From 20a754309e4818508bcf741f49b509d1f0db79ee Mon Sep 17 00:00:00 2001 From: public-api ci Date: Thu, 3 Nov 2022 20:28:49 +0000 Subject: [PATCH 001/474] Automated client deploy (from segmentio/public-api@03b85ab) --- api/openapi.yaml | 1218 +++++++++++++++++++++++----------------------- 1 file changed, 609 insertions(+), 609 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 4fd71354..0e795a49 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -22247,93 +22247,392 @@ components: - value title: AllowedLabelBeta type: object - AuditEventV1: - description: Represents an Audit Trail event. - example: - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - id: - description: Unique identifier for this audit trail event. - title: id - type: string - timestamp: - description: The timestamp of this event in ISO-8601 format. - title: timestamp - type: string - type: - description: The type of this event. - title: type - type: string - actor: - description: The user or API token that triggered this event. - title: actor - type: string - resourceId: - description: The identifier of the resource affected by this event. - title: resourceId - type: string - resourceType: - description: The kind of resource affected by this event. - title: resourceType - type: string - resourceName: - description: The name of the resource affected by this event. - title: resourceName - type: string - required: - - actor - - id - - resourceId - - resourceName - - resourceType - - timestamp - - type - title: AuditEventV1 - type: object - ListAuditEventsV1Input: - description: Retrieves all Audit Trail events for the current Workspace. + GetDestinationsCatalogV1Input: + description: Contains filter parameters used for loading the Destinations public + catalog. properties: {} - title: ListAuditEventsV1Input + required: + - pagination + title: GetDestinationsCatalogV1Input type: object - ListAuditEventsV1Output: - description: Returns a list of Audit Trail events for the current Workspace. + GetDestinationsCatalogV1Output: + description: Returns a list of all Destination catalog items contained within + a given page. example: pagination: null - events: - - actor: actor - resourceId: resourceId - resourceName: resourceName + destinationsCatalog: + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - type: type - timestamp: timestamp - resourceType: resourceType - - actor: actor - resourceId: resourceId - resourceName: resourceName + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - events: - description: Audit trail events for the current Workspace. - items: - $ref: '#/components/schemas/AuditEventV1' - title: events - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - events - title: ListAuditEventsV1Output - type: object - ListFiltersFromDestinationV1Input: + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + properties: + destinationsCatalog: + description: All Destination catalog items contained within the requested + page. + items: + $ref: '#/components/schemas/DestinationMetadataV1' + title: destinationsCatalog + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - destinationsCatalog + - pagination + title: GetDestinationsCatalogV1Output + type: object + GetDestinationMetadataV1Input: + description: Loads a Destination catalog item by id. + properties: {} + required: + - destinationMetadataId + title: GetDestinationMetadataV1Input + type: object + GetDestinationMetadataV1Output: + description: Returns a Destination catalog item. + example: + destinationMetadata: null + properties: + destinationMetadata: + $ref: '#/components/schemas/destinationMetadata' + required: + - destinationMetadata + title: GetDestinationMetadataV1Output + type: object + AuditEventV1: + description: Represents an Audit Trail event. + example: + actor: actor + resourceId: resourceId + resourceName: resourceName + id: id + type: type + timestamp: timestamp + resourceType: resourceType + properties: + id: + description: Unique identifier for this audit trail event. + title: id + type: string + timestamp: + description: The timestamp of this event in ISO-8601 format. + title: timestamp + type: string + type: + description: The type of this event. + title: type + type: string + actor: + description: The user or API token that triggered this event. + title: actor + type: string + resourceId: + description: The identifier of the resource affected by this event. + title: resourceId + type: string + resourceType: + description: The kind of resource affected by this event. + title: resourceType + type: string + resourceName: + description: The name of the resource affected by this event. + title: resourceName + type: string + required: + - actor + - id + - resourceId + - resourceName + - resourceType + - timestamp + - type + title: AuditEventV1 + type: object + ListAuditEventsV1Input: + description: Retrieves all Audit Trail events for the current Workspace. + properties: {} + title: ListAuditEventsV1Input + type: object + ListAuditEventsV1Output: + description: Returns a list of Audit Trail events for the current Workspace. + example: + pagination: null + events: + - actor: actor + resourceId: resourceId + resourceName: resourceName + id: id + type: type + timestamp: timestamp + resourceType: resourceType + - actor: actor + resourceId: resourceId + resourceName: resourceName + id: id + type: type + timestamp: timestamp + resourceType: resourceType + properties: + events: + description: Audit trail events for the current Workspace. + items: + $ref: '#/components/schemas/AuditEventV1' + title: events + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - events + title: ListAuditEventsV1Output + type: object + ListFiltersFromDestinationV1Input: description: Input for ListDestinationFiltersV1. properties: {} required: @@ -23075,539 +23374,240 @@ components: - "1" - NONE - SINGLE - title: deviceModeInstances - type: string - replay: - description: Whether this Destination supports replays. - title: replay - type: boolean - browserUnbundling: - description: Whether this Destination supports browser unbundling. - title: browserUnbundling - type: boolean - browserUnbundlingPublic: - description: Whether this Destination supports public browser unbundling. - title: browserUnbundlingPublic - type: boolean - title: DestinationMetadataFeaturesV1 - type: object - DestinationMetadataActionV1: - description: "Represents an Action, a building block of behavior that can be\ - \ performed by the Destination." - example: - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - properties: - id: - description: The primary key of the action. - title: id - type: string - slug: - description: A machine-readable key unique to the action definition. - title: slug - type: string - name: - description: A human-readable name for the action. - title: name - type: string - description: - description: A human-readable description of the action. May include Markdown. - title: description - type: string - platform: - description: The platform on which this action runs. - enum: - - CLOUD - - MOBILE - - WEB - title: platform - type: string - hidden: - description: Whether the action should be hidden. - title: hidden - type: boolean - defaultTrigger: - description: The default value used as the trigger when connecting this - action. - nullable: true - title: defaultTrigger - type: string - fields: - description: The fields expected in order to perform the action. - items: - $ref: '#/components/schemas/DestinationMetadataActionFieldV1' - title: fields - type: array - required: - - defaultTrigger - - description - - fields - - hidden - - id - - name - - platform - - slug - title: DestinationMetadataActionV1 - type: object - DestinationMetadataActionFieldV1: - description: Represents a field used in configuring an action. - example: - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - properties: - id: - description: The primary key of the field. - title: id - type: string - sortOrder: - description: The order this particular field is (used in the UI for displaying - the fields in a specified order). - title: sortOrder - type: number - fieldKey: - description: A unique machine-readable key for the field. Should ideally - match the expected key in the action\'s API request. - title: fieldKey - type: string - label: - description: A human-readable label for this value. - title: label - type: string - type: - description: The data type for this value. - enum: - - BOOLEAN - - DATETIME - - HIDDEN - - INTEGER - - NUMBER - - OBJECT - - PASSWORD - - STRING - - TEXT - title: type - type: string - description: - description: A human-readable description of this value. You can use Markdown. - title: description - type: string - placeholder: - description: An example value displayed but not saved. - title: placeholder - type: string - defaultValue: - description: A default value that is saved the first time an action is created. - title: defaultValue - required: - description: Whether this field is required. - title: required - type: boolean - multiple: - description: Whether a user can provide multiples of this field. - title: multiple - type: boolean - choices: - description: A list of machine-readable value/label pairs to populate a - static dropdown. - title: choices - dynamic: - description: "Whether this field should execute a dynamic request to fetch\ - \ choices to populate a dropdown. When true, `choices` is ignored." - title: dynamic - type: boolean - allowNull: - description: Whether this field allows null values. - title: allowNull - type: boolean - required: - - allowNull - - description - - dynamic - - fieldKey - - id - - label - - multiple - - required - - sortOrder - - type - title: DestinationMetadataActionFieldV1 - type: object - DestinationMetadataSubscriptionPresetV1: - description: Represents a set of defaults for a Destination subscription. - example: - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - properties: - actionId: - description: The unique identifier for the Destination Action to trigger. - title: actionId - type: string - name: - description: The name of the subscription. - title: name - type: string - fields: - additionalProperties: true - description: The default settings for action fields. - title: fields - type: object - trigger: - description: FQL string that describes what events should trigger an action. - See https://segment.com/docs/config-api/fql/ for more information regarding - Segment's Filter Query Language (FQL). - title: trigger - type: string - required: - - actionId - - fields - - name - - trigger - title: DestinationMetadataSubscriptionPresetV1 - type: object - GetDestinationsCatalogV1Input: - description: Contains filter parameters used for loading the Destinations public - catalog. - properties: {} - required: - - pagination - title: GetDestinationsCatalogV1Input - type: object - GetDestinationsCatalogV1Output: - description: Returns a list of all Destination catalog items contained within - a given page. - example: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED + title: deviceModeInstances + type: string + replay: + description: Whether this Destination supports replays. + title: replay + type: boolean + browserUnbundling: + description: Whether this Destination supports browser unbundling. + title: browserUnbundling + type: boolean + browserUnbundlingPublic: + description: Whether this Destination supports public browser unbundling. + title: browserUnbundlingPublic + type: boolean + title: DestinationMetadataFeaturesV1 + type: object + DestinationMetadataActionV1: + description: "Represents an Action, a building block of behavior that can be\ + \ performed by the Destination." + example: + defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD properties: - destinationsCatalog: - description: All Destination catalog items contained within the requested - page. + id: + description: The primary key of the action. + title: id + type: string + slug: + description: A machine-readable key unique to the action definition. + title: slug + type: string + name: + description: A human-readable name for the action. + title: name + type: string + description: + description: A human-readable description of the action. May include Markdown. + title: description + type: string + platform: + description: The platform on which this action runs. + enum: + - CLOUD + - MOBILE + - WEB + title: platform + type: string + hidden: + description: Whether the action should be hidden. + title: hidden + type: boolean + defaultTrigger: + description: The default value used as the trigger when connecting this + action. + nullable: true + title: defaultTrigger + type: string + fields: + description: The fields expected in order to perform the action. items: - $ref: '#/components/schemas/DestinationMetadataV1' - title: destinationsCatalog + $ref: '#/components/schemas/DestinationMetadataActionFieldV1' + title: fields type: array - pagination: - $ref: '#/components/schemas/pagination' required: - - destinationsCatalog - - pagination - title: GetDestinationsCatalogV1Output + - defaultTrigger + - description + - fields + - hidden + - id + - name + - platform + - slug + title: DestinationMetadataActionV1 type: object - GetDestinationMetadataV1Input: - description: Loads a Destination catalog item by id. - properties: {} + DestinationMetadataActionFieldV1: + description: Represents a field used in configuring an action. + example: + fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + properties: + id: + description: The primary key of the field. + title: id + type: string + sortOrder: + description: The order this particular field is (used in the UI for displaying + the fields in a specified order). + title: sortOrder + type: number + fieldKey: + description: A unique machine-readable key for the field. Should ideally + match the expected key in the action\'s API request. + title: fieldKey + type: string + label: + description: A human-readable label for this value. + title: label + type: string + type: + description: The data type for this value. + enum: + - BOOLEAN + - DATETIME + - HIDDEN + - INTEGER + - NUMBER + - OBJECT + - PASSWORD + - STRING + - TEXT + title: type + type: string + description: + description: A human-readable description of this value. You can use Markdown. + title: description + type: string + placeholder: + description: An example value displayed but not saved. + title: placeholder + type: string + defaultValue: + description: A default value that is saved the first time an action is created. + title: defaultValue + required: + description: Whether this field is required. + title: required + type: boolean + multiple: + description: Whether a user can provide multiples of this field. + title: multiple + type: boolean + choices: + description: A list of machine-readable value/label pairs to populate a + static dropdown. + title: choices + dynamic: + description: "Whether this field should execute a dynamic request to fetch\ + \ choices to populate a dropdown. When true, `choices` is ignored." + title: dynamic + type: boolean + allowNull: + description: Whether this field allows null values. + title: allowNull + type: boolean required: - - destinationMetadataId - title: GetDestinationMetadataV1Input + - allowNull + - description + - dynamic + - fieldKey + - id + - label + - multiple + - required + - sortOrder + - type + title: DestinationMetadataActionFieldV1 type: object - GetDestinationMetadataV1Output: - description: Returns a Destination catalog item. + DestinationMetadataSubscriptionPresetV1: + description: Represents a set of defaults for a Destination subscription. example: - destinationMetadata: null + name: name + actionId: actionId + trigger: trigger + fields: + key: "" properties: - destinationMetadata: - $ref: '#/components/schemas/destinationMetadata' + actionId: + description: The unique identifier for the Destination Action to trigger. + title: actionId + type: string + name: + description: The name of the subscription. + title: name + type: string + fields: + additionalProperties: true + description: The default settings for action fields. + title: fields + type: object + trigger: + description: FQL string that describes what events should trigger an action. + See https://segment.com/docs/config-api/fql/ for more information regarding + Segment's Filter Query Language (FQL). + title: trigger + type: string required: - - destinationMetadata - title: GetDestinationMetadataV1Output + - actionId + - fields + - name + - trigger + title: DestinationMetadataSubscriptionPresetV1 type: object DestinationSubscription: example: @@ -32786,6 +32786,11 @@ components: - $ref: '#/components/schemas/PaginationOutput' description: Information about the pagination of this response. title: pagination + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata filter: allOf: - $ref: '#/components/schemas/PreviewDestinationFilterV1' @@ -32829,11 +32834,6 @@ components: description: "Platforms from which the Destination receives events.\n\nConfig\ \ API note: equal to `platforms`." title: supportedPlatforms - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata subscription: allOf: - $ref: '#/components/schemas/DestinationSubscription' From 6c16f323eaeaeb8a54879315b62c494e7cab95f4 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Thu, 3 Nov 2022 20:36:39 +0000 Subject: [PATCH 002/474] Automated client deploy (from segmentio/public-api@bf5ea9f) --- api/openapi.yaml | 1014 +++++++++++++++++++++++----------------------- 1 file changed, 507 insertions(+), 507 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 0e795a49..4fd71354 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -22247,305 +22247,6 @@ components: - value title: AllowedLabelBeta type: object - GetDestinationsCatalogV1Input: - description: Contains filter parameters used for loading the Destinations public - catalog. - properties: {} - required: - - pagination - title: GetDestinationsCatalogV1Input - type: object - GetDestinationsCatalogV1Output: - description: Returns a list of all Destination catalog items contained within - a given page. - example: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - properties: - destinationsCatalog: - description: All Destination catalog items contained within the requested - page. - items: - $ref: '#/components/schemas/DestinationMetadataV1' - title: destinationsCatalog - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - destinationsCatalog - - pagination - title: GetDestinationsCatalogV1Output - type: object - GetDestinationMetadataV1Input: - description: Loads a Destination catalog item by id. - properties: {} - required: - - destinationMetadataId - title: GetDestinationMetadataV1Input - type: object - GetDestinationMetadataV1Output: - description: Returns a Destination catalog item. - example: - destinationMetadata: null - properties: - destinationMetadata: - $ref: '#/components/schemas/destinationMetadata' - required: - - destinationMetadata - title: GetDestinationMetadataV1Output - type: object AuditEventV1: description: Represents an Audit Trail event. example: @@ -23390,224 +23091,523 @@ components: type: boolean title: DestinationMetadataFeaturesV1 type: object - DestinationMetadataActionV1: - description: "Represents an Action, a building block of behavior that can be\ - \ performed by the Destination." + DestinationMetadataActionV1: + description: "Represents an Action, a building block of behavior that can be\ + \ performed by the Destination." + example: + defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + properties: + id: + description: The primary key of the action. + title: id + type: string + slug: + description: A machine-readable key unique to the action definition. + title: slug + type: string + name: + description: A human-readable name for the action. + title: name + type: string + description: + description: A human-readable description of the action. May include Markdown. + title: description + type: string + platform: + description: The platform on which this action runs. + enum: + - CLOUD + - MOBILE + - WEB + title: platform + type: string + hidden: + description: Whether the action should be hidden. + title: hidden + type: boolean + defaultTrigger: + description: The default value used as the trigger when connecting this + action. + nullable: true + title: defaultTrigger + type: string + fields: + description: The fields expected in order to perform the action. + items: + $ref: '#/components/schemas/DestinationMetadataActionFieldV1' + title: fields + type: array + required: + - defaultTrigger + - description + - fields + - hidden + - id + - name + - platform + - slug + title: DestinationMetadataActionV1 + type: object + DestinationMetadataActionFieldV1: + description: Represents a field used in configuring an action. + example: + fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + properties: + id: + description: The primary key of the field. + title: id + type: string + sortOrder: + description: The order this particular field is (used in the UI for displaying + the fields in a specified order). + title: sortOrder + type: number + fieldKey: + description: A unique machine-readable key for the field. Should ideally + match the expected key in the action\'s API request. + title: fieldKey + type: string + label: + description: A human-readable label for this value. + title: label + type: string + type: + description: The data type for this value. + enum: + - BOOLEAN + - DATETIME + - HIDDEN + - INTEGER + - NUMBER + - OBJECT + - PASSWORD + - STRING + - TEXT + title: type + type: string + description: + description: A human-readable description of this value. You can use Markdown. + title: description + type: string + placeholder: + description: An example value displayed but not saved. + title: placeholder + type: string + defaultValue: + description: A default value that is saved the first time an action is created. + title: defaultValue + required: + description: Whether this field is required. + title: required + type: boolean + multiple: + description: Whether a user can provide multiples of this field. + title: multiple + type: boolean + choices: + description: A list of machine-readable value/label pairs to populate a + static dropdown. + title: choices + dynamic: + description: "Whether this field should execute a dynamic request to fetch\ + \ choices to populate a dropdown. When true, `choices` is ignored." + title: dynamic + type: boolean + allowNull: + description: Whether this field allows null values. + title: allowNull + type: boolean + required: + - allowNull + - description + - dynamic + - fieldKey + - id + - label + - multiple + - required + - sortOrder + - type + title: DestinationMetadataActionFieldV1 + type: object + DestinationMetadataSubscriptionPresetV1: + description: Represents a set of defaults for a Destination subscription. + example: + name: name + actionId: actionId + trigger: trigger + fields: + key: "" + properties: + actionId: + description: The unique identifier for the Destination Action to trigger. + title: actionId + type: string + name: + description: The name of the subscription. + title: name + type: string + fields: + additionalProperties: true + description: The default settings for action fields. + title: fields + type: object + trigger: + description: FQL string that describes what events should trigger an action. + See https://segment.com/docs/config-api/fql/ for more information regarding + Segment's Filter Query Language (FQL). + title: trigger + type: string + required: + - actionId + - fields + - name + - trigger + title: DestinationMetadataSubscriptionPresetV1 + type: object + GetDestinationsCatalogV1Input: + description: Contains filter parameters used for loading the Destinations public + catalog. + properties: {} + required: + - pagination + title: GetDestinationsCatalogV1Input + type: object + GetDestinationsCatalogV1Output: + description: Returns a list of all Destination catalog items contained within + a given page. example: - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true + pagination: null + destinationsCatalog: + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED properties: - id: - description: The primary key of the action. - title: id - type: string - slug: - description: A machine-readable key unique to the action definition. - title: slug - type: string - name: - description: A human-readable name for the action. - title: name - type: string - description: - description: A human-readable description of the action. May include Markdown. - title: description - type: string - platform: - description: The platform on which this action runs. - enum: - - CLOUD - - MOBILE - - WEB - title: platform - type: string - hidden: - description: Whether the action should be hidden. - title: hidden - type: boolean - defaultTrigger: - description: The default value used as the trigger when connecting this - action. - nullable: true - title: defaultTrigger - type: string - fields: - description: The fields expected in order to perform the action. + destinationsCatalog: + description: All Destination catalog items contained within the requested + page. items: - $ref: '#/components/schemas/DestinationMetadataActionFieldV1' - title: fields + $ref: '#/components/schemas/DestinationMetadataV1' + title: destinationsCatalog type: array + pagination: + $ref: '#/components/schemas/pagination' required: - - defaultTrigger - - description - - fields - - hidden - - id - - name - - platform - - slug - title: DestinationMetadataActionV1 + - destinationsCatalog + - pagination + title: GetDestinationsCatalogV1Output type: object - DestinationMetadataActionFieldV1: - description: Represents a field used in configuring an action. - example: - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - properties: - id: - description: The primary key of the field. - title: id - type: string - sortOrder: - description: The order this particular field is (used in the UI for displaying - the fields in a specified order). - title: sortOrder - type: number - fieldKey: - description: A unique machine-readable key for the field. Should ideally - match the expected key in the action\'s API request. - title: fieldKey - type: string - label: - description: A human-readable label for this value. - title: label - type: string - type: - description: The data type for this value. - enum: - - BOOLEAN - - DATETIME - - HIDDEN - - INTEGER - - NUMBER - - OBJECT - - PASSWORD - - STRING - - TEXT - title: type - type: string - description: - description: A human-readable description of this value. You can use Markdown. - title: description - type: string - placeholder: - description: An example value displayed but not saved. - title: placeholder - type: string - defaultValue: - description: A default value that is saved the first time an action is created. - title: defaultValue - required: - description: Whether this field is required. - title: required - type: boolean - multiple: - description: Whether a user can provide multiples of this field. - title: multiple - type: boolean - choices: - description: A list of machine-readable value/label pairs to populate a - static dropdown. - title: choices - dynamic: - description: "Whether this field should execute a dynamic request to fetch\ - \ choices to populate a dropdown. When true, `choices` is ignored." - title: dynamic - type: boolean - allowNull: - description: Whether this field allows null values. - title: allowNull - type: boolean + GetDestinationMetadataV1Input: + description: Loads a Destination catalog item by id. + properties: {} required: - - allowNull - - description - - dynamic - - fieldKey - - id - - label - - multiple - - required - - sortOrder - - type - title: DestinationMetadataActionFieldV1 + - destinationMetadataId + title: GetDestinationMetadataV1Input type: object - DestinationMetadataSubscriptionPresetV1: - description: Represents a set of defaults for a Destination subscription. + GetDestinationMetadataV1Output: + description: Returns a Destination catalog item. example: - name: name - actionId: actionId - trigger: trigger - fields: - key: "" + destinationMetadata: null properties: - actionId: - description: The unique identifier for the Destination Action to trigger. - title: actionId - type: string - name: - description: The name of the subscription. - title: name - type: string - fields: - additionalProperties: true - description: The default settings for action fields. - title: fields - type: object - trigger: - description: FQL string that describes what events should trigger an action. - See https://segment.com/docs/config-api/fql/ for more information regarding - Segment's Filter Query Language (FQL). - title: trigger - type: string + destinationMetadata: + $ref: '#/components/schemas/destinationMetadata' required: - - actionId - - fields - - name - - trigger - title: DestinationMetadataSubscriptionPresetV1 + - destinationMetadata + title: GetDestinationMetadataV1Output type: object DestinationSubscription: example: @@ -32786,11 +32786,6 @@ components: - $ref: '#/components/schemas/PaginationOutput' description: Information about the pagination of this response. title: pagination - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata filter: allOf: - $ref: '#/components/schemas/PreviewDestinationFilterV1' @@ -32834,6 +32829,11 @@ components: description: "Platforms from which the Destination receives events.\n\nConfig\ \ API note: equal to `platforms`." title: supportedPlatforms + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata subscription: allOf: - $ref: '#/components/schemas/DestinationSubscription' From 900e8745975eb0b65f04a40486b6783a58f4cec9 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Thu, 3 Nov 2022 21:30:07 +0000 Subject: [PATCH 003/474] Automated client deploy (from segmentio/public-api@7787748) --- api/openapi.yaml | 1218 +++++++++++++++++++++++----------------------- 1 file changed, 609 insertions(+), 609 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 4fd71354..0e795a49 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -22247,93 +22247,392 @@ components: - value title: AllowedLabelBeta type: object - AuditEventV1: - description: Represents an Audit Trail event. - example: - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - id: - description: Unique identifier for this audit trail event. - title: id - type: string - timestamp: - description: The timestamp of this event in ISO-8601 format. - title: timestamp - type: string - type: - description: The type of this event. - title: type - type: string - actor: - description: The user or API token that triggered this event. - title: actor - type: string - resourceId: - description: The identifier of the resource affected by this event. - title: resourceId - type: string - resourceType: - description: The kind of resource affected by this event. - title: resourceType - type: string - resourceName: - description: The name of the resource affected by this event. - title: resourceName - type: string - required: - - actor - - id - - resourceId - - resourceName - - resourceType - - timestamp - - type - title: AuditEventV1 - type: object - ListAuditEventsV1Input: - description: Retrieves all Audit Trail events for the current Workspace. + GetDestinationsCatalogV1Input: + description: Contains filter parameters used for loading the Destinations public + catalog. properties: {} - title: ListAuditEventsV1Input + required: + - pagination + title: GetDestinationsCatalogV1Input type: object - ListAuditEventsV1Output: - description: Returns a list of Audit Trail events for the current Workspace. + GetDestinationsCatalogV1Output: + description: Returns a list of all Destination catalog items contained within + a given page. example: pagination: null - events: - - actor: actor - resourceId: resourceId - resourceName: resourceName + destinationsCatalog: + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - type: type - timestamp: timestamp - resourceType: resourceType - - actor: actor - resourceId: resourceId - resourceName: resourceName + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - events: - description: Audit trail events for the current Workspace. - items: - $ref: '#/components/schemas/AuditEventV1' - title: events - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - events - title: ListAuditEventsV1Output - type: object - ListFiltersFromDestinationV1Input: + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + properties: + destinationsCatalog: + description: All Destination catalog items contained within the requested + page. + items: + $ref: '#/components/schemas/DestinationMetadataV1' + title: destinationsCatalog + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - destinationsCatalog + - pagination + title: GetDestinationsCatalogV1Output + type: object + GetDestinationMetadataV1Input: + description: Loads a Destination catalog item by id. + properties: {} + required: + - destinationMetadataId + title: GetDestinationMetadataV1Input + type: object + GetDestinationMetadataV1Output: + description: Returns a Destination catalog item. + example: + destinationMetadata: null + properties: + destinationMetadata: + $ref: '#/components/schemas/destinationMetadata' + required: + - destinationMetadata + title: GetDestinationMetadataV1Output + type: object + AuditEventV1: + description: Represents an Audit Trail event. + example: + actor: actor + resourceId: resourceId + resourceName: resourceName + id: id + type: type + timestamp: timestamp + resourceType: resourceType + properties: + id: + description: Unique identifier for this audit trail event. + title: id + type: string + timestamp: + description: The timestamp of this event in ISO-8601 format. + title: timestamp + type: string + type: + description: The type of this event. + title: type + type: string + actor: + description: The user or API token that triggered this event. + title: actor + type: string + resourceId: + description: The identifier of the resource affected by this event. + title: resourceId + type: string + resourceType: + description: The kind of resource affected by this event. + title: resourceType + type: string + resourceName: + description: The name of the resource affected by this event. + title: resourceName + type: string + required: + - actor + - id + - resourceId + - resourceName + - resourceType + - timestamp + - type + title: AuditEventV1 + type: object + ListAuditEventsV1Input: + description: Retrieves all Audit Trail events for the current Workspace. + properties: {} + title: ListAuditEventsV1Input + type: object + ListAuditEventsV1Output: + description: Returns a list of Audit Trail events for the current Workspace. + example: + pagination: null + events: + - actor: actor + resourceId: resourceId + resourceName: resourceName + id: id + type: type + timestamp: timestamp + resourceType: resourceType + - actor: actor + resourceId: resourceId + resourceName: resourceName + id: id + type: type + timestamp: timestamp + resourceType: resourceType + properties: + events: + description: Audit trail events for the current Workspace. + items: + $ref: '#/components/schemas/AuditEventV1' + title: events + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - events + title: ListAuditEventsV1Output + type: object + ListFiltersFromDestinationV1Input: description: Input for ListDestinationFiltersV1. properties: {} required: @@ -23075,539 +23374,240 @@ components: - "1" - NONE - SINGLE - title: deviceModeInstances - type: string - replay: - description: Whether this Destination supports replays. - title: replay - type: boolean - browserUnbundling: - description: Whether this Destination supports browser unbundling. - title: browserUnbundling - type: boolean - browserUnbundlingPublic: - description: Whether this Destination supports public browser unbundling. - title: browserUnbundlingPublic - type: boolean - title: DestinationMetadataFeaturesV1 - type: object - DestinationMetadataActionV1: - description: "Represents an Action, a building block of behavior that can be\ - \ performed by the Destination." - example: - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - properties: - id: - description: The primary key of the action. - title: id - type: string - slug: - description: A machine-readable key unique to the action definition. - title: slug - type: string - name: - description: A human-readable name for the action. - title: name - type: string - description: - description: A human-readable description of the action. May include Markdown. - title: description - type: string - platform: - description: The platform on which this action runs. - enum: - - CLOUD - - MOBILE - - WEB - title: platform - type: string - hidden: - description: Whether the action should be hidden. - title: hidden - type: boolean - defaultTrigger: - description: The default value used as the trigger when connecting this - action. - nullable: true - title: defaultTrigger - type: string - fields: - description: The fields expected in order to perform the action. - items: - $ref: '#/components/schemas/DestinationMetadataActionFieldV1' - title: fields - type: array - required: - - defaultTrigger - - description - - fields - - hidden - - id - - name - - platform - - slug - title: DestinationMetadataActionV1 - type: object - DestinationMetadataActionFieldV1: - description: Represents a field used in configuring an action. - example: - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - properties: - id: - description: The primary key of the field. - title: id - type: string - sortOrder: - description: The order this particular field is (used in the UI for displaying - the fields in a specified order). - title: sortOrder - type: number - fieldKey: - description: A unique machine-readable key for the field. Should ideally - match the expected key in the action\'s API request. - title: fieldKey - type: string - label: - description: A human-readable label for this value. - title: label - type: string - type: - description: The data type for this value. - enum: - - BOOLEAN - - DATETIME - - HIDDEN - - INTEGER - - NUMBER - - OBJECT - - PASSWORD - - STRING - - TEXT - title: type - type: string - description: - description: A human-readable description of this value. You can use Markdown. - title: description - type: string - placeholder: - description: An example value displayed but not saved. - title: placeholder - type: string - defaultValue: - description: A default value that is saved the first time an action is created. - title: defaultValue - required: - description: Whether this field is required. - title: required - type: boolean - multiple: - description: Whether a user can provide multiples of this field. - title: multiple - type: boolean - choices: - description: A list of machine-readable value/label pairs to populate a - static dropdown. - title: choices - dynamic: - description: "Whether this field should execute a dynamic request to fetch\ - \ choices to populate a dropdown. When true, `choices` is ignored." - title: dynamic - type: boolean - allowNull: - description: Whether this field allows null values. - title: allowNull - type: boolean - required: - - allowNull - - description - - dynamic - - fieldKey - - id - - label - - multiple - - required - - sortOrder - - type - title: DestinationMetadataActionFieldV1 - type: object - DestinationMetadataSubscriptionPresetV1: - description: Represents a set of defaults for a Destination subscription. - example: - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - properties: - actionId: - description: The unique identifier for the Destination Action to trigger. - title: actionId - type: string - name: - description: The name of the subscription. - title: name - type: string - fields: - additionalProperties: true - description: The default settings for action fields. - title: fields - type: object - trigger: - description: FQL string that describes what events should trigger an action. - See https://segment.com/docs/config-api/fql/ for more information regarding - Segment's Filter Query Language (FQL). - title: trigger - type: string - required: - - actionId - - fields - - name - - trigger - title: DestinationMetadataSubscriptionPresetV1 - type: object - GetDestinationsCatalogV1Input: - description: Contains filter parameters used for loading the Destinations public - catalog. - properties: {} - required: - - pagination - title: GetDestinationsCatalogV1Input - type: object - GetDestinationsCatalogV1Output: - description: Returns a list of all Destination catalog items contained within - a given page. - example: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED + title: deviceModeInstances + type: string + replay: + description: Whether this Destination supports replays. + title: replay + type: boolean + browserUnbundling: + description: Whether this Destination supports browser unbundling. + title: browserUnbundling + type: boolean + browserUnbundlingPublic: + description: Whether this Destination supports public browser unbundling. + title: browserUnbundlingPublic + type: boolean + title: DestinationMetadataFeaturesV1 + type: object + DestinationMetadataActionV1: + description: "Represents an Action, a building block of behavior that can be\ + \ performed by the Destination." + example: + defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD properties: - destinationsCatalog: - description: All Destination catalog items contained within the requested - page. + id: + description: The primary key of the action. + title: id + type: string + slug: + description: A machine-readable key unique to the action definition. + title: slug + type: string + name: + description: A human-readable name for the action. + title: name + type: string + description: + description: A human-readable description of the action. May include Markdown. + title: description + type: string + platform: + description: The platform on which this action runs. + enum: + - CLOUD + - MOBILE + - WEB + title: platform + type: string + hidden: + description: Whether the action should be hidden. + title: hidden + type: boolean + defaultTrigger: + description: The default value used as the trigger when connecting this + action. + nullable: true + title: defaultTrigger + type: string + fields: + description: The fields expected in order to perform the action. items: - $ref: '#/components/schemas/DestinationMetadataV1' - title: destinationsCatalog + $ref: '#/components/schemas/DestinationMetadataActionFieldV1' + title: fields type: array - pagination: - $ref: '#/components/schemas/pagination' required: - - destinationsCatalog - - pagination - title: GetDestinationsCatalogV1Output + - defaultTrigger + - description + - fields + - hidden + - id + - name + - platform + - slug + title: DestinationMetadataActionV1 type: object - GetDestinationMetadataV1Input: - description: Loads a Destination catalog item by id. - properties: {} + DestinationMetadataActionFieldV1: + description: Represents a field used in configuring an action. + example: + fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + properties: + id: + description: The primary key of the field. + title: id + type: string + sortOrder: + description: The order this particular field is (used in the UI for displaying + the fields in a specified order). + title: sortOrder + type: number + fieldKey: + description: A unique machine-readable key for the field. Should ideally + match the expected key in the action\'s API request. + title: fieldKey + type: string + label: + description: A human-readable label for this value. + title: label + type: string + type: + description: The data type for this value. + enum: + - BOOLEAN + - DATETIME + - HIDDEN + - INTEGER + - NUMBER + - OBJECT + - PASSWORD + - STRING + - TEXT + title: type + type: string + description: + description: A human-readable description of this value. You can use Markdown. + title: description + type: string + placeholder: + description: An example value displayed but not saved. + title: placeholder + type: string + defaultValue: + description: A default value that is saved the first time an action is created. + title: defaultValue + required: + description: Whether this field is required. + title: required + type: boolean + multiple: + description: Whether a user can provide multiples of this field. + title: multiple + type: boolean + choices: + description: A list of machine-readable value/label pairs to populate a + static dropdown. + title: choices + dynamic: + description: "Whether this field should execute a dynamic request to fetch\ + \ choices to populate a dropdown. When true, `choices` is ignored." + title: dynamic + type: boolean + allowNull: + description: Whether this field allows null values. + title: allowNull + type: boolean required: - - destinationMetadataId - title: GetDestinationMetadataV1Input + - allowNull + - description + - dynamic + - fieldKey + - id + - label + - multiple + - required + - sortOrder + - type + title: DestinationMetadataActionFieldV1 type: object - GetDestinationMetadataV1Output: - description: Returns a Destination catalog item. + DestinationMetadataSubscriptionPresetV1: + description: Represents a set of defaults for a Destination subscription. example: - destinationMetadata: null + name: name + actionId: actionId + trigger: trigger + fields: + key: "" properties: - destinationMetadata: - $ref: '#/components/schemas/destinationMetadata' + actionId: + description: The unique identifier for the Destination Action to trigger. + title: actionId + type: string + name: + description: The name of the subscription. + title: name + type: string + fields: + additionalProperties: true + description: The default settings for action fields. + title: fields + type: object + trigger: + description: FQL string that describes what events should trigger an action. + See https://segment.com/docs/config-api/fql/ for more information regarding + Segment's Filter Query Language (FQL). + title: trigger + type: string required: - - destinationMetadata - title: GetDestinationMetadataV1Output + - actionId + - fields + - name + - trigger + title: DestinationMetadataSubscriptionPresetV1 type: object DestinationSubscription: example: @@ -32786,6 +32786,11 @@ components: - $ref: '#/components/schemas/PaginationOutput' description: Information about the pagination of this response. title: pagination + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata filter: allOf: - $ref: '#/components/schemas/PreviewDestinationFilterV1' @@ -32829,11 +32834,6 @@ components: description: "Platforms from which the Destination receives events.\n\nConfig\ \ API note: equal to `platforms`." title: supportedPlatforms - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata subscription: allOf: - $ref: '#/components/schemas/DestinationSubscription' From 7882e9eee42c74bc9a7b6de70ebf3b4d8f270f3d Mon Sep 17 00:00:00 2001 From: public-api ci Date: Fri, 4 Nov 2022 21:14:37 +0000 Subject: [PATCH 004/474] Automated client deploy (from segmentio/public-api@f95fb61) --- api/openapi.yaml | 962 +++++++++++++++++++++++------------------------ 1 file changed, 481 insertions(+), 481 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 0e795a49..80f12800 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -22247,305 +22247,6 @@ components: - value title: AllowedLabelBeta type: object - GetDestinationsCatalogV1Input: - description: Contains filter parameters used for loading the Destinations public - catalog. - properties: {} - required: - - pagination - title: GetDestinationsCatalogV1Input - type: object - GetDestinationsCatalogV1Output: - description: Returns a list of all Destination catalog items contained within - a given page. - example: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - properties: - destinationsCatalog: - description: All Destination catalog items contained within the requested - page. - items: - $ref: '#/components/schemas/DestinationMetadataV1' - title: destinationsCatalog - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - destinationsCatalog - - pagination - title: GetDestinationsCatalogV1Output - type: object - GetDestinationMetadataV1Input: - description: Loads a Destination catalog item by id. - properties: {} - required: - - destinationMetadataId - title: GetDestinationMetadataV1Input - type: object - GetDestinationMetadataV1Output: - description: Returns a Destination catalog item. - example: - destinationMetadata: null - properties: - destinationMetadata: - $ref: '#/components/schemas/destinationMetadata' - required: - - destinationMetadata - title: GetDestinationMetadataV1Output - type: object AuditEventV1: description: Represents an Audit Trail event. example: @@ -23620,25 +23321,167 @@ components: destinationId: destinationId enabled: true properties: - id: - description: The unique identifier for the subscription. - title: id - type: string + id: + description: The unique identifier for the subscription. + title: id + type: string + name: + description: The name of the subscription. + title: name + type: string + actionId: + description: The unique identifier for the Destination action to trigger. + title: actionId + type: string + actionSlug: + description: The URL-friendly key for the associated Destination action. + title: actionSlug + type: string + destinationId: + description: The associated Destination instance id. + title: destinationId + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The customer settings for action fields. + title: settings + trigger: + description: FQL string that describes what events should trigger a Destination + action. + title: trigger + type: string + required: + - actionId + - actionSlug + - destinationId + - enabled + - id + - name + - settings + - trigger + title: DestinationSubscription + type: object + DestinationSubscriptionFields: + additionalProperties: {} + description: Represents settings used to configure an action subscription. + title: DestinationSubscriptionFields + type: object + ListSubscriptionsFromDestinationAlphaInput: + description: Input for ListDestinationSubscriptionsAlpha. + properties: {} + required: + - destinationId + title: ListSubscriptionsFromDestinationAlphaInput + type: object + ListSubscriptionsFromDestinationAlphaOutput: + description: Output for ListDestinationSubscriptionsAlpha. + example: + subscriptions: + - actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + - actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + pagination: null + properties: + subscriptions: + description: A list of Destination subscriptions. + items: + $ref: '#/components/schemas/DestinationSubscription' + title: subscriptions + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - subscriptions + title: ListSubscriptionsFromDestinationAlphaOutput + type: object + GetSubscriptionFromDestinationAlphaInput: + description: Fetches a Destination subscription. + properties: {} + required: + - destinationId + title: GetSubscriptionFromDestinationAlphaInput + type: object + GetSubscriptionFromDestinationAlphaOutput: + description: Returns a subscription for a given subscription id. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: GetSubscriptionFromDestinationAlphaOutput + type: object + CreateDestinationSubscriptionAlphaInput: + description: The basic input parameters for creating a Destination subscription. + properties: + name: + description: A user-defined name for the subscription. + title: name + type: string + actionId: + description: The associated action id the subscription should trigger. + title: actionId + type: string + trigger: + description: The FQL statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + required: + - actionId + - enabled + - name + - trigger + title: CreateDestinationSubscriptionAlphaInput + type: object + CreateDestinationSubscriptionAlphaOutput: + description: Returns a newly created Destination subscription. + example: + destinationSubscription: null + properties: + destinationSubscription: + $ref: '#/components/schemas/destinationSubscription' + required: + - destinationSubscription + title: CreateDestinationSubscriptionAlphaOutput + type: object + DestinationSubscriptionUpdateInput: + description: The input parameters for updating a Destination subscription. + properties: name: - description: The name of the subscription. + description: The user-defined name for the subscription. title: name type: string - actionId: - description: The unique identifier for the Destination action to trigger. - title: actionId - type: string - actionSlug: - description: The URL-friendly key for the associated Destination action. - title: actionSlug - type: string - destinationId: - description: The associated Destination instance id. - title: destinationId + trigger: + description: The fql statement. + title: trigger type: string enabled: description: Is the subscription enabled. @@ -23647,194 +23490,351 @@ components: settings: allOf: - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The customer settings for action fields. + description: The fields used for configuring this action. title: settings - trigger: - description: FQL string that describes what events should trigger a Destination - action. - title: trigger - type: string + title: DestinationSubscriptionUpdateInput + type: object + UpdateSubscriptionForDestinationAlphaInput: + description: The basic input parameters for updating a Destination subscription. + properties: + input: + $ref: '#/components/schemas/input' required: - - actionId - - actionSlug - destinationId - - enabled - - id - - name - - settings - - trigger - title: DestinationSubscription + - input + title: UpdateSubscriptionForDestinationAlphaInput type: object - DestinationSubscriptionFields: - additionalProperties: {} - description: Represents settings used to configure an action subscription. - title: DestinationSubscriptionFields + UpdateSubscriptionForDestinationAlphaOutput: + description: Returns the updated Destination subscription. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: UpdateSubscriptionForDestinationAlphaOutput type: object - ListSubscriptionsFromDestinationAlphaInput: - description: Input for ListDestinationSubscriptionsAlpha. + RemoveSubscriptionFromDestinationAlphaInput: + description: Deletes a Destination by id. properties: {} required: - destinationId - title: ListSubscriptionsFromDestinationAlphaInput + title: RemoveSubscriptionFromDestinationAlphaInput type: object - ListSubscriptionsFromDestinationAlphaOutput: - description: Output for ListDestinationSubscriptionsAlpha. + RemoveSubscriptionFromDestinationAlphaOutput: + description: Returns a Destination deletion flag. example: - subscriptions: - - actionSlug: actionSlug - settings: "" + status: SUCCESS + properties: + status: + description: The status of the operation. + enum: + - SUCCESS + title: status + type: string + required: + - status + title: RemoveSubscriptionFromDestinationAlphaOutput + type: object + GetDestinationsCatalogV1Input: + description: Contains filter parameters used for loading the Destinations public + catalog. + properties: {} + required: + - pagination + title: GetDestinationsCatalogV1Input + type: object + GetDestinationsCatalogV1Output: + description: Returns a list of all Destination catalog items contained within + a given page. + example: + pagination: null + destinationsCatalog: + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames name: name - actionId: actionId + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - trigger: trigger - destinationId: destinationId - enabled: true - - actionSlug: actionSlug - settings: "" + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames name: name - actionId: actionId + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true id: id - trigger: trigger - destinationId: destinationId - enabled: true - pagination: null + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED properties: - subscriptions: - description: A list of Destination subscriptions. + destinationsCatalog: + description: All Destination catalog items contained within the requested + page. items: - $ref: '#/components/schemas/DestinationSubscription' - title: subscriptions + $ref: '#/components/schemas/DestinationMetadataV1' + title: destinationsCatalog type: array pagination: $ref: '#/components/schemas/pagination' required: - - subscriptions - title: ListSubscriptionsFromDestinationAlphaOutput - type: object - GetSubscriptionFromDestinationAlphaInput: - description: Fetches a Destination subscription. - properties: {} - required: - - destinationId - title: GetSubscriptionFromDestinationAlphaInput - type: object - GetSubscriptionFromDestinationAlphaOutput: - description: Returns a subscription for a given subscription id. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: GetSubscriptionFromDestinationAlphaOutput - type: object - CreateDestinationSubscriptionAlphaInput: - description: The basic input parameters for creating a Destination subscription. - properties: - name: - description: A user-defined name for the subscription. - title: name - type: string - actionId: - description: The associated action id the subscription should trigger. - title: actionId - type: string - trigger: - description: The FQL statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - required: - - actionId - - enabled - - name - - trigger - title: CreateDestinationSubscriptionAlphaInput - type: object - CreateDestinationSubscriptionAlphaOutput: - description: Returns a newly created Destination subscription. - example: - destinationSubscription: null - properties: - destinationSubscription: - $ref: '#/components/schemas/destinationSubscription' - required: - - destinationSubscription - title: CreateDestinationSubscriptionAlphaOutput - type: object - DestinationSubscriptionUpdateInput: - description: The input parameters for updating a Destination subscription. - properties: - name: - description: The user-defined name for the subscription. - title: name - type: string - trigger: - description: The fql statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - title: DestinationSubscriptionUpdateInput - type: object - UpdateSubscriptionForDestinationAlphaInput: - description: The basic input parameters for updating a Destination subscription. - properties: - input: - $ref: '#/components/schemas/input' - required: - - destinationId - - input - title: UpdateSubscriptionForDestinationAlphaInput - type: object - UpdateSubscriptionForDestinationAlphaOutput: - description: Returns the updated Destination subscription. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: UpdateSubscriptionForDestinationAlphaOutput + - destinationsCatalog + - pagination + title: GetDestinationsCatalogV1Output type: object - RemoveSubscriptionFromDestinationAlphaInput: - description: Deletes a Destination by id. + GetDestinationMetadataV1Input: + description: Loads a Destination catalog item by id. properties: {} required: - - destinationId - title: RemoveSubscriptionFromDestinationAlphaInput + - destinationMetadataId + title: GetDestinationMetadataV1Input type: object - RemoveSubscriptionFromDestinationAlphaOutput: - description: Returns a Destination deletion flag. + GetDestinationMetadataV1Output: + description: Returns a Destination catalog item. example: - status: SUCCESS + destinationMetadata: null properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string + destinationMetadata: + $ref: '#/components/schemas/destinationMetadata' required: - - status - title: RemoveSubscriptionFromDestinationAlphaOutput + - destinationMetadata + title: GetDestinationMetadataV1Output type: object ListDeliveryMetricsSummaryFromDestinationBetaInput: description: Input to retrieve event delivery metrics summary for a Destination. @@ -32786,11 +32786,6 @@ components: - $ref: '#/components/schemas/PaginationOutput' description: Information about the pagination of this response. title: pagination - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata filter: allOf: - $ref: '#/components/schemas/PreviewDestinationFilterV1' @@ -32849,6 +32844,11 @@ components: - $ref: '#/components/schemas/DestinationSubscriptionUpdateInput' description: A set of valid Destination input params required for updating. title: input + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata deliveryMetricsSummary: allOf: - $ref: '#/components/schemas/DeliveryMetricsSummaryBeta' From 9e6671b1fa384b3f19b99c8778c7857a46c2cac0 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Mon, 7 Nov 2022 22:27:07 +0000 Subject: [PATCH 005/474] Automated client deploy (from segmentio/public-api@f2660e2) --- README.md | 45 +- api/openapi.yaml | 552 ++++++++++-------- src/main/java/com/segment/publicapi/JSON.java | 1 + .../models/CreateTransformationBetaInput.java | 52 +- .../PropertyValueTransformationBeta.java | 260 +++++++++ .../publicapi/models/Transformation.java | 52 +- .../publicapi/models/Transformation1.java | 52 +- .../publicapi/models/Transformation2.java | 52 +- .../publicapi/models/TransformationBeta.java | 52 +- .../models/UpdateTransformationBetaInput.java | 52 +- 10 files changed, 917 insertions(+), 253 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java diff --git a/README.md b/README.md index 3159e646..a58ec255 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# segment-publicapi +# Java API client for Segment Public API + +## Overview +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. + Segment Public API - API version: 32.0.2 @@ -90,7 +94,9 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.ApiCallsApi; +import com.segment.publicapi.api.SourcesApi; +import com.segment.publicapi.api.WorkspacesApi; +import java.math.BigDecimal; public class Example { public static void main(String[] args) { @@ -104,15 +110,36 @@ public class Example { ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in alpha. PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in alpha. + + // Make an API call without Pagination + try { + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + GetWorkspace200Response workspaceResponse = apiInstance.getWorkspace(); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#getWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + + // Make an API call with Pagination try { - GetDailyPerSourceAPICallsUsage200Response result = apiInstance.getDailyPerSourceAPICallsUsage(period, pagination); - System.out.println(result); + SourcesApi sourceApiInstance = new SourcesApi(defaultClient); + PaginationInput paginationInput = new PaginationInput(); + paginationInput.count(BigDecimal.valueOf(20)); + String current = null; + do { + paginationInput.setCursor(current); + ListSources200Response sourcesResponse = sourceApiInstance.listSources(paginationInput); + current = sourcesResponse.getData().getPagination().getNext(); + } while(current != null); } catch (ApiException e) { - System.err.println("Exception when calling ApiCallsApi#getDailyPerSourceAPICallsUsage"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + System.err.println("Exception when calling SourcesApi#sourceApiInstance"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } diff --git a/api/openapi.yaml b/api/openapi.yaml index 80f12800..f1f36e7b 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -23310,233 +23310,6 @@ components: - trigger title: DestinationMetadataSubscriptionPresetV1 type: object - DestinationSubscription: - example: - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - properties: - id: - description: The unique identifier for the subscription. - title: id - type: string - name: - description: The name of the subscription. - title: name - type: string - actionId: - description: The unique identifier for the Destination action to trigger. - title: actionId - type: string - actionSlug: - description: The URL-friendly key for the associated Destination action. - title: actionSlug - type: string - destinationId: - description: The associated Destination instance id. - title: destinationId - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The customer settings for action fields. - title: settings - trigger: - description: FQL string that describes what events should trigger a Destination - action. - title: trigger - type: string - required: - - actionId - - actionSlug - - destinationId - - enabled - - id - - name - - settings - - trigger - title: DestinationSubscription - type: object - DestinationSubscriptionFields: - additionalProperties: {} - description: Represents settings used to configure an action subscription. - title: DestinationSubscriptionFields - type: object - ListSubscriptionsFromDestinationAlphaInput: - description: Input for ListDestinationSubscriptionsAlpha. - properties: {} - required: - - destinationId - title: ListSubscriptionsFromDestinationAlphaInput - type: object - ListSubscriptionsFromDestinationAlphaOutput: - description: Output for ListDestinationSubscriptionsAlpha. - example: - subscriptions: - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - pagination: null - properties: - subscriptions: - description: A list of Destination subscriptions. - items: - $ref: '#/components/schemas/DestinationSubscription' - title: subscriptions - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - subscriptions - title: ListSubscriptionsFromDestinationAlphaOutput - type: object - GetSubscriptionFromDestinationAlphaInput: - description: Fetches a Destination subscription. - properties: {} - required: - - destinationId - title: GetSubscriptionFromDestinationAlphaInput - type: object - GetSubscriptionFromDestinationAlphaOutput: - description: Returns a subscription for a given subscription id. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: GetSubscriptionFromDestinationAlphaOutput - type: object - CreateDestinationSubscriptionAlphaInput: - description: The basic input parameters for creating a Destination subscription. - properties: - name: - description: A user-defined name for the subscription. - title: name - type: string - actionId: - description: The associated action id the subscription should trigger. - title: actionId - type: string - trigger: - description: The FQL statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - required: - - actionId - - enabled - - name - - trigger - title: CreateDestinationSubscriptionAlphaInput - type: object - CreateDestinationSubscriptionAlphaOutput: - description: Returns a newly created Destination subscription. - example: - destinationSubscription: null - properties: - destinationSubscription: - $ref: '#/components/schemas/destinationSubscription' - required: - - destinationSubscription - title: CreateDestinationSubscriptionAlphaOutput - type: object - DestinationSubscriptionUpdateInput: - description: The input parameters for updating a Destination subscription. - properties: - name: - description: The user-defined name for the subscription. - title: name - type: string - trigger: - description: The fql statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - title: DestinationSubscriptionUpdateInput - type: object - UpdateSubscriptionForDestinationAlphaInput: - description: The basic input parameters for updating a Destination subscription. - properties: - input: - $ref: '#/components/schemas/input' - required: - - destinationId - - input - title: UpdateSubscriptionForDestinationAlphaInput - type: object - UpdateSubscriptionForDestinationAlphaOutput: - description: Returns the updated Destination subscription. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: UpdateSubscriptionForDestinationAlphaOutput - type: object - RemoveSubscriptionFromDestinationAlphaInput: - description: Deletes a Destination by id. - properties: {} - required: - - destinationId - title: RemoveSubscriptionFromDestinationAlphaInput - type: object - RemoveSubscriptionFromDestinationAlphaOutput: - description: Returns a Destination deletion flag. - example: - status: SUCCESS - properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveSubscriptionFromDestinationAlphaOutput - type: object GetDestinationsCatalogV1Input: description: Contains filter parameters used for loading the Destinations public catalog. @@ -23836,6 +23609,233 @@ components: - destinationMetadata title: GetDestinationMetadataV1Output type: object + DestinationSubscription: + example: + actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + properties: + id: + description: The unique identifier for the subscription. + title: id + type: string + name: + description: The name of the subscription. + title: name + type: string + actionId: + description: The unique identifier for the Destination action to trigger. + title: actionId + type: string + actionSlug: + description: The URL-friendly key for the associated Destination action. + title: actionSlug + type: string + destinationId: + description: The associated Destination instance id. + title: destinationId + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The customer settings for action fields. + title: settings + trigger: + description: FQL string that describes what events should trigger a Destination + action. + title: trigger + type: string + required: + - actionId + - actionSlug + - destinationId + - enabled + - id + - name + - settings + - trigger + title: DestinationSubscription + type: object + DestinationSubscriptionFields: + additionalProperties: {} + description: Represents settings used to configure an action subscription. + title: DestinationSubscriptionFields + type: object + ListSubscriptionsFromDestinationAlphaInput: + description: Input for ListDestinationSubscriptionsAlpha. + properties: {} + required: + - destinationId + title: ListSubscriptionsFromDestinationAlphaInput + type: object + ListSubscriptionsFromDestinationAlphaOutput: + description: Output for ListDestinationSubscriptionsAlpha. + example: + subscriptions: + - actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + - actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + pagination: null + properties: + subscriptions: + description: A list of Destination subscriptions. + items: + $ref: '#/components/schemas/DestinationSubscription' + title: subscriptions + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - subscriptions + title: ListSubscriptionsFromDestinationAlphaOutput + type: object + GetSubscriptionFromDestinationAlphaInput: + description: Fetches a Destination subscription. + properties: {} + required: + - destinationId + title: GetSubscriptionFromDestinationAlphaInput + type: object + GetSubscriptionFromDestinationAlphaOutput: + description: Returns a subscription for a given subscription id. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: GetSubscriptionFromDestinationAlphaOutput + type: object + CreateDestinationSubscriptionAlphaInput: + description: The basic input parameters for creating a Destination subscription. + properties: + name: + description: A user-defined name for the subscription. + title: name + type: string + actionId: + description: The associated action id the subscription should trigger. + title: actionId + type: string + trigger: + description: The FQL statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + required: + - actionId + - enabled + - name + - trigger + title: CreateDestinationSubscriptionAlphaInput + type: object + CreateDestinationSubscriptionAlphaOutput: + description: Returns a newly created Destination subscription. + example: + destinationSubscription: null + properties: + destinationSubscription: + $ref: '#/components/schemas/destinationSubscription' + required: + - destinationSubscription + title: CreateDestinationSubscriptionAlphaOutput + type: object + DestinationSubscriptionUpdateInput: + description: The input parameters for updating a Destination subscription. + properties: + name: + description: The user-defined name for the subscription. + title: name + type: string + trigger: + description: The fql statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + title: DestinationSubscriptionUpdateInput + type: object + UpdateSubscriptionForDestinationAlphaInput: + description: The basic input parameters for updating a Destination subscription. + properties: + input: + $ref: '#/components/schemas/input' + required: + - destinationId + - input + title: UpdateSubscriptionForDestinationAlphaInput + type: object + UpdateSubscriptionForDestinationAlphaOutput: + description: Returns the updated Destination subscription. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: UpdateSubscriptionForDestinationAlphaOutput + type: object + RemoveSubscriptionFromDestinationAlphaInput: + description: Deletes a Destination by id. + properties: {} + required: + - destinationId + title: RemoveSubscriptionFromDestinationAlphaInput + type: object + RemoveSubscriptionFromDestinationAlphaOutput: + description: Returns a Destination deletion flag. + example: + status: SUCCESS + properties: + status: + description: The status of the operation. + enum: + - SUCCESS + title: status + type: string + required: + - status + title: RemoveSubscriptionFromDestinationAlphaOutput + type: object ListDeliveryMetricsSummaryFromDestinationBetaInput: description: Input to retrieve event delivery metrics summary for a Destination. properties: {} @@ -28857,6 +28857,15 @@ components: example: sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -28906,6 +28915,13 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array + propertyValueTransformations: + description: Optional array for transforming properties and values collected + by your events. + items: + $ref: '#/components/schemas/PropertyValueTransformationBeta' + title: propertyValueTransformations + type: array required: - enabled - id @@ -28932,6 +28948,28 @@ components: - oldName title: PropertyRenameBeta type: object + PropertyValueTransformationBeta: + example: + propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + properties: + propertyPaths: + description: The property paths. + items: + type: string + title: propertyPaths + type: array + propertyValue: + description: The new value of the property paths. + title: propertyValue + type: string + required: + - propertyPaths + - propertyValue + title: PropertyValueTransformationBeta + type: object GetTransformationBetaOutput: description: The output of Transformation retrieval. example: @@ -28964,6 +29002,15 @@ components: transformations: - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -28976,6 +29023,15 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -29060,6 +29116,13 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array + propertyValueTransformations: + description: Optional array for transforming properties and values collected + by your events. + items: + $ref: '#/components/schemas/PropertyValueTransformationBeta' + title: propertyValueTransformations + type: array required: - transformationId title: UpdateTransformationBetaInput @@ -29113,6 +29176,13 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array + propertyValueTransformations: + description: Optional array for transforming properties and values collected + by your events. + items: + $ref: '#/components/schemas/PropertyValueTransformationBeta' + title: propertyValueTransformations + type: array required: - enabled - if @@ -31212,6 +31282,15 @@ components: transformations: - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -31224,6 +31303,15 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -32829,6 +32917,11 @@ components: description: "Platforms from which the Destination receives events.\n\nConfig\ \ API note: equal to `platforms`." title: supportedPlatforms + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata subscription: allOf: - $ref: '#/components/schemas/DestinationSubscription' @@ -32844,11 +32937,6 @@ components: - $ref: '#/components/schemas/DestinationSubscriptionUpdateInput' description: A set of valid Destination input params required for updating. title: input - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata deliveryMetricsSummary: allOf: - $ref: '#/components/schemas/DeliveryMetricsSummaryBeta' diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 6471fcc6..80448002 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -415,6 +415,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyValueTransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveFilterFromDestination200Response.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 9de9a154..ab4e8c32 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -82,6 +83,10 @@ public class CreateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public CreateTransformationBetaInput() { } @@ -254,6 +259,37 @@ public void setPropertyRenames(List propertyRenames) { } + public CreateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public CreateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -270,12 +306,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, createTransformationBetaInput.enabled) && Objects.equals(this._if, createTransformationBetaInput._if) && Objects.equals(this.newEventName, createTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames); + Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames) && + Objects.equals(this.propertyValueTransformations, createTransformationBetaInput.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -289,6 +326,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -318,6 +356,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -378,6 +417,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java new file mode 100644 index 00000000..a8e86783 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -0,0 +1,260 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.2 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.segment.publicapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.segment.publicapi.JSON; + +/** + * PropertyValueTransformationBeta + */ + +public class PropertyValueTransformationBeta { + public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; + @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) + private List propertyPaths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) + private String propertyValue; + + public PropertyValueTransformationBeta() { + } + + public PropertyValueTransformationBeta propertyPaths(List propertyPaths) { + + this.propertyPaths = propertyPaths; + return this; + } + + public PropertyValueTransformationBeta addPropertyPathsItem(String propertyPathsItem) { + this.propertyPaths.add(propertyPathsItem); + return this; + } + + /** + * The property paths. + * @return propertyPaths + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The property paths.") + + public List getPropertyPaths() { + return propertyPaths; + } + + + public void setPropertyPaths(List propertyPaths) { + this.propertyPaths = propertyPaths; + } + + + public PropertyValueTransformationBeta propertyValue(String propertyValue) { + + this.propertyValue = propertyValue; + return this; + } + + /** + * The new value of the property paths. + * @return propertyValue + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new value of the property paths.") + + public String getPropertyValue() { + return propertyValue; + } + + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyValueTransformationBeta propertyValueTransformationBeta = (PropertyValueTransformationBeta) o; + return Objects.equals(this.propertyPaths, propertyValueTransformationBeta.propertyPaths) && + Objects.equals(this.propertyValue, propertyValueTransformationBeta.propertyValue); + } + + @Override + public int hashCode() { + return Objects.hash(propertyPaths, propertyValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyValueTransformationBeta {\n"); + sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); + sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("propertyPaths"); + openapiFields.add("propertyValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("propertyPaths"); + openapiRequiredFields.add("propertyValue"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PropertyValueTransformationBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyValueTransformationBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueTransformationBeta is not found in the empty JSON string", PropertyValueTransformationBeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyValueTransformationBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueTransformationBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyValueTransformationBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("propertyPaths") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("propertyPaths").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyPaths` to be an array in the JSON string but got `%s`", jsonObj.get("propertyPaths").toString())); + } + if (!jsonObj.get("propertyValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("propertyValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyValueTransformationBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyValueTransformationBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueTransformationBeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyValueTransformationBeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyValueTransformationBeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyValueTransformationBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyValueTransformationBeta + * @throws IOException if the JSON string is invalid with respect to PropertyValueTransformationBeta + */ + public static PropertyValueTransformationBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyValueTransformationBeta.class); + } + + /** + * Convert an instance of PropertyValueTransformationBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index a7c1ea74..ee6c612b 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class Transformation { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public Transformation propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation.enabled) && Objects.equals(this._if, transformation._if) && Objects.equals(this.newEventName, transformation.newEventName) && - Objects.equals(this.propertyRenames, transformation.propertyRenames); + Objects.equals(this.propertyRenames, transformation.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformation.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index cb4f6074..7e710647 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class Transformation1 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation1() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public Transformation1 propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation1 addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation1.enabled) && Objects.equals(this._if, transformation1._if) && Objects.equals(this.newEventName, transformation1.newEventName) && - Objects.equals(this.propertyRenames, transformation1.propertyRenames); + Objects.equals(this.propertyRenames, transformation1.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformation1.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index 0f76e959..9d710281 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class Transformation2 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation2() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public Transformation2 propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation2 addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation2.enabled) && Objects.equals(this._if, transformation2._if) && Objects.equals(this.newEventName, transformation2.newEventName) && - Objects.equals(this.propertyRenames, transformation2.propertyRenames); + Objects.equals(this.propertyRenames, transformation2.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformation2.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index 0b7d356a..e3d45f14 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class TransformationBeta { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public TransformationBeta() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public TransformationBeta propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public TransformationBeta addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformationBeta.enabled) && Objects.equals(this._if, transformationBeta._if) && Objects.equals(this.newEventName, transformationBeta.newEventName) && - Objects.equals(this.propertyRenames, transformationBeta.propertyRenames); + Objects.equals(this.propertyRenames, transformationBeta.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformationBeta.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 94d4a93c..3999027d 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -82,6 +83,10 @@ public class UpdateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public UpdateTransformationBetaInput() { } @@ -254,6 +259,37 @@ public void setPropertyRenames(List propertyRenames) { } + public UpdateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public UpdateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -270,12 +306,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, updateTransformationBetaInput.enabled) && Objects.equals(this._if, updateTransformationBetaInput._if) && Objects.equals(this.newEventName, updateTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, updateTransformationBetaInput.propertyRenames); + Objects.equals(this.propertyRenames, updateTransformationBetaInput.propertyRenames) && + Objects.equals(this.propertyValueTransformations, updateTransformationBetaInput.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -289,6 +326,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -318,6 +356,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -367,6 +406,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 788de220561549d17d0f60834b42af782cac8639 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Tue, 8 Nov 2022 18:11:15 +0000 Subject: [PATCH 006/474] Automated client deploy (from segmentio/public-api@f95fb61) --- README.md | 45 +-- api/openapi.yaml | 88 ------ src/main/java/com/segment/publicapi/JSON.java | 1 - .../models/CreateTransformationBetaInput.java | 52 +--- .../PropertyValueTransformationBeta.java | 260 ------------------ .../publicapi/models/Transformation.java | 52 +--- .../publicapi/models/Transformation1.java | 52 +--- .../publicapi/models/Transformation2.java | 52 +--- .../publicapi/models/TransformationBeta.java | 52 +--- .../models/UpdateTransformationBetaInput.java | 52 +--- 10 files changed, 21 insertions(+), 685 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java diff --git a/README.md b/README.md index a58ec255..3159e646 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,4 @@ -# Java API client for Segment Public API - -## Overview -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. - +# segment-publicapi Segment Public API - API version: 32.0.2 @@ -94,9 +90,7 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.SourcesApi; -import com.segment.publicapi.api.WorkspacesApi; -import java.math.BigDecimal; +import com.segment.publicapi.api.ApiCallsApi; public class Example { public static void main(String[] args) { @@ -110,36 +104,15 @@ public class Example { ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in alpha. PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in alpha. - - // Make an API call without Pagination - try { - WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); - GetWorkspace200Response workspaceResponse = apiInstance.getWorkspace(); - } catch (ApiException e) { - System.err.println("Exception when calling WorkspacesApi#getWorkspace"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - // Make an API call with Pagination try { - SourcesApi sourceApiInstance = new SourcesApi(defaultClient); - PaginationInput paginationInput = new PaginationInput(); - paginationInput.count(BigDecimal.valueOf(20)); - String current = null; - do { - paginationInput.setCursor(current); - ListSources200Response sourcesResponse = sourceApiInstance.listSources(paginationInput); - current = sourcesResponse.getData().getPagination().getNext(); - } while(current != null); + GetDailyPerSourceAPICallsUsage200Response result = apiInstance.getDailyPerSourceAPICallsUsage(period, pagination); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling SourcesApi#sourceApiInstance"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + System.err.println("Exception when calling ApiCallsApi#getDailyPerSourceAPICallsUsage"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } diff --git a/api/openapi.yaml b/api/openapi.yaml index f1f36e7b..4fd71354 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -28857,15 +28857,6 @@ components: example: sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -28915,13 +28906,6 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array - propertyValueTransformations: - description: Optional array for transforming properties and values collected - by your events. - items: - $ref: '#/components/schemas/PropertyValueTransformationBeta' - title: propertyValueTransformations - type: array required: - enabled - id @@ -28948,28 +28932,6 @@ components: - oldName title: PropertyRenameBeta type: object - PropertyValueTransformationBeta: - example: - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - properties: - propertyPaths: - description: The property paths. - items: - type: string - title: propertyPaths - type: array - propertyValue: - description: The new value of the property paths. - title: propertyValue - type: string - required: - - propertyPaths - - propertyValue - title: PropertyValueTransformationBeta - type: object GetTransformationBetaOutput: description: The output of Transformation retrieval. example: @@ -29002,15 +28964,6 @@ components: transformations: - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -29023,15 +28976,6 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -29116,13 +29060,6 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array - propertyValueTransformations: - description: Optional array for transforming properties and values collected - by your events. - items: - $ref: '#/components/schemas/PropertyValueTransformationBeta' - title: propertyValueTransformations - type: array required: - transformationId title: UpdateTransformationBetaInput @@ -29176,13 +29113,6 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array - propertyValueTransformations: - description: Optional array for transforming properties and values collected - by your events. - items: - $ref: '#/components/schemas/PropertyValueTransformationBeta' - title: propertyValueTransformations - type: array required: - enabled - if @@ -31282,15 +31212,6 @@ components: transformations: - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -31303,15 +31224,6 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 80448002..6471fcc6 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -415,7 +415,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyValueTransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveFilterFromDestination200Response.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index ab4e8c32..9de9a154 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -83,10 +82,6 @@ public class CreateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - public CreateTransformationBetaInput() { } @@ -259,37 +254,6 @@ public void setPropertyRenames(List propertyRenames) { } - public CreateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public CreateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override public boolean equals(Object o) { @@ -306,13 +270,12 @@ public boolean equals(Object o) { Objects.equals(this.enabled, createTransformationBetaInput.enabled) && Objects.equals(this._if, createTransformationBetaInput._if) && Objects.equals(this.newEventName, createTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames) && - Objects.equals(this.propertyValueTransformations, createTransformationBetaInput.propertyValueTransformations); + Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames); } @Override public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); + return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); } @Override @@ -326,7 +289,6 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -356,7 +318,6 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -417,15 +378,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java deleted file mode 100644 index a8e86783..00000000 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * The version of the OpenAPI document: 32.0.2 - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.segment.publicapi.models; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.segment.publicapi.JSON; - -/** - * PropertyValueTransformationBeta - */ - -public class PropertyValueTransformationBeta { - public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; - @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) - private List propertyPaths = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) - private String propertyValue; - - public PropertyValueTransformationBeta() { - } - - public PropertyValueTransformationBeta propertyPaths(List propertyPaths) { - - this.propertyPaths = propertyPaths; - return this; - } - - public PropertyValueTransformationBeta addPropertyPathsItem(String propertyPathsItem) { - this.propertyPaths.add(propertyPathsItem); - return this; - } - - /** - * The property paths. - * @return propertyPaths - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The property paths.") - - public List getPropertyPaths() { - return propertyPaths; - } - - - public void setPropertyPaths(List propertyPaths) { - this.propertyPaths = propertyPaths; - } - - - public PropertyValueTransformationBeta propertyValue(String propertyValue) { - - this.propertyValue = propertyValue; - return this; - } - - /** - * The new value of the property paths. - * @return propertyValue - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new value of the property paths.") - - public String getPropertyValue() { - return propertyValue; - } - - - public void setPropertyValue(String propertyValue) { - this.propertyValue = propertyValue; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PropertyValueTransformationBeta propertyValueTransformationBeta = (PropertyValueTransformationBeta) o; - return Objects.equals(this.propertyPaths, propertyValueTransformationBeta.propertyPaths) && - Objects.equals(this.propertyValue, propertyValueTransformationBeta.propertyValue); - } - - @Override - public int hashCode() { - return Objects.hash(propertyPaths, propertyValue); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PropertyValueTransformationBeta {\n"); - sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); - sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("propertyPaths"); - openapiFields.add("propertyValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("propertyPaths"); - openapiRequiredFields.add("propertyValue"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PropertyValueTransformationBeta - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PropertyValueTransformationBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueTransformationBeta is not found in the empty JSON string", PropertyValueTransformationBeta.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!PropertyValueTransformationBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueTransformationBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PropertyValueTransformationBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // ensure the required json array is present - if (jsonObj.get("propertyPaths") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("propertyPaths").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyPaths` to be an array in the JSON string but got `%s`", jsonObj.get("propertyPaths").toString())); - } - if (!jsonObj.get("propertyValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("propertyValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PropertyValueTransformationBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PropertyValueTransformationBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueTransformationBeta.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PropertyValueTransformationBeta value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PropertyValueTransformationBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PropertyValueTransformationBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertyValueTransformationBeta - * @throws IOException if the JSON string is invalid with respect to PropertyValueTransformationBeta - */ - public static PropertyValueTransformationBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PropertyValueTransformationBeta.class); - } - - /** - * Convert an instance of PropertyValueTransformationBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index ee6c612b..a7c1ea74 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -87,10 +86,6 @@ public class Transformation { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - public Transformation() { } @@ -286,37 +281,6 @@ public void setPropertyRenames(List propertyRenames) { } - public Transformation propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override public boolean equals(Object o) { @@ -334,13 +298,12 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation.enabled) && Objects.equals(this._if, transformation._if) && Objects.equals(this.newEventName, transformation.newEventName) && - Objects.equals(this.propertyRenames, transformation.propertyRenames) && - Objects.equals(this.propertyValueTransformations, transformation.propertyValueTransformations); + Objects.equals(this.propertyRenames, transformation.propertyRenames); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); } @Override @@ -355,7 +318,6 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -386,7 +348,6 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -451,15 +412,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index 7e710647..cb4f6074 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -87,10 +86,6 @@ public class Transformation1 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - public Transformation1() { } @@ -286,37 +281,6 @@ public void setPropertyRenames(List propertyRenames) { } - public Transformation1 propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation1 addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override public boolean equals(Object o) { @@ -334,13 +298,12 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation1.enabled) && Objects.equals(this._if, transformation1._if) && Objects.equals(this.newEventName, transformation1.newEventName) && - Objects.equals(this.propertyRenames, transformation1.propertyRenames) && - Objects.equals(this.propertyValueTransformations, transformation1.propertyValueTransformations); + Objects.equals(this.propertyRenames, transformation1.propertyRenames); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); } @Override @@ -355,7 +318,6 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -386,7 +348,6 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -451,15 +412,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index 9d710281..0f76e959 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -87,10 +86,6 @@ public class Transformation2 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - public Transformation2() { } @@ -286,37 +281,6 @@ public void setPropertyRenames(List propertyRenames) { } - public Transformation2 propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation2 addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override public boolean equals(Object o) { @@ -334,13 +298,12 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation2.enabled) && Objects.equals(this._if, transformation2._if) && Objects.equals(this.newEventName, transformation2.newEventName) && - Objects.equals(this.propertyRenames, transformation2.propertyRenames) && - Objects.equals(this.propertyValueTransformations, transformation2.propertyValueTransformations); + Objects.equals(this.propertyRenames, transformation2.propertyRenames); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); } @Override @@ -355,7 +318,6 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -386,7 +348,6 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -451,15 +412,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index e3d45f14..0b7d356a 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -87,10 +86,6 @@ public class TransformationBeta { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - public TransformationBeta() { } @@ -286,37 +281,6 @@ public void setPropertyRenames(List propertyRenames) { } - public TransformationBeta propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public TransformationBeta addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override public boolean equals(Object o) { @@ -334,13 +298,12 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformationBeta.enabled) && Objects.equals(this._if, transformationBeta._if) && Objects.equals(this.newEventName, transformationBeta.newEventName) && - Objects.equals(this.propertyRenames, transformationBeta.propertyRenames) && - Objects.equals(this.propertyValueTransformations, transformationBeta.propertyValueTransformations); + Objects.equals(this.propertyRenames, transformationBeta.propertyRenames); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); } @Override @@ -355,7 +318,6 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -386,7 +348,6 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -451,15 +412,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 3999027d..94d4a93c 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -21,7 +21,6 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -83,10 +82,6 @@ public class UpdateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - public UpdateTransformationBetaInput() { } @@ -259,37 +254,6 @@ public void setPropertyRenames(List propertyRenames) { } - public UpdateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public UpdateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override public boolean equals(Object o) { @@ -306,13 +270,12 @@ public boolean equals(Object o) { Objects.equals(this.enabled, updateTransformationBetaInput.enabled) && Objects.equals(this._if, updateTransformationBetaInput._if) && Objects.equals(this.newEventName, updateTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, updateTransformationBetaInput.propertyRenames) && - Objects.equals(this.propertyValueTransformations, updateTransformationBetaInput.propertyValueTransformations); + Objects.equals(this.propertyRenames, updateTransformationBetaInput.propertyRenames); } @Override public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); + return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); } @Override @@ -326,7 +289,6 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -356,7 +318,6 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -406,15 +367,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } - } - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From e0d576774f6eb6ebea5c873b8146e0f00c24374a Mon Sep 17 00:00:00 2001 From: public-api ci Date: Tue, 8 Nov 2022 18:19:04 +0000 Subject: [PATCH 007/474] Automated client deploy (from segmentio/public-api@d0a7c39) --- README.md | 49 +++- api/openapi.yaml | 88 ++++++ pom.xml | 4 +- src/main/java/com/segment/publicapi/JSON.java | 1 + .../models/CreateTransformationBetaInput.java | 52 +++- .../PropertyValueTransformationBeta.java | 260 ++++++++++++++++++ .../publicapi/models/Transformation.java | 52 +++- .../publicapi/models/Transformation1.java | 52 +++- .../publicapi/models/Transformation2.java | 52 +++- .../publicapi/models/TransformationBeta.java | 52 +++- .../models/UpdateTransformationBetaInput.java | 52 +++- 11 files changed, 689 insertions(+), 25 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java diff --git a/README.md b/README.md index 3159e646..41ca5edc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# segment-publicapi +# Java API client for Segment Public API + +## Overview +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. + Segment Public API - API version: 32.0.2 @@ -43,7 +47,7 @@ Add this dependency to your project's POM: ```xml - com.segment + com.segment.publicapi segment-publicapi 32.0.2 compile @@ -61,7 +65,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment:segment-publicapi:32.0.2" + implementation "com.segment.publicapi:segment-publicapi:32.0.2" } ``` @@ -90,7 +94,9 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.ApiCallsApi; +import com.segment.publicapi.api.SourcesApi; +import com.segment.publicapi.api.WorkspacesApi; +import java.math.BigDecimal; public class Example { public static void main(String[] args) { @@ -104,15 +110,36 @@ public class Example { ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in alpha. PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in alpha. + + // Make an API call without Pagination + try { + WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); + GetWorkspace200Response workspaceResponse = apiInstance.getWorkspace(); + } catch (ApiException e) { + System.err.println("Exception when calling WorkspacesApi#getWorkspace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + + // Make an API call with Pagination try { - GetDailyPerSourceAPICallsUsage200Response result = apiInstance.getDailyPerSourceAPICallsUsage(period, pagination); - System.out.println(result); + SourcesApi sourceApiInstance = new SourcesApi(defaultClient); + PaginationInput paginationInput = new PaginationInput(); + paginationInput.count(BigDecimal.valueOf(20)); + String current = null; + do { + paginationInput.setCursor(current); + ListSources200Response sourcesResponse = sourceApiInstance.listSources(paginationInput); + current = sourcesResponse.getData().getPagination().getNext(); + } while(current != null); } catch (ApiException e) { - System.err.println("Exception when calling ApiCallsApi#getDailyPerSourceAPICallsUsage"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + System.err.println("Exception when calling SourcesApi#sourceApiInstance"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } diff --git a/api/openapi.yaml b/api/openapi.yaml index 4fd71354..f1f36e7b 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -28857,6 +28857,15 @@ components: example: sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -28906,6 +28915,13 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array + propertyValueTransformations: + description: Optional array for transforming properties and values collected + by your events. + items: + $ref: '#/components/schemas/PropertyValueTransformationBeta' + title: propertyValueTransformations + type: array required: - enabled - id @@ -28932,6 +28948,28 @@ components: - oldName title: PropertyRenameBeta type: object + PropertyValueTransformationBeta: + example: + propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + properties: + propertyPaths: + description: The property paths. + items: + type: string + title: propertyPaths + type: array + propertyValue: + description: The new value of the property paths. + title: propertyValue + type: string + required: + - propertyPaths + - propertyValue + title: PropertyValueTransformationBeta + type: object GetTransformationBetaOutput: description: The output of Transformation retrieval. example: @@ -28964,6 +29002,15 @@ components: transformations: - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -28976,6 +29023,15 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -29060,6 +29116,13 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array + propertyValueTransformations: + description: Optional array for transforming properties and values collected + by your events. + items: + $ref: '#/components/schemas/PropertyValueTransformationBeta' + title: propertyValueTransformations + type: array required: - transformationId title: UpdateTransformationBetaInput @@ -29113,6 +29176,13 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array + propertyValueTransformations: + description: Optional array for transforming properties and values collected + by your events. + items: + $ref: '#/components/schemas/PropertyValueTransformationBeta' + title: propertyValueTransformations + type: array required: - enabled - if @@ -31212,6 +31282,15 @@ components: transformations: - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -31224,6 +31303,15 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName + propertyValueTransformations: + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue + - propertyPaths: + - propertyPaths + - propertyPaths + propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id diff --git a/pom.xml b/pom.xml index bb5da8f2..855dbdcf 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - com.segment + com.segment.publicapi segment-publicapi jar segment-publicapi @@ -25,7 +25,7 @@ Segment - team@openapitools.org + friends@segment.com Segment https://segment.com/ diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 6471fcc6..80448002 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -415,6 +415,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyValueTransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveFilterFromDestination200Response.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 9de9a154..ab4e8c32 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -82,6 +83,10 @@ public class CreateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public CreateTransformationBetaInput() { } @@ -254,6 +259,37 @@ public void setPropertyRenames(List propertyRenames) { } + public CreateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public CreateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -270,12 +306,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, createTransformationBetaInput.enabled) && Objects.equals(this._if, createTransformationBetaInput._if) && Objects.equals(this.newEventName, createTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames); + Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames) && + Objects.equals(this.propertyValueTransformations, createTransformationBetaInput.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -289,6 +326,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -318,6 +356,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -378,6 +417,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java new file mode 100644 index 00000000..a8e86783 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -0,0 +1,260 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.2 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.segment.publicapi.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.segment.publicapi.JSON; + +/** + * PropertyValueTransformationBeta + */ + +public class PropertyValueTransformationBeta { + public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; + @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) + private List propertyPaths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) + private String propertyValue; + + public PropertyValueTransformationBeta() { + } + + public PropertyValueTransformationBeta propertyPaths(List propertyPaths) { + + this.propertyPaths = propertyPaths; + return this; + } + + public PropertyValueTransformationBeta addPropertyPathsItem(String propertyPathsItem) { + this.propertyPaths.add(propertyPathsItem); + return this; + } + + /** + * The property paths. + * @return propertyPaths + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The property paths.") + + public List getPropertyPaths() { + return propertyPaths; + } + + + public void setPropertyPaths(List propertyPaths) { + this.propertyPaths = propertyPaths; + } + + + public PropertyValueTransformationBeta propertyValue(String propertyValue) { + + this.propertyValue = propertyValue; + return this; + } + + /** + * The new value of the property paths. + * @return propertyValue + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new value of the property paths.") + + public String getPropertyValue() { + return propertyValue; + } + + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyValueTransformationBeta propertyValueTransformationBeta = (PropertyValueTransformationBeta) o; + return Objects.equals(this.propertyPaths, propertyValueTransformationBeta.propertyPaths) && + Objects.equals(this.propertyValue, propertyValueTransformationBeta.propertyValue); + } + + @Override + public int hashCode() { + return Objects.hash(propertyPaths, propertyValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyValueTransformationBeta {\n"); + sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); + sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("propertyPaths"); + openapiFields.add("propertyValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("propertyPaths"); + openapiRequiredFields.add("propertyValue"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PropertyValueTransformationBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyValueTransformationBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PropertyValueTransformationBeta is not found in the empty JSON string", PropertyValueTransformationBeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyValueTransformationBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PropertyValueTransformationBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyValueTransformationBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("propertyPaths") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("propertyPaths").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyPaths` to be an array in the JSON string but got `%s`", jsonObj.get("propertyPaths").toString())); + } + if (!jsonObj.get("propertyValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("propertyValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyValueTransformationBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyValueTransformationBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PropertyValueTransformationBeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyValueTransformationBeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyValueTransformationBeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyValueTransformationBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyValueTransformationBeta + * @throws IOException if the JSON string is invalid with respect to PropertyValueTransformationBeta + */ + public static PropertyValueTransformationBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyValueTransformationBeta.class); + } + + /** + * Convert an instance of PropertyValueTransformationBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index a7c1ea74..ee6c612b 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class Transformation { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public Transformation propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation.enabled) && Objects.equals(this._if, transformation._if) && Objects.equals(this.newEventName, transformation.newEventName) && - Objects.equals(this.propertyRenames, transformation.propertyRenames); + Objects.equals(this.propertyRenames, transformation.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformation.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index cb4f6074..7e710647 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class Transformation1 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation1() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public Transformation1 propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation1 addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation1.enabled) && Objects.equals(this._if, transformation1._if) && Objects.equals(this.newEventName, transformation1.newEventName) && - Objects.equals(this.propertyRenames, transformation1.propertyRenames); + Objects.equals(this.propertyRenames, transformation1.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformation1.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index 0f76e959..9d710281 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class Transformation2 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation2() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public Transformation2 propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation2 addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformation2.enabled) && Objects.equals(this._if, transformation2._if) && Objects.equals(this.newEventName, transformation2.newEventName) && - Objects.equals(this.propertyRenames, transformation2.propertyRenames); + Objects.equals(this.propertyRenames, transformation2.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformation2.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index 0b7d356a..e3d45f14 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -86,6 +87,10 @@ public class TransformationBeta { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public TransformationBeta() { } @@ -281,6 +286,37 @@ public void setPropertyRenames(List propertyRenames) { } + public TransformationBeta propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public TransformationBeta addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -298,12 +334,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, transformationBeta.enabled) && Objects.equals(this._if, transformationBeta._if) && Objects.equals(this.newEventName, transformationBeta.newEventName) && - Objects.equals(this.propertyRenames, transformationBeta.propertyRenames); + Objects.equals(this.propertyRenames, transformationBeta.propertyRenames) && + Objects.equals(this.propertyValueTransformations, transformationBeta.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(id, name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -318,6 +355,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -348,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -412,6 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 94d4a93c..3999027d 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.models.PropertyRenameBeta; +import com.segment.publicapi.models.PropertyValueTransformationBeta; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; @@ -82,6 +83,10 @@ public class UpdateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public UpdateTransformationBetaInput() { } @@ -254,6 +259,37 @@ public void setPropertyRenames(List propertyRenames) { } + public UpdateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public UpdateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. + * @return propertyValueTransformations + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") + + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + + public void setPropertyValueTransformations(List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override public boolean equals(Object o) { @@ -270,12 +306,13 @@ public boolean equals(Object o) { Objects.equals(this.enabled, updateTransformationBetaInput.enabled) && Objects.equals(this._if, updateTransformationBetaInput._if) && Objects.equals(this.newEventName, updateTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, updateTransformationBetaInput.propertyRenames); + Objects.equals(this.propertyRenames, updateTransformationBetaInput.propertyRenames) && + Objects.equals(this.propertyValueTransformations, updateTransformationBetaInput.propertyValueTransformations); } @Override public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); } @Override @@ -289,6 +326,7 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); sb.append("}"); return sb.toString(); } @@ -318,6 +356,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -367,6 +406,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 03731af42fb96c4042f990365eeec89c48fac8b2 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Mon, 14 Nov 2022 19:11:27 +0000 Subject: [PATCH 008/474] Automated client deploy (from segmentio/public-api@b84a82c) --- README.md | 26 +- api/openapi.yaml | 2838 ++++++++--------- pom.xml | 99 +- .../com/segment/publicapi/ApiCallback.java | 8 +- .../java/com/segment/publicapi/ApiClient.java | 446 +-- .../com/segment/publicapi/ApiException.java | 71 +- .../com/segment/publicapi/ApiResponse.java | 28 +- .../com/segment/publicapi/Configuration.java | 14 +- .../publicapi/GzipRequestInterceptor.java | 23 +- src/main/java/com/segment/publicapi/JSON.java | 1737 +++++++--- src/main/java/com/segment/publicapi/Pair.java | 8 +- .../publicapi/ProgressRequestBody.java | 13 +- .../publicapi/ProgressResponseBody.java | 13 +- .../publicapi/ServerConfiguration.java | 23 +- .../com/segment/publicapi/ServerVariable.java | 8 +- .../com/segment/publicapi/StringUtil.java | 118 +- .../segment/publicapi/api/ApiCallsApi.java | 406 ++- .../segment/publicapi/api/AuditTrailApi.java | 266 +- .../com/segment/publicapi/api/CatalogApi.java | 979 +++--- .../api/DeletionAndSuppressionApi.java | 1507 +++++---- .../publicapi/api/DestinationFiltersApi.java | 1201 ++++--- .../publicapi/api/DestinationsApi.java | 2132 ++++++++----- .../publicapi/api/EdgeFunctionsApi.java | 718 +++-- .../com/segment/publicapi/api/EventsApi.java | 423 ++- .../segment/publicapi/api/FunctionsApi.java | 1056 +++--- .../segment/publicapi/api/IamGroupsApi.java | 2305 ++++++++----- .../segment/publicapi/api/IamRolesApi.java | 163 +- .../segment/publicapi/api/IamUsersApi.java | 1566 +++++---- .../com/segment/publicapi/api/LabelsApi.java | 505 +-- .../publicapi/api/MonthlyTrackedUsersApi.java | 396 ++- .../publicapi/api/SelectiveSyncApi.java | 1303 +++++--- .../com/segment/publicapi/api/SourcesApi.java | 2022 +++++++----- .../com/segment/publicapi/api/SpacesApi.java | 581 ++-- .../com/segment/publicapi/api/TestingApi.java | 327 +- .../publicapi/api/TrackingPlansApi.java | 2326 +++++++++----- .../publicapi/api/TransformationsApi.java | 888 ++++-- .../segment/publicapi/api/WarehousesApi.java | 1784 +++++++---- .../segment/publicapi/api/WorkspacesApi.java | 143 +- .../segment/publicapi/auth/ApiKeyAuth.java | 106 +- .../publicapi/auth/Authentication.java | 20 +- .../segment/publicapi/auth/HttpBasicAuth.java | 33 +- .../publicapi/auth/HttpBearerAuth.java | 90 +- .../publicapi/models/APICallSnapshotV1.java | 404 +-- .../models/AbstractOpenApiSchema.java | 45 +- .../publicapi/models/AccessPermissionV1.java | 479 +-- ...ctionFromSourceToWarehouse200Response.java | 333 +- ...nnectionFromSourceToWarehouseV1Output.java | 436 +-- .../models/AddLabelsToSource200Response.java | 321 +- .../models/AddLabelsToSource200Response1.java | 322 +- .../models/AddLabelsToSourceAlphaInput.java | 354 +- .../models/AddLabelsToSourceAlphaOutput.java | 358 +-- .../models/AddLabelsToSourceV1Input.java | 357 +-- .../models/AddLabelsToSourceV1Output.java | 354 +- .../AddPermissionsToUser200Response.java | 322 +- .../AddPermissionsToUserGroup200Response.java | 326 +- .../AddPermissionsToUserGroupV1Input.java | 362 ++- .../AddPermissionsToUserGroupV1Output.java | 363 +-- .../models/AddPermissionsToUserV1Input.java | 357 +-- .../models/AddPermissionsToUserV1Output.java | 358 +-- .../AddSourceToTrackingPlan200Response.java | 324 +- .../AddSourceToTrackingPlanV1Input.java | 337 +- .../AddSourceToTrackingPlanV1Output.java | 417 +-- .../AddUsersToUserGroup200Response.java | 322 +- .../models/AddUsersToUserGroupV1Input.java | 349 +- .../models/AddUsersToUserGroupV1Output.java | 331 +- .../AdvancedWarehouseSyncScheduleV1Input.java | 428 +-- ...AdvancedWarehouseSyncScheduleV1Output.java | 406 +-- .../publicapi/models/AllowedLabelBeta.java | 458 +-- .../publicapi/models/AuditEventV1.java | 694 ++-- ...agingSubscriptionsForSpace200Response.java | 338 +- ...sagingSubscriptionsForSpaceAlphaInput.java | 380 +-- ...agingSubscriptionsForSpaceAlphaOutput.java | 595 ++-- .../publicapi/models/BreakdownBeta.java | 389 ++- .../models/CommonSourceSettingsV1.java | 539 ++-- .../com/segment/publicapi/models/Contact.java | 507 ++- ...reateCloudSourceRegulation200Response.java | 326 +- .../CreateCloudSourceRegulationV1Input.java | 705 ++-- .../CreateCloudSourceRegulationV1Output.java | 349 +- .../models/CreateDestination200Response.java | 321 +- ...ateDestinationSubscription200Response.java | 329 +- ...eateDestinationSubscriptionAlphaInput.java | 583 ++-- ...ateDestinationSubscriptionAlphaOutput.java | 348 +- .../models/CreateDestinationV1Input.java | 581 ++-- .../models/CreateDestinationV1Output.java | 331 +- .../CreateEdgeFunctions200Response.java | 322 +- .../models/CreateEdgeFunctionsAlphaInput.java | 349 +- .../CreateEdgeFunctionsAlphaOutput.java | 336 +- ...CreateFilterForDestination200Response.java | 326 +- .../CreateFilterForDestinationV1Input.java | 648 ++-- .../CreateFilterForDestinationV1Output.java | 338 +- .../models/CreateFunction200Response.java | 317 +- .../CreateFunctionDeployment200Response.java | 324 +- .../CreateFunctionDeploymentV1Output.java | 340 +- .../models/CreateFunctionV1Input.java | 743 ++--- .../models/CreateFunctionV1Output.java | 330 +- .../models/CreateInvites200Response.java | 317 +- .../models/CreateInvitesV1Input.java | 353 +- .../models/CreateInvitesV1Output.java | 357 +-- .../models/CreateLabel200Response.java | 316 +- .../models/CreateLabel200Response1.java | 317 +- .../models/CreateLabelAlphaInput.java | 330 +- .../models/CreateLabelAlphaOutput.java | 353 +- .../publicapi/models/CreateLabelV1Input.java | 330 +- .../publicapi/models/CreateLabelV1Output.java | 330 +- .../models/CreateSource200Response.java | 317 +- .../models/CreateSource200Response1.java | 317 +- .../models/CreateSourceAlphaInput.java | 578 ++-- .../models/CreateSourceAlphaOutput.java | 331 +- .../CreateSourceRegulation200Response.java | 323 +- .../models/CreateSourceRegulationV1Input.java | 645 ++-- .../CreateSourceRegulationV1Output.java | 347 +- .../publicapi/models/CreateSourceV1Input.java | 520 +-- .../models/CreateSourceV1Output.java | 330 +- .../models/CreateTrackingPlan200Response.java | 322 +- .../models/CreateTrackingPlanV1Input.java | 551 ++-- .../models/CreateTrackingPlanV1Output.java | 331 +- .../CreateTransformation200Response.java | 322 +- .../models/CreateTransformationBetaInput.java | 780 +++-- .../CreateTransformationBetaOutput.java | 336 +- .../models/CreateUserGroup200Response.java | 317 +- .../models/CreateUserGroupV1Input.java | 346 +- .../models/CreateUserGroupV1Output.java | 331 +- ...reateValidationInWarehouse200Response.java | 326 +- .../CreateValidationInWarehouseV1Input.java | 398 +-- .../CreateValidationInWarehouseV1Output.java | 432 +-- .../models/CreateWarehouse200Response.java | 317 +- .../models/CreateWarehouseV1Input.java | 507 +-- .../models/CreateWarehouseV1Output.java | 331 +- .../CreateWorkspaceRegulation200Response.java | 326 +- .../CreateWorkspaceRegulationV1Input.java | 657 ++-- .../CreateWorkspaceRegulationV1Output.java | 348 +- .../models/DeleteDestination200Response.java | 321 +- .../models/DeleteDestinationV1Output.java | 412 ++- .../models/DeleteFunction200Response.java | 317 +- .../models/DeleteFunctionV1Output.java | 411 ++- .../models/DeleteInvites200Response.java | 317 +- .../models/DeleteInvitesV1Output.java | 411 ++- .../models/DeleteLabel200Response.java | 316 +- .../models/DeleteLabel200Response1.java | 317 +- .../models/DeleteLabelAlphaOutput.java | 411 ++- .../publicapi/models/DeleteLabelV1Output.java | 411 ++- .../models/DeleteRegulation200Response.java | 317 +- .../models/DeleteRegulationV1Output.java | 412 ++- .../models/DeleteSource200Response.java | 317 +- .../models/DeleteSource200Response1.java | 317 +- .../models/DeleteSourceAlphaOutput.java | 412 ++- .../models/DeleteSourceV1Output.java | 411 ++- .../models/DeleteTrackingPlan200Response.java | 322 +- .../models/DeleteTrackingPlanV1Output.java | 412 ++- .../DeleteTransformation200Response.java | 322 +- .../DeleteTransformationBetaOutput.java | 417 +-- .../models/DeleteUserGroup200Response.java | 317 +- .../models/DeleteUserGroupV1Output.java | 414 ++- .../models/DeleteUsers200Response.java | 316 +- .../publicapi/models/DeleteUsersV1Output.java | 413 ++- .../models/DeleteWarehouse200Response.java | 317 +- .../models/DeleteWarehouseV1Output.java | 412 ++- .../models/DeliveryMetricsSummary.java | 482 +-- .../models/DeliveryMetricsSummaryBeta.java | 484 +-- .../segment/publicapi/models/Destination.java | 634 ++-- .../publicapi/models/Destination1.java | 634 ++-- .../publicapi/models/Destination2.java | 634 ++-- .../models/DestinationFilterActionV1.java | 604 ++-- .../publicapi/models/DestinationFilterV1.java | 927 +++--- .../publicapi/models/DestinationMetadata.java | 1579 ++++----- .../DestinationMetadataActionFieldV1.java | 1175 +++---- .../models/DestinationMetadataActionV1.java | 878 ++--- .../DestinationMetadataComponentV1.java | 627 ++-- .../models/DestinationMetadataFeaturesV1.java | 748 +++-- .../models/DestinationMetadataMethodsV1.java | 507 ++- .../DestinationMetadataPlatformsV1.java | 414 ++- ...stinationMetadataSubscriptionPresetV1.java | 537 ++-- .../models/DestinationMetadataV1.java | 1584 ++++----- .../publicapi/models/DestinationStatusV1.java | 675 ++-- .../models/DestinationSubscription.java | 778 ++--- .../DestinationSubscriptionUpdateInput.java | 501 +-- .../publicapi/models/DestinationV1.java | 640 ++-- .../DisableEdgeFunctions200Response.java | 322 +- .../DisableEdgeFunctionsAlphaOutput.java | 336 +- .../publicapi/models/Echo200Response.java | 316 +- .../publicapi/models/Echo200Response1.java | 316 +- .../publicapi/models/EchoAlphaOutput.java | 541 ++-- .../publicapi/models/EchoV1Output.java | 540 ++-- .../publicapi/models/EdgeFunctions.java | 629 ++-- .../publicapi/models/EdgeFunctions1.java | 629 ++-- .../publicapi/models/EdgeFunctionsAlpha.java | 630 ++-- .../publicapi/models/EventSourceV1.java | 456 +-- .../com/segment/publicapi/models/Filter.java | 429 +-- .../com/segment/publicapi/models/Filter1.java | 926 +++--- .../com/segment/publicapi/models/Filter2.java | 926 +++--- .../com/segment/publicapi/models/Filter3.java | 926 +++--- .../segment/publicapi/models/Function.java | 1216 +++---- .../segment/publicapi/models/Function1.java | 1216 +++---- .../segment/publicapi/models/Function2.java | 1216 +++---- .../publicapi/models/FunctionDeployment.java | 411 ++- .../publicapi/models/FunctionSettingV1.java | 703 ++-- .../segment/publicapi/models/FunctionV1.java | 1216 +++---- ...eUploadURLForEdgeFunctions200Response.java | 332 +- ...eUploadURLForEdgeFunctionsAlphaOutput.java | 362 ++- ...dSyncScheduleFromWarehouse200Response.java | 335 +- ...ncedSyncScheduleFromWarehouseV1Output.java | 396 +-- ...nnectionStateFromWarehouse200Response.java | 331 +- ...tConnectionStateFromWarehouseV1Output.java | 438 +-- ...ailyPerSourceAPICallsUsage200Response.java | 329 +- ...etDailyPerSourceAPICallsUsageV1Output.java | 425 +-- .../GetDailyPerSourceMTUUsage200Response.java | 326 +- .../GetDailyPerSourceMTUUsageV1Output.java | 418 +-- ...ailyWorkspaceAPICallsUsage200Response.java | 329 +- ...etDailyWorkspaceAPICallsUsageV1Output.java | 425 +-- .../GetDailyWorkspaceMTUUsage200Response.java | 326 +- .../GetDailyWorkspaceMTUUsageV1Output.java | 418 +-- .../models/GetDestination200Response.java | 317 +- .../GetDestinationMetadata200Response.java | 323 +- .../GetDestinationMetadataV1Output.java | 340 +- .../models/GetDestinationV1Output.java | 330 +- .../GetDestinationsCatalog200Response.java | 323 +- .../GetDestinationsCatalogV1Output.java | 421 +-- ...tEventsVolumeFromWorkspace200Response.java | 328 +- .../GetEventsVolumeFromWorkspaceV1Output.java | 423 +-- .../GetFilterInDestination200Response.java | 323 +- .../GetFilterInDestinationV1Output.java | 336 +- .../models/GetFunction200Response.java | 316 +- .../publicapi/models/GetFunctionV1Output.java | 330 +- ...GetLatestFromEdgeFunctions200Response.java | 326 +- ...GetLatestFromEdgeFunctionsAlphaOutput.java | 341 +- ...tMessagingSubscriptionFailureResponse.java | 492 +-- ...tMessagingSubscriptionSuccessResponse.java | 643 ++-- .../models/GetRegulation200Response.java | 317 +- .../models/GetRegulationV1Output.java | 330 +- .../models/GetSource200Response.java | 316 +- .../models/GetSource200Response1.java | 316 +- .../models/GetSourceAlphaOutput.java | 330 +- .../models/GetSourceMetadata200Response.java | 321 +- .../models/GetSourceMetadataV1Output.java | 331 +- .../publicapi/models/GetSourceV1Output.java | 330 +- .../models/GetSourcesCatalog200Response.java | 321 +- .../models/GetSourcesCatalogV1Output.java | 406 ++- .../publicapi/models/GetSpace200Response.java | 316 +- .../publicapi/models/GetSpaceAlphaOutput.java | 330 +- ...ubscriptionFromDestination200Response.java | 329 +- ...ubscriptionFromDestinationAlphaOutput.java | 344 +- .../models/GetSubscriptionRequest.java | 481 ++- .../models/GetTrackingPlan200Response.java | 317 +- .../models/GetTrackingPlanV1Output.java | 331 +- .../models/GetTransformation200Response.java | 321 +- .../models/GetTransformationBetaOutput.java | 331 +- .../publicapi/models/GetUser200Response.java | 316 +- .../models/GetUserGroup200Response.java | 317 +- .../models/GetUserGroupV1Output.java | 330 +- .../publicapi/models/GetUserV1Output.java | 330 +- .../models/GetWarehouse200Response.java | 317 +- .../GetWarehouseMetadata200Response.java | 322 +- .../models/GetWarehouseMetadataV1Output.java | 338 +- .../models/GetWarehouseV1Output.java | 330 +- .../GetWarehousesCatalog200Response.java | 322 +- .../models/GetWarehousesCatalogV1Output.java | 419 +-- .../models/GetWorkspace200Response.java | 317 +- .../models/GetWorkspaceV1Output.java | 330 +- .../com/segment/publicapi/models/Group.java | 532 +-- .../models/GroupSourceSettingsV1.java | 536 ++-- .../segment/publicapi/models/Identify.java | 532 +-- .../models/IdentifySourceSettingsV1.java | 539 ++-- .../com/segment/publicapi/models/Input.java | 492 +-- .../models/IntegrationOptionBeta.java | 654 ++-- .../publicapi/models/InvitePermissionV1.java | 500 +-- .../segment/publicapi/models/InviteV1.java | 421 ++- .../com/segment/publicapi/models/Label.java | 457 +-- .../com/segment/publicapi/models/Label1.java | 457 +-- .../com/segment/publicapi/models/Label2.java | 457 +-- .../segment/publicapi/models/LabelAlpha.java | 471 +-- .../com/segment/publicapi/models/LabelV1.java | 471 +-- .../models/ListAuditEvents200Response.java | 317 +- .../models/ListAuditEventsV1Output.java | 402 ++- ...ctedDestinationsFromSource200Response.java | 334 +- ...tedDestinationsFromSource200Response1.java | 335 +- ...ctedDestinationsFromSourceAlphaOutput.java | 428 +-- ...nnectedDestinationsFromSourceV1Output.java | 424 +-- ...nectedSourcesFromWarehouse200Response.java | 332 +- ...ConnectedSourcesFromWarehouseV1Output.java | 419 +-- ...nectedWarehousesFromSource200Response.java | 332 +- ...ectedWarehousesFromSource200Response1.java | 333 +- ...nectedWarehousesFromSourceAlphaOutput.java | 424 +-- ...ConnectedWarehousesFromSourceV1Output.java | 419 +-- ...ricsSummaryFromDestination200Response.java | 338 +- ...tricsSummaryFromDestinationBetaOutput.java | 357 ++- .../models/ListDestinations200Response.java | 317 +- .../models/ListDestinationsV1Output.java | 406 ++- ...ListFiltersFromDestination200Response.java | 326 +- .../ListFiltersFromDestinationV1Output.java | 413 +-- .../publicapi/models/ListFunctionItemV1.java | 845 ++--- .../models/ListFunctions200Response.java | 317 +- .../models/ListFunctionsV1Output.java | 403 ++- .../models/ListInvites200Response.java | 316 +- .../ListInvitesFromUserGroup200Response.java | 324 +- .../ListInvitesFromUserGroupV1Output.java | 413 +-- .../publicapi/models/ListInvitesV1Output.java | 407 ++- .../models/ListLabels200Response.java | 316 +- .../models/ListLabels200Response1.java | 316 +- .../models/ListLabelsAlphaOutput.java | 353 +- .../publicapi/models/ListLabelsV1Output.java | 353 +- .../ListRegulationsFromSource200Response.java | 326 +- .../ListRegulationsFromSourceV1Output.java | 363 +-- .../models/ListRoles200Response.java | 316 +- .../publicapi/models/ListRolesV1Output.java | 403 ++- .../ListRulesFromTrackingPlan200Response.java | 326 +- .../ListRulesFromTrackingPlanV1Output.java | 410 +-- ...ListSchemaSettingsInSource200Response.java | 326 +- .../ListSchemaSettingsInSourceV1Output.java | 401 +-- ...yncsFromWarehouseAndSource200Response.java | 338 +- ...veSyncsFromWarehouseAndSourceV1Output.java | 430 +-- .../models/ListSources200Response.java | 316 +- .../models/ListSources200Response1.java | 317 +- .../models/ListSourcesAlphaOutput.java | 403 ++- ...istSourcesFromTrackingPlan200Response.java | 326 +- .../ListSourcesFromTrackingPlanV1Output.java | 413 +-- .../publicapi/models/ListSourcesV1Output.java | 403 ++- ...bscriptionsFromDestination200Response.java | 331 +- ...bscriptionsFromDestinationAlphaOutput.java | 421 +-- .../models/ListSuppressions200Response.java | 317 +- .../models/ListSuppressionsV1Output.java | 409 ++- .../ListSyncsFromWarehouse200Response.java | 323 +- ...yncsFromWarehouseAndSource200Response.java | 331 +- ...stSyncsFromWarehouseAndSourceV1Output.java | 424 +-- .../ListSyncsFromWarehouseV1Output.java | 411 +-- .../models/ListTrackingPlans200Response.java | 321 +- .../models/ListTrackingPlansV1Output.java | 404 ++- .../ListTransformations200Response.java | 322 +- .../models/ListTransformationsBetaOutput.java | 410 +-- .../models/ListUserGroups200Response.java | 317 +- .../ListUserGroupsFromUser200Response.java | 323 +- .../ListUserGroupsFromUserV1Output.java | 409 ++- .../models/ListUserGroupsV1Output.java | 403 ++- .../models/ListUsers200Response.java | 316 +- .../ListUsersFromUserGroup200Response.java | 323 +- .../ListUsersFromUserGroupV1Output.java | 409 ++- .../publicapi/models/ListUsersV1Output.java | 403 ++- .../models/ListWarehouses200Response.java | 317 +- .../models/ListWarehousesV1Output.java | 403 ++- .../ListWorkspaceRegulations200Response.java | 324 +- .../ListWorkspaceRegulationsV1Output.java | 412 +-- .../com/segment/publicapi/models/Logos.java | 482 +-- .../com/segment/publicapi/models/Logos1.java | 482 +-- .../com/segment/publicapi/models/Logos2.java | 482 +-- .../segment/publicapi/models/LogosBeta.java | 482 +-- .../models/MessageSubscriptionResponse.java | 705 ++-- .../MessageSubscriptionResponseError.java | 407 +-- .../models/MessagesSubscriptionRequest.java | 628 ++-- .../segment/publicapi/models/Metadata.java | 1582 ++++----- .../segment/publicapi/models/Metadata1.java | 825 ++--- .../segment/publicapi/models/Metadata2.java | 642 ++-- .../segment/publicapi/models/MetricBeta.java | 468 ++- .../publicapi/models/MinimalUserGroupV1.java | 400 ++- .../publicapi/models/MinimalUserV1.java | 460 +-- .../publicapi/models/MtuSnapshotV1.java | 697 ++-- .../segment/publicapi/models/Pagination.java | 545 ++-- .../publicapi/models/PaginationInput.java | 403 +-- .../publicapi/models/PaginationOutput.java | 553 ++-- .../publicapi/models/PermissionInputV1.java | 416 ++- .../models/PermissionResourceV1.java | 577 ++-- .../publicapi/models/PermissionV1.java | 560 ++-- .../PreviewDestinationFilter200Response.java | 324 +- .../models/PreviewDestinationFilterV1.java | 437 +-- .../PreviewDestinationFilterV1Input.java | 437 +-- .../PreviewDestinationFilterV1Output.java | 437 +-- .../publicapi/models/PropertyRenameBeta.java | 401 ++- .../PropertyValueTransformationBeta.java | 260 -- .../segment/publicapi/models/Regulation.java | 753 ++--- .../models/RegulationListEntryV1.java | 748 ++--- ...emoveFilterFromDestination200Response.java | 326 +- .../RemoveFilterFromDestinationV1Output.java | 419 +-- .../publicapi/models/RemoveRuleV1.java | 539 ++-- ...emoveRulesFromTrackingPlan200Response.java | 326 +- .../RemoveRulesFromTrackingPlanV1Output.java | 419 +-- ...rceConnectionFromWarehouse200Response.java | 334 +- ...SourceConnectionFromWarehouseV1Output.java | 428 +-- ...moveSourceFromTrackingPlan200Response.java | 328 +- .../RemoveSourceFromTrackingPlanV1Output.java | 421 +-- ...ubscriptionFromDestination200Response.java | 332 +- ...ubscriptionFromDestinationAlphaOutput.java | 427 +-- .../RemoveUsersFromUserGroup200Response.java | 324 +- .../RemoveUsersFromUserGroupV1Output.java | 419 +-- ...edSyncScheduleForWarehouse200Response.java | 337 +- ...vancedSyncScheduleForWarehouseV1Input.java | 380 +-- ...ancedSyncScheduleForWarehouseV1Output.java | 399 +-- .../ReplaceLabelsInSource200Response.java | 322 +- .../ReplaceLabelsInSource200Response1.java | 323 +- .../ReplaceLabelsInSourceAlphaInput.java | 359 +-- .../ReplaceLabelsInSourceAlphaOutput.java | 359 +-- .../models/ReplaceLabelsInSourceV1Input.java | 361 ++- .../models/ReplaceLabelsInSourceV1Output.java | 359 +-- ...agingSubscriptionsInSpaces200Response.java | 335 +- ...sagingSubscriptionsInSpacesAlphaInput.java | 375 +-- ...agingSubscriptionsInSpacesAlphaOutput.java | 505 +-- .../ReplacePermissionsForUser200Response.java | 326 +- ...acePermissionsForUserGroup200Response.java | 329 +- ...ReplacePermissionsForUserGroupV1Input.java | 367 +-- ...eplacePermissionsForUserGroupV1Output.java | 365 +-- .../ReplacePermissionsForUserV1Input.java | 362 ++- .../ReplacePermissionsForUserV1Output.java | 361 +-- ...ReplaceRulesInTrackingPlan200Response.java | 326 +- .../ReplaceRulesInTrackingPlanV1Input.java | 363 ++- .../ReplaceRulesInTrackingPlanV1Output.java | 419 +-- .../ReplaceUsersInUserGroup200Response.java | 324 +- .../ReplaceUsersInUserGroupV1Input.java | 354 +- .../ReplaceUsersInUserGroupV1Output.java | 336 +- .../publicapi/models/RequestError.java | 579 ++-- .../models/RequestErrorEnvelope.java | 353 +- .../segment/publicapi/models/ResourceV1.java | 490 ++- .../com/segment/publicapi/models/RoleV1.java | 458 +-- .../com/segment/publicapi/models/RuleV1.java | 756 ++--- .../segment/publicapi/models/Schedule.java | 400 ++- .../segment/publicapi/models/Schedule1.java | 417 ++- .../segment/publicapi/models/Schedule2.java | 395 ++- .../segment/publicapi/models/Settings.java | 537 ++-- .../segment/publicapi/models/Settings1.java | 537 ++-- .../com/segment/publicapi/models/Source.java | 456 +-- .../com/segment/publicapi/models/Source1.java | 883 ++--- .../com/segment/publicapi/models/Source2.java | 883 ++--- .../com/segment/publicapi/models/Source3.java | 883 ++--- .../com/segment/publicapi/models/Source4.java | 883 ++--- .../com/segment/publicapi/models/Source5.java | 883 ++--- .../com/segment/publicapi/models/Source6.java | 883 ++--- .../models/SourceAPICallSnapshotV1.java | 464 +-- .../segment/publicapi/models/SourceAlpha.java | 883 ++--- .../models/SourceEventVolumeDatapointV1.java | 409 +-- .../publicapi/models/SourceEventVolumeV1.java | 580 ++-- .../publicapi/models/SourceMetadata.java | 821 ++--- .../publicapi/models/SourceMetadataV1.java | 825 ++--- .../models/SourceSettingsOutputV1.java | 540 ++-- .../segment/publicapi/models/SourceV1.java | 883 ++--- .../com/segment/publicapi/models/Space.java | 458 +-- .../publicapi/models/StreamStatusV1.java | 421 +-- .../publicapi/models/Subscription.java | 776 ++--- .../publicapi/models/SupportedFeatures.java | 740 +++-- .../publicapi/models/SupportedMethods.java | 504 ++- .../publicapi/models/SupportedPlatforms.java | 412 ++- .../publicapi/models/SuppressedInner.java | 417 ++- .../publicapi/models/SyncNoticeV1.java | 460 +-- .../com/segment/publicapi/models/SyncV1.java | 798 ++--- .../com/segment/publicapi/models/Track.java | 646 ++-- .../models/TrackSourceSettingsV1.java | 653 ++-- .../publicapi/models/TrackingPlan.java | 786 ++--- .../publicapi/models/TrackingPlan1.java | 786 ++--- .../publicapi/models/TrackingPlanV1.java | 786 ++--- .../publicapi/models/Transformation.java | 851 +++-- .../publicapi/models/Transformation1.java | 852 +++-- .../publicapi/models/Transformation2.java | 852 +++-- .../publicapi/models/TransformationBeta.java | 853 +++-- .../models/UpdateDestination200Response.java | 321 +- .../models/UpdateDestinationV1Input.java | 470 +-- .../models/UpdateDestinationV1Output.java | 331 +- ...UpdateFilterForDestination200Response.java | 326 +- .../UpdateFilterForDestinationV1Input.java | 604 ++-- .../UpdateFilterForDestinationV1Output.java | 338 +- .../models/UpdateFunction200Response.java | 317 +- .../models/UpdateFunctionV1Input.java | 578 ++-- .../models/UpdateFunctionV1Output.java | 330 +- .../UpdateRulesInTrackingPlan200Response.java | 326 +- .../UpdateRulesInTrackingPlanV1Input.java | 362 ++- .../UpdateRulesInTrackingPlanV1Output.java | 418 +-- ...dateSchemaSettingsInSource200Response.java | 328 +- .../UpdateSchemaSettingsInSourceV1Input.java | 551 ++-- .../UpdateSchemaSettingsInSourceV1Output.java | 406 +-- ...eSelectiveSyncForWarehouse200Response.java | 331 +- ...pdateSelectiveSyncForWarehouseV1Input.java | 369 +-- ...dateSelectiveSyncForWarehouseV1Output.java | 506 +-- .../models/UpdateSource200Response.java | 317 +- .../models/UpdateSource200Response1.java | 317 +- .../models/UpdateSourceAlphaInput.java | 509 +-- .../models/UpdateSourceAlphaOutput.java | 331 +- .../publicapi/models/UpdateSourceV1Input.java | 509 +-- .../models/UpdateSourceV1Output.java | 330 +- ...SubscriptionForDestination200Response.java | 331 +- ...eSubscriptionForDestinationAlphaInput.java | 345 +- ...SubscriptionForDestinationAlphaOutput.java | 346 +- .../models/UpdateTrackingPlan200Response.java | 322 +- .../models/UpdateTrackingPlanV1Input.java | 386 ++- .../models/UpdateTrackingPlanV1Output.java | 412 ++- .../UpdateTransformation200Response.java | 322 +- .../models/UpdateTransformationBetaInput.java | 757 +++-- .../UpdateTransformationBetaOutput.java | 336 +- .../models/UpdateUserGroup200Response.java | 317 +- .../models/UpdateUserGroupV1Input.java | 327 +- .../models/UpdateUserGroupV1Output.java | 331 +- .../models/UpdateWarehouse200Response.java | 317 +- .../models/UpdateWarehouseV1Input.java | 458 +-- .../models/UpdateWarehouseV1Output.java | 331 +- .../publicapi/models/UpsertRuleV1.java | 848 ++--- .../com/segment/publicapi/models/User.java | 539 ++-- .../segment/publicapi/models/UserGroup.java | 529 ++- .../segment/publicapi/models/UserGroup1.java | 529 ++- .../segment/publicapi/models/UserGroup2.java | 529 ++- .../segment/publicapi/models/UserGroup3.java | 529 ++- .../segment/publicapi/models/UserGroupV1.java | 529 ++- .../com/segment/publicapi/models/UserV1.java | 539 ++-- .../models/UsersPerSourceSnapshotV1.java | 799 ++--- .../segment/publicapi/models/Warehouse.java | 553 ++-- .../segment/publicapi/models/Warehouse1.java | 553 ++-- .../segment/publicapi/models/Warehouse2.java | 553 ++-- .../models/WarehouseAdvancedSyncV1.java | 381 ++- .../publicapi/models/WarehouseMetadata.java | 643 ++-- .../publicapi/models/WarehouseMetadataV1.java | 643 ++-- .../models/WarehouseSelectiveSyncItemV1.java | 530 +-- .../models/WarehouseSyncOverrideV1.java | 512 +-- .../segment/publicapi/models/WarehouseV1.java | 553 ++-- .../segment/publicapi/models/Workspace.java | 458 +-- .../segment/publicapi/models/WorkspaceV1.java | 458 +-- .../segment/publicapi/api/EchoApiTest.java | 46 +- 508 files changed, 123367 insertions(+), 116161 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java diff --git a/README.md b/README.md index 41ca5edc..08be087c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 32.0.2 +- API version: 32.0.4 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -27,20 +27,6 @@ Building the API client library requires: ## Installation -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - ### Maven users Add this dependency to your project's POM: @@ -49,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 32.0.2 + 32.0.4 compile ``` @@ -65,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:32.0.2" + implementation "com.segment.publicapi:segment-publicapi:32.0.4" } ``` @@ -79,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-32.0.2.jar` +* `target/segment-publicapi-32.0.4.jar` * `target/lib/*.jar` ## Getting Started @@ -108,8 +94,8 @@ public class Example { token.setBearerToken("BEARER TOKEN"); ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); - String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in alpha. - PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in alpha. + String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in v1. + PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. // Make an API call without Pagination try { diff --git a/api/openapi.yaml b/api/openapi.yaml index f1f36e7b..28ad3636 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -13,7 +13,7 @@ info: \ in a Workspace.\n\nSee the next sections for more information on how to use\ \ the Segment Public API.\n" title: Segment Public API - version: 32.0.2 + version: 32.0.4 x-logo: url: https://brand.segment.com/site-assets/images/brand-guidelines/content/twilio/twilio-segment-logo.png backgroundColor: '#ebf4ff' @@ -98,25 +98,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -188,25 +188,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: CONNECTED schema: $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: CONNECTED schema: $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: CONNECTED schema: $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: CONNECTED @@ -269,14 +269,14 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR labels: - key: type value: web schema: - $ref: '#/components/schemas/AddLabelsToSourceAlphaInput' + $ref: '#/components/schemas/AddLabelsToSourceV1Input' application/vnd.segment.v1beta+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR @@ -285,27 +285,29 @@ paths: value: web schema: $ref: '#/components/schemas/AddLabelsToSourceV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR labels: - key: type value: web schema: - $ref: '#/components/schemas/AddLabelsToSourceV1Input' + $ref: '#/components/schemas/AddLabelsToSourceAlphaInput' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: labels: - key: type value: web + - key: environment + value: prod schema: $ref: '#/components/schemas/addLabelsToSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: labels: @@ -314,8 +316,8 @@ paths: - key: environment value: prod schema: - $ref: '#/components/schemas/addLabelsToSource_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/addLabelsToSource_200_response' + application/vnd.segment.v1beta+json: example: data: labels: @@ -324,15 +326,13 @@ paths: - key: environment value: prod schema: - $ref: '#/components/schemas/addLabelsToSource_200_response_1' - application/json: + $ref: '#/components/schemas/addLabelsToSource_200_response' + application/vnd.segment.v1alpha+json: example: data: labels: - key: type value: web - - key: environment - value: prod schema: $ref: '#/components/schemas/addLabelsToSource_200_response_1' description: OK @@ -372,7 +372,7 @@ paths: x-domain-hierarchy: - Connections - Sources - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json put: deprecated: false @@ -390,14 +390,14 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR labels: - key: environment value: prod schema: - $ref: '#/components/schemas/ReplaceLabelsInSourceAlphaInput' + $ref: '#/components/schemas/ReplaceLabelsInSourceV1Input' application/vnd.segment.v1beta+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR @@ -406,19 +406,19 @@ paths: value: prod schema: $ref: '#/components/schemas/ReplaceLabelsInSourceV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR labels: - key: environment value: prod schema: - $ref: '#/components/schemas/ReplaceLabelsInSourceV1Input' + $ref: '#/components/schemas/ReplaceLabelsInSourceAlphaInput' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: labels: @@ -426,23 +426,23 @@ paths: value: prod schema: $ref: '#/components/schemas/replaceLabelsInSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: labels: - key: environment value: prod schema: - $ref: '#/components/schemas/replaceLabelsInSource_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/replaceLabelsInSource_200_response' + application/vnd.segment.v1beta+json: example: data: labels: - key: environment value: prod schema: - $ref: '#/components/schemas/replaceLabelsInSource_200_response_1' - application/json: + $ref: '#/components/schemas/replaceLabelsInSource_200_response' + application/vnd.segment.v1alpha+json: example: data: labels: @@ -487,7 +487,7 @@ paths: x-domain-hierarchy: - Connections - Sources - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /users/{userId}/permissions: post: @@ -512,7 +512,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: userId: sgJDWk3K21k6LE3tLU9nRK permissions: @@ -532,7 +532,7 @@ paths: type: WORKSPACE schema: $ref: '#/components/schemas/AddPermissionsToUserV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: userId: sgJDWk3K21k6LE3tLU9nRK permissions: @@ -546,11 +546,11 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: permissions: - - policyId: 2Qyqtmy96fq1iV81Ax6W9f + - policyId: 2DrXp6Tx3Lcba6CvSqnwyiX5SDH roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: sgJDWk3K21k6LE3tLU9nRK @@ -561,11 +561,11 @@ paths: labels: [] schema: $ref: '#/components/schemas/addPermissionsToUser_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: permissions: - - policyId: 2DrXoOPQa1eaYu1fjfmYT2A3n1g + - policyId: 2DrXp6Tx3Lcba6CvSqnwyiX5SDH roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: sgJDWk3K21k6LE3tLU9nRK @@ -576,11 +576,11 @@ paths: labels: [] schema: $ref: '#/components/schemas/addPermissionsToUser_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: permissions: - - policyId: 2DrXp6Tx3Lcba6CvSqnwyiX5SDH + - policyId: 2DrXoOPQa1eaYu1fjfmYT2A3n1g roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: sgJDWk3K21k6LE3tLU9nRK @@ -591,11 +591,11 @@ paths: labels: [] schema: $ref: '#/components/schemas/addPermissionsToUser_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: permissions: - - policyId: 2DrXp6Tx3Lcba6CvSqnwyiX5SDH + - policyId: 2Qyqtmy96fq1iV81Ax6W9f roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: sgJDWk3K21k6LE3tLU9nRK @@ -643,7 +643,7 @@ paths: x-domain-hierarchy: - Admin - IAM Users - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json put: deprecated: false @@ -667,7 +667,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: userId: sgJDWk3K21k6LE3tLU9nRK permissions: @@ -687,7 +687,7 @@ paths: type: WORKSPACE schema: $ref: '#/components/schemas/ReplacePermissionsForUserV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: userId: sgJDWk3K21k6LE3tLU9nRK permissions: @@ -701,7 +701,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: permissions: @@ -713,7 +713,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/replacePermissionsForUser_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: permissions: @@ -725,7 +725,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/replacePermissionsForUser_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: permissions: @@ -737,7 +737,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/replacePermissionsForUser_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: permissions: @@ -786,7 +786,7 @@ paths: x-domain-hierarchy: - Admin - IAM Users - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /groups/{userGroupId}/permissions: post: @@ -811,7 +811,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm permissions: @@ -831,7 +831,7 @@ paths: type: WORKSPACE schema: $ref: '#/components/schemas/AddPermissionsToUserGroupV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm permissions: @@ -845,11 +845,11 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: permissions: - - policyId: 2DrXoTM7Kxb1rCTZhRko40oN8e0 + - policyId: 2DrXqK6YSJGtQs9PJHcMSneAWIZ roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: bBABwqbaDf2QdwTbW8bNEm @@ -860,11 +860,11 @@ paths: labels: [] schema: $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: permissions: - - policyId: 2DrXpCP88iCLEsmGa9SSrei1C6o + - policyId: 2DrXqK6YSJGtQs9PJHcMSneAWIZ roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: bBABwqbaDf2QdwTbW8bNEm @@ -875,11 +875,11 @@ paths: labels: [] schema: $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: permissions: - - policyId: 2DrXqK6YSJGtQs9PJHcMSneAWIZ + - policyId: 2DrXpCP88iCLEsmGa9SSrei1C6o roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: bBABwqbaDf2QdwTbW8bNEm @@ -890,11 +890,11 @@ paths: labels: [] schema: $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: permissions: - - policyId: 2DrXqK6YSJGtQs9PJHcMSneAWIZ + - policyId: 2DrXoTM7Kxb1rCTZhRko40oN8e0 roleName: Workspace Owner roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS subjectId: bBABwqbaDf2QdwTbW8bNEm @@ -942,7 +942,7 @@ paths: x-domain-hierarchy: - Admin - IAM Groups - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json put: deprecated: false @@ -966,7 +966,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm permissions: @@ -986,7 +986,7 @@ paths: type: WORKSPACE schema: $ref: '#/components/schemas/ReplacePermissionsForUserGroupV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm permissions: @@ -1000,7 +1000,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: permissions: @@ -1012,7 +1012,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: permissions: @@ -1024,7 +1024,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: permissions: @@ -1036,7 +1036,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: permissions: @@ -1085,7 +1085,7 @@ paths: x-domain-hierarchy: - Admin - IAM Groups - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /tracking-plans/{trackingPlanId}/sources: delete: @@ -1108,7 +1108,7 @@ paths: style: simple - description: "The id of the Source associated with the Tracking Plan.\n\n\ Config API note: analogous to `sourceName`.\n\nThis parameter exists in\ - \ alpha." + \ v1." explode: false in: query name: sourceId @@ -1122,25 +1122,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -1206,7 +1206,7 @@ paths: - description: |- Pagination options. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -1217,7 +1217,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: sources: @@ -1247,7 +1247,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: sources: @@ -1277,7 +1277,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: sources: @@ -1307,7 +1307,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: sources: @@ -1395,7 +1395,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP sourceId: qQEHquLrjRDN9j1ByrChyn @@ -1407,7 +1407,7 @@ paths: sourceId: qQEHquLrjRDN9j1ByrChyn schema: $ref: '#/components/schemas/AddSourceToTrackingPlanV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP sourceId: qQEHquLrjRDN9j1ByrChyn @@ -1417,25 +1417,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -1478,7 +1478,7 @@ paths: x-domain-hierarchy: - Protocols - Tracking Plans - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /groups/{userGroupId}/users: get: @@ -1498,7 +1498,7 @@ paths: - description: |- Pagination for members of a group. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -1509,19 +1509,16 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: - users: - - id: sgJDWk3K21k6LE3tLU9nRK - email: papi@segment.com - name: "" + users: [] pagination: current: MA== - totalEntries: 1 + totalEntries: 0 schema: $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: users: [] @@ -1530,7 +1527,7 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: users: [] @@ -1539,13 +1536,16 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: - users: [] + users: + - id: sgJDWk3K21k6LE3tLU9nRK + email: papi@segment.com + name: "" pagination: current: MA== - totalEntries: 0 + totalEntries: 1 schema: $ref: '#/components/schemas/listUsersFromUserGroup_200_response' description: OK @@ -1608,7 +1608,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm emails: @@ -1622,7 +1622,7 @@ paths: - foo@example.com schema: $ref: '#/components/schemas/AddUsersToUserGroupV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm emails: @@ -1633,16 +1633,16 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: userGroup: id: bBABwqbaDf2QdwTbW8bNEm name: PAPI Example Group - memberCount: 2 + memberCount: 1 schema: $ref: '#/components/schemas/addUsersToUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: userGroup: @@ -1651,7 +1651,7 @@ paths: memberCount: 1 schema: $ref: '#/components/schemas/addUsersToUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: userGroup: @@ -1660,13 +1660,13 @@ paths: memberCount: 1 schema: $ref: '#/components/schemas/addUsersToUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: userGroup: id: bBABwqbaDf2QdwTbW8bNEm name: PAPI Example Group - memberCount: 1 + memberCount: 2 schema: $ref: '#/components/schemas/addUsersToUserGroup_200_response' description: OK @@ -1706,7 +1706,7 @@ paths: x-domain-hierarchy: - Admin - IAM Groups - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /spaces/{spaceId}/messaging-subscriptions/batch: post: @@ -1818,7 +1818,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: regulationType: SUPPRESS_ONLY subjectType: OBJECT_ID @@ -1838,7 +1838,7 @@ paths: collection: some-app-collection schema: $ref: '#/components/schemas/CreateCloudSourceRegulationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: regulationType: SUPPRESS_ONLY subjectType: OBJECT_ID @@ -1852,25 +1852,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn @@ -1913,7 +1913,7 @@ paths: x-domain-hierarchy: - Connections - Deletion and Suppression - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /destinations: get: @@ -1924,7 +1924,7 @@ paths: - description: |- Required pagination params for the request. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -1935,7 +1935,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destinations: @@ -2038,7 +2038,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listDestinations_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destinations: @@ -2141,7 +2141,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listDestinations_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: destinations: @@ -2244,7 +2244,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listDestinations_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: destinations: @@ -2394,11 +2394,11 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR metadataId: 547610a5db31d978f14a5c4e - name: Example destination + name: my destination v1 settings: apiKey: XYZ retarget: true @@ -2414,11 +2414,11 @@ paths: retarget: true schema: $ref: '#/components/schemas/CreateDestinationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR metadataId: 547610a5db31d978f14a5c4e - name: my destination v1 + name: Example destination settings: apiKey: XYZ retarget: true @@ -2428,13 +2428,13 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destination: - id: 6307d783e53cc188ebad0d02 + id: 6307d789e53cc13be4ad0d06 enabled: true - name: Example destination + name: my destination v1 settings: apiKey: •••••••••• retarget: true @@ -2496,13 +2496,13 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/createDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destination: - id: 6307d786e53cc10ae7ad0d04 + id: 6307d789e53cc13be4ad0d06 enabled: true - name: my destination beta + name: my destination v1 settings: apiKey: •••••••••• retarget: true @@ -2564,13 +2564,13 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/createDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: destination: - id: 6307d789e53cc13be4ad0d06 + id: 6307d786e53cc10ae7ad0d04 enabled: true - name: my destination v1 + name: my destination beta settings: apiKey: •••••••••• retarget: true @@ -2632,13 +2632,13 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/createDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: destination: - id: 6307d789e53cc13be4ad0d06 + id: 6307d783e53cc188ebad0d02 enabled: true - name: my destination v1 + name: Example destination settings: apiKey: •••••••••• retarget: true @@ -2737,7 +2737,7 @@ paths: x-domain-hierarchy: - Connections - Destinations - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /destinations/{destinationId}/subscriptions: get: @@ -3005,7 +3005,7 @@ paths: - description: |- Pagination options. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -3016,22 +3016,18 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: filters: - id: xx6AySGeFExzdv2Gw2EuhV sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn - if: event = "Order Completed" + if: '!(type = "track")' actions: - - type: DROP_PROPERTIES - fields: - properties: - - userId - - secretValue - title: Order Completed - description: This filter probably does nothing + - type: DROP + title: Allow Track + description: Allows track calls through to the destination. enabled: true createdAt: 2006-01-02T15:04:05.000Z updatedAt: 2006-01-02T15:04:05.000Z @@ -3040,7 +3036,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listFiltersFromDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: filters: @@ -3060,7 +3056,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listFiltersFromDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: filters: @@ -3080,18 +3076,22 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listFiltersFromDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: filters: - id: xx6AySGeFExzdv2Gw2EuhV sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' + if: event = "Order Completed" actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. + - type: DROP_PROPERTIES + fields: + properties: + - userId + - secretValue + title: Order Completed + description: This filter probably does nothing enabled: true createdAt: 2006-01-02T15:04:05.000Z updatedAt: 2006-01-02T15:04:05.000Z @@ -3156,7 +3156,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn @@ -3180,7 +3180,7 @@ paths: enabled: true schema: $ref: '#/components/schemas/CreateFilterForDestinationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn @@ -3196,11 +3196,11 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: filter: - id: 2DrXhZUwilV5MHOwaOTg9NEhGNl + id: 2DrXiU3g89bTXEKys3dhDAYAlIk sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn if: type = "identify" @@ -3213,11 +3213,11 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/createFilterForDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: filter: - id: 2DrXi853HCPQrDXWdqxfi5tS1GX + id: 2DrXiU3g89bTXEKys3dhDAYAlIk sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn if: type = "identify" @@ -3230,11 +3230,11 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/createFilterForDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: filter: - id: 2DrXiU3g89bTXEKys3dhDAYAlIk + id: 2DrXi853HCPQrDXWdqxfi5tS1GX sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn if: type = "identify" @@ -3247,11 +3247,11 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/createFilterForDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: filter: - id: 2DrXiU3g89bTXEKys3dhDAYAlIk + id: 2DrXhZUwilV5MHOwaOTg9NEhGNl sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn if: type = "identify" @@ -3301,7 +3301,7 @@ paths: x-domain-hierarchy: - Connections - Destination Filters - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /functions: get: @@ -3315,7 +3315,7 @@ paths: - description: |- Pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -3324,7 +3324,7 @@ paths: $ref: '#/components/schemas/PaginationInput' style: deepObject - description: "The Function type.\n\nConfig API note: equal to `type`.\n\n\ - This parameter exists in alpha." + This parameter exists in v1." explode: false in: query name: resourceType @@ -3340,7 +3340,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: functions: @@ -3356,7 +3356,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listFunctions_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: functions: @@ -3372,7 +3372,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listFunctions_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: functions: @@ -3388,7 +3388,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listFunctions_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: functions: @@ -3451,7 +3451,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions settings: @@ -3495,7 +3495,7 @@ paths: description: My source function schema: $ref: '#/components/schemas/CreateFunctionV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions settings: @@ -3521,7 +3521,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: function: @@ -3553,7 +3553,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/createFunction_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: function: @@ -3585,7 +3585,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/createFunction_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: function: @@ -3617,7 +3617,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/createFunction_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: function: @@ -3686,7 +3686,7 @@ paths: x-domain-hierarchy: - Connections - Functions - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /functions/{functionId}/deploy: post: @@ -3709,28 +3709,28 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: functionDeployment: status: SUCCESS schema: $ref: '#/components/schemas/createFunctionDeployment_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: functionDeployment: status: SUCCESS schema: $ref: '#/components/schemas/createFunctionDeployment_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: functionDeployment: status: SUCCESS schema: $ref: '#/components/schemas/createFunctionDeployment_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: functionDeployment: @@ -3790,7 +3790,7 @@ paths: - description: |- The list of emails to delete invites for. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: emails @@ -3805,25 +3805,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteInvites_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteInvites_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteInvites_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -3879,7 +3879,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -3890,16 +3890,17 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: pagination: current: MA== - totalEntries: 0 - invites: [] + totalEntries: 1 + invites: + - foo@example.com schema: $ref: '#/components/schemas/listInvites_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: pagination: @@ -3909,7 +3910,7 @@ paths: - foo@example.com schema: $ref: '#/components/schemas/listInvites_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: pagination: @@ -3919,14 +3920,13 @@ paths: - foo@example.com schema: $ref: '#/components/schemas/listInvites_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: pagination: current: MA== - totalEntries: 1 - invites: - - foo@example.com + totalEntries: 0 + invites: [] schema: $ref: '#/components/schemas/listInvites_200_response' description: OK @@ -3981,7 +3981,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: invites: - email: foo@example.com @@ -4003,7 +4003,7 @@ paths: type: WORKSPACE schema: $ref: '#/components/schemas/CreateInvitesV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: invites: - email: foo@example.com @@ -4018,28 +4018,28 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: emails: - foo@example.com schema: $ref: '#/components/schemas/createInvites_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: emails: - foo@example.com schema: $ref: '#/components/schemas/createInvites_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: emails: - foo@example.com schema: $ref: '#/components/schemas/createInvites_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: emails: @@ -4083,7 +4083,7 @@ paths: x-domain-hierarchy: - Admin - IAM Users - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /labels: get: @@ -4094,7 +4094,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: labels: @@ -4104,9 +4104,12 @@ paths: - key: environment value: prod description: "" + - key: type + value: web + description: labels source as web schema: $ref: '#/components/schemas/listLabels_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: labels: @@ -4120,8 +4123,8 @@ paths: value: web description: labels source as web schema: - $ref: '#/components/schemas/listLabels_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/listLabels_200_response' + application/vnd.segment.v1beta+json: example: data: labels: @@ -4135,8 +4138,8 @@ paths: value: web description: labels source as web schema: - $ref: '#/components/schemas/listLabels_200_response_1' - application/json: + $ref: '#/components/schemas/listLabels_200_response' + application/vnd.segment.v1alpha+json: example: data: labels: @@ -4146,9 +4149,6 @@ paths: - key: environment value: prod description: "" - - key: type - value: web - description: labels source as web schema: $ref: '#/components/schemas/listLabels_200_response_1' description: OK @@ -4201,14 +4201,14 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: label: key: environment value: yolo description: an environment for courageous devs schema: - $ref: '#/components/schemas/CreateLabelAlphaInput' + $ref: '#/components/schemas/CreateLabelV1Input' application/vnd.segment.v1beta+json: example: label: @@ -4217,34 +4217,28 @@ paths: description: an environment for courageous devs schema: $ref: '#/components/schemas/CreateLabelV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: label: key: environment value: yolo description: an environment for courageous devs schema: - $ref: '#/components/schemas/CreateLabelV1Input' + $ref: '#/components/schemas/CreateLabelAlphaInput' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: - labels: - - key: environment - value: dev - description: "" - - key: environment - value: prod - description: "" - - key: environment + label: + key: environment value: yolo description: an environment for courageous devs schema: $ref: '#/components/schemas/createLabel_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: label: @@ -4252,8 +4246,8 @@ paths: value: yolo description: an environment for courageous devs schema: - $ref: '#/components/schemas/createLabel_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/createLabel_200_response' + application/vnd.segment.v1beta+json: example: data: label: @@ -4261,12 +4255,18 @@ paths: value: yolo description: an environment for courageous devs schema: - $ref: '#/components/schemas/createLabel_200_response_1' - application/json: + $ref: '#/components/schemas/createLabel_200_response' + application/vnd.segment.v1alpha+json: example: data: - label: - key: environment + labels: + - key: environment + value: dev + description: "" + - key: environment + value: prod + description: "" + - key: environment value: yolo description: an environment for courageous devs schema: @@ -4308,7 +4308,7 @@ paths: x-domain-hierarchy: - Admin - Labels - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /sources: get: @@ -4319,7 +4319,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in beta. + This parameter exists in alpha. explode: false in: query name: pagination @@ -4330,7 +4330,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: sources: @@ -4386,7 +4386,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listSources_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: sources: @@ -4441,8 +4441,8 @@ paths: current: MA== totalEntries: 2 schema: - $ref: '#/components/schemas/listSources_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/listSources_200_response' + application/vnd.segment.v1beta+json: example: data: sources: @@ -4497,8 +4497,8 @@ paths: current: MA== totalEntries: 2 schema: - $ref: '#/components/schemas/listSources_200_response_1' - application/json: + $ref: '#/components/schemas/listSources_200_response' + application/vnd.segment.v1alpha+json: example: data: sources: @@ -4600,15 +4600,14 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: - slug: my-test-source-r-dsv2 - name: My Source + slug: my-test-source-mc1fgb enabled: true metadataId: IqDTy1TpoU settings: {} schema: - $ref: '#/components/schemas/CreateSourceAlphaInput' + $ref: '#/components/schemas/CreateSourceV1Input' application/vnd.segment.v1beta+json: example: slug: my-test-source-0opjqz @@ -4617,29 +4616,62 @@ paths: settings: {} schema: $ref: '#/components/schemas/CreateSourceV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: - slug: my-test-source-mc1fgb + slug: my-test-source-r-dsv2 + name: My Source enabled: true metadataId: IqDTy1TpoU settings: {} schema: - $ref: '#/components/schemas/CreateSourceV1Input' + $ref: '#/components/schemas/CreateSourceAlphaInput' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: source: - id: 3aJbFPLDssh5dtKjy3Drnh - slug: my-test-source-r-dsv2 - name: My Source + id: b3nk6CisJ6zQVKb9KjbFjV + slug: my-test-source-mc1fgb + name: my-test-source-mc1fgb workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: true writeKeys: - - wS1qvVNUj2TaBZFR52sT5GS7jxdDSUM8 + - IGA8Ur1riMfSQeAbHNKua70oMagjBuu8 + metadata: + id: IqDTy1TpoU + slug: javascript + name: Javascript + categories: + - Website + description: "This is our most flexible and powerful tracking\ + \ system, using analytics.js. Track and analyze information\ + \ about your visitors and customers, and every action that\ + \ they take, in any of our 140 integrations, business intelligence\ + \ tools, or directly with SQL tools." + logos: + default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq + alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq + mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd + options: [] + isCloudEventSource: false + settings: {} + labels: [] + schema: + $ref: '#/components/schemas/createSource_200_response' + application/json: + example: + data: + source: + id: b3nk6CisJ6zQVKb9KjbFjV + slug: my-test-source-mc1fgb + name: my-test-source-mc1fgb + workspaceId: 9aQ1Lj62S4bomZKLF4DPqW + enabled: true + writeKeys: + - IGA8Ur1riMfSQeAbHNKua70oMagjBuu8 metadata: id: IqDTy1TpoU slug: javascript @@ -4692,50 +4724,18 @@ paths: settings: {} labels: [] schema: - $ref: '#/components/schemas/createSource_200_response_1' - application/vnd.segment.v1+json: - example: - data: - source: - id: b3nk6CisJ6zQVKb9KjbFjV - slug: my-test-source-mc1fgb - name: my-test-source-mc1fgb - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - IGA8Ur1riMfSQeAbHNKua70oMagjBuu8 - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/createSource_200_response_1' - application/json: + $ref: '#/components/schemas/createSource_200_response' + application/vnd.segment.v1alpha+json: example: data: source: - id: b3nk6CisJ6zQVKb9KjbFjV - slug: my-test-source-mc1fgb - name: my-test-source-mc1fgb + id: 3aJbFPLDssh5dtKjy3Drnh + slug: my-test-source-r-dsv2 + name: My Source workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: true writeKeys: - - IGA8Ur1riMfSQeAbHNKua70oMagjBuu8 + - wS1qvVNUj2TaBZFR52sT5GS7jxdDSUM8 metadata: id: IqDTy1TpoU slug: javascript @@ -4794,7 +4794,7 @@ paths: x-domain-hierarchy: - Connections - Sources - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /regulations/sources/{sourceId}: get: @@ -4814,7 +4814,7 @@ paths: - description: |- The status on which to filter returned regulations. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: status @@ -4835,7 +4835,7 @@ paths: - description: |- The regulation types on which to filter returned regulations. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: regulationTypes @@ -4857,7 +4857,7 @@ paths: - description: |- Pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -4868,7 +4868,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: regulations: @@ -4882,7 +4882,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listRegulationsFromSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: regulations: @@ -4896,7 +4896,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listRegulationsFromSource_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: regulations: @@ -4910,7 +4910,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listRegulationsFromSource_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: regulations: @@ -4981,7 +4981,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: regulationType: SUPPRESS_ONLY subjectType: USER_ID @@ -4999,7 +4999,7 @@ paths: sourceId: qQEHquLrjRDN9j1ByrChyn schema: $ref: '#/components/schemas/CreateSourceRegulationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: regulationType: SUPPRESS_ONLY subjectType: USER_ID @@ -5012,25 +5012,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createSourceRegulation_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createSourceRegulation_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createSourceRegulation_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn @@ -5073,7 +5073,7 @@ paths: x-domain-hierarchy: - Connections - Deletion and Suppression - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /tracking-plans: get: @@ -5085,7 +5085,7 @@ paths: operationId: listTrackingPlans parameters: - description: "Requests Tracking Plans of a certain type. If omitted, lists\ - \ all types.\n\nThis parameter exists in alpha." + \ all types.\n\nThis parameter exists in v1." explode: false in: query name: type @@ -5104,7 +5104,7 @@ paths: - description: |- Pagination options. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -5115,7 +5115,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: trackingPlans: @@ -5131,7 +5131,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listTrackingPlans_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: trackingPlans: @@ -5147,7 +5147,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listTrackingPlans_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: trackingPlans: @@ -5163,7 +5163,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listTrackingPlans_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: trackingPlans: @@ -5227,7 +5227,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: name: New TP type: LIVE @@ -5239,7 +5239,7 @@ paths: type: LIVE schema: $ref: '#/components/schemas/CreateTrackingPlanV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: name: New TP type: LIVE @@ -5249,7 +5249,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: trackingPlan: @@ -5263,7 +5263,7 @@ paths: createdAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/createTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: trackingPlan: @@ -5277,7 +5277,7 @@ paths: createdAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/createTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: trackingPlan: @@ -5291,7 +5291,7 @@ paths: createdAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/createTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: trackingPlan: @@ -5342,7 +5342,7 @@ paths: x-domain-hierarchy: - Protocols - Tracking Plans - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /transformations: get: @@ -5356,7 +5356,7 @@ paths: - description: |- Pagination options. - This parameter exists in alpha. + This parameter exists in beta. explode: false in: query name: pagination @@ -5367,10 +5367,22 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: data: transformations: + - id: 2DrXmjwFYTgYxxJdCmvz8O0Zu7F + workspaceId: 9aQ1Lj62S4bomZKLF4DPqW + name: Name of the new transformation + enabled: true + sourceId: qQEHquLrjRDN9j1ByrChyn + if: event = 'Example Event Alpha' + newEventName: new-event-name + propertyRenames: + - oldName: old-name + newName: new-name + - oldName: another-name-old + newName: another-name-new - id: c5EmPMhTGmgwoas8YCKXgs workspaceId: 9aQ1Lj62S4bomZKLF4DPqW name: Order cancelled event rename in destination @@ -5390,13 +5402,15 @@ paths: propertyRenames: [] - id: pHrD51Ds35Zjfka84yXQE6 workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked edit track event + name: updated-name enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'User Clicked' + sourceId: rh5BDZp6QDHvXFCkibm1pR + destinationMetadataId: 547610a5db31d978f14a5c4e + if: event="my-event" + newEventName: my-updated-event propertyRenames: - - oldName: Category - newName: category + - oldName: old-property + newName: new-property - id: rBoBnPKiAek36M192XJsYQ workspaceId: 9aQ1Lj62S4bomZKLF4DPqW name: User clicked edit identify event @@ -5408,25 +5422,13 @@ paths: newName: group pagination: current: MA== - totalEntries: 4 + totalEntries: 5 schema: $ref: '#/components/schemas/listTransformations_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: data: transformations: - - id: 2DrXmjwFYTgYxxJdCmvz8O0Zu7F - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: Name of the new transformation - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'Example Event Alpha' - newEventName: new-event-name - propertyRenames: - - oldName: old-name - newName: new-name - - oldName: another-name-old - newName: another-name-new - id: c5EmPMhTGmgwoas8YCKXgs workspaceId: 9aQ1Lj62S4bomZKLF4DPqW name: Order cancelled event rename in destination @@ -5446,15 +5448,13 @@ paths: propertyRenames: [] - id: pHrD51Ds35Zjfka84yXQE6 workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: updated-name + name: User clicked edit track event enabled: true - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event + sourceId: qQEHquLrjRDN9j1ByrChyn + if: event = 'User Clicked' propertyRenames: - - oldName: old-property - newName: new-property + - oldName: Category + newName: category - id: rBoBnPKiAek36M192XJsYQ workspaceId: 9aQ1Lj62S4bomZKLF4DPqW name: User clicked edit identify event @@ -5466,7 +5466,7 @@ paths: newName: group pagination: current: MA== - totalEntries: 5 + totalEntries: 4 schema: $ref: '#/components/schemas/listTransformations_200_response' description: OK @@ -5518,7 +5518,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: name: Name of the new transformation sourceId: qQEHquLrjRDN9j1ByrChyn @@ -5529,10 +5529,10 @@ paths: newName: new-name - oldName: another-name-old newName: another-name-new - if: event = 'Example Event Alpha' + if: event = 'Example Event Beta' schema: $ref: '#/components/schemas/CreateTransformationBetaInput' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: name: Name of the new transformation sourceId: qQEHquLrjRDN9j1ByrChyn @@ -5543,23 +5543,23 @@ paths: newName: new-name - oldName: another-name-old newName: another-name-new - if: event = 'Example Event Beta' + if: event = 'Example Event Alpha' schema: $ref: '#/components/schemas/CreateTransformationBetaInput' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: data: transformation: - id: 2DrXmjwFYTgYxxJdCmvz8O0Zu7F + id: 2DrXmmo9lVoky2aObFR0XIh23Px workspaceId: 9aQ1Lj62S4bomZKLF4DPqW name: Name of the new transformation enabled: true sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'Example Event Alpha' + if: event = 'Example Event Beta' newEventName: new-event-name propertyRenames: - oldName: old-name @@ -5568,16 +5568,16 @@ paths: newName: another-name-new schema: $ref: '#/components/schemas/createTransformation_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: data: transformation: - id: 2DrXmmo9lVoky2aObFR0XIh23Px + id: 2DrXmjwFYTgYxxJdCmvz8O0Zu7F workspaceId: 9aQ1Lj62S4bomZKLF4DPqW name: Name of the new transformation enabled: true sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'Example Event Beta' + if: event = 'Example Event Alpha' newEventName: new-event-name propertyRenames: - oldName: old-name @@ -5623,7 +5623,7 @@ paths: x-domain-hierarchy: - Protocols - Transformations - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1beta+json x-accepts: application/json /groups: get: @@ -5634,7 +5634,7 @@ paths: - description: |- Pagination for user groups. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -5645,13 +5645,13 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: userGroups: - id: bBABwqbaDf2QdwTbW8bNEm - name: Public API Group - memberCount: 1 + name: PAPI Example Group + memberCount: 0 permissions: - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS roleName: Workspace Owner @@ -5663,7 +5663,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listUserGroups_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: userGroups: @@ -5681,7 +5681,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listUserGroups_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: userGroups: @@ -5699,13 +5699,13 @@ paths: current: MA== schema: $ref: '#/components/schemas/listUserGroups_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: userGroups: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 + name: Public API Group + memberCount: 1 permissions: - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS roleName: Workspace Owner @@ -5768,9 +5768,9 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: - name: New User Group 8mo8ghLQxS + name: New User Group fkHWOE-a_p schema: $ref: '#/components/schemas/CreateUserGroupV1Input' application/vnd.segment.v1beta+json: @@ -5778,48 +5778,48 @@ paths: name: New User Group R18j9ZA9TR schema: $ref: '#/components/schemas/CreateUserGroupV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: - name: New User Group fkHWOE-a_p + name: New User Group 8mo8ghLQxS schema: $ref: '#/components/schemas/CreateUserGroupV1Input' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: userGroup: - id: 2DrXo6GpGW9LpRTp1naKkZcV4bP - name: New User Group 8mo8ghLQxS + id: 2DrXpkze3NH3ySNB6tUUs1TbJbo + name: New User Group fkHWOE-a_p memberCount: 0 schema: $ref: '#/components/schemas/createUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: userGroup: - id: 2DrXoyNnhFM85FbcRqzACdhP6t7 - name: New User Group R18j9ZA9TR + id: 2DrXpkze3NH3ySNB6tUUs1TbJbo + name: New User Group fkHWOE-a_p memberCount: 0 schema: $ref: '#/components/schemas/createUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: userGroup: - id: 2DrXpkze3NH3ySNB6tUUs1TbJbo - name: New User Group fkHWOE-a_p + id: 2DrXoyNnhFM85FbcRqzACdhP6t7 + name: New User Group R18j9ZA9TR memberCount: 0 schema: $ref: '#/components/schemas/createUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: userGroup: - id: 2DrXpkze3NH3ySNB6tUUs1TbJbo - name: New User Group fkHWOE-a_p + id: 2DrXo6GpGW9LpRTp1naKkZcV4bP + name: New User Group 8mo8ghLQxS memberCount: 0 schema: $ref: '#/components/schemas/createUserGroup_200_response' @@ -5860,7 +5860,7 @@ paths: x-domain-hierarchy: - Admin - IAM Groups - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /warehouses/validation: post: @@ -5872,7 +5872,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: metadataId: 55d3d3aea3c settings: @@ -5894,7 +5894,7 @@ paths: password: test schema: $ref: '#/components/schemas/CreateValidationInWarehouseV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: metadataId: 55d3d3aea3c settings: @@ -5909,25 +5909,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: CONNECTED schema: $ref: '#/components/schemas/createValidationInWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: CONNECTED schema: $ref: '#/components/schemas/createValidationInWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: CONNECTED schema: $ref: '#/components/schemas/createValidationInWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: CONNECTED @@ -5970,7 +5970,7 @@ paths: x-domain-hierarchy: - Connections - Warehouses - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /warehouses: get: @@ -5981,7 +5981,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -5992,7 +5992,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehouses: @@ -6065,7 +6065,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listWarehouses_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehouses: @@ -6138,7 +6138,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listWarehouses_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: warehouses: @@ -6211,7 +6211,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listWarehouses_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: warehouses: @@ -6331,7 +6331,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: metadataId: aea3c55dsz settings: {} @@ -6343,7 +6343,7 @@ paths: settings: {} schema: $ref: '#/components/schemas/CreateWarehouseV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: metadataId: aea3c55dsz settings: {} @@ -6353,11 +6353,11 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehouse: - id: rjZRNacj6LHGbW5pYGePhK + id: 6o4HsR4fzmfczk6gQ616B workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: true metadata: @@ -6392,11 +6392,11 @@ paths: name: Redshift_2 schema: $ref: '#/components/schemas/createWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehouse: - id: ekNpN2fHBmJ16nUfsn3B5H + id: 6o4HsR4fzmfczk6gQ616B workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: true metadata: @@ -6431,11 +6431,11 @@ paths: name: Redshift_2 schema: $ref: '#/components/schemas/createWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: warehouse: - id: 6o4HsR4fzmfczk6gQ616B + id: ekNpN2fHBmJ16nUfsn3B5H workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: true metadata: @@ -6470,11 +6470,11 @@ paths: name: Redshift_2 schema: $ref: '#/components/schemas/createWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: warehouse: - id: 6o4HsR4fzmfczk6gQ616B + id: rjZRNacj6LHGbW5pYGePhK workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: true metadata: @@ -6546,7 +6546,7 @@ paths: x-domain-hierarchy: - Connections - Warehouses - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /regulations: get: @@ -6557,7 +6557,7 @@ paths: - description: |- The status on which to filter the returned regulations. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: status @@ -6578,7 +6578,7 @@ paths: - description: |- The regulation types on which to filter returned regulations. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: regulationTypes @@ -6600,7 +6600,7 @@ paths: - description: |- Pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -6611,7 +6611,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: regulations: @@ -6625,7 +6625,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: regulations: @@ -6639,7 +6639,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: regulations: @@ -6653,7 +6653,7 @@ paths: current: MQ== schema: $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: regulations: @@ -6715,7 +6715,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: regulationType: SUPPRESS_ONLY subjectType: USER_ID @@ -6731,7 +6731,7 @@ paths: - test_user_id_1 schema: $ref: '#/components/schemas/CreateWorkspaceRegulationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: regulationType: SUPPRESS_ONLY subjectType: USER_ID @@ -6743,25 +6743,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn schema: $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: regulateId: 1qJkfE1tpwvQcklImGksLN629wn @@ -6804,7 +6804,7 @@ paths: x-domain-hierarchy: - Connections - Deletion and Suppression - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /destinations/{destinationId}: delete: @@ -6826,25 +6826,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -6909,17 +6909,49 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destination: id: fP7qoQw2HTWt9WdMr718gn - enabled: true + enabled: false name: "" settings: + anonymizeIp: false + classic: false + contentGroupings: {} + dimensions: {} + domain: "" + doubleClick: false + enableServerIdentify: false + enhancedEcommerce: false + enhancedLinkAttribution: false + identifyCategory: "" + identifyEventName: "" + ignoredReferrers: [] + includeSearch: false + metrics: {} mobileTrackingId: "123" + nameTracker: false + nonInteraction: false + optimize: "" + preferAnonymousId: false + protocolMappings: {} + reportUncaughtExceptions: false + resetCustomDimensionsOnPage: [] + sampleRate: 100 + sendUserId: false + serversideClassic: false serversideTrackingId: "123" + setAllMappedProps: true + siteSpeedSampleRate: 1 + topLevelContextMapping: false + trackCategorizedPages: true + trackNamedPages: true trackingId: "123" + typeOverride: false + useGoogleAmpClientId: false + userDeletion: "" metadata: id: 54521fd725e721e32a72eebb name: Google Universal Analytics @@ -7349,7 +7381,7 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/getDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destination: @@ -7821,7 +7853,7 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/getDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: destination: @@ -8293,49 +8325,17 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/getDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: destination: id: fP7qoQw2HTWt9WdMr718gn - enabled: false + enabled: true name: "" settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" metadata: id: 54521fd725e721e32a72eebb name: Google Universal Analytics @@ -8826,7 +8826,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: destinationId: fP7qoQw2HTWt9WdMr718gn enabled: false @@ -8838,7 +8838,7 @@ paths: enabled: false schema: $ref: '#/components/schemas/UpdateDestinationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: destinationId: fP7qoQw2HTWt9WdMr718gn enabled: false @@ -8848,7 +8848,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destination: @@ -9320,7 +9320,7 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/updateDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destination: @@ -9792,7 +9792,7 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/updateDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: destination: @@ -10264,7 +10264,7 @@ paths: sourceId: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/updateDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: destination: @@ -10773,7 +10773,7 @@ paths: x-domain-hierarchy: - Connections - Destinations - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /functions/{functionId}: delete: @@ -10795,25 +10795,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteFunction_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteFunction_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteFunction_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -10876,7 +10876,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: function: @@ -10908,7 +10908,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/getFunction_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: function: @@ -10940,7 +10940,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/getFunction_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: function: @@ -10972,7 +10972,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/getFunction_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: function: @@ -11061,7 +11061,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: functionId: sfnc_wXzcDGFR3KmjLDrtSawNHf code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions @@ -11075,7 +11075,7 @@ paths: logoUrl: https://placekitten.com/200/139 schema: $ref: '#/components/schemas/UpdateFunctionV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: functionId: sfnc_wXzcDGFR3KmjLDrtSawNHf code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions @@ -11086,7 +11086,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: function: @@ -11118,7 +11118,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/updateFunction_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: function: @@ -11150,7 +11150,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/updateFunction_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: function: @@ -11182,7 +11182,7 @@ paths: resourceType: SOURCE schema: $ref: '#/components/schemas/updateFunction_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: function: @@ -11251,7 +11251,7 @@ paths: x-domain-hierarchy: - Connections - Functions - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /labels/{key}/{value}: delete: @@ -11285,25 +11285,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteLabel_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: - $ref: '#/components/schemas/deleteLabel_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/deleteLabel_200_response' + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: - $ref: '#/components/schemas/deleteLabel_200_response_1' - application/json: + $ref: '#/components/schemas/deleteLabel_200_response' + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -11368,25 +11368,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteRegulation_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteRegulation_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteRegulation_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -11448,7 +11448,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: regulation: @@ -11460,7 +11460,7 @@ paths: streamStatus: [] schema: $ref: '#/components/schemas/getRegulation_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: regulation: @@ -11472,7 +11472,7 @@ paths: streamStatus: [] schema: $ref: '#/components/schemas/getRegulation_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: regulation: @@ -11484,7 +11484,7 @@ paths: streamStatus: [] schema: $ref: '#/components/schemas/getRegulation_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: regulation: @@ -11554,25 +11554,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: - $ref: '#/components/schemas/deleteSource_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/deleteSource_200_response' + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: - $ref: '#/components/schemas/deleteSource_200_response_1' - application/json: + $ref: '#/components/schemas/deleteSource_200_response' + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -11633,7 +11633,34 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: + example: + data: + source: + id: qQEHquLrjRDN9j1ByrChyn + slug: ios + name: "" + workspaceId: 9aQ1Lj62S4bomZKLF4DPqW + enabled: true + writeKeys: + - 3YdEudTwjouyC5WPjpbTik + metadata: + id: UBrsG9RVzw + slug: ios + name: iOS + categories: + - Mobile + description: "" + logos: + default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u + alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u + options: [] + isCloudEventSource: false + settings: {} + labels: [] + schema: + $ref: '#/components/schemas/getSource_200_response' + application/json: example: data: source: @@ -11661,60 +11688,33 @@ paths: schema: $ref: '#/components/schemas/getSource_200_response' application/vnd.segment.v1beta+json: - example: - data: - source: - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/getSource_200_response_1' - application/vnd.segment.v1+json: - example: - data: - source: - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/getSource_200_response_1' - application/json: + example: + data: + source: + id: qQEHquLrjRDN9j1ByrChyn + slug: ios + name: "" + workspaceId: 9aQ1Lj62S4bomZKLF4DPqW + enabled: true + writeKeys: + - 3YdEudTwjouyC5WPjpbTik + metadata: + id: UBrsG9RVzw + slug: ios + name: iOS + categories: + - Mobile + description: "" + logos: + default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u + alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u + options: [] + isCloudEventSource: false + settings: {} + labels: [] + schema: + $ref: '#/components/schemas/getSource_200_response' + application/vnd.segment.v1alpha+json: example: data: source: @@ -11798,13 +11798,13 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: - sourceId: piTVHEYNrRgBMM1uQGCPbK + sourceId: 3uCNQopSsSnXeAHAwYKZqF name: My updated source enabled: false schema: - $ref: '#/components/schemas/UpdateSourceAlphaInput' + $ref: '#/components/schemas/UpdateSourceV1Input' application/vnd.segment.v1beta+json: example: sourceId: kgPS3ESM35Ez5UQ7nvfJbC @@ -11812,28 +11812,28 @@ paths: enabled: false schema: $ref: '#/components/schemas/UpdateSourceV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: - sourceId: 3uCNQopSsSnXeAHAwYKZqF + sourceId: piTVHEYNrRgBMM1uQGCPbK name: My updated source enabled: false schema: - $ref: '#/components/schemas/UpdateSourceV1Input' + $ref: '#/components/schemas/UpdateSourceAlphaInput' required: true responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: source: - id: piTVHEYNrRgBMM1uQGCPbK - slug: update-source-slug-gqd2dx + id: 3uCNQopSsSnXeAHAwYKZqF + slug: update-source-slug-a-yoz5 name: My updated source workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: false writeKeys: - - VkV0fu40bXSSNJtqnQEzonkzLOWj2llN + - 4czIPB0pGAv89HEJZDYUa5XomDi5dj4E metadata: id: IqDTy1TpoU slug: javascript @@ -11855,17 +11855,17 @@ paths: labels: [] schema: $ref: '#/components/schemas/updateSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: source: - id: kgPS3ESM35Ez5UQ7nvfJbC - slug: update-source-slug-wb_c2h + id: 3uCNQopSsSnXeAHAwYKZqF + slug: update-source-slug-a-yoz5 name: My updated source workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: false writeKeys: - - HqFwQdNCYOAsLPE8FQEgBo6RwHALu7lj + - 4czIPB0pGAv89HEJZDYUa5XomDi5dj4E metadata: id: IqDTy1TpoU slug: javascript @@ -11886,18 +11886,18 @@ paths: settings: {} labels: [] schema: - $ref: '#/components/schemas/updateSource_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/updateSource_200_response' + application/vnd.segment.v1beta+json: example: data: source: - id: 3uCNQopSsSnXeAHAwYKZqF - slug: update-source-slug-a-yoz5 + id: kgPS3ESM35Ez5UQ7nvfJbC + slug: update-source-slug-wb_c2h name: My updated source workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: false writeKeys: - - 4czIPB0pGAv89HEJZDYUa5XomDi5dj4E + - HqFwQdNCYOAsLPE8FQEgBo6RwHALu7lj metadata: id: IqDTy1TpoU slug: javascript @@ -11918,18 +11918,18 @@ paths: settings: {} labels: [] schema: - $ref: '#/components/schemas/updateSource_200_response_1' - application/json: + $ref: '#/components/schemas/updateSource_200_response' + application/vnd.segment.v1alpha+json: example: data: source: - id: 3uCNQopSsSnXeAHAwYKZqF - slug: update-source-slug-a-yoz5 + id: piTVHEYNrRgBMM1uQGCPbK + slug: update-source-slug-gqd2dx name: My updated source workspaceId: 9aQ1Lj62S4bomZKLF4DPqW enabled: false writeKeys: - - 4czIPB0pGAv89HEJZDYUa5XomDi5dj4E + - VkV0fu40bXSSNJtqnQEzonkzLOWj2llN metadata: id: IqDTy1TpoU slug: javascript @@ -11988,7 +11988,7 @@ paths: x-domain-hierarchy: - Connections - Sources - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /tracking-plans/{trackingPlanId}: delete: @@ -12011,25 +12011,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -12093,7 +12093,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: trackingPlan: @@ -12107,7 +12107,7 @@ paths: createdAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/getTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: trackingPlan: @@ -12121,7 +12121,7 @@ paths: createdAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/getTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: trackingPlan: @@ -12135,7 +12135,7 @@ paths: createdAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/getTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: trackingPlan: @@ -12206,7 +12206,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP name: Updated TP @@ -12218,7 +12218,7 @@ paths: name: Updated TP schema: $ref: '#/components/schemas/UpdateTrackingPlanV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP name: Updated TP @@ -12228,25 +12228,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/updateTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/updateTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/updateTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -12289,7 +12289,7 @@ paths: x-domain-hierarchy: - Protocols - Tracking Plans - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /transformations/{transformationId}: delete: @@ -12313,13 +12313,13 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteTransformation_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -12382,36 +12382,36 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: data: transformation: id: pHrD51Ds35Zjfka84yXQE6 workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked edit track event + name: updated-name enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'User Clicked' + sourceId: rh5BDZp6QDHvXFCkibm1pR + destinationMetadataId: 547610a5db31d978f14a5c4e + if: event="my-event" + newEventName: my-updated-event propertyRenames: - - oldName: Category - newName: category + - oldName: old-property + newName: new-property schema: $ref: '#/components/schemas/getTransformation_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: data: transformation: id: pHrD51Ds35Zjfka84yXQE6 workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: updated-name + name: User clicked edit track event enabled: true - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event + sourceId: qQEHquLrjRDN9j1ByrChyn + if: event = 'User Clicked' propertyRenames: - - oldName: old-property - newName: new-property + - oldName: Category + newName: category schema: $ref: '#/components/schemas/getTransformation_200_response' description: OK @@ -12472,7 +12472,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: transformationId: pHrD51Ds35Zjfka84yXQE6 name: updated-name @@ -12486,7 +12486,7 @@ paths: oldName: old-property schema: $ref: '#/components/schemas/UpdateTransformationBetaInput' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: transformationId: pHrD51Ds35Zjfka84yXQE6 name: updated-name @@ -12504,7 +12504,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: data: transformation: @@ -12521,7 +12521,7 @@ paths: newName: new-property schema: $ref: '#/components/schemas/updateTransformation_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: data: transformation: @@ -12575,7 +12575,7 @@ paths: x-domain-hierarchy: - Protocols - Transformations - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1beta+json x-accepts: application/json /groups/{userGroupId}: delete: @@ -12601,25 +12601,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -12680,13 +12680,13 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: userGroup: id: bBABwqbaDf2QdwTbW8bNEm - name: Public API Group - memberCount: 1 + name: PAPI Example Group + memberCount: 0 permissions: - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS roleName: Workspace Owner @@ -12696,7 +12696,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/getUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: userGroup: @@ -12712,7 +12712,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/getUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: userGroup: @@ -12728,13 +12728,13 @@ paths: labels: [] schema: $ref: '#/components/schemas/getUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: userGroup: id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 + name: Public API Group + memberCount: 1 permissions: - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS roleName: Workspace Owner @@ -12804,7 +12804,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm name: PAPI Example Group @@ -12816,7 +12816,7 @@ paths: name: PAPI Example Group schema: $ref: '#/components/schemas/UpdateUserGroupV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: userGroupId: bBABwqbaDf2QdwTbW8bNEm name: PAPI Example Group @@ -12826,16 +12826,16 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: userGroup: id: bBABwqbaDf2QdwTbW8bNEm name: PAPI Example Group - memberCount: 1 + memberCount: 0 schema: $ref: '#/components/schemas/updateUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: userGroup: @@ -12844,7 +12844,7 @@ paths: memberCount: 0 schema: $ref: '#/components/schemas/updateUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: userGroup: @@ -12853,13 +12853,13 @@ paths: memberCount: 0 schema: $ref: '#/components/schemas/updateUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: userGroup: id: bBABwqbaDf2QdwTbW8bNEm name: PAPI Example Group - memberCount: 0 + memberCount: 1 schema: $ref: '#/components/schemas/updateUserGroup_200_response' description: OK @@ -12899,7 +12899,7 @@ paths: x-domain-hierarchy: - Admin - IAM Groups - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /users: delete: @@ -12916,7 +12916,7 @@ paths: - description: |- The ids of the users to remove. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: userIds @@ -12931,25 +12931,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteUsers_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteUsers_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteUsers_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -13001,7 +13001,7 @@ paths: - description: |- Pagination for users. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -13012,7 +13012,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: users: @@ -13027,7 +13027,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listUsers_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: users: @@ -13042,7 +13042,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listUsers_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: users: @@ -13057,7 +13057,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listUsers_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: users: @@ -13130,25 +13130,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/deleteWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -13209,7 +13209,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehouse: @@ -13247,7 +13247,7 @@ paths: settings: {} schema: $ref: '#/components/schemas/getWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehouse: @@ -13285,7 +13285,7 @@ paths: settings: {} schema: $ref: '#/components/schemas/getWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: warehouse: @@ -13323,7 +13323,7 @@ paths: settings: {} schema: $ref: '#/components/schemas/getWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: warehouse: @@ -13417,10 +13417,10 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: warehouseId: kjU72LCJexvrqL7G4TMHHN - name: API Example Test Warehouse Update + name: Redshift Dev settings: host: aws.redshift.dev schema: @@ -13433,10 +13433,10 @@ paths: host: aws.redshift.dev schema: $ref: '#/components/schemas/UpdateWarehouseV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: warehouseId: kjU72LCJexvrqL7G4TMHHN - name: Redshift Dev + name: API Example Test Warehouse Update settings: host: aws.redshift.dev schema: @@ -13445,7 +13445,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehouse: @@ -13482,10 +13482,10 @@ paths: type: string settings: host: aws.redshift.dev - name: API Example Test Warehouse Update + name: Redshift Dev schema: $ref: '#/components/schemas/updateWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehouse: @@ -13525,7 +13525,7 @@ paths: name: Redshift Dev schema: $ref: '#/components/schemas/updateWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: warehouse: @@ -13565,7 +13565,7 @@ paths: name: Redshift Dev schema: $ref: '#/components/schemas/updateWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: warehouse: @@ -13602,7 +13602,7 @@ paths: type: string settings: host: aws.redshift.dev - name: Redshift Dev + name: API Example Test Warehouse Update schema: $ref: '#/components/schemas/updateWarehouse_200_response' description: OK @@ -13642,7 +13642,7 @@ paths: x-domain-hierarchy: - Connections - Warehouses - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /sources/{sourceId}/edge-functions/disable: patch: @@ -13724,7 +13724,7 @@ paths: - description: |- Sets the response `message` field. The response contains this field's entry. - This parameter exists in v1. + This parameter exists in alpha. explode: false in: query name: message @@ -13736,7 +13736,7 @@ paths: type: string style: deepObject - description: "The desired response delay, in milliseconds.\n\nThis parameter\ - \ exists in v1." + \ exists in alpha." explode: false in: query name: delay @@ -13747,7 +13747,7 @@ paths: type: number style: deepObject - description: "If `true`, returns an HTTP `4xx` error that contains the string\ - \ in `message`.\n\nThis parameter exists in v1." + \ in `message`.\n\nThis parameter exists in alpha." explode: false in: query name: triggerError @@ -13760,7 +13760,7 @@ paths: style: deepObject - description: "If `true`, returns an HTTP `4xx` error that contains the value\ \ of the `message` field in the error message array.\n\nThis has no effect\ - \ if the request sets `triggerError`.\n\nThis parameter exists in v1." + \ if the request sets `triggerError`.\n\nThis parameter exists in alpha." explode: false in: query name: triggerMultipleErrors @@ -13774,7 +13774,7 @@ paths: style: deepObject - description: "If `true`, triggers a `500` error.\n\nThis has no effect if\ \ the request sets either `triggerError` or `triggerMultipleErrors`.\n\n\ - This parameter exists in v1." + This parameter exists in alpha." explode: false in: query name: triggerUnexpectedError @@ -13788,7 +13788,7 @@ paths: - description: |- Sets the HTTP status code to return. - This parameter exists in v1. + This parameter exists in alpha. explode: false in: query name: statusCode @@ -13801,7 +13801,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: method: get @@ -13810,7 +13810,7 @@ paths: : schema: $ref: '#/components/schemas/echo_200_response' - application/vnd.segment.v1+json: + application/json: example: data: method: get @@ -13818,8 +13818,8 @@ paths: headers: : schema: - $ref: '#/components/schemas/echo_200_response_1' - application/json: + $ref: '#/components/schemas/echo_200_response' + application/vnd.segment.v1alpha+json: example: data: method: get @@ -13954,13 +13954,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: - example: - data: - enabled: false - schema: - $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1+json: example: data: enabled: true @@ -13975,7 +13969,7 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - application/vnd.segment.v1+json: + application/json: example: data: enabled: true @@ -13990,7 +13984,7 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - application/json: + application/vnd.segment.v1beta+json: example: data: enabled: true @@ -14005,6 +13999,12 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' + application/vnd.segment.v1alpha+json: + example: + data: + enabled: false + schema: + $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' description: OK "404": content: @@ -14064,7 +14064,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: warehouseId: kjU72LCJexvrqL7G4TMHHN enabled: true @@ -14094,7 +14094,7 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/ReplaceAdvancedSyncScheduleForWarehouseV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: warehouseId: kjU72LCJexvrqL7G4TMHHN enabled: true @@ -14113,7 +14113,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: enabled: true @@ -14128,7 +14128,7 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: enabled: true @@ -14143,7 +14143,7 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: enabled: true @@ -14158,7 +14158,7 @@ paths: timezone: America/Vancouver schema: $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: enabled: true @@ -14210,7 +14210,7 @@ paths: x-domain-hierarchy: - Connections - Selective Sync - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /warehouses/{warehouseId}/connection-state: get: @@ -14234,25 +14234,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: connectionState: CONNECTED schema: $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: connectionState: CONNECTED schema: $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: connectionState: CONNECTED schema: $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: connectionState: CONNECTED @@ -14306,7 +14306,7 @@ paths: - description: |- The start of the usage month in the ISO-8601 format. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: period @@ -14319,7 +14319,7 @@ paths: - description: |- Pagination input for per Source API calls counts. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -14330,7 +14330,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: dailyPerSourceAPICallsUsage: @@ -14370,7 +14370,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: dailyPerSourceAPICallsUsage: @@ -14410,7 +14410,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: dailyPerSourceAPICallsUsage: @@ -14450,7 +14450,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: dailyPerSourceAPICallsUsage: @@ -14535,7 +14535,7 @@ paths: operationId: getDailyPerSourceMTUUsage parameters: - description: "The start of the usage month, in the ISO-8601 format.\n\nThis\ - \ parameter exists in alpha." + \ parameter exists in v1." explode: false in: query name: period @@ -14548,7 +14548,7 @@ paths: - description: |- Pagination input for per Source MTU counts. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -14559,7 +14559,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: dailyPerSourceMTUUsage: @@ -14649,7 +14649,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: dailyPerSourceMTUUsage: @@ -14739,7 +14739,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: dailyPerSourceMTUUsage: @@ -14829,7 +14829,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: dailyPerSourceMTUUsage: @@ -14966,7 +14966,7 @@ paths: - description: |- The start of the usage month in the ISO-8601 format. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: period @@ -14979,7 +14979,7 @@ paths: - description: |- Pagination input for Workspace API call counts. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -14990,7 +14990,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: dailyWorkspaceAPICallsUsage: @@ -15020,7 +15020,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: dailyWorkspaceAPICallsUsage: @@ -15050,7 +15050,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: dailyWorkspaceAPICallsUsage: @@ -15080,7 +15080,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: dailyWorkspaceAPICallsUsage: @@ -15155,7 +15155,7 @@ paths: operationId: getDailyWorkspaceMTUUsage parameters: - description: "The start of the usage month, in the ISO-8601 format.\n\nThis\ - \ parameter exists in alpha." + \ parameter exists in v1." explode: false in: query name: period @@ -15168,7 +15168,7 @@ paths: - description: |- Pagination input for Workspace MTU counts. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -15179,7 +15179,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: dailyWorkspaceMTUUsage: @@ -15259,7 +15259,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: dailyWorkspaceMTUUsage: @@ -15339,7 +15339,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: dailyWorkspaceMTUUsage: @@ -15419,7 +15419,7 @@ paths: totalEntries: 28 schema: $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: dailyWorkspaceMTUUsage: @@ -15555,7 +15555,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destinationMetadata: @@ -15653,7 +15653,7 @@ paths: presets: [] schema: $ref: '#/components/schemas/getDestinationMetadata_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destinationMetadata: @@ -15751,7 +15751,7 @@ paths: presets: [] schema: $ref: '#/components/schemas/getDestinationMetadata_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: destinationMetadata: @@ -15849,7 +15849,7 @@ paths: presets: [] schema: $ref: '#/components/schemas/getDestinationMetadata_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: destinationMetadata: @@ -15994,7 +15994,7 @@ paths: - description: |- Required pagination parameters used to filter the Destinations catalog. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -16005,7 +16005,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destinationsCatalog: @@ -16179,7 +16179,7 @@ paths: totalEntries: 378 schema: $ref: '#/components/schemas/getDestinationsCatalog_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destinationsCatalog: @@ -16353,7 +16353,7 @@ paths: totalEntries: 378 schema: $ref: '#/components/schemas/getDestinationsCatalog_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: destinationsCatalog: @@ -16527,7 +16527,7 @@ paths: totalEntries: 378 schema: $ref: '#/components/schemas/getDestinationsCatalog_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: destinationsCatalog: @@ -16752,7 +16752,7 @@ paths: - description: |- The size of each bucket in the requested window. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: granularity @@ -16767,7 +16767,7 @@ paths: type: string style: deepObject - description: "The ISO8601 formatted timestamp that corresponds to the\nbeginning\ - \ of the requested time frame, inclusive.\n\nThis parameter exists in alpha." + \ of the requested time frame, inclusive.\n\nThis parameter exists in v1." explode: false in: query name: startTime @@ -16781,7 +16781,7 @@ paths: - description: "The ISO8601 formatted timestamp that corresponds to the\nend\ \ of the requested time frame, noninclusive.\nSegment recommends that you\ \ lag queries 1 minute behind clock time to reduce\nthe risk for latency\ - \ to impact the counts.\n\nThis parameter exists in alpha." + \ to impact the counts.\n\nThis parameter exists in v1." explode: false in: query name: endTime @@ -16796,7 +16796,7 @@ paths: style: deepObject - description: "A comma-delimited list of strings that represents the dimensions\n\ to group the result by. The options are:\n`eventName`, `eventType` and `source`.\n\ - \nThis parameter exists in alpha." + \nThis parameter exists in v1." explode: false in: query name: groupBy @@ -16814,7 +16814,7 @@ paths: A list of strings which filters the results to the given SourceIds. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: sourceId @@ -16832,7 +16832,7 @@ paths: A list of strings which filters the results to the given EventNames. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: eventName @@ -16850,7 +16850,7 @@ paths: A list of strings which filters the results to the given EventTypes. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: eventType @@ -16868,7 +16868,7 @@ paths: A list of strings which filters the results to the given AppVersions. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: appVersion @@ -16885,7 +16885,7 @@ paths: - description: |- Pagination input for event volume by Workspace. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -16896,7 +16896,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: result: @@ -16937,7 +16937,7 @@ paths: count: 23040 schema: $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: result: @@ -16978,7 +16978,7 @@ paths: count: 23040 schema: $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: result: @@ -17019,7 +17019,7 @@ paths: count: 23040 schema: $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: result: @@ -17127,25 +17127,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeFilterFromDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeFilterFromDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeFilterFromDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -17215,28 +17215,24 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: filter: id: xx6AySGeFExzdv2Gw2EuhV sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn - if: event = "Order Completed" + if: '!(type = "track")' actions: - - type: DROP_PROPERTIES - fields: - properties: - - userId - - secretValue - title: Order Completed - description: This filter probably does nothing + - type: DROP + title: Allow Track + description: Allows track calls through to the destination. enabled: true createdAt: 2006-01-02T15:04:05.000Z updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/getFilterInDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: filter: @@ -17253,7 +17249,7 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/getFilterInDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: filter: @@ -17270,18 +17266,22 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/getFilterInDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: filter: id: xx6AySGeFExzdv2Gw2EuhV sourceId: rh5BDZp6QDHvXFCkibm1pR destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' + if: event = "Order Completed" actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. + - type: DROP_PROPERTIES + fields: + properties: + - userId + - secretValue + title: Order Completed + description: This filter probably does nothing enabled: true createdAt: 2006-01-02T15:04:05.000Z updatedAt: 2006-01-02T15:04:05.000Z @@ -17353,7 +17353,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: filterId: xx6AySGeFExzdv2Gw2EuhV destinationId: fP7qoQw2HTWt9WdMr718gn @@ -17377,7 +17377,7 @@ paths: enabled: true schema: $ref: '#/components/schemas/UpdateFilterForDestinationV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: filterId: xx6AySGeFExzdv2Gw2EuhV destinationId: fP7qoQw2HTWt9WdMr718gn @@ -17393,7 +17393,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: filter: @@ -17410,7 +17410,7 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/updateFilterForDestination_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: filter: @@ -17427,7 +17427,7 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/updateFilterForDestination_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: filter: @@ -17444,7 +17444,7 @@ paths: updatedAt: 2006-01-02T15:04:05.000Z schema: $ref: '#/components/schemas/updateFilterForDestination_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: filter: @@ -17498,7 +17498,7 @@ paths: x-domain-hierarchy: - Connections - Destination Filters - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /sources/{sourceId}/edge-functions/latest: get: @@ -17589,7 +17589,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: sourceMetadata: @@ -17611,7 +17611,7 @@ paths: isCloudEventSource: false schema: $ref: '#/components/schemas/getSourceMetadata_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: sourceMetadata: @@ -17633,7 +17633,7 @@ paths: isCloudEventSource: false schema: $ref: '#/components/schemas/getSourceMetadata_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: sourceMetadata: @@ -17655,7 +17655,7 @@ paths: isCloudEventSource: false schema: $ref: '#/components/schemas/getSourceMetadata_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: sourceMetadata: @@ -17724,7 +17724,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -17735,7 +17735,53 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: + example: + data: + sourcesCatalog: + - id: 117eYCe9jH + slug: youbora + name: Youbora + categories: + - Analytics + description: "YOUBORA is a business intelligence and video analytics\ + \ solution for the online video industry to maximize revenue\ + \ through understanding user behavior using actionable data.\ + \ The platform delivers high quality and reliable insights based\ + \ on real-time data, in order for your business to ensure the\ + \ delivery of flawless video and a high quality of experiences\ + \ to your users." + logos: + default: https://cdn.filepicker.io/api/file/bzmEOg5CRO2RWAVFeHb5 + mark: https://cdn.filepicker.io/api/file/lIl1q5XSRriNiYAodvnC + options: [] + isCloudEventSource: true + - id: 1QTd6JKw53 + slug: regal-voice + name: Regal Voice + categories: + - Marketing Automation + - Personalization + - SMS & Push Notifications + description: Next-gen phone marketing and sales enablement for + innovative consumer and financial services brands + logos: + default: https://public-segment-devcenter-production.s3.amazonaws.com/a3189276-1b86-4126-a31c-d1a50057b7fe.svg + mark: https://public-segment-devcenter-production.s3.amazonaws.com/e20664bd-2398-440a-a6d6-59cd348b25e2.svg + options: + - name: api-key + required: true + type: string + defaultValue: "" + description: Regal Voice API key + isCloudEventSource: true + pagination: + current: MA== + next: Mg== + totalEntries: 81 + schema: + $ref: '#/components/schemas/getSourcesCatalog_200_response' + application/json: example: data: sourcesCatalog: @@ -17827,53 +17873,7 @@ paths: totalEntries: 81 schema: $ref: '#/components/schemas/getSourcesCatalog_200_response' - application/vnd.segment.v1+json: - example: - data: - sourcesCatalog: - - id: 117eYCe9jH - slug: youbora - name: Youbora - categories: - - Analytics - description: "YOUBORA is a business intelligence and video analytics\ - \ solution for the online video industry to maximize revenue\ - \ through understanding user behavior using actionable data.\ - \ The platform delivers high quality and reliable insights based\ - \ on real-time data, in order for your business to ensure the\ - \ delivery of flawless video and a high quality of experiences\ - \ to your users." - logos: - default: https://cdn.filepicker.io/api/file/bzmEOg5CRO2RWAVFeHb5 - mark: https://cdn.filepicker.io/api/file/lIl1q5XSRriNiYAodvnC - options: [] - isCloudEventSource: true - - id: 1QTd6JKw53 - slug: regal-voice - name: Regal Voice - categories: - - Marketing Automation - - Personalization - - SMS & Push Notifications - description: Next-gen phone marketing and sales enablement for - innovative consumer and financial services brands - logos: - default: https://public-segment-devcenter-production.s3.amazonaws.com/a3189276-1b86-4126-a31c-d1a50057b7fe.svg - mark: https://public-segment-devcenter-production.s3.amazonaws.com/e20664bd-2398-440a-a6d6-59cd348b25e2.svg - options: - - name: api-key - required: true - type: string - defaultValue: "" - description: Regal Voice API key - isCloudEventSource: true - pagination: - current: MA== - next: Mg== - totalEntries: 81 - schema: - $ref: '#/components/schemas/getSourcesCatalog_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: sourcesCatalog: @@ -18279,7 +18279,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: user: @@ -18295,7 +18295,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/getUser_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: user: @@ -18311,7 +18311,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/getUser_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: user: @@ -18327,7 +18327,7 @@ paths: labels: [] schema: $ref: '#/components/schemas/getUser_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: user: @@ -18399,7 +18399,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehouseMetadata: @@ -18432,7 +18432,7 @@ paths: type: string schema: $ref: '#/components/schemas/getWarehouseMetadata_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehouseMetadata: @@ -18465,7 +18465,7 @@ paths: type: string schema: $ref: '#/components/schemas/getWarehouseMetadata_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: warehouseMetadata: @@ -18498,7 +18498,7 @@ paths: type: string schema: $ref: '#/components/schemas/getWarehouseMetadata_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: warehouseMetadata: @@ -18578,7 +18578,7 @@ paths: - description: |- Required pagination params used to filter the Warehouses catalog. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -18589,7 +18589,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehousesCatalog: @@ -18617,7 +18617,7 @@ paths: totalEntries: 7 schema: $ref: '#/components/schemas/getWarehousesCatalog_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehousesCatalog: @@ -18645,7 +18645,7 @@ paths: totalEntries: 7 schema: $ref: '#/components/schemas/getWarehousesCatalog_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: warehousesCatalog: @@ -18673,7 +18673,7 @@ paths: totalEntries: 7 schema: $ref: '#/components/schemas/getWarehousesCatalog_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: warehousesCatalog: @@ -18749,7 +18749,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: workspace: @@ -18758,7 +18758,7 @@ paths: slug: papi-e2e schema: $ref: '#/components/schemas/getWorkspace_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: workspace: @@ -18767,7 +18767,7 @@ paths: slug: papi-e2e schema: $ref: '#/components/schemas/getWorkspace_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: workspace: @@ -18776,7 +18776,7 @@ paths: slug: papi-e2e schema: $ref: '#/components/schemas/getWorkspace_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: workspace: @@ -18832,7 +18832,7 @@ paths: - description: |- Filter response to events that happened after this time. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: startTime @@ -18844,7 +18844,7 @@ paths: style: deepObject - description: "Filter response to events that happened before this time.\n\ Defaults to the current time, or the end time from the pagination cursor.\n\ - \nThis parameter exists in alpha." + \nThis parameter exists in v1." explode: false in: query name: endTime @@ -18856,7 +18856,7 @@ paths: type: string style: deepObject - description: "Filter response to events that affect a specific resource, for\ - \ example, a single Source.\n\nThis parameter exists in alpha." + \ example, a single Source.\n\nThis parameter exists in v1." explode: false in: query name: resourceId @@ -18868,7 +18868,7 @@ paths: type: string style: deepObject - description: "Filter response to events that affect a specific type, for example,\ - \ Sources, Warehouses, and Tracking Plans.\n\nThis parameter exists in alpha." + \ Sources, Warehouses, and Tracking Plans.\n\nThis parameter exists in v1." explode: false in: query name: resourceType @@ -18882,7 +18882,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -18893,7 +18893,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: events: @@ -18912,11 +18912,11 @@ paths: resourceType: function resourceName: displayName pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuMTM4WiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuMTM4WiJ9 + current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 + next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 schema: $ref: '#/components/schemas/listAuditEvents_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: events: @@ -18935,11 +18935,11 @@ paths: resourceType: function resourceName: displayName pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuNjQxWiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuNjQxWiJ9 + current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 + next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 schema: $ref: '#/components/schemas/listAuditEvents_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: events: @@ -18958,11 +18958,11 @@ paths: resourceType: function resourceName: displayName pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 + current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuNjQxWiJ9 + next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuNjQxWiJ9 schema: $ref: '#/components/schemas/listAuditEvents_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: events: @@ -18981,8 +18981,8 @@ paths: resourceType: function resourceName: displayName pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 + current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuMTM4WiJ9 + next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuMTM4WiJ9 schema: $ref: '#/components/schemas/listAuditEvents_200_response' description: OK @@ -19041,7 +19041,7 @@ paths: - description: |- Required pagination params for the request. - This parameter exists in beta. + This parameter exists in alpha. explode: false in: query name: pagination @@ -19052,7 +19052,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: destinations: [] @@ -19061,7 +19061,7 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: destinations: [] @@ -19069,8 +19069,8 @@ paths: current: MQ== totalEntries: 0 schema: - $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response' + application/vnd.segment.v1beta+json: example: data: destinations: [] @@ -19078,8 +19078,8 @@ paths: current: MQ== totalEntries: 0 schema: - $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response_1' - application/json: + $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response' + application/vnd.segment.v1alpha+json: example: data: destinations: [] @@ -19144,7 +19144,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -19155,7 +19155,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: sources: @@ -19182,11 +19182,10 @@ paths: labels: [] pagination: current: MA== - next: MQ== - totalEntries: 2 + totalEntries: 1 schema: $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: sources: @@ -19216,7 +19215,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: sources: @@ -19246,7 +19245,7 @@ paths: totalEntries: 1 schema: $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: sources: @@ -19273,7 +19272,8 @@ paths: labels: [] pagination: current: MA== - totalEntries: 1 + next: MQ== + totalEntries: 2 schema: $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' description: OK @@ -19332,7 +19332,7 @@ paths: - description: |- Required pagination params for the request. - This parameter exists in beta. + This parameter exists in alpha. explode: false in: query name: pagination @@ -19343,7 +19343,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: warehouses: @@ -19416,7 +19416,7 @@ paths: totalEntries: 2 schema: $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: warehouses: @@ -19488,8 +19488,8 @@ paths: current: MA== totalEntries: 2 schema: - $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response_1' - application/vnd.segment.v1+json: + $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response' + application/vnd.segment.v1beta+json: example: data: warehouses: @@ -19561,8 +19561,8 @@ paths: current: MA== totalEntries: 2 schema: - $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response_1' - application/json: + $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response' + application/vnd.segment.v1alpha+json: example: data: warehouses: @@ -19695,7 +19695,7 @@ paths: type: string style: simple - description: "The id of the Source linked to the Destination.\n\nConfig API\ - \ note: analogous to `parent`.\n\nThis parameter exists in alpha." + \ note: analogous to `parent`.\n\nThis parameter exists in beta." explode: false in: query name: sourceId @@ -19714,7 +19714,7 @@ paths: - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. - This parameter exists in alpha. + This parameter exists in beta. explode: false in: query name: startTime @@ -19733,7 +19733,7 @@ paths: - description: |- Filter events that happened before this time. Defaults to now if not set. - This parameter exists in alpha. + This parameter exists in beta. explode: false in: query name: endTime @@ -19746,7 +19746,7 @@ paths: style: deepObject - description: "The granularity to filter metrics to. Either `MINUTE`, `HOUR`\ \ or `DAY`.\n\nDefaults to `MINUTE` if not set.\n\nThis parameter exists\ - \ in alpha." + \ in beta." explode: false in: query name: granularity @@ -19764,7 +19764,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1beta+json: example: data: deliveryMetricsSummary: @@ -19800,7 +19800,7 @@ paths: value: 0 schema: $ref: '#/components/schemas/listDeliveryMetricsSummaryFromDestination_200_response' - application/vnd.segment.v1beta+json: + application/vnd.segment.v1alpha+json: example: data: deliveryMetricsSummary: @@ -19892,7 +19892,7 @@ paths: - description: |- Pagination for invites to the group. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -19903,7 +19903,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: emails: [] @@ -19912,7 +19912,7 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: emails: [] @@ -19921,7 +19921,7 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: emails: [] @@ -19930,7 +19930,7 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: emails: [] @@ -19987,7 +19987,7 @@ paths: - description: |- Pagination for roles. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -19998,7 +19998,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: roles: @@ -20017,7 +20017,7 @@ paths: next: Mg== schema: $ref: '#/components/schemas/listRoles_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: roles: @@ -20036,7 +20036,7 @@ paths: next: Mg== schema: $ref: '#/components/schemas/listRoles_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: roles: @@ -20055,7 +20055,7 @@ paths: next: Mg== schema: $ref: '#/components/schemas/listRoles_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: roles: @@ -20133,7 +20133,7 @@ paths: - description: |- Rules to delete. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: rules @@ -20148,25 +20148,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -20234,7 +20234,7 @@ paths: - description: |- Pagination options. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -20245,7 +20245,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: rules: @@ -20269,7 +20269,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: rules: @@ -20293,7 +20293,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: rules: @@ -20317,7 +20317,7 @@ paths: current: MA== schema: $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: rules: @@ -20398,7 +20398,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP rules: @@ -20418,7 +20418,7 @@ paths: jsonSchema: {} schema: $ref: '#/components/schemas/UpdateRulesInTrackingPlanV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP rules: @@ -20432,25 +20432,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -20493,7 +20493,7 @@ paths: x-domain-hierarchy: - Protocols - Tracking Plans - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json put: deprecated: false @@ -20514,7 +20514,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP rules: @@ -20534,7 +20534,7 @@ paths: jsonSchema: {} schema: $ref: '#/components/schemas/ReplaceRulesInTrackingPlanV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP rules: @@ -20548,25 +20548,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -20609,7 +20609,7 @@ paths: x-domain-hierarchy: - Protocols - Tracking Plans - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /sources/{sourceId}/settings: get: @@ -20631,7 +20631,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20654,7 +20654,7 @@ paths: forwardingViolationsTo: "" schema: $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20677,7 +20677,7 @@ paths: forwardingViolationsTo: "" schema: $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20700,7 +20700,7 @@ paths: forwardingViolationsTo: "" schema: $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20780,7 +20780,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: sourceId: qQEHquLrjRDN9j1ByrChyn group: @@ -20822,7 +20822,7 @@ paths: forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/UpdateSchemaSettingsInSourceV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: sourceId: qQEHquLrjRDN9j1ByrChyn group: @@ -20847,7 +20847,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20870,7 +20870,7 @@ paths: forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20893,7 +20893,7 @@ paths: forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20916,7 +20916,7 @@ paths: forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR schema: $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: sourceId: qQEHquLrjRDN9j1ByrChyn @@ -20976,7 +20976,7 @@ paths: x-domain-hierarchy: - Connections - Sources - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs: get: @@ -21010,7 +21010,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -21021,7 +21021,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: items: @@ -21046,7 +21046,7 @@ paths: totalEntries: 10 schema: $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: items: @@ -21071,7 +21071,7 @@ paths: totalEntries: 10 schema: $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: items: @@ -21096,7 +21096,7 @@ paths: totalEntries: 10 schema: $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: items: @@ -21168,7 +21168,7 @@ paths: - description: |- Pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -21179,7 +21179,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: suppressed: @@ -21191,7 +21191,7 @@ paths: next: cmVnLTY1MDgtMDA5ODE= schema: $ref: '#/components/schemas/listSuppressions_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: suppressed: @@ -21203,7 +21203,7 @@ paths: next: cmVnLTY1MDgtMDA5ODE= schema: $ref: '#/components/schemas/listSuppressions_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: suppressed: @@ -21215,7 +21215,7 @@ paths: next: cmVnLTY1MDgtMDA5ODE= schema: $ref: '#/components/schemas/listSuppressions_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: suppressed: @@ -21288,7 +21288,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -21299,7 +21299,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: reports: [] @@ -21308,7 +21308,7 @@ paths: current: "" schema: $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: reports: [] @@ -21317,7 +21317,7 @@ paths: current: "" schema: $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: reports: [] @@ -21326,7 +21326,7 @@ paths: current: "" schema: $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: reports: [] @@ -21404,7 +21404,7 @@ paths: - description: |- Defines the pagination parameters. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -21415,7 +21415,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: reports: [] @@ -21424,7 +21424,7 @@ paths: current: "" schema: $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: reports: [] @@ -21433,7 +21433,7 @@ paths: current: "" schema: $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: reports: [] @@ -21442,7 +21442,7 @@ paths: current: "" schema: $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: reports: [] @@ -21507,7 +21507,7 @@ paths: - description: |- Pagination for groups. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: pagination @@ -21518,18 +21518,16 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: - groups: - - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group + groups: [] pagination: current: MA== - totalEntries: 1 + totalEntries: 0 schema: $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: groups: [] @@ -21538,7 +21536,7 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: groups: [] @@ -21547,13 +21545,15 @@ paths: totalEntries: 0 schema: $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: - groups: [] + groups: + - id: bBABwqbaDf2QdwTbW8bNEm + name: PAPI Example Group pagination: current: MA== - totalEntries: 0 + totalEntries: 1 schema: $ref: '#/components/schemas/listUserGroupsFromUser_200_response' description: OK @@ -21603,7 +21603,7 @@ paths: parameters: [] requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: filter: if: type = "track" AND event = "Order Completed" @@ -21641,7 +21641,7 @@ paths: referrer: www.example.com schema: $ref: '#/components/schemas/PreviewDestinationFilterV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: filter: if: type = "track" AND event = "Order Completed" @@ -21664,7 +21664,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: inputPayload: @@ -21681,7 +21681,7 @@ paths: requestedFrom: /products/123/checkout schema: $ref: '#/components/schemas/previewDestinationFilter_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: inputPayload: @@ -21698,7 +21698,7 @@ paths: requestedFrom: /products/123/checkout schema: $ref: '#/components/schemas/previewDestinationFilter_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: inputPayload: @@ -21715,7 +21715,7 @@ paths: requestedFrom: /products/123/checkout schema: $ref: '#/components/schemas/previewDestinationFilter_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: inputPayload: @@ -21769,7 +21769,7 @@ paths: x-domain-hierarchy: - Connections - Destination Filters - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /group/{userGroupId}/users: delete: @@ -21796,7 +21796,7 @@ paths: - description: |- The list of emails to remove from the user group. - This parameter exists in alpha. + This parameter exists in v1. explode: false in: query name: emails @@ -21811,25 +21811,25 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: SUCCESS schema: $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: SUCCESS @@ -21896,7 +21896,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: emails: - foo@example.com @@ -21910,7 +21910,7 @@ paths: userGroupId: bBABwqbaDf2QdwTbW8bNEm schema: $ref: '#/components/schemas/ReplaceUsersInUserGroupV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: emails: - foo@example.com @@ -21921,7 +21921,7 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: userGroup: @@ -21930,7 +21930,7 @@ paths: memberCount: 1 schema: $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: userGroup: @@ -21939,7 +21939,7 @@ paths: memberCount: 1 schema: $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: userGroup: @@ -21948,7 +21948,7 @@ paths: memberCount: 1 schema: $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: userGroup: @@ -21994,7 +21994,7 @@ paths: x-domain-hierarchy: - Admin - IAM Groups - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json /spaces/{spaceId}/messaging-subscriptions: put: @@ -22120,7 +22120,7 @@ paths: style: simple requestBody: content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: warehouseId: kjU72LCJexvrqL7G4TMHHN syncOverrides: @@ -22140,7 +22140,7 @@ paths: property: context_ip schema: $ref: '#/components/schemas/UpdateSelectiveSyncForWarehouseV1Input' - application/vnd.segment.v1+json: + application/vnd.segment.v1alpha+json: example: warehouseId: kjU72LCJexvrqL7G4TMHHN syncOverrides: @@ -22154,28 +22154,28 @@ paths: responses: "200": content: - application/vnd.segment.v1alpha+json: + application/vnd.segment.v1+json: example: data: status: UPDATED warnings: [] schema: $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - application/vnd.segment.v1beta+json: + application/json: example: data: status: UPDATED warnings: [] schema: $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - application/vnd.segment.v1+json: + application/vnd.segment.v1beta+json: example: data: status: UPDATED warnings: [] schema: $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - application/json: + application/vnd.segment.v1alpha+json: example: data: status: UPDATED @@ -22219,7 +22219,7 @@ paths: x-domain-hierarchy: - Connections - Selective Sync - x-content-type: application/vnd.segment.v1alpha+json + x-content-type: application/vnd.segment.v1+json x-accepts: application/json components: schemas: @@ -23310,6 +23310,233 @@ components: - trigger title: DestinationMetadataSubscriptionPresetV1 type: object + DestinationSubscription: + example: + actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + properties: + id: + description: The unique identifier for the subscription. + title: id + type: string + name: + description: The name of the subscription. + title: name + type: string + actionId: + description: The unique identifier for the Destination action to trigger. + title: actionId + type: string + actionSlug: + description: The URL-friendly key for the associated Destination action. + title: actionSlug + type: string + destinationId: + description: The associated Destination instance id. + title: destinationId + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The customer settings for action fields. + title: settings + trigger: + description: FQL string that describes what events should trigger a Destination + action. + title: trigger + type: string + required: + - actionId + - actionSlug + - destinationId + - enabled + - id + - name + - settings + - trigger + title: DestinationSubscription + type: object + DestinationSubscriptionFields: + additionalProperties: {} + description: Represents settings used to configure an action subscription. + title: DestinationSubscriptionFields + type: object + ListSubscriptionsFromDestinationAlphaInput: + description: Input for ListDestinationSubscriptionsAlpha. + properties: {} + required: + - destinationId + title: ListSubscriptionsFromDestinationAlphaInput + type: object + ListSubscriptionsFromDestinationAlphaOutput: + description: Output for ListDestinationSubscriptionsAlpha. + example: + subscriptions: + - actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + - actionSlug: actionSlug + settings: "" + name: name + actionId: actionId + id: id + trigger: trigger + destinationId: destinationId + enabled: true + pagination: null + properties: + subscriptions: + description: A list of Destination subscriptions. + items: + $ref: '#/components/schemas/DestinationSubscription' + title: subscriptions + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - subscriptions + title: ListSubscriptionsFromDestinationAlphaOutput + type: object + GetSubscriptionFromDestinationAlphaInput: + description: Fetches a Destination subscription. + properties: {} + required: + - destinationId + title: GetSubscriptionFromDestinationAlphaInput + type: object + GetSubscriptionFromDestinationAlphaOutput: + description: Returns a subscription for a given subscription id. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: GetSubscriptionFromDestinationAlphaOutput + type: object + CreateDestinationSubscriptionAlphaInput: + description: The basic input parameters for creating a Destination subscription. + properties: + name: + description: A user-defined name for the subscription. + title: name + type: string + actionId: + description: The associated action id the subscription should trigger. + title: actionId + type: string + trigger: + description: The FQL statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + required: + - actionId + - enabled + - name + - trigger + title: CreateDestinationSubscriptionAlphaInput + type: object + CreateDestinationSubscriptionAlphaOutput: + description: Returns a newly created Destination subscription. + example: + destinationSubscription: null + properties: + destinationSubscription: + $ref: '#/components/schemas/destinationSubscription' + required: + - destinationSubscription + title: CreateDestinationSubscriptionAlphaOutput + type: object + DestinationSubscriptionUpdateInput: + description: The input parameters for updating a Destination subscription. + properties: + name: + description: The user-defined name for the subscription. + title: name + type: string + trigger: + description: The fql statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + title: DestinationSubscriptionUpdateInput + type: object + UpdateSubscriptionForDestinationAlphaInput: + description: The basic input parameters for updating a Destination subscription. + properties: + input: + $ref: '#/components/schemas/input' + required: + - destinationId + - input + title: UpdateSubscriptionForDestinationAlphaInput + type: object + UpdateSubscriptionForDestinationAlphaOutput: + description: Returns the updated Destination subscription. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: UpdateSubscriptionForDestinationAlphaOutput + type: object + RemoveSubscriptionFromDestinationAlphaInput: + description: Deletes a Destination by id. + properties: {} + required: + - destinationId + title: RemoveSubscriptionFromDestinationAlphaInput + type: object + RemoveSubscriptionFromDestinationAlphaOutput: + description: Returns a Destination deletion flag. + example: + status: SUCCESS + properties: + status: + description: The status of the operation. + enum: + - SUCCESS + title: status + type: string + required: + - status + title: RemoveSubscriptionFromDestinationAlphaOutput + type: object GetDestinationsCatalogV1Input: description: Contains filter parameters used for loading the Destinations public catalog. @@ -23609,233 +23836,6 @@ components: - destinationMetadata title: GetDestinationMetadataV1Output type: object - DestinationSubscription: - example: - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - properties: - id: - description: The unique identifier for the subscription. - title: id - type: string - name: - description: The name of the subscription. - title: name - type: string - actionId: - description: The unique identifier for the Destination action to trigger. - title: actionId - type: string - actionSlug: - description: The URL-friendly key for the associated Destination action. - title: actionSlug - type: string - destinationId: - description: The associated Destination instance id. - title: destinationId - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The customer settings for action fields. - title: settings - trigger: - description: FQL string that describes what events should trigger a Destination - action. - title: trigger - type: string - required: - - actionId - - actionSlug - - destinationId - - enabled - - id - - name - - settings - - trigger - title: DestinationSubscription - type: object - DestinationSubscriptionFields: - additionalProperties: {} - description: Represents settings used to configure an action subscription. - title: DestinationSubscriptionFields - type: object - ListSubscriptionsFromDestinationAlphaInput: - description: Input for ListDestinationSubscriptionsAlpha. - properties: {} - required: - - destinationId - title: ListSubscriptionsFromDestinationAlphaInput - type: object - ListSubscriptionsFromDestinationAlphaOutput: - description: Output for ListDestinationSubscriptionsAlpha. - example: - subscriptions: - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - pagination: null - properties: - subscriptions: - description: A list of Destination subscriptions. - items: - $ref: '#/components/schemas/DestinationSubscription' - title: subscriptions - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - subscriptions - title: ListSubscriptionsFromDestinationAlphaOutput - type: object - GetSubscriptionFromDestinationAlphaInput: - description: Fetches a Destination subscription. - properties: {} - required: - - destinationId - title: GetSubscriptionFromDestinationAlphaInput - type: object - GetSubscriptionFromDestinationAlphaOutput: - description: Returns a subscription for a given subscription id. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: GetSubscriptionFromDestinationAlphaOutput - type: object - CreateDestinationSubscriptionAlphaInput: - description: The basic input parameters for creating a Destination subscription. - properties: - name: - description: A user-defined name for the subscription. - title: name - type: string - actionId: - description: The associated action id the subscription should trigger. - title: actionId - type: string - trigger: - description: The FQL statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - required: - - actionId - - enabled - - name - - trigger - title: CreateDestinationSubscriptionAlphaInput - type: object - CreateDestinationSubscriptionAlphaOutput: - description: Returns a newly created Destination subscription. - example: - destinationSubscription: null - properties: - destinationSubscription: - $ref: '#/components/schemas/destinationSubscription' - required: - - destinationSubscription - title: CreateDestinationSubscriptionAlphaOutput - type: object - DestinationSubscriptionUpdateInput: - description: The input parameters for updating a Destination subscription. - properties: - name: - description: The user-defined name for the subscription. - title: name - type: string - trigger: - description: The fql statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - title: DestinationSubscriptionUpdateInput - type: object - UpdateSubscriptionForDestinationAlphaInput: - description: The basic input parameters for updating a Destination subscription. - properties: - input: - $ref: '#/components/schemas/input' - required: - - destinationId - - input - title: UpdateSubscriptionForDestinationAlphaInput - type: object - UpdateSubscriptionForDestinationAlphaOutput: - description: Returns the updated Destination subscription. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: UpdateSubscriptionForDestinationAlphaOutput - type: object - RemoveSubscriptionFromDestinationAlphaInput: - description: Deletes a Destination by id. - properties: {} - required: - - destinationId - title: RemoveSubscriptionFromDestinationAlphaInput - type: object - RemoveSubscriptionFromDestinationAlphaOutput: - description: Returns a Destination deletion flag. - example: - status: SUCCESS - properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveSubscriptionFromDestinationAlphaOutput - type: object ListDeliveryMetricsSummaryFromDestinationBetaInput: description: Input to retrieve event delivery metrics summary for a Destination. properties: {} @@ -24132,11 +24132,6 @@ components: type: object EchoAlphaOutput: description: Echo response. - example: - headers: - key: "" - method: get - message: message properties: method: description: "The HTTP method used for this round-trip.\n\nCurrently, this\ @@ -24168,6 +24163,11 @@ components: type: object EchoV1Output: description: Echo response. + example: + headers: + key: "" + method: get + message: message properties: method: description: "The HTTP method used for this round-trip.\n\nCurrently, this\ @@ -26133,10 +26133,6 @@ components: \ and Prod (production) environments. On top of those, Free and\nTeam plan\ \ customers may create up to five labels.\n\nCustomers with the Enterprise\ \ pricing package may create an unlimited number of labels." - example: - description: description - value: value - key: key properties: key: description: The key that represents the name of this label. @@ -26161,14 +26157,6 @@ components: type: object ListLabelsAlphaOutput: description: Returns all available labels for the current Workspace. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key properties: labels: description: All labels associated with the current Workspace. @@ -26191,14 +26179,6 @@ components: type: object CreateLabelAlphaOutput: description: Result of creating a new label in the current Workspace. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key properties: labels: description: All labels associated with the current Workspace. @@ -26219,8 +26199,6 @@ components: type: object DeleteLabelAlphaOutput: description: Returns the status of a label deletion. - example: - status: SUCCESS properties: status: description: The status of the label deletion operation. @@ -26247,14 +26225,6 @@ components: type: object AddLabelsToSourceAlphaOutput: description: Applies an existing label to an existing Source. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key properties: labels: description: All labels applied to the Source. @@ -26281,14 +26251,6 @@ components: type: object ReplaceLabelsInSourceAlphaOutput: description: Response from replacing a list of labels in a Source. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key properties: labels: description: All labels replaced in the Source. @@ -26337,6 +26299,14 @@ components: type: object ListLabelsV1Output: description: Returns all available labels for the current Workspace. + example: + labels: + - description: description + value: value + key: key + - description: description + value: value + key: key properties: labels: description: All labels associated with the current Workspace. @@ -26359,6 +26329,8 @@ components: type: object CreateLabelV1Output: description: Result of creating a new label in the current Workspace. + example: + label: null properties: label: $ref: '#/components/schemas/label_2' @@ -26373,6 +26345,8 @@ components: type: object DeleteLabelV1Output: description: Returns the status of a label deletion. + example: + status: SUCCESS properties: status: description: The status of the label deletion operation. @@ -26397,6 +26371,14 @@ components: type: object AddLabelsToSourceV1Output: description: Applies an existing label to an existing Source. + example: + labels: + - description: description + value: value + key: key + - description: description + value: value + key: key properties: labels: description: All labels applied to the Source. @@ -26421,6 +26403,14 @@ components: type: object ReplaceLabelsInSourceV1Output: description: Response from replacing a list of labels in a Source. + example: + labels: + - description: description + value: value + key: key + - description: description + value: value + key: key properties: labels: description: All labels replaced in the Source. @@ -27368,24 +27358,6 @@ components: type: object SourceAlpha: description: Defines a data Source for Segment data. - example: - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key properties: id: description: "The id of the Source.\n\nConfig API note: analogous to `name`." @@ -27457,43 +27429,6 @@ components: type: object ListSourcesAlphaOutput: description: Returns a list of Sources that belong to the current Workspace. - example: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key properties: sources: description: A list of Sources that belong to the Workspace. @@ -27517,8 +27452,6 @@ components: type: object GetSourceAlphaOutput: description: Returns a Source. - example: - source: null properties: source: $ref: '#/components/schemas/source_1' @@ -27535,19 +27468,6 @@ components: type: object ListConnectedWarehousesFromSourceAlphaOutput: description: Returns a list of Warehouses connected to a Source. - example: - pagination: null - warehouses: - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId properties: warehouses: description: A list that contains the Warehouses connected to the Source. @@ -27571,23 +27491,6 @@ components: type: object ListConnectedDestinationsFromSourceAlphaOutput: description: Returns a list of Destinations connected to a Source. - example: - pagination: null - destinations: - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true properties: destinations: description: A list that contains the Destinations connected to the Source. @@ -27638,8 +27541,6 @@ components: type: object CreateSourceAlphaOutput: description: Returns the newly Source. - example: - source: null properties: source: $ref: '#/components/schemas/source_2' @@ -27656,8 +27557,6 @@ components: type: object DeleteSourceAlphaOutput: description: Returns the status of a Source deletion. - example: - status: SUCCESS properties: status: description: The status of the Source deletion operation. @@ -27703,8 +27602,6 @@ components: type: object UpdateSourceAlphaOutput: description: Returns the updated Source. - example: - source: null properties: source: $ref: '#/components/schemas/source_3' @@ -27803,6 +27700,43 @@ components: type: object ListSourcesV1Output: description: Returns a list of Sources that belong to the current Workspace. + example: + pagination: null + sources: + - settings: "" + metadata: null + name: name + id: id + writeKeys: + - writeKeys + - writeKeys + slug: slug + enabled: true + workspaceId: workspaceId + labels: + - description: description + value: value + key: key + - description: description + value: value + key: key + - settings: "" + metadata: null + name: name + id: id + writeKeys: + - writeKeys + - writeKeys + slug: slug + enabled: true + workspaceId: workspaceId + labels: + - description: description + value: value + key: key + - description: description + value: value + key: key properties: sources: description: A list of Sources that belong to the Workspace. @@ -27826,6 +27760,8 @@ components: type: object GetSourceV1Output: description: Returns a Source. + example: + source: null properties: source: $ref: '#/components/schemas/source_4' @@ -27840,6 +27776,19 @@ components: type: object ListConnectedWarehousesFromSourceV1Output: description: Returns a list of Warehouses connected to a Source. + example: + pagination: null + warehouses: + - settings: "" + metadata: null + id: id + enabled: true + workspaceId: workspaceId + - settings: "" + metadata: null + id: id + enabled: true + workspaceId: workspaceId properties: warehouses: description: A list that contains the Warehouses connected to the Source. @@ -27861,6 +27810,23 @@ components: type: object ListConnectedDestinationsFromSourceV1Output: description: Returns a list of Destinations connected to a Source. + example: + pagination: null + destinations: + - sourceId: sourceId + settings: + key: "" + metadata: null + name: name + id: id + enabled: true + - sourceId: sourceId + settings: + key: "" + metadata: null + name: name + id: id + enabled: true properties: destinations: description: A list that contains the Destinations connected to the Source. @@ -27907,6 +27873,8 @@ components: type: object CreateSourceV1Output: description: Returns a newly created Source. + example: + source: null properties: source: $ref: '#/components/schemas/source_5' @@ -27923,6 +27891,8 @@ components: type: object DeleteSourceV1Output: description: Returns the status of a Source deletion. + example: + status: SUCCESS properties: status: description: The status of the Source deletion operation. @@ -27968,6 +27938,8 @@ components: type: object UpdateSourceV1Output: description: Returns the updated Source. + example: + source: null properties: source: $ref: '#/components/schemas/source_6' @@ -28857,15 +28829,6 @@ components: example: sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -28915,13 +28878,6 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array - propertyValueTransformations: - description: Optional array for transforming properties and values collected - by your events. - items: - $ref: '#/components/schemas/PropertyValueTransformationBeta' - title: propertyValueTransformations - type: array required: - enabled - id @@ -28948,28 +28904,6 @@ components: - oldName title: PropertyRenameBeta type: object - PropertyValueTransformationBeta: - example: - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - properties: - propertyPaths: - description: The property paths. - items: - type: string - title: propertyPaths - type: array - propertyValue: - description: The new value of the property paths. - title: propertyValue - type: string - required: - - propertyPaths - - propertyValue - title: PropertyValueTransformationBeta - type: object GetTransformationBetaOutput: description: The output of Transformation retrieval. example: @@ -29002,15 +28936,6 @@ components: transformations: - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -29023,15 +28948,6 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -29116,13 +29032,6 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array - propertyValueTransformations: - description: Optional array for transforming properties and values collected - by your events. - items: - $ref: '#/components/schemas/PropertyValueTransformationBeta' - title: propertyValueTransformations - type: array required: - transformationId title: UpdateTransformationBetaInput @@ -29176,13 +29085,6 @@ components: $ref: '#/components/schemas/PropertyRenameBeta' title: propertyRenames type: array - propertyValueTransformations: - description: Optional array for transforming properties and values collected - by your events. - items: - $ref: '#/components/schemas/PropertyValueTransformationBeta' - title: propertyValueTransformations - type: array required: - enabled - if @@ -30602,11 +30504,11 @@ components: key: key properties: data: - $ref: '#/components/schemas/ReplaceLabelsInSourceAlphaOutput' + $ref: '#/components/schemas/ReplaceLabelsInSourceV1Output' replaceLabelsInSource_200_response_1: properties: data: - $ref: '#/components/schemas/ReplaceLabelsInSourceV1Output' + $ref: '#/components/schemas/ReplaceLabelsInSourceAlphaOutput' addLabelsToSource_200_response: example: data: @@ -30619,11 +30521,11 @@ components: key: key properties: data: - $ref: '#/components/schemas/AddLabelsToSourceAlphaOutput' + $ref: '#/components/schemas/AddLabelsToSourceV1Output' addLabelsToSource_200_response_1: properties: data: - $ref: '#/components/schemas/AddLabelsToSourceV1Output' + $ref: '#/components/schemas/AddLabelsToSourceAlphaOutput' replacePermissionsForUser_200_response: example: data: @@ -31137,28 +31039,22 @@ components: key: key properties: data: - $ref: '#/components/schemas/ListLabelsAlphaOutput' + $ref: '#/components/schemas/ListLabelsV1Output' listLabels_200_response_1: properties: data: - $ref: '#/components/schemas/ListLabelsV1Output' + $ref: '#/components/schemas/ListLabelsAlphaOutput' createLabel_200_response: example: data: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key + label: null properties: data: - $ref: '#/components/schemas/CreateLabelAlphaOutput' + $ref: '#/components/schemas/CreateLabelV1Output' createLabel_200_response_1: properties: data: - $ref: '#/components/schemas/CreateLabelV1Output' + $ref: '#/components/schemas/CreateLabelAlphaOutput' listSources_200_response: example: data: @@ -31200,22 +31096,22 @@ components: key: key properties: data: - $ref: '#/components/schemas/ListSourcesAlphaOutput' + $ref: '#/components/schemas/ListSourcesV1Output' listSources_200_response_1: properties: data: - $ref: '#/components/schemas/ListSourcesV1Output' + $ref: '#/components/schemas/ListSourcesAlphaOutput' createSource_200_response: example: data: source: null properties: data: - $ref: '#/components/schemas/CreateSourceAlphaOutput' + $ref: '#/components/schemas/CreateSourceV1Output' createSource_200_response_1: properties: data: - $ref: '#/components/schemas/CreateSourceV1Output' + $ref: '#/components/schemas/CreateSourceAlphaOutput' listRegulationsFromSource_200_response: example: data: @@ -31282,15 +31178,6 @@ components: transformations: - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -31303,15 +31190,6 @@ components: oldName: oldName - sourceId: sourceId newEventName: newEventName - propertyValueTransformations: - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue - - propertyPaths: - - propertyPaths - - propertyPaths - propertyValue: propertyValue name: name destinationMetadataId: destinationMetadataId id: id @@ -31578,11 +31456,11 @@ components: status: SUCCESS properties: data: - $ref: '#/components/schemas/DeleteLabelAlphaOutput' + $ref: '#/components/schemas/DeleteLabelV1Output' deleteLabel_200_response_1: properties: data: - $ref: '#/components/schemas/DeleteLabelV1Output' + $ref: '#/components/schemas/DeleteLabelAlphaOutput' getRegulation_200_response: example: data: @@ -31633,33 +31511,33 @@ components: source: null properties: data: - $ref: '#/components/schemas/GetSourceAlphaOutput' + $ref: '#/components/schemas/GetSourceV1Output' getSource_200_response_1: properties: data: - $ref: '#/components/schemas/GetSourceV1Output' + $ref: '#/components/schemas/GetSourceAlphaOutput' deleteSource_200_response: example: data: status: SUCCESS properties: data: - $ref: '#/components/schemas/DeleteSourceAlphaOutput' + $ref: '#/components/schemas/DeleteSourceV1Output' deleteSource_200_response_1: properties: data: - $ref: '#/components/schemas/DeleteSourceV1Output' + $ref: '#/components/schemas/DeleteSourceAlphaOutput' updateSource_200_response: example: data: source: null properties: data: - $ref: '#/components/schemas/UpdateSourceAlphaOutput' + $ref: '#/components/schemas/UpdateSourceV1Output' updateSource_200_response_1: properties: data: - $ref: '#/components/schemas/UpdateSourceV1Output' + $ref: '#/components/schemas/UpdateSourceAlphaOutput' getTrackingPlan_200_response: example: data: @@ -31895,11 +31773,11 @@ components: message: message properties: data: - $ref: '#/components/schemas/EchoAlphaOutput' + $ref: '#/components/schemas/EchoV1Output' echo_200_response_1: properties: data: - $ref: '#/components/schemas/EchoV1Output' + $ref: '#/components/schemas/EchoAlphaOutput' generateUploadURLForEdgeFunctions_200_response: example: data: @@ -32518,11 +32396,11 @@ components: enabled: true properties: data: - $ref: '#/components/schemas/ListConnectedDestinationsFromSourceAlphaOutput' + $ref: '#/components/schemas/ListConnectedDestinationsFromSourceV1Output' listConnectedDestinationsFromSource_200_response_1: properties: data: - $ref: '#/components/schemas/ListConnectedDestinationsFromSourceV1Output' + $ref: '#/components/schemas/ListConnectedDestinationsFromSourceAlphaOutput' listConnectedSourcesFromWarehouse_200_response: example: data: @@ -32582,11 +32460,11 @@ components: workspaceId: workspaceId properties: data: - $ref: '#/components/schemas/ListConnectedWarehousesFromSourceAlphaOutput' + $ref: '#/components/schemas/ListConnectedWarehousesFromSourceV1Output' listConnectedWarehousesFromSource_200_response_1: properties: data: - $ref: '#/components/schemas/ListConnectedWarehousesFromSourceV1Output' + $ref: '#/components/schemas/ListConnectedWarehousesFromSourceAlphaOutput' listDeliveryMetricsSummaryFromDestination_200_response: example: data: @@ -32917,11 +32795,6 @@ components: description: "Platforms from which the Destination receives events.\n\nConfig\ \ API note: equal to `platforms`." title: supportedPlatforms - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata subscription: allOf: - $ref: '#/components/schemas/DestinationSubscription' @@ -32937,6 +32810,11 @@ components: - $ref: '#/components/schemas/DestinationSubscriptionUpdateInput' description: A set of valid Destination input params required for updating. title: input + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata deliveryMetricsSummary: allOf: - $ref: '#/components/schemas/DeliveryMetricsSummaryBeta' diff --git a/pom.xml b/pom.xml index 855dbdcf..0bafff52 100644 --- a/pom.xml +++ b/pom.xml @@ -5,23 +5,31 @@ segment-publicapi jar segment-publicapi - 32.0.2 + 32.0.4 https://segment.com/docs/api/public-api/ Segment Public API - scm:git:git@github.com:openapitools/openapi-generator.git - scm:git:git@github.com:openapitools/openapi-generator.git - https://github.com/openapitools/openapi-generator + scm:git:git@github.com:segmentio/public-api-sdk-java.git + scm:git:ssh@github.com:segmentio/public-api-sdk-java.git + https://github.com/segmentio/public-api-sdk-java - - Unlicense - http://unlicense.org + MIT License + http://www.opensource.org/licenses/mit-license.php repo - + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + Segment @@ -30,7 +38,6 @@ https://segment.com/ - @@ -50,7 +57,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -93,6 +100,7 @@ maven-dependency-plugin + 3.3.0 package @@ -109,7 +117,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -123,7 +131,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -154,7 +162,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.1 attach-javadocs @@ -177,7 +185,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources @@ -218,7 +226,7 @@ - 1.8 + 1.15.0 true @@ -229,33 +237,34 @@ + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - io.swagger @@ -340,17 +349,17 @@ ${java.version} 1.8.5 1.6.5 - 4.9.3 - 2.9.0 + 4.10.0 + 2.9.1 3.12.0 - 0.2.3 + 0.2.4 1.3.5 - 5.8.2 - 1.6.2 + 5.9.1 + 1.9.1 3.12.4 2.1.1 1.1.1 UTF-8 - 2.21.0 + 2.27.2 diff --git a/src/main/java/com/segment/publicapi/ApiCallback.java b/src/main/java/com/segment/publicapi/ApiCallback.java index ef2036bd..12817a96 100644 --- a/src/main/java/com/segment/publicapi/ApiCallback.java +++ b/src/main/java/com/segment/publicapi/ApiCallback.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,13 +10,11 @@ * Do not edit the class manually. */ - package com.segment.publicapi; -import java.io.IOException; -import java.util.Map; import java.util.List; +import java.util.Map; /** * Callback for asynchronous API call. diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 928329b5..076b5ccb 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,21 +10,14 @@ * Do not edit the class manually. */ - package com.segment.publicapi; -import com.segment.publicapi.models.PaginationInput; -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; - -import javax.net.ssl.*; +import com.segment.publicapi.auth.ApiKeyAuth; +import com.segment.publicapi.auth.Authentication; +import com.segment.publicapi.auth.HttpBasicAuth; +import com.segment.publicapi.auth.HttpBearerAuth; +import com.segment.publicapi.models.PaginationInput; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -41,7 +34,6 @@ import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; import java.text.DateFormat; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -51,15 +43,17 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.net.ssl.*; +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; -import com.segment.publicapi.auth.Authentication; -import com.segment.publicapi.auth.HttpBasicAuth; -import com.segment.publicapi.auth.HttpBearerAuth; -import com.segment.publicapi.auth.ApiKeyAuth; - -/** - *

ApiClient class.

- */ +/** ApiClient class. */ public class ApiClient { private String basePath = "https://api.segmentapis.com"; @@ -84,9 +78,7 @@ public class ApiClient { private HttpLoggingInterceptor loggingInterceptor; - /** - * Basic constructor for ApiClient - */ + /** Basic constructor for ApiClient */ public ApiClient() { init(); initHttpClient(); @@ -120,7 +112,7 @@ private void initHttpClient() { private void initHttpClient(List interceptors) { OkHttpClient.Builder builder = new OkHttpClient.Builder(); builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { + for (Interceptor interceptor : interceptors) { builder.addInterceptor(interceptor); } @@ -133,7 +125,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/32.0.2/java"); + setUserAgent("OpenAPI-Generator/32.0.4/java"); authentications = new HashMap(); } @@ -209,9 +201,9 @@ public boolean isVerifyingSsl() { } /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * Configure whether to verify certificate and hostname when making https requests. Default to + * true. NOTE: Do NOT set to false in production code, otherwise you would face multiple types + * of cryptographic attacks. * * @param verifyingSsl True to verify TLS/SSL connection * @return ApiClient @@ -232,8 +224,8 @@ public InputStream getSslCaCert() { } /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. + * Configure the CA certificate to be trusted when making https requests. Use null to reset to + * default. * * @param sslCaCert input stream for SSL CA cert * @return ApiClient @@ -245,7 +237,7 @@ public ApiClient setSslCaCert(InputStream sslCaCert) { } /** - *

Getter for the field keyManagers.

+ * Getter for the field keyManagers. * * @return an array of {@link javax.net.ssl.KeyManager} objects */ @@ -254,8 +246,8 @@ public KeyManager[] getKeyManagers() { } /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. + * Configure client keys to use for authorization in an SSL session. Use null to reset to + * default. * * @param managers The KeyManagers to use * @return ApiClient @@ -267,7 +259,7 @@ public ApiClient setKeyManagers(KeyManager[] managers) { } /** - *

Getter for the field dateFormat.

+ * Getter for the field dateFormat. * * @return a {@link java.text.DateFormat} object */ @@ -276,7 +268,7 @@ public DateFormat getDateFormat() { } /** - *

Setter for the field dateFormat.

+ * Setter for the field dateFormat. * * @param dateFormat a {@link java.text.DateFormat} object * @return a {@link com.segment.publicapi.ApiClient} object @@ -287,7 +279,7 @@ public ApiClient setDateFormat(DateFormat dateFormat) { } /** - *

Set SqlDateFormat.

+ * Set SqlDateFormat. * * @param dateFormat a {@link java.text.DateFormat} object * @return a {@link com.segment.publicapi.ApiClient} object @@ -298,7 +290,7 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { } /** - *

Set OffsetDateTimeFormat.

+ * Set OffsetDateTimeFormat. * * @param dateFormat a {@link java.time.format.DateTimeFormatter} object * @return a {@link com.segment.publicapi.ApiClient} object @@ -309,7 +301,7 @@ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { } /** - *

Set LocalDateFormat.

+ * Set LocalDateFormat. * * @param dateFormat a {@link java.time.format.DateTimeFormatter} object * @return a {@link com.segment.publicapi.ApiClient} object @@ -320,7 +312,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { } /** - *

Set LenientOnJson.

+ * Set LenientOnJson. * * @param lenientOnJson a boolean * @return a {@link com.segment.publicapi.ApiClient} object @@ -349,10 +341,11 @@ public Authentication getAuthentication(String authName) { return authentications.get(authName); } - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ + /** + * Helper method to set access token for the first Bearer authentication. + * + * @param bearerToken Bearer token + */ public void setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { @@ -500,11 +493,12 @@ public ApiClient setDebugging(boolean debugging) { } /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. + * The path of temporary folder used to store downloaded files from endpoints with file + * response. The default value is null, i.e. using the system's default temporary + * folder. * - * @see createTempFile + * @see createTempFile * @return Temporary folder path */ public String getTempFolderPath() { @@ -532,15 +526,18 @@ public int getConnectTimeout() { } /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. + * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values + * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. * * @param connectionTimeout connection timeout in milliseconds * @return Api client */ public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + httpClient = + httpClient + .newBuilder() + .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS) + .build(); return this; } @@ -554,15 +551,15 @@ public int getReadTimeout() { } /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. + * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link java.lang.Integer#MAX_VALUE}. * * @param readTimeout read timeout in milliseconds * @return Api client */ public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + httpClient = + httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); return this; } @@ -576,19 +573,18 @@ public int getWriteTimeout() { } /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. + * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values + * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. * * @param writeTimeout connection timeout in milliseconds * @return Api client */ public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + httpClient = + httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); return this; } - /** * Format the given parameter object into string. * @@ -598,8 +594,10 @@ public ApiClient setWriteTimeout(int writeTimeout) { public String parameterToString(Object param) { if (param == null) { return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters + } else if (param instanceof Date + || param instanceof OffsetDateTime + || param instanceof LocalDate) { + // Serialize to json string and remove the " enclosing characters String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { @@ -619,7 +617,7 @@ public String parameterToString(Object param) { /** * Formats the specified query parameter to a list containing a single {@code Pair} object. * - * Note that {@code value} must not be a collection. + *

Note that {@code value} must not be a collection. * * @param name The name of the parameter. * @param value The value of the parameter. @@ -653,7 +651,7 @@ public List parameterToPair(String name, Object value) { /** * Formats the specified collection query parameters to a list of {@code Pair} objects. * - * Note that the values of each of the returned Pair objects are percent-encoded. + *

Note that the values of each of the returned Pair objects are percent-encoded. * * @param collectionFormat The collection format of the parameter. * @param name The name of the parameter. @@ -725,7 +723,7 @@ public String collectionPathParameterToString(String collectionFormat, Collectio delimiter = "|"; } - StringBuilder sb = new StringBuilder() ; + StringBuilder sb = new StringBuilder(); for (Object item : value) { sb.append(delimiter); sb.append(parameterToString(item)); @@ -735,8 +733,7 @@ public String collectionPathParameterToString(String collectionFormat, Collectio } /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif + * Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif * * @param filename The filename to be sanitized * @return The sanitized filename @@ -746,13 +743,10 @@ public String sanitizeFilename(String filename) { } /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON + * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json + * application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also + * default to JSON + * * @param mime MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ @@ -762,13 +756,12 @@ public boolean isJsonMime(String mime) { } /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * Select the Accept header's value from the given accepts array: if JSON exists in the given + * array, use it; otherwise use all of them (joining into a string) * * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). + * @return The Accept header to use. If the given array is empty, null will be returned (not to + * set the Accept header explicitly). */ public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { @@ -783,13 +776,12 @@ public String selectHeaderAccept(String[] accepts) { } /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. + * Select the Content-Type header's value from the given array: if JSON exists in the given + * array, use it; otherwise use the first one of the array. * * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. + * @return The Content-Type header to use. If the given array is empty, returns null. If it + * matches "any", JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { if (contentTypes.length == 0) { @@ -824,15 +816,15 @@ public String escapeString(String str) { } /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. + * Deserialize response body to Java object, according to the return type and the Content-Type + * response header. * * @param Type * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws com.segment.publicapi.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. + * @throws com.segment.publicapi.ApiException If fail to deserialize response body, i.e. cannot + * read response body or the Content-Type of the response is not supported. */ @SuppressWarnings("unchecked") public T deserialize(Response response, Type returnType) throws ApiException { @@ -854,10 +846,8 @@ public T deserialize(Response response, Type returnType) throws ApiException String respBody; try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; + if (response.body() != null) respBody = response.body().string(); + else respBody = null; } catch (IOException e) { throw new ApiException(e); } @@ -886,8 +876,8 @@ public T deserialize(Response response, Type returnType) throws ApiException } /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. + * Serialize the given Java object into request body according to the object's class and the + * request Content-Type. * * @param obj The Java object * @param contentType The request Content-Type @@ -922,7 +912,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException * Download file from the given response. * * @param response An instance of the Response object - * @throws com.segment.publicapi.ApiException If fail to read file content from response and write to disk + * @throws com.segment.publicapi.ApiException If fail to read file content from response and + * write to disk * @return Downloaded file */ public File downloadFileFromResponse(Response response) throws ApiException { @@ -970,14 +961,11 @@ public File prepareDownloadFile(Response response) throws IOException { suffix = filename.substring(pos); } // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; + if (prefix.length() < 3) prefix = "download-"; } - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + if (tempFolderPath == null) return Files.createTempFile(prefix, suffix).toFile(); + else return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -998,9 +986,8 @@ public ApiResponse execute(Call call) throws ApiException { * @param returnType The return type used to deserialize HTTP response body * @param The return type corresponding to (same with) returnType * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. + * @return ApiResponse object containing response status, headers and data, which is a Java + * object deserialized from response body and would be null when returnType is null. * @throws com.segment.publicapi.ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { @@ -1035,27 +1022,32 @@ public void executeAsync(Call call, ApiCallback callback) { */ @SuppressWarnings("unchecked") public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } + call.enqueue( + new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure( + new ApiException(e), + response.code(), + response.headers().toMultimap()); + return; + } + callback.onSuccess( + result, response.code(), response.headers().toMultimap()); + } + }); } /** @@ -1066,7 +1058,7 @@ public void onResponse(Call call, Response response) throws IOException { * @param returnType Return type * @return Type * @throws com.segment.publicapi.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body + * fail to deserialize the response body */ public T handleResponse(Response response, Type returnType) throws ApiException { if (response.isSuccessful()) { @@ -1077,7 +1069,11 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept try { response.body().close(); } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + throw new ApiException( + response.message(), + e, + response.code(), + response.headers().toMultimap()); } } return null; @@ -1090,10 +1086,15 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept try { respBody = response.body().string(); } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + throw new ApiException( + response.message(), + e, + response.code(), + response.headers().toMultimap()); } } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + throw new ApiException( + response.message(), response.code(), response.headers().toMultimap(), respBody); } } @@ -1102,7 +1103,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * * @param baseUrl The base URL * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and + * "DELETE" * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters * @param body The request body object @@ -1114,8 +1116,32 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @return The HTTP call * @throws com.segment.publicapi.ApiException If fail to serialize the request body object */ - public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall( + String baseUrl, + String path, + String method, + List queryParams, + List collectionQueryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String[] authNames, + ApiCallback callback) + throws ApiException { + Request request = + buildRequest( + baseUrl, + path, + method, + queryParams, + collectionQueryParams, + body, + headerParams, + cookieParams, + formParams, + authNames, + callback); return httpClient.newCall(request); } @@ -1125,7 +1151,8 @@ public Call buildCall(String baseUrl, String path, String method, List que * * @param baseUrl The base URL * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and + * "DELETE" * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters * @param body The request body object @@ -1137,7 +1164,19 @@ public Call buildCall(String baseUrl, String path, String method, List que * @return The HTTP request * @throws com.segment.publicapi.ApiException If fail to serialize the request body object */ - public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + public Request buildRequest( + String baseUrl, + String path, + String method, + List queryParams, + List collectionQueryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String[] authNames, + ApiCallback callback) + throws ApiException { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams List allQueryParams = new ArrayList(queryParams); allQueryParams.addAll(collectionQueryParams); @@ -1160,14 +1199,23 @@ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams) { + public String buildUrl( + String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); if (baseUrl != null) { url.append(baseUrl).append(path); @@ -1218,7 +1267,9 @@ public String buildUrl(String baseUrl, String path, List queryParams, List url.append("&"); } String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + url.append(escapeString(param.getName())) + .append("=") + .append(escapeString(value)); } } } @@ -1268,11 +1319,13 @@ public void processHeaderParams(Map headerParams, Request.Builde */ public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + reqBuilder.addHeader( + "Cookie", String.format("%s=%s", param.getKey(), param.getValue())); } for (Entry param : defaultCookieMap.entrySet()) { if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + reqBuilder.addHeader( + "Cookie", String.format("%s=%s", param.getKey(), param.getValue())); } } } @@ -1289,8 +1342,15 @@ public void processCookieParams(Map cookieParams, Request.Builde * @param uri URI * @throws com.segment.publicapi.ApiException If fails to update the parameters */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { + public void updateParamsForAuth( + String[] authNames, + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { @@ -1315,8 +1375,8 @@ public RequestBody buildRequestBodyFormEncoding(Map formParams) } /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. + * Build a multipart (file uploading) request body with the given form parameters, which could + * contain text fields and file fields. * * @param formParams Form parameters in the form of Map * @return RequestBody @@ -1329,7 +1389,7 @@ public RequestBody buildRequestBodyMultipart(Map formParams) { addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); } else if (param.getValue() instanceof List) { List list = (List) param.getValue(); - for (Object item: list) { + for (Object item : list) { if (item instanceof File) { addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); } else { @@ -1361,24 +1421,29 @@ public String guessContentTypeFromFile(File file) { /** * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. * - * @param mpBuilder MultipartBody.Builder + * @param mpBuilder MultipartBody.Builder * @param key The key of the Header element * @param file The file to add to the Header - */ + */ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + Headers partHeaders = + Headers.of( + "Content-Disposition", + "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); } /** - * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody + * Builder. * * @param mpBuilder MultipartBody.Builder * @param key The key of the Header element * @param obj The complex object to add to the Header */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + private void addPartToMultiPartBuilder( + MultipartBody.Builder mpBuilder, String key, Object obj) { RequestBody requestBody; if (obj instanceof String) { requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); @@ -1397,8 +1462,8 @@ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String k } /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. + * Get network interceptor to add it to the httpClient to track download progress for async + * requests. */ private Interceptor getProgressInterceptor() { return new Interceptor() { @@ -1408,9 +1473,10 @@ public Response intercept(Interceptor.Chain chain) throws IOException { final Response originalResponse = chain.proceed(request); if (request.tag() instanceof ApiCallback) { final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); + return originalResponse + .newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); } return originalResponse; } @@ -1418,47 +1484,54 @@ public Response intercept(Interceptor.Chain chain) throws IOException { } /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. + * Apply SSL related settings to httpClient according to the current values of verifyingSsl and + * sslCaCert. */ private void applySslSettings() { try { TrustManager[] trustManagers; HostnameVerifier hostnameVerifier; if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + trustManagers = + new TrustManager[] { + new X509TrustManager() { + @Override + public void checkClientTrusted( + java.security.cert.X509Certificate[] chain, String authType) + throws CertificateException {} + + @Override + public void checkServerTrusted( + java.security.cert.X509Certificate[] chain, String authType) + throws CertificateException {} + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[] {}; + } } - + }; + hostnameVerifier = + new HostnameVerifier() { @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; + public boolean verify(String hostname, SSLSession session) { + return true; } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; + }; } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + TrustManagerFactory trustManagerFactory = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); if (sslCaCert == null) { trustManagerFactory.init((KeyStore) null); } else { char[] password = null; // Any password will work. CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); + Collection certificates = + certificateFactory.generateCertificates(sslCaCert); if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + throw new IllegalArgumentException( + "expected non-empty set of trusted certificates"); } KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; @@ -1474,8 +1547,12 @@ public boolean verify(String hostname, SSLSession session) { SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + httpClient = + httpClient + .newBuilder() + .sslSocketFactory( + sslContext.getSocketFactory(), + (X509TrustManager) trustManagers[0]) .hostnameVerifier(hostnameVerifier) .build(); } catch (GeneralSecurityException e) { @@ -1498,7 +1575,8 @@ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityExcepti * * @param requestBody The HTTP request object * @return The string representation of the HTTP request body - * @throws com.segment.publicapi.ApiException If fail to serialize the request body object into a string + * @throws com.segment.publicapi.ApiException If fail to serialize the request body object into + * a string */ private String requestBodyToString(RequestBody requestBody) throws ApiException { if (requestBody != null) { diff --git a/src/main/java/com/segment/publicapi/ApiException.java b/src/main/java/com/segment/publicapi/ApiException.java index 15b7c7fa..c0590044 100644 --- a/src/main/java/com/segment/publicapi/ApiException.java +++ b/src/main/java/com/segment/publicapi/ApiException.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,31 +10,24 @@ * Do not edit the class manually. */ - package com.segment.publicapi; -import java.util.Map; -import java.util.List; -import javax.ws.rs.core.GenericType; +import java.util.List; +import java.util.Map; -/** - *

ApiException class.

- */ +/** ApiException class. */ @SuppressWarnings("serial") - public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - - /** - *

Constructor for ApiException.

- */ + + /** Constructor for ApiException. */ public ApiException() {} /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param throwable a {@link java.lang.Throwable} object */ @@ -43,7 +36,7 @@ public ApiException(Throwable throwable) { } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param message the error message */ @@ -52,7 +45,7 @@ public ApiException(String message) { } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param message the error message * @param throwable a {@link java.lang.Throwable} object @@ -60,7 +53,12 @@ public ApiException(String message) { * @param responseHeaders a {@link java.util.Map} of HTTP response headers * @param responseBody the response body */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders, + String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; @@ -68,31 +66,39 @@ public ApiException(String message, Throwable throwable, int code, MapConstructor for ApiException.

+ * Constructor for ApiException. * * @param message the error message * @param code HTTP status code * @param responseHeaders a {@link java.util.Map} of HTTP response headers * @param responseBody the response body */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + public ApiException( + String message, + int code, + Map> responseHeaders, + String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param message the error message * @param throwable a {@link java.lang.Throwable} object * @param code HTTP status code * @param responseHeaders a {@link java.util.Map} of HTTP response headers */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders) { this(message, throwable, code, responseHeaders, null); } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param code HTTP status code * @param responseHeaders a {@link java.util.Map} of HTTP response headers @@ -103,7 +109,7 @@ public ApiException(int code, Map> responseHeaders, String } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param code HTTP status code * @param message a {@link java.lang.String} object @@ -114,14 +120,18 @@ public ApiException(int code, String message) { } /** - *

Constructor for ApiException.

+ * Constructor for ApiException. * * @param code HTTP status code * @param message the error message * @param responseHeaders a {@link java.util.Map} of HTTP response headers * @param responseBody the response body */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + public ApiException( + int code, + String message, + Map> responseHeaders, + String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; @@ -160,7 +170,12 @@ public String getResponseBody() { * @return The exception message */ public String getMessage() { - return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", - super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + return String.format( + "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response" + + " headers: %s", + super.getMessage(), + this.getCode(), + this.getResponseBody(), + this.getResponseHeaders()); } } diff --git a/src/main/java/com/segment/publicapi/ApiResponse.java b/src/main/java/com/segment/publicapi/ApiResponse.java index 34468098..95a241ca 100644 --- a/src/main/java/com/segment/publicapi/ApiResponse.java +++ b/src/main/java/com/segment/publicapi/ApiResponse.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,22 +10,20 @@ * Do not edit the class manually. */ - package com.segment.publicapi; + import java.util.List; import java.util.Map; -/** - * API response returned by API call. - */ +/** API response returned by API call. */ public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; + private final int statusCode; + private final Map> headers; + private final T data; /** - *

Constructor for ApiResponse.

+ * Constructor for ApiResponse. * * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response @@ -35,7 +33,7 @@ public ApiResponse(int statusCode, Map> headers) { } /** - *

Constructor for ApiResponse.

+ * Constructor for ApiResponse. * * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response @@ -48,7 +46,7 @@ public ApiResponse(int statusCode, Map> headers, T data) { } /** - *

Get the status code.

+ * Get the status code. * * @return the status code */ @@ -57,16 +55,16 @@ public int getStatusCode() { } /** - *

Get the headers.

+ * Get the headers. * - * @return a {@link java.util.Map} of headers + * @return a {@link java.util.Map} of headers */ public Map> getHeaders() { return headers; } /** - *

Get the data.

+ * Get the data. * * @return the data */ diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index bfc4e3d5..f3510d54 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,16 +10,14 @@ * Do not edit the class manually. */ - package com.segment.publicapi; - public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. + * Get the default API client, which would be used when creating API instances without providing + * an API client. * * @return Default API client */ @@ -28,8 +26,8 @@ public static ApiClient getDefaultApiClient() { } /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. + * Set the default API client, which would be used when creating API instances without providing + * an API client. * * @param apiClient API client */ diff --git a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java index a411ce50..89734910 100644 --- a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java +++ b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,21 +10,20 @@ * Do not edit the class manually. */ - package com.segment.publicapi; + +import java.io.IOException; import okhttp3.*; import okio.Buffer; import okio.BufferedSink; import okio.GzipSink; import okio.Okio; -import java.io.IOException; - /** * Encodes request bodies using gzip. * - * Taken from https://github.com/square/okhttp/issues/350 + *

Taken from https://github.com/square/okhttp/issues/350 */ class GzipRequestInterceptor implements Interceptor { @Override @@ -34,10 +33,14 @@ public Response intercept(Chain chain) throws IOException { return chain.proceed(originalRequest); } - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); + Request compressedRequest = + originalRequest + .newBuilder() + .header("Content-Encoding", "gzip") + .method( + originalRequest.method(), + forceContentLength(gzip(originalRequest.body()))) + .build(); return chain.proceed(compressedRequest); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 80448002..e0135b8d 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,22 +10,18 @@ * Do not edit the class manually. */ - package com.segment.publicapi; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; - -import okio.ByteString; - import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; @@ -36,9 +32,8 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; -import java.util.Locale; import java.util.Map; -import java.util.HashMap; +import okio.ByteString; /* * A JSON utility class @@ -51,37 +46,42 @@ public class JSON { private static boolean isLenientOnJson = false; private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = + new OffsetDateTimeTypeAdapter(); private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - ; + GsonFireBuilder fireBuilder = new GsonFireBuilder(); GsonBuilder builder = fireBuilder.createGsonBuilder(); return builder; } - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + private static String getDiscriminatorValue( + JsonElement readElement, String discriminatorField) { JsonElement element = readElement.getAsJsonObject().get(discriminatorField); if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + throw new IllegalArgumentException( + "missing discriminator field: <" + discriminatorField + ">"); } return element.getAsString(); } /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * Returns the Java class that implements the OpenAPI schema for the specified discriminator + * value. * * @param classByDiscriminatorValue The map of discriminator values to Java classes. * @param discriminatorValue The value of the OpenAPI discriminator in the input data. * @return The Java class that implements the OpenAPI schema */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + private static Class getClassByDiscriminator( + Map classByDiscriminatorValue, String discriminatorValue) { Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + throw new IllegalArgumentException( + "cannot determine model class of name: <" + discriminatorValue + ">"); } return clazz; } @@ -93,470 +93,1210 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.APICallSnapshotV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AccessPermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddConnectionFromSourceToWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddConnectionFromSourceToWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddLabelsToSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddLabelsToSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddLabelsToSourceAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddLabelsToSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddLabelsToSourceV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddLabelsToSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddPermissionsToUser200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddPermissionsToUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddPermissionsToUserGroupV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddPermissionsToUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddPermissionsToUserV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddPermissionsToUserV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddSourceToTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddSourceToTrackingPlanV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddSourceToTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddUsersToUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddUsersToUserGroupV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AddUsersToUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AdvancedWarehouseSyncScheduleV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AdvancedWarehouseSyncScheduleV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpace200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateCloudSourceRegulation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateCloudSourceRegulationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateCloudSourceRegulationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateDestinationSubscription200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateDestinationSubscriptionAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateDestinationSubscriptionAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateDestinationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateEdgeFunctions200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateEdgeFunctionsAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateEdgeFunctionsAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFilterForDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFilterForDestinationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFilterForDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFunction200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFunctionDeployment200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFunctionDeploymentV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFunctionV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateFunctionV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateInvites200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateInvitesV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateInvitesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateLabel200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateLabel200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateLabelAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateLabelAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateLabelV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateLabelV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceRegulation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceRegulationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceRegulationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateTrackingPlanV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateTransformation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateTransformationBetaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateTransformationBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateUserGroupV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateValidationInWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateValidationInWarehouseV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateValidationInWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateWarehouseV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateWorkspaceRegulation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateWorkspaceRegulationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.CreateWorkspaceRegulationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteFunction200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteFunctionV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteInvites200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteInvitesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteLabel200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteLabel200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteLabelAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteLabelV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteRegulation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteRegulationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteTransformation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteTransformationBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteUsers200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteUsersV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeleteWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeliveryMetricsSummary.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DeliveryMetricsSummaryBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Destination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Destination1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Destination2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationFilterActionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationFilterV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataActionFieldV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataActionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataComponentV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataFeaturesV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataMethodsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataPlatformsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataSubscriptionPresetV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationMetadataV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationStatusV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationSubscription.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationSubscriptionUpdateInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DestinationV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DisableEdgeFunctions200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.DisableEdgeFunctionsAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Echo200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Echo200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.EchoAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.EdgeFunctions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.EdgeFunctions1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Filter1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Filter2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Filter3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Function.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Function1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Function2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.FunctionSettingV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.FunctionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GenerateUploadURLForEdgeFunctions200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GenerateUploadURLForEdgeFunctionsAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetConnectionStateFromWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetConnectionStateFromWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyPerSourceAPICallsUsage200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyPerSourceAPICallsUsageV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyPerSourceMTUUsage200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyPerSourceMTUUsageV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsage200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsageV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyWorkspaceMTUUsage200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDailyWorkspaceMTUUsageV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDestinationMetadata200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDestinationMetadataV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDestinationsCatalog200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetDestinationsCatalogV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetEventsVolumeFromWorkspace200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetFilterInDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetFilterInDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetFunction200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetFunctionV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetLatestFromEdgeFunctionsAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetMessagingSubscriptionFailureResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetRegulation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetRegulationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSourceMetadata200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSourceMetadataV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSourcesCatalog200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSourcesCatalogV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSpace200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSpaceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSubscriptionFromDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSubscriptionFromDestinationAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetSubscriptionRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetTransformation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetTransformationBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetUserV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWarehouseMetadata200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWarehouseMetadataV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWarehousesCatalog200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWarehousesCatalogV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWorkspace200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GetWorkspaceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Group.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.GroupSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Identify.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.IdentifySourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.IntegrationOptionBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.InvitePermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.InviteV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Label.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Label1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Label2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListAuditEvents200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListAuditEventsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedDestinationsFromSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedDestinationsFromSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedSourcesFromWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedSourcesFromWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedWarehousesFromSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedWarehousesFromSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedWarehousesFromSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListConnectedWarehousesFromSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListDeliveryMetricsSummaryFromDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListDeliveryMetricsSummaryFromDestinationBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListDestinations200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListDestinationsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListFiltersFromDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListFiltersFromDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListFunctionItemV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListFunctions200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListFunctionsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListInvites200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListInvitesFromUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListInvitesFromUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListInvitesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListLabels200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListLabels200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListLabelsAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListLabelsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListRegulationsFromSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListRegulationsFromSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListRoles200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListRolesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListRulesFromTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListRulesFromTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSchemaSettingsInSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSchemaSettingsInSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSources200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSources200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSourcesAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSourcesFromTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSourcesFromTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSourcesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSubscriptionsFromDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSubscriptionsFromDestinationAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSuppressions200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSuppressionsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSyncsFromWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSyncsFromWarehouseAndSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSyncsFromWarehouseAndSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListSyncsFromWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListTrackingPlans200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListTrackingPlansV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListTransformations200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListTransformationsBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUserGroups200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUserGroupsFromUser200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUserGroupsFromUserV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUserGroupsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUsers200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUsersFromUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUsersFromUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListUsersV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListWarehouses200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListWarehousesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListWorkspaceRegulations200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ListWorkspaceRegulationsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Logos.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Logos1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Logos2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.LogosBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MessageSubscriptionResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MessageSubscriptionResponseError.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MessagesSubscriptionRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Metadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Metadata1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Metadata2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MetricBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MinimalUserGroupV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MinimalUserV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PaginationOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PermissionInputV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilter200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PreviewDestinationFilterV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.PropertyValueTransformationBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveFilterFromDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveRuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveRulesFromTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveRulesFromTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveSourceConnectionFromWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveSourceConnectionFromWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveSourceFromTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveSourceFromTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveSubscriptionFromDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveSubscriptionFromDestinationAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveUsersFromUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RemoveUsersFromUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouseV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceLabelsInSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceLabelsInSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceLabelsInSourceAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceLabelsInSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceLabelsInSourceV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceLabelsInSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpaces200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpacesAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpacesAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplacePermissionsForUser200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplacePermissionsForUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplacePermissionsForUserGroupV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplacePermissionsForUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplacePermissionsForUserV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplacePermissionsForUserV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceRulesInTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceUsersInUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceUsersInUserGroupV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ReplaceUsersInUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RequestError.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RequestErrorEnvelope.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.ResourceV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Schedule.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Schedule1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Schedule2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Settings.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Settings1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source4.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source5.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Source6.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceAPICallSnapshotV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceAlpha.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceEventVolumeDatapointV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceEventVolumeV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceMetadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceMetadataV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceSettingsOutputV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SourceV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Space.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Subscription.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SupportedFeatures.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SupportedMethods.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SupportedPlatforms.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SuppressedInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SyncNoticeV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.SyncV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Track.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.TrackSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.TrackingPlan.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.TrackingPlan1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.TrackingPlanV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Transformation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateDestinationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateFilterForDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateFilterForDestinationV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateFilterForDestinationV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateFunction200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateFunctionV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateFunctionV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateRulesInTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateRulesInTrackingPlanV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateRulesInTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSchemaSettingsInSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSchemaSettingsInSourceV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSchemaSettingsInSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSource200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSource200Response1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSourceAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSourceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSourceV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSubscriptionForDestination200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSubscriptionForDestinationAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateSubscriptionForDestinationAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateTrackingPlan200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateTrackingPlanV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateTrackingPlanV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateTransformation200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateTransformationBetaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateTransformationBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateUserGroup200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateUserGroupV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateUserGroupV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateWarehouse200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateWarehouseV1Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpdateWarehouseV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UpsertRuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.User.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UserGroup.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UserGroup1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UserGroup2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UserGroup3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UserGroupV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UserV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.UsersPerSourceSnapshotV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Warehouse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Warehouse1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Warehouse2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WarehouseAdvancedSyncV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WarehouseMetadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WarehouseMetadataV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WarehouseSelectiveSyncItemV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WarehouseSyncOverrideV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WarehouseV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.Workspace.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.segment.publicapi.models.WorkspaceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.APICallSnapshotV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AccessPermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddConnectionFromSourceToWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddConnectionFromSourceToWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddLabelsToSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddLabelsToSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddLabelsToSourceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddLabelsToSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddLabelsToSourceV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddLabelsToSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddPermissionsToUser200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddPermissionsToUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddPermissionsToUserGroupV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddPermissionsToUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddPermissionsToUserV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddPermissionsToUserV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddSourceToTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddSourceToTrackingPlanV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddSourceToTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddUsersToUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddUsersToUserGroupV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddUsersToUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AdvancedWarehouseSyncScheduleV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AdvancedWarehouseSyncScheduleV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateCloudSourceRegulation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateCloudSourceRegulationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateCloudSourceRegulationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDestinationSubscription200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDestinationSubscriptionAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDestinationSubscriptionAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDestinationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateEdgeFunctions200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateEdgeFunctionsAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateEdgeFunctionsAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilterForDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilterForDestinationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilterForDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFunction200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFunctionDeployment200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFunctionDeploymentV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFunctionV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInvites200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInvitesV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInvitesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateLabel200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateLabel200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateLabelAlphaInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateLabelAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateLabelV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateLabelV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceAlphaInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceRegulation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceRegulationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceRegulationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateSourceV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTrackingPlanV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationBetaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationBetaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateUserGroupV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateValidationInWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateValidationInWarehouseV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateValidationInWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateWarehouseV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateWorkspaceRegulation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateWorkspaceRegulationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateWorkspaceRegulationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteFunction200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInvites200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInvitesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteLabel200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteLabel200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteLabelAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteLabelV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteRegulation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteRegulationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteSourceV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationBetaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteUsers200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteUsersV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeliveryMetricsSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeliveryMetricsSummaryBeta + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Destination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Destination1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Destination2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationFilterActionV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationFilterV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataActionFieldV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataActionV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataComponentV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataFeaturesV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataMethodsV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataPlatformsV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataSubscriptionPresetV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationMetadataV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationStatusV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationSubscription + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationSubscriptionUpdateInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DisableEdgeFunctions200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DisableEdgeFunctionsAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Echo200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Echo200Response1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EchoAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EdgeFunctions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EdgeFunctions1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Filter1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Filter2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Filter3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Function.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Function1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Function2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.FunctionSettingV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.FunctionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GenerateUploadURLForEdgeFunctions200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GenerateUploadURLForEdgeFunctionsAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetConnectionStateFromWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetConnectionStateFromWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyPerSourceAPICallsUsage200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyPerSourceAPICallsUsageV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyPerSourceMTUUsage200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyPerSourceMTUUsageV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsage200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsageV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyWorkspaceMTUUsage200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDailyWorkspaceMTUUsageV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDestinationMetadata200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDestinationMetadataV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDestinationV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDestinationsCatalog200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetDestinationsCatalogV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetEventsVolumeFromWorkspace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFilterInDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFilterInDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFunction200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetLatestFromEdgeFunctionsAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetMessagingSubscriptionFailureResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetRegulation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetRegulationV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSource200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSource200Response1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSourceAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSourceMetadata200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSourceMetadataV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSourceV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSourcesCatalog200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSourcesCatalogV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSpace200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSpaceAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSubscriptionFromDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSubscriptionFromDestinationAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetSubscriptionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationBetaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetUserGroupV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetUserV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWarehouseMetadata200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWarehouseMetadataV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWarehouseV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWarehousesCatalog200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWarehousesCatalogV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWorkspace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetWorkspaceV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Group.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GroupSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Identify.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.IdentifySourceSettingsV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.IntegrationOptionBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InvitePermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InviteV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Label.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Label1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Label2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAuditEvents200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAuditEventsV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedDestinationsFromSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedDestinationsFromSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedSourcesFromWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedSourcesFromWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedWarehousesFromSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedWarehousesFromSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedWarehousesFromSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListConnectedWarehousesFromSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListDeliveryMetricsSummaryFromDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListDeliveryMetricsSummaryFromDestinationBetaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListDestinations200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListDestinationsV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFiltersFromDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFiltersFromDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFunctionItemV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFunctions200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFunctionsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInvites200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInvitesFromUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInvitesFromUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInvitesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListLabels200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListLabels200Response1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListLabelsAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListLabelsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListRegulationsFromSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListRegulationsFromSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListRoles200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListRolesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListRulesFromTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListRulesFromTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSchemaSettingsInSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSchemaSettingsInSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSources200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSources200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSourcesAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSourcesFromTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSourcesFromTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSourcesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSubscriptionsFromDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSubscriptionsFromDestinationAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSuppressions200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSuppressionsV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSyncsFromWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSyncsFromWarehouseAndSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSyncsFromWarehouseAndSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSyncsFromWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTrackingPlans200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTrackingPlansV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformations200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsBetaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUserGroups200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUserGroupsFromUser200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUserGroupsFromUserV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUserGroupsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUsers200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUsersFromUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUsersFromUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListUsersV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListWarehouses200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListWarehousesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListWorkspaceRegulations200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListWorkspaceRegulationsV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Logos.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Logos1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Logos2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.LogosBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MessageSubscriptionResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MessageSubscriptionResponseError + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MessagesSubscriptionRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Metadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Metadata1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Metadata2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MetricBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MinimalUserGroupV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MinimalUserV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PaginationOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PermissionInputV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewDestinationFilter200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewDestinationFilterV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewDestinationFilterV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewDestinationFilterV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveFilterFromDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveRuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveRulesFromTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveRulesFromTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveSourceConnectionFromWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveSourceConnectionFromWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveSourceFromTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveSourceFromTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveSubscriptionFromDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveSubscriptionFromDestinationAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveUsersFromUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveUsersFromUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouseV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceLabelsInSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceLabelsInSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceLabelsInSourceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceLabelsInSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceLabelsInSourceV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceLabelsInSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpaces200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpacesAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpacesAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplacePermissionsForUser200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplacePermissionsForUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplacePermissionsForUserGroupV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplacePermissionsForUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplacePermissionsForUserV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplacePermissionsForUserV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceRulesInTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceUsersInUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceUsersInUserGroupV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceUsersInUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RequestError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RequestErrorEnvelope.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ResourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Schedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Schedule1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Schedule2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Settings.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Settings1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source5.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Source6.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceAPICallSnapshotV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceAlpha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceEventVolumeDatapointV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceEventVolumeV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceMetadataV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceSettingsOutputV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Space.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Subscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SupportedFeatures.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SupportedMethods.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SupportedPlatforms.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SuppressedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SyncNoticeV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SyncV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Track.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TrackSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TrackingPlan.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TrackingPlan1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TrackingPlanV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestinationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFilterForDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFilterForDestinationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFilterForDestinationV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFunction200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFunctionV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateRulesInTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateRulesInTrackingPlanV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateRulesInTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSchemaSettingsInSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSchemaSettingsInSourceV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSchemaSettingsInSourceV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSource200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSource200Response1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSourceAlphaInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSourceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSourceV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSourceV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSubscriptionForDestination200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSubscriptionForDestinationAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSubscriptionForDestinationAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTrackingPlan200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTrackingPlanV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTrackingPlanV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformation200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationBetaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationBetaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateUserGroup200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateUserGroupV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateUserGroupV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateWarehouseV1Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateWarehouseV1Output + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpsertRuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.User.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UserGroup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UserGroup1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UserGroup2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UserGroup3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UserGroupV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UserV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UsersPerSourceSnapshotV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Warehouse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Warehouse1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Warehouse2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WarehouseAdvancedSyncV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WarehouseMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WarehouseMetadataV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WarehouseSelectiveSyncItemV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WarehouseSyncOverrideV1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WarehouseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Workspace.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.WorkspaceV1.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } @@ -595,8 +1335,8 @@ public static String serialize(Object obj) { /** * Deserialize the given JSON string to Java object. * - * @param Type - * @param body The JSON string + * @param Type + * @param body The JSON string * @param returnType The type to deserialize into * @return The deserialized Java object */ @@ -605,7 +1345,8 @@ public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + // see + // https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { @@ -622,9 +1363,7 @@ public static T deserialize(String body, Type returnType) { } } - /** - * Gson TypeAdapter for Byte Array type - */ + /** Gson TypeAdapter for Byte Array type */ public static class ByteArrayAdapter extends TypeAdapter { @Override @@ -650,9 +1389,7 @@ public byte[] read(JsonReader in) throws IOException { } } - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ + /** Gson TypeAdapter for JSR310 OffsetDateTime type */ public static class OffsetDateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -687,16 +1424,14 @@ public OffsetDateTime read(JsonReader in) throws IOException { default: String date = in.nextString(); if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; + date = date.substring(0, date.length() - 5) + "Z"; } return OffsetDateTime.parse(date, formatter); } } } - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ + /** Gson TypeAdapter for JSR310 LocalDate type */ public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -744,9 +1479,8 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) { } /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). + * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" + * format will be used (more efficient than SimpleDateFormat). */ public static class SqlDateTypeAdapter extends TypeAdapter { @@ -789,7 +1523,8 @@ public java.sql.Date read(JsonReader in) throws IOException { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + return new java.sql.Date( + ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } @@ -798,8 +1533,8 @@ public java.sql.Date read(JsonReader in) throws IOException { } /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. + * Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be + * used. */ public static class DateTypeAdapter extends TypeAdapter { diff --git a/src/main/java/com/segment/publicapi/Pair.java b/src/main/java/com/segment/publicapi/Pair.java index db9bcb16..554b2d48 100644 --- a/src/main/java/com/segment/publicapi/Pair.java +++ b/src/main/java/com/segment/publicapi/Pair.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,15 +10,13 @@ * Do not edit the class manually. */ - package com.segment.publicapi; - public class Pair { private String name = ""; private String value = ""; - public Pair (String name, String value) { + public Pair(String name, String value) { setName(name); setValue(value); } diff --git a/src/main/java/com/segment/publicapi/ProgressRequestBody.java b/src/main/java/com/segment/publicapi/ProgressRequestBody.java index 88cb6fd7..2062a60c 100644 --- a/src/main/java/com/segment/publicapi/ProgressRequestBody.java +++ b/src/main/java/com/segment/publicapi/ProgressRequestBody.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,14 +10,12 @@ * Do not edit the class manually. */ - package com.segment.publicapi; -import okhttp3.MediaType; -import okhttp3.RequestBody; import java.io.IOException; - +import okhttp3.MediaType; +import okhttp3.RequestBody; import okio.Buffer; import okio.BufferedSink; import okio.ForwardingSink; @@ -66,7 +64,8 @@ public void write(Buffer source, long byteCount) throws IOException { } bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + callback.onUploadProgress( + bytesWritten, contentLength, bytesWritten == contentLength); } }; } diff --git a/src/main/java/com/segment/publicapi/ProgressResponseBody.java b/src/main/java/com/segment/publicapi/ProgressResponseBody.java index 8b88d2e0..84e4814b 100644 --- a/src/main/java/com/segment/publicapi/ProgressResponseBody.java +++ b/src/main/java/com/segment/publicapi/ProgressResponseBody.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,14 +10,12 @@ * Do not edit the class manually. */ - package com.segment.publicapi; -import okhttp3.MediaType; -import okhttp3.ResponseBody; import java.io.IOException; - +import okhttp3.MediaType; +import okhttp3.ResponseBody; import okio.Buffer; import okio.BufferedSource; import okio.ForwardingSource; @@ -62,7 +60,8 @@ public long read(Buffer sink, long byteCount) throws IOException { long bytesRead = super.read(sink, byteCount); // read() returns the number of bytes read, or -1 if this source is exhausted. totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + callback.onDownloadProgress( + totalBytesRead, responseBody.contentLength(), bytesRead == -1); return bytesRead; } }; diff --git a/src/main/java/com/segment/publicapi/ServerConfiguration.java b/src/main/java/com/segment/publicapi/ServerConfiguration.java index c956ba6b..743d66b7 100644 --- a/src/main/java/com/segment/publicapi/ServerConfiguration.java +++ b/src/main/java/com/segment/publicapi/ServerConfiguration.java @@ -1,10 +1,9 @@ package com.segment.publicapi; + import java.util.Map; -/** - * Representing a Server configuration. - */ +/** Representing a Server configuration. */ public class ServerConfiguration { public String URL; public String description; @@ -13,9 +12,11 @@ public class ServerConfiguration { /** * @param URL A URL to the target host. * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * @param variables A map between a variable name and its value. The value is used for + * substitution in the server's URL template. */ - public ServerConfiguration(String URL, String description, Map variables) { + public ServerConfiguration( + String URL, String description, Map variables) { this.URL = URL; this.description = description; this.variables = variables; @@ -31,15 +32,21 @@ public String URL(Map variables) { String url = this.URL; // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { + for (Map.Entry variable : this.variables.entrySet()) { String name = variable.getKey(); ServerVariable serverVariable = variable.getValue(); String value = serverVariable.defaultValue; if (variables != null && variables.containsKey(name)) { value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + if (serverVariable.enumValues.size() > 0 + && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + + name + + " in the server URL has invalid value " + + value + + "."); } } url = url.replaceAll("\\{" + name + "\\}", value); diff --git a/src/main/java/com/segment/publicapi/ServerVariable.java b/src/main/java/com/segment/publicapi/ServerVariable.java index b2f416f1..b630232f 100644 --- a/src/main/java/com/segment/publicapi/ServerVariable.java +++ b/src/main/java/com/segment/publicapi/ServerVariable.java @@ -1,10 +1,9 @@ package com.segment.publicapi; + import java.util.HashSet; -/** - * Representing a Server Variable for server URL template substitution. - */ +/** Representing a Server Variable for server URL template substitution. */ public class ServerVariable { public String description; public String defaultValue; @@ -13,7 +12,8 @@ public class ServerVariable { /** * @param description A description for the server variable. * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + * @param enumValues An enumeration of string values to be used if the substitution options are + * from a limited set. */ public ServerVariable(String description, String defaultValue, HashSet enumValues) { this.description = description; diff --git a/src/main/java/com/segment/publicapi/StringUtil.java b/src/main/java/com/segment/publicapi/StringUtil.java index d4b08fb0..f533c942 100644 --- a/src/main/java/com/segment/publicapi/StringUtil.java +++ b/src/main/java/com/segment/publicapi/StringUtil.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,74 +10,72 @@ * Do not edit the class manually. */ - package com.segment.publicapi; + import java.util.Collection; import java.util.Iterator; - public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; } - return false; - } - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } + /** + * Join an array of strings with the given separator. + * + *

Note: This might be replaced by utility method from commons-lang or guava someday if one + * of those libraries is added as dependency. + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); } - return out.toString(); - } - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); } - return out.toString(); - } } diff --git a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java index 236a1ad0..7baa42a7 100644 --- a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java +++ b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,34 +10,24 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.GetDailyPerSourceAPICallsUsage200Response; import com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsage200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class ApiCallsApi { private ApiClient localVarApiClient; @@ -78,29 +68,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getDailyPerSourceAPICallsUsage - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source API calls counts. This parameter exists in + * v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyPerSourceAPICallsUsageCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDailyPerSourceAPICallsUsageCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -126,136 +121,184 @@ public okhttp3.Call getDailyPerSourceAPICallsUsageCall(String period, Pagination } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDailyPerSourceAPICallsUsageValidateBeforeCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDailyPerSourceAPICallsUsageValidateBeforeCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'period' is set if (period == null) { - throw new ApiException("Missing the required parameter 'period' when calling getDailyPerSourceAPICallsUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'period' when calling" + + " getDailyPerSourceAPICallsUsage(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getDailyPerSourceAPICallsUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getDailyPerSourceAPICallsUsage(Async)"); } - - okhttp3.Call localVarCall = getDailyPerSourceAPICallsUsageCall(period, pagination, _callback); + okhttp3.Call localVarCall = + getDailyPerSourceAPICallsUsageCall(period, pagination, _callback); return localVarCall; - } /** - * Get Daily Per Source API Calls Usage - * Provides daily cumulative per-source API call counts for a usage period. - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) + * Get Daily Per Source API Calls Usage Provides daily cumulative per-source API call counts for + * a usage period. + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source API calls counts. This parameter exists in + * v1. (required) * @return GetDailyPerSourceAPICallsUsage200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetDailyPerSourceAPICallsUsage200Response getDailyPerSourceAPICallsUsage(String period, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getDailyPerSourceAPICallsUsageWithHttpInfo(period, pagination); + public GetDailyPerSourceAPICallsUsage200Response getDailyPerSourceAPICallsUsage( + String period, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + getDailyPerSourceAPICallsUsageWithHttpInfo(period, pagination); return localVarResp.getData(); } /** - * Get Daily Per Source API Calls Usage - * Provides daily cumulative per-source API call counts for a usage period. - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) + * Get Daily Per Source API Calls Usage Provides daily cumulative per-source API call counts for + * a usage period. + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source API calls counts. This parameter exists in + * v1. (required) * @return ApiResponse<GetDailyPerSourceAPICallsUsage200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDailyPerSourceAPICallsUsageWithHttpInfo(String period, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = getDailyPerSourceAPICallsUsageValidateBeforeCall(period, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + getDailyPerSourceAPICallsUsageWithHttpInfo(String period, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + getDailyPerSourceAPICallsUsageValidateBeforeCall(period, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Daily Per Source API Calls Usage (asynchronously) - * Provides daily cumulative per-source API call counts for a usage period. - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha. (required) + * Get Daily Per Source API Calls Usage (asynchronously) Provides daily cumulative per-source + * API call counts for a usage period. + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source API calls counts. This parameter exists in + * v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyPerSourceAPICallsUsageAsync(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDailyPerSourceAPICallsUsageValidateBeforeCall(period, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getDailyPerSourceAPICallsUsageAsync( + String period, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getDailyPerSourceAPICallsUsageValidateBeforeCall(period, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getDailyWorkspaceAPICallsUsage - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace API call counts. This parameter exists in + * v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyWorkspaceAPICallsUsageCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDailyWorkspaceAPICallsUsageCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -281,108 +324,151 @@ public okhttp3.Call getDailyWorkspaceAPICallsUsageCall(String period, Pagination } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDailyWorkspaceAPICallsUsageValidateBeforeCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDailyWorkspaceAPICallsUsageValidateBeforeCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'period' is set if (period == null) { - throw new ApiException("Missing the required parameter 'period' when calling getDailyWorkspaceAPICallsUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'period' when calling" + + " getDailyWorkspaceAPICallsUsage(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getDailyWorkspaceAPICallsUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getDailyWorkspaceAPICallsUsage(Async)"); } - - okhttp3.Call localVarCall = getDailyWorkspaceAPICallsUsageCall(period, pagination, _callback); + okhttp3.Call localVarCall = + getDailyWorkspaceAPICallsUsageCall(period, pagination, _callback); return localVarCall; - } /** - * Get Daily Workspace API Calls Usage - * Provides daily cumulative API call counts for a usage period. - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) + * Get Daily Workspace API Calls Usage Provides daily cumulative API call counts for a usage + * period. + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace API call counts. This parameter exists in + * v1. (required) * @return GetDailyWorkspaceAPICallsUsage200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetDailyWorkspaceAPICallsUsage200Response getDailyWorkspaceAPICallsUsage(String period, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getDailyWorkspaceAPICallsUsageWithHttpInfo(period, pagination); + public GetDailyWorkspaceAPICallsUsage200Response getDailyWorkspaceAPICallsUsage( + String period, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + getDailyWorkspaceAPICallsUsageWithHttpInfo(period, pagination); return localVarResp.getData(); } /** - * Get Daily Workspace API Calls Usage - * Provides daily cumulative API call counts for a usage period. - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) + * Get Daily Workspace API Calls Usage Provides daily cumulative API call counts for a usage + * period. + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace API call counts. This parameter exists in + * v1. (required) * @return ApiResponse<GetDailyWorkspaceAPICallsUsage200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDailyWorkspaceAPICallsUsageWithHttpInfo(String period, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = getDailyWorkspaceAPICallsUsageValidateBeforeCall(period, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + getDailyWorkspaceAPICallsUsageWithHttpInfo(String period, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + getDailyWorkspaceAPICallsUsageValidateBeforeCall(period, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Daily Workspace API Calls Usage (asynchronously) - * Provides daily cumulative API call counts for a usage period. - * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha. (required) + * Get Daily Workspace API Calls Usage (asynchronously) Provides daily cumulative API call + * counts for a usage period. + * + * @param period The start of the usage month in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace API call counts. This parameter exists in + * v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyWorkspaceAPICallsUsageAsync(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDailyWorkspaceAPICallsUsageValidateBeforeCall(period, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getDailyWorkspaceAPICallsUsageAsync( + String period, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getDailyWorkspaceAPICallsUsageValidateBeforeCall(period, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index 65ebacd7..fd4bdf76 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,33 +10,23 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.ListAuditEvents200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class AuditTrailApi { private ApiClient localVarApiClient; @@ -77,32 +67,45 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for listAuditEvents - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) - * @param startTime Filter response to events that happened after this time. This parameter exists in alpha. (optional) - * @param endTime Filter response to events that happened before this time. Defaults to the current time, or the end time from the pagination cursor. This parameter exists in alpha. (optional) - * @param resourceId Filter response to events that affect a specific resource, for example, a single Source. This parameter exists in alpha. (optional) - * @param resourceType Filter response to events that affect a specific type, for example, Sources, Warehouses, and Tracking Plans. This parameter exists in alpha. (optional) + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) + * @param startTime Filter response to events that happened after this time. This parameter + * exists in v1. (optional) + * @param endTime Filter response to events that happened before this time. Defaults to the + * current time, or the end time from the pagination cursor. This parameter exists in v1. + * (optional) + * @param resourceId Filter response to events that affect a specific resource, for example, a + * single Source. This parameter exists in v1. (optional) + * @param resourceType Filter response to events that affect a specific type, for example, + * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listAuditEventsCall(PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listAuditEventsCall( + PaginationInput pagination, + String startTime, + String endTime, + String resourceId, + String resourceType, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -132,7 +135,8 @@ public okhttp3.Call listAuditEventsCall(PaginationInput pagination, String start } if (resourceType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceType", resourceType)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("resourceType", resourceType)); } if (pagination != null) { @@ -140,112 +144,178 @@ public okhttp3.Call listAuditEventsCall(PaginationInput pagination, String start } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listAuditEventsValidateBeforeCall(PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listAuditEventsValidateBeforeCall( + PaginationInput pagination, + String startTime, + String endTime, + String resourceId, + String resourceType, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listAuditEvents(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listAuditEvents(Async)"); } - - okhttp3.Call localVarCall = listAuditEventsCall(pagination, startTime, endTime, resourceId, resourceType, _callback); + okhttp3.Call localVarCall = + listAuditEventsCall( + pagination, startTime, endTime, resourceId, resourceType, _callback); return localVarCall; - } /** - * List Audit Events - * Returns a list of Audit Trail events. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) - * @param startTime Filter response to events that happened after this time. This parameter exists in alpha. (optional) - * @param endTime Filter response to events that happened before this time. Defaults to the current time, or the end time from the pagination cursor. This parameter exists in alpha. (optional) - * @param resourceId Filter response to events that affect a specific resource, for example, a single Source. This parameter exists in alpha. (optional) - * @param resourceType Filter response to events that affect a specific type, for example, Sources, Warehouses, and Tracking Plans. This parameter exists in alpha. (optional) + * List Audit Events Returns a list of Audit Trail events. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) + * @param startTime Filter response to events that happened after this time. This parameter + * exists in v1. (optional) + * @param endTime Filter response to events that happened before this time. Defaults to the + * current time, or the end time from the pagination cursor. This parameter exists in v1. + * (optional) + * @param resourceId Filter response to events that affect a specific resource, for example, a + * single Source. This parameter exists in v1. (optional) + * @param resourceType Filter response to events that affect a specific type, for example, + * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) * @return ListAuditEvents200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListAuditEvents200Response listAuditEvents(PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType) throws ApiException { - ApiResponse localVarResp = listAuditEventsWithHttpInfo(pagination, startTime, endTime, resourceId, resourceType); + public ListAuditEvents200Response listAuditEvents( + PaginationInput pagination, + String startTime, + String endTime, + String resourceId, + String resourceType) + throws ApiException { + ApiResponse localVarResp = + listAuditEventsWithHttpInfo( + pagination, startTime, endTime, resourceId, resourceType); return localVarResp.getData(); } /** - * List Audit Events - * Returns a list of Audit Trail events. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) - * @param startTime Filter response to events that happened after this time. This parameter exists in alpha. (optional) - * @param endTime Filter response to events that happened before this time. Defaults to the current time, or the end time from the pagination cursor. This parameter exists in alpha. (optional) - * @param resourceId Filter response to events that affect a specific resource, for example, a single Source. This parameter exists in alpha. (optional) - * @param resourceType Filter response to events that affect a specific type, for example, Sources, Warehouses, and Tracking Plans. This parameter exists in alpha. (optional) + * List Audit Events Returns a list of Audit Trail events. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) + * @param startTime Filter response to events that happened after this time. This parameter + * exists in v1. (optional) + * @param endTime Filter response to events that happened before this time. Defaults to the + * current time, or the end time from the pagination cursor. This parameter exists in v1. + * (optional) + * @param resourceId Filter response to events that affect a specific resource, for example, a + * single Source. This parameter exists in v1. (optional) + * @param resourceType Filter response to events that affect a specific type, for example, + * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) * @return ApiResponse<ListAuditEvents200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listAuditEventsWithHttpInfo(PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType) throws ApiException { - okhttp3.Call localVarCall = listAuditEventsValidateBeforeCall(pagination, startTime, endTime, resourceId, resourceType, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listAuditEventsWithHttpInfo( + PaginationInput pagination, + String startTime, + String endTime, + String resourceId, + String resourceType) + throws ApiException { + okhttp3.Call localVarCall = + listAuditEventsValidateBeforeCall( + pagination, startTime, endTime, resourceId, resourceType, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Audit Events (asynchronously) - * Returns a list of Audit Trail events. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) - * @param startTime Filter response to events that happened after this time. This parameter exists in alpha. (optional) - * @param endTime Filter response to events that happened before this time. Defaults to the current time, or the end time from the pagination cursor. This parameter exists in alpha. (optional) - * @param resourceId Filter response to events that affect a specific resource, for example, a single Source. This parameter exists in alpha. (optional) - * @param resourceType Filter response to events that affect a specific type, for example, Sources, Warehouses, and Tracking Plans. This parameter exists in alpha. (optional) + * List Audit Events (asynchronously) Returns a list of Audit Trail events. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) + * @param startTime Filter response to events that happened after this time. This parameter + * exists in v1. (optional) + * @param endTime Filter response to events that happened before this time. Defaults to the + * current time, or the end time from the pagination cursor. This parameter exists in v1. + * (optional) + * @param resourceId Filter response to events that affect a specific resource, for example, a + * single Source. This parameter exists in v1. (optional) + * @param resourceType Filter response to events that affect a specific type, for example, + * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listAuditEventsAsync(PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listAuditEventsValidateBeforeCall(pagination, startTime, endTime, resourceId, resourceType, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listAuditEventsAsync( + PaginationInput pagination, + String startTime, + String endTime, + String resourceId, + String resourceType, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listAuditEventsValidateBeforeCall( + pagination, startTime, endTime, resourceId, resourceType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/CatalogApi.java b/src/main/java/com/segment/publicapi/api/CatalogApi.java index 7d6cf720..bb64a28f 100644 --- a/src/main/java/com/segment/publicapi/api/CatalogApi.java +++ b/src/main/java/com/segment/publicapi/api/CatalogApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.GetDestinationMetadata200Response; import com.segment.publicapi.models.GetDestinationsCatalog200Response; import com.segment.publicapi.models.GetSourceMetadata200Response; @@ -34,14 +27,11 @@ import com.segment.publicapi.models.GetWarehouseMetadata200Response; import com.segment.publicapi.models.GetWarehousesCatalog200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class CatalogApi { private ApiClient localVarApiClient; @@ -82,28 +72,30 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getDestinationMetadata - * @param destinationMetadataId (required) + * + * @param destinationMetadataId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDestinationMetadataCall(String destinationMetadataId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDestinationMetadataCall( + String destinationMetadataId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -112,8 +104,11 @@ public okhttp3.Call getDestinationMetadataCall(String destinationMetadataId, fin Object localVarPostBody = null; // create path and map variables - String localVarPath = "/catalog/destinations/{destinationMetadataId}" - .replaceAll("\\{" + "destinationMetadataId" + "\\}", localVarApiClient.escapeString(destinationMetadataId.toString())); + String localVarPath = + "/catalog/destinations/{destinationMetadataId}" + .replaceAll( + "\\{" + "destinationMetadataId" + "\\}", + localVarApiClient.escapeString(destinationMetadataId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -122,127 +117,156 @@ public okhttp3.Call getDestinationMetadataCall(String destinationMetadataId, fin Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDestinationMetadataValidateBeforeCall(String destinationMetadataId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDestinationMetadataValidateBeforeCall( + String destinationMetadataId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'destinationMetadataId' is set if (destinationMetadataId == null) { - throw new ApiException("Missing the required parameter 'destinationMetadataId' when calling getDestinationMetadata(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationMetadataId' when calling" + + " getDestinationMetadata(Async)"); } - okhttp3.Call localVarCall = getDestinationMetadataCall(destinationMetadataId, _callback); return localVarCall; - } /** - * Get Destination Metadata - * Returns a Destination catalog item by its id. - * @param destinationMetadataId (required) + * Get Destination Metadata Returns a Destination catalog item by its id. + * + * @param destinationMetadataId (required) * @return GetDestinationMetadata200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetDestinationMetadata200Response getDestinationMetadata(String destinationMetadataId) throws ApiException { - ApiResponse localVarResp = getDestinationMetadataWithHttpInfo(destinationMetadataId); + public GetDestinationMetadata200Response getDestinationMetadata(String destinationMetadataId) + throws ApiException { + ApiResponse localVarResp = + getDestinationMetadataWithHttpInfo(destinationMetadataId); return localVarResp.getData(); } /** - * Get Destination Metadata - * Returns a Destination catalog item by its id. - * @param destinationMetadataId (required) + * Get Destination Metadata Returns a Destination catalog item by its id. + * + * @param destinationMetadataId (required) * @return ApiResponse<GetDestinationMetadata200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDestinationMetadataWithHttpInfo(String destinationMetadataId) throws ApiException { - okhttp3.Call localVarCall = getDestinationMetadataValidateBeforeCall(destinationMetadataId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getDestinationMetadataWithHttpInfo( + String destinationMetadataId) throws ApiException { + okhttp3.Call localVarCall = + getDestinationMetadataValidateBeforeCall(destinationMetadataId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Destination Metadata (asynchronously) - * Returns a Destination catalog item by its id. - * @param destinationMetadataId (required) + * Get Destination Metadata (asynchronously) Returns a Destination catalog item by its id. + * + * @param destinationMetadataId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDestinationMetadataAsync(String destinationMetadataId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDestinationMetadataValidateBeforeCall(destinationMetadataId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getDestinationMetadataAsync( + String destinationMetadataId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getDestinationMetadataValidateBeforeCall(destinationMetadataId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getDestinationsCatalog - * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha. (required) + * + * @param pagination Required pagination parameters used to filter the Destinations catalog. + * This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDestinationsCatalogCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDestinationsCatalogCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -264,127 +288,157 @@ public okhttp3.Call getDestinationsCatalogCall(PaginationInput pagination, final } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDestinationsCatalogValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDestinationsCatalogValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getDestinationsCatalog(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getDestinationsCatalog(Async)"); } - okhttp3.Call localVarCall = getDestinationsCatalogCall(pagination, _callback); return localVarCall; - } /** - * Get Destinations Catalog - * Returns a list of all available Destinations in the Segment catalog. - * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha. (required) + * Get Destinations Catalog Returns a list of all available Destinations in the Segment catalog. + * + * @param pagination Required pagination parameters used to filter the Destinations catalog. + * This parameter exists in v1. (required) * @return GetDestinationsCatalog200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetDestinationsCatalog200Response getDestinationsCatalog(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getDestinationsCatalogWithHttpInfo(pagination); + public GetDestinationsCatalog200Response getDestinationsCatalog(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + getDestinationsCatalogWithHttpInfo(pagination); return localVarResp.getData(); } /** - * Get Destinations Catalog - * Returns a list of all available Destinations in the Segment catalog. - * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha. (required) + * Get Destinations Catalog Returns a list of all available Destinations in the Segment catalog. + * + * @param pagination Required pagination parameters used to filter the Destinations catalog. + * This parameter exists in v1. (required) * @return ApiResponse<GetDestinationsCatalog200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDestinationsCatalogWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse getDestinationsCatalogWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = getDestinationsCatalogValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Destinations Catalog (asynchronously) - * Returns a list of all available Destinations in the Segment catalog. - * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha. (required) + * Get Destinations Catalog (asynchronously) Returns a list of all available Destinations in the + * Segment catalog. + * + * @param pagination Required pagination parameters used to filter the Destinations catalog. + * This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDestinationsCatalogAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDestinationsCatalogAsync( + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getDestinationsCatalogValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSourceMetadata - * @param sourceMetadataId (required) + * + * @param sourceMetadataId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -393,8 +447,11 @@ public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCall Object localVarPostBody = null; // create path and map variables - String localVarPath = "/catalog/sources/{sourceMetadataId}" - .replaceAll("\\{" + "sourceMetadataId" + "\\}", localVarApiClient.escapeString(sourceMetadataId.toString())); + String localVarPath = + "/catalog/sources/{sourceMetadataId}" + .replaceAll( + "\\{" + "sourceMetadataId" + "\\}", + localVarApiClient.escapeString(sourceMetadataId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -403,127 +460,153 @@ public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getSourceMetadataValidateBeforeCall(String sourceMetadataId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getSourceMetadataValidateBeforeCall( + String sourceMetadataId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sourceMetadataId' is set if (sourceMetadataId == null) { - throw new ApiException("Missing the required parameter 'sourceMetadataId' when calling getSourceMetadata(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceMetadataId' when calling" + + " getSourceMetadata(Async)"); } - okhttp3.Call localVarCall = getSourceMetadataCall(sourceMetadataId, _callback); return localVarCall; - } /** - * Get Source Metadata - * Returns a Source catalog item by its id. - * @param sourceMetadataId (required) + * Get Source Metadata Returns a Source catalog item by its id. + * + * @param sourceMetadataId (required) * @return GetSourceMetadata200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetSourceMetadata200Response getSourceMetadata(String sourceMetadataId) throws ApiException { - ApiResponse localVarResp = getSourceMetadataWithHttpInfo(sourceMetadataId); + public GetSourceMetadata200Response getSourceMetadata(String sourceMetadataId) + throws ApiException { + ApiResponse localVarResp = + getSourceMetadataWithHttpInfo(sourceMetadataId); return localVarResp.getData(); } /** - * Get Source Metadata - * Returns a Source catalog item by its id. - * @param sourceMetadataId (required) + * Get Source Metadata Returns a Source catalog item by its id. + * + * @param sourceMetadataId (required) * @return ApiResponse<GetSourceMetadata200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getSourceMetadataWithHttpInfo(String sourceMetadataId) throws ApiException { + public ApiResponse getSourceMetadataWithHttpInfo( + String sourceMetadataId) throws ApiException { okhttp3.Call localVarCall = getSourceMetadataValidateBeforeCall(sourceMetadataId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Source Metadata (asynchronously) - * Returns a Source catalog item by its id. - * @param sourceMetadataId (required) + * Get Source Metadata (asynchronously) Returns a Source catalog item by its id. + * + * @param sourceMetadataId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSourceMetadataAsync(String sourceMetadataId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSourceMetadataAsync( + String sourceMetadataId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = getSourceMetadataValidateBeforeCall(sourceMetadataId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = + getSourceMetadataValidateBeforeCall(sourceMetadataId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSourcesCatalog - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSourcesCatalogCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSourcesCatalogCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -545,127 +628,153 @@ public okhttp3.Call getSourcesCatalogCall(PaginationInput pagination, final ApiC } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getSourcesCatalogValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getSourcesCatalogValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getSourcesCatalog(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getSourcesCatalog(Async)"); } - okhttp3.Call localVarCall = getSourcesCatalogCall(pagination, _callback); return localVarCall; - } /** - * Get Sources Catalog - * Returns a list of all available Sources in the Segment catalog. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * Get Sources Catalog Returns a list of all available Sources in the Segment catalog. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return GetSourcesCatalog200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetSourcesCatalog200Response getSourcesCatalog(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getSourcesCatalogWithHttpInfo(pagination); + public GetSourcesCatalog200Response getSourcesCatalog(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + getSourcesCatalogWithHttpInfo(pagination); return localVarResp.getData(); } /** - * Get Sources Catalog - * Returns a list of all available Sources in the Segment catalog. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * Get Sources Catalog Returns a list of all available Sources in the Segment catalog. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<GetSourcesCatalog200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getSourcesCatalogWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse getSourcesCatalogWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = getSourcesCatalogValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Sources Catalog (asynchronously) - * Returns a list of all available Sources in the Segment catalog. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * Get Sources Catalog (asynchronously) Returns a list of all available Sources in the Segment + * catalog. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSourcesCatalogAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSourcesCatalogAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getSourcesCatalogValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getWarehouseMetadata - * @param warehouseMetadataId (required) + * + * @param warehouseMetadataId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWarehouseMetadataCall(String warehouseMetadataId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getWarehouseMetadataCall( + String warehouseMetadataId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -674,8 +783,11 @@ public okhttp3.Call getWarehouseMetadataCall(String warehouseMetadataId, final A Object localVarPostBody = null; // create path and map variables - String localVarPath = "/catalog/warehouses/{warehouseMetadataId}" - .replaceAll("\\{" + "warehouseMetadataId" + "\\}", localVarApiClient.escapeString(warehouseMetadataId.toString())); + String localVarPath = + "/catalog/warehouses/{warehouseMetadataId}" + .replaceAll( + "\\{" + "warehouseMetadataId" + "\\}", + localVarApiClient.escapeString(warehouseMetadataId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -684,127 +796,156 @@ public okhttp3.Call getWarehouseMetadataCall(String warehouseMetadataId, final A Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getWarehouseMetadataValidateBeforeCall(String warehouseMetadataId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getWarehouseMetadataValidateBeforeCall( + String warehouseMetadataId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseMetadataId' is set if (warehouseMetadataId == null) { - throw new ApiException("Missing the required parameter 'warehouseMetadataId' when calling getWarehouseMetadata(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseMetadataId' when calling" + + " getWarehouseMetadata(Async)"); } - okhttp3.Call localVarCall = getWarehouseMetadataCall(warehouseMetadataId, _callback); return localVarCall; - } /** - * Get Warehouse Metadata - * Returns a Warehouse catalog item by its id. - * @param warehouseMetadataId (required) + * Get Warehouse Metadata Returns a Warehouse catalog item by its id. + * + * @param warehouseMetadataId (required) * @return GetWarehouseMetadata200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetWarehouseMetadata200Response getWarehouseMetadata(String warehouseMetadataId) throws ApiException { - ApiResponse localVarResp = getWarehouseMetadataWithHttpInfo(warehouseMetadataId); + public GetWarehouseMetadata200Response getWarehouseMetadata(String warehouseMetadataId) + throws ApiException { + ApiResponse localVarResp = + getWarehouseMetadataWithHttpInfo(warehouseMetadataId); return localVarResp.getData(); } /** - * Get Warehouse Metadata - * Returns a Warehouse catalog item by its id. - * @param warehouseMetadataId (required) + * Get Warehouse Metadata Returns a Warehouse catalog item by its id. + * + * @param warehouseMetadataId (required) * @return ApiResponse<GetWarehouseMetadata200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getWarehouseMetadataWithHttpInfo(String warehouseMetadataId) throws ApiException { - okhttp3.Call localVarCall = getWarehouseMetadataValidateBeforeCall(warehouseMetadataId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getWarehouseMetadataWithHttpInfo( + String warehouseMetadataId) throws ApiException { + okhttp3.Call localVarCall = + getWarehouseMetadataValidateBeforeCall(warehouseMetadataId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Warehouse Metadata (asynchronously) - * Returns a Warehouse catalog item by its id. - * @param warehouseMetadataId (required) + * Get Warehouse Metadata (asynchronously) Returns a Warehouse catalog item by its id. + * + * @param warehouseMetadataId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWarehouseMetadataAsync(String warehouseMetadataId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getWarehouseMetadataValidateBeforeCall(warehouseMetadataId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getWarehouseMetadataAsync( + String warehouseMetadataId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getWarehouseMetadataValidateBeforeCall(warehouseMetadataId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getWarehousesCatalog - * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha. (required) + * + * @param pagination Required pagination params used to filter the Warehouses catalog. This + * parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWarehousesCatalogCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getWarehousesCatalogCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -826,100 +967,128 @@ public okhttp3.Call getWarehousesCatalogCall(PaginationInput pagination, final A } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getWarehousesCatalogValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getWarehousesCatalogValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getWarehousesCatalog(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getWarehousesCatalog(Async)"); } - okhttp3.Call localVarCall = getWarehousesCatalogCall(pagination, _callback); return localVarCall; - } /** - * Get Warehouses Catalog - * Returns a list of all available Warehouses in the Segment catalog. - * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha. (required) + * Get Warehouses Catalog Returns a list of all available Warehouses in the Segment catalog. + * + * @param pagination Required pagination params used to filter the Warehouses catalog. This + * parameter exists in v1. (required) * @return GetWarehousesCatalog200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetWarehousesCatalog200Response getWarehousesCatalog(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getWarehousesCatalogWithHttpInfo(pagination); + public GetWarehousesCatalog200Response getWarehousesCatalog(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + getWarehousesCatalogWithHttpInfo(pagination); return localVarResp.getData(); } /** - * Get Warehouses Catalog - * Returns a list of all available Warehouses in the Segment catalog. - * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha. (required) + * Get Warehouses Catalog Returns a list of all available Warehouses in the Segment catalog. + * + * @param pagination Required pagination params used to filter the Warehouses catalog. This + * parameter exists in v1. (required) * @return ApiResponse<GetWarehousesCatalog200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getWarehousesCatalogWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse getWarehousesCatalogWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = getWarehousesCatalogValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Warehouses Catalog (asynchronously) - * Returns a list of all available Warehouses in the Segment catalog. - * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha. (required) + * Get Warehouses Catalog (asynchronously) Returns a list of all available Warehouses in the + * Segment catalog. + * + * @param pagination Required pagination params used to filter the Warehouses catalog. This + * parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWarehousesCatalogAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getWarehousesCatalogAsync( + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getWarehousesCatalogValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index d0cdb807..a9119a95 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateCloudSourceRegulation200Response; import com.segment.publicapi.models.CreateCloudSourceRegulationV1Input; import com.segment.publicapi.models.CreateSourceRegulation200Response; @@ -39,14 +32,11 @@ import com.segment.publicapi.models.ListSuppressions200Response; import com.segment.publicapi.models.ListWorkspaceRegulations200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class DeletionAndSuppressionApi { private ApiClient localVarApiClient; @@ -87,29 +77,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createCloudSourceRegulation - * @param sourceId (required) - * @param createCloudSourceRegulationV1Input (required) + * + * @param sourceId (required) + * @param createCloudSourceRegulationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createCloudSourceRegulationCall(String sourceId, CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createCloudSourceRegulationCall( + String sourceId, + CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -118,8 +113,11 @@ public okhttp3.Call createCloudSourceRegulationCall(String sourceId, CreateCloud Object localVarPostBody = createCloudSourceRegulationV1Input; // create path and map variables - String localVarPath = "/regulations/cloudsources/{sourceId}" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/regulations/cloudsources/{sourceId}" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -128,7 +126,10 @@ public okhttp3.Call createCloudSourceRegulationCall(String sourceId, CreateCloud Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -136,128 +137,179 @@ public okhttp3.Call createCloudSourceRegulationCall(String sourceId, CreateCloud } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createCloudSourceRegulationValidateBeforeCall(String sourceId, CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createCloudSourceRegulationValidateBeforeCall( + String sourceId, + CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling createCloudSourceRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " createCloudSourceRegulation(Async)"); } - + // verify the required parameter 'createCloudSourceRegulationV1Input' is set if (createCloudSourceRegulationV1Input == null) { - throw new ApiException("Missing the required parameter 'createCloudSourceRegulationV1Input' when calling createCloudSourceRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'createCloudSourceRegulationV1Input' when" + + " calling createCloudSourceRegulation(Async)"); } - - okhttp3.Call localVarCall = createCloudSourceRegulationCall(sourceId, createCloudSourceRegulationV1Input, _callback); + okhttp3.Call localVarCall = + createCloudSourceRegulationCall( + sourceId, createCloudSourceRegulationV1Input, _callback); return localVarCall; - } /** - * Create Cloud Source Regulation - * Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent` - * @param sourceId (required) - * @param createCloudSourceRegulationV1Input (required) + * Create Cloud Source Regulation Creates a Source-scoped regulation. Config API omitted fields: + * - `attributes`, - `userAgent` + * + * @param sourceId (required) + * @param createCloudSourceRegulationV1Input (required) * @return CreateCloudSourceRegulation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateCloudSourceRegulation200Response createCloudSourceRegulation(String sourceId, CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input) throws ApiException { - ApiResponse localVarResp = createCloudSourceRegulationWithHttpInfo(sourceId, createCloudSourceRegulationV1Input); + public CreateCloudSourceRegulation200Response createCloudSourceRegulation( + String sourceId, CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input) + throws ApiException { + ApiResponse localVarResp = + createCloudSourceRegulationWithHttpInfo( + sourceId, createCloudSourceRegulationV1Input); return localVarResp.getData(); } /** - * Create Cloud Source Regulation - * Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent` - * @param sourceId (required) - * @param createCloudSourceRegulationV1Input (required) + * Create Cloud Source Regulation Creates a Source-scoped regulation. Config API omitted fields: + * - `attributes`, - `userAgent` + * + * @param sourceId (required) + * @param createCloudSourceRegulationV1Input (required) * @return ApiResponse<CreateCloudSourceRegulation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createCloudSourceRegulationWithHttpInfo(String sourceId, CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input) throws ApiException { - okhttp3.Call localVarCall = createCloudSourceRegulationValidateBeforeCall(sourceId, createCloudSourceRegulationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + createCloudSourceRegulationWithHttpInfo( + String sourceId, + CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input) + throws ApiException { + okhttp3.Call localVarCall = + createCloudSourceRegulationValidateBeforeCall( + sourceId, createCloudSourceRegulationV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Cloud Source Regulation (asynchronously) - * Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent` - * @param sourceId (required) - * @param createCloudSourceRegulationV1Input (required) + * Create Cloud Source Regulation (asynchronously) Creates a Source-scoped regulation. Config + * API omitted fields: - `attributes`, - `userAgent` + * + * @param sourceId (required) + * @param createCloudSourceRegulationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createCloudSourceRegulationAsync(String sourceId, CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createCloudSourceRegulationValidateBeforeCall(sourceId, createCloudSourceRegulationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createCloudSourceRegulationAsync( + String sourceId, + CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createCloudSourceRegulationValidateBeforeCall( + sourceId, createCloudSourceRegulationV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createSourceRegulation - * @param sourceId (required) - * @param createSourceRegulationV1Input (required) + * + * @param sourceId (required) + * @param createSourceRegulationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createSourceRegulationCall(String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSourceRegulationCall( + String sourceId, + CreateSourceRegulationV1Input createSourceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -266,8 +318,11 @@ public okhttp3.Call createSourceRegulationCall(String sourceId, CreateSourceRegu Object localVarPostBody = createSourceRegulationV1Input; // create path and map variables - String localVarPath = "/regulations/sources/{sourceId}" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/regulations/sources/{sourceId}" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -276,7 +331,10 @@ public okhttp3.Call createSourceRegulationCall(String sourceId, CreateSourceRegu Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -284,127 +342,175 @@ public okhttp3.Call createSourceRegulationCall(String sourceId, CreateSourceRegu } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createSourceRegulationValidateBeforeCall(String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createSourceRegulationValidateBeforeCall( + String sourceId, + CreateSourceRegulationV1Input createSourceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling createSourceRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " createSourceRegulation(Async)"); } - + // verify the required parameter 'createSourceRegulationV1Input' is set if (createSourceRegulationV1Input == null) { - throw new ApiException("Missing the required parameter 'createSourceRegulationV1Input' when calling createSourceRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'createSourceRegulationV1Input' when calling" + + " createSourceRegulation(Async)"); } - - okhttp3.Call localVarCall = createSourceRegulationCall(sourceId, createSourceRegulationV1Input, _callback); + okhttp3.Call localVarCall = + createSourceRegulationCall(sourceId, createSourceRegulationV1Input, _callback); return localVarCall; - } /** - * Create Source Regulation - * Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent` - * @param sourceId (required) - * @param createSourceRegulationV1Input (required) + * Create Source Regulation Creates a Source-scoped regulation. When called, this endpoint may + * generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. + * Config API omitted fields: - `attributes`, - `userAgent` + * + * @param sourceId (required) + * @param createSourceRegulationV1Input (required) * @return CreateSourceRegulation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateSourceRegulation200Response createSourceRegulation(String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input) throws ApiException { - ApiResponse localVarResp = createSourceRegulationWithHttpInfo(sourceId, createSourceRegulationV1Input); + public CreateSourceRegulation200Response createSourceRegulation( + String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input) + throws ApiException { + ApiResponse localVarResp = + createSourceRegulationWithHttpInfo(sourceId, createSourceRegulationV1Input); return localVarResp.getData(); } /** - * Create Source Regulation - * Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent` - * @param sourceId (required) - * @param createSourceRegulationV1Input (required) + * Create Source Regulation Creates a Source-scoped regulation. When called, this endpoint may + * generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. + * Config API omitted fields: - `attributes`, - `userAgent` + * + * @param sourceId (required) + * @param createSourceRegulationV1Input (required) * @return ApiResponse<CreateSourceRegulation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createSourceRegulationWithHttpInfo(String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input) throws ApiException { - okhttp3.Call localVarCall = createSourceRegulationValidateBeforeCall(sourceId, createSourceRegulationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createSourceRegulationWithHttpInfo( + String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input) + throws ApiException { + okhttp3.Call localVarCall = + createSourceRegulationValidateBeforeCall( + sourceId, createSourceRegulationV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Source Regulation (asynchronously) - * Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent` - * @param sourceId (required) - * @param createSourceRegulationV1Input (required) + * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. When called, + * this endpoint may generate the `Source Regulation Created` [Audit + * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - + * `userAgent` + * + * @param sourceId (required) + * @param createSourceRegulationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createSourceRegulationAsync(String sourceId, CreateSourceRegulationV1Input createSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createSourceRegulationValidateBeforeCall(sourceId, createSourceRegulationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createSourceRegulationAsync( + String sourceId, + CreateSourceRegulationV1Input createSourceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createSourceRegulationValidateBeforeCall( + sourceId, createSourceRegulationV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createWorkspaceRegulation - * @param createWorkspaceRegulationV1Input (required) + * + * @param createWorkspaceRegulationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createWorkspaceRegulationCall(CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createWorkspaceRegulationCall( + CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -422,7 +528,10 @@ public okhttp3.Call createWorkspaceRegulationCall(CreateWorkspaceRegulationV1Inp Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -430,119 +539,160 @@ public okhttp3.Call createWorkspaceRegulationCall(CreateWorkspaceRegulationV1Inp } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createWorkspaceRegulationValidateBeforeCall(CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createWorkspaceRegulationValidateBeforeCall( + CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createWorkspaceRegulationV1Input' is set if (createWorkspaceRegulationV1Input == null) { - throw new ApiException("Missing the required parameter 'createWorkspaceRegulationV1Input' when calling createWorkspaceRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'createWorkspaceRegulationV1Input' when calling" + + " createWorkspaceRegulation(Async)"); } - - okhttp3.Call localVarCall = createWorkspaceRegulationCall(createWorkspaceRegulationV1Input, _callback); + okhttp3.Call localVarCall = + createWorkspaceRegulationCall(createWorkspaceRegulationV1Input, _callback); return localVarCall; - } /** - * Create Workspace Regulation - * Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent` - * @param createWorkspaceRegulationV1Input (required) + * Create Workspace Regulation Creates a Workspace-scoped regulation. When called, this endpoint + * may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) + * event. Config API omitted fields: - `attributes`, - `userAgent` + * + * @param createWorkspaceRegulationV1Input (required) * @return CreateWorkspaceRegulation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateWorkspaceRegulation200Response createWorkspaceRegulation(CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input) throws ApiException { - ApiResponse localVarResp = createWorkspaceRegulationWithHttpInfo(createWorkspaceRegulationV1Input); + public CreateWorkspaceRegulation200Response createWorkspaceRegulation( + CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input) throws ApiException { + ApiResponse localVarResp = + createWorkspaceRegulationWithHttpInfo(createWorkspaceRegulationV1Input); return localVarResp.getData(); } /** - * Create Workspace Regulation - * Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent` - * @param createWorkspaceRegulationV1Input (required) + * Create Workspace Regulation Creates a Workspace-scoped regulation. When called, this endpoint + * may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) + * event. Config API omitted fields: - `attributes`, - `userAgent` + * + * @param createWorkspaceRegulationV1Input (required) * @return ApiResponse<CreateWorkspaceRegulation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createWorkspaceRegulationWithHttpInfo(CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input) throws ApiException { - okhttp3.Call localVarCall = createWorkspaceRegulationValidateBeforeCall(createWorkspaceRegulationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createWorkspaceRegulationWithHttpInfo( + CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input) throws ApiException { + okhttp3.Call localVarCall = + createWorkspaceRegulationValidateBeforeCall(createWorkspaceRegulationV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Workspace Regulation (asynchronously) - * Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent` - * @param createWorkspaceRegulationV1Input (required) + * Create Workspace Regulation (asynchronously) Creates a Workspace-scoped regulation. When + * called, this endpoint may generate the `Workspace Regulation Created` [Audit + * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - + * `userAgent` + * + * @param createWorkspaceRegulationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createWorkspaceRegulationAsync(CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createWorkspaceRegulationValidateBeforeCall(createWorkspaceRegulationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createWorkspaceRegulationAsync( + CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createWorkspaceRegulationValidateBeforeCall( + createWorkspaceRegulationV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteRegulation - * @param regulateId (required) + * + * @param regulateId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -551,8 +701,11 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c Object localVarPostBody = null; // create path and map variables - String localVarPath = "/regulations/{regulateId}" - .replaceAll("\\{" + "regulateId" + "\\}", localVarApiClient.escapeString(regulateId.toString())); + String localVarPath = + "/regulations/{regulateId}" + .replaceAll( + "\\{" + "regulateId" + "\\}", + localVarApiClient.escapeString(regulateId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -561,127 +714,157 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteRegulationValidateBeforeCall(String regulateId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteRegulationValidateBeforeCall( + String regulateId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'regulateId' is set if (regulateId == null) { - throw new ApiException("Missing the required parameter 'regulateId' when calling deleteRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'regulateId' when calling" + + " deleteRegulation(Async)"); } - okhttp3.Call localVarCall = deleteRegulationCall(regulateId, _callback); return localVarCall; - } /** - * Delete Regulation - * Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param regulateId (required) + * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the + * initialized state to be deleted. When called, this endpoint may generate the `Regulation + * Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param regulateId (required) * @return DeleteRegulation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteRegulation200Response deleteRegulation(String regulateId) throws ApiException { - ApiResponse localVarResp = deleteRegulationWithHttpInfo(regulateId); + ApiResponse localVarResp = + deleteRegulationWithHttpInfo(regulateId); return localVarResp.getData(); } /** - * Delete Regulation - * Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param regulateId (required) + * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the + * initialized state to be deleted. When called, this endpoint may generate the `Regulation + * Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteRegulationWithHttpInfo(String regulateId) throws ApiException { + public ApiResponse deleteRegulationWithHttpInfo(String regulateId) + throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Regulation (asynchronously) - * Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param regulateId (required) + * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation + * must be in the initialized state to be deleted. When called, this endpoint may generate the + * `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteRegulationAsync(String regulateId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRegulationAsync( + String regulateId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getRegulation - * @param regulateId (required) + * + * @param regulateId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -690,8 +873,11 @@ public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _call Object localVarPostBody = null; // create path and map variables - String localVarPath = "/regulations/{regulateId}" - .replaceAll("\\{" + "regulateId" + "\\}", localVarApiClient.escapeString(regulateId.toString())); + String localVarPath = + "/regulations/{regulateId}" + .replaceAll( + "\\{" + "regulateId" + "\\}", + localVarApiClient.escapeString(regulateId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -700,53 +886,70 @@ public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _call Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getRegulationValidateBeforeCall(String regulateId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getRegulationValidateBeforeCall( + String regulateId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'regulateId' is set if (regulateId == null) { - throw new ApiException("Missing the required parameter 'regulateId' when calling getRegulation(Async)"); + throw new ApiException( + "Missing the required parameter 'regulateId' when calling" + + " getRegulation(Async)"); } - okhttp3.Call localVarCall = getRegulationCall(regulateId, _callback); return localVarCall; - } /** - * Get Regulation - * Gets a regulation from the Workspace. Config API omitted fields: - `parent` - * @param regulateId (required) + * Get Regulation Gets a regulation from the Workspace. Config API omitted fields: - + * `parent` + * + * @param regulateId (required) * @return GetRegulation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetRegulation200Response getRegulation(String regulateId) throws ApiException { ApiResponse localVarResp = getRegulationWithHttpInfo(regulateId); @@ -754,76 +957,92 @@ public GetRegulation200Response getRegulation(String regulateId) throws ApiExcep } /** - * Get Regulation - * Gets a regulation from the Workspace. Config API omitted fields: - `parent` - * @param regulateId (required) + * Get Regulation Gets a regulation from the Workspace. Config API omitted fields: - + * `parent` + * + * @param regulateId (required) * @return ApiResponse<GetRegulation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getRegulationWithHttpInfo(String regulateId) throws ApiException { + public ApiResponse getRegulationWithHttpInfo(String regulateId) + throws ApiException { okhttp3.Call localVarCall = getRegulationValidateBeforeCall(regulateId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Regulation (asynchronously) - * Gets a regulation from the Workspace. Config API omitted fields: - `parent` - * @param regulateId (required) + * Get Regulation (asynchronously) Gets a regulation from the Workspace. Config API omitted + * fields: - `parent` + * + * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getRegulationAsync(String regulateId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getRegulationAsync( + String regulateId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getRegulationValidateBeforeCall(regulateId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listRegulationsFromSource - * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * + * @param sourceId (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter returned regulations. This parameter exists in + * v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listRegulationsFromSourceCall(String sourceId, PaginationInput pagination, String status, List regulationTypes, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRegulationsFromSourceCall( + String sourceId, + PaginationInput pagination, + String status, + List regulationTypes, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -832,8 +1051,11 @@ public okhttp3.Call listRegulationsFromSourceCall(String sourceId, PaginationInp Object localVarPostBody = null; // create path and map variables - String localVarPath = "/regulations/sources/{sourceId}" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/regulations/sources/{sourceId}" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -846,7 +1068,8 @@ public okhttp3.Call listRegulationsFromSourceCall(String sourceId, PaginationInp } if (regulationTypes != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "regulationTypes", regulationTypes)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "regulationTypes", regulationTypes)); } if (pagination != null) { @@ -854,141 +1077,200 @@ public okhttp3.Call listRegulationsFromSourceCall(String sourceId, PaginationInp } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listRegulationsFromSourceValidateBeforeCall(String sourceId, PaginationInput pagination, String status, List regulationTypes, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( + String sourceId, + PaginationInput pagination, + String status, + List regulationTypes, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listRegulationsFromSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listRegulationsFromSource(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listRegulationsFromSource(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listRegulationsFromSource(Async)"); } - - okhttp3.Call localVarCall = listRegulationsFromSourceCall(sourceId, pagination, status, regulationTypes, _callback); + okhttp3.Call localVarCall = + listRegulationsFromSourceCall( + sourceId, pagination, status, regulationTypes, _callback); return localVarCall; - } /** - * List Regulations from Source - * Lists all Source-scoped regulations. - * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * List Regulations from Source Lists all Source-scoped regulations. + * + * @param sourceId (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter returned regulations. This parameter exists in + * v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @return ListRegulationsFromSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListRegulationsFromSource200Response listRegulationsFromSource(String sourceId, PaginationInput pagination, String status, List regulationTypes) throws ApiException { - ApiResponse localVarResp = listRegulationsFromSourceWithHttpInfo(sourceId, pagination, status, regulationTypes); + public ListRegulationsFromSource200Response listRegulationsFromSource( + String sourceId, + PaginationInput pagination, + String status, + List regulationTypes) + throws ApiException { + ApiResponse localVarResp = + listRegulationsFromSourceWithHttpInfo( + sourceId, pagination, status, regulationTypes); return localVarResp.getData(); } /** - * List Regulations from Source - * Lists all Source-scoped regulations. - * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * List Regulations from Source Lists all Source-scoped regulations. + * + * @param sourceId (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter returned regulations. This parameter exists in + * v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @return ApiResponse<ListRegulationsFromSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listRegulationsFromSourceWithHttpInfo(String sourceId, PaginationInput pagination, String status, List regulationTypes) throws ApiException { - okhttp3.Call localVarCall = listRegulationsFromSourceValidateBeforeCall(sourceId, pagination, status, regulationTypes, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listRegulationsFromSourceWithHttpInfo( + String sourceId, + PaginationInput pagination, + String status, + List regulationTypes) + throws ApiException { + okhttp3.Call localVarCall = + listRegulationsFromSourceValidateBeforeCall( + sourceId, pagination, status, regulationTypes, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Regulations from Source (asynchronously) - * Lists all Source-scoped regulations. - * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * List Regulations from Source (asynchronously) Lists all Source-scoped regulations. + * + * @param sourceId (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter returned regulations. This parameter exists in + * v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listRegulationsFromSourceAsync(String sourceId, PaginationInput pagination, String status, List regulationTypes, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listRegulationsFromSourceValidateBeforeCall(sourceId, pagination, status, regulationTypes, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listRegulationsFromSourceAsync( + String sourceId, + PaginationInput pagination, + String status, + List regulationTypes, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listRegulationsFromSourceValidateBeforeCall( + sourceId, pagination, status, regulationTypes, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSuppressions - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSuppressionsCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSuppressionsCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1010,129 +1292,160 @@ public okhttp3.Call listSuppressionsCall(PaginationInput pagination, final ApiCa } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSuppressionsValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSuppressionsValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSuppressions(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSuppressions(Async)"); } - okhttp3.Call localVarCall = listSuppressionsCall(pagination, _callback); return localVarCall; - } /** - * List Suppressions - * Lists all suppressions in a given Workspace. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * List Suppressions Lists all suppressions in a given Workspace. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @return ListSuppressions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSuppressions200Response listSuppressions(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listSuppressionsWithHttpInfo(pagination); + public ListSuppressions200Response listSuppressions(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listSuppressionsWithHttpInfo(pagination); return localVarResp.getData(); } /** - * List Suppressions - * Lists all suppressions in a given Workspace. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * List Suppressions Lists all suppressions in a given Workspace. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListSuppressions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSuppressionsWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listSuppressionsWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listSuppressionsValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Suppressions (asynchronously) - * Lists all suppressions in a given Workspace. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * List Suppressions (asynchronously) Lists all suppressions in a given Workspace. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSuppressionsAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSuppressionsAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listSuppressionsValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listWorkspaceRegulations - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter the returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter the returned regulations. This parameter exists + * in v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listWorkspaceRegulationsCall(PaginationInput pagination, String status, List regulationTypes, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listWorkspaceRegulationsCall( + PaginationInput pagination, + String status, + List regulationTypes, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1154,7 +1467,8 @@ public okhttp3.Call listWorkspaceRegulationsCall(PaginationInput pagination, Str } if (regulationTypes != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "regulationTypes", regulationTypes)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "regulationTypes", regulationTypes)); } if (pagination != null) { @@ -1162,106 +1476,149 @@ public okhttp3.Call listWorkspaceRegulationsCall(PaginationInput pagination, Str } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall(PaginationInput pagination, String status, List regulationTypes, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall( + PaginationInput pagination, + String status, + List regulationTypes, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listWorkspaceRegulations(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listWorkspaceRegulations(Async)"); } - - okhttp3.Call localVarCall = listWorkspaceRegulationsCall(pagination, status, regulationTypes, _callback); + okhttp3.Call localVarCall = + listWorkspaceRegulationsCall(pagination, status, regulationTypes, _callback); return localVarCall; - } /** - * List Workspace Regulations - * Lists all Workspace-scoped regulations. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter the returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * List Workspace Regulations Lists all Workspace-scoped regulations. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter the returned regulations. This parameter exists + * in v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @return ListWorkspaceRegulations200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListWorkspaceRegulations200Response listWorkspaceRegulations(PaginationInput pagination, String status, List regulationTypes) throws ApiException { - ApiResponse localVarResp = listWorkspaceRegulationsWithHttpInfo(pagination, status, regulationTypes); + public ListWorkspaceRegulations200Response listWorkspaceRegulations( + PaginationInput pagination, String status, List regulationTypes) + throws ApiException { + ApiResponse localVarResp = + listWorkspaceRegulationsWithHttpInfo(pagination, status, regulationTypes); return localVarResp.getData(); } /** - * List Workspace Regulations - * Lists all Workspace-scoped regulations. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter the returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * List Workspace Regulations Lists all Workspace-scoped regulations. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter the returned regulations. This parameter exists + * in v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @return ApiResponse<ListWorkspaceRegulations200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listWorkspaceRegulationsWithHttpInfo(PaginationInput pagination, String status, List regulationTypes) throws ApiException { - okhttp3.Call localVarCall = listWorkspaceRegulationsValidateBeforeCall(pagination, status, regulationTypes, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listWorkspaceRegulationsWithHttpInfo( + PaginationInput pagination, String status, List regulationTypes) + throws ApiException { + okhttp3.Call localVarCall = + listWorkspaceRegulationsValidateBeforeCall( + pagination, status, regulationTypes, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Workspace Regulations (asynchronously) - * Lists all Workspace-scoped regulations. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param status The status on which to filter the returned regulations. This parameter exists in alpha. (optional) - * @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha. (optional) + * List Workspace Regulations (asynchronously) Lists all Workspace-scoped regulations. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param status The status on which to filter the returned regulations. This parameter exists + * in v1. (optional) + * @param regulationTypes The regulation types on which to filter returned regulations. This + * parameter exists in v1. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listWorkspaceRegulationsAsync(PaginationInput pagination, String status, List regulationTypes, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listWorkspaceRegulationsValidateBeforeCall(pagination, status, regulationTypes, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listWorkspaceRegulationsAsync( + PaginationInput pagination, + String status, + List regulationTypes, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listWorkspaceRegulationsValidateBeforeCall( + pagination, status, regulationTypes, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index 9155d760..c13b08e6 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateFilterForDestination200Response; import com.segment.publicapi.models.CreateFilterForDestinationV1Input; import com.segment.publicapi.models.GetFilterInDestination200Response; @@ -35,16 +28,13 @@ import com.segment.publicapi.models.PreviewDestinationFilter200Response; import com.segment.publicapi.models.PreviewDestinationFilterV1Input; import com.segment.publicapi.models.RemoveFilterFromDestination200Response; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateFilterForDestination200Response; import com.segment.publicapi.models.UpdateFilterForDestinationV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class DestinationFiltersApi { private ApiClient localVarApiClient; @@ -85,29 +75,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createFilterForDestination - * @param destinationId (required) - * @param createFilterForDestinationV1Input (required) + * + * @param destinationId (required) + * @param createFilterForDestinationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createFilterForDestinationCall(String destinationId, CreateFilterForDestinationV1Input createFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createFilterForDestinationCall( + String destinationId, + CreateFilterForDestinationV1Input createFilterForDestinationV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -116,8 +111,11 @@ public okhttp3.Call createFilterForDestinationCall(String destinationId, CreateF Object localVarPostBody = createFilterForDestinationV1Input; // create path and map variables - String localVarPath = "/destination/{destinationId}/filters" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destination/{destinationId}/filters" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -126,7 +124,10 @@ public okhttp3.Call createFilterForDestinationCall(String destinationId, CreateF Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -134,128 +135,181 @@ public okhttp3.Call createFilterForDestinationCall(String destinationId, CreateF } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createFilterForDestinationValidateBeforeCall(String destinationId, CreateFilterForDestinationV1Input createFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createFilterForDestinationValidateBeforeCall( + String destinationId, + CreateFilterForDestinationV1Input createFilterForDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling createFilterForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " createFilterForDestination(Async)"); } - + // verify the required parameter 'createFilterForDestinationV1Input' is set if (createFilterForDestinationV1Input == null) { - throw new ApiException("Missing the required parameter 'createFilterForDestinationV1Input' when calling createFilterForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'createFilterForDestinationV1Input' when" + + " calling createFilterForDestination(Async)"); } - - okhttp3.Call localVarCall = createFilterForDestinationCall(destinationId, createFilterForDestinationV1Input, _callback); + okhttp3.Call localVarCall = + createFilterForDestinationCall( + destinationId, createFilterForDestinationV1Input, _callback); return localVarCall; - } /** - * Create Filter for Destination - * Creates a filter in a Destination. When called, this endpoint may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) event. - * @param destinationId (required) - * @param createFilterForDestinationV1Input (required) + * Create Filter for Destination Creates a filter in a Destination. When called, this endpoint + * may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) + * event. + * + * @param destinationId (required) + * @param createFilterForDestinationV1Input (required) * @return CreateFilterForDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateFilterForDestination200Response createFilterForDestination(String destinationId, CreateFilterForDestinationV1Input createFilterForDestinationV1Input) throws ApiException { - ApiResponse localVarResp = createFilterForDestinationWithHttpInfo(destinationId, createFilterForDestinationV1Input); + public CreateFilterForDestination200Response createFilterForDestination( + String destinationId, + CreateFilterForDestinationV1Input createFilterForDestinationV1Input) + throws ApiException { + ApiResponse localVarResp = + createFilterForDestinationWithHttpInfo( + destinationId, createFilterForDestinationV1Input); return localVarResp.getData(); } /** - * Create Filter for Destination - * Creates a filter in a Destination. When called, this endpoint may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) event. - * @param destinationId (required) - * @param createFilterForDestinationV1Input (required) + * Create Filter for Destination Creates a filter in a Destination. When called, this endpoint + * may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) + * event. + * + * @param destinationId (required) + * @param createFilterForDestinationV1Input (required) * @return ApiResponse<CreateFilterForDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createFilterForDestinationWithHttpInfo(String destinationId, CreateFilterForDestinationV1Input createFilterForDestinationV1Input) throws ApiException { - okhttp3.Call localVarCall = createFilterForDestinationValidateBeforeCall(destinationId, createFilterForDestinationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + createFilterForDestinationWithHttpInfo( + String destinationId, + CreateFilterForDestinationV1Input createFilterForDestinationV1Input) + throws ApiException { + okhttp3.Call localVarCall = + createFilterForDestinationValidateBeforeCall( + destinationId, createFilterForDestinationV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Filter for Destination (asynchronously) - * Creates a filter in a Destination. When called, this endpoint may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) event. - * @param destinationId (required) - * @param createFilterForDestinationV1Input (required) + * Create Filter for Destination (asynchronously) Creates a filter in a Destination. When + * called, this endpoint may generate the `Destination Filter Created` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param destinationId (required) + * @param createFilterForDestinationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createFilterForDestinationAsync(String destinationId, CreateFilterForDestinationV1Input createFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createFilterForDestinationValidateBeforeCall(destinationId, createFilterForDestinationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createFilterForDestinationAsync( + String destinationId, + CreateFilterForDestinationV1Input createFilterForDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createFilterForDestinationValidateBeforeCall( + destinationId, createFilterForDestinationV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getFilterInDestination - * @param destinationId (required) - * @param filterId (required) + * + * @param destinationId (required) + * @param filterId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getFilterInDestinationCall(String destinationId, String filterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFilterInDestinationCall( + String destinationId, String filterId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -264,9 +318,14 @@ public okhttp3.Call getFilterInDestinationCall(String destinationId, String filt Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destination/{destinationId}/filters/{filterId}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll("\\{" + "filterId" + "\\}", localVarApiClient.escapeString(filterId.toString())); + String localVarPath = + "/destination/{destinationId}/filters/{filterId}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())) + .replaceAll( + "\\{" + "filterId" + "\\}", + localVarApiClient.escapeString(filterId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -275,136 +334,169 @@ public okhttp3.Call getFilterInDestinationCall(String destinationId, String filt Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getFilterInDestinationValidateBeforeCall(String destinationId, String filterId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getFilterInDestinationValidateBeforeCall( + String destinationId, String filterId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling getFilterInDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " getFilterInDestination(Async)"); } - + // verify the required parameter 'filterId' is set if (filterId == null) { - throw new ApiException("Missing the required parameter 'filterId' when calling getFilterInDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'filterId' when calling" + + " getFilterInDestination(Async)"); } - okhttp3.Call localVarCall = getFilterInDestinationCall(destinationId, filterId, _callback); return localVarCall; - } /** - * Get Filter in Destination - * Gets a Destination filter by id. - * @param destinationId (required) - * @param filterId (required) + * Get Filter in Destination Gets a Destination filter by id. + * + * @param destinationId (required) + * @param filterId (required) * @return GetFilterInDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetFilterInDestination200Response getFilterInDestination(String destinationId, String filterId) throws ApiException { - ApiResponse localVarResp = getFilterInDestinationWithHttpInfo(destinationId, filterId); + public GetFilterInDestination200Response getFilterInDestination( + String destinationId, String filterId) throws ApiException { + ApiResponse localVarResp = + getFilterInDestinationWithHttpInfo(destinationId, filterId); return localVarResp.getData(); } /** - * Get Filter in Destination - * Gets a Destination filter by id. - * @param destinationId (required) - * @param filterId (required) + * Get Filter in Destination Gets a Destination filter by id. + * + * @param destinationId (required) + * @param filterId (required) * @return ApiResponse<GetFilterInDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getFilterInDestinationWithHttpInfo(String destinationId, String filterId) throws ApiException { - okhttp3.Call localVarCall = getFilterInDestinationValidateBeforeCall(destinationId, filterId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getFilterInDestinationWithHttpInfo( + String destinationId, String filterId) throws ApiException { + okhttp3.Call localVarCall = + getFilterInDestinationValidateBeforeCall(destinationId, filterId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Filter in Destination (asynchronously) - * Gets a Destination filter by id. - * @param destinationId (required) - * @param filterId (required) + * Get Filter in Destination (asynchronously) Gets a Destination filter by id. + * + * @param destinationId (required) + * @param filterId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getFilterInDestinationAsync(String destinationId, String filterId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getFilterInDestinationValidateBeforeCall(destinationId, filterId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getFilterInDestinationAsync( + String destinationId, + String filterId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getFilterInDestinationValidateBeforeCall(destinationId, filterId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listFiltersFromDestination - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listFiltersFromDestinationCall(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listFiltersFromDestinationCall( + String destinationId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -413,8 +505,11 @@ public okhttp3.Call listFiltersFromDestinationCall(String destinationId, Paginat Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destination/{destinationId}/filters" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destination/{destinationId}/filters" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -427,135 +522,173 @@ public okhttp3.Call listFiltersFromDestinationCall(String destinationId, Paginat } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listFiltersFromDestinationValidateBeforeCall(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listFiltersFromDestinationValidateBeforeCall( + String destinationId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling listFiltersFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " listFiltersFromDestination(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listFiltersFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listFiltersFromDestination(Async)"); } - - okhttp3.Call localVarCall = listFiltersFromDestinationCall(destinationId, pagination, _callback); + okhttp3.Call localVarCall = + listFiltersFromDestinationCall(destinationId, pagination, _callback); return localVarCall; - } /** - * List Filters from Destination - * Lists filters for a Destination. - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Filters from Destination Lists filters for a Destination. + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListFiltersFromDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListFiltersFromDestination200Response listFiltersFromDestination(String destinationId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listFiltersFromDestinationWithHttpInfo(destinationId, pagination); + public ListFiltersFromDestination200Response listFiltersFromDestination( + String destinationId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listFiltersFromDestinationWithHttpInfo(destinationId, pagination); return localVarResp.getData(); } /** - * List Filters from Destination - * Lists filters for a Destination. - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Filters from Destination Lists filters for a Destination. + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListFiltersFromDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listFiltersFromDestinationWithHttpInfo(String destinationId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listFiltersFromDestinationValidateBeforeCall(destinationId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listFiltersFromDestinationWithHttpInfo(String destinationId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listFiltersFromDestinationValidateBeforeCall(destinationId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Filters from Destination (asynchronously) - * Lists filters for a Destination. - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Filters from Destination (asynchronously) Lists filters for a Destination. + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listFiltersFromDestinationAsync(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listFiltersFromDestinationValidateBeforeCall(destinationId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listFiltersFromDestinationAsync( + String destinationId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFiltersFromDestinationValidateBeforeCall(destinationId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for previewDestinationFilter - * @param previewDestinationFilterV1Input (required) + * + * @param previewDestinationFilterV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call previewDestinationFilterCall(PreviewDestinationFilterV1Input previewDestinationFilterV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call previewDestinationFilterCall( + PreviewDestinationFilterV1Input previewDestinationFilterV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -573,7 +706,10 @@ public okhttp3.Call previewDestinationFilterCall(PreviewDestinationFilterV1Input Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -581,120 +717,156 @@ public okhttp3.Call previewDestinationFilterCall(PreviewDestinationFilterV1Input } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call previewDestinationFilterValidateBeforeCall(PreviewDestinationFilterV1Input previewDestinationFilterV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call previewDestinationFilterValidateBeforeCall( + PreviewDestinationFilterV1Input previewDestinationFilterV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'previewDestinationFilterV1Input' is set if (previewDestinationFilterV1Input == null) { - throw new ApiException("Missing the required parameter 'previewDestinationFilterV1Input' when calling previewDestinationFilter(Async)"); + throw new ApiException( + "Missing the required parameter 'previewDestinationFilterV1Input' when calling" + + " previewDestinationFilter(Async)"); } - - okhttp3.Call localVarCall = previewDestinationFilterCall(previewDestinationFilterV1Input, _callback); + okhttp3.Call localVarCall = + previewDestinationFilterCall(previewDestinationFilterV1Input, _callback); return localVarCall; - } /** - * Preview Destination Filter - * Simulates the application of a Destination filter to a provided JSON payload. - * @param previewDestinationFilterV1Input (required) + * Preview Destination Filter Simulates the application of a Destination filter to a provided + * JSON payload. + * + * @param previewDestinationFilterV1Input (required) * @return PreviewDestinationFilter200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public PreviewDestinationFilter200Response previewDestinationFilter(PreviewDestinationFilterV1Input previewDestinationFilterV1Input) throws ApiException { - ApiResponse localVarResp = previewDestinationFilterWithHttpInfo(previewDestinationFilterV1Input); + public PreviewDestinationFilter200Response previewDestinationFilter( + PreviewDestinationFilterV1Input previewDestinationFilterV1Input) throws ApiException { + ApiResponse localVarResp = + previewDestinationFilterWithHttpInfo(previewDestinationFilterV1Input); return localVarResp.getData(); } /** - * Preview Destination Filter - * Simulates the application of a Destination filter to a provided JSON payload. - * @param previewDestinationFilterV1Input (required) + * Preview Destination Filter Simulates the application of a Destination filter to a provided + * JSON payload. + * + * @param previewDestinationFilterV1Input (required) * @return ApiResponse<PreviewDestinationFilter200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse previewDestinationFilterWithHttpInfo(PreviewDestinationFilterV1Input previewDestinationFilterV1Input) throws ApiException { - okhttp3.Call localVarCall = previewDestinationFilterValidateBeforeCall(previewDestinationFilterV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse previewDestinationFilterWithHttpInfo( + PreviewDestinationFilterV1Input previewDestinationFilterV1Input) throws ApiException { + okhttp3.Call localVarCall = + previewDestinationFilterValidateBeforeCall(previewDestinationFilterV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Preview Destination Filter (asynchronously) - * Simulates the application of a Destination filter to a provided JSON payload. - * @param previewDestinationFilterV1Input (required) + * Preview Destination Filter (asynchronously) Simulates the application of a Destination filter + * to a provided JSON payload. + * + * @param previewDestinationFilterV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call previewDestinationFilterAsync(PreviewDestinationFilterV1Input previewDestinationFilterV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = previewDestinationFilterValidateBeforeCall(previewDestinationFilterV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call previewDestinationFilterAsync( + PreviewDestinationFilterV1Input previewDestinationFilterV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + previewDestinationFilterValidateBeforeCall( + previewDestinationFilterV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeFilterFromDestination - * @param destinationId (required) - * @param filterId (required) + * + * @param destinationId (required) + * @param filterId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeFilterFromDestinationCall(String destinationId, String filterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeFilterFromDestinationCall( + String destinationId, String filterId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -703,9 +875,14 @@ public okhttp3.Call removeFilterFromDestinationCall(String destinationId, String Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destination/{destinationId}/filters/{filterId}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll("\\{" + "filterId" + "\\}", localVarApiClient.escapeString(filterId.toString())); + String localVarPath = + "/destination/{destinationId}/filters/{filterId}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())) + .replaceAll( + "\\{" + "filterId" + "\\}", + localVarApiClient.escapeString(filterId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -714,137 +891,181 @@ public okhttp3.Call removeFilterFromDestinationCall(String destinationId, String Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call removeFilterFromDestinationValidateBeforeCall(String destinationId, String filterId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call removeFilterFromDestinationValidateBeforeCall( + String destinationId, String filterId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling removeFilterFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " removeFilterFromDestination(Async)"); } - + // verify the required parameter 'filterId' is set if (filterId == null) { - throw new ApiException("Missing the required parameter 'filterId' when calling removeFilterFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'filterId' when calling" + + " removeFilterFromDestination(Async)"); } - - okhttp3.Call localVarCall = removeFilterFromDestinationCall(destinationId, filterId, _callback); + okhttp3.Call localVarCall = + removeFilterFromDestinationCall(destinationId, filterId, _callback); return localVarCall; - } /** - * Remove Filter from Destination - * Deletes a Destination filter. When called, this endpoint may generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param destinationId (required) - * @param filterId (required) + * Remove Filter from Destination Deletes a Destination filter. When called, this endpoint may + * generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param destinationId (required) + * @param filterId (required) * @return RemoveFilterFromDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public RemoveFilterFromDestination200Response removeFilterFromDestination(String destinationId, String filterId) throws ApiException { - ApiResponse localVarResp = removeFilterFromDestinationWithHttpInfo(destinationId, filterId); + public RemoveFilterFromDestination200Response removeFilterFromDestination( + String destinationId, String filterId) throws ApiException { + ApiResponse localVarResp = + removeFilterFromDestinationWithHttpInfo(destinationId, filterId); return localVarResp.getData(); } /** - * Remove Filter from Destination - * Deletes a Destination filter. When called, this endpoint may generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param destinationId (required) - * @param filterId (required) + * Remove Filter from Destination Deletes a Destination filter. When called, this endpoint may + * generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param destinationId (required) + * @param filterId (required) * @return ApiResponse<RemoveFilterFromDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse removeFilterFromDestinationWithHttpInfo(String destinationId, String filterId) throws ApiException { - okhttp3.Call localVarCall = removeFilterFromDestinationValidateBeforeCall(destinationId, filterId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + removeFilterFromDestinationWithHttpInfo(String destinationId, String filterId) + throws ApiException { + okhttp3.Call localVarCall = + removeFilterFromDestinationValidateBeforeCall(destinationId, filterId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove Filter from Destination (asynchronously) - * Deletes a Destination filter. When called, this endpoint may generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param destinationId (required) - * @param filterId (required) + * Remove Filter from Destination (asynchronously) Deletes a Destination filter. When called, + * this endpoint may generate the `Destination Filter Deleted` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param destinationId (required) + * @param filterId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeFilterFromDestinationAsync(String destinationId, String filterId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = removeFilterFromDestinationValidateBeforeCall(destinationId, filterId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call removeFilterFromDestinationAsync( + String destinationId, + String filterId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeFilterFromDestinationValidateBeforeCall(destinationId, filterId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateFilterForDestination - * @param destinationId (required) - * @param filterId (required) - * @param updateFilterForDestinationV1Input (required) + * + * @param destinationId (required) + * @param filterId (required) + * @param updateFilterForDestinationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateFilterForDestinationCall(String destinationId, String filterId, UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateFilterForDestinationCall( + String destinationId, + String filterId, + UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -853,9 +1074,14 @@ public okhttp3.Call updateFilterForDestinationCall(String destinationId, String Object localVarPostBody = updateFilterForDestinationV1Input; // create path and map variables - String localVarPath = "/destination/{destinationId}/filters/{filterId}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll("\\{" + "filterId" + "\\}", localVarApiClient.escapeString(filterId.toString())); + String localVarPath = + "/destination/{destinationId}/filters/{filterId}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())) + .replaceAll( + "\\{" + "filterId" + "\\}", + localVarApiClient.escapeString(filterId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -864,7 +1090,10 @@ public okhttp3.Call updateFilterForDestinationCall(String destinationId, String Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -872,108 +1101,164 @@ public okhttp3.Call updateFilterForDestinationCall(String destinationId, String } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateFilterForDestinationValidateBeforeCall(String destinationId, String filterId, UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateFilterForDestinationValidateBeforeCall( + String destinationId, + String filterId, + UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling updateFilterForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " updateFilterForDestination(Async)"); } - + // verify the required parameter 'filterId' is set if (filterId == null) { - throw new ApiException("Missing the required parameter 'filterId' when calling updateFilterForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'filterId' when calling" + + " updateFilterForDestination(Async)"); } - + // verify the required parameter 'updateFilterForDestinationV1Input' is set if (updateFilterForDestinationV1Input == null) { - throw new ApiException("Missing the required parameter 'updateFilterForDestinationV1Input' when calling updateFilterForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'updateFilterForDestinationV1Input' when" + + " calling updateFilterForDestination(Async)"); } - - okhttp3.Call localVarCall = updateFilterForDestinationCall(destinationId, filterId, updateFilterForDestinationV1Input, _callback); + okhttp3.Call localVarCall = + updateFilterForDestinationCall( + destinationId, filterId, updateFilterForDestinationV1Input, _callback); return localVarCall; - } /** - * Update Filter for Destination - * Updates a filter in a Destination. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled - * @param destinationId (required) - * @param filterId (required) - * @param updateFilterForDestinationV1Input (required) + * Update Filter for Destination Updates a filter in a Destination. When called, this endpoint + * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Destination Filter Enabled * Destination Filter Disabled + * + * @param destinationId (required) + * @param filterId (required) + * @param updateFilterForDestinationV1Input (required) * @return UpdateFilterForDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateFilterForDestination200Response updateFilterForDestination(String destinationId, String filterId, UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input) throws ApiException { - ApiResponse localVarResp = updateFilterForDestinationWithHttpInfo(destinationId, filterId, updateFilterForDestinationV1Input); + public UpdateFilterForDestination200Response updateFilterForDestination( + String destinationId, + String filterId, + UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input) + throws ApiException { + ApiResponse localVarResp = + updateFilterForDestinationWithHttpInfo( + destinationId, filterId, updateFilterForDestinationV1Input); return localVarResp.getData(); } /** - * Update Filter for Destination - * Updates a filter in a Destination. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled - * @param destinationId (required) - * @param filterId (required) - * @param updateFilterForDestinationV1Input (required) + * Update Filter for Destination Updates a filter in a Destination. When called, this endpoint + * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Destination Filter Enabled * Destination Filter Disabled + * + * @param destinationId (required) + * @param filterId (required) + * @param updateFilterForDestinationV1Input (required) * @return ApiResponse<UpdateFilterForDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateFilterForDestinationWithHttpInfo(String destinationId, String filterId, UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input) throws ApiException { - okhttp3.Call localVarCall = updateFilterForDestinationValidateBeforeCall(destinationId, filterId, updateFilterForDestinationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + updateFilterForDestinationWithHttpInfo( + String destinationId, + String filterId, + UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input) + throws ApiException { + okhttp3.Call localVarCall = + updateFilterForDestinationValidateBeforeCall( + destinationId, filterId, updateFilterForDestinationV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Filter for Destination (asynchronously) - * Updates a filter in a Destination. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled - * @param destinationId (required) - * @param filterId (required) - * @param updateFilterForDestinationV1Input (required) + * Update Filter for Destination (asynchronously) Updates a filter in a Destination. When + * called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled + * + * @param destinationId (required) + * @param filterId (required) + * @param updateFilterForDestinationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateFilterForDestinationAsync(String destinationId, String filterId, UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateFilterForDestinationValidateBeforeCall(destinationId, filterId, updateFilterForDestinationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateFilterForDestinationAsync( + String destinationId, + String filterId, + UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateFilterForDestinationValidateBeforeCall( + destinationId, filterId, updateFilterForDestinationV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 4f5e6abe..317de9ff 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateDestination200Response; import com.segment.publicapi.models.CreateDestinationSubscription200Response; import com.segment.publicapi.models.CreateDestinationSubscriptionAlphaInput; @@ -39,18 +32,15 @@ import com.segment.publicapi.models.ListSubscriptionsFromDestination200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveSubscriptionFromDestination200Response; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateDestination200Response; import com.segment.publicapi.models.UpdateDestinationV1Input; import com.segment.publicapi.models.UpdateSubscriptionForDestination200Response; import com.segment.publicapi.models.UpdateSubscriptionForDestinationAlphaInput; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class DestinationsApi { private ApiClient localVarApiClient; @@ -91,28 +81,31 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createDestination - * @param createDestinationV1Input (required) + * + * @param createDestinationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createDestinationCall(CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createDestinationCall( + CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -130,7 +123,10 @@ public okhttp3.Call createDestinationCall(CreateDestinationV1Input createDestina Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -138,120 +134,155 @@ public okhttp3.Call createDestinationCall(CreateDestinationV1Input createDestina } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createDestinationValidateBeforeCall(CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createDestinationValidateBeforeCall( + CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createDestinationV1Input' is set if (createDestinationV1Input == null) { - throw new ApiException("Missing the required parameter 'createDestinationV1Input' when calling createDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'createDestinationV1Input' when calling" + + " createDestination(Async)"); } - okhttp3.Call localVarCall = createDestinationCall(createDestinationV1Input, _callback); return localVarCall; - } /** - * Create Destination - * Creates a new Destination. When called, this endpoint may generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createDestinationV1Input (required) + * Create Destination Creates a new Destination. When called, this endpoint may generate the + * `Integration Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createDestinationV1Input (required) * @return CreateDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateDestination200Response createDestination(CreateDestinationV1Input createDestinationV1Input) throws ApiException { - ApiResponse localVarResp = createDestinationWithHttpInfo(createDestinationV1Input); + public CreateDestination200Response createDestination( + CreateDestinationV1Input createDestinationV1Input) throws ApiException { + ApiResponse localVarResp = + createDestinationWithHttpInfo(createDestinationV1Input); return localVarResp.getData(); } /** - * Create Destination - * Creates a new Destination. When called, this endpoint may generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createDestinationV1Input (required) + * Create Destination Creates a new Destination. When called, this endpoint may generate the + * `Integration Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createDestinationV1Input (required) * @return ApiResponse<CreateDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createDestinationWithHttpInfo(CreateDestinationV1Input createDestinationV1Input) throws ApiException { - okhttp3.Call localVarCall = createDestinationValidateBeforeCall(createDestinationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createDestinationWithHttpInfo( + CreateDestinationV1Input createDestinationV1Input) throws ApiException { + okhttp3.Call localVarCall = + createDestinationValidateBeforeCall(createDestinationV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Destination (asynchronously) - * Creates a new Destination. When called, this endpoint may generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createDestinationV1Input (required) + * Create Destination (asynchronously) Creates a new Destination. When called, this endpoint may + * generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createDestinationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createDestinationAsync(CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createDestinationValidateBeforeCall(createDestinationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createDestinationAsync( + CreateDestinationV1Input createDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createDestinationValidateBeforeCall(createDestinationV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createDestinationSubscription - * @param destinationId (required) - * @param createDestinationSubscriptionAlphaInput (required) + * + * @param destinationId (required) + * @param createDestinationSubscriptionAlphaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createDestinationSubscriptionCall(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createDestinationSubscriptionCall( + String destinationId, + CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -260,8 +291,11 @@ public okhttp3.Call createDestinationSubscriptionCall(String destinationId, Crea Object localVarPostBody = createDestinationSubscriptionAlphaInput; // create path and map variables - String localVarPath = "/destinations/{destinationId}/subscriptions" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destinations/{destinationId}/subscriptions" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -277,128 +311,170 @@ public okhttp3.Call createDestinationSubscriptionCall(String destinationId, Crea localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createDestinationSubscriptionValidateBeforeCall(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createDestinationSubscriptionValidateBeforeCall( + String destinationId, + CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling createDestinationSubscription(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " createDestinationSubscription(Async)"); } - + // verify the required parameter 'createDestinationSubscriptionAlphaInput' is set if (createDestinationSubscriptionAlphaInput == null) { - throw new ApiException("Missing the required parameter 'createDestinationSubscriptionAlphaInput' when calling createDestinationSubscription(Async)"); + throw new ApiException( + "Missing the required parameter 'createDestinationSubscriptionAlphaInput' when" + + " calling createDestinationSubscription(Async)"); } - - okhttp3.Call localVarCall = createDestinationSubscriptionCall(destinationId, createDestinationSubscriptionAlphaInput, _callback); + okhttp3.Call localVarCall = + createDestinationSubscriptionCall( + destinationId, createDestinationSubscriptionAlphaInput, _callback); return localVarCall; - } /** - * Create Destination Subscription - * Creates a new Destination subscription. - * @param destinationId (required) - * @param createDestinationSubscriptionAlphaInput (required) + * Create Destination Subscription Creates a new Destination subscription. + * + * @param destinationId (required) + * @param createDestinationSubscriptionAlphaInput (required) * @return CreateDestinationSubscription200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateDestinationSubscription200Response createDestinationSubscription(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput) throws ApiException { - ApiResponse localVarResp = createDestinationSubscriptionWithHttpInfo(destinationId, createDestinationSubscriptionAlphaInput); + public CreateDestinationSubscription200Response createDestinationSubscription( + String destinationId, + CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createDestinationSubscriptionWithHttpInfo( + destinationId, createDestinationSubscriptionAlphaInput); return localVarResp.getData(); } /** - * Create Destination Subscription - * Creates a new Destination subscription. - * @param destinationId (required) - * @param createDestinationSubscriptionAlphaInput (required) + * Create Destination Subscription Creates a new Destination subscription. + * + * @param destinationId (required) + * @param createDestinationSubscriptionAlphaInput (required) * @return ApiResponse<CreateDestinationSubscription200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createDestinationSubscriptionWithHttpInfo(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput) throws ApiException { - okhttp3.Call localVarCall = createDestinationSubscriptionValidateBeforeCall(destinationId, createDestinationSubscriptionAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + createDestinationSubscriptionWithHttpInfo( + String destinationId, + CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createDestinationSubscriptionValidateBeforeCall( + destinationId, createDestinationSubscriptionAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Destination Subscription (asynchronously) - * Creates a new Destination subscription. - * @param destinationId (required) - * @param createDestinationSubscriptionAlphaInput (required) + * Create Destination Subscription (asynchronously) Creates a new Destination subscription. + * + * @param destinationId (required) + * @param createDestinationSubscriptionAlphaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createDestinationSubscriptionAsync(String destinationId, CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createDestinationSubscriptionValidateBeforeCall(destinationId, createDestinationSubscriptionAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createDestinationSubscriptionAsync( + String destinationId, + CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createDestinationSubscriptionValidateBeforeCall( + destinationId, createDestinationSubscriptionAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteDestination - * @param destinationId (required) + * + * @param destinationId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -407,8 +483,11 @@ public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destinations/{destinationId}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destinations/{destinationId}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -417,127 +496,158 @@ public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallbac Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteDestinationValidateBeforeCall(String destinationId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteDestinationValidateBeforeCall( + String destinationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling deleteDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " deleteDestination(Async)"); } - okhttp3.Call localVarCall = deleteDestinationCall(destinationId, _callback); return localVarCall; - } /** - * Delete Destination - * Deletes an existing Destination. When called, this endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `catalogId` - * @param destinationId (required) + * Delete Destination Deletes an existing Destination. When called, this endpoint may generate + * the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted + * fields: - `catalogId` + * + * @param destinationId (required) * @return DeleteDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public DeleteDestination200Response deleteDestination(String destinationId) throws ApiException { - ApiResponse localVarResp = deleteDestinationWithHttpInfo(destinationId); + public DeleteDestination200Response deleteDestination(String destinationId) + throws ApiException { + ApiResponse localVarResp = + deleteDestinationWithHttpInfo(destinationId); return localVarResp.getData(); } /** - * Delete Destination - * Deletes an existing Destination. When called, this endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `catalogId` - * @param destinationId (required) + * Delete Destination Deletes an existing Destination. When called, this endpoint may generate + * the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted + * fields: - `catalogId` + * + * @param destinationId (required) * @return ApiResponse<DeleteDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteDestinationWithHttpInfo(String destinationId) throws ApiException { + public ApiResponse deleteDestinationWithHttpInfo( + String destinationId) throws ApiException { okhttp3.Call localVarCall = deleteDestinationValidateBeforeCall(destinationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Destination (asynchronously) - * Deletes an existing Destination. When called, this endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `catalogId` - * @param destinationId (required) + * Delete Destination (asynchronously) Deletes an existing Destination. When called, this + * endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) + * event. Config API omitted fields: - `catalogId` + * + * @param destinationId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteDestinationAsync(String destinationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteDestinationAsync( + String destinationId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteDestinationValidateBeforeCall(destinationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getDestination - * @param destinationId (required) + * + * @param destinationId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -546,8 +656,11 @@ public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _ Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destinations/{destinationId}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destinations/{destinationId}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -556,128 +669,155 @@ public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _ Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDestinationValidateBeforeCall(String destinationId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDestinationValidateBeforeCall( + String destinationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling getDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " getDestination(Async)"); } - okhttp3.Call localVarCall = getDestinationCall(destinationId, _callback); return localVarCall; - } /** - * Get Destination - * Returns a Destination by its id. Config API omitted fields: - `catalogId` - * @param destinationId (required) + * Get Destination Returns a Destination by its id. Config API omitted fields: - + * `catalogId` + * + * @param destinationId (required) * @return GetDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetDestination200Response getDestination(String destinationId) throws ApiException { - ApiResponse localVarResp = getDestinationWithHttpInfo(destinationId); + ApiResponse localVarResp = + getDestinationWithHttpInfo(destinationId); return localVarResp.getData(); } /** - * Get Destination - * Returns a Destination by its id. Config API omitted fields: - `catalogId` - * @param destinationId (required) + * Get Destination Returns a Destination by its id. Config API omitted fields: - + * `catalogId` + * + * @param destinationId (required) * @return ApiResponse<GetDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDestinationWithHttpInfo(String destinationId) throws ApiException { + public ApiResponse getDestinationWithHttpInfo(String destinationId) + throws ApiException { okhttp3.Call localVarCall = getDestinationValidateBeforeCall(destinationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Destination (asynchronously) - * Returns a Destination by its id. Config API omitted fields: - `catalogId` - * @param destinationId (required) + * Get Destination (asynchronously) Returns a Destination by its id. Config API omitted fields: + * - `catalogId` + * + * @param destinationId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDestinationAsync(String destinationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDestinationAsync( + String destinationId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getDestinationValidateBeforeCall(destinationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSubscriptionFromDestination - * @param destinationId (required) - * @param id (required) + * + * @param destinationId (required) + * @param id (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSubscriptionFromDestinationCall(String destinationId, String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSubscriptionFromDestinationCall( + String destinationId, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -686,9 +826,14 @@ public okhttp3.Call getSubscriptionFromDestinationCall(String destinationId, Str Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + String localVarPath = + "/destinations/{destinationId}/subscriptions/{id}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -704,132 +849,176 @@ public okhttp3.Call getSubscriptionFromDestinationCall(String destinationId, Str localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getSubscriptionFromDestinationValidateBeforeCall(String destinationId, String id, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getSubscriptionFromDestinationValidateBeforeCall( + String destinationId, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling getSubscriptionFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " getSubscriptionFromDestination(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { - throw new ApiException("Missing the required parameter 'id' when calling getSubscriptionFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " getSubscriptionFromDestination(Async)"); } - - okhttp3.Call localVarCall = getSubscriptionFromDestinationCall(destinationId, id, _callback); + okhttp3.Call localVarCall = + getSubscriptionFromDestinationCall(destinationId, id, _callback); return localVarCall; - } /** - * Get Subscription from Destination - * Gets a Destination subscription by id. - * @param destinationId (required) - * @param id (required) + * Get Subscription from Destination Gets a Destination subscription by id. + * + * @param destinationId (required) + * @param id (required) * @return GetSubscriptionFromDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetSubscriptionFromDestination200Response getSubscriptionFromDestination(String destinationId, String id) throws ApiException { - ApiResponse localVarResp = getSubscriptionFromDestinationWithHttpInfo(destinationId, id); + public GetSubscriptionFromDestination200Response getSubscriptionFromDestination( + String destinationId, String id) throws ApiException { + ApiResponse localVarResp = + getSubscriptionFromDestinationWithHttpInfo(destinationId, id); return localVarResp.getData(); } /** - * Get Subscription from Destination - * Gets a Destination subscription by id. - * @param destinationId (required) - * @param id (required) + * Get Subscription from Destination Gets a Destination subscription by id. + * + * @param destinationId (required) + * @param id (required) * @return ApiResponse<GetSubscriptionFromDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getSubscriptionFromDestinationWithHttpInfo(String destinationId, String id) throws ApiException { - okhttp3.Call localVarCall = getSubscriptionFromDestinationValidateBeforeCall(destinationId, id, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + getSubscriptionFromDestinationWithHttpInfo(String destinationId, String id) + throws ApiException { + okhttp3.Call localVarCall = + getSubscriptionFromDestinationValidateBeforeCall(destinationId, id, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Subscription from Destination (asynchronously) - * Gets a Destination subscription by id. - * @param destinationId (required) - * @param id (required) + * Get Subscription from Destination (asynchronously) Gets a Destination subscription by id. + * + * @param destinationId (required) + * @param id (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSubscriptionFromDestinationAsync(String destinationId, String id, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSubscriptionFromDestinationValidateBeforeCall(destinationId, id, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getSubscriptionFromDestinationAsync( + String destinationId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getSubscriptionFromDestinationValidateBeforeCall(destinationId, id, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listDeliveryMetricsSummaryFromDestination - * @param destinationId (required) - * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) - * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) - * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) - * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in alpha. (optional) + * + * @param destinationId (required) + * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to + * `parent`. This parameter exists in beta. (required) + * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if + * granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 + * days ago if granularity is `DAY`. This parameter exists in beta. (optional) + * @param endTime Filter events that happened before this time. Defaults to now if not set. This + * parameter exists in beta. (optional) + * @param granularity The granularity to filter metrics to. Either `MINUTE`, + * `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This + * parameter exists in beta. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listDeliveryMetricsSummaryFromDestinationCall(String destinationId, String sourceId, String startTime, String endTime, String granularity, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listDeliveryMetricsSummaryFromDestinationCall( + String destinationId, + String sourceId, + String startTime, + String endTime, + String granularity, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -838,8 +1027,11 @@ public okhttp3.Call listDeliveryMetricsSummaryFromDestinationCall(String destina Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destinations/{destinationId}/delivery-metrics" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destinations/{destinationId}/delivery-metrics" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -860,148 +1052,241 @@ public okhttp3.Call listDeliveryMetricsSummaryFromDestinationCall(String destina } if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("granularity", granularity)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall(String destinationId, String sourceId, String startTime, String endTime, String granularity, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall( + String destinationId, + String sourceId, + String startTime, + String endTime, + String granularity, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling listDeliveryMetricsSummaryFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " listDeliveryMetricsSummaryFromDestination(Async)"); } - + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listDeliveryMetricsSummaryFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listDeliveryMetricsSummaryFromDestination(Async)"); } - - okhttp3.Call localVarCall = listDeliveryMetricsSummaryFromDestinationCall(destinationId, sourceId, startTime, endTime, granularity, _callback); + okhttp3.Call localVarCall = + listDeliveryMetricsSummaryFromDestinationCall( + destinationId, sourceId, startTime, endTime, granularity, _callback); return localVarCall; - } /** - * List Delivery Metrics Summary from Destination - * Get event delivery metrics summary from a Destination. Based on the granularity, there are restrictions on the time range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible start time: 60 days in the past - * @param destinationId (required) - * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) - * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) - * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) - * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in alpha. (optional) + * List Delivery Metrics Summary from Destination Get event delivery metrics summary from a + * Destination. Based on the granularity, there are restrictions on the time range you can + * query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 + * hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start + * time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible + * start time: 60 days in the past + * + * @param destinationId (required) + * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to + * `parent`. This parameter exists in beta. (required) + * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if + * granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 + * days ago if granularity is `DAY`. This parameter exists in beta. (optional) + * @param endTime Filter events that happened before this time. Defaults to now if not set. This + * parameter exists in beta. (optional) + * @param granularity The granularity to filter metrics to. Either `MINUTE`, + * `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This + * parameter exists in beta. (optional) * @return ListDeliveryMetricsSummaryFromDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListDeliveryMetricsSummaryFromDestination200Response listDeliveryMetricsSummaryFromDestination(String destinationId, String sourceId, String startTime, String endTime, String granularity) throws ApiException { - ApiResponse localVarResp = listDeliveryMetricsSummaryFromDestinationWithHttpInfo(destinationId, sourceId, startTime, endTime, granularity); + public ListDeliveryMetricsSummaryFromDestination200Response + listDeliveryMetricsSummaryFromDestination( + String destinationId, + String sourceId, + String startTime, + String endTime, + String granularity) + throws ApiException { + ApiResponse localVarResp = + listDeliveryMetricsSummaryFromDestinationWithHttpInfo( + destinationId, sourceId, startTime, endTime, granularity); return localVarResp.getData(); } /** - * List Delivery Metrics Summary from Destination - * Get event delivery metrics summary from a Destination. Based on the granularity, there are restrictions on the time range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible start time: 60 days in the past - * @param destinationId (required) - * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) - * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) - * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) - * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in alpha. (optional) + * List Delivery Metrics Summary from Destination Get event delivery metrics summary from a + * Destination. Based on the granularity, there are restrictions on the time range you can + * query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 + * hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start + * time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible + * start time: 60 days in the past + * + * @param destinationId (required) + * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to + * `parent`. This parameter exists in beta. (required) + * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if + * granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 + * days ago if granularity is `DAY`. This parameter exists in beta. (optional) + * @param endTime Filter events that happened before this time. Defaults to now if not set. This + * parameter exists in beta. (optional) + * @param granularity The granularity to filter metrics to. Either `MINUTE`, + * `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This + * parameter exists in beta. (optional) * @return ApiResponse<ListDeliveryMetricsSummaryFromDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listDeliveryMetricsSummaryFromDestinationWithHttpInfo(String destinationId, String sourceId, String startTime, String endTime, String granularity) throws ApiException { - okhttp3.Call localVarCall = listDeliveryMetricsSummaryFromDestinationValidateBeforeCall(destinationId, sourceId, startTime, endTime, granularity, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listDeliveryMetricsSummaryFromDestinationWithHttpInfo( + String destinationId, + String sourceId, + String startTime, + String endTime, + String granularity) + throws ApiException { + okhttp3.Call localVarCall = + listDeliveryMetricsSummaryFromDestinationValidateBeforeCall( + destinationId, sourceId, startTime, endTime, granularity, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Delivery Metrics Summary from Destination (asynchronously) - * Get event delivery metrics summary from a Destination. Based on the granularity, there are restrictions on the time range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible start time: 60 days in the past - * @param destinationId (required) - * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in alpha. (required) - * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in alpha. (optional) - * @param endTime Filter events that happened before this time. Defaults to now if not set. This parameter exists in alpha. (optional) - * @param granularity The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in alpha. (optional) + * List Delivery Metrics Summary from Destination (asynchronously) Get event delivery metrics + * summary from a Destination. Based on the granularity, there are restrictions on the time + * range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible + * start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest + * possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - + * Oldest possible start time: 60 days in the past + * + * @param destinationId (required) + * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to + * `parent`. This parameter exists in beta. (required) + * @param startTime Filter events that happened after this time. Defaults to: - 1 hour ago if + * granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 + * days ago if granularity is `DAY`. This parameter exists in beta. (optional) + * @param endTime Filter events that happened before this time. Defaults to now if not set. This + * parameter exists in beta. (optional) + * @param granularity The granularity to filter metrics to. Either `MINUTE`, + * `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This + * parameter exists in beta. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listDeliveryMetricsSummaryFromDestinationAsync(String destinationId, String sourceId, String startTime, String endTime, String granularity, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listDeliveryMetricsSummaryFromDestinationValidateBeforeCall(destinationId, sourceId, startTime, endTime, granularity, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listDeliveryMetricsSummaryFromDestinationAsync( + String destinationId, + String sourceId, + String startTime, + String endTime, + String granularity, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listDeliveryMetricsSummaryFromDestinationValidateBeforeCall( + destinationId, sourceId, startTime, endTime, granularity, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listDestinations - * @param pagination Required pagination params for the request. This parameter exists in alpha. (required) + * + * @param pagination Required pagination params for the request. This parameter exists in v1. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listDestinationsCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listDestinationsCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1023,128 +1308,157 @@ public okhttp3.Call listDestinationsCall(PaginationInput pagination, final ApiCa } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listDestinationsValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listDestinationsValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listDestinations(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listDestinations(Async)"); } - okhttp3.Call localVarCall = listDestinationsCall(pagination, _callback); return localVarCall; - } /** - * List Destinations - * Returns a list of Destinations. - * @param pagination Required pagination params for the request. This parameter exists in alpha. (required) + * List Destinations Returns a list of Destinations. + * + * @param pagination Required pagination params for the request. This parameter exists in v1. + * (required) * @return ListDestinations200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListDestinations200Response listDestinations(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listDestinationsWithHttpInfo(pagination); + public ListDestinations200Response listDestinations(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listDestinationsWithHttpInfo(pagination); return localVarResp.getData(); } /** - * List Destinations - * Returns a list of Destinations. - * @param pagination Required pagination params for the request. This parameter exists in alpha. (required) + * List Destinations Returns a list of Destinations. + * + * @param pagination Required pagination params for the request. This parameter exists in v1. + * (required) * @return ApiResponse<ListDestinations200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listDestinationsWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listDestinationsWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listDestinationsValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Destinations (asynchronously) - * Returns a list of Destinations. - * @param pagination Required pagination params for the request. This parameter exists in alpha. (required) + * List Destinations (asynchronously) Returns a list of Destinations. + * + * @param pagination Required pagination params for the request. This parameter exists in v1. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listDestinationsAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listDestinationsAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listDestinationsValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSubscriptionsFromDestination - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in alpha. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSubscriptionsFromDestinationCall(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSubscriptionsFromDestinationCall( + String destinationId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1153,8 +1467,11 @@ public okhttp3.Call listSubscriptionsFromDestinationCall(String destinationId, P Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destinations/{destinationId}/subscriptions" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destinations/{destinationId}/subscriptions" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1174,129 +1491,163 @@ public okhttp3.Call listSubscriptionsFromDestinationCall(String destinationId, P localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSubscriptionsFromDestinationValidateBeforeCall(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSubscriptionsFromDestinationValidateBeforeCall( + String destinationId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling listSubscriptionsFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " listSubscriptionsFromDestination(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSubscriptionsFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSubscriptionsFromDestination(Async)"); } - - okhttp3.Call localVarCall = listSubscriptionsFromDestinationCall(destinationId, pagination, _callback); + okhttp3.Call localVarCall = + listSubscriptionsFromDestinationCall(destinationId, pagination, _callback); return localVarCall; - } /** - * List Subscriptions from Destination - * Lists subscriptions for a Destination. - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Subscriptions from Destination Lists subscriptions for a Destination. + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in alpha. (required) * @return ListSubscriptionsFromDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSubscriptionsFromDestination200Response listSubscriptionsFromDestination(String destinationId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listSubscriptionsFromDestinationWithHttpInfo(destinationId, pagination); + public ListSubscriptionsFromDestination200Response listSubscriptionsFromDestination( + String destinationId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listSubscriptionsFromDestinationWithHttpInfo(destinationId, pagination); return localVarResp.getData(); } /** - * List Subscriptions from Destination - * Lists subscriptions for a Destination. - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Subscriptions from Destination Lists subscriptions for a Destination. + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in alpha. (required) * @return ApiResponse<ListSubscriptionsFromDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSubscriptionsFromDestinationWithHttpInfo(String destinationId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listSubscriptionsFromDestinationValidateBeforeCall(destinationId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listSubscriptionsFromDestinationWithHttpInfo( + String destinationId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listSubscriptionsFromDestinationValidateBeforeCall(destinationId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Subscriptions from Destination (asynchronously) - * Lists subscriptions for a Destination. - * @param destinationId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Subscriptions from Destination (asynchronously) Lists subscriptions for a Destination. + * + * @param destinationId (required) + * @param pagination Pagination options. This parameter exists in alpha. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSubscriptionsFromDestinationAsync(String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listSubscriptionsFromDestinationValidateBeforeCall(destinationId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listSubscriptionsFromDestinationAsync( + String destinationId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSubscriptionsFromDestinationValidateBeforeCall( + destinationId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeSubscriptionFromDestination - * @param destinationId (required) - * @param id (required) + * + * @param destinationId (required) + * @param id (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeSubscriptionFromDestinationCall(String destinationId, String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeSubscriptionFromDestinationCall( + String destinationId, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1305,9 +1656,14 @@ public okhttp3.Call removeSubscriptionFromDestinationCall(String destinationId, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + String localVarPath = + "/destinations/{destinationId}/subscriptions/{id}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1323,129 +1679,165 @@ public okhttp3.Call removeSubscriptionFromDestinationCall(String destinationId, localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall(String destinationId, String id, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall( + String destinationId, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling removeSubscriptionFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " removeSubscriptionFromDestination(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { - throw new ApiException("Missing the required parameter 'id' when calling removeSubscriptionFromDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " removeSubscriptionFromDestination(Async)"); } - - okhttp3.Call localVarCall = removeSubscriptionFromDestinationCall(destinationId, id, _callback); + okhttp3.Call localVarCall = + removeSubscriptionFromDestinationCall(destinationId, id, _callback); return localVarCall; - } /** - * Remove Subscription from Destination - * Deletes an existing Destination subscription. - * @param destinationId (required) - * @param id (required) + * Remove Subscription from Destination Deletes an existing Destination subscription. + * + * @param destinationId (required) + * @param id (required) * @return RemoveSubscriptionFromDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestination(String destinationId, String id) throws ApiException { - ApiResponse localVarResp = removeSubscriptionFromDestinationWithHttpInfo(destinationId, id); + public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestination( + String destinationId, String id) throws ApiException { + ApiResponse localVarResp = + removeSubscriptionFromDestinationWithHttpInfo(destinationId, id); return localVarResp.getData(); } /** - * Remove Subscription from Destination - * Deletes an existing Destination subscription. - * @param destinationId (required) - * @param id (required) + * Remove Subscription from Destination Deletes an existing Destination subscription. + * + * @param destinationId (required) + * @param id (required) * @return ApiResponse<RemoveSubscriptionFromDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse removeSubscriptionFromDestinationWithHttpInfo(String destinationId, String id) throws ApiException { - okhttp3.Call localVarCall = removeSubscriptionFromDestinationValidateBeforeCall(destinationId, id, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + removeSubscriptionFromDestinationWithHttpInfo(String destinationId, String id) + throws ApiException { + okhttp3.Call localVarCall = + removeSubscriptionFromDestinationValidateBeforeCall(destinationId, id, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove Subscription from Destination (asynchronously) - * Deletes an existing Destination subscription. - * @param destinationId (required) - * @param id (required) + * Remove Subscription from Destination (asynchronously) Deletes an existing Destination + * subscription. + * + * @param destinationId (required) + * @param id (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeSubscriptionFromDestinationAsync(String destinationId, String id, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = removeSubscriptionFromDestinationValidateBeforeCall(destinationId, id, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call removeSubscriptionFromDestinationAsync( + String destinationId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeSubscriptionFromDestinationValidateBeforeCall(destinationId, id, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateDestination - * @param destinationId (required) - * @param updateDestinationV1Input (required) + * + * @param destinationId (required) + * @param updateDestinationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateDestinationCall(String destinationId, UpdateDestinationV1Input updateDestinationV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateDestinationCall( + String destinationId, + UpdateDestinationV1Input updateDestinationV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1454,8 +1846,11 @@ public okhttp3.Call updateDestinationCall(String destinationId, UpdateDestinatio Object localVarPostBody = updateDestinationV1Input; // create path and map variables - String localVarPath = "/destinations/{destinationId}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())); + String localVarPath = + "/destinations/{destinationId}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1464,7 +1859,10 @@ public okhttp3.Call updateDestinationCall(String destinationId, UpdateDestinatio Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1472,129 +1870,190 @@ public okhttp3.Call updateDestinationCall(String destinationId, UpdateDestinatio } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateDestinationValidateBeforeCall(String destinationId, UpdateDestinationV1Input updateDestinationV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateDestinationValidateBeforeCall( + String destinationId, + UpdateDestinationV1Input updateDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling updateDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " updateDestination(Async)"); } - + // verify the required parameter 'updateDestinationV1Input' is set if (updateDestinationV1Input == null) { - throw new ApiException("Missing the required parameter 'updateDestinationV1Input' when calling updateDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'updateDestinationV1Input' when calling" + + " updateDestination(Async)"); } - - okhttp3.Call localVarCall = updateDestinationCall(destinationId, updateDestinationV1Input, _callback); + okhttp3.Call localVarCall = + updateDestinationCall(destinationId, updateDestinationV1Input, _callback); return localVarCall; - } /** - * Update Destination - * Updates an existing Destination. **Note**: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. When called, this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` - * @param destinationId (required) - * @param updateDestinationV1Input (required) + * Update Destination Updates an existing Destination. **Note**: if you attempt to update + * read-only settings for your destination you'll encounter the following behavior: * If + * only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If + * there's a mix of writable and read-only properties in the payload, the request will be + * accepted, the writable properties will be updated and the read-only properties ignored. When + * called, this endpoint may generate the `Integration Disabled` [Audit + * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` + * + * @param destinationId (required) + * @param updateDestinationV1Input (required) * @return UpdateDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateDestination200Response updateDestination(String destinationId, UpdateDestinationV1Input updateDestinationV1Input) throws ApiException { - ApiResponse localVarResp = updateDestinationWithHttpInfo(destinationId, updateDestinationV1Input); + public UpdateDestination200Response updateDestination( + String destinationId, UpdateDestinationV1Input updateDestinationV1Input) + throws ApiException { + ApiResponse localVarResp = + updateDestinationWithHttpInfo(destinationId, updateDestinationV1Input); return localVarResp.getData(); } /** - * Update Destination - * Updates an existing Destination. **Note**: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. When called, this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` - * @param destinationId (required) - * @param updateDestinationV1Input (required) + * Update Destination Updates an existing Destination. **Note**: if you attempt to update + * read-only settings for your destination you'll encounter the following behavior: * If + * only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If + * there's a mix of writable and read-only properties in the payload, the request will be + * accepted, the writable properties will be updated and the read-only properties ignored. When + * called, this endpoint may generate the `Integration Disabled` [Audit + * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` + * + * @param destinationId (required) + * @param updateDestinationV1Input (required) * @return ApiResponse<UpdateDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateDestinationWithHttpInfo(String destinationId, UpdateDestinationV1Input updateDestinationV1Input) throws ApiException { - okhttp3.Call localVarCall = updateDestinationValidateBeforeCall(destinationId, updateDestinationV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateDestinationWithHttpInfo( + String destinationId, UpdateDestinationV1Input updateDestinationV1Input) + throws ApiException { + okhttp3.Call localVarCall = + updateDestinationValidateBeforeCall(destinationId, updateDestinationV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Destination (asynchronously) - * Updates an existing Destination. **Note**: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. When called, this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` - * @param destinationId (required) - * @param updateDestinationV1Input (required) + * Update Destination (asynchronously) Updates an existing Destination. **Note**: if you attempt + * to update read-only settings for your destination you'll encounter the following + * behavior: * If only read-only properties are being updated, the endpoint will return an HTTP + * 400 error. * If there's a mix of writable and read-only properties in the payload, the + * request will be accepted, the writable properties will be updated and the read-only + * properties ignored. When called, this endpoint may generate the `Integration + * Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - + * `updateMask` + * + * @param destinationId (required) + * @param updateDestinationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateDestinationAsync(String destinationId, UpdateDestinationV1Input updateDestinationV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateDestinationValidateBeforeCall(destinationId, updateDestinationV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateDestinationAsync( + String destinationId, + UpdateDestinationV1Input updateDestinationV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateDestinationValidateBeforeCall( + destinationId, updateDestinationV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateSubscriptionForDestination - * @param destinationId (required) - * @param id (required) - * @param updateSubscriptionForDestinationAlphaInput (required) + * + * @param destinationId (required) + * @param id (required) + * @param updateSubscriptionForDestinationAlphaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSubscriptionForDestinationCall(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSubscriptionForDestinationCall( + String destinationId, + String id, + UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1603,9 +2062,14 @@ public okhttp3.Call updateSubscriptionForDestinationCall(String destinationId, S Object localVarPostBody = updateSubscriptionForDestinationAlphaInput; // create path and map variables - String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" - .replaceAll("\\{" + "destinationId" + "\\}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); + String localVarPath = + "/destinations/{destinationId}/subscriptions/{id}" + .replaceAll( + "\\{" + "destinationId" + "\\}", + localVarApiClient.escapeString(destinationId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1621,109 +2085,157 @@ public okhttp3.Call updateSubscriptionForDestinationCall(String destinationId, S localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall( + String destinationId, + String id, + UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'destinationId' is set if (destinationId == null) { - throw new ApiException("Missing the required parameter 'destinationId' when calling updateSubscriptionForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'destinationId' when calling" + + " updateSubscriptionForDestination(Async)"); } - + // verify the required parameter 'id' is set if (id == null) { - throw new ApiException("Missing the required parameter 'id' when calling updateSubscriptionForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " updateSubscriptionForDestination(Async)"); } - + // verify the required parameter 'updateSubscriptionForDestinationAlphaInput' is set if (updateSubscriptionForDestinationAlphaInput == null) { - throw new ApiException("Missing the required parameter 'updateSubscriptionForDestinationAlphaInput' when calling updateSubscriptionForDestination(Async)"); + throw new ApiException( + "Missing the required parameter 'updateSubscriptionForDestinationAlphaInput'" + + " when calling updateSubscriptionForDestination(Async)"); } - - okhttp3.Call localVarCall = updateSubscriptionForDestinationCall(destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); + okhttp3.Call localVarCall = + updateSubscriptionForDestinationCall( + destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); return localVarCall; - } /** - * Update Subscription for Destination - * Updates an existing Destination subscription. - * @param destinationId (required) - * @param id (required) - * @param updateSubscriptionForDestinationAlphaInput (required) + * Update Subscription for Destination Updates an existing Destination subscription. + * + * @param destinationId (required) + * @param id (required) + * @param updateSubscriptionForDestinationAlphaInput (required) * @return UpdateSubscriptionForDestination200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateSubscriptionForDestination200Response updateSubscriptionForDestination(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput) throws ApiException { - ApiResponse localVarResp = updateSubscriptionForDestinationWithHttpInfo(destinationId, id, updateSubscriptionForDestinationAlphaInput); + public UpdateSubscriptionForDestination200Response updateSubscriptionForDestination( + String destinationId, + String id, + UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateSubscriptionForDestinationWithHttpInfo( + destinationId, id, updateSubscriptionForDestinationAlphaInput); return localVarResp.getData(); } /** - * Update Subscription for Destination - * Updates an existing Destination subscription. - * @param destinationId (required) - * @param id (required) - * @param updateSubscriptionForDestinationAlphaInput (required) + * Update Subscription for Destination Updates an existing Destination subscription. + * + * @param destinationId (required) + * @param id (required) + * @param updateSubscriptionForDestinationAlphaInput (required) * @return ApiResponse<UpdateSubscriptionForDestination200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateSubscriptionForDestinationWithHttpInfo(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput) throws ApiException { - okhttp3.Call localVarCall = updateSubscriptionForDestinationValidateBeforeCall(destinationId, id, updateSubscriptionForDestinationAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + updateSubscriptionForDestinationWithHttpInfo( + String destinationId, + String id, + UpdateSubscriptionForDestinationAlphaInput + updateSubscriptionForDestinationAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateSubscriptionForDestinationValidateBeforeCall( + destinationId, id, updateSubscriptionForDestinationAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Subscription for Destination (asynchronously) - * Updates an existing Destination subscription. - * @param destinationId (required) - * @param id (required) - * @param updateSubscriptionForDestinationAlphaInput (required) + * Update Subscription for Destination (asynchronously) Updates an existing Destination + * subscription. + * + * @param destinationId (required) + * @param id (required) + * @param updateSubscriptionForDestinationAlphaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSubscriptionForDestinationAsync(String destinationId, String id, UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSubscriptionForDestinationValidateBeforeCall(destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateSubscriptionForDestinationAsync( + String destinationId, + String id, + UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSubscriptionForDestinationValidateBeforeCall( + destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index d3eaf43c..330e2267 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,36 +10,26 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateEdgeFunctions200Response; import com.segment.publicapi.models.CreateEdgeFunctionsAlphaInput; import com.segment.publicapi.models.DisableEdgeFunctions200Response; import com.segment.publicapi.models.GenerateUploadURLForEdgeFunctions200Response; import com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class EdgeFunctionsApi { private ApiClient localVarApiClient; @@ -80,29 +70,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createEdgeFunctions - * @param sourceId (required) - * @param createEdgeFunctionsAlphaInput (required) + * + * @param sourceId (required) + * @param createEdgeFunctionsAlphaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createEdgeFunctionsCall(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createEdgeFunctionsCall( + String sourceId, + CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -111,8 +106,11 @@ public okhttp3.Call createEdgeFunctionsCall(String sourceId, CreateEdgeFunctions Object localVarPostBody = createEdgeFunctionsAlphaInput; // create path and map variables - String localVarPath = "/sources/{sourceId}/edge-functions" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/edge-functions" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -128,128 +126,172 @@ public okhttp3.Call createEdgeFunctionsCall(String sourceId, CreateEdgeFunctions localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createEdgeFunctionsValidateBeforeCall(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createEdgeFunctionsValidateBeforeCall( + String sourceId, + CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling createEdgeFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " createEdgeFunctions(Async)"); } - + // verify the required parameter 'createEdgeFunctionsAlphaInput' is set if (createEdgeFunctionsAlphaInput == null) { - throw new ApiException("Missing the required parameter 'createEdgeFunctionsAlphaInput' when calling createEdgeFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'createEdgeFunctionsAlphaInput' when calling" + + " createEdgeFunctions(Async)"); } - - okhttp3.Call localVarCall = createEdgeFunctionsCall(sourceId, createEdgeFunctionsAlphaInput, _callback); + okhttp3.Call localVarCall = + createEdgeFunctionsCall(sourceId, createEdgeFunctionsAlphaInput, _callback); return localVarCall; - } /** - * Create Edge Functions - * Create EdgeFunctions for your Source, given a valid upload URL for an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) - * @param createEdgeFunctionsAlphaInput (required) + * Create Edge Functions Create EdgeFunctions for your Source, given a valid upload URL for an + * Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified + * Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param sourceId (required) + * @param createEdgeFunctionsAlphaInput (required) * @return CreateEdgeFunctions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateEdgeFunctions200Response createEdgeFunctions(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput) throws ApiException { - ApiResponse localVarResp = createEdgeFunctionsWithHttpInfo(sourceId, createEdgeFunctionsAlphaInput); + public CreateEdgeFunctions200Response createEdgeFunctions( + String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createEdgeFunctionsWithHttpInfo(sourceId, createEdgeFunctionsAlphaInput); return localVarResp.getData(); } /** - * Create Edge Functions - * Create EdgeFunctions for your Source, given a valid upload URL for an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) - * @param createEdgeFunctionsAlphaInput (required) + * Create Edge Functions Create EdgeFunctions for your Source, given a valid upload URL for an + * Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified + * Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param sourceId (required) + * @param createEdgeFunctionsAlphaInput (required) * @return ApiResponse<CreateEdgeFunctions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createEdgeFunctionsWithHttpInfo(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput) throws ApiException { - okhttp3.Call localVarCall = createEdgeFunctionsValidateBeforeCall(sourceId, createEdgeFunctionsAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createEdgeFunctionsWithHttpInfo( + String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createEdgeFunctionsValidateBeforeCall( + sourceId, createEdgeFunctionsAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Edge Functions (asynchronously) - * Create EdgeFunctions for your Source, given a valid upload URL for an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) - * @param createEdgeFunctionsAlphaInput (required) + * Create Edge Functions (asynchronously) Create EdgeFunctions for your Source, given a valid + * upload URL for an Edge Functions bundle. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param sourceId (required) + * @param createEdgeFunctionsAlphaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createEdgeFunctionsAsync(String sourceId, CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createEdgeFunctionsValidateBeforeCall(sourceId, createEdgeFunctionsAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createEdgeFunctionsAsync( + String sourceId, + CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createEdgeFunctionsValidateBeforeCall( + sourceId, createEdgeFunctionsAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for disableEdgeFunctions - * @param sourceId (required) + * + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -258,8 +300,11 @@ public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}/edge-functions/disable" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/edge-functions/disable" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -275,120 +320,149 @@ public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call disableEdgeFunctionsValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call disableEdgeFunctionsValidateBeforeCall( + String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling disableEdgeFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " disableEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = disableEdgeFunctionsCall(sourceId, _callback); return localVarCall; - } /** - * Disable Edge Functions - * Disable Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Disable Edge Functions Disable Edge Functions for your Source. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Edge Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param sourceId (required) * @return DisableEdgeFunctions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public DisableEdgeFunctions200Response disableEdgeFunctions(String sourceId) throws ApiException { - ApiResponse localVarResp = disableEdgeFunctionsWithHttpInfo(sourceId); + public DisableEdgeFunctions200Response disableEdgeFunctions(String sourceId) + throws ApiException { + ApiResponse localVarResp = + disableEdgeFunctionsWithHttpInfo(sourceId); return localVarResp.getData(); } /** - * Disable Edge Functions - * Disable Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Disable Edge Functions Disable Edge Functions for your Source. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Edge Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param sourceId (required) * @return ApiResponse<DisableEdgeFunctions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse disableEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException { + public ApiResponse disableEdgeFunctionsWithHttpInfo( + String sourceId) throws ApiException { okhttp3.Call localVarCall = disableEdgeFunctionsValidateBeforeCall(sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Disable Edge Functions (asynchronously) - * Disable Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Disable Edge Functions (asynchronously) Disable Edge Functions for your Source. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Functions feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call disableEdgeFunctionsAsync(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call disableEdgeFunctionsAsync( + String sourceId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = disableEdgeFunctionsValidateBeforeCall(sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for generateUploadURLForEdgeFunctions - * @param sourceId (required) + * + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call generateUploadURLForEdgeFunctionsCall(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call generateUploadURLForEdgeFunctionsCall( + String sourceId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -397,8 +471,11 @@ public okhttp3.Call generateUploadURLForEdgeFunctionsCall(String sourceId, final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}/edge-functions/upload-url" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/edge-functions/upload-url" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -414,120 +491,156 @@ public okhttp3.Call generateUploadURLForEdgeFunctionsCall(String sourceId, final localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call generateUploadURLForEdgeFunctionsValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call generateUploadURLForEdgeFunctionsValidateBeforeCall( + String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling generateUploadURLForEdgeFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " generateUploadURLForEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsCall(sourceId, _callback); return localVarCall; - } /** - * Generate Upload URL for Edge Functions - * Generate a temporary upload URL, that can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Generate Upload URL for Edge Functions Generate a temporary upload URL, that can be used to + * upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Edge Functions feature enabled. Please reach out to + * your customer success manager for more information. + * + * @param sourceId (required) * @return GenerateUploadURLForEdgeFunctions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunctions(String sourceId) throws ApiException { - ApiResponse localVarResp = generateUploadURLForEdgeFunctionsWithHttpInfo(sourceId); + public GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunctions( + String sourceId) throws ApiException { + ApiResponse localVarResp = + generateUploadURLForEdgeFunctionsWithHttpInfo(sourceId); return localVarResp.getData(); } /** - * Generate Upload URL for Edge Functions - * Generate a temporary upload URL, that can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Generate Upload URL for Edge Functions Generate a temporary upload URL, that can be used to + * upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Edge Functions feature enabled. Please reach out to + * your customer success manager for more information. + * + * @param sourceId (required) * @return ApiResponse<GenerateUploadURLForEdgeFunctions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse generateUploadURLForEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException { - okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsValidateBeforeCall(sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + generateUploadURLForEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException { + okhttp3.Call localVarCall = + generateUploadURLForEdgeFunctionsValidateBeforeCall(sourceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Generate Upload URL for Edge Functions (asynchronously) - * Generate a temporary upload URL, that can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Generate Upload URL for Edge Functions (asynchronously) Generate a temporary upload URL, that + * can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call generateUploadURLForEdgeFunctionsAsync(String sourceId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsValidateBeforeCall(sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call generateUploadURLForEdgeFunctionsAsync( + String sourceId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + generateUploadURLForEdgeFunctionsValidateBeforeCall(sourceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getLatestFromEdgeFunctions - * @param sourceId (required) + * + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -536,8 +649,11 @@ public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}/edge-functions/latest" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/edge-functions/latest" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -553,93 +669,125 @@ public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCal localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getLatestFromEdgeFunctionsValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getLatestFromEdgeFunctionsValidateBeforeCall( + String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling getLatestFromEdgeFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " getLatestFromEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = getLatestFromEdgeFunctionsCall(sourceId, _callback); return localVarCall; - } /** - * Get Latest from Edge Functions - * Get the latest Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Get Latest from Edge Functions Get the latest Edge Functions for your Source. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Functions feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param sourceId (required) * @return GetLatestFromEdgeFunctions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions(String sourceId) throws ApiException { - ApiResponse localVarResp = getLatestFromEdgeFunctionsWithHttpInfo(sourceId); + public GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions(String sourceId) + throws ApiException { + ApiResponse localVarResp = + getLatestFromEdgeFunctionsWithHttpInfo(sourceId); return localVarResp.getData(); } /** - * Get Latest from Edge Functions - * Get the latest Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Get Latest from Edge Functions Get the latest Edge Functions for your Source. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Functions feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param sourceId (required) * @return ApiResponse<GetLatestFromEdgeFunctions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getLatestFromEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException { + public ApiResponse + getLatestFromEdgeFunctionsWithHttpInfo(String sourceId) throws ApiException { okhttp3.Call localVarCall = getLatestFromEdgeFunctionsValidateBeforeCall(sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Latest from Edge Functions (asynchronously) - * Get the latest Edge Functions for your Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer success manager for more information. - * @param sourceId (required) + * Get Latest from Edge Functions (asynchronously) Get the latest Edge Functions for your + * Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs + * to have the Edge Functions feature enabled. Please reach out to your customer success manager + * for more information. + * + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getLatestFromEdgeFunctionsAsync(String sourceId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getLatestFromEdgeFunctionsValidateBeforeCall(sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getLatestFromEdgeFunctionsAsync( + String sourceId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getLatestFromEdgeFunctionsValidateBeforeCall(sourceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index d19b9542..2603a05c 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,33 +10,23 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.GetEventsVolumeFromWorkspace200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class EventsApi { private ApiClient localVarApiClient; @@ -77,36 +67,60 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getEventsVolumeFromWorkspace - * @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required) - * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required) - * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required) - * @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional) - * @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional) - * @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional) - * @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional) - * @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional) - * @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional) + * + * @param granularity The size of each bucket in the requested window. This parameter exists in + * v1. (required) + * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the + * requested time frame, inclusive. This parameter exists in v1. (required) + * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested + * time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock + * time to reduce the risk for latency to impact the counts. This parameter exists in v1. + * (required) + * @param groupBy A comma-delimited list of strings that represents the dimensions to group the + * result by. The options are: `eventName`, `eventType` and + * `source`. This parameter exists in v1. (optional) + * @param sourceId A list of strings which filters the results to the given SourceIds. This + * parameter exists in v1. (optional) + * @param eventName A list of strings which filters the results to the given EventNames. This + * parameter exists in v1. (optional) + * @param eventType A list of strings which filters the results to the given EventTypes. This + * parameter exists in v1. (optional) + * @param appVersion A list of strings which filters the results to the given AppVersions. This + * parameter exists in v1. (optional) + * @param pagination Pagination input for event volume by Workspace. This parameter exists in + * v1. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getEventsVolumeFromWorkspaceCall(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getEventsVolumeFromWorkspaceCall( + String granularity, + String startTime, + String endTime, + List groupBy, + List sourceId, + List eventName, + List eventType, + List appVersion, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -124,7 +138,8 @@ public okhttp3.Call getEventsVolumeFromWorkspaceCall(String granularity, String Map localVarFormParams = new HashMap(); if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("granularity", granularity)); } if (startTime != null) { @@ -136,23 +151,28 @@ public okhttp3.Call getEventsVolumeFromWorkspaceCall(String granularity, String } if (groupBy != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "groupBy", groupBy)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "groupBy", groupBy)); } if (sourceId != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "sourceId", sourceId)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "sourceId", sourceId)); } if (eventName != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "eventName", eventName)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "eventName", eventName)); } if (eventType != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "eventType", eventType)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "eventType", eventType)); } if (appVersion != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "appVersion", appVersion)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "appVersion", appVersion)); } if (pagination != null) { @@ -160,134 +180,291 @@ public okhttp3.Call getEventsVolumeFromWorkspaceCall(String granularity, String } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getEventsVolumeFromWorkspaceValidateBeforeCall(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getEventsVolumeFromWorkspaceValidateBeforeCall( + String granularity, + String startTime, + String endTime, + List groupBy, + List sourceId, + List eventName, + List eventType, + List appVersion, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'granularity' is set if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling getEventsVolumeFromWorkspace(Async)"); + throw new ApiException( + "Missing the required parameter 'granularity' when calling" + + " getEventsVolumeFromWorkspace(Async)"); } - + // verify the required parameter 'startTime' is set if (startTime == null) { - throw new ApiException("Missing the required parameter 'startTime' when calling getEventsVolumeFromWorkspace(Async)"); + throw new ApiException( + "Missing the required parameter 'startTime' when calling" + + " getEventsVolumeFromWorkspace(Async)"); } - + // verify the required parameter 'endTime' is set if (endTime == null) { - throw new ApiException("Missing the required parameter 'endTime' when calling getEventsVolumeFromWorkspace(Async)"); + throw new ApiException( + "Missing the required parameter 'endTime' when calling" + + " getEventsVolumeFromWorkspace(Async)"); } - - okhttp3.Call localVarCall = getEventsVolumeFromWorkspaceCall(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination, _callback); + okhttp3.Call localVarCall = + getEventsVolumeFromWorkspaceCall( + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + pagination, + _callback); return localVarCall; - } /** - * Get Events Volume from Workspace - * Enumerates the Workspace event volumes over time in minute increments. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required) - * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required) - * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required) - * @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional) - * @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional) - * @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional) - * @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional) - * @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional) - * @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional) + * Get Events Volume from Workspace Enumerates the Workspace event volumes over time in minute + * increments. The rate limit for this endpoint is 20 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param granularity The size of each bucket in the requested window. This parameter exists in + * v1. (required) + * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the + * requested time frame, inclusive. This parameter exists in v1. (required) + * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested + * time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock + * time to reduce the risk for latency to impact the counts. This parameter exists in v1. + * (required) + * @param groupBy A comma-delimited list of strings that represents the dimensions to group the + * result by. The options are: `eventName`, `eventType` and + * `source`. This parameter exists in v1. (optional) + * @param sourceId A list of strings which filters the results to the given SourceIds. This + * parameter exists in v1. (optional) + * @param eventName A list of strings which filters the results to the given EventNames. This + * parameter exists in v1. (optional) + * @param eventType A list of strings which filters the results to the given EventTypes. This + * parameter exists in v1. (optional) + * @param appVersion A list of strings which filters the results to the given AppVersions. This + * parameter exists in v1. (optional) + * @param pagination Pagination input for event volume by Workspace. This parameter exists in + * v1. (optional) * @return GetEventsVolumeFromWorkspace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getEventsVolumeFromWorkspaceWithHttpInfo(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination); + public GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace( + String granularity, + String startTime, + String endTime, + List groupBy, + List sourceId, + List eventName, + List eventType, + List appVersion, + PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + getEventsVolumeFromWorkspaceWithHttpInfo( + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + pagination); return localVarResp.getData(); } /** - * Get Events Volume from Workspace - * Enumerates the Workspace event volumes over time in minute increments. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required) - * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required) - * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required) - * @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional) - * @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional) - * @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional) - * @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional) - * @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional) - * @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional) + * Get Events Volume from Workspace Enumerates the Workspace event volumes over time in minute + * increments. The rate limit for this endpoint is 20 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param granularity The size of each bucket in the requested window. This parameter exists in + * v1. (required) + * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the + * requested time frame, inclusive. This parameter exists in v1. (required) + * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested + * time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock + * time to reduce the risk for latency to impact the counts. This parameter exists in v1. + * (required) + * @param groupBy A comma-delimited list of strings that represents the dimensions to group the + * result by. The options are: `eventName`, `eventType` and + * `source`. This parameter exists in v1. (optional) + * @param sourceId A list of strings which filters the results to the given SourceIds. This + * parameter exists in v1. (optional) + * @param eventName A list of strings which filters the results to the given EventNames. This + * parameter exists in v1. (optional) + * @param eventType A list of strings which filters the results to the given EventTypes. This + * parameter exists in v1. (optional) + * @param appVersion A list of strings which filters the results to the given AppVersions. This + * parameter exists in v1. (optional) + * @param pagination Pagination input for event volume by Workspace. This parameter exists in + * v1. (optional) * @return ApiResponse<GetEventsVolumeFromWorkspace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getEventsVolumeFromWorkspaceWithHttpInfo(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = getEventsVolumeFromWorkspaceValidateBeforeCall(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + getEventsVolumeFromWorkspaceWithHttpInfo( + String granularity, + String startTime, + String endTime, + List groupBy, + List sourceId, + List eventName, + List eventType, + List appVersion, + PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + getEventsVolumeFromWorkspaceValidateBeforeCall( + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + pagination, + null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Events Volume from Workspace (asynchronously) - * Enumerates the Workspace event volumes over time in minute increments. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param granularity The size of each bucket in the requested window. This parameter exists in alpha. (required) - * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the requested time frame, inclusive. This parameter exists in alpha. (required) - * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock time to reduce the risk for latency to impact the counts. This parameter exists in alpha. (required) - * @param groupBy A comma-delimited list of strings that represents the dimensions to group the result by. The options are: `eventName`, `eventType` and `source`. This parameter exists in alpha. (optional) - * @param sourceId A list of strings which filters the results to the given SourceIds. This parameter exists in alpha. (optional) - * @param eventName A list of strings which filters the results to the given EventNames. This parameter exists in alpha. (optional) - * @param eventType A list of strings which filters the results to the given EventTypes. This parameter exists in alpha. (optional) - * @param appVersion A list of strings which filters the results to the given AppVersions. This parameter exists in alpha. (optional) - * @param pagination Pagination input for event volume by Workspace. This parameter exists in alpha. (optional) + * Get Events Volume from Workspace (asynchronously) Enumerates the Workspace event volumes over + * time in minute increments. The rate limit for this endpoint is 20 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param granularity The size of each bucket in the requested window. This parameter exists in + * v1. (required) + * @param startTime The ISO8601 formatted timestamp that corresponds to the beginning of the + * requested time frame, inclusive. This parameter exists in v1. (required) + * @param endTime The ISO8601 formatted timestamp that corresponds to the end of the requested + * time frame, noninclusive. Segment recommends that you lag queries 1 minute behind clock + * time to reduce the risk for latency to impact the counts. This parameter exists in v1. + * (required) + * @param groupBy A comma-delimited list of strings that represents the dimensions to group the + * result by. The options are: `eventName`, `eventType` and + * `source`. This parameter exists in v1. (optional) + * @param sourceId A list of strings which filters the results to the given SourceIds. This + * parameter exists in v1. (optional) + * @param eventName A list of strings which filters the results to the given EventNames. This + * parameter exists in v1. (optional) + * @param eventType A list of strings which filters the results to the given EventTypes. This + * parameter exists in v1. (optional) + * @param appVersion A list of strings which filters the results to the given AppVersions. This + * parameter exists in v1. (optional) + * @param pagination Pagination input for event volume by Workspace. This parameter exists in + * v1. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getEventsVolumeFromWorkspaceAsync(String granularity, String startTime, String endTime, List groupBy, List sourceId, List eventName, List eventType, List appVersion, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getEventsVolumeFromWorkspaceValidateBeforeCall(granularity, startTime, endTime, groupBy, sourceId, eventName, eventType, appVersion, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getEventsVolumeFromWorkspaceAsync( + String granularity, + String startTime, + String endTime, + List groupBy, + List sourceId, + List eventName, + List eventType, + List appVersion, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getEventsVolumeFromWorkspaceValidateBeforeCall( + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + pagination, + _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 0323f5b9..296f31d3 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateFunction200Response; import com.segment.publicapi.models.CreateFunctionDeployment200Response; import com.segment.publicapi.models.CreateFunctionV1Input; @@ -34,16 +27,13 @@ import com.segment.publicapi.models.GetFunction200Response; import com.segment.publicapi.models.ListFunctions200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class FunctionsApi { private ApiClient localVarApiClient; @@ -84,28 +74,31 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createFunction - * @param createFunctionV1Input (required) + * + * @param createFunctionV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createFunctionCall(CreateFunctionV1Input createFunctionV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createFunctionCall( + CreateFunctionV1Input createFunctionV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -123,7 +116,10 @@ public okhttp3.Call createFunctionCall(CreateFunctionV1Input createFunctionV1Inp Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -131,119 +127,153 @@ public okhttp3.Call createFunctionCall(CreateFunctionV1Input createFunctionV1Inp } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createFunctionValidateBeforeCall(CreateFunctionV1Input createFunctionV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createFunctionValidateBeforeCall( + CreateFunctionV1Input createFunctionV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createFunctionV1Input' is set if (createFunctionV1Input == null) { - throw new ApiException("Missing the required parameter 'createFunctionV1Input' when calling createFunction(Async)"); + throw new ApiException( + "Missing the required parameter 'createFunctionV1Input' when calling" + + " createFunction(Async)"); } - okhttp3.Call localVarCall = createFunctionCall(createFunctionV1Input, _callback); return localVarCall; - } /** - * Create Function - * Creates a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param createFunctionV1Input (required) + * Create Function Creates a Function. **Note**: In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param createFunctionV1Input (required) * @return CreateFunction200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateFunction200Response createFunction(CreateFunctionV1Input createFunctionV1Input) throws ApiException { - ApiResponse localVarResp = createFunctionWithHttpInfo(createFunctionV1Input); + public CreateFunction200Response createFunction(CreateFunctionV1Input createFunctionV1Input) + throws ApiException { + ApiResponse localVarResp = + createFunctionWithHttpInfo(createFunctionV1Input); return localVarResp.getData(); } /** - * Create Function - * Creates a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param createFunctionV1Input (required) + * Create Function Creates a Function. **Note**: In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param createFunctionV1Input (required) * @return ApiResponse<CreateFunction200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createFunctionWithHttpInfo(CreateFunctionV1Input createFunctionV1Input) throws ApiException { + public ApiResponse createFunctionWithHttpInfo( + CreateFunctionV1Input createFunctionV1Input) throws ApiException { okhttp3.Call localVarCall = createFunctionValidateBeforeCall(createFunctionV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Function (asynchronously) - * Creates a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param createFunctionV1Input (required) + * Create Function (asynchronously) Creates a Function. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param createFunctionV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createFunctionAsync(CreateFunctionV1Input createFunctionV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createFunctionValidateBeforeCall(createFunctionV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createFunctionAsync( + CreateFunctionV1Input createFunctionV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createFunctionValidateBeforeCall(createFunctionV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createFunctionDeployment - * @param functionId (required) + * + * @param functionId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -252,8 +282,11 @@ public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/functions/{functionId}/deploy" - .replaceAll("\\{" + "functionId" + "\\}", localVarApiClient.escapeString(functionId.toString())); + String localVarPath = + "/functions/{functionId}/deploy" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -262,127 +295,162 @@ public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCal Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createFunctionDeploymentValidateBeforeCall(String functionId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createFunctionDeploymentValidateBeforeCall( + String functionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling createFunctionDeployment(Async)"); + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " createFunctionDeployment(Async)"); } - okhttp3.Call localVarCall = createFunctionDeploymentCall(functionId, _callback); return localVarCall; - } /** - * Create Function Deployment - * Deploys a Function. Only applicable to Source Function instances. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Create Function Deployment Deploys a Function. Only applicable to Source Function instances. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Functions feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param functionId (required) * @return CreateFunctionDeployment200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateFunctionDeployment200Response createFunctionDeployment(String functionId) throws ApiException { - ApiResponse localVarResp = createFunctionDeploymentWithHttpInfo(functionId); + public CreateFunctionDeployment200Response createFunctionDeployment(String functionId) + throws ApiException { + ApiResponse localVarResp = + createFunctionDeploymentWithHttpInfo(functionId); return localVarResp.getData(); } /** - * Create Function Deployment - * Deploys a Function. Only applicable to Source Function instances. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Create Function Deployment Deploys a Function. Only applicable to Source Function instances. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Functions feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param functionId (required) * @return ApiResponse<CreateFunctionDeployment200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createFunctionDeploymentWithHttpInfo(String functionId) throws ApiException { + public ApiResponse createFunctionDeploymentWithHttpInfo( + String functionId) throws ApiException { okhttp3.Call localVarCall = createFunctionDeploymentValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Function Deployment (asynchronously) - * Deploys a Function. Only applicable to Source Function instances. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Create Function Deployment (asynchronously) Deploys a Function. Only applicable to Source + * Function instances. **Note**: In order to successfully call this endpoint, the specified + * Workspace needs to have the Functions feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param functionId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createFunctionDeploymentAsync(String functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createFunctionDeploymentAsync( + String functionId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = createFunctionDeploymentValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = + createFunctionDeploymentValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteFunction - * @param functionId (required) + * + * @param functionId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -391,8 +459,11 @@ public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _cal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/functions/{functionId}" - .replaceAll("\\{" + "functionId" + "\\}", localVarApiClient.escapeString(functionId.toString())); + String localVarPath = + "/functions/{functionId}" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -401,127 +472,157 @@ public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _cal Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteFunctionValidateBeforeCall(String functionId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteFunctionValidateBeforeCall( + String functionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling deleteFunction(Async)"); + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " deleteFunction(Async)"); } - okhttp3.Call localVarCall = deleteFunctionCall(functionId, _callback); return localVarCall; - } /** - * Delete Function - * Deletes a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Delete Function Deletes a Function. **Note**: In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param functionId (required) * @return DeleteFunction200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteFunction200Response deleteFunction(String functionId) throws ApiException { - ApiResponse localVarResp = deleteFunctionWithHttpInfo(functionId); + ApiResponse localVarResp = + deleteFunctionWithHttpInfo(functionId); return localVarResp.getData(); } /** - * Delete Function - * Deletes a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Delete Function Deletes a Function. **Note**: In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param functionId (required) * @return ApiResponse<DeleteFunction200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteFunctionWithHttpInfo(String functionId) throws ApiException { + public ApiResponse deleteFunctionWithHttpInfo(String functionId) + throws ApiException { okhttp3.Call localVarCall = deleteFunctionValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Function (asynchronously) - * Deletes a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Delete Function (asynchronously) Deletes a Function. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param functionId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteFunctionAsync(String functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteFunctionAsync( + String functionId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteFunctionValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getFunction - * @param functionId (required) + * + * @param functionId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -530,8 +631,11 @@ public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callba Object localVarPostBody = null; // create path and map variables - String localVarPath = "/functions/{functionId}" - .replaceAll("\\{" + "functionId" + "\\}", localVarApiClient.escapeString(functionId.toString())); + String localVarPath = + "/functions/{functionId}" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -540,53 +644,70 @@ public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callba Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getFunctionValidateBeforeCall(String functionId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getFunctionValidateBeforeCall( + String functionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling getFunction(Async)"); + throw new ApiException( + "Missing the required parameter 'functionId' when calling getFunction(Async)"); } - okhttp3.Call localVarCall = getFunctionCall(functionId, _callback); return localVarCall; - } /** - * Get Function - * Gets a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Get Function Gets a Function. **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param functionId (required) * @return GetFunction200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetFunction200Response getFunction(String functionId) throws ApiException { ApiResponse localVarResp = getFunctionWithHttpInfo(functionId); @@ -594,74 +715,87 @@ public GetFunction200Response getFunction(String functionId) throws ApiException } /** - * Get Function - * Gets a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Get Function Gets a Function. **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param functionId (required) * @return ApiResponse<GetFunction200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getFunctionWithHttpInfo(String functionId) throws ApiException { + public ApiResponse getFunctionWithHttpInfo(String functionId) + throws ApiException { okhttp3.Call localVarCall = getFunctionValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Function (asynchronously) - * Gets a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param functionId (required) + * Get Function (asynchronously) Gets a Function. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param functionId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getFunctionAsync(String functionId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getFunctionAsync( + String functionId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getFunctionValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listFunctions - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This parameter exists in alpha. (required) + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listFunctionsCall(PaginationInput pagination, String resourceType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listFunctionsCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -683,140 +817,184 @@ public okhttp3.Call listFunctionsCall(PaginationInput pagination, String resourc } if (resourceType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("resourceType", resourceType)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("resourceType", resourceType)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionsValidateBeforeCall(PaginationInput pagination, String resourceType, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listFunctionsValidateBeforeCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listFunctions(Async)"); } - + // verify the required parameter 'resourceType' is set if (resourceType == null) { - throw new ApiException("Missing the required parameter 'resourceType' when calling listFunctions(Async)"); + throw new ApiException( + "Missing the required parameter 'resourceType' when calling" + + " listFunctions(Async)"); } - okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); return localVarCall; - } /** - * List Functions - * Lists all Functions in a Workspace. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This parameter exists in alpha. (required) + * List Functions Lists all Functions in a Workspace. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @return ListFunctions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) throws ApiException { - ApiResponse localVarResp = listFunctionsWithHttpInfo(pagination, resourceType); + public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) + throws ApiException { + ApiResponse localVarResp = + listFunctionsWithHttpInfo(pagination, resourceType); return localVarResp.getData(); } /** - * List Functions - * Lists all Functions in a Workspace. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This parameter exists in alpha. (required) + * List Functions Lists all Functions in a Workspace. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @return ApiResponse<ListFunctions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listFunctionsWithHttpInfo(PaginationInput pagination, String resourceType) throws ApiException { + public ApiResponse listFunctionsWithHttpInfo( + PaginationInput pagination, String resourceType) throws ApiException { okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Functions (asynchronously) - * Lists all Functions in a Workspace. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This parameter exists in alpha. (required) + * List Functions (asynchronously) Lists all Functions in a Workspace. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listFunctionsAsync(PaginationInput pagination, String resourceType, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listFunctionsAsync( + PaginationInput pagination, + String resourceType, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFunctionsValidateBeforeCall(pagination, resourceType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateFunction - * @param functionId (required) - * @param updateFunctionV1Input (required) + * + * @param functionId (required) + * @param updateFunctionV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateFunctionCall(String functionId, UpdateFunctionV1Input updateFunctionV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateFunctionCall( + String functionId, + UpdateFunctionV1Input updateFunctionV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -825,8 +1003,11 @@ public okhttp3.Call updateFunctionCall(String functionId, UpdateFunctionV1Input Object localVarPostBody = updateFunctionV1Input; // create path and map variables - String localVarPath = "/functions/{functionId}" - .replaceAll("\\{" + "functionId" + "\\}", localVarApiClient.escapeString(functionId.toString())); + String localVarPath = + "/functions/{functionId}" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -835,7 +1016,10 @@ public okhttp3.Call updateFunctionCall(String functionId, UpdateFunctionV1Input Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -843,100 +1027,142 @@ public okhttp3.Call updateFunctionCall(String functionId, UpdateFunctionV1Input } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateFunctionValidateBeforeCall(String functionId, UpdateFunctionV1Input updateFunctionV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateFunctionValidateBeforeCall( + String functionId, + UpdateFunctionV1Input updateFunctionV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'functionId' is set if (functionId == null) { - throw new ApiException("Missing the required parameter 'functionId' when calling updateFunction(Async)"); + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " updateFunction(Async)"); } - + // verify the required parameter 'updateFunctionV1Input' is set if (updateFunctionV1Input == null) { - throw new ApiException("Missing the required parameter 'updateFunctionV1Input' when calling updateFunction(Async)"); + throw new ApiException( + "Missing the required parameter 'updateFunctionV1Input' when calling" + + " updateFunction(Async)"); } - - okhttp3.Call localVarCall = updateFunctionCall(functionId, updateFunctionV1Input, _callback); + okhttp3.Call localVarCall = + updateFunctionCall(functionId, updateFunctionV1Input, _callback); return localVarCall; - } /** - * Update Function - * Updates a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. Config API omitted fields: - `updateMask` - * @param functionId (required) - * @param updateFunctionV1Input (required) + * Update Function Updates a Function. **Note**: In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. Config API omitted fields: - + * `updateMask` + * + * @param functionId (required) + * @param updateFunctionV1Input (required) * @return UpdateFunction200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateFunction200Response updateFunction(String functionId, UpdateFunctionV1Input updateFunctionV1Input) throws ApiException { - ApiResponse localVarResp = updateFunctionWithHttpInfo(functionId, updateFunctionV1Input); + public UpdateFunction200Response updateFunction( + String functionId, UpdateFunctionV1Input updateFunctionV1Input) throws ApiException { + ApiResponse localVarResp = + updateFunctionWithHttpInfo(functionId, updateFunctionV1Input); return localVarResp.getData(); } /** - * Update Function - * Updates a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. Config API omitted fields: - `updateMask` - * @param functionId (required) - * @param updateFunctionV1Input (required) + * Update Function Updates a Function. **Note**: In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. Config API omitted fields: - + * `updateMask` + * + * @param functionId (required) + * @param updateFunctionV1Input (required) * @return ApiResponse<UpdateFunction200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateFunctionWithHttpInfo(String functionId, UpdateFunctionV1Input updateFunctionV1Input) throws ApiException { - okhttp3.Call localVarCall = updateFunctionValidateBeforeCall(functionId, updateFunctionV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateFunctionWithHttpInfo( + String functionId, UpdateFunctionV1Input updateFunctionV1Input) throws ApiException { + okhttp3.Call localVarCall = + updateFunctionValidateBeforeCall(functionId, updateFunctionV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Function (asynchronously) - * Updates a Function. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach out to your customer success manager for more information. Config API omitted fields: - `updateMask` - * @param functionId (required) - * @param updateFunctionV1Input (required) + * Update Function (asynchronously) Updates a Function. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please + * reach out to your customer success manager for more information. Config API omitted fields: - + * `updateMask` + * + * @param functionId (required) + * @param updateFunctionV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateFunctionAsync(String functionId, UpdateFunctionV1Input updateFunctionV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateFunctionValidateBeforeCall(functionId, updateFunctionV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateFunctionAsync( + String functionId, + UpdateFunctionV1Input updateFunctionV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateFunctionValidateBeforeCall(functionId, updateFunctionV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index ec08ca90..1d91f5f7 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.AddPermissionsToUserGroup200Response; import com.segment.publicapi.models.AddPermissionsToUserGroupV1Input; import com.segment.publicapi.models.AddUsersToUserGroup200Response; @@ -44,16 +37,13 @@ import com.segment.publicapi.models.ReplacePermissionsForUserGroupV1Input; import com.segment.publicapi.models.ReplaceUsersInUserGroup200Response; import com.segment.publicapi.models.ReplaceUsersInUserGroupV1Input; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateUserGroup200Response; import com.segment.publicapi.models.UpdateUserGroupV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class IamGroupsApi { private ApiClient localVarApiClient; @@ -94,29 +84,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addPermissionsToUserGroup - * @param userGroupId (required) - * @param addPermissionsToUserGroupV1Input (required) + * + * @param userGroupId (required) + * @param addPermissionsToUserGroupV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addPermissionsToUserGroupCall(String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addPermissionsToUserGroupCall( + String userGroupId, + AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -125,8 +120,11 @@ public okhttp3.Call addPermissionsToUserGroupCall(String userGroupId, AddPermiss Object localVarPostBody = addPermissionsToUserGroupV1Input; // create path and map variables - String localVarPath = "/groups/{userGroupId}/permissions" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}/permissions" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -135,7 +133,10 @@ public okhttp3.Call addPermissionsToUserGroupCall(String userGroupId, AddPermiss Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -143,128 +144,190 @@ public okhttp3.Call addPermissionsToUserGroupCall(String userGroupId, AddPermiss } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addPermissionsToUserGroupValidateBeforeCall(String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call addPermissionsToUserGroupValidateBeforeCall( + String userGroupId, + AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling addPermissionsToUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " addPermissionsToUserGroup(Async)"); } - + // verify the required parameter 'addPermissionsToUserGroupV1Input' is set if (addPermissionsToUserGroupV1Input == null) { - throw new ApiException("Missing the required parameter 'addPermissionsToUserGroupV1Input' when calling addPermissionsToUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'addPermissionsToUserGroupV1Input' when calling" + + " addPermissionsToUserGroup(Async)"); } - - okhttp3.Call localVarCall = addPermissionsToUserGroupCall(userGroupId, addPermissionsToUserGroupV1Input, _callback); + okhttp3.Call localVarCall = + addPermissionsToUserGroupCall( + userGroupId, addPermissionsToUserGroupV1Input, _callback); return localVarCall; - } /** - * Add Permissions to User Group - * Adds a list of access permissions to a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param addPermissionsToUserGroupV1Input (required) + * Add Permissions to User Group Adds a list of access permissions to a user group. When called, + * this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) + * events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param addPermissionsToUserGroupV1Input (required) * @return AddPermissionsToUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public AddPermissionsToUserGroup200Response addPermissionsToUserGroup(String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input) throws ApiException { - ApiResponse localVarResp = addPermissionsToUserGroupWithHttpInfo(userGroupId, addPermissionsToUserGroupV1Input); + public AddPermissionsToUserGroup200Response addPermissionsToUserGroup( + String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input) + throws ApiException { + ApiResponse localVarResp = + addPermissionsToUserGroupWithHttpInfo( + userGroupId, addPermissionsToUserGroupV1Input); return localVarResp.getData(); } /** - * Add Permissions to User Group - * Adds a list of access permissions to a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param addPermissionsToUserGroupV1Input (required) + * Add Permissions to User Group Adds a list of access permissions to a user group. When called, + * this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) + * events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param addPermissionsToUserGroupV1Input (required) * @return ApiResponse<AddPermissionsToUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse addPermissionsToUserGroupWithHttpInfo(String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input) throws ApiException { - okhttp3.Call localVarCall = addPermissionsToUserGroupValidateBeforeCall(userGroupId, addPermissionsToUserGroupV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse addPermissionsToUserGroupWithHttpInfo( + String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input) + throws ApiException { + okhttp3.Call localVarCall = + addPermissionsToUserGroupValidateBeforeCall( + userGroupId, addPermissionsToUserGroupV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add Permissions to User Group (asynchronously) - * Adds a list of access permissions to a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param addPermissionsToUserGroupV1Input (required) + * Add Permissions to User Group (asynchronously) Adds a list of access permissions to a user + * group. When called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param userGroupId (required) + * @param addPermissionsToUserGroupV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addPermissionsToUserGroupAsync(String userGroupId, AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addPermissionsToUserGroupValidateBeforeCall(userGroupId, addPermissionsToUserGroupV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call addPermissionsToUserGroupAsync( + String userGroupId, + AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addPermissionsToUserGroupValidateBeforeCall( + userGroupId, addPermissionsToUserGroupV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for addUsersToUserGroup - * @param userGroupId (required) - * @param addUsersToUserGroupV1Input (required) + * + * @param userGroupId (required) + * @param addUsersToUserGroupV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addUsersToUserGroupCall(String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addUsersToUserGroupCall( + String userGroupId, + AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -273,8 +336,11 @@ public okhttp3.Call addUsersToUserGroupCall(String userGroupId, AddUsersToUserGr Object localVarPostBody = addUsersToUserGroupV1Input; // create path and map variables - String localVarPath = "/groups/{userGroupId}/users" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}/users" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -283,7 +349,10 @@ public okhttp3.Call addUsersToUserGroupCall(String userGroupId, AddUsersToUserGr Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -291,127 +360,183 @@ public okhttp3.Call addUsersToUserGroupCall(String userGroupId, AddUsersToUserGr } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addUsersToUserGroupValidateBeforeCall(String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call addUsersToUserGroupValidateBeforeCall( + String userGroupId, + AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling addUsersToUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " addUsersToUserGroup(Async)"); } - + // verify the required parameter 'addUsersToUserGroupV1Input' is set if (addUsersToUserGroupV1Input == null) { - throw new ApiException("Missing the required parameter 'addUsersToUserGroupV1Input' when calling addUsersToUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'addUsersToUserGroupV1Input' when calling" + + " addUsersToUserGroup(Async)"); } - - okhttp3.Call localVarCall = addUsersToUserGroupCall(userGroupId, addUsersToUserGroupV1Input, _callback); + okhttp3.Call localVarCall = + addUsersToUserGroupCall(userGroupId, addUsersToUserGroupV1Input, _callback); return localVarCall; - } /** - * Add Users to User Group - * Adds a list of users or invites to a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param addUsersToUserGroupV1Input (required) + * Add Users to User Group Adds a list of users or invites to a user group. When called, this + * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param addUsersToUserGroupV1Input (required) * @return AddUsersToUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public AddUsersToUserGroup200Response addUsersToUserGroup(String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input) throws ApiException { - ApiResponse localVarResp = addUsersToUserGroupWithHttpInfo(userGroupId, addUsersToUserGroupV1Input); + public AddUsersToUserGroup200Response addUsersToUserGroup( + String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input) + throws ApiException { + ApiResponse localVarResp = + addUsersToUserGroupWithHttpInfo(userGroupId, addUsersToUserGroupV1Input); return localVarResp.getData(); } /** - * Add Users to User Group - * Adds a list of users or invites to a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param addUsersToUserGroupV1Input (required) + * Add Users to User Group Adds a list of users or invites to a user group. When called, this + * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param addUsersToUserGroupV1Input (required) * @return ApiResponse<AddUsersToUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse addUsersToUserGroupWithHttpInfo(String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input) throws ApiException { - okhttp3.Call localVarCall = addUsersToUserGroupValidateBeforeCall(userGroupId, addUsersToUserGroupV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse addUsersToUserGroupWithHttpInfo( + String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input) + throws ApiException { + okhttp3.Call localVarCall = + addUsersToUserGroupValidateBeforeCall( + userGroupId, addUsersToUserGroupV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add Users to User Group (asynchronously) - * Adds a list of users or invites to a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param addUsersToUserGroupV1Input (required) + * Add Users to User Group (asynchronously) Adds a list of users or invites to a user group. + * When called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param addUsersToUserGroupV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addUsersToUserGroupAsync(String userGroupId, AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addUsersToUserGroupValidateBeforeCall(userGroupId, addUsersToUserGroupV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call addUsersToUserGroupAsync( + String userGroupId, + AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addUsersToUserGroupValidateBeforeCall( + userGroupId, addUsersToUserGroupV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createUserGroup - * @param createUserGroupV1Input (required) + * + * @param createUserGroupV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createUserGroupCall(CreateUserGroupV1Input createUserGroupV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUserGroupCall( + CreateUserGroupV1Input createUserGroupV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -429,7 +554,10 @@ public okhttp3.Call createUserGroupCall(CreateUserGroupV1Input createUserGroupV1 Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -437,119 +565,162 @@ public okhttp3.Call createUserGroupCall(CreateUserGroupV1Input createUserGroupV1 } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createUserGroupValidateBeforeCall(CreateUserGroupV1Input createUserGroupV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createUserGroupValidateBeforeCall( + CreateUserGroupV1Input createUserGroupV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createUserGroupV1Input' is set if (createUserGroupV1Input == null) { - throw new ApiException("Missing the required parameter 'createUserGroupV1Input' when calling createUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'createUserGroupV1Input' when calling" + + " createUserGroup(Async)"); } - okhttp3.Call localVarCall = createUserGroupCall(createUserGroupV1Input, _callback); return localVarCall; - } /** - * Create User Group - * Creates a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy Created The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createUserGroupV1Input (required) + * Create User Group Creates a user group. When called, this endpoint may generate one or more + * of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy + * Created The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param createUserGroupV1Input (required) * @return CreateUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateUserGroup200Response createUserGroup(CreateUserGroupV1Input createUserGroupV1Input) throws ApiException { - ApiResponse localVarResp = createUserGroupWithHttpInfo(createUserGroupV1Input); + public CreateUserGroup200Response createUserGroup(CreateUserGroupV1Input createUserGroupV1Input) + throws ApiException { + ApiResponse localVarResp = + createUserGroupWithHttpInfo(createUserGroupV1Input); return localVarResp.getData(); } /** - * Create User Group - * Creates a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy Created The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createUserGroupV1Input (required) + * Create User Group Creates a user group. When called, this endpoint may generate one or more + * of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy + * Created The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param createUserGroupV1Input (required) * @return ApiResponse<CreateUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createUserGroupWithHttpInfo(CreateUserGroupV1Input createUserGroupV1Input) throws ApiException { + public ApiResponse createUserGroupWithHttpInfo( + CreateUserGroupV1Input createUserGroupV1Input) throws ApiException { okhttp3.Call localVarCall = createUserGroupValidateBeforeCall(createUserGroupV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create User Group (asynchronously) - * Creates a user group. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy Created The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createUserGroupV1Input (required) + * Create User Group (asynchronously) Creates a user group. When called, this endpoint may + * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * User Group + * Created * Policy Created The rate limit for this endpoint is 60 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param createUserGroupV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createUserGroupAsync(CreateUserGroupV1Input createUserGroupV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createUserGroupValidateBeforeCall(createUserGroupV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createUserGroupAsync( + CreateUserGroupV1Input createUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createUserGroupValidateBeforeCall(createUserGroupV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteUserGroup - * @param userGroupId (required) + * + * @param userGroupId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -558,8 +729,11 @@ public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _c Object localVarPostBody = null; // create path and map variables - String localVarPath = "/groups/{userGroupId}" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -568,127 +742,166 @@ public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _c Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteUserGroupValidateBeforeCall(String userGroupId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteUserGroupValidateBeforeCall( + String userGroupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling deleteUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " deleteUserGroup(Async)"); } - okhttp3.Call localVarCall = deleteUserGroupCall(userGroupId, _callback); return localVarCall; - } /** - * Delete User Group - * Removes a user group from a Workspace. When called, this endpoint may generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) + * Delete User Group Removes a user group from a Workspace. When called, this endpoint may + * generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) * @return DeleteUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteUserGroup200Response deleteUserGroup(String userGroupId) throws ApiException { - ApiResponse localVarResp = deleteUserGroupWithHttpInfo(userGroupId); + ApiResponse localVarResp = + deleteUserGroupWithHttpInfo(userGroupId); return localVarResp.getData(); } /** - * Delete User Group - * Removes a user group from a Workspace. When called, this endpoint may generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) + * Delete User Group Removes a user group from a Workspace. When called, this endpoint may + * generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) * @return ApiResponse<DeleteUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteUserGroupWithHttpInfo(String userGroupId) throws ApiException { + public ApiResponse deleteUserGroupWithHttpInfo(String userGroupId) + throws ApiException { okhttp3.Call localVarCall = deleteUserGroupValidateBeforeCall(userGroupId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete User Group (asynchronously) - * Removes a user group from a Workspace. When called, this endpoint may generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) + * Delete User Group (asynchronously) Removes a user group from a Workspace. When called, this + * endpoint may generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) + * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteUserGroupAsync(String userGroupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteUserGroupAsync( + String userGroupId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteUserGroupValidateBeforeCall(userGroupId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getUserGroup - * @param userGroupId (required) + * + * @param userGroupId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -697,8 +910,11 @@ public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _call Object localVarPostBody = null; // create path and map variables - String localVarPath = "/groups/{userGroupId}" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -707,53 +923,69 @@ public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _call Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getUserGroupValidateBeforeCall(String userGroupId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getUserGroupValidateBeforeCall( + String userGroupId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling getUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " getUserGroup(Async)"); } - okhttp3.Call localVarCall = getUserGroupCall(userGroupId, _callback); return localVarCall; - } /** - * Get User Group - * Returns a user group. - * @param userGroupId (required) + * Get User Group Returns a user group. + * + * @param userGroupId (required) * @return GetUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetUserGroup200Response getUserGroup(String userGroupId) throws ApiException { ApiResponse localVarResp = getUserGroupWithHttpInfo(userGroupId); @@ -761,74 +993,83 @@ public GetUserGroup200Response getUserGroup(String userGroupId) throws ApiExcept } /** - * Get User Group - * Returns a user group. - * @param userGroupId (required) + * Get User Group Returns a user group. + * + * @param userGroupId (required) * @return ApiResponse<GetUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getUserGroupWithHttpInfo(String userGroupId) throws ApiException { + public ApiResponse getUserGroupWithHttpInfo(String userGroupId) + throws ApiException { okhttp3.Call localVarCall = getUserGroupValidateBeforeCall(userGroupId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get User Group (asynchronously) - * Returns a user group. - * @param userGroupId (required) + * Get User Group (asynchronously) Returns a user group. + * + * @param userGroupId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getUserGroupAsync(String userGroupId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserGroupAsync( + String userGroupId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getUserGroupValidateBeforeCall(userGroupId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listInvitesFromUserGroup - * @param userGroupId (required) - * @param pagination Pagination for invites to the group. This parameter exists in alpha. (required) + * + * @param userGroupId (required) + * @param pagination Pagination for invites to the group. This parameter exists in v1. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listInvitesFromUserGroupCall(String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listInvitesFromUserGroupCall( + String userGroupId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -837,8 +1078,11 @@ public okhttp3.Call listInvitesFromUserGroupCall(String userGroupId, PaginationI Object localVarPostBody = null; // create path and map variables - String localVarPath = "/groups/{userGroupId}/invites" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}/invites" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -851,135 +1095,171 @@ public okhttp3.Call listInvitesFromUserGroupCall(String userGroupId, PaginationI } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listInvitesFromUserGroupValidateBeforeCall(String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listInvitesFromUserGroupValidateBeforeCall( + String userGroupId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling listInvitesFromUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " listInvitesFromUserGroup(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listInvitesFromUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listInvitesFromUserGroup(Async)"); } - - okhttp3.Call localVarCall = listInvitesFromUserGroupCall(userGroupId, pagination, _callback); + okhttp3.Call localVarCall = + listInvitesFromUserGroupCall(userGroupId, pagination, _callback); return localVarCall; - } /** - * List Invites from User Group - * Returns the emails of invitees to a user group. - * @param userGroupId (required) - * @param pagination Pagination for invites to the group. This parameter exists in alpha. (required) + * List Invites from User Group Returns the emails of invitees to a user group. + * + * @param userGroupId (required) + * @param pagination Pagination for invites to the group. This parameter exists in v1. + * (required) * @return ListInvitesFromUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListInvitesFromUserGroup200Response listInvitesFromUserGroup(String userGroupId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listInvitesFromUserGroupWithHttpInfo(userGroupId, pagination); + public ListInvitesFromUserGroup200Response listInvitesFromUserGroup( + String userGroupId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listInvitesFromUserGroupWithHttpInfo(userGroupId, pagination); return localVarResp.getData(); } /** - * List Invites from User Group - * Returns the emails of invitees to a user group. - * @param userGroupId (required) - * @param pagination Pagination for invites to the group. This parameter exists in alpha. (required) + * List Invites from User Group Returns the emails of invitees to a user group. + * + * @param userGroupId (required) + * @param pagination Pagination for invites to the group. This parameter exists in v1. + * (required) * @return ApiResponse<ListInvitesFromUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listInvitesFromUserGroupWithHttpInfo(String userGroupId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listInvitesFromUserGroupValidateBeforeCall(userGroupId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listInvitesFromUserGroupWithHttpInfo( + String userGroupId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listInvitesFromUserGroupValidateBeforeCall(userGroupId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Invites from User Group (asynchronously) - * Returns the emails of invitees to a user group. - * @param userGroupId (required) - * @param pagination Pagination for invites to the group. This parameter exists in alpha. (required) + * List Invites from User Group (asynchronously) Returns the emails of invitees to a user group. + * + * @param userGroupId (required) + * @param pagination Pagination for invites to the group. This parameter exists in v1. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listInvitesFromUserGroupAsync(String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listInvitesFromUserGroupValidateBeforeCall(userGroupId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listInvitesFromUserGroupAsync( + String userGroupId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listInvitesFromUserGroupValidateBeforeCall(userGroupId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listUserGroups - * @param pagination Pagination for user groups. This parameter exists in alpha. (required) + * + * @param pagination Pagination for user groups. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUserGroupsCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listUserGroupsCall(PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1001,128 +1281,154 @@ public okhttp3.Call listUserGroupsCall(PaginationInput pagination, final ApiCall } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listUserGroupsValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listUserGroupsValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listUserGroups(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listUserGroups(Async)"); } - okhttp3.Call localVarCall = listUserGroupsCall(pagination, _callback); return localVarCall; - } /** - * List User Groups - * Returns all user groups. - * @param pagination Pagination for user groups. This parameter exists in alpha. (required) + * List User Groups Returns all user groups. + * + * @param pagination Pagination for user groups. This parameter exists in v1. (required) * @return ListUserGroups200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListUserGroups200Response listUserGroups(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listUserGroupsWithHttpInfo(pagination); + public ListUserGroups200Response listUserGroups(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listUserGroupsWithHttpInfo(pagination); return localVarResp.getData(); } /** - * List User Groups - * Returns all user groups. - * @param pagination Pagination for user groups. This parameter exists in alpha. (required) + * List User Groups Returns all user groups. + * + * @param pagination Pagination for user groups. This parameter exists in v1. (required) * @return ApiResponse<ListUserGroups200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listUserGroupsWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listUserGroupsWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listUserGroupsValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List User Groups (asynchronously) - * Returns all user groups. - * @param pagination Pagination for user groups. This parameter exists in alpha. (required) + * List User Groups (asynchronously) Returns all user groups. + * + * @param pagination Pagination for user groups. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUserGroupsAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listUserGroupsAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listUserGroupsValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listUsersFromUserGroup - * @param userGroupId (required) - * @param pagination Pagination for members of a group. This parameter exists in alpha. (required) + * + * @param userGroupId (required) + * @param pagination Pagination for members of a group. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUsersFromUserGroupCall(String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listUsersFromUserGroupCall( + String userGroupId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1131,8 +1437,11 @@ public okhttp3.Call listUsersFromUserGroupCall(String userGroupId, PaginationInp Object localVarPostBody = null; // create path and map variables - String localVarPath = "/groups/{userGroupId}/users" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}/users" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1145,136 +1454,170 @@ public okhttp3.Call listUsersFromUserGroupCall(String userGroupId, PaginationInp } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listUsersFromUserGroupValidateBeforeCall(String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listUsersFromUserGroupValidateBeforeCall( + String userGroupId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling listUsersFromUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " listUsersFromUserGroup(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listUsersFromUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listUsersFromUserGroup(Async)"); } - okhttp3.Call localVarCall = listUsersFromUserGroupCall(userGroupId, pagination, _callback); return localVarCall; - } /** - * List Users from User Group - * Returns users belonging to a user group. - * @param userGroupId (required) - * @param pagination Pagination for members of a group. This parameter exists in alpha. (required) + * List Users from User Group Returns users belonging to a user group. + * + * @param userGroupId (required) + * @param pagination Pagination for members of a group. This parameter exists in v1. (required) * @return ListUsersFromUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListUsersFromUserGroup200Response listUsersFromUserGroup(String userGroupId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listUsersFromUserGroupWithHttpInfo(userGroupId, pagination); + public ListUsersFromUserGroup200Response listUsersFromUserGroup( + String userGroupId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listUsersFromUserGroupWithHttpInfo(userGroupId, pagination); return localVarResp.getData(); } /** - * List Users from User Group - * Returns users belonging to a user group. - * @param userGroupId (required) - * @param pagination Pagination for members of a group. This parameter exists in alpha. (required) + * List Users from User Group Returns users belonging to a user group. + * + * @param userGroupId (required) + * @param pagination Pagination for members of a group. This parameter exists in v1. (required) * @return ApiResponse<ListUsersFromUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listUsersFromUserGroupWithHttpInfo(String userGroupId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listUsersFromUserGroupValidateBeforeCall(userGroupId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listUsersFromUserGroupWithHttpInfo( + String userGroupId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listUsersFromUserGroupValidateBeforeCall(userGroupId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Users from User Group (asynchronously) - * Returns users belonging to a user group. - * @param userGroupId (required) - * @param pagination Pagination for members of a group. This parameter exists in alpha. (required) + * List Users from User Group (asynchronously) Returns users belonging to a user group. + * + * @param userGroupId (required) + * @param pagination Pagination for members of a group. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUsersFromUserGroupAsync(String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listUsersFromUserGroupValidateBeforeCall(userGroupId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listUsersFromUserGroupAsync( + String userGroupId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listUsersFromUserGroupValidateBeforeCall(userGroupId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeUsersFromUserGroup - * @param userGroupId (required) - * @param emails The list of emails to remove from the user group. This parameter exists in alpha. (required) + * + * @param userGroupId (required) + * @param emails The list of emails to remove from the user group. This parameter exists in v1. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeUsersFromUserGroupCall(String userGroupId, List emails, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeUsersFromUserGroupCall( + String userGroupId, List emails, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1283,8 +1626,11 @@ public okhttp3.Call removeUsersFromUserGroupCall(String userGroupId, List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1293,140 +1639,197 @@ public okhttp3.Call removeUsersFromUserGroupCall(String userGroupId, List localVarFormParams = new HashMap(); if (emails != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "emails", emails)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "emails", emails)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call removeUsersFromUserGroupValidateBeforeCall(String userGroupId, List emails, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call removeUsersFromUserGroupValidateBeforeCall( + String userGroupId, List emails, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling removeUsersFromUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " removeUsersFromUserGroup(Async)"); } - + // verify the required parameter 'emails' is set if (emails == null) { - throw new ApiException("Missing the required parameter 'emails' when calling removeUsersFromUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'emails' when calling" + + " removeUsersFromUserGroup(Async)"); } - okhttp3.Call localVarCall = removeUsersFromUserGroupCall(userGroupId, emails, _callback); return localVarCall; - } /** - * Remove Users from User Group - * Removes one or multiple users or invites from a user group by email. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param emails The list of emails to remove from the user group. This parameter exists in alpha. (required) + * Remove Users from User Group Removes one or multiple users or invites from a user group by + * email. When called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group + * The rate limit for this endpoint is 60 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param emails The list of emails to remove from the user group. This parameter exists in v1. + * (required) * @return RemoveUsersFromUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public RemoveUsersFromUserGroup200Response removeUsersFromUserGroup(String userGroupId, List emails) throws ApiException { - ApiResponse localVarResp = removeUsersFromUserGroupWithHttpInfo(userGroupId, emails); + public RemoveUsersFromUserGroup200Response removeUsersFromUserGroup( + String userGroupId, List emails) throws ApiException { + ApiResponse localVarResp = + removeUsersFromUserGroupWithHttpInfo(userGroupId, emails); return localVarResp.getData(); } /** - * Remove Users from User Group - * Removes one or multiple users or invites from a user group by email. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param emails The list of emails to remove from the user group. This parameter exists in alpha. (required) + * Remove Users from User Group Removes one or multiple users or invites from a user group by + * email. When called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group + * The rate limit for this endpoint is 60 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param emails The list of emails to remove from the user group. This parameter exists in v1. + * (required) * @return ApiResponse<RemoveUsersFromUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse removeUsersFromUserGroupWithHttpInfo(String userGroupId, List emails) throws ApiException { - okhttp3.Call localVarCall = removeUsersFromUserGroupValidateBeforeCall(userGroupId, emails, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse removeUsersFromUserGroupWithHttpInfo( + String userGroupId, List emails) throws ApiException { + okhttp3.Call localVarCall = + removeUsersFromUserGroupValidateBeforeCall(userGroupId, emails, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove Users from User Group (asynchronously) - * Removes one or multiple users or invites from a user group by email. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param emails The list of emails to remove from the user group. This parameter exists in alpha. (required) + * Remove Users from User Group (asynchronously) Removes one or multiple users or invites from a + * user group by email. When called, this endpoint may generate one or more of the following + * [Audit Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User + * Group The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param emails The list of emails to remove from the user group. This parameter exists in v1. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeUsersFromUserGroupAsync(String userGroupId, List emails, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = removeUsersFromUserGroupValidateBeforeCall(userGroupId, emails, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call removeUsersFromUserGroupAsync( + String userGroupId, + List emails, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeUsersFromUserGroupValidateBeforeCall(userGroupId, emails, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replacePermissionsForUserGroup - * @param userGroupId (required) - * @param replacePermissionsForUserGroupV1Input (required) + * + * @param userGroupId (required) + * @param replacePermissionsForUserGroupV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replacePermissionsForUserGroupCall(String userGroupId, ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replacePermissionsForUserGroupCall( + String userGroupId, + ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1435,8 +1838,11 @@ public okhttp3.Call replacePermissionsForUserGroupCall(String userGroupId, Repla Object localVarPostBody = replacePermissionsForUserGroupV1Input; // create path and map variables - String localVarPath = "/groups/{userGroupId}/permissions" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}/permissions" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1445,7 +1851,10 @@ public okhttp3.Call replacePermissionsForUserGroupCall(String userGroupId, Repla Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1453,128 +1862,192 @@ public okhttp3.Call replacePermissionsForUserGroupCall(String userGroupId, Repla } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replacePermissionsForUserGroupValidateBeforeCall(String userGroupId, ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replacePermissionsForUserGroupValidateBeforeCall( + String userGroupId, + ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling replacePermissionsForUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " replacePermissionsForUserGroup(Async)"); } - + // verify the required parameter 'replacePermissionsForUserGroupV1Input' is set if (replacePermissionsForUserGroupV1Input == null) { - throw new ApiException("Missing the required parameter 'replacePermissionsForUserGroupV1Input' when calling replacePermissionsForUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'replacePermissionsForUserGroupV1Input' when" + + " calling replacePermissionsForUserGroup(Async)"); } - - okhttp3.Call localVarCall = replacePermissionsForUserGroupCall(userGroupId, replacePermissionsForUserGroupV1Input, _callback); + okhttp3.Call localVarCall = + replacePermissionsForUserGroupCall( + userGroupId, replacePermissionsForUserGroupV1Input, _callback); return localVarCall; - } /** - * Replace Permissions for User Group - * Updates the list of access permissions for a user group. When called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param replacePermissionsForUserGroupV1Input (required) + * Replace Permissions for User Group Updates the list of access permissions for a user group. + * When called, this endpoint may generate the `Policy Deleted` [Audit + * Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param replacePermissionsForUserGroupV1Input (required) * @return ReplacePermissionsForUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplacePermissionsForUserGroup200Response replacePermissionsForUserGroup(String userGroupId, ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input) throws ApiException { - ApiResponse localVarResp = replacePermissionsForUserGroupWithHttpInfo(userGroupId, replacePermissionsForUserGroupV1Input); + public ReplacePermissionsForUserGroup200Response replacePermissionsForUserGroup( + String userGroupId, + ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input) + throws ApiException { + ApiResponse localVarResp = + replacePermissionsForUserGroupWithHttpInfo( + userGroupId, replacePermissionsForUserGroupV1Input); return localVarResp.getData(); } /** - * Replace Permissions for User Group - * Updates the list of access permissions for a user group. When called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param replacePermissionsForUserGroupV1Input (required) + * Replace Permissions for User Group Updates the list of access permissions for a user group. + * When called, this endpoint may generate the `Policy Deleted` [Audit + * Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param replacePermissionsForUserGroupV1Input (required) * @return ApiResponse<ReplacePermissionsForUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replacePermissionsForUserGroupWithHttpInfo(String userGroupId, ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input) throws ApiException { - okhttp3.Call localVarCall = replacePermissionsForUserGroupValidateBeforeCall(userGroupId, replacePermissionsForUserGroupV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + replacePermissionsForUserGroupWithHttpInfo( + String userGroupId, + ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input) + throws ApiException { + okhttp3.Call localVarCall = + replacePermissionsForUserGroupValidateBeforeCall( + userGroupId, replacePermissionsForUserGroupV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Permissions for User Group (asynchronously) - * Updates the list of access permissions for a user group. When called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param replacePermissionsForUserGroupV1Input (required) + * Replace Permissions for User Group (asynchronously) Updates the list of access permissions + * for a user group. When called, this endpoint may generate the `Policy Deleted` + * [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param replacePermissionsForUserGroupV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replacePermissionsForUserGroupAsync(String userGroupId, ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replacePermissionsForUserGroupValidateBeforeCall(userGroupId, replacePermissionsForUserGroupV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replacePermissionsForUserGroupAsync( + String userGroupId, + ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replacePermissionsForUserGroupValidateBeforeCall( + userGroupId, replacePermissionsForUserGroupV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replaceUsersInUserGroup - * @param userGroupId (required) - * @param replaceUsersInUserGroupV1Input (required) + * + * @param userGroupId (required) + * @param replaceUsersInUserGroupV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceUsersInUserGroupCall(String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replaceUsersInUserGroupCall( + String userGroupId, + ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1583,8 +2056,11 @@ public okhttp3.Call replaceUsersInUserGroupCall(String userGroupId, ReplaceUsers Object localVarPostBody = replaceUsersInUserGroupV1Input; // create path and map variables - String localVarPath = "/group/{userGroupId}/users" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/group/{userGroupId}/users" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1593,7 +2069,10 @@ public okhttp3.Call replaceUsersInUserGroupCall(String userGroupId, ReplaceUsers Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1601,128 +2080,188 @@ public okhttp3.Call replaceUsersInUserGroupCall(String userGroupId, ReplaceUsers } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replaceUsersInUserGroupValidateBeforeCall(String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replaceUsersInUserGroupValidateBeforeCall( + String userGroupId, + ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling replaceUsersInUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " replaceUsersInUserGroup(Async)"); } - + // verify the required parameter 'replaceUsersInUserGroupV1Input' is set if (replaceUsersInUserGroupV1Input == null) { - throw new ApiException("Missing the required parameter 'replaceUsersInUserGroupV1Input' when calling replaceUsersInUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'replaceUsersInUserGroupV1Input' when calling" + + " replaceUsersInUserGroup(Async)"); } - - okhttp3.Call localVarCall = replaceUsersInUserGroupCall(userGroupId, replaceUsersInUserGroupV1Input, _callback); + okhttp3.Call localVarCall = + replaceUsersInUserGroupCall(userGroupId, replaceUsersInUserGroupV1Input, _callback); return localVarCall; - } /** - * Replace Users in User Group - * Replaces the members of a user group by email. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param replaceUsersInUserGroupV1Input (required) + * Replace Users in User Group Replaces the members of a user group by email. When called, this + * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param userGroupId (required) + * @param replaceUsersInUserGroupV1Input (required) * @return ReplaceUsersInUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplaceUsersInUserGroup200Response replaceUsersInUserGroup(String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input) throws ApiException { - ApiResponse localVarResp = replaceUsersInUserGroupWithHttpInfo(userGroupId, replaceUsersInUserGroupV1Input); + public ReplaceUsersInUserGroup200Response replaceUsersInUserGroup( + String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input) + throws ApiException { + ApiResponse localVarResp = + replaceUsersInUserGroupWithHttpInfo(userGroupId, replaceUsersInUserGroupV1Input); return localVarResp.getData(); } /** - * Replace Users in User Group - * Replaces the members of a user group by email. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param replaceUsersInUserGroupV1Input (required) + * Replace Users in User Group Replaces the members of a user group by email. When called, this + * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param userGroupId (required) + * @param replaceUsersInUserGroupV1Input (required) * @return ApiResponse<ReplaceUsersInUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replaceUsersInUserGroupWithHttpInfo(String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input) throws ApiException { - okhttp3.Call localVarCall = replaceUsersInUserGroupValidateBeforeCall(userGroupId, replaceUsersInUserGroupV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse replaceUsersInUserGroupWithHttpInfo( + String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input) + throws ApiException { + okhttp3.Call localVarCall = + replaceUsersInUserGroupValidateBeforeCall( + userGroupId, replaceUsersInUserGroupV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Users in User Group (asynchronously) - * Replaces the members of a user group by email. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param replaceUsersInUserGroupV1Input (required) + * Replace Users in User Group (asynchronously) Replaces the members of a user group by email. + * When called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group + * Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param replaceUsersInUserGroupV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceUsersInUserGroupAsync(String userGroupId, ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceUsersInUserGroupValidateBeforeCall(userGroupId, replaceUsersInUserGroupV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replaceUsersInUserGroupAsync( + String userGroupId, + ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replaceUsersInUserGroupValidateBeforeCall( + userGroupId, replaceUsersInUserGroupV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateUserGroup - * @param userGroupId (required) - * @param updateUserGroupV1Input (required) + * + * @param userGroupId (required) + * @param updateUserGroupV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateUserGroupCall(String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUserGroupCall( + String userGroupId, + UpdateUserGroupV1Input updateUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1731,8 +2270,11 @@ public okhttp3.Call updateUserGroupCall(String userGroupId, UpdateUserGroupV1Inp Object localVarPostBody = updateUserGroupV1Input; // create path and map variables - String localVarPath = "/groups/{userGroupId}" - .replaceAll("\\{" + "userGroupId" + "\\}", localVarApiClient.escapeString(userGroupId.toString())); + String localVarPath = + "/groups/{userGroupId}" + .replaceAll( + "\\{" + "userGroupId" + "\\}", + localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1741,7 +2283,10 @@ public okhttp3.Call updateUserGroupCall(String userGroupId, UpdateUserGroupV1Inp Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1749,100 +2294,148 @@ public okhttp3.Call updateUserGroupCall(String userGroupId, UpdateUserGroupV1Inp } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateUserGroupValidateBeforeCall(String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateUserGroupValidateBeforeCall( + String userGroupId, + UpdateUserGroupV1Input updateUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userGroupId' is set if (userGroupId == null) { - throw new ApiException("Missing the required parameter 'userGroupId' when calling updateUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'userGroupId' when calling" + + " updateUserGroup(Async)"); } - + // verify the required parameter 'updateUserGroupV1Input' is set if (updateUserGroupV1Input == null) { - throw new ApiException("Missing the required parameter 'updateUserGroupV1Input' when calling updateUserGroup(Async)"); + throw new ApiException( + "Missing the required parameter 'updateUserGroupV1Input' when calling" + + " updateUserGroup(Async)"); } - - okhttp3.Call localVarCall = updateUserGroupCall(userGroupId, updateUserGroupV1Input, _callback); + okhttp3.Call localVarCall = + updateUserGroupCall(userGroupId, updateUserGroupV1Input, _callback); return localVarCall; - } /** - * Update User Group - * Updates a user group for a Workspace. When called, this endpoint may generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param updateUserGroupV1Input (required) + * Update User Group Updates a user group for a Workspace. When called, this endpoint may + * generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param updateUserGroupV1Input (required) * @return UpdateUserGroup200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateUserGroup200Response updateUserGroup(String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input) throws ApiException { - ApiResponse localVarResp = updateUserGroupWithHttpInfo(userGroupId, updateUserGroupV1Input); + public UpdateUserGroup200Response updateUserGroup( + String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input) throws ApiException { + ApiResponse localVarResp = + updateUserGroupWithHttpInfo(userGroupId, updateUserGroupV1Input); return localVarResp.getData(); } /** - * Update User Group - * Updates a user group for a Workspace. When called, this endpoint may generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param updateUserGroupV1Input (required) + * Update User Group Updates a user group for a Workspace. When called, this endpoint may + * generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param updateUserGroupV1Input (required) * @return ApiResponse<UpdateUserGroup200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateUserGroupWithHttpInfo(String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input) throws ApiException { - okhttp3.Call localVarCall = updateUserGroupValidateBeforeCall(userGroupId, updateUserGroupV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateUserGroupWithHttpInfo( + String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input) throws ApiException { + okhttp3.Call localVarCall = + updateUserGroupValidateBeforeCall(userGroupId, updateUserGroupV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update User Group (asynchronously) - * Updates a user group for a Workspace. When called, this endpoint may generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userGroupId (required) - * @param updateUserGroupV1Input (required) + * Update User Group (asynchronously) Updates a user group for a Workspace. When called, this + * endpoint may generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) + * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userGroupId (required) + * @param updateUserGroupV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateUserGroupAsync(String userGroupId, UpdateUserGroupV1Input updateUserGroupV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateUserGroupValidateBeforeCall(userGroupId, updateUserGroupV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateUserGroupAsync( + String userGroupId, + UpdateUserGroupV1Input updateUserGroupV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateUserGroupValidateBeforeCall(userGroupId, updateUserGroupV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/IamRolesApi.java b/src/main/java/com/segment/publicapi/api/IamRolesApi.java index 26b6ec83..f7ebf845 100644 --- a/src/main/java/com/segment/publicapi/api/IamRolesApi.java +++ b/src/main/java/com/segment/publicapi/api/IamRolesApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,33 +10,23 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.ListRoles200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class IamRolesApi { private ApiClient localVarApiClient; @@ -77,28 +67,30 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for listRoles - * @param pagination Pagination for roles. This parameter exists in alpha. (required) + * + * @param pagination Pagination for roles. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listRolesCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRolesCall(PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -120,53 +112,68 @@ public okhttp3.Call listRolesCall(PaginationInput pagination, final ApiCallback } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listRolesValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listRolesValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listRoles(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling listRoles(Async)"); } - okhttp3.Call localVarCall = listRolesCall(pagination, _callback); return localVarCall; - } /** - * List Roles - * Returns a list of Roles available to apply to permissions for users and/or groups. - * @param pagination Pagination for roles. This parameter exists in alpha. (required) + * List Roles Returns a list of Roles available to apply to permissions for users and/or groups. + * + * @param pagination Pagination for roles. This parameter exists in v1. (required) * @return ListRoles200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ListRoles200Response listRoles(PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listRolesWithHttpInfo(pagination); @@ -174,46 +181,52 @@ public ListRoles200Response listRoles(PaginationInput pagination) throws ApiExce } /** - * List Roles - * Returns a list of Roles available to apply to permissions for users and/or groups. - * @param pagination Pagination for roles. This parameter exists in alpha. (required) + * List Roles Returns a list of Roles available to apply to permissions for users and/or groups. + * + * @param pagination Pagination for roles. This parameter exists in v1. (required) * @return ApiResponse<ListRoles200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listRolesWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listRolesWithHttpInfo(PaginationInput pagination) + throws ApiException { okhttp3.Call localVarCall = listRolesValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Roles (asynchronously) - * Returns a list of Roles available to apply to permissions for users and/or groups. - * @param pagination Pagination for roles. This parameter exists in alpha. (required) + * List Roles (asynchronously) Returns a list of Roles available to apply to permissions for + * users and/or groups. + * + * @param pagination Pagination for roles. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listRolesAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRolesAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listRolesValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 5fae3256..344fe567 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.AddPermissionsToUser200Response; import com.segment.publicapi.models.AddPermissionsToUserV1Input; import com.segment.publicapi.models.CreateInvites200Response; @@ -40,14 +33,11 @@ import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.ReplacePermissionsForUser200Response; import com.segment.publicapi.models.ReplacePermissionsForUserV1Input; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class IamUsersApi { private ApiClient localVarApiClient; @@ -88,29 +78,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addPermissionsToUser - * @param userId (required) - * @param addPermissionsToUserV1Input (required) + * + * @param userId (required) + * @param addPermissionsToUserV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addPermissionsToUserCall(String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addPermissionsToUserCall( + String userId, + AddPermissionsToUserV1Input addPermissionsToUserV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -119,8 +114,11 @@ public okhttp3.Call addPermissionsToUserCall(String userId, AddPermissionsToUser Object localVarPostBody = addPermissionsToUserV1Input; // create path and map variables - String localVarPath = "/users/{userId}/permissions" - .replaceAll("\\{" + "userId" + "\\}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = + "/users/{userId}/permissions" + .replaceAll( + "\\{" + "userId" + "\\}", + localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -129,7 +127,10 @@ public okhttp3.Call addPermissionsToUserCall(String userId, AddPermissionsToUser Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -137,127 +138,182 @@ public okhttp3.Call addPermissionsToUserCall(String userId, AddPermissionsToUser } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addPermissionsToUserValidateBeforeCall(String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call addPermissionsToUserValidateBeforeCall( + String userId, + AddPermissionsToUserV1Input addPermissionsToUserV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userId' is set if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling addPermissionsToUser(Async)"); + throw new ApiException( + "Missing the required parameter 'userId' when calling" + + " addPermissionsToUser(Async)"); } - + // verify the required parameter 'addPermissionsToUserV1Input' is set if (addPermissionsToUserV1Input == null) { - throw new ApiException("Missing the required parameter 'addPermissionsToUserV1Input' when calling addPermissionsToUser(Async)"); + throw new ApiException( + "Missing the required parameter 'addPermissionsToUserV1Input' when calling" + + " addPermissionsToUser(Async)"); } - - okhttp3.Call localVarCall = addPermissionsToUserCall(userId, addPermissionsToUserV1Input, _callback); + okhttp3.Call localVarCall = + addPermissionsToUserCall(userId, addPermissionsToUserV1Input, _callback); return localVarCall; - } /** - * Add Permissions to User - * Adds a list of access permissions to a user. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userId (required) - * @param addPermissionsToUserV1Input (required) + * Add Permissions to User Adds a list of access permissions to a user. When called, this + * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userId (required) + * @param addPermissionsToUserV1Input (required) * @return AddPermissionsToUser200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public AddPermissionsToUser200Response addPermissionsToUser(String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input) throws ApiException { - ApiResponse localVarResp = addPermissionsToUserWithHttpInfo(userId, addPermissionsToUserV1Input); + public AddPermissionsToUser200Response addPermissionsToUser( + String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input) + throws ApiException { + ApiResponse localVarResp = + addPermissionsToUserWithHttpInfo(userId, addPermissionsToUserV1Input); return localVarResp.getData(); } /** - * Add Permissions to User - * Adds a list of access permissions to a user. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userId (required) - * @param addPermissionsToUserV1Input (required) + * Add Permissions to User Adds a list of access permissions to a user. When called, this + * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userId (required) + * @param addPermissionsToUserV1Input (required) * @return ApiResponse<AddPermissionsToUser200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse addPermissionsToUserWithHttpInfo(String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input) throws ApiException { - okhttp3.Call localVarCall = addPermissionsToUserValidateBeforeCall(userId, addPermissionsToUserV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse addPermissionsToUserWithHttpInfo( + String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input) + throws ApiException { + okhttp3.Call localVarCall = + addPermissionsToUserValidateBeforeCall(userId, addPermissionsToUserV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add Permissions to User (asynchronously) - * Adds a list of access permissions to a user. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userId (required) - * @param addPermissionsToUserV1Input (required) + * Add Permissions to User (asynchronously) Adds a list of access permissions to a user. When + * called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for + * this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param userId (required) + * @param addPermissionsToUserV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addPermissionsToUserAsync(String userId, AddPermissionsToUserV1Input addPermissionsToUserV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addPermissionsToUserValidateBeforeCall(userId, addPermissionsToUserV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call addPermissionsToUserAsync( + String userId, + AddPermissionsToUserV1Input addPermissionsToUserV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addPermissionsToUserValidateBeforeCall( + userId, addPermissionsToUserV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createInvites - * @param createInvitesV1Input (required) + * + * @param createInvitesV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createInvitesCall(CreateInvitesV1Input createInvitesV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createInvitesCall( + CreateInvitesV1Input createInvitesV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -275,7 +331,10 @@ public okhttp3.Call createInvitesCall(CreateInvitesV1Input createInvitesV1Input, Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -283,119 +342,167 @@ public okhttp3.Call createInvitesCall(CreateInvitesV1Input createInvitesV1Input, } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createInvitesValidateBeforeCall(CreateInvitesV1Input createInvitesV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createInvitesValidateBeforeCall( + CreateInvitesV1Input createInvitesV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createInvitesV1Input' is set if (createInvitesV1Input == null) { - throw new ApiException("Missing the required parameter 'createInvitesV1Input' when calling createInvites(Async)"); + throw new ApiException( + "Missing the required parameter 'createInvitesV1Input' when calling" + + " createInvites(Async)"); } - okhttp3.Call localVarCall = createInvitesCall(createInvitesV1Input, _callback); return localVarCall; - } /** - * Create Invites - * Invites a list of users to join a Workspace. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API omitted fields: - `parent` The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createInvitesV1Input (required) + * Create Invites Invites a list of users to join a Workspace. When called, this endpoint may + * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment + * User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API + * omitted fields: - `parent` The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param createInvitesV1Input (required) * @return CreateInvites200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateInvites200Response createInvites(CreateInvitesV1Input createInvitesV1Input) throws ApiException { - ApiResponse localVarResp = createInvitesWithHttpInfo(createInvitesV1Input); + public CreateInvites200Response createInvites(CreateInvitesV1Input createInvitesV1Input) + throws ApiException { + ApiResponse localVarResp = + createInvitesWithHttpInfo(createInvitesV1Input); return localVarResp.getData(); } /** - * Create Invites - * Invites a list of users to join a Workspace. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API omitted fields: - `parent` The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createInvitesV1Input (required) + * Create Invites Invites a list of users to join a Workspace. When called, this endpoint may + * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment + * User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API + * omitted fields: - `parent` The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param createInvitesV1Input (required) * @return ApiResponse<CreateInvites200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createInvitesWithHttpInfo(CreateInvitesV1Input createInvitesV1Input) throws ApiException { + public ApiResponse createInvitesWithHttpInfo( + CreateInvitesV1Input createInvitesV1Input) throws ApiException { okhttp3.Call localVarCall = createInvitesValidateBeforeCall(createInvitesV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Invites (asynchronously) - * Invites a list of users to join a Workspace. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API omitted fields: - `parent` The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createInvitesV1Input (required) + * Create Invites (asynchronously) Invites a list of users to join a Workspace. When called, + * this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) + * events: * Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited + * to Workspace Config API omitted fields: - `parent` The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param createInvitesV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createInvitesAsync(CreateInvitesV1Input createInvitesV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createInvitesValidateBeforeCall(createInvitesV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createInvitesAsync( + CreateInvitesV1Input createInvitesV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createInvitesValidateBeforeCall(createInvitesV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteInvites - * @param emails The list of emails to delete invites for. This parameter exists in alpha. (required) + * + * @param emails The list of emails to delete invites for. This parameter exists in v1. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteInvitesCall(List emails, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteInvitesCall(List emails, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -413,57 +520,79 @@ public okhttp3.Call deleteInvitesCall(List emails, final ApiCallback _ca Map localVarFormParams = new HashMap(); if (emails != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "emails", emails)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "emails", emails)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteInvitesValidateBeforeCall(List emails, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteInvitesValidateBeforeCall( + List emails, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emails' is set if (emails == null) { - throw new ApiException("Missing the required parameter 'emails' when calling deleteInvites(Async)"); + throw new ApiException( + "Missing the required parameter 'emails' when calling deleteInvites(Async)"); } - okhttp3.Call localVarCall = deleteInvitesCall(emails, _callback); return localVarCall; - } /** - * Delete Invites - * Removes a list of invitations to join a Workspace. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param emails The list of emails to delete invites for. This parameter exists in alpha. (required) + * Delete Invites Removes a list of invitations to join a Workspace. When called, this endpoint + * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite + * Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param emails The list of emails to delete invites for. This parameter exists in v1. + * (required) * @return DeleteInvites200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteInvites200Response deleteInvites(List emails) throws ApiException { ApiResponse localVarResp = deleteInvitesWithHttpInfo(emails); @@ -471,73 +600,93 @@ public DeleteInvites200Response deleteInvites(List emails) throws ApiExc } /** - * Delete Invites - * Removes a list of invitations to join a Workspace. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param emails The list of emails to delete invites for. This parameter exists in alpha. (required) + * Delete Invites Removes a list of invitations to join a Workspace. When called, this endpoint + * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite + * Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param emails The list of emails to delete invites for. This parameter exists in v1. + * (required) * @return ApiResponse<DeleteInvites200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteInvitesWithHttpInfo(List emails) throws ApiException { + public ApiResponse deleteInvitesWithHttpInfo(List emails) + throws ApiException { okhttp3.Call localVarCall = deleteInvitesValidateBeforeCall(emails, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Invites (asynchronously) - * Removes a list of invitations to join a Workspace. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param emails The list of emails to delete invites for. This parameter exists in alpha. (required) + * Delete Invites (asynchronously) Removes a list of invitations to join a Workspace. When + * called, this endpoint may generate one or more of the following [Audit + * Trail](/tag/Audit-Trail) events: * Invite Deleted * Group Memberships Deleted The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param emails The list of emails to delete invites for. This parameter exists in v1. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteInvitesAsync(List emails, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteInvitesAsync( + List emails, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteInvitesValidateBeforeCall(emails, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteUsers - * @param userIds The ids of the users to remove. This parameter exists in alpha. (required) + * + * @param userIds The ids of the users to remove. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteUsersCall(List userIds, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteUsersCall(List userIds, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -555,57 +704,78 @@ public okhttp3.Call deleteUsersCall(List userIds, final ApiCallback _cal Map localVarFormParams = new HashMap(); if (userIds != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "userIds", userIds)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "userIds", userIds)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteUsersValidateBeforeCall(List userIds, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteUsersValidateBeforeCall( + List userIds, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userIds' is set if (userIds == null) { - throw new ApiException("Missing the required parameter 'userIds' when calling deleteUsers(Async)"); + throw new ApiException( + "Missing the required parameter 'userIds' when calling deleteUsers(Async)"); } - okhttp3.Call localVarCall = deleteUsersCall(userIds, _callback); return localVarCall; - } /** - * Delete Users - * Removes one or multiple users. When called, this endpoint may generate the `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userIds The ids of the users to remove. This parameter exists in alpha. (required) + * Delete Users Removes one or multiple users. When called, this endpoint may generate the + * `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param userIds The ids of the users to remove. This parameter exists in v1. (required) * @return DeleteUsers200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteUsers200Response deleteUsers(List userIds) throws ApiException { ApiResponse localVarResp = deleteUsersWithHttpInfo(userIds); @@ -613,73 +783,90 @@ public DeleteUsers200Response deleteUsers(List userIds) throws ApiExcept } /** - * Delete Users - * Removes one or multiple users. When called, this endpoint may generate the `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userIds The ids of the users to remove. This parameter exists in alpha. (required) + * Delete Users Removes one or multiple users. When called, this endpoint may generate the + * `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param userIds The ids of the users to remove. This parameter exists in v1. (required) * @return ApiResponse<DeleteUsers200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteUsersWithHttpInfo(List userIds) throws ApiException { + public ApiResponse deleteUsersWithHttpInfo(List userIds) + throws ApiException { okhttp3.Call localVarCall = deleteUsersValidateBeforeCall(userIds, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Users (asynchronously) - * Removes one or multiple users. When called, this endpoint may generate the `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userIds The ids of the users to remove. This parameter exists in alpha. (required) + * Delete Users (asynchronously) Removes one or multiple users. When called, this endpoint may + * generate the `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userIds The ids of the users to remove. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteUsersAsync(List userIds, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteUsersAsync( + List userIds, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteUsersValidateBeforeCall(userIds, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getUser - * @param userId (required) + * + * @param userId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -688,8 +875,11 @@ public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) thro Object localVarPostBody = null; // create path and map variables - String localVarPath = "/users/{userId}" - .replaceAll("\\{" + "userId" + "\\}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = + "/users/{userId}" + .replaceAll( + "\\{" + "userId" + "\\}", + localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -698,53 +888,68 @@ public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) thro Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getUserValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getUserValidateBeforeCall(String userId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userId' is set if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling getUser(Async)"); + throw new ApiException( + "Missing the required parameter 'userId' when calling getUser(Async)"); } - okhttp3.Call localVarCall = getUserCall(userId, _callback); return localVarCall; - } /** - * Get User - * Returns a user given their id. - * @param userId (required) + * Get User Returns a user given their id. + * + * @param userId (required) * @return GetUser200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetUser200Response getUser(String userId) throws ApiException { ApiResponse localVarResp = getUserWithHttpInfo(userId); @@ -752,73 +957,78 @@ public GetUser200Response getUser(String userId) throws ApiException { } /** - * Get User - * Returns a user given their id. - * @param userId (required) + * Get User Returns a user given their id. + * + * @param userId (required) * @return ApiResponse<GetUser200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ApiResponse getUserWithHttpInfo(String userId) throws ApiException { okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get User (asynchronously) - * Returns a user given their id. - * @param userId (required) + * Get User (asynchronously) Returns a user given their id. + * + * @param userId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getUserAsync(String userId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUserAsync(String userId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getUserValidateBeforeCall(userId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listInvites - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listInvitesCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listInvitesCall(PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -840,53 +1050,69 @@ public okhttp3.Call listInvitesCall(PaginationInput pagination, final ApiCallbac } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listInvitesValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listInvitesValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listInvites(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling listInvites(Async)"); } - okhttp3.Call localVarCall = listInvitesCall(pagination, _callback); return localVarCall; - } /** - * List Invites - * Returns a list of invitations to join a Workspace. Config API omitted fields: - `parent` - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Invites Returns a list of invitations to join a Workspace. Config API omitted fields: - + * `parent` + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListInvites200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ListInvites200Response listInvites(PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listInvitesWithHttpInfo(pagination); @@ -894,74 +1120,84 @@ public ListInvites200Response listInvites(PaginationInput pagination) throws Api } /** - * List Invites - * Returns a list of invitations to join a Workspace. Config API omitted fields: - `parent` - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Invites Returns a list of invitations to join a Workspace. Config API omitted fields: - + * `parent` + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListInvites200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listInvitesWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listInvitesWithHttpInfo(PaginationInput pagination) + throws ApiException { okhttp3.Call localVarCall = listInvitesValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Invites (asynchronously) - * Returns a list of invitations to join a Workspace. Config API omitted fields: - `parent` - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Invites (asynchronously) Returns a list of invitations to join a Workspace. Config API + * omitted fields: - `parent` + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listInvitesAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listInvitesAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listInvitesValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listUserGroupsFromUser - * @param userId (required) - * @param pagination Pagination for groups. This parameter exists in alpha. (required) + * + * @param userId (required) + * @param pagination Pagination for groups. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUserGroupsFromUserCall(String userId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listUserGroupsFromUserCall( + String userId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -970,8 +1206,11 @@ public okhttp3.Call listUserGroupsFromUserCall(String userId, PaginationInput pa Object localVarPostBody = null; // create path and map variables - String localVarPath = "/users/{userId}/groups" - .replaceAll("\\{" + "userId" + "\\}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = + "/users/{userId}/groups" + .replaceAll( + "\\{" + "userId" + "\\}", + localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -984,135 +1223,167 @@ public okhttp3.Call listUserGroupsFromUserCall(String userId, PaginationInput pa } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listUserGroupsFromUserValidateBeforeCall(String userId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listUserGroupsFromUserValidateBeforeCall( + String userId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userId' is set if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling listUserGroupsFromUser(Async)"); + throw new ApiException( + "Missing the required parameter 'userId' when calling" + + " listUserGroupsFromUser(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listUserGroupsFromUser(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listUserGroupsFromUser(Async)"); } - okhttp3.Call localVarCall = listUserGroupsFromUserCall(userId, pagination, _callback); return localVarCall; - } /** - * List User Groups from User - * Returns all groups a user belongs to. - * @param userId (required) - * @param pagination Pagination for groups. This parameter exists in alpha. (required) + * List User Groups from User Returns all groups a user belongs to. + * + * @param userId (required) + * @param pagination Pagination for groups. This parameter exists in v1. (required) * @return ListUserGroupsFromUser200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListUserGroupsFromUser200Response listUserGroupsFromUser(String userId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listUserGroupsFromUserWithHttpInfo(userId, pagination); + public ListUserGroupsFromUser200Response listUserGroupsFromUser( + String userId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listUserGroupsFromUserWithHttpInfo(userId, pagination); return localVarResp.getData(); } /** - * List User Groups from User - * Returns all groups a user belongs to. - * @param userId (required) - * @param pagination Pagination for groups. This parameter exists in alpha. (required) + * List User Groups from User Returns all groups a user belongs to. + * + * @param userId (required) + * @param pagination Pagination for groups. This parameter exists in v1. (required) * @return ApiResponse<ListUserGroupsFromUser200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listUserGroupsFromUserWithHttpInfo(String userId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listUserGroupsFromUserValidateBeforeCall(userId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listUserGroupsFromUserWithHttpInfo( + String userId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listUserGroupsFromUserValidateBeforeCall(userId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List User Groups from User (asynchronously) - * Returns all groups a user belongs to. - * @param userId (required) - * @param pagination Pagination for groups. This parameter exists in alpha. (required) + * List User Groups from User (asynchronously) Returns all groups a user belongs to. + * + * @param userId (required) + * @param pagination Pagination for groups. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUserGroupsFromUserAsync(String userId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listUserGroupsFromUserValidateBeforeCall(userId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listUserGroupsFromUserAsync( + String userId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listUserGroupsFromUserValidateBeforeCall(userId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listUsers - * @param pagination Pagination for users. This parameter exists in alpha. (required) + * + * @param pagination Pagination for users. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUsersCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listUsersCall(PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1134,53 +1405,68 @@ public okhttp3.Call listUsersCall(PaginationInput pagination, final ApiCallback } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listUsersValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listUsersValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listUsers(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling listUsers(Async)"); } - okhttp3.Call localVarCall = listUsersCall(pagination, _callback); return localVarCall; - } /** - * List Users - * Returns a list of users with access to the Workspace. - * @param pagination Pagination for users. This parameter exists in alpha. (required) + * List Users Returns a list of users with access to the Workspace. + * + * @param pagination Pagination for users. This parameter exists in v1. (required) * @return ListUsers200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ListUsers200Response listUsers(PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listUsersWithHttpInfo(pagination); @@ -1188,74 +1474,84 @@ public ListUsers200Response listUsers(PaginationInput pagination) throws ApiExce } /** - * List Users - * Returns a list of users with access to the Workspace. - * @param pagination Pagination for users. This parameter exists in alpha. (required) + * List Users Returns a list of users with access to the Workspace. + * + * @param pagination Pagination for users. This parameter exists in v1. (required) * @return ApiResponse<ListUsers200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listUsersWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listUsersWithHttpInfo(PaginationInput pagination) + throws ApiException { okhttp3.Call localVarCall = listUsersValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Users (asynchronously) - * Returns a list of users with access to the Workspace. - * @param pagination Pagination for users. This parameter exists in alpha. (required) + * List Users (asynchronously) Returns a list of users with access to the Workspace. + * + * @param pagination Pagination for users. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listUsersAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listUsersAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listUsersValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replacePermissionsForUser - * @param userId (required) - * @param replacePermissionsForUserV1Input (required) + * + * @param userId (required) + * @param replacePermissionsForUserV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replacePermissionsForUserCall(String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replacePermissionsForUserCall( + String userId, + ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1264,8 +1560,11 @@ public okhttp3.Call replacePermissionsForUserCall(String userId, ReplacePermissi Object localVarPostBody = replacePermissionsForUserV1Input; // create path and map variables - String localVarPath = "/users/{userId}/permissions" - .replaceAll("\\{" + "userId" + "\\}", localVarApiClient.escapeString(userId.toString())); + String localVarPath = + "/users/{userId}/permissions" + .replaceAll( + "\\{" + "userId" + "\\}", + localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1274,7 +1573,10 @@ public okhttp3.Call replacePermissionsForUserCall(String userId, ReplacePermissi Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1282,100 +1584,154 @@ public okhttp3.Call replacePermissionsForUserCall(String userId, ReplacePermissi } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replacePermissionsForUserValidateBeforeCall(String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replacePermissionsForUserValidateBeforeCall( + String userId, + ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'userId' is set if (userId == null) { - throw new ApiException("Missing the required parameter 'userId' when calling replacePermissionsForUser(Async)"); + throw new ApiException( + "Missing the required parameter 'userId' when calling" + + " replacePermissionsForUser(Async)"); } - + // verify the required parameter 'replacePermissionsForUserV1Input' is set if (replacePermissionsForUserV1Input == null) { - throw new ApiException("Missing the required parameter 'replacePermissionsForUserV1Input' when calling replacePermissionsForUser(Async)"); + throw new ApiException( + "Missing the required parameter 'replacePermissionsForUserV1Input' when calling" + + " replacePermissionsForUser(Async)"); } - - okhttp3.Call localVarCall = replacePermissionsForUserCall(userId, replacePermissionsForUserV1Input, _callback); + okhttp3.Call localVarCall = + replacePermissionsForUserCall(userId, replacePermissionsForUserV1Input, _callback); return localVarCall; - } /** - * Replace Permissions for User - * Updates the list of access permissions for a user. When called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userId (required) - * @param replacePermissionsForUserV1Input (required) + * Replace Permissions for User Updates the list of access permissions for a user. When called, + * this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) + * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userId (required) + * @param replacePermissionsForUserV1Input (required) * @return ReplacePermissionsForUser200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplacePermissionsForUser200Response replacePermissionsForUser(String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input) throws ApiException { - ApiResponse localVarResp = replacePermissionsForUserWithHttpInfo(userId, replacePermissionsForUserV1Input); + public ReplacePermissionsForUser200Response replacePermissionsForUser( + String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input) + throws ApiException { + ApiResponse localVarResp = + replacePermissionsForUserWithHttpInfo(userId, replacePermissionsForUserV1Input); return localVarResp.getData(); } /** - * Replace Permissions for User - * Updates the list of access permissions for a user. When called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userId (required) - * @param replacePermissionsForUserV1Input (required) + * Replace Permissions for User Updates the list of access permissions for a user. When called, + * this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) + * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param userId (required) + * @param replacePermissionsForUserV1Input (required) * @return ApiResponse<ReplacePermissionsForUser200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replacePermissionsForUserWithHttpInfo(String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input) throws ApiException { - okhttp3.Call localVarCall = replacePermissionsForUserValidateBeforeCall(userId, replacePermissionsForUserV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse replacePermissionsForUserWithHttpInfo( + String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input) + throws ApiException { + okhttp3.Call localVarCall = + replacePermissionsForUserValidateBeforeCall( + userId, replacePermissionsForUserV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Permissions for User (asynchronously) - * Updates the list of access permissions for a user. When called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param userId (required) - * @param replacePermissionsForUserV1Input (required) + * Replace Permissions for User (asynchronously) Updates the list of access permissions for a + * user. When called, this endpoint may generate the `Policy Deleted` [Audit + * Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param userId (required) + * @param replacePermissionsForUserV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replacePermissionsForUserAsync(String userId, ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replacePermissionsForUserValidateBeforeCall(userId, replacePermissionsForUserV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replacePermissionsForUserAsync( + String userId, + ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replacePermissionsForUserValidateBeforeCall( + userId, replacePermissionsForUserV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index b59e8678..65054ab9 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,39 +10,25 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateLabel200Response; -import com.segment.publicapi.models.CreateLabel200Response1; -import com.segment.publicapi.models.CreateLabelAlphaInput; import com.segment.publicapi.models.CreateLabelV1Input; import com.segment.publicapi.models.DeleteLabel200Response; -import com.segment.publicapi.models.DeleteLabel200Response1; import com.segment.publicapi.models.ListLabels200Response; -import com.segment.publicapi.models.ListLabels200Response1; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class LabelsApi { private ApiClient localVarApiClient; @@ -83,34 +69,37 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createLabel - * @param createLabelAlphaInput (required) + * + * @param createLabelV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createLabelCall(CreateLabelAlphaInput createLabelAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createLabelCall( + CreateLabelV1Input createLabelV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } - Object localVarPostBody = createLabelAlphaInput; + Object localVarPostBody = createLabelV1Input; // create path and map variables String localVarPath = "/labels"; @@ -122,7 +111,10 @@ public okhttp3.Call createLabelCall(CreateLabelAlphaInput createLabelAlphaInput, Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -130,120 +122,160 @@ public okhttp3.Call createLabelCall(CreateLabelAlphaInput createLabelAlphaInput, } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createLabelValidateBeforeCall(CreateLabelAlphaInput createLabelAlphaInput, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'createLabelAlphaInput' is set - if (createLabelAlphaInput == null) { - throw new ApiException("Missing the required parameter 'createLabelAlphaInput' when calling createLabel(Async)"); + private okhttp3.Call createLabelValidateBeforeCall( + CreateLabelV1Input createLabelV1Input, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'createLabelV1Input' is set + if (createLabelV1Input == null) { + throw new ApiException( + "Missing the required parameter 'createLabelV1Input' when calling" + + " createLabel(Async)"); } - - okhttp3.Call localVarCall = createLabelCall(createLabelAlphaInput, _callback); + okhttp3.Call localVarCall = createLabelCall(createLabelV1Input, _callback); return localVarCall; - } /** - * Create Label - * Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createLabelAlphaInput (required) + * Create Label Creates a new label. When called, this endpoint may generate the `Label + * Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param createLabelV1Input (required) * @return CreateLabel200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateLabel200Response createLabel(CreateLabelAlphaInput createLabelAlphaInput) throws ApiException { - ApiResponse localVarResp = createLabelWithHttpInfo(createLabelAlphaInput); + public CreateLabel200Response createLabel(CreateLabelV1Input createLabelV1Input) + throws ApiException { + ApiResponse localVarResp = + createLabelWithHttpInfo(createLabelV1Input); return localVarResp.getData(); } /** - * Create Label - * Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createLabelAlphaInput (required) + * Create Label Creates a new label. When called, this endpoint may generate the `Label + * Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param createLabelV1Input (required) * @return ApiResponse<CreateLabel200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createLabelWithHttpInfo(CreateLabelAlphaInput createLabelAlphaInput) throws ApiException { - okhttp3.Call localVarCall = createLabelValidateBeforeCall(createLabelAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createLabelWithHttpInfo( + CreateLabelV1Input createLabelV1Input) throws ApiException { + okhttp3.Call localVarCall = createLabelValidateBeforeCall(createLabelV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Label (asynchronously) - * Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param createLabelAlphaInput (required) + * Create Label (asynchronously) Creates a new label. When called, this endpoint may generate + * the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this + * endpoint is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param createLabelV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createLabelAsync(CreateLabelAlphaInput createLabelAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createLabelAsync( + CreateLabelV1Input createLabelV1Input, + final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = createLabelValidateBeforeCall(createLabelAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createLabelValidateBeforeCall(createLabelV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteLabel - * @param key (required) - * @param value (required) + * + * @param key (required) + * @param value (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -252,9 +284,14 @@ public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/labels/{key}/{value}" - .replaceAll("\\{" + "key" + "\\}", localVarApiClient.escapeString(key.toString())) - .replaceAll("\\{" + "value" + "\\}", localVarApiClient.escapeString(value.toString())); + String localVarPath = + "/labels/{key}/{value}" + .replaceAll( + "\\{" + "key" + "\\}", + localVarApiClient.escapeString(key.toString())) + .replaceAll( + "\\{" + "value" + "\\}", + localVarApiClient.escapeString(value.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -263,59 +300,79 @@ public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteLabelValidateBeforeCall(String key, String value, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteLabelValidateBeforeCall( + String key, String value, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'key' is set if (key == null) { - throw new ApiException("Missing the required parameter 'key' when calling deleteLabel(Async)"); + throw new ApiException( + "Missing the required parameter 'key' when calling deleteLabel(Async)"); } - + // verify the required parameter 'value' is set if (value == null) { - throw new ApiException("Missing the required parameter 'value' when calling deleteLabel(Async)"); + throw new ApiException( + "Missing the required parameter 'value' when calling deleteLabel(Async)"); } - okhttp3.Call localVarCall = deleteLabelCall(key, value, _callback); return localVarCall; - } /** - * Delete Label - * Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param key (required) - * @param value (required) + * Delete Label Deletes a label. When called, this endpoint may generate the `Label + * Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param key (required) + * @param value (required) * @return DeleteLabel200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteLabel200Response deleteLabel(String key, String value) throws ApiException { ApiResponse localVarResp = deleteLabelWithHttpInfo(key, value); @@ -323,74 +380,89 @@ public DeleteLabel200Response deleteLabel(String key, String value) throws ApiEx } /** - * Delete Label - * Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param key (required) - * @param value (required) + * Delete Label Deletes a label. When called, this endpoint may generate the `Label + * Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param key (required) + * @param value (required) * @return ApiResponse<DeleteLabel200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteLabelWithHttpInfo(String key, String value) throws ApiException { + public ApiResponse deleteLabelWithHttpInfo(String key, String value) + throws ApiException { okhttp3.Call localVarCall = deleteLabelValidateBeforeCall(key, value, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Label (asynchronously) - * Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param key (required) - * @param value (required) + * Delete Label (asynchronously) Deletes a label. When called, this endpoint may generate the + * `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this + * endpoint is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param key (required) + * @param value (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteLabelAsync(String key, String value, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteLabelAsync( + String key, String value, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteLabelValidateBeforeCall(key, value, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listLabels + * * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public okhttp3.Call listLabelsCall(final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -408,47 +480,61 @@ public okhttp3.Call listLabelsCall(final ApiCallback _callback) throws ApiExcept Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listLabelsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listLabelsValidateBeforeCall(final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listLabelsCall(_callback); return localVarCall; - } /** - * List Labels - * Returns a list of all available labels. + * List Labels Returns a list of all available labels. + * * @return ListLabels200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ListLabels200Response listLabels() throws ApiException { ApiResponse localVarResp = listLabelsWithHttpInfo(); @@ -456,44 +542,47 @@ public ListLabels200Response listLabels() throws ApiException { } /** - * List Labels - * Returns a list of all available labels. + * List Labels Returns a list of all available labels. + * * @return ApiResponse<ListLabels200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ApiResponse listLabelsWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = listLabelsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Labels (asynchronously) - * Returns a list of all available labels. + * List Labels (asynchronously) Returns a list of all available labels. + * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listLabelsAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call listLabelsAsync(final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listLabelsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java index 6359e3d0..551177e8 100644 --- a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,34 +10,24 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.GetDailyPerSourceMTUUsage200Response; import com.segment.publicapi.models.GetDailyWorkspaceMTUUsage200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class MonthlyTrackedUsersApi { private ApiClient localVarApiClient; @@ -78,29 +68,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getDailyPerSourceMTUUsage - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source MTU counts. This parameter exists in alpha. (required) + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source MTU counts. This parameter exists in v1. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyPerSourceMTUUsageCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDailyPerSourceMTUUsageCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -126,136 +121,182 @@ public okhttp3.Call getDailyPerSourceMTUUsageCall(String period, PaginationInput } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDailyPerSourceMTUUsageValidateBeforeCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDailyPerSourceMTUUsageValidateBeforeCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'period' is set if (period == null) { - throw new ApiException("Missing the required parameter 'period' when calling getDailyPerSourceMTUUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'period' when calling" + + " getDailyPerSourceMTUUsage(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getDailyPerSourceMTUUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getDailyPerSourceMTUUsage(Async)"); } - okhttp3.Call localVarCall = getDailyPerSourceMTUUsageCall(period, pagination, _callback); return localVarCall; - } /** - * Get Daily Per Source MTU Usage - * Provides daily cumulative per-source MTU counts for a usage period. - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source MTU counts. This parameter exists in alpha. (required) + * Get Daily Per Source MTU Usage Provides daily cumulative per-source MTU counts for a usage + * period. + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source MTU counts. This parameter exists in v1. + * (required) * @return GetDailyPerSourceMTUUsage200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetDailyPerSourceMTUUsage200Response getDailyPerSourceMTUUsage(String period, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getDailyPerSourceMTUUsageWithHttpInfo(period, pagination); + public GetDailyPerSourceMTUUsage200Response getDailyPerSourceMTUUsage( + String period, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + getDailyPerSourceMTUUsageWithHttpInfo(period, pagination); return localVarResp.getData(); } /** - * Get Daily Per Source MTU Usage - * Provides daily cumulative per-source MTU counts for a usage period. - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source MTU counts. This parameter exists in alpha. (required) + * Get Daily Per Source MTU Usage Provides daily cumulative per-source MTU counts for a usage + * period. + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source MTU counts. This parameter exists in v1. + * (required) * @return ApiResponse<GetDailyPerSourceMTUUsage200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDailyPerSourceMTUUsageWithHttpInfo(String period, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = getDailyPerSourceMTUUsageValidateBeforeCall(period, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getDailyPerSourceMTUUsageWithHttpInfo( + String period, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + getDailyPerSourceMTUUsageValidateBeforeCall(period, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Daily Per Source MTU Usage (asynchronously) - * Provides daily cumulative per-source MTU counts for a usage period. - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for per Source MTU counts. This parameter exists in alpha. (required) + * Get Daily Per Source MTU Usage (asynchronously) Provides daily cumulative per-source MTU + * counts for a usage period. + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for per Source MTU counts. This parameter exists in v1. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyPerSourceMTUUsageAsync(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDailyPerSourceMTUUsageValidateBeforeCall(period, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getDailyPerSourceMTUUsageAsync( + String period, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getDailyPerSourceMTUUsageValidateBeforeCall(period, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getDailyWorkspaceMTUUsage - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace MTU counts. This parameter exists in alpha. (required) + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace MTU counts. This parameter exists in v1. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyWorkspaceMTUUsageCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getDailyWorkspaceMTUUsageCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -281,108 +322,147 @@ public okhttp3.Call getDailyWorkspaceMTUUsageCall(String period, PaginationInput } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getDailyWorkspaceMTUUsageValidateBeforeCall(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getDailyWorkspaceMTUUsageValidateBeforeCall( + String period, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'period' is set if (period == null) { - throw new ApiException("Missing the required parameter 'period' when calling getDailyWorkspaceMTUUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'period' when calling" + + " getDailyWorkspaceMTUUsage(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling getDailyWorkspaceMTUUsage(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " getDailyWorkspaceMTUUsage(Async)"); } - okhttp3.Call localVarCall = getDailyWorkspaceMTUUsageCall(period, pagination, _callback); return localVarCall; - } /** - * Get Daily Workspace MTU Usage - * Provides daily cumulative MTU counts for a usage period. - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace MTU counts. This parameter exists in alpha. (required) + * Get Daily Workspace MTU Usage Provides daily cumulative MTU counts for a usage period. + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace MTU counts. This parameter exists in v1. + * (required) * @return GetDailyWorkspaceMTUUsage200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetDailyWorkspaceMTUUsage200Response getDailyWorkspaceMTUUsage(String period, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = getDailyWorkspaceMTUUsageWithHttpInfo(period, pagination); + public GetDailyWorkspaceMTUUsage200Response getDailyWorkspaceMTUUsage( + String period, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + getDailyWorkspaceMTUUsageWithHttpInfo(period, pagination); return localVarResp.getData(); } /** - * Get Daily Workspace MTU Usage - * Provides daily cumulative MTU counts for a usage period. - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace MTU counts. This parameter exists in alpha. (required) + * Get Daily Workspace MTU Usage Provides daily cumulative MTU counts for a usage period. + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace MTU counts. This parameter exists in v1. + * (required) * @return ApiResponse<GetDailyWorkspaceMTUUsage200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getDailyWorkspaceMTUUsageWithHttpInfo(String period, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = getDailyWorkspaceMTUUsageValidateBeforeCall(period, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getDailyWorkspaceMTUUsageWithHttpInfo( + String period, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + getDailyWorkspaceMTUUsageValidateBeforeCall(period, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Daily Workspace MTU Usage (asynchronously) - * Provides daily cumulative MTU counts for a usage period. - * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in alpha. (required) - * @param pagination Pagination input for Workspace MTU counts. This parameter exists in alpha. (required) + * Get Daily Workspace MTU Usage (asynchronously) Provides daily cumulative MTU counts for a + * usage period. + * + * @param period The start of the usage month, in the ISO-8601 format. This parameter exists in + * v1. (required) + * @param pagination Pagination input for Workspace MTU counts. This parameter exists in v1. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getDailyWorkspaceMTUUsageAsync(String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getDailyWorkspaceMTUUsageValidateBeforeCall(period, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getDailyWorkspaceMTUUsageAsync( + String period, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getDailyWorkspaceMTUUsageValidateBeforeCall(period, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 2bde3039..6c478d04 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouse200Response; import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSource200Response; import com.segment.publicapi.models.ListSyncsFromWarehouse200Response; @@ -34,16 +27,13 @@ import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouse200Response; import com.segment.publicapi.models.ReplaceAdvancedSyncScheduleForWarehouseV1Input; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateSelectiveSyncForWarehouse200Response; import com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class SelectiveSyncApi { private ApiClient localVarApiClient; @@ -84,28 +74,30 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getAdvancedSyncScheduleFromWarehouse - * @param warehouseId (required) + * + * @param warehouseId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall(String warehouseId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall( + String warehouseId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -114,8 +106,11 @@ public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall(String warehouseId, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/advanced-sync-schedule" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/advanced-sync-schedule" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -124,129 +119,177 @@ public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall(String warehouseId, Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAdvancedSyncScheduleFromWarehouseValidateBeforeCall(String warehouseId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getAdvancedSyncScheduleFromWarehouseValidateBeforeCall( + String warehouseId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling getAdvancedSyncScheduleFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " getAdvancedSyncScheduleFromWarehouse(Async)"); } - - okhttp3.Call localVarCall = getAdvancedSyncScheduleFromWarehouseCall(warehouseId, _callback); + okhttp3.Call localVarCall = + getAdvancedSyncScheduleFromWarehouseCall(warehouseId, _callback); return localVarCall; - } /** - * Get Advanced Sync Schedule from Warehouse - * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) + * Get Advanced Sync Schedule from Warehouse Returns the advanced sync schedule for a Warehouse. + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) * @return GetAdvancedSyncScheduleFromWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetAdvancedSyncScheduleFromWarehouse200Response getAdvancedSyncScheduleFromWarehouse(String warehouseId) throws ApiException { - ApiResponse localVarResp = getAdvancedSyncScheduleFromWarehouseWithHttpInfo(warehouseId); + public GetAdvancedSyncScheduleFromWarehouse200Response getAdvancedSyncScheduleFromWarehouse( + String warehouseId) throws ApiException { + ApiResponse localVarResp = + getAdvancedSyncScheduleFromWarehouseWithHttpInfo(warehouseId); return localVarResp.getData(); } /** - * Get Advanced Sync Schedule from Warehouse - * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) + * Get Advanced Sync Schedule from Warehouse Returns the advanced sync schedule for a Warehouse. + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) * @return ApiResponse<GetAdvancedSyncScheduleFromWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getAdvancedSyncScheduleFromWarehouseWithHttpInfo(String warehouseId) throws ApiException { - okhttp3.Call localVarCall = getAdvancedSyncScheduleFromWarehouseValidateBeforeCall(warehouseId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + getAdvancedSyncScheduleFromWarehouseWithHttpInfo(String warehouseId) + throws ApiException { + okhttp3.Call localVarCall = + getAdvancedSyncScheduleFromWarehouseValidateBeforeCall(warehouseId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Advanced Sync Schedule from Warehouse (asynchronously) - * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) + * Get Advanced Sync Schedule from Warehouse (asynchronously) Returns the advanced sync schedule + * for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower + * than the default due to access pattern restrictions. Once reached, this endpoint will respond + * with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getAdvancedSyncScheduleFromWarehouseAsync(String warehouseId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAdvancedSyncScheduleFromWarehouseValidateBeforeCall(warehouseId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getAdvancedSyncScheduleFromWarehouseAsync( + String warehouseId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getAdvancedSyncScheduleFromWarehouseValidateBeforeCall(warehouseId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSelectiveSyncsFromWarehouseAndSource - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceCall(String warehouseId, String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceCall( + String warehouseId, + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -255,9 +298,14 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceCall(String warehous Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())) + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -270,144 +318,206 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceCall(String warehous } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall(String warehouseId, String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall( + String warehouseId, + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling listSelectiveSyncsFromWarehouseAndSource(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSelectiveSyncsFromWarehouseAndSource(Async)"); } - + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listSelectiveSyncsFromWarehouseAndSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listSelectiveSyncsFromWarehouseAndSource(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSelectiveSyncsFromWarehouseAndSource(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSelectiveSyncsFromWarehouseAndSource(Async)"); } - - okhttp3.Call localVarCall = listSelectiveSyncsFromWarehouseAndSourceCall(warehouseId, sourceId, pagination, _callback); + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSourceCall( + warehouseId, sourceId, pagination, _callback); return localVarCall; - } /** - * List Selective Syncs from Warehouse And Source - * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Selective Syncs from Warehouse And Source Returns the schema for a Warehouse, including + * Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListSelectiveSyncsFromWarehouseAndSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSelectiveSyncsFromWarehouseAndSource200Response listSelectiveSyncsFromWarehouseAndSource(String warehouseId, String sourceId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listSelectiveSyncsFromWarehouseAndSourceWithHttpInfo(warehouseId, sourceId, pagination); + public ListSelectiveSyncsFromWarehouseAndSource200Response + listSelectiveSyncsFromWarehouseAndSource( + String warehouseId, String sourceId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listSelectiveSyncsFromWarehouseAndSourceWithHttpInfo( + warehouseId, sourceId, pagination); return localVarResp.getData(); } /** - * List Selective Syncs from Warehouse And Source - * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Selective Syncs from Warehouse And Source Returns the schema for a Warehouse, including + * Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSelectiveSyncsFromWarehouseAndSourceWithHttpInfo(String warehouseId, String sourceId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall(warehouseId, sourceId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listSelectiveSyncsFromWarehouseAndSourceWithHttpInfo( + String warehouseId, String sourceId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall( + warehouseId, sourceId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Selective Syncs from Warehouse And Source (asynchronously) - * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Selective Syncs from Warehouse And Source (asynchronously) Returns the schema for a + * Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint + * is 2 requests per minute, which is lower than the default due to access pattern restrictions. + * Once reached, this endpoint will respond with the 429 HTTP status code with headers + * indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceAsync(String warehouseId, String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall(warehouseId, sourceId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceAsync( + String warehouseId, + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall( + warehouseId, sourceId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSyncsFromWarehouse - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSyncsFromWarehouseCall(String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSyncsFromWarehouseCall( + String warehouseId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -416,8 +526,11 @@ public okhttp3.Call listSyncsFromWarehouseCall(String warehouseId, PaginationInp Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/syncs" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/syncs" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -430,137 +543,185 @@ public okhttp3.Call listSyncsFromWarehouseCall(String warehouseId, PaginationInp } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSyncsFromWarehouseValidateBeforeCall(String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSyncsFromWarehouseValidateBeforeCall( + String warehouseId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling listSyncsFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSyncsFromWarehouse(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSyncsFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSyncsFromWarehouse(Async)"); } - okhttp3.Call localVarCall = listSyncsFromWarehouseCall(warehouseId, pagination, _callback); return localVarCall; - } /** - * List Syncs from Warehouse - * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Syncs from Warehouse Returns the overview of syncs for every Source connected to a + * Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListSyncsFromWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSyncsFromWarehouse200Response listSyncsFromWarehouse(String warehouseId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listSyncsFromWarehouseWithHttpInfo(warehouseId, pagination); + public ListSyncsFromWarehouse200Response listSyncsFromWarehouse( + String warehouseId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listSyncsFromWarehouseWithHttpInfo(warehouseId, pagination); return localVarResp.getData(); } /** - * List Syncs from Warehouse - * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Syncs from Warehouse Returns the overview of syncs for every Source connected to a + * Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListSyncsFromWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSyncsFromWarehouseWithHttpInfo(String warehouseId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listSyncsFromWarehouseValidateBeforeCall(warehouseId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listSyncsFromWarehouseWithHttpInfo( + String warehouseId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listSyncsFromWarehouseValidateBeforeCall(warehouseId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Syncs from Warehouse (asynchronously) - * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Syncs from Warehouse (asynchronously) Returns the overview of syncs for every Source + * connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSyncsFromWarehouseAsync(String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listSyncsFromWarehouseValidateBeforeCall(warehouseId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listSyncsFromWarehouseAsync( + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSyncsFromWarehouseValidateBeforeCall(warehouseId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSyncsFromWarehouseAndSource - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSyncsFromWarehouseAndSourceCall(String warehouseId, String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSyncsFromWarehouseAndSourceCall( + String warehouseId, + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -569,9 +730,14 @@ public okhttp3.Call listSyncsFromWarehouseAndSourceCall(String warehouseId, Stri Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())) + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -584,144 +750,205 @@ public okhttp3.Call listSyncsFromWarehouseAndSourceCall(String warehouseId, Stri } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSyncsFromWarehouseAndSourceValidateBeforeCall(String warehouseId, String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSyncsFromWarehouseAndSourceValidateBeforeCall( + String warehouseId, + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling listSyncsFromWarehouseAndSource(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSyncsFromWarehouseAndSource(Async)"); } - + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listSyncsFromWarehouseAndSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listSyncsFromWarehouseAndSource(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSyncsFromWarehouseAndSource(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSyncsFromWarehouseAndSource(Async)"); } - - okhttp3.Call localVarCall = listSyncsFromWarehouseAndSourceCall(warehouseId, sourceId, pagination, _callback); + okhttp3.Call localVarCall = + listSyncsFromWarehouseAndSourceCall(warehouseId, sourceId, pagination, _callback); return localVarCall; - } /** - * List Syncs from Warehouse And Source - * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Syncs from Warehouse And Source Returns the overview of syncs for a Source connected to + * a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListSyncsFromWarehouseAndSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSyncsFromWarehouseAndSource200Response listSyncsFromWarehouseAndSource(String warehouseId, String sourceId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listSyncsFromWarehouseAndSourceWithHttpInfo(warehouseId, sourceId, pagination); + public ListSyncsFromWarehouseAndSource200Response listSyncsFromWarehouseAndSource( + String warehouseId, String sourceId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listSyncsFromWarehouseAndSourceWithHttpInfo(warehouseId, sourceId, pagination); return localVarResp.getData(); } /** - * List Syncs from Warehouse And Source - * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Syncs from Warehouse And Source Returns the overview of syncs for a Source connected to + * a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListSyncsFromWarehouseAndSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSyncsFromWarehouseAndSourceWithHttpInfo(String warehouseId, String sourceId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listSyncsFromWarehouseAndSourceValidateBeforeCall(warehouseId, sourceId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listSyncsFromWarehouseAndSourceWithHttpInfo( + String warehouseId, String sourceId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listSyncsFromWarehouseAndSourceValidateBeforeCall( + warehouseId, sourceId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Syncs from Warehouse And Source (asynchronously) - * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param sourceId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Syncs from Warehouse And Source (asynchronously) Returns the overview of syncs for a + * Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param sourceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSyncsFromWarehouseAndSourceAsync(String warehouseId, String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listSyncsFromWarehouseAndSourceValidateBeforeCall(warehouseId, sourceId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listSyncsFromWarehouseAndSourceAsync( + String warehouseId, + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSyncsFromWarehouseAndSourceValidateBeforeCall( + warehouseId, sourceId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replaceAdvancedSyncScheduleForWarehouse - * @param warehouseId (required) - * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) + * + * @param warehouseId (required) + * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseCall(String warehouseId, ReplaceAdvancedSyncScheduleForWarehouseV1Input replaceAdvancedSyncScheduleForWarehouseV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseCall( + String warehouseId, + ReplaceAdvancedSyncScheduleForWarehouseV1Input + replaceAdvancedSyncScheduleForWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -730,8 +957,11 @@ public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseCall(String warehouse Object localVarPostBody = replaceAdvancedSyncScheduleForWarehouseV1Input; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/advanced-sync-schedule" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/advanced-sync-schedule" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -740,7 +970,10 @@ public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseCall(String warehouse Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -748,128 +981,196 @@ public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseCall(String warehouse } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall(String warehouseId, ReplaceAdvancedSyncScheduleForWarehouseV1Input replaceAdvancedSyncScheduleForWarehouseV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall( + String warehouseId, + ReplaceAdvancedSyncScheduleForWarehouseV1Input + replaceAdvancedSyncScheduleForWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling replaceAdvancedSyncScheduleForWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " replaceAdvancedSyncScheduleForWarehouse(Async)"); } - + // verify the required parameter 'replaceAdvancedSyncScheduleForWarehouseV1Input' is set if (replaceAdvancedSyncScheduleForWarehouseV1Input == null) { - throw new ApiException("Missing the required parameter 'replaceAdvancedSyncScheduleForWarehouseV1Input' when calling replaceAdvancedSyncScheduleForWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter" + + " 'replaceAdvancedSyncScheduleForWarehouseV1Input' when calling" + + " replaceAdvancedSyncScheduleForWarehouse(Async)"); } - - okhttp3.Call localVarCall = replaceAdvancedSyncScheduleForWarehouseCall(warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, _callback); + okhttp3.Call localVarCall = + replaceAdvancedSyncScheduleForWarehouseCall( + warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, _callback); return localVarCall; - } /** - * Replace Advanced Sync Schedule for Warehouse - * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) + * Replace Advanced Sync Schedule for Warehouse Updates the advanced sync schedule for a + * Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint + * is 2 requests per minute, which is lower than the default due to access pattern restrictions. + * Once reached, this endpoint will respond with the 429 HTTP status code with headers + * indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) * @return ReplaceAdvancedSyncScheduleForWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplaceAdvancedSyncScheduleForWarehouse200Response replaceAdvancedSyncScheduleForWarehouse(String warehouseId, ReplaceAdvancedSyncScheduleForWarehouseV1Input replaceAdvancedSyncScheduleForWarehouseV1Input) throws ApiException { - ApiResponse localVarResp = replaceAdvancedSyncScheduleForWarehouseWithHttpInfo(warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input); + public ReplaceAdvancedSyncScheduleForWarehouse200Response + replaceAdvancedSyncScheduleForWarehouse( + String warehouseId, + ReplaceAdvancedSyncScheduleForWarehouseV1Input + replaceAdvancedSyncScheduleForWarehouseV1Input) + throws ApiException { + ApiResponse localVarResp = + replaceAdvancedSyncScheduleForWarehouseWithHttpInfo( + warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input); return localVarResp.getData(); } /** - * Replace Advanced Sync Schedule for Warehouse - * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) + * Replace Advanced Sync Schedule for Warehouse Updates the advanced sync schedule for a + * Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint + * is 2 requests per minute, which is lower than the default due to access pattern restrictions. + * Once reached, this endpoint will respond with the 429 HTTP status code with headers + * indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) * @return ApiResponse<ReplaceAdvancedSyncScheduleForWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replaceAdvancedSyncScheduleForWarehouseWithHttpInfo(String warehouseId, ReplaceAdvancedSyncScheduleForWarehouseV1Input replaceAdvancedSyncScheduleForWarehouseV1Input) throws ApiException { - okhttp3.Call localVarCall = replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall(warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + replaceAdvancedSyncScheduleForWarehouseWithHttpInfo( + String warehouseId, + ReplaceAdvancedSyncScheduleForWarehouseV1Input + replaceAdvancedSyncScheduleForWarehouseV1Input) + throws ApiException { + okhttp3.Call localVarCall = + replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall( + warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Advanced Sync Schedule for Warehouse (asynchronously) - * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) + * Replace Advanced Sync Schedule for Warehouse (asynchronously) Updates the advanced sync + * schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for + * this endpoint is 2 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param warehouseId (required) + * @param replaceAdvancedSyncScheduleForWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseAsync(String warehouseId, ReplaceAdvancedSyncScheduleForWarehouseV1Input replaceAdvancedSyncScheduleForWarehouseV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall(warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseAsync( + String warehouseId, + ReplaceAdvancedSyncScheduleForWarehouseV1Input + replaceAdvancedSyncScheduleForWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall( + warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateSelectiveSyncForWarehouse - * @param warehouseId (required) - * @param updateSelectiveSyncForWarehouseV1Input (required) + * + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSelectiveSyncForWarehouseCall(String warehouseId, UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSelectiveSyncForWarehouseCall( + String warehouseId, + UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -878,8 +1179,11 @@ public okhttp3.Call updateSelectiveSyncForWarehouseCall(String warehouseId, Upda Object localVarPostBody = updateSelectiveSyncForWarehouseV1Input; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/selective-sync" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/selective-sync" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -888,7 +1192,10 @@ public okhttp3.Call updateSelectiveSyncForWarehouseCall(String warehouseId, Upda Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -896,100 +1203,162 @@ public okhttp3.Call updateSelectiveSyncForWarehouseCall(String warehouseId, Upda } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSelectiveSyncForWarehouseValidateBeforeCall(String warehouseId, UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateSelectiveSyncForWarehouseValidateBeforeCall( + String warehouseId, + UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling updateSelectiveSyncForWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " updateSelectiveSyncForWarehouse(Async)"); } - + // verify the required parameter 'updateSelectiveSyncForWarehouseV1Input' is set if (updateSelectiveSyncForWarehouseV1Input == null) { - throw new ApiException("Missing the required parameter 'updateSelectiveSyncForWarehouseV1Input' when calling updateSelectiveSyncForWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'updateSelectiveSyncForWarehouseV1Input' when" + + " calling updateSelectiveSyncForWarehouse(Async)"); } - - okhttp3.Call localVarCall = updateSelectiveSyncForWarehouseCall(warehouseId, updateSelectiveSyncForWarehouseV1Input, _callback); + okhttp3.Call localVarCall = + updateSelectiveSyncForWarehouseCall( + warehouseId, updateSelectiveSyncForWarehouseV1Input, _callback); return localVarCall; - } /** - * Update Selective Sync for Warehouse - * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param updateSelectiveSyncForWarehouseV1Input (required) + * Update Selective Sync for Warehouse Configures the schema for a Warehouse, including Sources, + * Collections, and Properties. When called, this endpoint may generate the `Storage + * Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this + * endpoint is 2 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseV1Input (required) * @return UpdateSelectiveSyncForWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateSelectiveSyncForWarehouse200Response updateSelectiveSyncForWarehouse(String warehouseId, UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input) throws ApiException { - ApiResponse localVarResp = updateSelectiveSyncForWarehouseWithHttpInfo(warehouseId, updateSelectiveSyncForWarehouseV1Input); + public UpdateSelectiveSyncForWarehouse200Response updateSelectiveSyncForWarehouse( + String warehouseId, + UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input) + throws ApiException { + ApiResponse localVarResp = + updateSelectiveSyncForWarehouseWithHttpInfo( + warehouseId, updateSelectiveSyncForWarehouseV1Input); return localVarResp.getData(); } /** - * Update Selective Sync for Warehouse - * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param updateSelectiveSyncForWarehouseV1Input (required) + * Update Selective Sync for Warehouse Configures the schema for a Warehouse, including Sources, + * Collections, and Properties. When called, this endpoint may generate the `Storage + * Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this + * endpoint is 2 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseV1Input (required) * @return ApiResponse<UpdateSelectiveSyncForWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateSelectiveSyncForWarehouseWithHttpInfo(String warehouseId, UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input) throws ApiException { - okhttp3.Call localVarCall = updateSelectiveSyncForWarehouseValidateBeforeCall(warehouseId, updateSelectiveSyncForWarehouseV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + updateSelectiveSyncForWarehouseWithHttpInfo( + String warehouseId, + UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input) + throws ApiException { + okhttp3.Call localVarCall = + updateSelectiveSyncForWarehouseValidateBeforeCall( + warehouseId, updateSelectiveSyncForWarehouseV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Selective Sync for Warehouse (asynchronously) - * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) - * @param updateSelectiveSyncForWarehouseV1Input (required) + * Update Selective Sync for Warehouse (asynchronously) Configures the schema for a Warehouse, + * including Sources, Collections, and Properties. When called, this endpoint may generate the + * `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate + * limit for this endpoint is 2 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSelectiveSyncForWarehouseAsync(String warehouseId, UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSelectiveSyncForWarehouseValidateBeforeCall(warehouseId, updateSelectiveSyncForWarehouseV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateSelectiveSyncForWarehouseAsync( + String warehouseId, + UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSelectiveSyncForWarehouseValidateBeforeCall( + warehouseId, updateSelectiveSyncForWarehouseV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index 3d2e3ce9..ef46d677 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,61 +10,38 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.AddLabelsToSource200Response; -import com.segment.publicapi.models.AddLabelsToSource200Response1; -import com.segment.publicapi.models.AddLabelsToSourceAlphaInput; import com.segment.publicapi.models.AddLabelsToSourceV1Input; import com.segment.publicapi.models.CreateSource200Response; -import com.segment.publicapi.models.CreateSource200Response1; -import com.segment.publicapi.models.CreateSourceAlphaInput; import com.segment.publicapi.models.CreateSourceV1Input; import com.segment.publicapi.models.DeleteSource200Response; -import com.segment.publicapi.models.DeleteSource200Response1; import com.segment.publicapi.models.GetSource200Response; -import com.segment.publicapi.models.GetSource200Response1; import com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response; -import com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response1; import com.segment.publicapi.models.ListConnectedWarehousesFromSource200Response; -import com.segment.publicapi.models.ListConnectedWarehousesFromSource200Response1; import com.segment.publicapi.models.ListSchemaSettingsInSource200Response; import com.segment.publicapi.models.ListSources200Response; -import com.segment.publicapi.models.ListSources200Response1; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.ReplaceLabelsInSource200Response; -import com.segment.publicapi.models.ReplaceLabelsInSource200Response1; -import com.segment.publicapi.models.ReplaceLabelsInSourceAlphaInput; import com.segment.publicapi.models.ReplaceLabelsInSourceV1Input; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateSchemaSettingsInSource200Response; import com.segment.publicapi.models.UpdateSchemaSettingsInSourceV1Input; import com.segment.publicapi.models.UpdateSource200Response; -import com.segment.publicapi.models.UpdateSource200Response1; -import com.segment.publicapi.models.UpdateSourceAlphaInput; import com.segment.publicapi.models.UpdateSourceV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class SourcesApi { private ApiClient localVarApiClient; @@ -105,39 +82,47 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addLabelsToSource - * @param sourceId (required) - * @param addLabelsToSourceAlphaInput (required) + * + * @param sourceId (required) + * @param addLabelsToSourceV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addLabelsToSourceCall(String sourceId, AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addLabelsToSourceCall( + String sourceId, + AddLabelsToSourceV1Input addLabelsToSourceV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } - Object localVarPostBody = addLabelsToSourceAlphaInput; + Object localVarPostBody = addLabelsToSourceV1Input; // create path and map variables - String localVarPath = "/sources/{sourceId}/labels" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/labels" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -146,7 +131,10 @@ public okhttp3.Call addLabelsToSourceCall(String sourceId, AddLabelsToSourceAlph Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -154,133 +142,174 @@ public okhttp3.Call addLabelsToSourceCall(String sourceId, AddLabelsToSourceAlph } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addLabelsToSourceValidateBeforeCall(String sourceId, AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call addLabelsToSourceValidateBeforeCall( + String sourceId, + AddLabelsToSourceV1Input addLabelsToSourceV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling addLabelsToSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " addLabelsToSource(Async)"); } - - // verify the required parameter 'addLabelsToSourceAlphaInput' is set - if (addLabelsToSourceAlphaInput == null) { - throw new ApiException("Missing the required parameter 'addLabelsToSourceAlphaInput' when calling addLabelsToSource(Async)"); + + // verify the required parameter 'addLabelsToSourceV1Input' is set + if (addLabelsToSourceV1Input == null) { + throw new ApiException( + "Missing the required parameter 'addLabelsToSourceV1Input' when calling" + + " addLabelsToSource(Async)"); } - - okhttp3.Call localVarCall = addLabelsToSourceCall(sourceId, addLabelsToSourceAlphaInput, _callback); + okhttp3.Call localVarCall = + addLabelsToSourceCall(sourceId, addLabelsToSourceV1Input, _callback); return localVarCall; - } /** - * Add Labels to Source - * Adds an existing label to a Source. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. - * @param sourceId (required) - * @param addLabelsToSourceAlphaInput (required) + * Add Labels to Source Adds an existing label to a Source. When called, this endpoint may + * generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * + * @param sourceId (required) + * @param addLabelsToSourceV1Input (required) * @return AddLabelsToSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public AddLabelsToSource200Response addLabelsToSource(String sourceId, AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput) throws ApiException { - ApiResponse localVarResp = addLabelsToSourceWithHttpInfo(sourceId, addLabelsToSourceAlphaInput); + public AddLabelsToSource200Response addLabelsToSource( + String sourceId, AddLabelsToSourceV1Input addLabelsToSourceV1Input) + throws ApiException { + ApiResponse localVarResp = + addLabelsToSourceWithHttpInfo(sourceId, addLabelsToSourceV1Input); return localVarResp.getData(); } /** - * Add Labels to Source - * Adds an existing label to a Source. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. - * @param sourceId (required) - * @param addLabelsToSourceAlphaInput (required) + * Add Labels to Source Adds an existing label to a Source. When called, this endpoint may + * generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * + * @param sourceId (required) + * @param addLabelsToSourceV1Input (required) * @return ApiResponse<AddLabelsToSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse addLabelsToSourceWithHttpInfo(String sourceId, AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput) throws ApiException { - okhttp3.Call localVarCall = addLabelsToSourceValidateBeforeCall(sourceId, addLabelsToSourceAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse addLabelsToSourceWithHttpInfo( + String sourceId, AddLabelsToSourceV1Input addLabelsToSourceV1Input) + throws ApiException { + okhttp3.Call localVarCall = + addLabelsToSourceValidateBeforeCall(sourceId, addLabelsToSourceV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add Labels to Source (asynchronously) - * Adds an existing label to a Source. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. - * @param sourceId (required) - * @param addLabelsToSourceAlphaInput (required) + * Add Labels to Source (asynchronously) Adds an existing label to a Source. When called, this + * endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * + * @param sourceId (required) + * @param addLabelsToSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addLabelsToSourceAsync(String sourceId, AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addLabelsToSourceValidateBeforeCall(sourceId, addLabelsToSourceAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call addLabelsToSourceAsync( + String sourceId, + AddLabelsToSourceV1Input addLabelsToSourceV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addLabelsToSourceValidateBeforeCall(sourceId, addLabelsToSourceV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createSource - * @param createSourceAlphaInput (required) + * + * @param createSourceV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createSourceCall(CreateSourceAlphaInput createSourceAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSourceCall( + CreateSourceV1Input createSourceV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } - Object localVarPostBody = createSourceAlphaInput; + Object localVarPostBody = createSourceV1Input; // create path and map variables String localVarPath = "/sources"; @@ -292,7 +321,10 @@ public okhttp3.Call createSourceCall(CreateSourceAlphaInput createSourceAlphaInp Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -300,119 +332,149 @@ public okhttp3.Call createSourceCall(CreateSourceAlphaInput createSourceAlphaInp } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createSourceValidateBeforeCall(CreateSourceAlphaInput createSourceAlphaInput, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'createSourceAlphaInput' is set - if (createSourceAlphaInput == null) { - throw new ApiException("Missing the required parameter 'createSourceAlphaInput' when calling createSource(Async)"); + private okhttp3.Call createSourceValidateBeforeCall( + CreateSourceV1Input createSourceV1Input, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'createSourceV1Input' is set + if (createSourceV1Input == null) { + throw new ApiException( + "Missing the required parameter 'createSourceV1Input' when calling" + + " createSource(Async)"); } - - okhttp3.Call localVarCall = createSourceCall(createSourceAlphaInput, _callback); + okhttp3.Call localVarCall = createSourceCall(createSourceV1Input, _callback); return localVarCall; - } /** - * Create Source - * Creates a new Source. When called, this endpoint may generate the `Source Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createSourceAlphaInput (required) + * Create Source Creates a new Source. When called, this endpoint may generate the `Source + * Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createSourceV1Input (required) * @return CreateSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateSource200Response createSource(CreateSourceAlphaInput createSourceAlphaInput) throws ApiException { - ApiResponse localVarResp = createSourceWithHttpInfo(createSourceAlphaInput); + public CreateSource200Response createSource(CreateSourceV1Input createSourceV1Input) + throws ApiException { + ApiResponse localVarResp = + createSourceWithHttpInfo(createSourceV1Input); return localVarResp.getData(); } /** - * Create Source - * Creates a new Source. When called, this endpoint may generate the `Source Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createSourceAlphaInput (required) + * Create Source Creates a new Source. When called, this endpoint may generate the `Source + * Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createSourceV1Input (required) * @return ApiResponse<CreateSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createSourceWithHttpInfo(CreateSourceAlphaInput createSourceAlphaInput) throws ApiException { - okhttp3.Call localVarCall = createSourceValidateBeforeCall(createSourceAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createSourceWithHttpInfo( + CreateSourceV1Input createSourceV1Input) throws ApiException { + okhttp3.Call localVarCall = createSourceValidateBeforeCall(createSourceV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Source (asynchronously) - * Creates a new Source. When called, this endpoint may generate the `Source Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createSourceAlphaInput (required) + * Create Source (asynchronously) Creates a new Source. When called, this endpoint may generate + * the `Source Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createSourceAsync(CreateSourceAlphaInput createSourceAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createSourceAsync( + CreateSourceV1Input createSourceV1Input, + final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = createSourceValidateBeforeCall(createSourceAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createSourceValidateBeforeCall(createSourceV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteSource - * @param sourceId (required) + * + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -421,8 +483,11 @@ public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -431,53 +496,69 @@ public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callbac Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteSourceValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteSourceValidateBeforeCall( + String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling deleteSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling deleteSource(Async)"); } - okhttp3.Call localVarCall = deleteSourceCall(sourceId, _callback); return localVarCall; - } /** - * Delete Source - * Deletes an existing Source. When called, this endpoint may generate the `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param sourceId (required) + * Delete Source Deletes an existing Source. When called, this endpoint may generate the + * `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param sourceId (required) * @return DeleteSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteSource200Response deleteSource(String sourceId) throws ApiException { ApiResponse localVarResp = deleteSourceWithHttpInfo(sourceId); @@ -485,73 +566,82 @@ public DeleteSource200Response deleteSource(String sourceId) throws ApiException } /** - * Delete Source - * Deletes an existing Source. When called, this endpoint may generate the `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param sourceId (required) + * Delete Source Deletes an existing Source. When called, this endpoint may generate the + * `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param sourceId (required) * @return ApiResponse<DeleteSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteSourceWithHttpInfo(String sourceId) throws ApiException { + public ApiResponse deleteSourceWithHttpInfo(String sourceId) + throws ApiException { okhttp3.Call localVarCall = deleteSourceValidateBeforeCall(sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Source (asynchronously) - * Deletes an existing Source. When called, this endpoint may generate the `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param sourceId (required) + * Delete Source (asynchronously) Deletes an existing Source. When called, this endpoint may + * generate the `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteSourceAsync(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteSourceAsync( + String sourceId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteSourceValidateBeforeCall(sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSource - * @param sourceId (required) + * + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -560,8 +650,11 @@ public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -570,53 +663,68 @@ public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getSourceValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getSourceValidateBeforeCall(String sourceId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling getSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling getSource(Async)"); } - okhttp3.Call localVarCall = getSourceCall(sourceId, _callback); return localVarCall; - } /** - * Get Source - * Returns a Source by its id. - * @param sourceId (required) + * Get Source Returns a Source by its id. + * + * @param sourceId (required) * @return GetSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetSource200Response getSource(String sourceId) throws ApiException { ApiResponse localVarResp = getSourceWithHttpInfo(sourceId); @@ -624,74 +732,83 @@ public GetSource200Response getSource(String sourceId) throws ApiException { } /** - * Get Source - * Returns a Source by its id. - * @param sourceId (required) + * Get Source Returns a Source by its id. + * + * @param sourceId (required) * @return ApiResponse<GetSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getSourceWithHttpInfo(String sourceId) throws ApiException { + public ApiResponse getSourceWithHttpInfo(String sourceId) + throws ApiException { okhttp3.Call localVarCall = getSourceValidateBeforeCall(sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Source (asynchronously) - * Returns a Source by its id. - * @param sourceId (required) + * Get Source (asynchronously) Returns a Source by its id. + * + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSourceAsync(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSourceAsync( + String sourceId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getSourceValidateBeforeCall(sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listConnectedDestinationsFromSource - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listConnectedDestinationsFromSourceCall(String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listConnectedDestinationsFromSourceCall( + String sourceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -700,8 +817,11 @@ public okhttp3.Call listConnectedDestinationsFromSourceCall(String sourceId, Pag Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}/connected-destinations" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/connected-destinations" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -714,136 +834,179 @@ public okhttp3.Call listConnectedDestinationsFromSourceCall(String sourceId, Pag } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listConnectedDestinationsFromSourceValidateBeforeCall(String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listConnectedDestinationsFromSourceValidateBeforeCall( + String sourceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listConnectedDestinationsFromSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listConnectedDestinationsFromSource(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listConnectedDestinationsFromSource(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listConnectedDestinationsFromSource(Async)"); } - - okhttp3.Call localVarCall = listConnectedDestinationsFromSourceCall(sourceId, pagination, _callback); + okhttp3.Call localVarCall = + listConnectedDestinationsFromSourceCall(sourceId, pagination, _callback); return localVarCall; - } /** - * List Connected Destinations from Source - * Returns a list of Destinations connected to a Source. - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * List Connected Destinations from Source Returns a list of Destinations connected to a Source. + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @return ListConnectedDestinationsFromSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListConnectedDestinationsFromSource200Response listConnectedDestinationsFromSource(String sourceId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listConnectedDestinationsFromSourceWithHttpInfo(sourceId, pagination); + public ListConnectedDestinationsFromSource200Response listConnectedDestinationsFromSource( + String sourceId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listConnectedDestinationsFromSourceWithHttpInfo(sourceId, pagination); return localVarResp.getData(); } /** - * List Connected Destinations from Source - * Returns a list of Destinations connected to a Source. - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * List Connected Destinations from Source Returns a list of Destinations connected to a Source. + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @return ApiResponse<ListConnectedDestinationsFromSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listConnectedDestinationsFromSourceWithHttpInfo(String sourceId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listConnectedDestinationsFromSourceValidateBeforeCall(sourceId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listConnectedDestinationsFromSourceWithHttpInfo( + String sourceId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listConnectedDestinationsFromSourceValidateBeforeCall(sourceId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Connected Destinations from Source (asynchronously) - * Returns a list of Destinations connected to a Source. - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * List Connected Destinations from Source (asynchronously) Returns a list of Destinations + * connected to a Source. + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listConnectedDestinationsFromSourceAsync(String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listConnectedDestinationsFromSourceValidateBeforeCall(sourceId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listConnectedDestinationsFromSourceAsync( + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listConnectedDestinationsFromSourceValidateBeforeCall( + sourceId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listConnectedWarehousesFromSource - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listConnectedWarehousesFromSourceCall(String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listConnectedWarehousesFromSourceCall( + String sourceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -852,8 +1015,11 @@ public okhttp3.Call listConnectedWarehousesFromSourceCall(String sourceId, Pagin Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}/connected-warehouses" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/connected-warehouses" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -866,135 +1032,176 @@ public okhttp3.Call listConnectedWarehousesFromSourceCall(String sourceId, Pagin } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listConnectedWarehousesFromSourceValidateBeforeCall(String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listConnectedWarehousesFromSourceValidateBeforeCall( + String sourceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listConnectedWarehousesFromSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listConnectedWarehousesFromSource(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listConnectedWarehousesFromSource(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listConnectedWarehousesFromSource(Async)"); } - - okhttp3.Call localVarCall = listConnectedWarehousesFromSourceCall(sourceId, pagination, _callback); + okhttp3.Call localVarCall = + listConnectedWarehousesFromSourceCall(sourceId, pagination, _callback); return localVarCall; - } /** - * List Connected Warehouses from Source - * Returns a list of Warehouses connected to a Source. - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * List Connected Warehouses from Source Returns a list of Warehouses connected to a Source. + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @return ListConnectedWarehousesFromSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListConnectedWarehousesFromSource200Response listConnectedWarehousesFromSource(String sourceId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listConnectedWarehousesFromSourceWithHttpInfo(sourceId, pagination); + public ListConnectedWarehousesFromSource200Response listConnectedWarehousesFromSource( + String sourceId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listConnectedWarehousesFromSourceWithHttpInfo(sourceId, pagination); return localVarResp.getData(); } /** - * List Connected Warehouses from Source - * Returns a list of Warehouses connected to a Source. - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * List Connected Warehouses from Source Returns a list of Warehouses connected to a Source. + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @return ApiResponse<ListConnectedWarehousesFromSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listConnectedWarehousesFromSourceWithHttpInfo(String sourceId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listConnectedWarehousesFromSourceValidateBeforeCall(sourceId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listConnectedWarehousesFromSourceWithHttpInfo( + String sourceId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listConnectedWarehousesFromSourceValidateBeforeCall(sourceId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Connected Warehouses from Source (asynchronously) - * Returns a list of Warehouses connected to a Source. - * @param sourceId (required) - * @param pagination Required pagination params for the request. This parameter exists in beta. (required) + * List Connected Warehouses from Source (asynchronously) Returns a list of Warehouses connected + * to a Source. + * + * @param sourceId (required) + * @param pagination Required pagination params for the request. This parameter exists in alpha. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listConnectedWarehousesFromSourceAsync(String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listConnectedWarehousesFromSourceValidateBeforeCall(sourceId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listConnectedWarehousesFromSourceAsync( + String sourceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listConnectedWarehousesFromSourceValidateBeforeCall( + sourceId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSchemaSettingsInSource - * @param sourceId (required) + * + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1003,8 +1210,11 @@ public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCal Object localVarPostBody = null; // create path and map variables - String localVarPath = "/sources/{sourceId}/settings" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/settings" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1013,127 +1223,162 @@ public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCal Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSchemaSettingsInSourceValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSchemaSettingsInSourceValidateBeforeCall( + String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling listSchemaSettingsInSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " listSchemaSettingsInSource(Async)"); } - okhttp3.Call localVarCall = listSchemaSettingsInSourceCall(sourceId, _callback); return localVarCall; - } /** - * List Schema Settings in Source - * Retrieves the schema configuration settings for a Source. If Protocols is not enabled for the Source, the configurations specific to Protocols will have default values. - * @param sourceId (required) + * List Schema Settings in Source Retrieves the schema configuration settings for a Source. If + * Protocols is not enabled for the Source, the configurations specific to Protocols will have + * default values. + * + * @param sourceId (required) * @return ListSchemaSettingsInSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSchemaSettingsInSource200Response listSchemaSettingsInSource(String sourceId) throws ApiException { - ApiResponse localVarResp = listSchemaSettingsInSourceWithHttpInfo(sourceId); + public ListSchemaSettingsInSource200Response listSchemaSettingsInSource(String sourceId) + throws ApiException { + ApiResponse localVarResp = + listSchemaSettingsInSourceWithHttpInfo(sourceId); return localVarResp.getData(); } /** - * List Schema Settings in Source - * Retrieves the schema configuration settings for a Source. If Protocols is not enabled for the Source, the configurations specific to Protocols will have default values. - * @param sourceId (required) + * List Schema Settings in Source Retrieves the schema configuration settings for a Source. If + * Protocols is not enabled for the Source, the configurations specific to Protocols will have + * default values. + * + * @param sourceId (required) * @return ApiResponse<ListSchemaSettingsInSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSchemaSettingsInSourceWithHttpInfo(String sourceId) throws ApiException { + public ApiResponse + listSchemaSettingsInSourceWithHttpInfo(String sourceId) throws ApiException { okhttp3.Call localVarCall = listSchemaSettingsInSourceValidateBeforeCall(sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Schema Settings in Source (asynchronously) - * Retrieves the schema configuration settings for a Source. If Protocols is not enabled for the Source, the configurations specific to Protocols will have default values. - * @param sourceId (required) + * List Schema Settings in Source (asynchronously) Retrieves the schema configuration settings + * for a Source. If Protocols is not enabled for the Source, the configurations specific to + * Protocols will have default values. + * + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSchemaSettingsInSourceAsync(String sourceId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listSchemaSettingsInSourceValidateBeforeCall(sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listSchemaSettingsInSourceAsync( + String sourceId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSchemaSettingsInSourceValidateBeforeCall(sourceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSources - * @param pagination Defines the pagination parameters. This parameter exists in beta. (required) + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSourcesCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSourcesCall(PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1155,53 +1400,69 @@ public okhttp3.Call listSourcesCall(PaginationInput pagination, final ApiCallbac } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSourcesValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSourcesValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSources(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling listSources(Async)"); } - okhttp3.Call localVarCall = listSourcesCall(pagination, _callback); return localVarCall; - } /** - * List Sources - * Returns a list of Sources. - * @param pagination Defines the pagination parameters. This parameter exists in beta. (required) + * List Sources Returns a list of Sources. + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) * @return ListSources200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ListSources200Response listSources(PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listSourcesWithHttpInfo(pagination); @@ -1209,84 +1470,99 @@ public ListSources200Response listSources(PaginationInput pagination) throws Api } /** - * List Sources - * Returns a list of Sources. - * @param pagination Defines the pagination parameters. This parameter exists in beta. (required) + * List Sources Returns a list of Sources. + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) * @return ApiResponse<ListSources200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSourcesWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listSourcesWithHttpInfo(PaginationInput pagination) + throws ApiException { okhttp3.Call localVarCall = listSourcesValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Sources (asynchronously) - * Returns a list of Sources. - * @param pagination Defines the pagination parameters. This parameter exists in beta. (required) + * List Sources (asynchronously) Returns a list of Sources. + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSourcesAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSourcesAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listSourcesValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replaceLabelsInSource - * @param sourceId (required) - * @param replaceLabelsInSourceAlphaInput (required) + * + * @param sourceId (required) + * @param replaceLabelsInSourceV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceLabelsInSourceCall(String sourceId, ReplaceLabelsInSourceAlphaInput replaceLabelsInSourceAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replaceLabelsInSourceCall( + String sourceId, + ReplaceLabelsInSourceV1Input replaceLabelsInSourceV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } - Object localVarPostBody = replaceLabelsInSourceAlphaInput; + Object localVarPostBody = replaceLabelsInSourceV1Input; // create path and map variables - String localVarPath = "/sources/{sourceId}/labels" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/labels" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1295,7 +1571,10 @@ public okhttp3.Call replaceLabelsInSourceCall(String sourceId, ReplaceLabelsInSo Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1303,128 +1582,170 @@ public okhttp3.Call replaceLabelsInSourceCall(String sourceId, ReplaceLabelsInSo } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replaceLabelsInSourceValidateBeforeCall(String sourceId, ReplaceLabelsInSourceAlphaInput replaceLabelsInSourceAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replaceLabelsInSourceValidateBeforeCall( + String sourceId, + ReplaceLabelsInSourceV1Input replaceLabelsInSourceV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling replaceLabelsInSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " replaceLabelsInSource(Async)"); } - - // verify the required parameter 'replaceLabelsInSourceAlphaInput' is set - if (replaceLabelsInSourceAlphaInput == null) { - throw new ApiException("Missing the required parameter 'replaceLabelsInSourceAlphaInput' when calling replaceLabelsInSource(Async)"); + + // verify the required parameter 'replaceLabelsInSourceV1Input' is set + if (replaceLabelsInSourceV1Input == null) { + throw new ApiException( + "Missing the required parameter 'replaceLabelsInSourceV1Input' when calling" + + " replaceLabelsInSource(Async)"); } - - okhttp3.Call localVarCall = replaceLabelsInSourceCall(sourceId, replaceLabelsInSourceAlphaInput, _callback); + okhttp3.Call localVarCall = + replaceLabelsInSourceCall(sourceId, replaceLabelsInSourceV1Input, _callback); return localVarCall; - } /** - * Replace Labels in Source - * Replaces all labels in a Source. - * @param sourceId (required) - * @param replaceLabelsInSourceAlphaInput (required) + * Replace Labels in Source Replaces all labels in a Source. + * + * @param sourceId (required) + * @param replaceLabelsInSourceV1Input (required) * @return ReplaceLabelsInSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplaceLabelsInSource200Response replaceLabelsInSource(String sourceId, ReplaceLabelsInSourceAlphaInput replaceLabelsInSourceAlphaInput) throws ApiException { - ApiResponse localVarResp = replaceLabelsInSourceWithHttpInfo(sourceId, replaceLabelsInSourceAlphaInput); + public ReplaceLabelsInSource200Response replaceLabelsInSource( + String sourceId, ReplaceLabelsInSourceV1Input replaceLabelsInSourceV1Input) + throws ApiException { + ApiResponse localVarResp = + replaceLabelsInSourceWithHttpInfo(sourceId, replaceLabelsInSourceV1Input); return localVarResp.getData(); } /** - * Replace Labels in Source - * Replaces all labels in a Source. - * @param sourceId (required) - * @param replaceLabelsInSourceAlphaInput (required) + * Replace Labels in Source Replaces all labels in a Source. + * + * @param sourceId (required) + * @param replaceLabelsInSourceV1Input (required) * @return ApiResponse<ReplaceLabelsInSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replaceLabelsInSourceWithHttpInfo(String sourceId, ReplaceLabelsInSourceAlphaInput replaceLabelsInSourceAlphaInput) throws ApiException { - okhttp3.Call localVarCall = replaceLabelsInSourceValidateBeforeCall(sourceId, replaceLabelsInSourceAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse replaceLabelsInSourceWithHttpInfo( + String sourceId, ReplaceLabelsInSourceV1Input replaceLabelsInSourceV1Input) + throws ApiException { + okhttp3.Call localVarCall = + replaceLabelsInSourceValidateBeforeCall( + sourceId, replaceLabelsInSourceV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Labels in Source (asynchronously) - * Replaces all labels in a Source. - * @param sourceId (required) - * @param replaceLabelsInSourceAlphaInput (required) + * Replace Labels in Source (asynchronously) Replaces all labels in a Source. + * + * @param sourceId (required) + * @param replaceLabelsInSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceLabelsInSourceAsync(String sourceId, ReplaceLabelsInSourceAlphaInput replaceLabelsInSourceAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceLabelsInSourceValidateBeforeCall(sourceId, replaceLabelsInSourceAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replaceLabelsInSourceAsync( + String sourceId, + ReplaceLabelsInSourceV1Input replaceLabelsInSourceV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replaceLabelsInSourceValidateBeforeCall( + sourceId, replaceLabelsInSourceV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateSchemaSettingsInSource - * @param sourceId (required) - * @param updateSchemaSettingsInSourceV1Input (required) + * + * @param sourceId (required) + * @param updateSchemaSettingsInSourceV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSchemaSettingsInSourceCall(String sourceId, UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSchemaSettingsInSourceCall( + String sourceId, + UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1433,8 +1754,11 @@ public okhttp3.Call updateSchemaSettingsInSourceCall(String sourceId, UpdateSche Object localVarPostBody = updateSchemaSettingsInSourceV1Input; // create path and map variables - String localVarPath = "/sources/{sourceId}/settings" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}/settings" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1443,7 +1767,10 @@ public okhttp3.Call updateSchemaSettingsInSourceCall(String sourceId, UpdateSche Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1451,138 +1778,194 @@ public okhttp3.Call updateSchemaSettingsInSourceCall(String sourceId, UpdateSche } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSchemaSettingsInSourceValidateBeforeCall(String sourceId, UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateSchemaSettingsInSourceValidateBeforeCall( + String sourceId, + UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling updateSchemaSettingsInSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " updateSchemaSettingsInSource(Async)"); } - + // verify the required parameter 'updateSchemaSettingsInSourceV1Input' is set if (updateSchemaSettingsInSourceV1Input == null) { - throw new ApiException("Missing the required parameter 'updateSchemaSettingsInSourceV1Input' when calling updateSchemaSettingsInSource(Async)"); + throw new ApiException( + "Missing the required parameter 'updateSchemaSettingsInSourceV1Input' when" + + " calling updateSchemaSettingsInSource(Async)"); } - - okhttp3.Call localVarCall = updateSchemaSettingsInSourceCall(sourceId, updateSchemaSettingsInSourceV1Input, _callback); + okhttp3.Call localVarCall = + updateSchemaSettingsInSourceCall( + sourceId, updateSchemaSettingsInSourceV1Input, _callback); return localVarCall; - } /** - * Update Schema Settings in Source - * Updates the schema configuration for a Source. If Protocols is not enabled for the Source, any updates to Protocols-specific configurations will not be applied. Config API omitted fields: - `updateMask` - * @param sourceId (required) - * @param updateSchemaSettingsInSourceV1Input (required) + * Update Schema Settings in Source Updates the schema configuration for a Source. If Protocols + * is not enabled for the Source, any updates to Protocols-specific configurations will not be + * applied. Config API omitted fields: - `updateMask` + * + * @param sourceId (required) + * @param updateSchemaSettingsInSourceV1Input (required) * @return UpdateSchemaSettingsInSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateSchemaSettingsInSource200Response updateSchemaSettingsInSource(String sourceId, UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input) throws ApiException { - ApiResponse localVarResp = updateSchemaSettingsInSourceWithHttpInfo(sourceId, updateSchemaSettingsInSourceV1Input); + public UpdateSchemaSettingsInSource200Response updateSchemaSettingsInSource( + String sourceId, + UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input) + throws ApiException { + ApiResponse localVarResp = + updateSchemaSettingsInSourceWithHttpInfo( + sourceId, updateSchemaSettingsInSourceV1Input); return localVarResp.getData(); } /** - * Update Schema Settings in Source - * Updates the schema configuration for a Source. If Protocols is not enabled for the Source, any updates to Protocols-specific configurations will not be applied. Config API omitted fields: - `updateMask` - * @param sourceId (required) - * @param updateSchemaSettingsInSourceV1Input (required) + * Update Schema Settings in Source Updates the schema configuration for a Source. If Protocols + * is not enabled for the Source, any updates to Protocols-specific configurations will not be + * applied. Config API omitted fields: - `updateMask` + * + * @param sourceId (required) + * @param updateSchemaSettingsInSourceV1Input (required) * @return ApiResponse<UpdateSchemaSettingsInSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateSchemaSettingsInSourceWithHttpInfo(String sourceId, UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input) throws ApiException { - okhttp3.Call localVarCall = updateSchemaSettingsInSourceValidateBeforeCall(sourceId, updateSchemaSettingsInSourceV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + updateSchemaSettingsInSourceWithHttpInfo( + String sourceId, + UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input) + throws ApiException { + okhttp3.Call localVarCall = + updateSchemaSettingsInSourceValidateBeforeCall( + sourceId, updateSchemaSettingsInSourceV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Schema Settings in Source (asynchronously) - * Updates the schema configuration for a Source. If Protocols is not enabled for the Source, any updates to Protocols-specific configurations will not be applied. Config API omitted fields: - `updateMask` - * @param sourceId (required) - * @param updateSchemaSettingsInSourceV1Input (required) + * Update Schema Settings in Source (asynchronously) Updates the schema configuration for a + * Source. If Protocols is not enabled for the Source, any updates to Protocols-specific + * configurations will not be applied. Config API omitted fields: - `updateMask` + * + * @param sourceId (required) + * @param updateSchemaSettingsInSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSchemaSettingsInSourceAsync(String sourceId, UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSchemaSettingsInSourceValidateBeforeCall(sourceId, updateSchemaSettingsInSourceV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateSchemaSettingsInSourceAsync( + String sourceId, + UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSchemaSettingsInSourceValidateBeforeCall( + sourceId, updateSchemaSettingsInSourceV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateSource - * @param sourceId (required) - * @param updateSourceAlphaInput (required) + * + * @param sourceId (required) + * @param updateSourceV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSourceCall(String sourceId, UpdateSourceAlphaInput updateSourceAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateSourceCall( + String sourceId, UpdateSourceV1Input updateSourceV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } - Object localVarPostBody = updateSourceAlphaInput; + Object localVarPostBody = updateSourceV1Input; // create path and map variables - String localVarPath = "/sources/{sourceId}" - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/sources/{sourceId}" + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1591,7 +1974,10 @@ public okhttp3.Call updateSourceCall(String sourceId, UpdateSourceAlphaInput upd Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1599,100 +1985,138 @@ public okhttp3.Call updateSourceCall(String sourceId, UpdateSourceAlphaInput upd } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateSourceValidateBeforeCall(String sourceId, UpdateSourceAlphaInput updateSourceAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateSourceValidateBeforeCall( + String sourceId, UpdateSourceV1Input updateSourceV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling updateSource(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling updateSource(Async)"); } - - // verify the required parameter 'updateSourceAlphaInput' is set - if (updateSourceAlphaInput == null) { - throw new ApiException("Missing the required parameter 'updateSourceAlphaInput' when calling updateSource(Async)"); + + // verify the required parameter 'updateSourceV1Input' is set + if (updateSourceV1Input == null) { + throw new ApiException( + "Missing the required parameter 'updateSourceV1Input' when calling" + + " updateSource(Async)"); } - - okhttp3.Call localVarCall = updateSourceCall(sourceId, updateSourceAlphaInput, _callback); + okhttp3.Call localVarCall = updateSourceCall(sourceId, updateSourceV1Input, _callback); return localVarCall; - } /** - * Update Source - * Updates an existing Source. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted fields: - `updateMask` - * @param sourceId (required) - * @param updateSourceAlphaInput (required) + * Update Source Updates an existing Source. When called, this endpoint may generate one or more + * of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * + * Source Settings Modified * Source Disabled Config API omitted fields: - + * `updateMask` + * + * @param sourceId (required) + * @param updateSourceV1Input (required) * @return UpdateSource200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateSource200Response updateSource(String sourceId, UpdateSourceAlphaInput updateSourceAlphaInput) throws ApiException { - ApiResponse localVarResp = updateSourceWithHttpInfo(sourceId, updateSourceAlphaInput); + public UpdateSource200Response updateSource( + String sourceId, UpdateSourceV1Input updateSourceV1Input) throws ApiException { + ApiResponse localVarResp = + updateSourceWithHttpInfo(sourceId, updateSourceV1Input); return localVarResp.getData(); } /** - * Update Source - * Updates an existing Source. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted fields: - `updateMask` - * @param sourceId (required) - * @param updateSourceAlphaInput (required) + * Update Source Updates an existing Source. When called, this endpoint may generate one or more + * of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * + * Source Settings Modified * Source Disabled Config API omitted fields: - + * `updateMask` + * + * @param sourceId (required) + * @param updateSourceV1Input (required) * @return ApiResponse<UpdateSource200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateSourceWithHttpInfo(String sourceId, UpdateSourceAlphaInput updateSourceAlphaInput) throws ApiException { - okhttp3.Call localVarCall = updateSourceValidateBeforeCall(sourceId, updateSourceAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateSourceWithHttpInfo( + String sourceId, UpdateSourceV1Input updateSourceV1Input) throws ApiException { + okhttp3.Call localVarCall = + updateSourceValidateBeforeCall(sourceId, updateSourceV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Source (asynchronously) - * Updates an existing Source. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted fields: - `updateMask` - * @param sourceId (required) - * @param updateSourceAlphaInput (required) + * Update Source (asynchronously) Updates an existing Source. When called, this endpoint may + * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Source + * Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted + * fields: - `updateMask` + * + * @param sourceId (required) + * @param updateSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateSourceAsync(String sourceId, UpdateSourceAlphaInput updateSourceAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateSourceValidateBeforeCall(sourceId, updateSourceAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateSourceAsync( + String sourceId, + UpdateSourceV1Input updateSourceV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSourceValidateBeforeCall(sourceId, updateSourceV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 7d8da271..9aa5c813 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,36 +10,26 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpace200Response; import com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaInput; import com.segment.publicapi.models.GetSpace200Response; import com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpaces200Response; import com.segment.publicapi.models.ReplaceMessagingSubscriptionsInSpacesAlphaInput; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class SpacesApi { private ApiClient localVarApiClient; @@ -80,29 +70,35 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for batchQueryMessagingSubscriptionsForSpace - * @param spaceId (required) - * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) + * + * @param spaceId (required) + * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceCall(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceCall( + String spaceId, + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + batchQueryMessagingSubscriptionsForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -111,8 +107,11 @@ public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceCall(String spaceId, Object localVarPostBody = batchQueryMessagingSubscriptionsForSpaceAlphaInput; // create path and map variables - String localVarPath = "/spaces/{spaceId}/messaging-subscriptions/batch" - .replaceAll("\\{" + "spaceId" + "\\}", localVarApiClient.escapeString(spaceId.toString())); + String localVarPath = + "/spaces/{spaceId}/messaging-subscriptions/batch" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -128,128 +127,177 @@ public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceCall(String spaceId, localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( + String spaceId, + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + batchQueryMessagingSubscriptionsForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set if (spaceId == null) { - throw new ApiException("Missing the required parameter 'spaceId' when calling batchQueryMessagingSubscriptionsForSpace(Async)"); + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " batchQueryMessagingSubscriptionsForSpace(Async)"); } - + // verify the required parameter 'batchQueryMessagingSubscriptionsForSpaceAlphaInput' is set if (batchQueryMessagingSubscriptionsForSpaceAlphaInput == null) { - throw new ApiException("Missing the required parameter 'batchQueryMessagingSubscriptionsForSpaceAlphaInput' when calling batchQueryMessagingSubscriptionsForSpace(Async)"); + throw new ApiException( + "Missing the required parameter" + + " 'batchQueryMessagingSubscriptionsForSpaceAlphaInput' when calling" + + " batchQueryMessagingSubscriptionsForSpace(Async)"); } - - okhttp3.Call localVarCall = batchQueryMessagingSubscriptionsForSpaceCall(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback); + okhttp3.Call localVarCall = + batchQueryMessagingSubscriptionsForSpaceCall( + spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback); return localVarCall; - } /** - * Batch Query Messaging Subscriptions for Space - * Get Messaging Subscriptions for space. - * @param spaceId (required) - * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) + * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. + * + * @param spaceId (required) + * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) * @return BatchQueryMessagingSubscriptionsForSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public BatchQueryMessagingSubscriptionsForSpace200Response batchQueryMessagingSubscriptionsForSpace(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput) throws ApiException { - ApiResponse localVarResp = batchQueryMessagingSubscriptionsForSpaceWithHttpInfo(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput); + public BatchQueryMessagingSubscriptionsForSpace200Response + batchQueryMessagingSubscriptionsForSpace( + String spaceId, + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + batchQueryMessagingSubscriptionsForSpaceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + batchQueryMessagingSubscriptionsForSpaceWithHttpInfo( + spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput); return localVarResp.getData(); } /** - * Batch Query Messaging Subscriptions for Space - * Get Messaging Subscriptions for space. - * @param spaceId (required) - * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) + * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. + * + * @param spaceId (required) + * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) * @return ApiResponse<BatchQueryMessagingSubscriptionsForSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse batchQueryMessagingSubscriptionsForSpaceWithHttpInfo(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput) throws ApiException { - okhttp3.Call localVarCall = batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + batchQueryMessagingSubscriptionsForSpaceWithHttpInfo( + String spaceId, + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + batchQueryMessagingSubscriptionsForSpaceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( + spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Batch Query Messaging Subscriptions for Space (asynchronously) - * Get Messaging Subscriptions for space. - * @param spaceId (required) - * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) + * Batch Query Messaging Subscriptions for Space (asynchronously) Get Messaging Subscriptions + * for space. + * + * @param spaceId (required) + * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceAsync(String spaceId, BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall(spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceAsync( + String spaceId, + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + batchQueryMessagingSubscriptionsForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( + spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSpace - * @param spaceId (required) + * + * @param spaceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -258,8 +306,11 @@ public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) th Object localVarPostBody = null; // create path and map variables - String localVarPath = "/spaces/{spaceId}" - .replaceAll("\\{" + "spaceId" + "\\}", localVarApiClient.escapeString(spaceId.toString())); + String localVarPath = + "/spaces/{spaceId}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -275,46 +326,58 @@ public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) th localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getSpaceValidateBeforeCall(String spaceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getSpaceValidateBeforeCall(String spaceId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set if (spaceId == null) { - throw new ApiException("Missing the required parameter 'spaceId' when calling getSpace(Async)"); + throw new ApiException( + "Missing the required parameter 'spaceId' when calling getSpace(Async)"); } - okhttp3.Call localVarCall = getSpaceCall(spaceId, _callback); return localVarCall; - } /** - * Get Space - * Returns the Space by id. - * @param spaceId (required) + * Get Space Returns the Space by id. + * + * @param spaceId (required) * @return GetSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetSpace200Response getSpace(String spaceId) throws ApiException { ApiResponse localVarResp = getSpaceWithHttpInfo(spaceId); @@ -322,74 +385,84 @@ public GetSpace200Response getSpace(String spaceId) throws ApiException { } /** - * Get Space - * Returns the Space by id. - * @param spaceId (required) + * Get Space Returns the Space by id. + * + * @param spaceId (required) * @return ApiResponse<GetSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getSpaceWithHttpInfo(String spaceId) throws ApiException { + public ApiResponse getSpaceWithHttpInfo(String spaceId) + throws ApiException { okhttp3.Call localVarCall = getSpaceValidateBeforeCall(spaceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Space (asynchronously) - * Returns the Space by id. - * @param spaceId (required) + * Get Space (asynchronously) Returns the Space by id. + * + * @param spaceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getSpaceAsync(String spaceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getSpaceAsync( + String spaceId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getSpaceValidateBeforeCall(spaceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replaceMessagingSubscriptionsInSpaces - * @param spaceId (required) - * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) + * + * @param spaceId (required) + * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceMessagingSubscriptionsInSpacesCall(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replaceMessagingSubscriptionsInSpacesCall( + String spaceId, + ReplaceMessagingSubscriptionsInSpacesAlphaInput + replaceMessagingSubscriptionsInSpacesAlphaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -398,8 +471,11 @@ public okhttp3.Call replaceMessagingSubscriptionsInSpacesCall(String spaceId, Re Object localVarPostBody = replaceMessagingSubscriptionsInSpacesAlphaInput; // create path and map variables - String localVarPath = "/spaces/{spaceId}/messaging-subscriptions" - .replaceAll("\\{" + "spaceId" + "\\}", localVarApiClient.escapeString(spaceId.toString())); + String localVarPath = + "/spaces/{spaceId}/messaging-subscriptions" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -415,101 +491,158 @@ public okhttp3.Call replaceMessagingSubscriptionsInSpacesCall(String spaceId, Re localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall( + String spaceId, + ReplaceMessagingSubscriptionsInSpacesAlphaInput + replaceMessagingSubscriptionsInSpacesAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set if (spaceId == null) { - throw new ApiException("Missing the required parameter 'spaceId' when calling replaceMessagingSubscriptionsInSpaces(Async)"); + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " replaceMessagingSubscriptionsInSpaces(Async)"); } - + // verify the required parameter 'replaceMessagingSubscriptionsInSpacesAlphaInput' is set if (replaceMessagingSubscriptionsInSpacesAlphaInput == null) { - throw new ApiException("Missing the required parameter 'replaceMessagingSubscriptionsInSpacesAlphaInput' when calling replaceMessagingSubscriptionsInSpaces(Async)"); + throw new ApiException( + "Missing the required parameter" + + " 'replaceMessagingSubscriptionsInSpacesAlphaInput' when calling" + + " replaceMessagingSubscriptionsInSpaces(Async)"); } - - okhttp3.Call localVarCall = replaceMessagingSubscriptionsInSpacesCall(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback); + okhttp3.Call localVarCall = + replaceMessagingSubscriptionsInSpacesCall( + spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback); return localVarCall; - } /** - * Replace Messaging Subscriptions in Spaces - * Replace Messaging Subscriptions in Spaces. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param spaceId (required) - * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) + * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) * @return ReplaceMessagingSubscriptionsInSpaces200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscriptionsInSpaces(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput) throws ApiException { - ApiResponse localVarResp = replaceMessagingSubscriptionsInSpacesWithHttpInfo(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput); + public ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscriptionsInSpaces( + String spaceId, + ReplaceMessagingSubscriptionsInSpacesAlphaInput + replaceMessagingSubscriptionsInSpacesAlphaInput) + throws ApiException { + ApiResponse localVarResp = + replaceMessagingSubscriptionsInSpacesWithHttpInfo( + spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput); return localVarResp.getData(); } /** - * Replace Messaging Subscriptions in Spaces - * Replace Messaging Subscriptions in Spaces. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param spaceId (required) - * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) + * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) * @return ApiResponse<ReplaceMessagingSubscriptionsInSpaces200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replaceMessagingSubscriptionsInSpacesWithHttpInfo(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput) throws ApiException { - okhttp3.Call localVarCall = replaceMessagingSubscriptionsInSpacesValidateBeforeCall(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + replaceMessagingSubscriptionsInSpacesWithHttpInfo( + String spaceId, + ReplaceMessagingSubscriptionsInSpacesAlphaInput + replaceMessagingSubscriptionsInSpacesAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + replaceMessagingSubscriptionsInSpacesValidateBeforeCall( + spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Messaging Subscriptions in Spaces (asynchronously) - * Replace Messaging Subscriptions in Spaces. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param spaceId (required) - * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) + * Replace Messaging Subscriptions in Spaces (asynchronously) Replace Messaging Subscriptions in + * Spaces. The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceMessagingSubscriptionsInSpacesAsync(String spaceId, ReplaceMessagingSubscriptionsInSpacesAlphaInput replaceMessagingSubscriptionsInSpacesAlphaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceMessagingSubscriptionsInSpacesValidateBeforeCall(spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replaceMessagingSubscriptionsInSpacesAsync( + String spaceId, + ReplaceMessagingSubscriptionsInSpacesAlphaInput + replaceMessagingSubscriptionsInSpacesAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replaceMessagingSubscriptionsInSpacesValidateBeforeCall( + spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/TestingApi.java b/src/main/java/com/segment/publicapi/api/TestingApi.java index d8c5f709..f88ba694 100644 --- a/src/main/java/com/segment/publicapi/api/TestingApi.java +++ b/src/main/java/com/segment/publicapi/api/TestingApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,34 +10,23 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import java.math.BigDecimal; import com.segment.publicapi.models.Echo200Response; -import com.segment.publicapi.models.Echo200Response1; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class TestingApi { private ApiClient localVarApiClient; @@ -78,33 +67,51 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for echo - * @param message Sets the response `message` field. The response contains this field's entry. This parameter exists in v1. (required) - * @param delay The desired response delay, in milliseconds. This parameter exists in v1. (optional) - * @param triggerError If `true`, returns an HTTP `4xx` error that contains the string in `message`. This parameter exists in v1. (optional) - * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that contains the value of the `message` field in the error message array. This has no effect if the request sets `triggerError`. This parameter exists in v1. (optional) - * @param triggerUnexpectedError If `true`, triggers a `500` error. This has no effect if the request sets either `triggerError` or `triggerMultipleErrors`. This parameter exists in v1. (optional) - * @param statusCode Sets the HTTP status code to return. This parameter exists in v1. (optional) + * + * @param message Sets the response `message` field. The response contains this + * field's entry. This parameter exists in alpha. (required) + * @param delay The desired response delay, in milliseconds. This parameter exists in alpha. + * (optional) + * @param triggerError If `true`, returns an HTTP `4xx` error that contains + * the string in `message`. This parameter exists in alpha. (optional) + * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that + * contains the value of the `message` field in the error message array. This has + * no effect if the request sets `triggerError`. This parameter exists in alpha. + * (optional) + * @param triggerUnexpectedError If `true`, triggers a `500` error. This has + * no effect if the request sets either `triggerError` or + * `triggerMultipleErrors`. This parameter exists in alpha. (optional) + * @param statusCode Sets the HTTP status code to return. This parameter exists in alpha. + * (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call echoCall(String message, BigDecimal delay, Boolean triggerError, Boolean triggerMultipleErrors, Boolean triggerUnexpectedError, BigDecimal statusCode, final ApiCallback _callback) throws ApiException { + public okhttp3.Call echoCall( + String message, + BigDecimal delay, + Boolean triggerError, + Boolean triggerMultipleErrors, + Boolean triggerUnexpectedError, + BigDecimal statusCode, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -130,15 +137,20 @@ public okhttp3.Call echoCall(String message, BigDecimal delay, Boolean triggerEr } if (triggerError != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("triggerError", triggerError)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("triggerError", triggerError)); } if (triggerMultipleErrors != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("triggerMultipleErrors", triggerMultipleErrors)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "triggerMultipleErrors", triggerMultipleErrors)); } if (triggerUnexpectedError != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("triggerUnexpectedError", triggerUnexpectedError)); + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "triggerUnexpectedError", triggerUnexpectedError)); } if (statusCode != null) { @@ -146,115 +158,218 @@ public okhttp3.Call echoCall(String message, BigDecimal delay, Boolean triggerEr } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call echoValidateBeforeCall(String message, BigDecimal delay, Boolean triggerError, Boolean triggerMultipleErrors, Boolean triggerUnexpectedError, BigDecimal statusCode, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call echoValidateBeforeCall( + String message, + BigDecimal delay, + Boolean triggerError, + Boolean triggerMultipleErrors, + Boolean triggerUnexpectedError, + BigDecimal statusCode, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'message' is set if (message == null) { - throw new ApiException("Missing the required parameter 'message' when calling echo(Async)"); + throw new ApiException( + "Missing the required parameter 'message' when calling echo(Async)"); } - - okhttp3.Call localVarCall = echoCall(message, delay, triggerError, triggerMultipleErrors, triggerUnexpectedError, statusCode, _callback); + okhttp3.Call localVarCall = + echoCall( + message, + delay, + triggerError, + triggerMultipleErrors, + triggerUnexpectedError, + statusCode, + _callback); return localVarCall; - } /** - * Echo - * Public Echo endpoint. - * @param message Sets the response `message` field. The response contains this field's entry. This parameter exists in v1. (required) - * @param delay The desired response delay, in milliseconds. This parameter exists in v1. (optional) - * @param triggerError If `true`, returns an HTTP `4xx` error that contains the string in `message`. This parameter exists in v1. (optional) - * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that contains the value of the `message` field in the error message array. This has no effect if the request sets `triggerError`. This parameter exists in v1. (optional) - * @param triggerUnexpectedError If `true`, triggers a `500` error. This has no effect if the request sets either `triggerError` or `triggerMultipleErrors`. This parameter exists in v1. (optional) - * @param statusCode Sets the HTTP status code to return. This parameter exists in v1. (optional) + * Echo Public Echo endpoint. + * + * @param message Sets the response `message` field. The response contains this + * field's entry. This parameter exists in alpha. (required) + * @param delay The desired response delay, in milliseconds. This parameter exists in alpha. + * (optional) + * @param triggerError If `true`, returns an HTTP `4xx` error that contains + * the string in `message`. This parameter exists in alpha. (optional) + * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that + * contains the value of the `message` field in the error message array. This has + * no effect if the request sets `triggerError`. This parameter exists in alpha. + * (optional) + * @param triggerUnexpectedError If `true`, triggers a `500` error. This has + * no effect if the request sets either `triggerError` or + * `triggerMultipleErrors`. This parameter exists in alpha. (optional) + * @param statusCode Sets the HTTP status code to return. This parameter exists in alpha. + * (optional) * @return Echo200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public Echo200Response echo(String message, BigDecimal delay, Boolean triggerError, Boolean triggerMultipleErrors, Boolean triggerUnexpectedError, BigDecimal statusCode) throws ApiException { - ApiResponse localVarResp = echoWithHttpInfo(message, delay, triggerError, triggerMultipleErrors, triggerUnexpectedError, statusCode); + public Echo200Response echo( + String message, + BigDecimal delay, + Boolean triggerError, + Boolean triggerMultipleErrors, + Boolean triggerUnexpectedError, + BigDecimal statusCode) + throws ApiException { + ApiResponse localVarResp = + echoWithHttpInfo( + message, + delay, + triggerError, + triggerMultipleErrors, + triggerUnexpectedError, + statusCode); return localVarResp.getData(); } /** - * Echo - * Public Echo endpoint. - * @param message Sets the response `message` field. The response contains this field's entry. This parameter exists in v1. (required) - * @param delay The desired response delay, in milliseconds. This parameter exists in v1. (optional) - * @param triggerError If `true`, returns an HTTP `4xx` error that contains the string in `message`. This parameter exists in v1. (optional) - * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that contains the value of the `message` field in the error message array. This has no effect if the request sets `triggerError`. This parameter exists in v1. (optional) - * @param triggerUnexpectedError If `true`, triggers a `500` error. This has no effect if the request sets either `triggerError` or `triggerMultipleErrors`. This parameter exists in v1. (optional) - * @param statusCode Sets the HTTP status code to return. This parameter exists in v1. (optional) + * Echo Public Echo endpoint. + * + * @param message Sets the response `message` field. The response contains this + * field's entry. This parameter exists in alpha. (required) + * @param delay The desired response delay, in milliseconds. This parameter exists in alpha. + * (optional) + * @param triggerError If `true`, returns an HTTP `4xx` error that contains + * the string in `message`. This parameter exists in alpha. (optional) + * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that + * contains the value of the `message` field in the error message array. This has + * no effect if the request sets `triggerError`. This parameter exists in alpha. + * (optional) + * @param triggerUnexpectedError If `true`, triggers a `500` error. This has + * no effect if the request sets either `triggerError` or + * `triggerMultipleErrors`. This parameter exists in alpha. (optional) + * @param statusCode Sets the HTTP status code to return. This parameter exists in alpha. + * (optional) * @return ApiResponse<Echo200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse echoWithHttpInfo(String message, BigDecimal delay, Boolean triggerError, Boolean triggerMultipleErrors, Boolean triggerUnexpectedError, BigDecimal statusCode) throws ApiException { - okhttp3.Call localVarCall = echoValidateBeforeCall(message, delay, triggerError, triggerMultipleErrors, triggerUnexpectedError, statusCode, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse echoWithHttpInfo( + String message, + BigDecimal delay, + Boolean triggerError, + Boolean triggerMultipleErrors, + Boolean triggerUnexpectedError, + BigDecimal statusCode) + throws ApiException { + okhttp3.Call localVarCall = + echoValidateBeforeCall( + message, + delay, + triggerError, + triggerMultipleErrors, + triggerUnexpectedError, + statusCode, + null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Echo (asynchronously) - * Public Echo endpoint. - * @param message Sets the response `message` field. The response contains this field's entry. This parameter exists in v1. (required) - * @param delay The desired response delay, in milliseconds. This parameter exists in v1. (optional) - * @param triggerError If `true`, returns an HTTP `4xx` error that contains the string in `message`. This parameter exists in v1. (optional) - * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that contains the value of the `message` field in the error message array. This has no effect if the request sets `triggerError`. This parameter exists in v1. (optional) - * @param triggerUnexpectedError If `true`, triggers a `500` error. This has no effect if the request sets either `triggerError` or `triggerMultipleErrors`. This parameter exists in v1. (optional) - * @param statusCode Sets the HTTP status code to return. This parameter exists in v1. (optional) + * Echo (asynchronously) Public Echo endpoint. + * + * @param message Sets the response `message` field. The response contains this + * field's entry. This parameter exists in alpha. (required) + * @param delay The desired response delay, in milliseconds. This parameter exists in alpha. + * (optional) + * @param triggerError If `true`, returns an HTTP `4xx` error that contains + * the string in `message`. This parameter exists in alpha. (optional) + * @param triggerMultipleErrors If `true`, returns an HTTP `4xx` error that + * contains the value of the `message` field in the error message array. This has + * no effect if the request sets `triggerError`. This parameter exists in alpha. + * (optional) + * @param triggerUnexpectedError If `true`, triggers a `500` error. This has + * no effect if the request sets either `triggerError` or + * `triggerMultipleErrors`. This parameter exists in alpha. (optional) + * @param statusCode Sets the HTTP status code to return. This parameter exists in alpha. + * (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call echoAsync(String message, BigDecimal delay, Boolean triggerError, Boolean triggerMultipleErrors, Boolean triggerUnexpectedError, BigDecimal statusCode, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = echoValidateBeforeCall(message, delay, triggerError, triggerMultipleErrors, triggerUnexpectedError, statusCode, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call echoAsync( + String message, + BigDecimal delay, + Boolean triggerError, + Boolean triggerMultipleErrors, + Boolean triggerUnexpectedError, + BigDecimal statusCode, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + echoValidateBeforeCall( + message, + delay, + triggerError, + triggerMultipleErrors, + triggerUnexpectedError, + statusCode, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index 67e8fd2f..4f781ceb 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.AddSourceToTrackingPlan200Response; import com.segment.publicapi.models.AddSourceToTrackingPlanV1Input; import com.segment.publicapi.models.CreateTrackingPlan200Response; @@ -42,18 +35,15 @@ import com.segment.publicapi.models.RemoveSourceFromTrackingPlan200Response; import com.segment.publicapi.models.ReplaceRulesInTrackingPlan200Response; import com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Input; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateRulesInTrackingPlan200Response; import com.segment.publicapi.models.UpdateRulesInTrackingPlanV1Input; import com.segment.publicapi.models.UpdateTrackingPlan200Response; import com.segment.publicapi.models.UpdateTrackingPlanV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class TrackingPlansApi { private ApiClient localVarApiClient; @@ -94,29 +84,34 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addSourceToTrackingPlan - * @param trackingPlanId (required) - * @param addSourceToTrackingPlanV1Input (required) + * + * @param trackingPlanId (required) + * @param addSourceToTrackingPlanV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addSourceToTrackingPlanCall(String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addSourceToTrackingPlanCall( + String trackingPlanId, + AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -125,8 +120,11 @@ public okhttp3.Call addSourceToTrackingPlanCall(String trackingPlanId, AddSource Object localVarPostBody = addSourceToTrackingPlanV1Input; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/sources" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/sources" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -135,7 +133,10 @@ public okhttp3.Call addSourceToTrackingPlanCall(String trackingPlanId, AddSource Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -143,127 +144,180 @@ public okhttp3.Call addSourceToTrackingPlanCall(String trackingPlanId, AddSource } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addSourceToTrackingPlanValidateBeforeCall(String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call addSourceToTrackingPlanValidateBeforeCall( + String trackingPlanId, + AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling addSourceToTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " addSourceToTrackingPlan(Async)"); } - + // verify the required parameter 'addSourceToTrackingPlanV1Input' is set if (addSourceToTrackingPlanV1Input == null) { - throw new ApiException("Missing the required parameter 'addSourceToTrackingPlanV1Input' when calling addSourceToTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'addSourceToTrackingPlanV1Input' when calling" + + " addSourceToTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = addSourceToTrackingPlanCall(trackingPlanId, addSourceToTrackingPlanV1Input, _callback); + okhttp3.Call localVarCall = + addSourceToTrackingPlanCall( + trackingPlanId, addSourceToTrackingPlanV1Input, _callback); return localVarCall; - } /** - * Add Source to Tracking Plan - * Connects a Source to a Tracking Plan. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param addSourceToTrackingPlanV1Input (required) + * Add Source to Tracking Plan Connects a Source to a Tracking Plan. When called, this endpoint + * may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param trackingPlanId (required) + * @param addSourceToTrackingPlanV1Input (required) * @return AddSourceToTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public AddSourceToTrackingPlan200Response addSourceToTrackingPlan(String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input) throws ApiException { - ApiResponse localVarResp = addSourceToTrackingPlanWithHttpInfo(trackingPlanId, addSourceToTrackingPlanV1Input); + public AddSourceToTrackingPlan200Response addSourceToTrackingPlan( + String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input) + throws ApiException { + ApiResponse localVarResp = + addSourceToTrackingPlanWithHttpInfo(trackingPlanId, addSourceToTrackingPlanV1Input); return localVarResp.getData(); } /** - * Add Source to Tracking Plan - * Connects a Source to a Tracking Plan. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param addSourceToTrackingPlanV1Input (required) + * Add Source to Tracking Plan Connects a Source to a Tracking Plan. When called, this endpoint + * may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param trackingPlanId (required) + * @param addSourceToTrackingPlanV1Input (required) * @return ApiResponse<AddSourceToTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse addSourceToTrackingPlanWithHttpInfo(String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input) throws ApiException { - okhttp3.Call localVarCall = addSourceToTrackingPlanValidateBeforeCall(trackingPlanId, addSourceToTrackingPlanV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse addSourceToTrackingPlanWithHttpInfo( + String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input) + throws ApiException { + okhttp3.Call localVarCall = + addSourceToTrackingPlanValidateBeforeCall( + trackingPlanId, addSourceToTrackingPlanV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add Source to Tracking Plan (asynchronously) - * Connects a Source to a Tracking Plan. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param addSourceToTrackingPlanV1Input (required) + * Add Source to Tracking Plan (asynchronously) Connects a Source to a Tracking Plan. When + * called, this endpoint may generate the `Source Modified` [Audit + * Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param trackingPlanId (required) + * @param addSourceToTrackingPlanV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addSourceToTrackingPlanAsync(String trackingPlanId, AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addSourceToTrackingPlanValidateBeforeCall(trackingPlanId, addSourceToTrackingPlanV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call addSourceToTrackingPlanAsync( + String trackingPlanId, + AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addSourceToTrackingPlanValidateBeforeCall( + trackingPlanId, addSourceToTrackingPlanV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createTrackingPlan - * @param createTrackingPlanV1Input (required) + * + * @param createTrackingPlanV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createTrackingPlanCall(CreateTrackingPlanV1Input createTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createTrackingPlanCall( + CreateTrackingPlanV1Input createTrackingPlanV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -281,7 +335,10 @@ public okhttp3.Call createTrackingPlanCall(CreateTrackingPlanV1Input createTrack Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -289,119 +346,154 @@ public okhttp3.Call createTrackingPlanCall(CreateTrackingPlanV1Input createTrack } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createTrackingPlanValidateBeforeCall(CreateTrackingPlanV1Input createTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createTrackingPlanValidateBeforeCall( + CreateTrackingPlanV1Input createTrackingPlanV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createTrackingPlanV1Input' is set if (createTrackingPlanV1Input == null) { - throw new ApiException("Missing the required parameter 'createTrackingPlanV1Input' when calling createTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'createTrackingPlanV1Input' when calling" + + " createTrackingPlan(Async)"); } - okhttp3.Call localVarCall = createTrackingPlanCall(createTrackingPlanV1Input, _callback); return localVarCall; - } /** - * Create Tracking Plan - * Creates a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param createTrackingPlanV1Input (required) + * Create Tracking Plan Creates a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param createTrackingPlanV1Input (required) * @return CreateTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateTrackingPlan200Response createTrackingPlan(CreateTrackingPlanV1Input createTrackingPlanV1Input) throws ApiException { - ApiResponse localVarResp = createTrackingPlanWithHttpInfo(createTrackingPlanV1Input); + public CreateTrackingPlan200Response createTrackingPlan( + CreateTrackingPlanV1Input createTrackingPlanV1Input) throws ApiException { + ApiResponse localVarResp = + createTrackingPlanWithHttpInfo(createTrackingPlanV1Input); return localVarResp.getData(); } /** - * Create Tracking Plan - * Creates a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param createTrackingPlanV1Input (required) + * Create Tracking Plan Creates a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param createTrackingPlanV1Input (required) * @return ApiResponse<CreateTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createTrackingPlanWithHttpInfo(CreateTrackingPlanV1Input createTrackingPlanV1Input) throws ApiException { - okhttp3.Call localVarCall = createTrackingPlanValidateBeforeCall(createTrackingPlanV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createTrackingPlanWithHttpInfo( + CreateTrackingPlanV1Input createTrackingPlanV1Input) throws ApiException { + okhttp3.Call localVarCall = + createTrackingPlanValidateBeforeCall(createTrackingPlanV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Tracking Plan (asynchronously) - * Creates a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param createTrackingPlanV1Input (required) + * Create Tracking Plan (asynchronously) Creates a Tracking Plan. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param createTrackingPlanV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createTrackingPlanAsync(CreateTrackingPlanV1Input createTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createTrackingPlanValidateBeforeCall(createTrackingPlanV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createTrackingPlanAsync( + CreateTrackingPlanV1Input createTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createTrackingPlanValidateBeforeCall(createTrackingPlanV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteTrackingPlan - * @param trackingPlanId (required) + * + * @param trackingPlanId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -410,8 +502,11 @@ public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallb Object localVarPostBody = null; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -420,127 +515,158 @@ public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallb Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteTrackingPlanValidateBeforeCall(String trackingPlanId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteTrackingPlanValidateBeforeCall( + String trackingPlanId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling deleteTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " deleteTrackingPlan(Async)"); } - okhttp3.Call localVarCall = deleteTrackingPlanCall(trackingPlanId, _callback); return localVarCall; - } /** - * Delete Tracking Plan - * Deletes a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) + * Delete Tracking Plan Deletes a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param trackingPlanId (required) * @return DeleteTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public DeleteTrackingPlan200Response deleteTrackingPlan(String trackingPlanId) throws ApiException { - ApiResponse localVarResp = deleteTrackingPlanWithHttpInfo(trackingPlanId); + public DeleteTrackingPlan200Response deleteTrackingPlan(String trackingPlanId) + throws ApiException { + ApiResponse localVarResp = + deleteTrackingPlanWithHttpInfo(trackingPlanId); return localVarResp.getData(); } /** - * Delete Tracking Plan - * Deletes a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) + * Delete Tracking Plan Deletes a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param trackingPlanId (required) * @return ApiResponse<DeleteTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteTrackingPlanWithHttpInfo(String trackingPlanId) throws ApiException { + public ApiResponse deleteTrackingPlanWithHttpInfo( + String trackingPlanId) throws ApiException { okhttp3.Call localVarCall = deleteTrackingPlanValidateBeforeCall(trackingPlanId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Tracking Plan (asynchronously) - * Deletes a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) + * Delete Tracking Plan (asynchronously) Deletes a Tracking Plan. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteTrackingPlanAsync(String trackingPlanId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteTrackingPlanAsync( + String trackingPlanId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteTrackingPlanValidateBeforeCall(trackingPlanId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getTrackingPlan - * @param trackingPlanId (required) + * + * @param trackingPlanId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -549,8 +675,11 @@ public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback Object localVarPostBody = null; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -559,128 +688,159 @@ public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getTrackingPlanValidateBeforeCall(String trackingPlanId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getTrackingPlanValidateBeforeCall( + String trackingPlanId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling getTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " getTrackingPlan(Async)"); } - okhttp3.Call localVarCall = getTrackingPlanCall(trackingPlanId, _callback); return localVarCall; - } /** - * Get Tracking Plan - * Returns a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) + * Get Tracking Plan Returns a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param trackingPlanId (required) * @return GetTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetTrackingPlan200Response getTrackingPlan(String trackingPlanId) throws ApiException { - ApiResponse localVarResp = getTrackingPlanWithHttpInfo(trackingPlanId); + ApiResponse localVarResp = + getTrackingPlanWithHttpInfo(trackingPlanId); return localVarResp.getData(); } /** - * Get Tracking Plan - * Returns a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) + * Get Tracking Plan Returns a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param trackingPlanId (required) * @return ApiResponse<GetTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getTrackingPlanWithHttpInfo(String trackingPlanId) throws ApiException { + public ApiResponse getTrackingPlanWithHttpInfo( + String trackingPlanId) throws ApiException { okhttp3.Call localVarCall = getTrackingPlanValidateBeforeCall(trackingPlanId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Tracking Plan (asynchronously) - * Returns a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) + * Get Tracking Plan (asynchronously) Returns a Tracking Plan. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getTrackingPlanAsync(String trackingPlanId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getTrackingPlanAsync( + String trackingPlanId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getTrackingPlanValidateBeforeCall(trackingPlanId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listRulesFromTrackingPlan - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listRulesFromTrackingPlanCall(String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listRulesFromTrackingPlanCall( + String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -689,8 +849,11 @@ public okhttp3.Call listRulesFromTrackingPlanCall(String trackingPlanId, Paginat Object localVarPostBody = null; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/rules" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -703,136 +866,190 @@ public okhttp3.Call listRulesFromTrackingPlanCall(String trackingPlanId, Paginat } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listRulesFromTrackingPlanValidateBeforeCall(String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listRulesFromTrackingPlanValidateBeforeCall( + String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling listRulesFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " listRulesFromTrackingPlan(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listRulesFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listRulesFromTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = listRulesFromTrackingPlanCall(trackingPlanId, pagination, _callback); + okhttp3.Call localVarCall = + listRulesFromTrackingPlanCall(trackingPlanId, pagination, _callback); return localVarCall; - } /** - * List Rules from Tracking Plan - * Lists Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Rules from Tracking Plan Lists Tracking Plan rules. **Note**: In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 20 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListRulesFromTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListRulesFromTrackingPlan200Response listRulesFromTrackingPlan(String trackingPlanId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listRulesFromTrackingPlanWithHttpInfo(trackingPlanId, pagination); + public ListRulesFromTrackingPlan200Response listRulesFromTrackingPlan( + String trackingPlanId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listRulesFromTrackingPlanWithHttpInfo(trackingPlanId, pagination); return localVarResp.getData(); } /** - * List Rules from Tracking Plan - * Lists Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Rules from Tracking Plan Lists Tracking Plan rules. **Note**: In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 20 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListRulesFromTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listRulesFromTrackingPlanWithHttpInfo(String trackingPlanId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse listRulesFromTrackingPlanWithHttpInfo( + String trackingPlanId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Rules from Tracking Plan (asynchronously) - * Lists Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Rules from Tracking Plan (asynchronously) Lists Tracking Plan rules. **Note**: In order + * to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listRulesFromTrackingPlanAsync(String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listRulesFromTrackingPlanAsync( + String trackingPlanId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listSourcesFromTrackingPlan - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSourcesFromTrackingPlanCall(String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listSourcesFromTrackingPlanCall( + String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -841,8 +1058,11 @@ public okhttp3.Call listSourcesFromTrackingPlanCall(String trackingPlanId, Pagin Object localVarPostBody = null; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/sources" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/sources" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -855,136 +1075,187 @@ public okhttp3.Call listSourcesFromTrackingPlanCall(String trackingPlanId, Pagin } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listSourcesFromTrackingPlanValidateBeforeCall(String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listSourcesFromTrackingPlanValidateBeforeCall( + String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling listSourcesFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " listSourcesFromTrackingPlan(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listSourcesFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSourcesFromTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = listSourcesFromTrackingPlanCall(trackingPlanId, pagination, _callback); + okhttp3.Call localVarCall = + listSourcesFromTrackingPlanCall(trackingPlanId, pagination, _callback); return localVarCall; - } /** - * List Sources from Tracking Plan - * Lists Sources connected to a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. This endpoint requires the user to have at least the following permission(s): * Source Read-only * Tracking Plan Read-only - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Sources from Tracking Plan Lists Sources connected to a Tracking Plan. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. This + * endpoint requires the user to have at least the following permission(s): * Source Read-only * + * Tracking Plan Read-only + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListSourcesFromTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListSourcesFromTrackingPlan200Response listSourcesFromTrackingPlan(String trackingPlanId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listSourcesFromTrackingPlanWithHttpInfo(trackingPlanId, pagination); + public ListSourcesFromTrackingPlan200Response listSourcesFromTrackingPlan( + String trackingPlanId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listSourcesFromTrackingPlanWithHttpInfo(trackingPlanId, pagination); return localVarResp.getData(); } /** - * List Sources from Tracking Plan - * Lists Sources connected to a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. This endpoint requires the user to have at least the following permission(s): * Source Read-only * Tracking Plan Read-only - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Sources from Tracking Plan Lists Sources connected to a Tracking Plan. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. This + * endpoint requires the user to have at least the following permission(s): * Source Read-only * + * Tracking Plan Read-only + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListSourcesFromTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listSourcesFromTrackingPlanWithHttpInfo(String trackingPlanId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listSourcesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listSourcesFromTrackingPlanWithHttpInfo( + String trackingPlanId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listSourcesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Sources from Tracking Plan (asynchronously) - * Lists Sources connected to a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. This endpoint requires the user to have at least the following permission(s): * Source Read-only * Tracking Plan Read-only - * @param trackingPlanId (required) - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Sources from Tracking Plan (asynchronously) Lists Sources connected to a Tracking Plan. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. This endpoint requires the user to have at least the following permission(s): * + * Source Read-only * Tracking Plan Read-only + * + * @param trackingPlanId (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listSourcesFromTrackingPlanAsync(String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listSourcesFromTrackingPlanValidateBeforeCall(trackingPlanId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listSourcesFromTrackingPlanAsync( + String trackingPlanId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSourcesFromTrackingPlanValidateBeforeCall( + trackingPlanId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listTrackingPlans - * @param pagination Pagination options. This parameter exists in alpha. (required) - * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This parameter exists in alpha. (optional) + * + * @param pagination Pagination options. This parameter exists in v1. (required) + * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This + * parameter exists in v1. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listTrackingPlansCall(PaginationInput pagination, String type, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listTrackingPlansCall( + PaginationInput pagination, String type, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1010,131 +1281,170 @@ public okhttp3.Call listTrackingPlansCall(PaginationInput pagination, String typ } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listTrackingPlansValidateBeforeCall(PaginationInput pagination, String type, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listTrackingPlansValidateBeforeCall( + PaginationInput pagination, String type, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listTrackingPlans(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listTrackingPlans(Async)"); } - okhttp3.Call localVarCall = listTrackingPlansCall(pagination, type, _callback); return localVarCall; - } /** - * List Tracking Plans - * Returns a list of Tracking Plans. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination options. This parameter exists in alpha. (required) - * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This parameter exists in alpha. (optional) + * List Tracking Plans Returns a list of Tracking Plans. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param pagination Pagination options. This parameter exists in v1. (required) + * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This + * parameter exists in v1. (optional) * @return ListTrackingPlans200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListTrackingPlans200Response listTrackingPlans(PaginationInput pagination, String type) throws ApiException { - ApiResponse localVarResp = listTrackingPlansWithHttpInfo(pagination, type); + public ListTrackingPlans200Response listTrackingPlans(PaginationInput pagination, String type) + throws ApiException { + ApiResponse localVarResp = + listTrackingPlansWithHttpInfo(pagination, type); return localVarResp.getData(); } /** - * List Tracking Plans - * Returns a list of Tracking Plans. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination options. This parameter exists in alpha. (required) - * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This parameter exists in alpha. (optional) + * List Tracking Plans Returns a list of Tracking Plans. **Note**: In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param pagination Pagination options. This parameter exists in v1. (required) + * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This + * parameter exists in v1. (optional) * @return ApiResponse<ListTrackingPlans200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listTrackingPlansWithHttpInfo(PaginationInput pagination, String type) throws ApiException { + public ApiResponse listTrackingPlansWithHttpInfo( + PaginationInput pagination, String type) throws ApiException { okhttp3.Call localVarCall = listTrackingPlansValidateBeforeCall(pagination, type, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Tracking Plans (asynchronously) - * Returns a list of Tracking Plans. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination options. This parameter exists in alpha. (required) - * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This parameter exists in alpha. (optional) + * List Tracking Plans (asynchronously) Returns a list of Tracking Plans. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param pagination Pagination options. This parameter exists in v1. (required) + * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This + * parameter exists in v1. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listTrackingPlansAsync(PaginationInput pagination, String type, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listTrackingPlansValidateBeforeCall(pagination, type, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listTrackingPlansAsync( + PaginationInput pagination, + String type, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listTrackingPlansValidateBeforeCall(pagination, type, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeRulesFromTrackingPlan - * @param trackingPlanId (required) - * @param rules Rules to delete. This parameter exists in alpha. (required) + * + * @param trackingPlanId (required) + * @param rules Rules to delete. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeRulesFromTrackingPlanCall(String trackingPlanId, List rules, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeRulesFromTrackingPlanCall( + String trackingPlanId, List rules, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1143,8 +1453,11 @@ public okhttp3.Call removeRulesFromTrackingPlanCall(String trackingPlanId, List< Object localVarPostBody = null; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/rules" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1153,140 +1466,185 @@ public okhttp3.Call removeRulesFromTrackingPlanCall(String trackingPlanId, List< Map localVarFormParams = new HashMap(); if (rules != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "rules", rules)); + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("csv", "rules", rules)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call removeRulesFromTrackingPlanValidateBeforeCall(String trackingPlanId, List rules, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call removeRulesFromTrackingPlanValidateBeforeCall( + String trackingPlanId, List rules, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling removeRulesFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " removeRulesFromTrackingPlan(Async)"); } - + // verify the required parameter 'rules' is set if (rules == null) { - throw new ApiException("Missing the required parameter 'rules' when calling removeRulesFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'rules' when calling" + + " removeRulesFromTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = removeRulesFromTrackingPlanCall(trackingPlanId, rules, _callback); + okhttp3.Call localVarCall = + removeRulesFromTrackingPlanCall(trackingPlanId, rules, _callback); return localVarCall; - } /** - * Remove Rules from Tracking Plan - * Deletes Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param rules Rules to delete. This parameter exists in alpha. (required) + * Remove Rules from Tracking Plan Deletes Tracking Plan rules. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param rules Rules to delete. This parameter exists in v1. (required) * @return RemoveRulesFromTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public RemoveRulesFromTrackingPlan200Response removeRulesFromTrackingPlan(String trackingPlanId, List rules) throws ApiException { - ApiResponse localVarResp = removeRulesFromTrackingPlanWithHttpInfo(trackingPlanId, rules); + public RemoveRulesFromTrackingPlan200Response removeRulesFromTrackingPlan( + String trackingPlanId, List rules) throws ApiException { + ApiResponse localVarResp = + removeRulesFromTrackingPlanWithHttpInfo(trackingPlanId, rules); return localVarResp.getData(); } /** - * Remove Rules from Tracking Plan - * Deletes Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param rules Rules to delete. This parameter exists in alpha. (required) + * Remove Rules from Tracking Plan Deletes Tracking Plan rules. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param rules Rules to delete. This parameter exists in v1. (required) * @return ApiResponse<RemoveRulesFromTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse removeRulesFromTrackingPlanWithHttpInfo(String trackingPlanId, List rules) throws ApiException { - okhttp3.Call localVarCall = removeRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, rules, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + removeRulesFromTrackingPlanWithHttpInfo(String trackingPlanId, List rules) + throws ApiException { + okhttp3.Call localVarCall = + removeRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, rules, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove Rules from Tracking Plan (asynchronously) - * Deletes Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param rules Rules to delete. This parameter exists in alpha. (required) + * Remove Rules from Tracking Plan (asynchronously) Deletes Tracking Plan rules. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param rules Rules to delete. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeRulesFromTrackingPlanAsync(String trackingPlanId, List rules, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = removeRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, rules, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call removeRulesFromTrackingPlanAsync( + String trackingPlanId, + List rules, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeRulesFromTrackingPlanValidateBeforeCall(trackingPlanId, rules, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeSourceFromTrackingPlan - * @param trackingPlanId (required) - * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: analogous to `sourceName`. This parameter exists in alpha. (required) + * + * @param trackingPlanId (required) + * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: + * analogous to `sourceName`. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeSourceFromTrackingPlanCall(String trackingPlanId, String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeSourceFromTrackingPlanCall( + String trackingPlanId, String sourceId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1295,8 +1653,11 @@ public okhttp3.Call removeSourceFromTrackingPlanCall(String trackingPlanId, Stri Object localVarPostBody = null; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/sources" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/sources" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1309,136 +1670,190 @@ public okhttp3.Call removeSourceFromTrackingPlanCall(String trackingPlanId, Stri } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call removeSourceFromTrackingPlanValidateBeforeCall(String trackingPlanId, String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call removeSourceFromTrackingPlanValidateBeforeCall( + String trackingPlanId, String sourceId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling removeSourceFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " removeSourceFromTrackingPlan(Async)"); } - + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling removeSourceFromTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " removeSourceFromTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = removeSourceFromTrackingPlanCall(trackingPlanId, sourceId, _callback); + okhttp3.Call localVarCall = + removeSourceFromTrackingPlanCall(trackingPlanId, sourceId, _callback); return localVarCall; - } /** - * Remove Source from Tracking Plan - * Disconnects a Source from a Tracking Plan. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: analogous to `sourceName`. This parameter exists in alpha. (required) + * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. When called, this + * endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param trackingPlanId (required) + * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: + * analogous to `sourceName`. This parameter exists in v1. (required) * @return RemoveSourceFromTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public RemoveSourceFromTrackingPlan200Response removeSourceFromTrackingPlan(String trackingPlanId, String sourceId) throws ApiException { - ApiResponse localVarResp = removeSourceFromTrackingPlanWithHttpInfo(trackingPlanId, sourceId); + public RemoveSourceFromTrackingPlan200Response removeSourceFromTrackingPlan( + String trackingPlanId, String sourceId) throws ApiException { + ApiResponse localVarResp = + removeSourceFromTrackingPlanWithHttpInfo(trackingPlanId, sourceId); return localVarResp.getData(); } /** - * Remove Source from Tracking Plan - * Disconnects a Source from a Tracking Plan. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: analogous to `sourceName`. This parameter exists in alpha. (required) + * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. When called, this + * endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param trackingPlanId (required) + * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: + * analogous to `sourceName`. This parameter exists in v1. (required) * @return ApiResponse<RemoveSourceFromTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse removeSourceFromTrackingPlanWithHttpInfo(String trackingPlanId, String sourceId) throws ApiException { - okhttp3.Call localVarCall = removeSourceFromTrackingPlanValidateBeforeCall(trackingPlanId, sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + removeSourceFromTrackingPlanWithHttpInfo(String trackingPlanId, String sourceId) + throws ApiException { + okhttp3.Call localVarCall = + removeSourceFromTrackingPlanValidateBeforeCall(trackingPlanId, sourceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove Source from Tracking Plan (asynchronously) - * Disconnects a Source from a Tracking Plan. When called, this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: analogous to `sourceName`. This parameter exists in alpha. (required) + * Remove Source from Tracking Plan (asynchronously) Disconnects a Source from a Tracking Plan. + * When called, this endpoint may generate the `Source Modified` [Audit + * Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param trackingPlanId (required) + * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: + * analogous to `sourceName`. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeSourceFromTrackingPlanAsync(String trackingPlanId, String sourceId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = removeSourceFromTrackingPlanValidateBeforeCall(trackingPlanId, sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call removeSourceFromTrackingPlanAsync( + String trackingPlanId, + String sourceId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeSourceFromTrackingPlanValidateBeforeCall(trackingPlanId, sourceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replaceRulesInTrackingPlan - * @param trackingPlanId (required) - * @param replaceRulesInTrackingPlanV1Input (required) + * + * @param trackingPlanId (required) + * @param replaceRulesInTrackingPlanV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceRulesInTrackingPlanCall(String trackingPlanId, ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call replaceRulesInTrackingPlanCall( + String trackingPlanId, + ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1447,8 +1862,11 @@ public okhttp3.Call replaceRulesInTrackingPlanCall(String trackingPlanId, Replac Object localVarPostBody = replaceRulesInTrackingPlanV1Input; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/rules" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1457,7 +1875,10 @@ public okhttp3.Call replaceRulesInTrackingPlanCall(String trackingPlanId, Replac Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1465,128 +1886,183 @@ public okhttp3.Call replaceRulesInTrackingPlanCall(String trackingPlanId, Replac } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call replaceRulesInTrackingPlanValidateBeforeCall(String trackingPlanId, ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call replaceRulesInTrackingPlanValidateBeforeCall( + String trackingPlanId, + ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling replaceRulesInTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " replaceRulesInTrackingPlan(Async)"); } - + // verify the required parameter 'replaceRulesInTrackingPlanV1Input' is set if (replaceRulesInTrackingPlanV1Input == null) { - throw new ApiException("Missing the required parameter 'replaceRulesInTrackingPlanV1Input' when calling replaceRulesInTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'replaceRulesInTrackingPlanV1Input' when" + + " calling replaceRulesInTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = replaceRulesInTrackingPlanCall(trackingPlanId, replaceRulesInTrackingPlanV1Input, _callback); + okhttp3.Call localVarCall = + replaceRulesInTrackingPlanCall( + trackingPlanId, replaceRulesInTrackingPlanV1Input, _callback); return localVarCall; - } /** - * Replace Rules in Tracking Plan - * Replaces Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param replaceRulesInTrackingPlanV1Input (required) + * Replace Rules in Tracking Plan Replaces Tracking Plan rules. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param replaceRulesInTrackingPlanV1Input (required) * @return ReplaceRulesInTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ReplaceRulesInTrackingPlan200Response replaceRulesInTrackingPlan(String trackingPlanId, ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input) throws ApiException { - ApiResponse localVarResp = replaceRulesInTrackingPlanWithHttpInfo(trackingPlanId, replaceRulesInTrackingPlanV1Input); + public ReplaceRulesInTrackingPlan200Response replaceRulesInTrackingPlan( + String trackingPlanId, + ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input) + throws ApiException { + ApiResponse localVarResp = + replaceRulesInTrackingPlanWithHttpInfo( + trackingPlanId, replaceRulesInTrackingPlanV1Input); return localVarResp.getData(); } /** - * Replace Rules in Tracking Plan - * Replaces Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param replaceRulesInTrackingPlanV1Input (required) + * Replace Rules in Tracking Plan Replaces Tracking Plan rules. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param replaceRulesInTrackingPlanV1Input (required) * @return ApiResponse<ReplaceRulesInTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse replaceRulesInTrackingPlanWithHttpInfo(String trackingPlanId, ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input) throws ApiException { - okhttp3.Call localVarCall = replaceRulesInTrackingPlanValidateBeforeCall(trackingPlanId, replaceRulesInTrackingPlanV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + replaceRulesInTrackingPlanWithHttpInfo( + String trackingPlanId, + ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input) + throws ApiException { + okhttp3.Call localVarCall = + replaceRulesInTrackingPlanValidateBeforeCall( + trackingPlanId, replaceRulesInTrackingPlanV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Replace Rules in Tracking Plan (asynchronously) - * Replaces Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param replaceRulesInTrackingPlanV1Input (required) + * Replace Rules in Tracking Plan (asynchronously) Replaces Tracking Plan rules. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param replaceRulesInTrackingPlanV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call replaceRulesInTrackingPlanAsync(String trackingPlanId, ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = replaceRulesInTrackingPlanValidateBeforeCall(trackingPlanId, replaceRulesInTrackingPlanV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call replaceRulesInTrackingPlanAsync( + String trackingPlanId, + ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replaceRulesInTrackingPlanValidateBeforeCall( + trackingPlanId, replaceRulesInTrackingPlanV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateRulesInTrackingPlan - * @param trackingPlanId (required) - * @param updateRulesInTrackingPlanV1Input (required) + * + * @param trackingPlanId (required) + * @param updateRulesInTrackingPlanV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateRulesInTrackingPlanCall(String trackingPlanId, UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateRulesInTrackingPlanCall( + String trackingPlanId, + UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1595,8 +2071,11 @@ public okhttp3.Call updateRulesInTrackingPlanCall(String trackingPlanId, UpdateR Object localVarPostBody = updateRulesInTrackingPlanV1Input; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}/rules" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1605,7 +2084,10 @@ public okhttp3.Call updateRulesInTrackingPlanCall(String trackingPlanId, UpdateR Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1613,128 +2095,182 @@ public okhttp3.Call updateRulesInTrackingPlanCall(String trackingPlanId, UpdateR } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateRulesInTrackingPlanValidateBeforeCall(String trackingPlanId, UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateRulesInTrackingPlanValidateBeforeCall( + String trackingPlanId, + UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling updateRulesInTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " updateRulesInTrackingPlan(Async)"); } - + // verify the required parameter 'updateRulesInTrackingPlanV1Input' is set if (updateRulesInTrackingPlanV1Input == null) { - throw new ApiException("Missing the required parameter 'updateRulesInTrackingPlanV1Input' when calling updateRulesInTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'updateRulesInTrackingPlanV1Input' when calling" + + " updateRulesInTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = updateRulesInTrackingPlanCall(trackingPlanId, updateRulesInTrackingPlanV1Input, _callback); + okhttp3.Call localVarCall = + updateRulesInTrackingPlanCall( + trackingPlanId, updateRulesInTrackingPlanV1Input, _callback); return localVarCall; - } /** - * Update Rules in Tracking Plan - * Updates Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param updateRulesInTrackingPlanV1Input (required) + * Update Rules in Tracking Plan Updates Tracking Plan rules. **Note**: In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param updateRulesInTrackingPlanV1Input (required) * @return UpdateRulesInTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateRulesInTrackingPlan200Response updateRulesInTrackingPlan(String trackingPlanId, UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input) throws ApiException { - ApiResponse localVarResp = updateRulesInTrackingPlanWithHttpInfo(trackingPlanId, updateRulesInTrackingPlanV1Input); + public UpdateRulesInTrackingPlan200Response updateRulesInTrackingPlan( + String trackingPlanId, + UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input) + throws ApiException { + ApiResponse localVarResp = + updateRulesInTrackingPlanWithHttpInfo( + trackingPlanId, updateRulesInTrackingPlanV1Input); return localVarResp.getData(); } /** - * Update Rules in Tracking Plan - * Updates Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param updateRulesInTrackingPlanV1Input (required) + * Update Rules in Tracking Plan Updates Tracking Plan rules. **Note**: In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param updateRulesInTrackingPlanV1Input (required) * @return ApiResponse<UpdateRulesInTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateRulesInTrackingPlanWithHttpInfo(String trackingPlanId, UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input) throws ApiException { - okhttp3.Call localVarCall = updateRulesInTrackingPlanValidateBeforeCall(trackingPlanId, updateRulesInTrackingPlanV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateRulesInTrackingPlanWithHttpInfo( + String trackingPlanId, + UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input) + throws ApiException { + okhttp3.Call localVarCall = + updateRulesInTrackingPlanValidateBeforeCall( + trackingPlanId, updateRulesInTrackingPlanV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Rules in Tracking Plan (asynchronously) - * Updates Tracking Plan rules. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param trackingPlanId (required) - * @param updateRulesInTrackingPlanV1Input (required) + * Update Rules in Tracking Plan (asynchronously) Updates Tracking Plan rules. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param trackingPlanId (required) + * @param updateRulesInTrackingPlanV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateRulesInTrackingPlanAsync(String trackingPlanId, UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateRulesInTrackingPlanValidateBeforeCall(trackingPlanId, updateRulesInTrackingPlanV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateRulesInTrackingPlanAsync( + String trackingPlanId, + UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateRulesInTrackingPlanValidateBeforeCall( + trackingPlanId, updateRulesInTrackingPlanV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateTrackingPlan - * @param trackingPlanId (required) - * @param updateTrackingPlanV1Input (required) + * + * @param trackingPlanId (required) + * @param updateTrackingPlanV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateTrackingPlanCall(String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateTrackingPlanCall( + String trackingPlanId, + UpdateTrackingPlanV1Input updateTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1743,8 +2279,11 @@ public okhttp3.Call updateTrackingPlanCall(String trackingPlanId, UpdateTracking Object localVarPostBody = updateTrackingPlanV1Input; // create path and map variables - String localVarPath = "/tracking-plans/{trackingPlanId}" - .replaceAll("\\{" + "trackingPlanId" + "\\}", localVarApiClient.escapeString(trackingPlanId.toString())); + String localVarPath = + "/tracking-plans/{trackingPlanId}" + .replaceAll( + "\\{" + "trackingPlanId" + "\\}", + localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1753,7 +2292,10 @@ public okhttp3.Call updateTrackingPlanCall(String trackingPlanId, UpdateTracking Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1761,100 +2303,146 @@ public okhttp3.Call updateTrackingPlanCall(String trackingPlanId, UpdateTracking } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateTrackingPlanValidateBeforeCall(String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateTrackingPlanValidateBeforeCall( + String trackingPlanId, + UpdateTrackingPlanV1Input updateTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { - throw new ApiException("Missing the required parameter 'trackingPlanId' when calling updateTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'trackingPlanId' when calling" + + " updateTrackingPlan(Async)"); } - + // verify the required parameter 'updateTrackingPlanV1Input' is set if (updateTrackingPlanV1Input == null) { - throw new ApiException("Missing the required parameter 'updateTrackingPlanV1Input' when calling updateTrackingPlan(Async)"); + throw new ApiException( + "Missing the required parameter 'updateTrackingPlanV1Input' when calling" + + " updateTrackingPlan(Async)"); } - - okhttp3.Call localVarCall = updateTrackingPlanCall(trackingPlanId, updateTrackingPlanV1Input, _callback); + okhttp3.Call localVarCall = + updateTrackingPlanCall(trackingPlanId, updateTrackingPlanV1Input, _callback); return localVarCall; - } /** - * Update Tracking Plan - * Updates a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. Config API omitted fields: - `updateMask` - * @param trackingPlanId (required) - * @param updateTrackingPlanV1Input (required) + * Update Tracking Plan Updates a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. Config API omitted fields: - + * `updateMask` + * + * @param trackingPlanId (required) + * @param updateTrackingPlanV1Input (required) * @return UpdateTrackingPlan200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateTrackingPlan200Response updateTrackingPlan(String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input) throws ApiException { - ApiResponse localVarResp = updateTrackingPlanWithHttpInfo(trackingPlanId, updateTrackingPlanV1Input); + public UpdateTrackingPlan200Response updateTrackingPlan( + String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input) + throws ApiException { + ApiResponse localVarResp = + updateTrackingPlanWithHttpInfo(trackingPlanId, updateTrackingPlanV1Input); return localVarResp.getData(); } /** - * Update Tracking Plan - * Updates a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. Config API omitted fields: - `updateMask` - * @param trackingPlanId (required) - * @param updateTrackingPlanV1Input (required) + * Update Tracking Plan Updates a Tracking Plan. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. Config API omitted fields: - + * `updateMask` + * + * @param trackingPlanId (required) + * @param updateTrackingPlanV1Input (required) * @return ApiResponse<UpdateTrackingPlan200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateTrackingPlanWithHttpInfo(String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input) throws ApiException { - okhttp3.Call localVarCall = updateTrackingPlanValidateBeforeCall(trackingPlanId, updateTrackingPlanV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateTrackingPlanWithHttpInfo( + String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input) + throws ApiException { + okhttp3.Call localVarCall = + updateTrackingPlanValidateBeforeCall( + trackingPlanId, updateTrackingPlanV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Tracking Plan (asynchronously) - * Updates a Tracking Plan. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. Config API omitted fields: - `updateMask` - * @param trackingPlanId (required) - * @param updateTrackingPlanV1Input (required) + * Update Tracking Plan (asynchronously) Updates a Tracking Plan. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. Config API + * omitted fields: - `updateMask` + * + * @param trackingPlanId (required) + * @param updateTrackingPlanV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateTrackingPlanAsync(String trackingPlanId, UpdateTrackingPlanV1Input updateTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateTrackingPlanValidateBeforeCall(trackingPlanId, updateTrackingPlanV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateTrackingPlanAsync( + String trackingPlanId, + UpdateTrackingPlanV1Input updateTrackingPlanV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateTrackingPlanValidateBeforeCall( + trackingPlanId, updateTrackingPlanV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index f8dc9af2..85e4a26e 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,39 +10,29 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.CreateTransformation200Response; import com.segment.publicapi.models.CreateTransformationBetaInput; import com.segment.publicapi.models.DeleteTransformation200Response; import com.segment.publicapi.models.GetTransformation200Response; import com.segment.publicapi.models.ListTransformations200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateTransformation200Response; import com.segment.publicapi.models.UpdateTransformationBetaInput; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class TransformationsApi { private ApiClient localVarApiClient; @@ -83,28 +73,32 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTransformation - * @param createTransformationBetaInput (required) + * + * @param createTransformationBetaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createTransformationCall(CreateTransformationBetaInput createTransformationBetaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createTransformationCall( + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -122,7 +116,9 @@ public okhttp3.Call createTransformationCall(CreateTransformationBetaInput creat Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -130,119 +126,158 @@ public okhttp3.Call createTransformationCall(CreateTransformationBetaInput creat } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json" + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createTransformationValidateBeforeCall(CreateTransformationBetaInput createTransformationBetaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createTransformationValidateBeforeCall( + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createTransformationBetaInput' is set if (createTransformationBetaInput == null) { - throw new ApiException("Missing the required parameter 'createTransformationBetaInput' when calling createTransformation(Async)"); + throw new ApiException( + "Missing the required parameter 'createTransformationBetaInput' when calling" + + " createTransformation(Async)"); } - - okhttp3.Call localVarCall = createTransformationCall(createTransformationBetaInput, _callback); + okhttp3.Call localVarCall = + createTransformationCall(createTransformationBetaInput, _callback); return localVarCall; - } /** - * Create Transformation - * Creates a new Transformation. When called, this endpoint may generate the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param createTransformationBetaInput (required) + * Create Transformation Creates a new Transformation. When called, this endpoint may generate + * the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param createTransformationBetaInput (required) * @return CreateTransformation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateTransformation200Response createTransformation(CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { - ApiResponse localVarResp = createTransformationWithHttpInfo(createTransformationBetaInput); + public CreateTransformation200Response createTransformation( + CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + ApiResponse localVarResp = + createTransformationWithHttpInfo(createTransformationBetaInput); return localVarResp.getData(); } /** - * Create Transformation - * Creates a new Transformation. When called, this endpoint may generate the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param createTransformationBetaInput (required) + * Create Transformation Creates a new Transformation. When called, this endpoint may generate + * the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param createTransformationBetaInput (required) * @return ApiResponse<CreateTransformation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createTransformationWithHttpInfo(CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { - okhttp3.Call localVarCall = createTransformationValidateBeforeCall(createTransformationBetaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createTransformationWithHttpInfo( + CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + okhttp3.Call localVarCall = + createTransformationValidateBeforeCall(createTransformationBetaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Transformation (asynchronously) - * Creates a new Transformation. When called, this endpoint may generate the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param createTransformationBetaInput (required) + * Create Transformation (asynchronously) Creates a new Transformation. When called, this + * endpoint may generate the `Transformation Created` [Audit Trail](/tag/Audit-Trail) + * event. **Note**: In order to successfully call this endpoint, the specified Workspace needs + * to have the Protocols feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createTransformationAsync(CreateTransformationBetaInput createTransformationBetaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createTransformationAsync( + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteTransformation - * @param transformationId (required) + * + * @param transformationId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteTransformationCall(String transformationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteTransformationCall( + String transformationId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -251,8 +286,11 @@ public okhttp3.Call deleteTransformationCall(String transformationId, final ApiC Object localVarPostBody = null; // create path and map variables - String localVarPath = "/transformations/{transformationId}" - .replaceAll("\\{" + "transformationId" + "\\}", localVarApiClient.escapeString(transformationId.toString())); + String localVarPath = + "/transformations/{transformationId}" + .replaceAll( + "\\{" + "transformationId" + "\\}", + localVarApiClient.escapeString(transformationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -261,127 +299,162 @@ public okhttp3.Call deleteTransformationCall(String transformationId, final ApiC Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteTransformationValidateBeforeCall(String transformationId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteTransformationValidateBeforeCall( + String transformationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'transformationId' is set if (transformationId == null) { - throw new ApiException("Missing the required parameter 'transformationId' when calling deleteTransformation(Async)"); + throw new ApiException( + "Missing the required parameter 'transformationId' when calling" + + " deleteTransformation(Async)"); } - okhttp3.Call localVarCall = deleteTransformationCall(transformationId, _callback); return localVarCall; - } /** - * Delete Transformation - * Deletes a Transformation. When called, this endpoint may generate the `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) + * Delete Transformation Deletes a Transformation. When called, this endpoint may generate the + * `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order + * to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param transformationId (required) * @return DeleteTransformation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public DeleteTransformation200Response deleteTransformation(String transformationId) throws ApiException { - ApiResponse localVarResp = deleteTransformationWithHttpInfo(transformationId); + public DeleteTransformation200Response deleteTransformation(String transformationId) + throws ApiException { + ApiResponse localVarResp = + deleteTransformationWithHttpInfo(transformationId); return localVarResp.getData(); } /** - * Delete Transformation - * Deletes a Transformation. When called, this endpoint may generate the `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) + * Delete Transformation Deletes a Transformation. When called, this endpoint may generate the + * `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order + * to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param transformationId (required) * @return ApiResponse<DeleteTransformation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteTransformationWithHttpInfo(String transformationId) throws ApiException { + public ApiResponse deleteTransformationWithHttpInfo( + String transformationId) throws ApiException { okhttp3.Call localVarCall = deleteTransformationValidateBeforeCall(transformationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Transformation (asynchronously) - * Deletes a Transformation. When called, this endpoint may generate the `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) + * Delete Transformation (asynchronously) Deletes a Transformation. When called, this endpoint + * may generate the `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param transformationId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteTransformationAsync(String transformationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteTransformationAsync( + String transformationId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = deleteTransformationValidateBeforeCall(transformationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = + deleteTransformationValidateBeforeCall(transformationId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getTransformation - * @param transformationId (required) + * + * @param transformationId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getTransformationCall(String transformationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getTransformationCall(String transformationId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -390,8 +463,11 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Object localVarPostBody = null; // create path and map variables - String localVarPath = "/transformations/{transformationId}" - .replaceAll("\\{" + "transformationId" + "\\}", localVarApiClient.escapeString(transformationId.toString())); + String localVarPath = + "/transformations/{transformationId}" + .replaceAll( + "\\{" + "transformationId" + "\\}", + localVarApiClient.escapeString(transformationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -400,127 +476,158 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getTransformationValidateBeforeCall(String transformationId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getTransformationValidateBeforeCall( + String transformationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'transformationId' is set if (transformationId == null) { - throw new ApiException("Missing the required parameter 'transformationId' when calling getTransformation(Async)"); + throw new ApiException( + "Missing the required parameter 'transformationId' when calling" + + " getTransformation(Async)"); } - okhttp3.Call localVarCall = getTransformationCall(transformationId, _callback); return localVarCall; - } /** - * Get Transformation - * Gets a Transformation. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) + * Get Transformation Gets a Transformation. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param transformationId (required) * @return GetTransformation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetTransformation200Response getTransformation(String transformationId) throws ApiException { - ApiResponse localVarResp = getTransformationWithHttpInfo(transformationId); + public GetTransformation200Response getTransformation(String transformationId) + throws ApiException { + ApiResponse localVarResp = + getTransformationWithHttpInfo(transformationId); return localVarResp.getData(); } /** - * Get Transformation - * Gets a Transformation. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) + * Get Transformation Gets a Transformation. **Note**: In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param transformationId (required) * @return ApiResponse<GetTransformation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getTransformationWithHttpInfo(String transformationId) throws ApiException { + public ApiResponse getTransformationWithHttpInfo( + String transformationId) throws ApiException { okhttp3.Call localVarCall = getTransformationValidateBeforeCall(transformationId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Transformation (asynchronously) - * Gets a Transformation. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) + * Get Transformation (asynchronously) Gets a Transformation. **Note**: In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. + * + * @param transformationId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getTransformationAsync(String transformationId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getTransformationAsync( + String transformationId, final ApiCallback _callback) + throws ApiException { - okhttp3.Call localVarCall = getTransformationValidateBeforeCall(transformationId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = + getTransformationValidateBeforeCall(transformationId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listTransformations - * @param pagination Pagination options. This parameter exists in alpha. (required) + * + * @param pagination Pagination options. This parameter exists in beta. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listTransformationsCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listTransformationsCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -542,128 +649,162 @@ public okhttp3.Call listTransformationsCall(PaginationInput pagination, final Ap } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listTransformationsValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listTransformationsValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listTransformations(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listTransformations(Async)"); } - okhttp3.Call localVarCall = listTransformationsCall(pagination, _callback); return localVarCall; - } /** - * List Transformations - * Lists all Transformations in the Workspace. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Transformations Lists all Transformations in the Workspace. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param pagination Pagination options. This parameter exists in beta. (required) * @return ListTransformations200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListTransformations200Response listTransformations(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listTransformationsWithHttpInfo(pagination); + public ListTransformations200Response listTransformations(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listTransformationsWithHttpInfo(pagination); return localVarResp.getData(); } /** - * List Transformations - * Lists all Transformations in the Workspace. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Transformations Lists all Transformations in the Workspace. **Note**: In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param pagination Pagination options. This parameter exists in beta. (required) * @return ApiResponse<ListTransformations200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listTransformationsWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listTransformationsWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listTransformationsValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Transformations (asynchronously) - * Lists all Transformations in the Workspace. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param pagination Pagination options. This parameter exists in alpha. (required) + * List Transformations (asynchronously) Lists all Transformations in the Workspace. **Note**: + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param pagination Pagination options. This parameter exists in beta. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listTransformationsAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listTransformationsAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listTransformationsValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateTransformation - * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * + * @param transformationId (required) + * @param updateTransformationBetaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateTransformationCall(String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateTransformationCall( + String transformationId, + UpdateTransformationBetaInput updateTransformationBetaInput, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -672,8 +813,11 @@ public okhttp3.Call updateTransformationCall(String transformationId, UpdateTran Object localVarPostBody = updateTransformationBetaInput; // create path and map variables - String localVarPath = "/transformations/{transformationId}" - .replaceAll("\\{" + "transformationId" + "\\}", localVarApiClient.escapeString(transformationId.toString())); + String localVarPath = + "/transformations/{transformationId}" + .replaceAll( + "\\{" + "transformationId" + "\\}", + localVarApiClient.escapeString(transformationId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -682,7 +826,9 @@ public okhttp3.Call updateTransformationCall(String transformationId, UpdateTran Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -690,100 +836,148 @@ public okhttp3.Call updateTransformationCall(String transformationId, UpdateTran } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json" + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateTransformationValidateBeforeCall(String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateTransformationValidateBeforeCall( + String transformationId, + UpdateTransformationBetaInput updateTransformationBetaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'transformationId' is set if (transformationId == null) { - throw new ApiException("Missing the required parameter 'transformationId' when calling updateTransformation(Async)"); + throw new ApiException( + "Missing the required parameter 'transformationId' when calling" + + " updateTransformation(Async)"); } - + // verify the required parameter 'updateTransformationBetaInput' is set if (updateTransformationBetaInput == null) { - throw new ApiException("Missing the required parameter 'updateTransformationBetaInput' when calling updateTransformation(Async)"); + throw new ApiException( + "Missing the required parameter 'updateTransformationBetaInput' when calling" + + " updateTransformation(Async)"); } - - okhttp3.Call localVarCall = updateTransformationCall(transformationId, updateTransformationBetaInput, _callback); + okhttp3.Call localVarCall = + updateTransformationCall( + transformationId, updateTransformationBetaInput, _callback); return localVarCall; - } /** - * Update Transformation - * Updates an existing Transformation. When called, this endpoint may generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * Update Transformation Updates an existing Transformation. When called, this endpoint may + * generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param transformationId (required) + * @param updateTransformationBetaInput (required) * @return UpdateTransformation200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateTransformation200Response updateTransformation(String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) throws ApiException { - ApiResponse localVarResp = updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); + public UpdateTransformation200Response updateTransformation( + String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + throws ApiException { + ApiResponse localVarResp = + updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); return localVarResp.getData(); } /** - * Update Transformation - * Updates an existing Transformation. When called, this endpoint may generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * Update Transformation Updates an existing Transformation. When called, this endpoint may + * generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param transformationId (required) + * @param updateTransformationBetaInput (required) * @return ApiResponse<UpdateTransformation200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateTransformationWithHttpInfo(String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) throws ApiException { - okhttp3.Call localVarCall = updateTransformationValidateBeforeCall(transformationId, updateTransformationBetaInput, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateTransformationWithHttpInfo( + String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateTransformationValidateBeforeCall( + transformationId, updateTransformationBetaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Transformation (asynchronously) - * Updates an existing Transformation. When called, this endpoint may generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach out to your customer success manager for more information. - * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * Update Transformation (asynchronously) Updates an existing Transformation. When called, this + * endpoint may generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) + * event. **Note**: In order to successfully call this endpoint, the specified Workspace needs + * to have the Protocols feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param transformationId (required) + * @param updateTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateTransformationAsync(String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateTransformationValidateBeforeCall(transformationId, updateTransformationBetaInput, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateTransformationAsync( + String transformationId, + UpdateTransformationBetaInput updateTransformationBetaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateTransformationValidateBeforeCall( + transformationId, updateTransformationBetaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index 4a272108..18c61db3 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,23 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.AddConnectionFromSourceToWarehouse200Response; import com.segment.publicapi.models.CreateValidationInWarehouse200Response; import com.segment.publicapi.models.CreateValidationInWarehouseV1Input; @@ -39,16 +32,13 @@ import com.segment.publicapi.models.ListWarehouses200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveSourceConnectionFromWarehouse200Response; -import com.segment.publicapi.models.RequestErrorEnvelope; import com.segment.publicapi.models.UpdateWarehouse200Response; import com.segment.publicapi.models.UpdateWarehouseV1Input; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class WarehousesApi { private ApiClient localVarApiClient; @@ -89,29 +79,31 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addConnectionFromSourceToWarehouse - * @param warehouseId (required) - * @param sourceId (required) + * + * @param warehouseId (required) + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addConnectionFromSourceToWarehouseCall(String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addConnectionFromSourceToWarehouseCall( + String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -120,9 +112,14 @@ public okhttp3.Call addConnectionFromSourceToWarehouseCall(String warehouseId, S Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/connected-sources/{sourceId}" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())) + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -131,135 +128,179 @@ public okhttp3.Call addConnectionFromSourceToWarehouseCall(String warehouseId, S Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call addConnectionFromSourceToWarehouseValidateBeforeCall(String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call addConnectionFromSourceToWarehouseValidateBeforeCall( + String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling addConnectionFromSourceToWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " addConnectionFromSourceToWarehouse(Async)"); } - + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling addConnectionFromSourceToWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " addConnectionFromSourceToWarehouse(Async)"); } - - okhttp3.Call localVarCall = addConnectionFromSourceToWarehouseCall(warehouseId, sourceId, _callback); + okhttp3.Call localVarCall = + addConnectionFromSourceToWarehouseCall(warehouseId, sourceId, _callback); return localVarCall; - } /** - * Add Connection from Source to Warehouse - * Connects a Source to a Warehouse. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. - * @param warehouseId (required) - * @param sourceId (required) + * Add Connection from Source to Warehouse Connects a Source to a Warehouse. When called, this + * endpoint may generate the `Storage Destination Modified` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param warehouseId (required) + * @param sourceId (required) * @return AddConnectionFromSourceToWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWarehouse(String warehouseId, String sourceId) throws ApiException { - ApiResponse localVarResp = addConnectionFromSourceToWarehouseWithHttpInfo(warehouseId, sourceId); + public AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWarehouse( + String warehouseId, String sourceId) throws ApiException { + ApiResponse localVarResp = + addConnectionFromSourceToWarehouseWithHttpInfo(warehouseId, sourceId); return localVarResp.getData(); } /** - * Add Connection from Source to Warehouse - * Connects a Source to a Warehouse. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. - * @param warehouseId (required) - * @param sourceId (required) + * Add Connection from Source to Warehouse Connects a Source to a Warehouse. When called, this + * endpoint may generate the `Storage Destination Modified` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param warehouseId (required) + * @param sourceId (required) * @return ApiResponse<AddConnectionFromSourceToWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse addConnectionFromSourceToWarehouseWithHttpInfo(String warehouseId, String sourceId) throws ApiException { - okhttp3.Call localVarCall = addConnectionFromSourceToWarehouseValidateBeforeCall(warehouseId, sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + addConnectionFromSourceToWarehouseWithHttpInfo(String warehouseId, String sourceId) + throws ApiException { + okhttp3.Call localVarCall = + addConnectionFromSourceToWarehouseValidateBeforeCall(warehouseId, sourceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Add Connection from Source to Warehouse (asynchronously) - * Connects a Source to a Warehouse. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. - * @param warehouseId (required) - * @param sourceId (required) + * Add Connection from Source to Warehouse (asynchronously) Connects a Source to a Warehouse. + * When called, this endpoint may generate the `Storage Destination Modified` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param warehouseId (required) + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call addConnectionFromSourceToWarehouseAsync(String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addConnectionFromSourceToWarehouseValidateBeforeCall(warehouseId, sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call addConnectionFromSourceToWarehouseAsync( + String warehouseId, + String sourceId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addConnectionFromSourceToWarehouseValidateBeforeCall( + warehouseId, sourceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createValidationInWarehouse - * @param createValidationInWarehouseV1Input (required) + * + * @param createValidationInWarehouseV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createValidationInWarehouseCall(CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createValidationInWarehouseCall( + CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -277,7 +318,10 @@ public okhttp3.Call createValidationInWarehouseCall(CreateValidationInWarehouseV Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -285,119 +329,164 @@ public okhttp3.Call createValidationInWarehouseCall(CreateValidationInWarehouseV } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createValidationInWarehouseValidateBeforeCall(CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createValidationInWarehouseValidateBeforeCall( + CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createValidationInWarehouseV1Input' is set if (createValidationInWarehouseV1Input == null) { - throw new ApiException("Missing the required parameter 'createValidationInWarehouseV1Input' when calling createValidationInWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'createValidationInWarehouseV1Input' when" + + " calling createValidationInWarehouse(Async)"); } - - okhttp3.Call localVarCall = createValidationInWarehouseCall(createValidationInWarehouseV1Input, _callback); + okhttp3.Call localVarCall = + createValidationInWarehouseCall(createValidationInWarehouseV1Input, _callback); return localVarCall; - } /** - * Create Validation in Warehouse - * Validates input settings against a Warehouse. When called, this endpoint may generate the `Storage Destination Settings Validation` [Audit Trail](/tag/Audit-Trail) event. - * @param createValidationInWarehouseV1Input (required) + * Create Validation in Warehouse Validates input settings against a Warehouse. When called, + * this endpoint may generate the `Storage Destination Settings Validation` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param createValidationInWarehouseV1Input (required) * @return CreateValidationInWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateValidationInWarehouse200Response createValidationInWarehouse(CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input) throws ApiException { - ApiResponse localVarResp = createValidationInWarehouseWithHttpInfo(createValidationInWarehouseV1Input); + public CreateValidationInWarehouse200Response createValidationInWarehouse( + CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input) + throws ApiException { + ApiResponse localVarResp = + createValidationInWarehouseWithHttpInfo(createValidationInWarehouseV1Input); return localVarResp.getData(); } /** - * Create Validation in Warehouse - * Validates input settings against a Warehouse. When called, this endpoint may generate the `Storage Destination Settings Validation` [Audit Trail](/tag/Audit-Trail) event. - * @param createValidationInWarehouseV1Input (required) + * Create Validation in Warehouse Validates input settings against a Warehouse. When called, + * this endpoint may generate the `Storage Destination Settings Validation` [Audit + * Trail](/tag/Audit-Trail) event. + * + * @param createValidationInWarehouseV1Input (required) * @return ApiResponse<CreateValidationInWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createValidationInWarehouseWithHttpInfo(CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input) throws ApiException { - okhttp3.Call localVarCall = createValidationInWarehouseValidateBeforeCall(createValidationInWarehouseV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + createValidationInWarehouseWithHttpInfo( + CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input) + throws ApiException { + okhttp3.Call localVarCall = + createValidationInWarehouseValidateBeforeCall( + createValidationInWarehouseV1Input, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Validation in Warehouse (asynchronously) - * Validates input settings against a Warehouse. When called, this endpoint may generate the `Storage Destination Settings Validation` [Audit Trail](/tag/Audit-Trail) event. - * @param createValidationInWarehouseV1Input (required) + * Create Validation in Warehouse (asynchronously) Validates input settings against a Warehouse. + * When called, this endpoint may generate the `Storage Destination Settings + * Validation` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createValidationInWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createValidationInWarehouseAsync(CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createValidationInWarehouseValidateBeforeCall(createValidationInWarehouseV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createValidationInWarehouseAsync( + CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createValidationInWarehouseValidateBeforeCall( + createValidationInWarehouseV1Input, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createWarehouse - * @param createWarehouseV1Input (required) + * + * @param createWarehouseV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createWarehouseCall(CreateWarehouseV1Input createWarehouseV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createWarehouseCall( + CreateWarehouseV1Input createWarehouseV1Input, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -415,7 +504,10 @@ public okhttp3.Call createWarehouseCall(CreateWarehouseV1Input createWarehouseV1 Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -423,119 +515,150 @@ public okhttp3.Call createWarehouseCall(CreateWarehouseV1Input createWarehouseV1 } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call createWarehouseValidateBeforeCall(CreateWarehouseV1Input createWarehouseV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call createWarehouseValidateBeforeCall( + CreateWarehouseV1Input createWarehouseV1Input, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createWarehouseV1Input' is set if (createWarehouseV1Input == null) { - throw new ApiException("Missing the required parameter 'createWarehouseV1Input' when calling createWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'createWarehouseV1Input' when calling" + + " createWarehouse(Async)"); } - okhttp3.Call localVarCall = createWarehouseCall(createWarehouseV1Input, _callback); return localVarCall; - } /** - * Create Warehouse - * Creates a new Warehouse. When called, this endpoint may generate the `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createWarehouseV1Input (required) + * Create Warehouse Creates a new Warehouse. When called, this endpoint may generate the + * `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createWarehouseV1Input (required) * @return CreateWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public CreateWarehouse200Response createWarehouse(CreateWarehouseV1Input createWarehouseV1Input) throws ApiException { - ApiResponse localVarResp = createWarehouseWithHttpInfo(createWarehouseV1Input); + public CreateWarehouse200Response createWarehouse(CreateWarehouseV1Input createWarehouseV1Input) + throws ApiException { + ApiResponse localVarResp = + createWarehouseWithHttpInfo(createWarehouseV1Input); return localVarResp.getData(); } /** - * Create Warehouse - * Creates a new Warehouse. When called, this endpoint may generate the `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createWarehouseV1Input (required) + * Create Warehouse Creates a new Warehouse. When called, this endpoint may generate the + * `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createWarehouseV1Input (required) * @return ApiResponse<CreateWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse createWarehouseWithHttpInfo(CreateWarehouseV1Input createWarehouseV1Input) throws ApiException { + public ApiResponse createWarehouseWithHttpInfo( + CreateWarehouseV1Input createWarehouseV1Input) throws ApiException { okhttp3.Call localVarCall = createWarehouseValidateBeforeCall(createWarehouseV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Warehouse (asynchronously) - * Creates a new Warehouse. When called, this endpoint may generate the `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. - * @param createWarehouseV1Input (required) + * Create Warehouse (asynchronously) Creates a new Warehouse. When called, this endpoint may + * generate the `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. + * + * @param createWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call createWarehouseAsync(CreateWarehouseV1Input createWarehouseV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createWarehouseValidateBeforeCall(createWarehouseV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call createWarehouseAsync( + CreateWarehouseV1Input createWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createWarehouseValidateBeforeCall(createWarehouseV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteWarehouse - * @param warehouseId (required) + * + * @param warehouseId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -544,8 +667,11 @@ public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _c Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -554,127 +680,155 @@ public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _c Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteWarehouseValidateBeforeCall(String warehouseId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call deleteWarehouseValidateBeforeCall( + String warehouseId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling deleteWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " deleteWarehouse(Async)"); } - okhttp3.Call localVarCall = deleteWarehouseCall(warehouseId, _callback); return localVarCall; - } /** - * Delete Warehouse - * Deletes an existing Warehouse. When called, this endpoint may generate the `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param warehouseId (required) + * Delete Warehouse Deletes an existing Warehouse. When called, this endpoint may generate the + * `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param warehouseId (required) * @return DeleteWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public DeleteWarehouse200Response deleteWarehouse(String warehouseId) throws ApiException { - ApiResponse localVarResp = deleteWarehouseWithHttpInfo(warehouseId); + ApiResponse localVarResp = + deleteWarehouseWithHttpInfo(warehouseId); return localVarResp.getData(); } /** - * Delete Warehouse - * Deletes an existing Warehouse. When called, this endpoint may generate the `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param warehouseId (required) + * Delete Warehouse Deletes an existing Warehouse. When called, this endpoint may generate the + * `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. + * + * @param warehouseId (required) * @return ApiResponse<DeleteWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse deleteWarehouseWithHttpInfo(String warehouseId) throws ApiException { + public ApiResponse deleteWarehouseWithHttpInfo(String warehouseId) + throws ApiException { okhttp3.Call localVarCall = deleteWarehouseValidateBeforeCall(warehouseId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete Warehouse (asynchronously) - * Deletes an existing Warehouse. When called, this endpoint may generate the `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. - * @param warehouseId (required) + * Delete Warehouse (asynchronously) Deletes an existing Warehouse. When called, this endpoint + * may generate the `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) + * event. + * + * @param warehouseId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call deleteWarehouseAsync(String warehouseId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteWarehouseAsync( + String warehouseId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = deleteWarehouseValidateBeforeCall(warehouseId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getConnectionStateFromWarehouse - * @param warehouseId (required) + * + * @param warehouseId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getConnectionStateFromWarehouseCall(String warehouseId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getConnectionStateFromWarehouseCall( + String warehouseId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -683,8 +837,11 @@ public okhttp3.Call getConnectionStateFromWarehouseCall(String warehouseId, fina Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/connection-state" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/connection-state" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -693,127 +850,169 @@ public okhttp3.Call getConnectionStateFromWarehouseCall(String warehouseId, fina Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getConnectionStateFromWarehouseValidateBeforeCall(String warehouseId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getConnectionStateFromWarehouseValidateBeforeCall( + String warehouseId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling getConnectionStateFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " getConnectionStateFromWarehouse(Async)"); } - okhttp3.Call localVarCall = getConnectionStateFromWarehouseCall(warehouseId, _callback); return localVarCall; - } /** - * Get Connection State from Warehouse - * Verifies the state of Warehouse connection settings. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) + * Get Connection State from Warehouse Verifies the state of Warehouse connection settings. The + * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) * @return GetConnectionStateFromWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public GetConnectionStateFromWarehouse200Response getConnectionStateFromWarehouse(String warehouseId) throws ApiException { - ApiResponse localVarResp = getConnectionStateFromWarehouseWithHttpInfo(warehouseId); + public GetConnectionStateFromWarehouse200Response getConnectionStateFromWarehouse( + String warehouseId) throws ApiException { + ApiResponse localVarResp = + getConnectionStateFromWarehouseWithHttpInfo(warehouseId); return localVarResp.getData(); } /** - * Get Connection State from Warehouse - * Verifies the state of Warehouse connection settings. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) + * Get Connection State from Warehouse Verifies the state of Warehouse connection settings. The + * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) * @return ApiResponse<GetConnectionStateFromWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getConnectionStateFromWarehouseWithHttpInfo(String warehouseId) throws ApiException { - okhttp3.Call localVarCall = getConnectionStateFromWarehouseValidateBeforeCall(warehouseId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + getConnectionStateFromWarehouseWithHttpInfo(String warehouseId) throws ApiException { + okhttp3.Call localVarCall = + getConnectionStateFromWarehouseValidateBeforeCall(warehouseId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Connection State from Warehouse (asynchronously) - * Verifies the state of Warehouse connection settings. The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * @param warehouseId (required) + * Get Connection State from Warehouse (asynchronously) Verifies the state of Warehouse + * connection settings. The rate limit for this endpoint is 20 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param warehouseId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getConnectionStateFromWarehouseAsync(String warehouseId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getConnectionStateFromWarehouseValidateBeforeCall(warehouseId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call getConnectionStateFromWarehouseAsync( + String warehouseId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getConnectionStateFromWarehouseValidateBeforeCall(warehouseId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getWarehouse - * @param warehouseId (required) + * + * @param warehouseId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -822,8 +1021,11 @@ public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _call Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -832,53 +1034,69 @@ public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _call Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getWarehouseValidateBeforeCall(String warehouseId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getWarehouseValidateBeforeCall( + String warehouseId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling getWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " getWarehouse(Async)"); } - okhttp3.Call localVarCall = getWarehouseCall(warehouseId, _callback); return localVarCall; - } /** - * Get Warehouse - * Returns a Warehouse by its id. - * @param warehouseId (required) + * Get Warehouse Returns a Warehouse by its id. + * + * @param warehouseId (required) * @return GetWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetWarehouse200Response getWarehouse(String warehouseId) throws ApiException { ApiResponse localVarResp = getWarehouseWithHttpInfo(warehouseId); @@ -886,74 +1104,82 @@ public GetWarehouse200Response getWarehouse(String warehouseId) throws ApiExcept } /** - * Get Warehouse - * Returns a Warehouse by its id. - * @param warehouseId (required) + * Get Warehouse Returns a Warehouse by its id. + * + * @param warehouseId (required) * @return ApiResponse<GetWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse getWarehouseWithHttpInfo(String warehouseId) throws ApiException { + public ApiResponse getWarehouseWithHttpInfo(String warehouseId) + throws ApiException { okhttp3.Call localVarCall = getWarehouseValidateBeforeCall(warehouseId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Warehouse (asynchronously) - * Returns a Warehouse by its id. - * @param warehouseId (required) + * Get Warehouse (asynchronously) Returns a Warehouse by its id. + * + * @param warehouseId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWarehouseAsync(String warehouseId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getWarehouseAsync( + String warehouseId, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getWarehouseValidateBeforeCall(warehouseId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listConnectedSourcesFromWarehouse - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listConnectedSourcesFromWarehouseCall(String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listConnectedSourcesFromWarehouseCall( + String warehouseId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -962,8 +1188,11 @@ public okhttp3.Call listConnectedSourcesFromWarehouseCall(String warehouseId, Pa Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/connected-sources" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/connected-sources" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -976,135 +1205,175 @@ public okhttp3.Call listConnectedSourcesFromWarehouseCall(String warehouseId, Pa } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listConnectedSourcesFromWarehouseValidateBeforeCall(String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listConnectedSourcesFromWarehouseValidateBeforeCall( + String warehouseId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling listConnectedSourcesFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listConnectedSourcesFromWarehouse(Async)"); } - + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listConnectedSourcesFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listConnectedSourcesFromWarehouse(Async)"); } - - okhttp3.Call localVarCall = listConnectedSourcesFromWarehouseCall(warehouseId, pagination, _callback); + okhttp3.Call localVarCall = + listConnectedSourcesFromWarehouseCall(warehouseId, pagination, _callback); return localVarCall; - } /** - * List Connected Sources from Warehouse - * Returns the list of Sources that are connected to a Warehouse. - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Connected Sources from Warehouse Returns the list of Sources that are connected to a + * Warehouse. + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListConnectedSourcesFromWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListConnectedSourcesFromWarehouse200Response listConnectedSourcesFromWarehouse(String warehouseId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listConnectedSourcesFromWarehouseWithHttpInfo(warehouseId, pagination); + public ListConnectedSourcesFromWarehouse200Response listConnectedSourcesFromWarehouse( + String warehouseId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listConnectedSourcesFromWarehouseWithHttpInfo(warehouseId, pagination); return localVarResp.getData(); } /** - * List Connected Sources from Warehouse - * Returns the list of Sources that are connected to a Warehouse. - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Connected Sources from Warehouse Returns the list of Sources that are connected to a + * Warehouse. + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListConnectedSourcesFromWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listConnectedSourcesFromWarehouseWithHttpInfo(String warehouseId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listConnectedSourcesFromWarehouseValidateBeforeCall(warehouseId, pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + listConnectedSourcesFromWarehouseWithHttpInfo( + String warehouseId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listConnectedSourcesFromWarehouseValidateBeforeCall(warehouseId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Connected Sources from Warehouse (asynchronously) - * Returns the list of Sources that are connected to a Warehouse. - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Connected Sources from Warehouse (asynchronously) Returns the list of Sources that are + * connected to a Warehouse. + * + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listConnectedSourcesFromWarehouseAsync(String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listConnectedSourcesFromWarehouseValidateBeforeCall(warehouseId, pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call listConnectedSourcesFromWarehouseAsync( + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listConnectedSourcesFromWarehouseValidateBeforeCall( + warehouseId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for listWarehouses - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listWarehousesCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listWarehousesCall(PaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1126,128 +1395,153 @@ public okhttp3.Call listWarehousesCall(PaginationInput pagination, final ApiCall } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call listWarehousesValidateBeforeCall(PaginationInput pagination, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call listWarehousesValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pagination' is set if (pagination == null) { - throw new ApiException("Missing the required parameter 'pagination' when calling listWarehouses(Async)"); + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listWarehouses(Async)"); } - okhttp3.Call localVarCall = listWarehousesCall(pagination, _callback); return localVarCall; - } /** - * List Warehouses - * Returns a list of Warehouses. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Warehouses Returns a list of Warehouses. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListWarehouses200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ListWarehouses200Response listWarehouses(PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = listWarehousesWithHttpInfo(pagination); + public ListWarehouses200Response listWarehouses(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listWarehousesWithHttpInfo(pagination); return localVarResp.getData(); } /** - * List Warehouses - * Returns a list of Warehouses. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Warehouses Returns a list of Warehouses. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListWarehouses200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse listWarehousesWithHttpInfo(PaginationInput pagination) throws ApiException { + public ApiResponse listWarehousesWithHttpInfo( + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listWarehousesValidateBeforeCall(pagination, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Warehouses (asynchronously) - * Returns a list of Warehouses. - * @param pagination Defines the pagination parameters. This parameter exists in alpha. (required) + * List Warehouses (asynchronously) Returns a list of Warehouses. + * + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call listWarehousesAsync(PaginationInput pagination, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listWarehousesAsync( + PaginationInput pagination, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = listWarehousesValidateBeforeCall(pagination, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for removeSourceConnectionFromWarehouse - * @param warehouseId (required) - * @param sourceId (required) + * + * @param warehouseId (required) + * @param sourceId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeSourceConnectionFromWarehouseCall(String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeSourceConnectionFromWarehouseCall( + String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1256,9 +1550,14 @@ public okhttp3.Call removeSourceConnectionFromWarehouseCall(String warehouseId, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll("\\{" + "sourceId" + "\\}", localVarApiClient.escapeString(sourceId.toString())); + String localVarPath = + "/warehouses/{warehouseId}/connected-sources/{sourceId}" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())) + .replaceAll( + "\\{" + "sourceId" + "\\}", + localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1267,136 +1566,176 @@ public okhttp3.Call removeSourceConnectionFromWarehouseCall(String warehouseId, Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call removeSourceConnectionFromWarehouseValidateBeforeCall(String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call removeSourceConnectionFromWarehouseValidateBeforeCall( + String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling removeSourceConnectionFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " removeSourceConnectionFromWarehouse(Async)"); } - + // verify the required parameter 'sourceId' is set if (sourceId == null) { - throw new ApiException("Missing the required parameter 'sourceId' when calling removeSourceConnectionFromWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " removeSourceConnectionFromWarehouse(Async)"); } - - okhttp3.Call localVarCall = removeSourceConnectionFromWarehouseCall(warehouseId, sourceId, _callback); + okhttp3.Call localVarCall = + removeSourceConnectionFromWarehouseCall(warehouseId, sourceId, _callback); return localVarCall; - } /** - * Remove Source Connection from Warehouse - * Disconnects a Source from a Warehouse. - * @param warehouseId (required) - * @param sourceId (required) + * Remove Source Connection from Warehouse Disconnects a Source from a Warehouse. + * + * @param warehouseId (required) + * @param sourceId (required) * @return RemoveSourceConnectionFromWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public RemoveSourceConnectionFromWarehouse200Response removeSourceConnectionFromWarehouse(String warehouseId, String sourceId) throws ApiException { - ApiResponse localVarResp = removeSourceConnectionFromWarehouseWithHttpInfo(warehouseId, sourceId); + public RemoveSourceConnectionFromWarehouse200Response removeSourceConnectionFromWarehouse( + String warehouseId, String sourceId) throws ApiException { + ApiResponse localVarResp = + removeSourceConnectionFromWarehouseWithHttpInfo(warehouseId, sourceId); return localVarResp.getData(); } /** - * Remove Source Connection from Warehouse - * Disconnects a Source from a Warehouse. - * @param warehouseId (required) - * @param sourceId (required) + * Remove Source Connection from Warehouse Disconnects a Source from a Warehouse. + * + * @param warehouseId (required) + * @param sourceId (required) * @return ApiResponse<RemoveSourceConnectionFromWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse removeSourceConnectionFromWarehouseWithHttpInfo(String warehouseId, String sourceId) throws ApiException { - okhttp3.Call localVarCall = removeSourceConnectionFromWarehouseValidateBeforeCall(warehouseId, sourceId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse + removeSourceConnectionFromWarehouseWithHttpInfo(String warehouseId, String sourceId) + throws ApiException { + okhttp3.Call localVarCall = + removeSourceConnectionFromWarehouseValidateBeforeCall(warehouseId, sourceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Remove Source Connection from Warehouse (asynchronously) - * Disconnects a Source from a Warehouse. - * @param warehouseId (required) - * @param sourceId (required) + * Remove Source Connection from Warehouse (asynchronously) Disconnects a Source from a + * Warehouse. + * + * @param warehouseId (required) + * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call removeSourceConnectionFromWarehouseAsync(String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = removeSourceConnectionFromWarehouseValidateBeforeCall(warehouseId, sourceId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call removeSourceConnectionFromWarehouseAsync( + String warehouseId, + String sourceId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeSourceConnectionFromWarehouseValidateBeforeCall( + warehouseId, sourceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateWarehouse - * @param warehouseId (required) - * @param updateWarehouseV1Input (required) + * + * @param warehouseId (required) + * @param updateWarehouseV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateWarehouseCall(String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateWarehouseCall( + String warehouseId, + UpdateWarehouseV1Input updateWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -1405,8 +1744,11 @@ public okhttp3.Call updateWarehouseCall(String warehouseId, UpdateWarehouseV1Inp Object localVarPostBody = updateWarehouseV1Input; // create path and map variables - String localVarPath = "/warehouses/{warehouseId}" - .replaceAll("\\{" + "warehouseId" + "\\}", localVarApiClient.escapeString(warehouseId.toString())); + String localVarPath = + "/warehouses/{warehouseId}" + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1415,7 +1757,10 @@ public okhttp3.Call updateWarehouseCall(String warehouseId, UpdateWarehouseV1Inp Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1423,100 +1768,139 @@ public okhttp3.Call updateWarehouseCall(String warehouseId, UpdateWarehouseV1Inp } final String[] localVarContentTypes = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call updateWarehouseValidateBeforeCall(String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input, final ApiCallback _callback) throws ApiException { - + private okhttp3.Call updateWarehouseValidateBeforeCall( + String warehouseId, + UpdateWarehouseV1Input updateWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'warehouseId' is set if (warehouseId == null) { - throw new ApiException("Missing the required parameter 'warehouseId' when calling updateWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " updateWarehouse(Async)"); } - + // verify the required parameter 'updateWarehouseV1Input' is set if (updateWarehouseV1Input == null) { - throw new ApiException("Missing the required parameter 'updateWarehouseV1Input' when calling updateWarehouse(Async)"); + throw new ApiException( + "Missing the required parameter 'updateWarehouseV1Input' when calling" + + " updateWarehouse(Async)"); } - - okhttp3.Call localVarCall = updateWarehouseCall(warehouseId, updateWarehouseV1Input, _callback); + okhttp3.Call localVarCall = + updateWarehouseCall(warehouseId, updateWarehouseV1Input, _callback); return localVarCall; - } /** - * Update Warehouse - * Updates an existing Warehouse. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination Modified * Storage Destination Enabled - * @param warehouseId (required) - * @param updateWarehouseV1Input (required) + * Update Warehouse Updates an existing Warehouse. When called, this endpoint may generate one + * or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination + * Modified * Storage Destination Enabled + * + * @param warehouseId (required) + * @param updateWarehouseV1Input (required) * @return UpdateWarehouse200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public UpdateWarehouse200Response updateWarehouse(String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input) throws ApiException { - ApiResponse localVarResp = updateWarehouseWithHttpInfo(warehouseId, updateWarehouseV1Input); + public UpdateWarehouse200Response updateWarehouse( + String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input) throws ApiException { + ApiResponse localVarResp = + updateWarehouseWithHttpInfo(warehouseId, updateWarehouseV1Input); return localVarResp.getData(); } /** - * Update Warehouse - * Updates an existing Warehouse. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination Modified * Storage Destination Enabled - * @param warehouseId (required) - * @param updateWarehouseV1Input (required) + * Update Warehouse Updates an existing Warehouse. When called, this endpoint may generate one + * or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination + * Modified * Storage Destination Enabled + * + * @param warehouseId (required) + * @param updateWarehouseV1Input (required) * @return ApiResponse<UpdateWarehouse200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public ApiResponse updateWarehouseWithHttpInfo(String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input) throws ApiException { - okhttp3.Call localVarCall = updateWarehouseValidateBeforeCall(warehouseId, updateWarehouseV1Input, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse updateWarehouseWithHttpInfo( + String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input) throws ApiException { + okhttp3.Call localVarCall = + updateWarehouseValidateBeforeCall(warehouseId, updateWarehouseV1Input, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Update Warehouse (asynchronously) - * Updates an existing Warehouse. When called, this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination Modified * Storage Destination Enabled - * @param warehouseId (required) - * @param updateWarehouseV1Input (required) + * Update Warehouse (asynchronously) Updates an existing Warehouse. When called, this endpoint + * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage + * Destination Modified * Storage Destination Enabled + * + * @param warehouseId (required) + * @param updateWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call updateWarehouseAsync(String warehouseId, UpdateWarehouseV1Input updateWarehouseV1Input, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = updateWarehouseValidateBeforeCall(warehouseId, updateWarehouseV1Input, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + public okhttp3.Call updateWarehouseAsync( + String warehouseId, + UpdateWarehouseV1Input updateWarehouseV1Input, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateWarehouseValidateBeforeCall(warehouseId, updateWarehouseV1Input, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index d4b77184..b898a98f 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,32 +10,22 @@ * Do not edit the class manually. */ - package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.ProgressRequestBody; -import com.segment.publicapi.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - import com.segment.publicapi.models.GetWorkspace200Response; -import com.segment.publicapi.models.RequestErrorEnvelope; - import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; public class WorkspacesApi { private ApiClient localVarApiClient; @@ -76,27 +66,28 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for getWorkspace + * * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public okhttp3.Call getWorkspaceCall(final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers - String[] localBasePaths = new String[] { }; + String[] localBasePaths = new String[] {}; // Determine Base Path to Use - if (localCustomBaseUrl != null){ + if (localCustomBaseUrl != null) { basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { + } else if (localBasePaths.length > 0) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; @@ -114,47 +105,61 @@ public okhttp3.Call getWorkspaceCall(final ApiCallback _callback) throws ApiExce Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/vnd.segment.v1beta+json", "application/vnd.segment.v1+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "token" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) throws ApiException { - + private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getWorkspaceCall(_callback); return localVarCall; - } /** - * Get Workspace - * Returns the Workspace associated with the token used to access this resource. + * Get Workspace Returns the Workspace associated with the token used to access this resource. + * * @return GetWorkspace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public GetWorkspace200Response getWorkspace() throws ApiException { ApiResponse localVarResp = getWorkspaceWithHttpInfo(); @@ -162,44 +167,48 @@ public GetWorkspace200Response getWorkspace() throws ApiException { } /** - * Get Workspace - * Returns the Workspace associated with the token used to access this resource. + * Get Workspace Returns the Workspace associated with the token used to access this resource. + * * @return ApiResponse<GetWorkspace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ public ApiResponse getWorkspaceWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getWorkspaceValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Workspace (asynchronously) - * Returns the Workspace associated with the token used to access this resource. + * Get Workspace (asynchronously) Returns the Workspace associated with the token used to access + * this resource. + * * @param _callback The callback to be executed when the API call finishes * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
*/ - public okhttp3.Call getWorkspaceAsync(final ApiCallback _callback) throws ApiException { + public okhttp3.Call getWorkspaceAsync(final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getWorkspaceValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java index f4e9c829..035d232e 100644 --- a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java +++ b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,71 +10,75 @@ * Do not edit the class manually. */ - package com.segment.publicapi.auth; + import com.segment.publicapi.ApiException; import com.segment.publicapi.Pair; - import java.net.URI; -import java.util.Map; import java.util.List; - +import java.util.Map; public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } + private final String location; + private final String paramName; - public String getLocation() { - return location; - } + private String apiKey; + private String apiKeyPrefix; - public String getParamName() { - return paramName; - } + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } - public String getApiKey() { - return apiKey; - } + public String getLocation() { + return location; + } - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } + public String getParamName() { + return paramName; + } - public String getApiKeyPrefix() { - return apiKeyPrefix; - } + public String getApiKey() { + return apiKey; + } - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; + public String getApiKeyPrefix() { + return apiKeyPrefix; } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); + + @Override + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } } - } } diff --git a/src/main/java/com/segment/publicapi/auth/Authentication.java b/src/main/java/com/segment/publicapi/auth/Authentication.java index cffcb3e3..c314af4f 100644 --- a/src/main/java/com/segment/publicapi/auth/Authentication.java +++ b/src/main/java/com/segment/publicapi/auth/Authentication.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,15 +10,14 @@ * Do not edit the class manually. */ - package com.segment.publicapi.auth; -import com.segment.publicapi.Pair; -import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; public interface Authentication { /** @@ -32,5 +31,12 @@ public interface Authentication { * @param uri URI * @throws ApiException if failed to update the parameters */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; + void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException; } diff --git a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java index 0d9da4e6..dd20d918 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,19 +10,15 @@ * Do not edit the class manually. */ - package com.segment.publicapi.auth; -import com.segment.publicapi.Pair; -import com.segment.publicapi.ApiException; - -import okhttp3.Credentials; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Pair; import java.net.URI; -import java.util.Map; import java.util.List; - -import java.io.UnsupportedEncodingException; +import java.util.Map; +import okhttp3.Credentials; public class HttpBasicAuth implements Authentication { private String username; @@ -45,13 +41,20 @@ public void setPassword(String password) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { if (username == null && password == null) { return; } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); + headerParams.put( + "Authorization", + Credentials.basic( + username == null ? "" : username, password == null ? "" : password)); } } diff --git a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java index dd01c029..bea680bd 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,54 +10,62 @@ * Do not edit the class manually. */ - package com.segment.publicapi.auth; + import com.segment.publicapi.ApiException; import com.segment.publicapi.Pair; - import java.net.URI; -import java.util.Map; import java.util.List; - +import java.util.Map; public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (bearerToken == null) { - return; + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; } - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } + /** + * Gets the token, which together with the scheme, will be sent as the value of the + * Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the + * Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + if (bearerToken == null) { + return; + } - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } + headerParams.put( + "Authorization", + (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } } diff --git a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java index 59c19103..ff712688 100644 --- a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,242 +10,244 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * A snapshot of the number of API calls for a given Workspace. - */ +/** A snapshot of the number of API calls for a given Workspace. */ @ApiModel(description = "A snapshot of the number of API calls for a given Workspace.") - public class APICallSnapshotV1 { - public static final String SERIALIZED_NAME_API_CALLS = "apiCalls"; - @SerializedName(SERIALIZED_NAME_API_CALLS) - private String apiCalls; - - public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; - @SerializedName(SERIALIZED_NAME_TIMESTAMP) - private String timestamp; + public static final String SERIALIZED_NAME_API_CALLS = "apiCalls"; - public APICallSnapshotV1() { - } + @SerializedName(SERIALIZED_NAME_API_CALLS) + private String apiCalls; - public APICallSnapshotV1 apiCalls(String apiCalls) { - - this.apiCalls = apiCalls; - return this; - } + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; - /** - * A bigint of the number of API calls in this snapshot. - * @return apiCalls - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A bigint of the number of API calls in this snapshot.") + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; - public String getApiCalls() { - return apiCalls; - } + public APICallSnapshotV1() {} + public APICallSnapshotV1 apiCalls(String apiCalls) { - public void setApiCalls(String apiCalls) { - this.apiCalls = apiCalls; - } + this.apiCalls = apiCalls; + return this; + } + /** + * A bigint of the number of API calls in this snapshot. + * + * @return apiCalls + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A bigint of the number of API calls in this snapshot.") + public String getApiCalls() { + return apiCalls; + } - public APICallSnapshotV1 timestamp(String timestamp) { - - this.timestamp = timestamp; - return this; - } + public void setApiCalls(String apiCalls) { + this.apiCalls = apiCalls; + } - /** - * Timestamp of this snapshot within the billing cycle in the ISO-8601 format. - * @return timestamp - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Timestamp of this snapshot within the billing cycle in the ISO-8601 format.") + public APICallSnapshotV1 timestamp(String timestamp) { - public String getTimestamp() { - return timestamp; - } + this.timestamp = timestamp; + return this; + } + /** + * Timestamp of this snapshot within the billing cycle in the ISO-8601 format. + * + * @return timestamp + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Timestamp of this snapshot within the billing cycle in the ISO-8601 format.") + public String getTimestamp() { + return timestamp; + } - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APICallSnapshotV1 apICallSnapshotV1 = (APICallSnapshotV1) o; + return Objects.equals(this.apiCalls, apICallSnapshotV1.apiCalls) + && Objects.equals(this.timestamp, apICallSnapshotV1.timestamp); + } + @Override + public int hashCode() { + return Objects.hash(apiCalls, timestamp); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APICallSnapshotV1 {\n"); + sb.append(" apiCalls: ").append(toIndentedString(apiCalls)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - APICallSnapshotV1 apICallSnapshotV1 = (APICallSnapshotV1) o; - return Objects.equals(this.apiCalls, apICallSnapshotV1.apiCalls) && - Objects.equals(this.timestamp, apICallSnapshotV1.timestamp); - } - - @Override - public int hashCode() { - return Objects.hash(apiCalls, timestamp); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class APICallSnapshotV1 {\n"); - sb.append(" apiCalls: ").append(toIndentedString(apiCalls)).append("\n"); - sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("apiCalls"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("apiCalls"); + openapiRequiredFields.add("timestamp"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("apiCalls"); - openapiFields.add("timestamp"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("apiCalls"); - openapiRequiredFields.add("timestamp"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to APICallSnapshotV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!APICallSnapshotV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in APICallSnapshotV1 is not found in the empty JSON string", APICallSnapshotV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to APICallSnapshotV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!APICallSnapshotV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in APICallSnapshotV1 is not found in the" + + " empty JSON string", + APICallSnapshotV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!APICallSnapshotV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `APICallSnapshotV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!APICallSnapshotV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `APICallSnapshotV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : APICallSnapshotV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : APICallSnapshotV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("apiCalls").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `apiCalls` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("apiCalls").toString())); + } + if (!jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timestamp` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timestamp").toString())); } - } - if (!jsonObj.get("apiCalls").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiCalls` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiCalls").toString())); - } - if (!jsonObj.get("timestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!APICallSnapshotV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'APICallSnapshotV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(APICallSnapshotV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, APICallSnapshotV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public APICallSnapshotV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of APICallSnapshotV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of APICallSnapshotV1 - * @throws IOException if the JSON string is invalid with respect to APICallSnapshotV1 - */ - public static APICallSnapshotV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, APICallSnapshotV1.class); - } - - /** - * Convert an instance of APICallSnapshotV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!APICallSnapshotV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'APICallSnapshotV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(APICallSnapshotV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, APICallSnapshotV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public APICallSnapshotV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of APICallSnapshotV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of APICallSnapshotV1 + * @throws IOException if the JSON string is invalid with respect to APICallSnapshotV1 + */ + public static APICallSnapshotV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, APICallSnapshotV1.class); + } + + /** + * Convert an instance of APICallSnapshotV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java index b8cf4100..7a6f9656 100644 --- a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java +++ b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,21 +10,16 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import com.segment.publicapi.ApiException; -import java.util.Objects; -import java.lang.reflect.Type; + import java.util.Map; +import java.util.Objects; import javax.ws.rs.core.GenericType; -//import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ +// import com.fasterxml.jackson.annotation.JsonValue; +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -53,18 +48,23 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - //@JsonValue - public Object getActualInstance() {return instance;} + // @JsonValue + public Object getActualInstance() { + return instance; + } /** * Set the actual instance * * @param instance the actual instance of the schema/object */ - public void setActualInstance(Object instance) {this.instance = instance;} + public void setActualInstance(Object instance) { + this.instance = instance; + } /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well * * @return an instance of the actual schema/object */ @@ -76,7 +76,7 @@ private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { if (object.getActualInstance() == null) { return null; } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); } else { return object.getActualInstance(); } @@ -103,8 +103,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). */ private String toIndentedString(Object o) { if (o == null) { @@ -121,9 +121,9 @@ public boolean equals(Object o) { return false; } AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) && - Objects.equals(this.isNullable, a.isNullable) && - Objects.equals(this.schemaType, a.schemaType); + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); } @Override @@ -143,7 +143,4 @@ public Boolean isNullable() { return Boolean.FALSE; } } - - - } diff --git a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java index 6e1cf34e..3b78aca0 100644 --- a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,287 +10,292 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.PermissionResourceV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * A permission governing access to a resource. - */ +/** A permission governing access to a resource. */ @ApiModel(description = "A permission governing access to a resource.") - public class AccessPermissionV1 { - public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; - @SerializedName(SERIALIZED_NAME_ROLE_ID) - private String roleId; - - public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; - @SerializedName(SERIALIZED_NAME_ROLE_NAME) - private String roleName; + public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; - public static final String SERIALIZED_NAME_RESOURCES = "resources"; - @SerializedName(SERIALIZED_NAME_RESOURCES) - private List resources = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_ROLE_ID) + private String roleId; - public AccessPermissionV1() { - } + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; - public AccessPermissionV1 roleId(String roleId) { - - this.roleId = roleId; - return this; - } + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; - /** - * The id of the role that applies to this permission. - * @return roleId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the role that applies to this permission.") + public static final String SERIALIZED_NAME_RESOURCES = "resources"; - public String getRoleId() { - return roleId; - } + @SerializedName(SERIALIZED_NAME_RESOURCES) + private List resources = new ArrayList<>(); + public AccessPermissionV1() {} - public void setRoleId(String roleId) { - this.roleId = roleId; - } + public AccessPermissionV1 roleId(String roleId) { + this.roleId = roleId; + return this; + } - public AccessPermissionV1 roleName(String roleName) { - - this.roleName = roleName; - return this; - } - - /** - * The name of the role that applies to this permission. - * @return roleName - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the role that applies to this permission.") + /** + * The id of the role that applies to this permission. + * + * @return roleId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the role that applies to this permission.") + public String getRoleId() { + return roleId; + } - public String getRoleName() { - return roleName; - } + public void setRoleId(String roleId) { + this.roleId = roleId; + } + public AccessPermissionV1 roleName(String roleName) { - public void setRoleName(String roleName) { - this.roleName = roleName; - } + this.roleName = roleName; + return this; + } + /** + * The name of the role that applies to this permission. + * + * @return roleName + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The name of the role that applies to this permission.") + public String getRoleName() { + return roleName; + } - public AccessPermissionV1 resources(List resources) { - - this.resources = resources; - return this; - } + public void setRoleName(String roleName) { + this.roleName = roleName; + } - public AccessPermissionV1 addResourcesItem(PermissionResourceV1 resourcesItem) { - this.resources.add(resourcesItem); - return this; - } + public AccessPermissionV1 resources(List resources) { - /** - * The resources included with this permission. - * @return resources - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The resources included with this permission.") + this.resources = resources; + return this; + } - public List getResources() { - return resources; - } + public AccessPermissionV1 addResourcesItem(PermissionResourceV1 resourcesItem) { + this.resources.add(resourcesItem); + return this; + } + /** + * The resources included with this permission. + * + * @return resources + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The resources included with this permission.") + public List getResources() { + return resources; + } - public void setResources(List resources) { - this.resources = resources; - } + public void setResources(List resources) { + this.resources = resources; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessPermissionV1 accessPermissionV1 = (AccessPermissionV1) o; + return Objects.equals(this.roleId, accessPermissionV1.roleId) + && Objects.equals(this.roleName, accessPermissionV1.roleName) + && Objects.equals(this.resources, accessPermissionV1.resources); + } + @Override + public int hashCode() { + return Objects.hash(roleId, roleName, resources); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessPermissionV1 {\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AccessPermissionV1 accessPermissionV1 = (AccessPermissionV1) o; - return Objects.equals(this.roleId, accessPermissionV1.roleId) && - Objects.equals(this.roleName, accessPermissionV1.roleName) && - Objects.equals(this.resources, accessPermissionV1.resources); - } - - @Override - public int hashCode() { - return Objects.hash(roleId, roleName, resources); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccessPermissionV1 {\n"); - sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); - sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("roleId"); + openapiFields.add("roleName"); + openapiFields.add("resources"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("roleId"); + openapiRequiredFields.add("roleName"); + openapiRequiredFields.add("resources"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("roleId"); - openapiFields.add("roleName"); - openapiFields.add("resources"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("roleId"); - openapiRequiredFields.add("roleName"); - openapiRequiredFields.add("resources"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AccessPermissionV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AccessPermissionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AccessPermissionV1 is not found in the empty JSON string", AccessPermissionV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccessPermissionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AccessPermissionV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AccessPermissionV1 is not found in the" + + " empty JSON string", + AccessPermissionV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AccessPermissionV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccessPermissionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AccessPermissionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AccessPermissionV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AccessPermissionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccessPermissionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("roleId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `roleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleId").toString())); - } - if (!jsonObj.get("roleName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("resources").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `resources` to be an array in the JSON string but got `%s`", jsonObj.get("resources").toString())); - } - - JsonArray jsonArrayresources = jsonObj.getAsJsonArray("resources"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AccessPermissionV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AccessPermissionV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AccessPermissionV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AccessPermissionV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AccessPermissionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + if (!jsonObj.get("roleId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `roleId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("roleId").toString())); + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `roleName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("roleName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("resources").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resources` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("resources").toString())); + } + + JsonArray jsonArrayresources = jsonObj.getAsJsonArray("resources"); } - } - - /** - * Create an instance of AccessPermissionV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AccessPermissionV1 - * @throws IOException if the JSON string is invalid with respect to AccessPermissionV1 - */ - public static AccessPermissionV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AccessPermissionV1.class); - } - - /** - * Convert an instance of AccessPermissionV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccessPermissionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessPermissionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AccessPermissionV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AccessPermissionV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccessPermissionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AccessPermissionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessPermissionV1 + * @throws IOException if the JSON string is invalid with respect to AccessPermissionV1 + */ + public static AccessPermissionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessPermissionV1.class); + } + + /** + * Convert an instance of AccessPermissionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java index dfff9b4c..c578bc4e 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,200 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddConnectionFromSourceToWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddConnectionFromSourceToWarehouse200Response - */ - +/** AddConnectionFromSourceToWarehouse200Response */ public class AddConnectionFromSourceToWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddConnectionFromSourceToWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddConnectionFromSourceToWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddConnectionFromSourceToWarehouseV1Output data; - public AddConnectionFromSourceToWarehouse200Response data(AddConnectionFromSourceToWarehouseV1Output data) { - - this.data = data; - return this; - } + public AddConnectionFromSourceToWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddConnectionFromSourceToWarehouse200Response data( + AddConnectionFromSourceToWarehouseV1Output data) { - public AddConnectionFromSourceToWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddConnectionFromSourceToWarehouseV1Output getData() { + return data; + } - public void setData(AddConnectionFromSourceToWarehouseV1Output data) { - this.data = data; - } + public void setData(AddConnectionFromSourceToWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddConnectionFromSourceToWarehouse200Response + addConnectionFromSourceToWarehouse200Response = + (AddConnectionFromSourceToWarehouse200Response) o; + return Objects.equals(this.data, addConnectionFromSourceToWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddConnectionFromSourceToWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWarehouse200Response = (AddConnectionFromSourceToWarehouse200Response) o; - return Objects.equals(this.data, addConnectionFromSourceToWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddConnectionFromSourceToWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddConnectionFromSourceToWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddConnectionFromSourceToWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddConnectionFromSourceToWarehouse200Response is not found in the empty JSON string", AddConnectionFromSourceToWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddConnectionFromSourceToWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddConnectionFromSourceToWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AddConnectionFromSourceToWarehouse200Response is not found" + + " in the empty JSON string", + AddConnectionFromSourceToWarehouse200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddConnectionFromSourceToWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddConnectionFromSourceToWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddConnectionFromSourceToWarehouse200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddConnectionFromSourceToWarehouse200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddConnectionFromSourceToWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddConnectionFromSourceToWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddConnectionFromSourceToWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddConnectionFromSourceToWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddConnectionFromSourceToWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddConnectionFromSourceToWarehouse200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AddConnectionFromSourceToWarehouse200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(AddConnectionFromSourceToWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AddConnectionFromSourceToWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddConnectionFromSourceToWarehouse200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddConnectionFromSourceToWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddConnectionFromSourceToWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to + * AddConnectionFromSourceToWarehouse200Response + */ + public static AddConnectionFromSourceToWarehouse200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AddConnectionFromSourceToWarehouse200Response.class); } - } - - /** - * Create an instance of AddConnectionFromSourceToWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddConnectionFromSourceToWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to AddConnectionFromSourceToWarehouse200Response - */ - public static AddConnectionFromSourceToWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddConnectionFromSourceToWarehouse200Response.class); - } - - /** - * Convert an instance of AddConnectionFromSourceToWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddConnectionFromSourceToWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java index 3dc0518d..bcccaf5d 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,255 +10,267 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Response indicating whether the connection was successful. - */ +/** Response indicating whether the connection was successful. */ @ApiModel(description = "Response indicating whether the connection was successful.") - public class AddConnectionFromSourceToWarehouseV1Output { - /** - * The status of the connection between the Source and Warehouse. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - CONNECTED("CONNECTED"), - - NOT_CONNECTED("NOT_CONNECTED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } + /** The status of the connection between the Source and Warehouse. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + CONNECTED("CONNECTED"), - public String getValue() { - return value; - } + NOT_CONNECTED("NOT_CONNECTED"); - @Override - public String toString() { - return String.valueOf(value); - } + private String value; - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public AddConnectionFromSourceToWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public AddConnectionFromSourceToWarehouseV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public AddConnectionFromSourceToWarehouseV1Output() {} - /** - * The status of the connection between the Source and Warehouse. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the connection between the Source and Warehouse.") + public AddConnectionFromSourceToWarehouseV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the connection between the Source and Warehouse. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The status of the connection between the Source and Warehouse.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddConnectionFromSourceToWarehouseV1Output addConnectionFromSourceToWarehouseV1Output = + (AddConnectionFromSourceToWarehouseV1Output) o; + return Objects.equals(this.status, addConnectionFromSourceToWarehouseV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddConnectionFromSourceToWarehouseV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddConnectionFromSourceToWarehouseV1Output addConnectionFromSourceToWarehouseV1Output = (AddConnectionFromSourceToWarehouseV1Output) o; - return Objects.equals(this.status, addConnectionFromSourceToWarehouseV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddConnectionFromSourceToWarehouseV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddConnectionFromSourceToWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddConnectionFromSourceToWarehouseV1Output is not found in the empty JSON string", AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddConnectionFromSourceToWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AddConnectionFromSourceToWarehouseV1Output is not found in" + + " the empty JSON string", + AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddConnectionFromSourceToWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddConnectionFromSourceToWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddConnectionFromSourceToWarehouseV1Output.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddConnectionFromSourceToWarehouseV1Output` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddConnectionFromSourceToWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddConnectionFromSourceToWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddConnectionFromSourceToWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddConnectionFromSourceToWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddConnectionFromSourceToWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AddConnectionFromSourceToWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddConnectionFromSourceToWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to AddConnectionFromSourceToWarehouseV1Output - */ - public static AddConnectionFromSourceToWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddConnectionFromSourceToWarehouseV1Output.class); - } - - /** - * Convert an instance of AddConnectionFromSourceToWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddConnectionFromSourceToWarehouseV1Output.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AddConnectionFromSourceToWarehouseV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddConnectionFromSourceToWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AddConnectionFromSourceToWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddConnectionFromSourceToWarehouseV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddConnectionFromSourceToWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddConnectionFromSourceToWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to + * AddConnectionFromSourceToWarehouseV1Output + */ + public static AddConnectionFromSourceToWarehouseV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AddConnectionFromSourceToWarehouseV1Output.class); + } + + /** + * Convert an instance of AddConnectionFromSourceToWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java index c8101d80..6350d7bf 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,188 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddLabelsToSourceAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddLabelsToSource200Response - */ - +/** AddLabelsToSource200Response */ public class AddLabelsToSource200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddLabelsToSourceAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddLabelsToSource200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddLabelsToSourceV1Output data; - public AddLabelsToSource200Response data(AddLabelsToSourceAlphaOutput data) { - - this.data = data; - return this; - } + public AddLabelsToSource200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddLabelsToSource200Response data(AddLabelsToSourceV1Output data) { - public AddLabelsToSourceAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddLabelsToSourceV1Output getData() { + return data; + } - public void setData(AddLabelsToSourceAlphaOutput data) { - this.data = data; - } + public void setData(AddLabelsToSourceV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddLabelsToSource200Response addLabelsToSource200Response = + (AddLabelsToSource200Response) o; + return Objects.equals(this.data, addLabelsToSource200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddLabelsToSource200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddLabelsToSource200Response addLabelsToSource200Response = (AddLabelsToSource200Response) o; - return Objects.equals(this.data, addLabelsToSource200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddLabelsToSource200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSource200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddLabelsToSource200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddLabelsToSource200Response is not found in the empty JSON string", AddLabelsToSource200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddLabelsToSource200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddLabelsToSource200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddLabelsToSource200Response is not" + + " found in the empty JSON string", + AddLabelsToSource200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddLabelsToSource200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddLabelsToSource200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddLabelsToSource200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddLabelsToSource200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddLabelsToSource200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddLabelsToSource200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSource200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddLabelsToSource200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddLabelsToSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddLabelsToSource200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddLabelsToSource200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddLabelsToSource200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddLabelsToSource200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddLabelsToSource200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddLabelsToSource200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddLabelsToSource200Response + * @throws IOException if the JSON string is invalid with respect to + * AddLabelsToSource200Response + */ + public static AddLabelsToSource200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddLabelsToSource200Response.class); } - } - - /** - * Create an instance of AddLabelsToSource200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddLabelsToSource200Response - * @throws IOException if the JSON string is invalid with respect to AddLabelsToSource200Response - */ - public static AddLabelsToSource200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddLabelsToSource200Response.class); - } - - /** - * Convert an instance of AddLabelsToSource200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddLabelsToSource200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java index 563ed207..2f509fd7 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddLabelsToSourceV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddLabelsToSource200Response1 - */ - +/** AddLabelsToSource200Response1 */ public class AddLabelsToSource200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddLabelsToSourceV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddLabelsToSource200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddLabelsToSourceAlphaOutput data; - public AddLabelsToSource200Response1 data(AddLabelsToSourceV1Output data) { - - this.data = data; - return this; - } + public AddLabelsToSource200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddLabelsToSource200Response1 data(AddLabelsToSourceAlphaOutput data) { - public AddLabelsToSourceV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddLabelsToSourceAlphaOutput getData() { + return data; + } - public void setData(AddLabelsToSourceV1Output data) { - this.data = data; - } + public void setData(AddLabelsToSourceAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddLabelsToSource200Response1 addLabelsToSource200Response1 = + (AddLabelsToSource200Response1) o; + return Objects.equals(this.data, addLabelsToSource200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddLabelsToSource200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddLabelsToSource200Response1 addLabelsToSource200Response1 = (AddLabelsToSource200Response1) o; - return Objects.equals(this.data, addLabelsToSource200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddLabelsToSource200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSource200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddLabelsToSource200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddLabelsToSource200Response1 is not found in the empty JSON string", AddLabelsToSource200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddLabelsToSource200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddLabelsToSource200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddLabelsToSource200Response1 is not" + + " found in the empty JSON string", + AddLabelsToSource200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddLabelsToSource200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddLabelsToSource200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddLabelsToSource200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddLabelsToSource200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddLabelsToSource200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddLabelsToSource200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSource200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddLabelsToSource200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddLabelsToSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddLabelsToSource200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddLabelsToSource200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddLabelsToSource200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddLabelsToSource200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddLabelsToSource200Response1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddLabelsToSource200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddLabelsToSource200Response1 + * @throws IOException if the JSON string is invalid with respect to + * AddLabelsToSource200Response1 + */ + public static AddLabelsToSource200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddLabelsToSource200Response1.class); } - } - - /** - * Create an instance of AddLabelsToSource200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddLabelsToSource200Response1 - * @throws IOException if the JSON string is invalid with respect to AddLabelsToSource200Response1 - */ - public static AddLabelsToSource200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddLabelsToSource200Response1.class); - } - - /** - * Convert an instance of AddLabelsToSource200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddLabelsToSource200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java index deffd01a..6eeaa66d 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,215 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.LabelAlpha; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Applies an existing label to an existing Source. - */ +/** Applies an existing label to an existing Source. */ @ApiModel(description = "Applies an existing label to an existing Source.") - public class AddLabelsToSourceAlphaInput { - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = new ArrayList<>(); + public static final String SERIALIZED_NAME_LABELS = "labels"; - public AddLabelsToSourceAlphaInput() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private List labels = new ArrayList<>(); - public AddLabelsToSourceAlphaInput labels(List labels) { - - this.labels = labels; - return this; - } + public AddLabelsToSourceAlphaInput() {} - public AddLabelsToSourceAlphaInput addLabelsItem(LabelAlpha labelsItem) { - this.labels.add(labelsItem); - return this; - } + public AddLabelsToSourceAlphaInput labels(List labels) { - /** - * The labels to associate with a Source. - * @return labels - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The labels to associate with a Source.") + this.labels = labels; + return this; + } - public List getLabels() { - return labels; - } + public AddLabelsToSourceAlphaInput addLabelsItem(LabelAlpha labelsItem) { + this.labels.add(labelsItem); + return this; + } + /** + * The labels to associate with a Source. + * + * @return labels + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The labels to associate with a Source.") + public List getLabels() { + return labels; + } - public void setLabels(List labels) { - this.labels = labels; - } + public void setLabels(List labels) { + this.labels = labels; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput = (AddLabelsToSourceAlphaInput) o; + return Objects.equals(this.labels, addLabelsToSourceAlphaInput.labels); + } + @Override + public int hashCode() { + return Objects.hash(labels); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddLabelsToSourceAlphaInput {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddLabelsToSourceAlphaInput addLabelsToSourceAlphaInput = (AddLabelsToSourceAlphaInput) o; - return Objects.equals(this.labels, addLabelsToSourceAlphaInput.labels); - } - - @Override - public int hashCode() { - return Objects.hash(labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddLabelsToSourceAlphaInput {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("labels"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("labels"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("labels"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddLabelsToSourceAlphaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddLabelsToSourceAlphaInput is not found in the empty JSON string", AddLabelsToSourceAlphaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddLabelsToSourceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddLabelsToSourceAlphaInput is not" + + " found in the empty JSON string", + AddLabelsToSourceAlphaInput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddLabelsToSourceAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddLabelsToSourceAlphaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddLabelsToSourceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddLabelsToSourceAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddLabelsToSourceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddLabelsToSourceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("labels").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `labels` to be an array in the JSON string but got `%s`", jsonObj.get("labels").toString())); - } - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - } + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddLabelsToSourceAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddLabelsToSourceAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceAlphaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddLabelsToSourceAlphaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddLabelsToSourceAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddLabelsToSourceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddLabelsToSourceAlphaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddLabelsToSourceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddLabelsToSourceAlphaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddLabelsToSourceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddLabelsToSourceAlphaInput + * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceAlphaInput + */ + public static AddLabelsToSourceAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddLabelsToSourceAlphaInput.class); } - } - - /** - * Create an instance of AddLabelsToSourceAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddLabelsToSourceAlphaInput - * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceAlphaInput - */ - public static AddLabelsToSourceAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddLabelsToSourceAlphaInput.class); - } - - /** - * Convert an instance of AddLabelsToSourceAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddLabelsToSourceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java index 30a82014..56866e6c 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,219 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.LabelAlpha; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Applies an existing label to an existing Source. - */ +/** Applies an existing label to an existing Source. */ @ApiModel(description = "Applies an existing label to an existing Source.") - public class AddLabelsToSourceAlphaOutput { - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = new ArrayList<>(); + public static final String SERIALIZED_NAME_LABELS = "labels"; - public AddLabelsToSourceAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private List labels = new ArrayList<>(); - public AddLabelsToSourceAlphaOutput labels(List labels) { - - this.labels = labels; - return this; - } + public AddLabelsToSourceAlphaOutput() {} - public AddLabelsToSourceAlphaOutput addLabelsItem(LabelAlpha labelsItem) { - this.labels.add(labelsItem); - return this; - } + public AddLabelsToSourceAlphaOutput labels(List labels) { - /** - * All labels applied to the Source. - * @return labels - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All labels applied to the Source.") + this.labels = labels; + return this; + } - public List getLabels() { - return labels; - } + public AddLabelsToSourceAlphaOutput addLabelsItem(LabelAlpha labelsItem) { + this.labels.add(labelsItem); + return this; + } + /** + * All labels applied to the Source. + * + * @return labels + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "All labels applied to the Source.") + public List getLabels() { + return labels; + } - public void setLabels(List labels) { - this.labels = labels; - } + public void setLabels(List labels) { + this.labels = labels; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddLabelsToSourceAlphaOutput addLabelsToSourceAlphaOutput = + (AddLabelsToSourceAlphaOutput) o; + return Objects.equals(this.labels, addLabelsToSourceAlphaOutput.labels); + } + @Override + public int hashCode() { + return Objects.hash(labels); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddLabelsToSourceAlphaOutput {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddLabelsToSourceAlphaOutput addLabelsToSourceAlphaOutput = (AddLabelsToSourceAlphaOutput) o; - return Objects.equals(this.labels, addLabelsToSourceAlphaOutput.labels); - } - - @Override - public int hashCode() { - return Objects.hash(labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddLabelsToSourceAlphaOutput {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("labels"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("labels"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("labels"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddLabelsToSourceAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddLabelsToSourceAlphaOutput is not found in the empty JSON string", AddLabelsToSourceAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddLabelsToSourceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddLabelsToSourceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddLabelsToSourceAlphaOutput is not" + + " found in the empty JSON string", + AddLabelsToSourceAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddLabelsToSourceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddLabelsToSourceAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddLabelsToSourceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddLabelsToSourceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddLabelsToSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddLabelsToSourceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("labels").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `labels` to be an array in the JSON string but got `%s`", jsonObj.get("labels").toString())); - } - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - } + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddLabelsToSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddLabelsToSourceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddLabelsToSourceAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddLabelsToSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddLabelsToSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddLabelsToSourceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddLabelsToSourceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddLabelsToSourceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddLabelsToSourceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddLabelsToSourceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddLabelsToSourceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * AddLabelsToSourceAlphaOutput + */ + public static AddLabelsToSourceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddLabelsToSourceAlphaOutput.class); } - } - - /** - * Create an instance of AddLabelsToSourceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddLabelsToSourceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceAlphaOutput - */ - public static AddLabelsToSourceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddLabelsToSourceAlphaOutput.class); - } - - /** - * Convert an instance of AddLabelsToSourceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddLabelsToSourceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index 85e8e756..ababcf0c 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,217 +10,210 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.LabelV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Applies an existing label to an existing Source. - */ +/** Applies an existing label to an existing Source. */ @ApiModel(description = "Applies an existing label to an existing Source.") - public class AddLabelsToSourceV1Input { - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = null; - - public AddLabelsToSourceV1Input() { - } - - public AddLabelsToSourceV1Input labels(List labels) { - - this.labels = labels; - return this; - } - - public AddLabelsToSourceV1Input addLabelsItem(LabelV1 labelsItem) { - if (this.labels == null) { - this.labels = new ArrayList<>(); - } - this.labels.add(labelsItem); - return this; - } + public static final String SERIALIZED_NAME_LABELS = "labels"; + + @SerializedName(SERIALIZED_NAME_LABELS) + private List labels = null; + + public AddLabelsToSourceV1Input() {} - /** - * The labels to associate with a Source. - * @return labels - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The labels to associate with a Source.") + public AddLabelsToSourceV1Input labels(List labels) { - public List getLabels() { - return labels; - } + this.labels = labels; + return this; + } + public AddLabelsToSourceV1Input addLabelsItem(LabelV1 labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } + this.labels.add(labelsItem); + return this; + } - public void setLabels(List labels) { - this.labels = labels; - } + /** + * The labels to associate with a Source. + * + * @return labels + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The labels to associate with a Source.") + public List getLabels() { + return labels; + } + public void setLabels(List labels) { + this.labels = labels; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddLabelsToSourceV1Input addLabelsToSourceV1Input = (AddLabelsToSourceV1Input) o; + return Objects.equals(this.labels, addLabelsToSourceV1Input.labels); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public int hashCode() { + return Objects.hash(labels); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddLabelsToSourceV1Input {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); } - AddLabelsToSourceV1Input addLabelsToSourceV1Input = (AddLabelsToSourceV1Input) o; - return Objects.equals(this.labels, addLabelsToSourceV1Input.labels); - } - - @Override - public int hashCode() { - return Objects.hash(labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddLabelsToSourceV1Input {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddLabelsToSourceV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddLabelsToSourceV1Input is not found in the empty JSON string", AddLabelsToSourceV1Input.openapiRequiredFields.toString())); + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("labels"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddLabelsToSourceV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddLabelsToSourceV1Input is not found" + + " in the empty JSON string", + AddLabelsToSourceV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddLabelsToSourceV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddLabelsToSourceV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddLabelsToSourceV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddLabelsToSourceV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - if (jsonArraylabels != null) { - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `labels` to be an array in the JSON string but got `%s`", jsonObj.get("labels").toString())); - } + if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + if (jsonArraylabels != null) { + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("labels").toString())); + } + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddLabelsToSourceV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddLabelsToSourceV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddLabelsToSourceV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddLabelsToSourceV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddLabelsToSourceV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddLabelsToSourceV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddLabelsToSourceV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddLabelsToSourceV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddLabelsToSourceV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddLabelsToSourceV1Input + * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceV1Input + */ + public static AddLabelsToSourceV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddLabelsToSourceV1Input.class); } - } - - /** - * Create an instance of AddLabelsToSourceV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddLabelsToSourceV1Input - * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceV1Input - */ - public static AddLabelsToSourceV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddLabelsToSourceV1Input.class); - } - - /** - * Convert an instance of AddLabelsToSourceV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddLabelsToSourceV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java index 71b92c0e..4f5a39ee 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,215 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.LabelV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Applies an existing label to an existing Source. - */ +/** Applies an existing label to an existing Source. */ @ApiModel(description = "Applies an existing label to an existing Source.") - public class AddLabelsToSourceV1Output { - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = new ArrayList<>(); + public static final String SERIALIZED_NAME_LABELS = "labels"; - public AddLabelsToSourceV1Output() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private List labels = new ArrayList<>(); - public AddLabelsToSourceV1Output labels(List labels) { - - this.labels = labels; - return this; - } + public AddLabelsToSourceV1Output() {} - public AddLabelsToSourceV1Output addLabelsItem(LabelV1 labelsItem) { - this.labels.add(labelsItem); - return this; - } + public AddLabelsToSourceV1Output labels(List labels) { - /** - * All labels applied to the Source. - * @return labels - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All labels applied to the Source.") + this.labels = labels; + return this; + } - public List getLabels() { - return labels; - } + public AddLabelsToSourceV1Output addLabelsItem(LabelV1 labelsItem) { + this.labels.add(labelsItem); + return this; + } + /** + * All labels applied to the Source. + * + * @return labels + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "All labels applied to the Source.") + public List getLabels() { + return labels; + } - public void setLabels(List labels) { - this.labels = labels; - } + public void setLabels(List labels) { + this.labels = labels; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddLabelsToSourceV1Output addLabelsToSourceV1Output = (AddLabelsToSourceV1Output) o; + return Objects.equals(this.labels, addLabelsToSourceV1Output.labels); + } + @Override + public int hashCode() { + return Objects.hash(labels); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddLabelsToSourceV1Output {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddLabelsToSourceV1Output addLabelsToSourceV1Output = (AddLabelsToSourceV1Output) o; - return Objects.equals(this.labels, addLabelsToSourceV1Output.labels); - } - - @Override - public int hashCode() { - return Objects.hash(labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddLabelsToSourceV1Output {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("labels"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("labels"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("labels"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddLabelsToSourceV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddLabelsToSourceV1Output is not found in the empty JSON string", AddLabelsToSourceV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddLabelsToSourceV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddLabelsToSourceV1Output is not found" + + " in the empty JSON string", + AddLabelsToSourceV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddLabelsToSourceV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddLabelsToSourceV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddLabelsToSourceV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddLabelsToSourceV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddLabelsToSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddLabelsToSourceV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("labels").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `labels` to be an array in the JSON string but got `%s`", jsonObj.get("labels").toString())); - } - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - } + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddLabelsToSourceV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddLabelsToSourceV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddLabelsToSourceV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddLabelsToSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddLabelsToSourceV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddLabelsToSourceV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddLabelsToSourceV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddLabelsToSourceV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddLabelsToSourceV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddLabelsToSourceV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddLabelsToSourceV1Output + * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceV1Output + */ + public static AddLabelsToSourceV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddLabelsToSourceV1Output.class); } - } - - /** - * Create an instance of AddLabelsToSourceV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddLabelsToSourceV1Output - * @throws IOException if the JSON string is invalid with respect to AddLabelsToSourceV1Output - */ - public static AddLabelsToSourceV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddLabelsToSourceV1Output.class); - } - - /** - * Convert an instance of AddLabelsToSourceV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddLabelsToSourceV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java index d6368aee..7db3a09b 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddPermissionsToUserV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddPermissionsToUser200Response - */ - +/** AddPermissionsToUser200Response */ public class AddPermissionsToUser200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddPermissionsToUserV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddPermissionsToUser200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddPermissionsToUserV1Output data; - public AddPermissionsToUser200Response data(AddPermissionsToUserV1Output data) { - - this.data = data; - return this; - } + public AddPermissionsToUser200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddPermissionsToUser200Response data(AddPermissionsToUserV1Output data) { - public AddPermissionsToUserV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddPermissionsToUserV1Output getData() { + return data; + } - public void setData(AddPermissionsToUserV1Output data) { - this.data = data; - } + public void setData(AddPermissionsToUserV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPermissionsToUser200Response addPermissionsToUser200Response = + (AddPermissionsToUser200Response) o; + return Objects.equals(this.data, addPermissionsToUser200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPermissionsToUser200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddPermissionsToUser200Response addPermissionsToUser200Response = (AddPermissionsToUser200Response) o; - return Objects.equals(this.data, addPermissionsToUser200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddPermissionsToUser200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUser200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddPermissionsToUser200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddPermissionsToUser200Response is not found in the empty JSON string", AddPermissionsToUser200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddPermissionsToUser200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPermissionsToUser200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddPermissionsToUser200Response is not" + + " found in the empty JSON string", + AddPermissionsToUser200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddPermissionsToUser200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPermissionsToUser200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPermissionsToUser200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddPermissionsToUser200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddPermissionsToUser200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddPermissionsToUser200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUser200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddPermissionsToUser200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddPermissionsToUser200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPermissionsToUser200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPermissionsToUser200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddPermissionsToUser200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPermissionsToUser200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPermissionsToUser200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddPermissionsToUser200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPermissionsToUser200Response + * @throws IOException if the JSON string is invalid with respect to + * AddPermissionsToUser200Response + */ + public static AddPermissionsToUser200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPermissionsToUser200Response.class); } - } - - /** - * Create an instance of AddPermissionsToUser200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddPermissionsToUser200Response - * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUser200Response - */ - public static AddPermissionsToUser200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddPermissionsToUser200Response.class); - } - - /** - * Convert an instance of AddPermissionsToUser200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddPermissionsToUser200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java index e2613c95..e28d02bf 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddPermissionsToUserGroupV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddPermissionsToUserGroup200Response - */ - +/** AddPermissionsToUserGroup200Response */ public class AddPermissionsToUserGroup200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddPermissionsToUserGroupV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddPermissionsToUserGroup200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddPermissionsToUserGroupV1Output data; - public AddPermissionsToUserGroup200Response data(AddPermissionsToUserGroupV1Output data) { - - this.data = data; - return this; - } + public AddPermissionsToUserGroup200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddPermissionsToUserGroup200Response data(AddPermissionsToUserGroupV1Output data) { - public AddPermissionsToUserGroupV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddPermissionsToUserGroupV1Output getData() { + return data; + } - public void setData(AddPermissionsToUserGroupV1Output data) { - this.data = data; - } + public void setData(AddPermissionsToUserGroupV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPermissionsToUserGroup200Response addPermissionsToUserGroup200Response = + (AddPermissionsToUserGroup200Response) o; + return Objects.equals(this.data, addPermissionsToUserGroup200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPermissionsToUserGroup200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddPermissionsToUserGroup200Response addPermissionsToUserGroup200Response = (AddPermissionsToUserGroup200Response) o; - return Objects.equals(this.data, addPermissionsToUserGroup200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddPermissionsToUserGroup200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserGroup200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddPermissionsToUserGroup200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddPermissionsToUserGroup200Response is not found in the empty JSON string", AddPermissionsToUserGroup200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddPermissionsToUserGroup200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPermissionsToUserGroup200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddPermissionsToUserGroup200Response" + + " is not found in the empty JSON string", + AddPermissionsToUserGroup200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddPermissionsToUserGroup200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPermissionsToUserGroup200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPermissionsToUserGroup200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddPermissionsToUserGroup200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddPermissionsToUserGroup200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddPermissionsToUserGroup200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUserGroup200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddPermissionsToUserGroup200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddPermissionsToUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPermissionsToUserGroup200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPermissionsToUserGroup200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddPermissionsToUserGroup200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AddPermissionsToUserGroup200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPermissionsToUserGroup200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddPermissionsToUserGroup200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPermissionsToUserGroup200Response + * @throws IOException if the JSON string is invalid with respect to + * AddPermissionsToUserGroup200Response + */ + public static AddPermissionsToUserGroup200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddPermissionsToUserGroup200Response.class); } - } - - /** - * Create an instance of AddPermissionsToUserGroup200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddPermissionsToUserGroup200Response - * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUserGroup200Response - */ - public static AddPermissionsToUserGroup200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddPermissionsToUserGroup200Response.class); - } - - /** - * Convert an instance of AddPermissionsToUserGroup200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddPermissionsToUserGroup200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index d560fd08..d8e4c71c 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,217 +10,215 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.PermissionInputV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Adds a list of permissions to a user group. - */ +/** Adds a list of permissions to a user group. */ @ApiModel(description = "Adds a list of permissions to a user group.") - public class AddPermissionsToUserGroupV1Input { - public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; - - public AddPermissionsToUserGroupV1Input() { - } - - public AddPermissionsToUserGroupV1Input permissions(List permissions) { - - this.permissions = permissions; - return this; - } - - public AddPermissionsToUserGroupV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } - this.permissions.add(permissionsItem); - return this; - } + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; + + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private List permissions = null; + + public AddPermissionsToUserGroupV1Input() {} - /** - * The permissions to add. - * @return permissions - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to add.") + public AddPermissionsToUserGroupV1Input permissions(List permissions) { - public List getPermissions() { - return permissions; - } + this.permissions = permissions; + return this; + } + public AddPermissionsToUserGroupV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } - public void setPermissions(List permissions) { - this.permissions = permissions; - } + /** + * The permissions to add. + * + * @return permissions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The permissions to add.") + public List getPermissions() { + return permissions; + } + public void setPermissions(List permissions) { + this.permissions = permissions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input = + (AddPermissionsToUserGroupV1Input) o; + return Objects.equals(this.permissions, addPermissionsToUserGroupV1Input.permissions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public int hashCode() { + return Objects.hash(permissions); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPermissionsToUserGroupV1Input {\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append("}"); + return sb.toString(); } - AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input = (AddPermissionsToUserGroupV1Input) o; - return Objects.equals(this.permissions, addPermissionsToUserGroupV1Input.permissions); - } - - @Override - public int hashCode() { - return Objects.hash(permissions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddPermissionsToUserGroupV1Input {\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserGroupV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddPermissionsToUserGroupV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddPermissionsToUserGroupV1Input is not found in the empty JSON string", AddPermissionsToUserGroupV1Input.openapiRequiredFields.toString())); + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddPermissionsToUserGroupV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPermissionsToUserGroupV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddPermissionsToUserGroupV1Input is" + + " not found in the empty JSON string", + AddPermissionsToUserGroupV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddPermissionsToUserGroupV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPermissionsToUserGroupV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPermissionsToUserGroupV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddPermissionsToUserGroupV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); - } + if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + if (jsonArraypermissions != null) { + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("permissions").toString())); + } + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddPermissionsToUserGroupV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddPermissionsToUserGroupV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUserGroupV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddPermissionsToUserGroupV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddPermissionsToUserGroupV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPermissionsToUserGroupV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPermissionsToUserGroupV1Input' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddPermissionsToUserGroupV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPermissionsToUserGroupV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPermissionsToUserGroupV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddPermissionsToUserGroupV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPermissionsToUserGroupV1Input + * @throws IOException if the JSON string is invalid with respect to + * AddPermissionsToUserGroupV1Input + */ + public static AddPermissionsToUserGroupV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPermissionsToUserGroupV1Input.class); } - } - - /** - * Create an instance of AddPermissionsToUserGroupV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddPermissionsToUserGroupV1Input - * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUserGroupV1Input - */ - public static AddPermissionsToUserGroupV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddPermissionsToUserGroupV1Input.class); - } - - /** - * Convert an instance of AddPermissionsToUserGroupV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddPermissionsToUserGroupV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java index 5076337b..f1e77ba0 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,224 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AccessPermissionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the group's permissions, including the added permissions. - */ +/** Returns the group's permissions, including the added permissions. */ @ApiModel(description = "Returns the group's permissions, including the added permissions.") - public class AddPermissionsToUserGroupV1Output { - public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = new ArrayList<>(); + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - public AddPermissionsToUserGroupV1Output() { - } + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private List permissions = new ArrayList<>(); - public AddPermissionsToUserGroupV1Output permissions(List permissions) { - - this.permissions = permissions; - return this; - } + public AddPermissionsToUserGroupV1Output() {} - public AddPermissionsToUserGroupV1Output addPermissionsItem(AccessPermissionV1 permissionsItem) { - this.permissions.add(permissionsItem); - return this; - } + public AddPermissionsToUserGroupV1Output permissions(List permissions) { - /** - * The updated set of permissions assigned to the user group. - * @return permissions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The updated set of permissions assigned to the user group.") + this.permissions = permissions; + return this; + } - public List getPermissions() { - return permissions; - } + public AddPermissionsToUserGroupV1Output addPermissionsItem( + AccessPermissionV1 permissionsItem) { + this.permissions.add(permissionsItem); + return this; + } + /** + * The updated set of permissions assigned to the user group. + * + * @return permissions + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The updated set of permissions assigned to the user group.") + public List getPermissions() { + return permissions; + } - public void setPermissions(List permissions) { - this.permissions = permissions; - } + public void setPermissions(List permissions) { + this.permissions = permissions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPermissionsToUserGroupV1Output addPermissionsToUserGroupV1Output = + (AddPermissionsToUserGroupV1Output) o; + return Objects.equals(this.permissions, addPermissionsToUserGroupV1Output.permissions); + } + @Override + public int hashCode() { + return Objects.hash(permissions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPermissionsToUserGroupV1Output {\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddPermissionsToUserGroupV1Output addPermissionsToUserGroupV1Output = (AddPermissionsToUserGroupV1Output) o; - return Objects.equals(this.permissions, addPermissionsToUserGroupV1Output.permissions); - } - - @Override - public int hashCode() { - return Objects.hash(permissions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddPermissionsToUserGroupV1Output {\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("permissions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserGroupV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddPermissionsToUserGroupV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddPermissionsToUserGroupV1Output is not found in the empty JSON string", AddPermissionsToUserGroupV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddPermissionsToUserGroupV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPermissionsToUserGroupV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddPermissionsToUserGroupV1Output is" + + " not found in the empty JSON string", + AddPermissionsToUserGroupV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddPermissionsToUserGroupV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPermissionsToUserGroupV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPermissionsToUserGroupV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddPermissionsToUserGroupV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddPermissionsToUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPermissionsToUserGroupV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("permissions").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); - } - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - } + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddPermissionsToUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddPermissionsToUserGroupV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUserGroupV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddPermissionsToUserGroupV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddPermissionsToUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPermissionsToUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPermissionsToUserGroupV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddPermissionsToUserGroupV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPermissionsToUserGroupV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPermissionsToUserGroupV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddPermissionsToUserGroupV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPermissionsToUserGroupV1Output + * @throws IOException if the JSON string is invalid with respect to + * AddPermissionsToUserGroupV1Output + */ + public static AddPermissionsToUserGroupV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPermissionsToUserGroupV1Output.class); } - } - - /** - * Create an instance of AddPermissionsToUserGroupV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddPermissionsToUserGroupV1Output - * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUserGroupV1Output - */ - public static AddPermissionsToUserGroupV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddPermissionsToUserGroupV1Output.class); - } - - /** - * Convert an instance of AddPermissionsToUserGroupV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddPermissionsToUserGroupV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index f83e6042..29e51270 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,217 +10,210 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.PermissionInputV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Adds a list of permissions to a user. - */ +/** Adds a list of permissions to a user. */ @ApiModel(description = "Adds a list of permissions to a user.") - public class AddPermissionsToUserV1Input { - public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; - - public AddPermissionsToUserV1Input() { - } - - public AddPermissionsToUserV1Input permissions(List permissions) { - - this.permissions = permissions; - return this; - } - - public AddPermissionsToUserV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } - this.permissions.add(permissionsItem); - return this; - } + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; + + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private List permissions = null; + + public AddPermissionsToUserV1Input() {} - /** - * The permissions to add. - * @return permissions - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to add.") + public AddPermissionsToUserV1Input permissions(List permissions) { - public List getPermissions() { - return permissions; - } + this.permissions = permissions; + return this; + } + public AddPermissionsToUserV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } - public void setPermissions(List permissions) { - this.permissions = permissions; - } + /** + * The permissions to add. + * + * @return permissions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The permissions to add.") + public List getPermissions() { + return permissions; + } + public void setPermissions(List permissions) { + this.permissions = permissions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPermissionsToUserV1Input addPermissionsToUserV1Input = (AddPermissionsToUserV1Input) o; + return Objects.equals(this.permissions, addPermissionsToUserV1Input.permissions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public int hashCode() { + return Objects.hash(permissions); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPermissionsToUserV1Input {\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append("}"); + return sb.toString(); } - AddPermissionsToUserV1Input addPermissionsToUserV1Input = (AddPermissionsToUserV1Input) o; - return Objects.equals(this.permissions, addPermissionsToUserV1Input.permissions); - } - - @Override - public int hashCode() { - return Objects.hash(permissions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddPermissionsToUserV1Input {\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddPermissionsToUserV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddPermissionsToUserV1Input is not found in the empty JSON string", AddPermissionsToUserV1Input.openapiRequiredFields.toString())); + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPermissionsToUserV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddPermissionsToUserV1Input is not" + + " found in the empty JSON string", + AddPermissionsToUserV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddPermissionsToUserV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPermissionsToUserV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPermissionsToUserV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddPermissionsToUserV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); - } + if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + if (jsonArraypermissions != null) { + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("permissions").toString())); + } + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddPermissionsToUserV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddPermissionsToUserV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUserV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddPermissionsToUserV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddPermissionsToUserV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPermissionsToUserV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPermissionsToUserV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUserV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPermissionsToUserV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPermissionsToUserV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddPermissionsToUserV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPermissionsToUserV1Input + * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUserV1Input + */ + public static AddPermissionsToUserV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPermissionsToUserV1Input.class); } - } - - /** - * Create an instance of AddPermissionsToUserV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddPermissionsToUserV1Input - * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUserV1Input - */ - public static AddPermissionsToUserV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddPermissionsToUserV1Input.class); - } - - /** - * Convert an instance of AddPermissionsToUserV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddPermissionsToUserV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java index 65b2ffe7..5beb00f4 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,219 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AccessPermissionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the user's permissions, including the added permissions. - */ +/** Returns the user's permissions, including the added permissions. */ @ApiModel(description = "Returns the user's permissions, including the added permissions.") - public class AddPermissionsToUserV1Output { - public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = new ArrayList<>(); + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - public AddPermissionsToUserV1Output() { - } + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private List permissions = new ArrayList<>(); - public AddPermissionsToUserV1Output permissions(List permissions) { - - this.permissions = permissions; - return this; - } + public AddPermissionsToUserV1Output() {} - public AddPermissionsToUserV1Output addPermissionsItem(AccessPermissionV1 permissionsItem) { - this.permissions.add(permissionsItem); - return this; - } + public AddPermissionsToUserV1Output permissions(List permissions) { - /** - * The new permissions. - * @return permissions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new permissions.") + this.permissions = permissions; + return this; + } - public List getPermissions() { - return permissions; - } + public AddPermissionsToUserV1Output addPermissionsItem(AccessPermissionV1 permissionsItem) { + this.permissions.add(permissionsItem); + return this; + } + /** + * The new permissions. + * + * @return permissions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new permissions.") + public List getPermissions() { + return permissions; + } - public void setPermissions(List permissions) { - this.permissions = permissions; - } + public void setPermissions(List permissions) { + this.permissions = permissions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPermissionsToUserV1Output addPermissionsToUserV1Output = + (AddPermissionsToUserV1Output) o; + return Objects.equals(this.permissions, addPermissionsToUserV1Output.permissions); + } + @Override + public int hashCode() { + return Objects.hash(permissions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPermissionsToUserV1Output {\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddPermissionsToUserV1Output addPermissionsToUserV1Output = (AddPermissionsToUserV1Output) o; - return Objects.equals(this.permissions, addPermissionsToUserV1Output.permissions); - } - - @Override - public int hashCode() { - return Objects.hash(permissions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddPermissionsToUserV1Output {\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("permissions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("permissions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddPermissionsToUserV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddPermissionsToUserV1Output is not found in the empty JSON string", AddPermissionsToUserV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddPermissionsToUserV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPermissionsToUserV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddPermissionsToUserV1Output is not" + + " found in the empty JSON string", + AddPermissionsToUserV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddPermissionsToUserV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPermissionsToUserV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPermissionsToUserV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddPermissionsToUserV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddPermissionsToUserV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPermissionsToUserV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("permissions").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); - } - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - } + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddPermissionsToUserV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddPermissionsToUserV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddPermissionsToUserV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddPermissionsToUserV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddPermissionsToUserV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPermissionsToUserV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPermissionsToUserV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddPermissionsToUserV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPermissionsToUserV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPermissionsToUserV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddPermissionsToUserV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPermissionsToUserV1Output + * @throws IOException if the JSON string is invalid with respect to + * AddPermissionsToUserV1Output + */ + public static AddPermissionsToUserV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPermissionsToUserV1Output.class); } - } - - /** - * Create an instance of AddPermissionsToUserV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddPermissionsToUserV1Output - * @throws IOException if the JSON string is invalid with respect to AddPermissionsToUserV1Output - */ - public static AddPermissionsToUserV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddPermissionsToUserV1Output.class); - } - - /** - * Convert an instance of AddPermissionsToUserV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddPermissionsToUserV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java index a4533edd..0374116b 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,191 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddSourceToTrackingPlanV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddSourceToTrackingPlan200Response - */ - +/** AddSourceToTrackingPlan200Response */ public class AddSourceToTrackingPlan200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddSourceToTrackingPlanV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddSourceToTrackingPlan200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddSourceToTrackingPlanV1Output data; - public AddSourceToTrackingPlan200Response data(AddSourceToTrackingPlanV1Output data) { - - this.data = data; - return this; - } + public AddSourceToTrackingPlan200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddSourceToTrackingPlan200Response data(AddSourceToTrackingPlanV1Output data) { - public AddSourceToTrackingPlanV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddSourceToTrackingPlanV1Output getData() { + return data; + } - public void setData(AddSourceToTrackingPlanV1Output data) { - this.data = data; - } + public void setData(AddSourceToTrackingPlanV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddSourceToTrackingPlan200Response addSourceToTrackingPlan200Response = + (AddSourceToTrackingPlan200Response) o; + return Objects.equals(this.data, addSourceToTrackingPlan200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddSourceToTrackingPlan200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddSourceToTrackingPlan200Response addSourceToTrackingPlan200Response = (AddSourceToTrackingPlan200Response) o; - return Objects.equals(this.data, addSourceToTrackingPlan200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddSourceToTrackingPlan200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddSourceToTrackingPlan200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddSourceToTrackingPlan200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddSourceToTrackingPlan200Response is not found in the empty JSON string", AddSourceToTrackingPlan200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddSourceToTrackingPlan200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddSourceToTrackingPlan200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddSourceToTrackingPlan200Response is" + + " not found in the empty JSON string", + AddSourceToTrackingPlan200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddSourceToTrackingPlan200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddSourceToTrackingPlan200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddSourceToTrackingPlan200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddSourceToTrackingPlan200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddSourceToTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddSourceToTrackingPlan200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddSourceToTrackingPlan200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddSourceToTrackingPlan200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddSourceToTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddSourceToTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddSourceToTrackingPlan200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddSourceToTrackingPlan200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddSourceToTrackingPlan200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddSourceToTrackingPlan200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddSourceToTrackingPlan200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddSourceToTrackingPlan200Response + * @throws IOException if the JSON string is invalid with respect to + * AddSourceToTrackingPlan200Response + */ + public static AddSourceToTrackingPlan200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddSourceToTrackingPlan200Response.class); } - } - - /** - * Create an instance of AddSourceToTrackingPlan200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddSourceToTrackingPlan200Response - * @throws IOException if the JSON string is invalid with respect to AddSourceToTrackingPlan200Response - */ - public static AddSourceToTrackingPlan200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddSourceToTrackingPlan200Response.class); - } - - /** - * Convert an instance of AddSourceToTrackingPlan200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddSourceToTrackingPlan200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index 35f4a137..ad0a5fc0 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,200 +10,203 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Connects a Source to a Tracking Plan. - */ +/** Connects a Source to a Tracking Plan. */ @ApiModel(description = "Connects a Source to a Tracking Plan.") - public class AddSourceToTrackingPlanV1Input { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public AddSourceToTrackingPlanV1Input() { - } + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public AddSourceToTrackingPlanV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + public AddSourceToTrackingPlanV1Input() {} - /** - * The id of the Source associated with the Tracking Plan. Config API note: analogous to `sourceName`. - * @return sourceId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Source associated with the Tracking Plan. Config API note: analogous to `sourceName`.") + public AddSourceToTrackingPlanV1Input sourceId(String sourceId) { - public String getSourceId() { - return sourceId; - } + this.sourceId = sourceId; + return this; + } + /** + * The id of the Source associated with the Tracking Plan. Config API note: analogous to + * `sourceName`. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The id of the Source associated with the Tracking Plan. Config API note:" + + " analogous to `sourceName`.") + public String getSourceId() { + return sourceId; + } - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input = + (AddSourceToTrackingPlanV1Input) o; + return Objects.equals(this.sourceId, addSourceToTrackingPlanV1Input.sourceId); + } + @Override + public int hashCode() { + return Objects.hash(sourceId); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddSourceToTrackingPlanV1Input {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input = (AddSourceToTrackingPlanV1Input) o; - return Objects.equals(this.sourceId, addSourceToTrackingPlanV1Input.sourceId); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddSourceToTrackingPlanV1Input {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddSourceToTrackingPlanV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddSourceToTrackingPlanV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddSourceToTrackingPlanV1Input is not found in the empty JSON string", AddSourceToTrackingPlanV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddSourceToTrackingPlanV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddSourceToTrackingPlanV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddSourceToTrackingPlanV1Input is not" + + " found in the empty JSON string", + AddSourceToTrackingPlanV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddSourceToTrackingPlanV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddSourceToTrackingPlanV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddSourceToTrackingPlanV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddSourceToTrackingPlanV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); } - } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) && !jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddSourceToTrackingPlanV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddSourceToTrackingPlanV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddSourceToTrackingPlanV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddSourceToTrackingPlanV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddSourceToTrackingPlanV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AddSourceToTrackingPlanV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddSourceToTrackingPlanV1Input - * @throws IOException if the JSON string is invalid with respect to AddSourceToTrackingPlanV1Input - */ - public static AddSourceToTrackingPlanV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddSourceToTrackingPlanV1Input.class); - } - - /** - * Convert an instance of AddSourceToTrackingPlanV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddSourceToTrackingPlanV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddSourceToTrackingPlanV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddSourceToTrackingPlanV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddSourceToTrackingPlanV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddSourceToTrackingPlanV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddSourceToTrackingPlanV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddSourceToTrackingPlanV1Input + * @throws IOException if the JSON string is invalid with respect to + * AddSourceToTrackingPlanV1Input + */ + public static AddSourceToTrackingPlanV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddSourceToTrackingPlanV1Input.class); + } + + /** + * Convert an instance of AddSourceToTrackingPlanV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java index 727caa7d..e339cfa8 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,254 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Connects a Source to a Tracking Plan. - */ +/** Connects a Source to a Tracking Plan. */ @ApiModel(description = "Connects a Source to a Tracking Plan.") - public class AddSourceToTrackingPlanV1Output { - /** - * The operation status. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The operation status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public AddSourceToTrackingPlanV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public AddSourceToTrackingPlanV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public AddSourceToTrackingPlanV1Output() {} - /** - * The operation status. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") + public AddSourceToTrackingPlanV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The operation status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The operation status.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddSourceToTrackingPlanV1Output addSourceToTrackingPlanV1Output = + (AddSourceToTrackingPlanV1Output) o; + return Objects.equals(this.status, addSourceToTrackingPlanV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddSourceToTrackingPlanV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddSourceToTrackingPlanV1Output addSourceToTrackingPlanV1Output = (AddSourceToTrackingPlanV1Output) o; - return Objects.equals(this.status, addSourceToTrackingPlanV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddSourceToTrackingPlanV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddSourceToTrackingPlanV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddSourceToTrackingPlanV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddSourceToTrackingPlanV1Output is not found in the empty JSON string", AddSourceToTrackingPlanV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddSourceToTrackingPlanV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddSourceToTrackingPlanV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddSourceToTrackingPlanV1Output is not" + + " found in the empty JSON string", + AddSourceToTrackingPlanV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddSourceToTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddSourceToTrackingPlanV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddSourceToTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddSourceToTrackingPlanV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddSourceToTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddSourceToTrackingPlanV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddSourceToTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddSourceToTrackingPlanV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddSourceToTrackingPlanV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddSourceToTrackingPlanV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddSourceToTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AddSourceToTrackingPlanV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddSourceToTrackingPlanV1Output - * @throws IOException if the JSON string is invalid with respect to AddSourceToTrackingPlanV1Output - */ - public static AddSourceToTrackingPlanV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddSourceToTrackingPlanV1Output.class); - } - - /** - * Convert an instance of AddSourceToTrackingPlanV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddSourceToTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddSourceToTrackingPlanV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddSourceToTrackingPlanV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddSourceToTrackingPlanV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddSourceToTrackingPlanV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddSourceToTrackingPlanV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddSourceToTrackingPlanV1Output + * @throws IOException if the JSON string is invalid with respect to + * AddSourceToTrackingPlanV1Output + */ + public static AddSourceToTrackingPlanV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddSourceToTrackingPlanV1Output.class); + } + + /** + * Convert an instance of AddSourceToTrackingPlanV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java index 4593501a..60b26d7d 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AddUsersToUserGroupV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * AddUsersToUserGroup200Response - */ - +/** AddUsersToUserGroup200Response */ public class AddUsersToUserGroup200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AddUsersToUserGroupV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public AddUsersToUserGroup200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private AddUsersToUserGroupV1Output data; - public AddUsersToUserGroup200Response data(AddUsersToUserGroupV1Output data) { - - this.data = data; - return this; - } + public AddUsersToUserGroup200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public AddUsersToUserGroup200Response data(AddUsersToUserGroupV1Output data) { - public AddUsersToUserGroupV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public AddUsersToUserGroupV1Output getData() { + return data; + } - public void setData(AddUsersToUserGroupV1Output data) { - this.data = data; - } + public void setData(AddUsersToUserGroupV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddUsersToUserGroup200Response addUsersToUserGroup200Response = + (AddUsersToUserGroup200Response) o; + return Objects.equals(this.data, addUsersToUserGroup200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddUsersToUserGroup200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddUsersToUserGroup200Response addUsersToUserGroup200Response = (AddUsersToUserGroup200Response) o; - return Objects.equals(this.data, addUsersToUserGroup200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddUsersToUserGroup200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroup200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddUsersToUserGroup200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddUsersToUserGroup200Response is not found in the empty JSON string", AddUsersToUserGroup200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AddUsersToUserGroup200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddUsersToUserGroup200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddUsersToUserGroup200Response is not" + + " found in the empty JSON string", + AddUsersToUserGroup200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddUsersToUserGroup200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddUsersToUserGroup200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddUsersToUserGroup200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddUsersToUserGroup200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddUsersToUserGroup200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddUsersToUserGroup200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddUsersToUserGroup200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddUsersToUserGroup200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddUsersToUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddUsersToUserGroup200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddUsersToUserGroup200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddUsersToUserGroup200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddUsersToUserGroup200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddUsersToUserGroup200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddUsersToUserGroup200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddUsersToUserGroup200Response + * @throws IOException if the JSON string is invalid with respect to + * AddUsersToUserGroup200Response + */ + public static AddUsersToUserGroup200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddUsersToUserGroup200Response.class); } - } - - /** - * Create an instance of AddUsersToUserGroup200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddUsersToUserGroup200Response - * @throws IOException if the JSON string is invalid with respect to AddUsersToUserGroup200Response - */ - public static AddUsersToUserGroup200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddUsersToUserGroup200Response.class); - } - - /** - * Convert an instance of AddUsersToUserGroup200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddUsersToUserGroup200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index 271fef24..183ff889 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,211 +10,204 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Adds a list of users and invites to a user group. - */ +/** Adds a list of users and invites to a user group. */ @ApiModel(description = "Adds a list of users and invites to a user group.") - public class AddUsersToUserGroupV1Input { - public static final String SERIALIZED_NAME_EMAILS = "emails"; - @SerializedName(SERIALIZED_NAME_EMAILS) - private List emails = null; - - public AddUsersToUserGroupV1Input() { - } - - public AddUsersToUserGroupV1Input emails(List emails) { - - this.emails = emails; - return this; - } - - public AddUsersToUserGroupV1Input addEmailsItem(String emailsItem) { - if (this.emails == null) { - this.emails = new ArrayList<>(); - } - this.emails.add(emailsItem); - return this; - } + public static final String SERIALIZED_NAME_EMAILS = "emails"; + + @SerializedName(SERIALIZED_NAME_EMAILS) + private List emails = null; - /** - * The email addresses of the users and invites to add. - * @return emails - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses of the users and invites to add.") + public AddUsersToUserGroupV1Input() {} + + public AddUsersToUserGroupV1Input emails(List emails) { + + this.emails = emails; + return this; + } - public List getEmails() { - return emails; - } + public AddUsersToUserGroupV1Input addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + /** + * The email addresses of the users and invites to add. + * + * @return emails + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The email addresses of the users and invites to add.") + public List getEmails() { + return emails; + } - public void setEmails(List emails) { - this.emails = emails; - } + public void setEmails(List emails) { + this.emails = emails; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddUsersToUserGroupV1Input addUsersToUserGroupV1Input = (AddUsersToUserGroupV1Input) o; + return Objects.equals(this.emails, addUsersToUserGroupV1Input.emails); + } + @Override + public int hashCode() { + return Objects.hash(emails); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddUsersToUserGroupV1Input {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddUsersToUserGroupV1Input addUsersToUserGroupV1Input = (AddUsersToUserGroupV1Input) o; - return Objects.equals(this.emails, addUsersToUserGroupV1Input.emails); - } - - @Override - public int hashCode() { - return Objects.hash(emails); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddUsersToUserGroupV1Input {\n"); - sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emails"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emails"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroupV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddUsersToUserGroupV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddUsersToUserGroupV1Input is not found in the empty JSON string", AddUsersToUserGroupV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroupV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddUsersToUserGroupV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddUsersToUserGroupV1Input is not" + + " found in the empty JSON string", + AddUsersToUserGroupV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddUsersToUserGroupV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddUsersToUserGroupV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddUsersToUserGroupV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddUsersToUserGroupV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `emails` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("emails").toString())); } - } - // ensure the optional json data is an array if present - if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddUsersToUserGroupV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddUsersToUserGroupV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddUsersToUserGroupV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddUsersToUserGroupV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddUsersToUserGroupV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AddUsersToUserGroupV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddUsersToUserGroupV1Input - * @throws IOException if the JSON string is invalid with respect to AddUsersToUserGroupV1Input - */ - public static AddUsersToUserGroupV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddUsersToUserGroupV1Input.class); - } - - /** - * Convert an instance of AddUsersToUserGroupV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddUsersToUserGroupV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddUsersToUserGroupV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddUsersToUserGroupV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddUsersToUserGroupV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddUsersToUserGroupV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddUsersToUserGroupV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddUsersToUserGroupV1Input + * @throws IOException if the JSON string is invalid with respect to AddUsersToUserGroupV1Input + */ + public static AddUsersToUserGroupV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddUsersToUserGroupV1Input.class); + } + + /** + * Convert an instance of AddUsersToUserGroupV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java index 10a1cf92..b3361af9 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.UserGroup1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the updated user group. - */ +/** Returns the updated user group. */ @ApiModel(description = "Returns the updated user group.") - public class AddUsersToUserGroupV1Output { - public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; - @SerializedName(SERIALIZED_NAME_USER_GROUP) - private UserGroup1 userGroup; + public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; - public AddUsersToUserGroupV1Output() { - } + @SerializedName(SERIALIZED_NAME_USER_GROUP) + private UserGroup1 userGroup; - public AddUsersToUserGroupV1Output userGroup(UserGroup1 userGroup) { - - this.userGroup = userGroup; - return this; - } + public AddUsersToUserGroupV1Output() {} - /** - * Get userGroup - * @return userGroup - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public AddUsersToUserGroupV1Output userGroup(UserGroup1 userGroup) { - public UserGroup1 getUserGroup() { - return userGroup; - } + this.userGroup = userGroup; + return this; + } + /** + * Get userGroup + * + * @return userGroup + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public UserGroup1 getUserGroup() { + return userGroup; + } - public void setUserGroup(UserGroup1 userGroup) { - this.userGroup = userGroup; - } + public void setUserGroup(UserGroup1 userGroup) { + this.userGroup = userGroup; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddUsersToUserGroupV1Output addUsersToUserGroupV1Output = (AddUsersToUserGroupV1Output) o; + return Objects.equals(this.userGroup, addUsersToUserGroupV1Output.userGroup); + } + @Override + public int hashCode() { + return Objects.hash(userGroup); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddUsersToUserGroupV1Output {\n"); + sb.append(" userGroup: ").append(toIndentedString(userGroup)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AddUsersToUserGroupV1Output addUsersToUserGroupV1Output = (AddUsersToUserGroupV1Output) o; - return Objects.equals(this.userGroup, addUsersToUserGroupV1Output.userGroup); - } - - @Override - public int hashCode() { - return Objects.hash(userGroup); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AddUsersToUserGroupV1Output {\n"); - sb.append(" userGroup: ").append(toIndentedString(userGroup)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userGroup"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userGroup"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userGroup"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userGroup"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroupV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AddUsersToUserGroupV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AddUsersToUserGroupV1Output is not found in the empty JSON string", AddUsersToUserGroupV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroupV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddUsersToUserGroupV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddUsersToUserGroupV1Output is not" + + " found in the empty JSON string", + AddUsersToUserGroupV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AddUsersToUserGroupV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddUsersToUserGroupV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddUsersToUserGroupV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddUsersToUserGroupV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AddUsersToUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddUsersToUserGroupV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AddUsersToUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AddUsersToUserGroupV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AddUsersToUserGroupV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AddUsersToUserGroupV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AddUsersToUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddUsersToUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddUsersToUserGroupV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AddUsersToUserGroupV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddUsersToUserGroupV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddUsersToUserGroupV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddUsersToUserGroupV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddUsersToUserGroupV1Output + * @throws IOException if the JSON string is invalid with respect to AddUsersToUserGroupV1Output + */ + public static AddUsersToUserGroupV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddUsersToUserGroupV1Output.class); } - } - - /** - * Create an instance of AddUsersToUserGroupV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AddUsersToUserGroupV1Output - * @throws IOException if the JSON string is invalid with respect to AddUsersToUserGroupV1Output - */ - public static AddUsersToUserGroupV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AddUsersToUserGroupV1Output.class); - } - - /** - * Convert an instance of AddUsersToUserGroupV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of AddUsersToUserGroupV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java index c71a11a4..f8251644 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,263 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.WarehouseAdvancedSyncV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Defines the advanced sync schedule for a Warehouse. - */ +/** Defines the advanced sync schedule for a Warehouse. */ @ApiModel(description = "Defines the advanced sync schedule for a Warehouse.") - public class AdvancedWarehouseSyncScheduleV1Input { - public static final String SERIALIZED_NAME_TIMES = "times"; - @SerializedName(SERIALIZED_NAME_TIMES) - private List times = new ArrayList<>(); + public static final String SERIALIZED_NAME_TIMES = "times"; - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - @SerializedName(SERIALIZED_NAME_TIMEZONE) - private String timezone; + @SerializedName(SERIALIZED_NAME_TIMES) + private List times = new ArrayList<>(); - public AdvancedWarehouseSyncScheduleV1Input() { - } + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - public AdvancedWarehouseSyncScheduleV1Input times(List times) { - - this.times = times; - return this; - } + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; - public AdvancedWarehouseSyncScheduleV1Input addTimesItem(WarehouseAdvancedSyncV1 timesItem) { - this.times.add(timesItem); - return this; - } + public AdvancedWarehouseSyncScheduleV1Input() {} - /** - * A list that contains the times when syncs should occur. - * @return times - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list that contains the times when syncs should occur.") - - public List getTimes() { - return times; - } + public AdvancedWarehouseSyncScheduleV1Input times(List times) { + this.times = times; + return this; + } - public void setTimes(List times) { - this.times = times; - } + public AdvancedWarehouseSyncScheduleV1Input addTimesItem(WarehouseAdvancedSyncV1 timesItem) { + this.times.add(timesItem); + return this; + } + /** + * A list that contains the times when syncs should occur. + * + * @return times + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list that contains the times when syncs should occur.") + public List getTimes() { + return times; + } - public AdvancedWarehouseSyncScheduleV1Input timezone(String timezone) { - - this.timezone = timezone; - return this; - } + public void setTimes(List times) { + this.times = times; + } - /** - * A TZ-database timezone for this sync schedule. - * @return timezone - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A TZ-database timezone for this sync schedule.") + public AdvancedWarehouseSyncScheduleV1Input timezone(String timezone) { - public String getTimezone() { - return timezone; - } + this.timezone = timezone; + return this; + } + /** + * A TZ-database timezone for this sync schedule. + * + * @return timezone + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A TZ-database timezone for this sync schedule.") + public String getTimezone() { + return timezone; + } - public void setTimezone(String timezone) { - this.timezone = timezone; - } + public void setTimezone(String timezone) { + this.timezone = timezone; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvancedWarehouseSyncScheduleV1Input advancedWarehouseSyncScheduleV1Input = + (AdvancedWarehouseSyncScheduleV1Input) o; + return Objects.equals(this.times, advancedWarehouseSyncScheduleV1Input.times) + && Objects.equals(this.timezone, advancedWarehouseSyncScheduleV1Input.timezone); + } + @Override + public int hashCode() { + return Objects.hash(times, timezone); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvancedWarehouseSyncScheduleV1Input {\n"); + sb.append(" times: ").append(toIndentedString(times)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AdvancedWarehouseSyncScheduleV1Input advancedWarehouseSyncScheduleV1Input = (AdvancedWarehouseSyncScheduleV1Input) o; - return Objects.equals(this.times, advancedWarehouseSyncScheduleV1Input.times) && - Objects.equals(this.timezone, advancedWarehouseSyncScheduleV1Input.timezone); - } - - @Override - public int hashCode() { - return Objects.hash(times, timezone); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdvancedWarehouseSyncScheduleV1Input {\n"); - sb.append(" times: ").append(toIndentedString(times)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("times"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("times"); + openapiRequiredFields.add("timezone"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("times"); - openapiFields.add("timezone"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("times"); - openapiRequiredFields.add("timezone"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AdvancedWarehouseSyncScheduleV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AdvancedWarehouseSyncScheduleV1Input is not found in the empty JSON string", AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AdvancedWarehouseSyncScheduleV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AdvancedWarehouseSyncScheduleV1Input" + + " is not found in the empty JSON string", + AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AdvancedWarehouseSyncScheduleV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdvancedWarehouseSyncScheduleV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdvancedWarehouseSyncScheduleV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AdvancedWarehouseSyncScheduleV1Input` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("times").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `times` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("times").toString())); + } + + JsonArray jsonArraytimes = jsonObj.getAsJsonArray("times"); + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("times").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `times` to be an array in the JSON string but got `%s`", jsonObj.get("times").toString())); - } - - JsonArray jsonArraytimes = jsonObj.getAsJsonArray("times"); - if (!jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AdvancedWarehouseSyncScheduleV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AdvancedWarehouseSyncScheduleV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AdvancedWarehouseSyncScheduleV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AdvancedWarehouseSyncScheduleV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AdvancedWarehouseSyncScheduleV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AdvancedWarehouseSyncScheduleV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdvancedWarehouseSyncScheduleV1Input - * @throws IOException if the JSON string is invalid with respect to AdvancedWarehouseSyncScheduleV1Input - */ - public static AdvancedWarehouseSyncScheduleV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AdvancedWarehouseSyncScheduleV1Input.class); - } - - /** - * Convert an instance of AdvancedWarehouseSyncScheduleV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvancedWarehouseSyncScheduleV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvancedWarehouseSyncScheduleV1Input' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AdvancedWarehouseSyncScheduleV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AdvancedWarehouseSyncScheduleV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvancedWarehouseSyncScheduleV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AdvancedWarehouseSyncScheduleV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvancedWarehouseSyncScheduleV1Input + * @throws IOException if the JSON string is invalid with respect to + * AdvancedWarehouseSyncScheduleV1Input + */ + public static AdvancedWarehouseSyncScheduleV1Input fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AdvancedWarehouseSyncScheduleV1Input.class); + } + + /** + * Convert an instance of AdvancedWarehouseSyncScheduleV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java index de73ab3f..4a7cc1ea 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,250 +10,256 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.WarehouseAdvancedSyncV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Defines the advanced sync schedule for a Warehouse. - */ +/** Defines the advanced sync schedule for a Warehouse. */ @ApiModel(description = "Defines the advanced sync schedule for a Warehouse.") - public class AdvancedWarehouseSyncScheduleV1Output { - public static final String SERIALIZED_NAME_TIMES = "times"; - @SerializedName(SERIALIZED_NAME_TIMES) - private List times = null; - - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - @SerializedName(SERIALIZED_NAME_TIMEZONE) - private String timezone; - - public AdvancedWarehouseSyncScheduleV1Output() { - } - - public AdvancedWarehouseSyncScheduleV1Output times(List times) { - - this.times = times; - return this; - } - - public AdvancedWarehouseSyncScheduleV1Output addTimesItem(WarehouseAdvancedSyncV1 timesItem) { - if (this.times == null) { - this.times = new ArrayList<>(); - } - this.times.add(timesItem); - return this; - } + public static final String SERIALIZED_NAME_TIMES = "times"; - /** - * A list that contains the times when syncs should occur. - * @return times - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list that contains the times when syncs should occur.") + @SerializedName(SERIALIZED_NAME_TIMES) + private List times = null; - public List getTimes() { - return times; - } + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; - public void setTimes(List times) { - this.times = times; - } + public AdvancedWarehouseSyncScheduleV1Output() {} + public AdvancedWarehouseSyncScheduleV1Output times(List times) { - public AdvancedWarehouseSyncScheduleV1Output timezone(String timezone) { - - this.timezone = timezone; - return this; - } - - /** - * A TZ-database timezone for this sync schedule. - * @return timezone - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A TZ-database timezone for this sync schedule.") + this.times = times; + return this; + } - public String getTimezone() { - return timezone; - } + public AdvancedWarehouseSyncScheduleV1Output addTimesItem(WarehouseAdvancedSyncV1 timesItem) { + if (this.times == null) { + this.times = new ArrayList<>(); + } + this.times.add(timesItem); + return this; + } + /** + * A list that contains the times when syncs should occur. + * + * @return times + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list that contains the times when syncs should occur.") + public List getTimes() { + return times; + } - public void setTimezone(String timezone) { - this.timezone = timezone; - } + public void setTimes(List times) { + this.times = times; + } + public AdvancedWarehouseSyncScheduleV1Output timezone(String timezone) { + this.timezone = timezone; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * A TZ-database timezone for this sync schedule. + * + * @return timezone + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A TZ-database timezone for this sync schedule.") + public String getTimezone() { + return timezone; } - if (o == null || getClass() != o.getClass()) { - return false; + + public void setTimezone(String timezone) { + this.timezone = timezone; } - AdvancedWarehouseSyncScheduleV1Output advancedWarehouseSyncScheduleV1Output = (AdvancedWarehouseSyncScheduleV1Output) o; - return Objects.equals(this.times, advancedWarehouseSyncScheduleV1Output.times) && - Objects.equals(this.timezone, advancedWarehouseSyncScheduleV1Output.timezone); - } - @Override - public int hashCode() { - return Objects.hash(times, timezone); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvancedWarehouseSyncScheduleV1Output advancedWarehouseSyncScheduleV1Output = + (AdvancedWarehouseSyncScheduleV1Output) o; + return Objects.equals(this.times, advancedWarehouseSyncScheduleV1Output.times) + && Objects.equals(this.timezone, advancedWarehouseSyncScheduleV1Output.timezone); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdvancedWarehouseSyncScheduleV1Output {\n"); - sb.append(" times: ").append(toIndentedString(times)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append("}"); - return sb.toString(); - } + @Override + public int hashCode() { + return Objects.hash(times, timezone); + } - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdvancedWarehouseSyncScheduleV1Output {\n"); + sb.append(" times: ").append(toIndentedString(times)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("times"); - openapiFields.add("timezone"); + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("times"); + openapiFields.add("timezone"); - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AdvancedWarehouseSyncScheduleV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AdvancedWarehouseSyncScheduleV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AdvancedWarehouseSyncScheduleV1Output is not found in the empty JSON string", AdvancedWarehouseSyncScheduleV1Output.openapiRequiredFields.toString())); + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * AdvancedWarehouseSyncScheduleV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AdvancedWarehouseSyncScheduleV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AdvancedWarehouseSyncScheduleV1Output" + + " is not found in the empty JSON string", + AdvancedWarehouseSyncScheduleV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AdvancedWarehouseSyncScheduleV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdvancedWarehouseSyncScheduleV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdvancedWarehouseSyncScheduleV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AdvancedWarehouseSyncScheduleV1Output` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - if (jsonObj.get("times") != null && !jsonObj.get("times").isJsonNull()) { - JsonArray jsonArraytimes = jsonObj.getAsJsonArray("times"); - if (jsonArraytimes != null) { - // ensure the json data is an array - if (!jsonObj.get("times").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `times` to be an array in the JSON string but got `%s`", jsonObj.get("times").toString())); - } + if (jsonObj.get("times") != null && !jsonObj.get("times").isJsonNull()) { + JsonArray jsonArraytimes = jsonObj.getAsJsonArray("times"); + if (jsonArraytimes != null) { + // ensure the json data is an array + if (!jsonObj.get("times").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `times` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("times").toString())); + } + } } - } - if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) && !jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timezone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timezone").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AdvancedWarehouseSyncScheduleV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AdvancedWarehouseSyncScheduleV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AdvancedWarehouseSyncScheduleV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AdvancedWarehouseSyncScheduleV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AdvancedWarehouseSyncScheduleV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } + if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) + && !jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdvancedWarehouseSyncScheduleV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdvancedWarehouseSyncScheduleV1Output' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AdvancedWarehouseSyncScheduleV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AdvancedWarehouseSyncScheduleV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdvancedWarehouseSyncScheduleV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } } - } - /** - * Create an instance of AdvancedWarehouseSyncScheduleV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of AdvancedWarehouseSyncScheduleV1Output - * @throws IOException if the JSON string is invalid with respect to AdvancedWarehouseSyncScheduleV1Output - */ - public static AdvancedWarehouseSyncScheduleV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AdvancedWarehouseSyncScheduleV1Output.class); - } + /** + * Create an instance of AdvancedWarehouseSyncScheduleV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdvancedWarehouseSyncScheduleV1Output + * @throws IOException if the JSON string is invalid with respect to + * AdvancedWarehouseSyncScheduleV1Output + */ + public static AdvancedWarehouseSyncScheduleV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AdvancedWarehouseSyncScheduleV1Output.class); + } - /** - * Convert an instance of AdvancedWarehouseSyncScheduleV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } + /** + * Convert an instance of AdvancedWarehouseSyncScheduleV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } - diff --git a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java index df59d42c..6b214ea3 100644 --- a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java +++ b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,275 +10,277 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Defines a label that you may apply to resources within a Workspace. - */ +/** Defines a label that you may apply to resources within a Workspace. */ @ApiModel(description = "Defines a label that you may apply to resources within a Workspace.") - public class AllowedLabelBeta { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; + public static final String SERIALIZED_NAME_KEY = "key"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; - public AllowedLabelBeta() { - } + public static final String SERIALIZED_NAME_VALUE = "value"; - public AllowedLabelBeta key(String key) { - - this.key = key; - return this; - } + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; - /** - * The key identifier for this label. - * @return key - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The key identifier for this label.") + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public String getKey() { - return key; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public AllowedLabelBeta() {} - public void setKey(String key) { - this.key = key; - } + public AllowedLabelBeta key(String key) { + this.key = key; + return this; + } - public AllowedLabelBeta value(String value) { - - this.value = value; - return this; - } - - /** - * The value of this label. - * @return value - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value of this label.") + /** + * The key identifier for this label. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The key identifier for this label.") + public String getKey() { + return key; + } - public String getValue() { - return value; - } + public void setKey(String key) { + this.key = key; + } + public AllowedLabelBeta value(String value) { - public void setValue(String value) { - this.value = value; - } + this.value = value; + return this; + } + /** + * The value of this label. + * + * @return value + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The value of this label.") + public String getValue() { + return value; + } - public AllowedLabelBeta description(String description) { - - this.description = description; - return this; - } + public void setValue(String value) { + this.value = value; + } - /** - * A description of what this label represents. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description of what this label represents.") + public AllowedLabelBeta description(String description) { - public String getDescription() { - return description; - } + this.description = description; + return this; + } + /** + * A description of what this label represents. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description of what this label represents.") + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllowedLabelBeta allowedLabelBeta = (AllowedLabelBeta) o; + return Objects.equals(this.key, allowedLabelBeta.key) + && Objects.equals(this.value, allowedLabelBeta.value) + && Objects.equals(this.description, allowedLabelBeta.description); + } + @Override + public int hashCode() { + return Objects.hash(key, value, description); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllowedLabelBeta {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - AllowedLabelBeta allowedLabelBeta = (AllowedLabelBeta) o; - return Objects.equals(this.key, allowedLabelBeta.key) && - Objects.equals(this.value, allowedLabelBeta.value) && - Objects.equals(this.description, allowedLabelBeta.description); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AllowedLabelBeta {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("value"); - openapiFields.add("description"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AllowedLabelBeta - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AllowedLabelBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AllowedLabelBeta is not found in the empty JSON string", AllowedLabelBeta.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AllowedLabelBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AllowedLabelBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AllowedLabelBeta is not found in the" + + " empty JSON string", + AllowedLabelBeta.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AllowedLabelBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllowedLabelBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AllowedLabelBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AllowedLabelBeta` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AllowedLabelBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AllowedLabelBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `value` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("value").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AllowedLabelBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AllowedLabelBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AllowedLabelBeta.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AllowedLabelBeta value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AllowedLabelBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AllowedLabelBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of AllowedLabelBeta - * @throws IOException if the JSON string is invalid with respect to AllowedLabelBeta - */ - public static AllowedLabelBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AllowedLabelBeta.class); - } - - /** - * Convert an instance of AllowedLabelBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllowedLabelBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllowedLabelBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AllowedLabelBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AllowedLabelBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AllowedLabelBeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AllowedLabelBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllowedLabelBeta + * @throws IOException if the JSON string is invalid with respect to AllowedLabelBeta + */ + public static AllowedLabelBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllowedLabelBeta.class); + } + + /** + * Convert an instance of AllowedLabelBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AuditEventV1.java b/src/main/java/com/segment/publicapi/models/AuditEventV1.java index 16edb041..5eb4ba7b 100644 --- a/src/main/java/com/segment/publicapi/models/AuditEventV1.java +++ b/src/main/java/com/segment/publicapi/models/AuditEventV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,412 +10,426 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents an Audit Trail event. - */ +/** Represents an Audit Trail event. */ @ApiModel(description = "Represents an Audit Trail event.") - public class AuditEventV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; - public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; - @SerializedName(SERIALIZED_NAME_TIMESTAMP) - private String timestamp; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_ACTOR = "actor"; - @SerializedName(SERIALIZED_NAME_ACTOR) - private String actor; - - public static final String SERIALIZED_NAME_RESOURCE_ID = "resourceId"; - @SerializedName(SERIALIZED_NAME_RESOURCE_ID) - private String resourceId; + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private String resourceType; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; - public static final String SERIALIZED_NAME_RESOURCE_NAME = "resourceName"; - @SerializedName(SERIALIZED_NAME_RESOURCE_NAME) - private String resourceName; + public static final String SERIALIZED_NAME_TYPE = "type"; - public AuditEventV1() { - } + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; - public AuditEventV1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_ACTOR = "actor"; - /** - * Unique identifier for this audit trail event. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Unique identifier for this audit trail event.") + @SerializedName(SERIALIZED_NAME_ACTOR) + private String actor; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_RESOURCE_ID = "resourceId"; + @SerializedName(SERIALIZED_NAME_RESOURCE_ID) + private String resourceId; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private String resourceType; - public AuditEventV1 timestamp(String timestamp) { - - this.timestamp = timestamp; - return this; - } + public static final String SERIALIZED_NAME_RESOURCE_NAME = "resourceName"; - /** - * The timestamp of this event in ISO-8601 format. - * @return timestamp - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this event in ISO-8601 format.") + @SerializedName(SERIALIZED_NAME_RESOURCE_NAME) + private String resourceName; - public String getTimestamp() { - return timestamp; - } + public AuditEventV1() {} + public AuditEventV1 id(String id) { - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } + this.id = id; + return this; + } + /** + * Unique identifier for this audit trail event. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Unique identifier for this audit trail event.") + public String getId() { + return id; + } - public AuditEventV1 type(String type) { - - this.type = type; - return this; - } + public void setId(String id) { + this.id = id; + } - /** - * The type of this event. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this event.") + public AuditEventV1 timestamp(String timestamp) { - public String getType() { - return type; - } + this.timestamp = timestamp; + return this; + } + /** + * The timestamp of this event in ISO-8601 format. + * + * @return timestamp + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this event in ISO-8601 format.") + public String getTimestamp() { + return timestamp; + } - public void setType(String type) { - this.type = type; - } + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + public AuditEventV1 type(String type) { - public AuditEventV1 actor(String actor) { - - this.actor = actor; - return this; - } + this.type = type; + return this; + } - /** - * The user or API token that triggered this event. - * @return actor - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The user or API token that triggered this event.") + /** + * The type of this event. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The type of this event.") + public String getType() { + return type; + } - public String getActor() { - return actor; - } + public void setType(String type) { + this.type = type; + } + public AuditEventV1 actor(String actor) { - public void setActor(String actor) { - this.actor = actor; - } + this.actor = actor; + return this; + } + /** + * The user or API token that triggered this event. + * + * @return actor + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The user or API token that triggered this event.") + public String getActor() { + return actor; + } - public AuditEventV1 resourceId(String resourceId) { - - this.resourceId = resourceId; - return this; - } + public void setActor(String actor) { + this.actor = actor; + } - /** - * The identifier of the resource affected by this event. - * @return resourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The identifier of the resource affected by this event.") + public AuditEventV1 resourceId(String resourceId) { - public String getResourceId() { - return resourceId; - } + this.resourceId = resourceId; + return this; + } + /** + * The identifier of the resource affected by this event. + * + * @return resourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The identifier of the resource affected by this event.") + public String getResourceId() { + return resourceId; + } - public void setResourceId(String resourceId) { - this.resourceId = resourceId; - } + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + public AuditEventV1 resourceType(String resourceType) { - public AuditEventV1 resourceType(String resourceType) { - - this.resourceType = resourceType; - return this; - } + this.resourceType = resourceType; + return this; + } - /** - * The kind of resource affected by this event. - * @return resourceType - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The kind of resource affected by this event.") + /** + * The kind of resource affected by this event. + * + * @return resourceType + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The kind of resource affected by this event.") + public String getResourceType() { + return resourceType; + } - public String getResourceType() { - return resourceType; - } + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + public AuditEventV1 resourceName(String resourceName) { - public void setResourceType(String resourceType) { - this.resourceType = resourceType; - } + this.resourceName = resourceName; + return this; + } + /** + * The name of the resource affected by this event. + * + * @return resourceName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the resource affected by this event.") + public String getResourceName() { + return resourceName; + } - public AuditEventV1 resourceName(String resourceName) { - - this.resourceName = resourceName; - return this; - } + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } - /** - * The name of the resource affected by this event. - * @return resourceName - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the resource affected by this event.") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuditEventV1 auditEventV1 = (AuditEventV1) o; + return Objects.equals(this.id, auditEventV1.id) + && Objects.equals(this.timestamp, auditEventV1.timestamp) + && Objects.equals(this.type, auditEventV1.type) + && Objects.equals(this.actor, auditEventV1.actor) + && Objects.equals(this.resourceId, auditEventV1.resourceId) + && Objects.equals(this.resourceType, auditEventV1.resourceType) + && Objects.equals(this.resourceName, auditEventV1.resourceName); + } - public String getResourceName() { - return resourceName; - } + @Override + public int hashCode() { + return Objects.hash(id, timestamp, type, actor, resourceId, resourceType, resourceName); + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuditEventV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" actor: ").append(toIndentedString(actor)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" resourceName: ").append(toIndentedString(resourceName)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("timestamp"); + openapiFields.add("type"); + openapiFields.add("actor"); + openapiFields.add("resourceId"); + openapiFields.add("resourceType"); + openapiFields.add("resourceName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("timestamp"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("actor"); + openapiRequiredFields.add("resourceId"); + openapiRequiredFields.add("resourceType"); + openapiRequiredFields.add("resourceName"); + } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AuditEventV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AuditEventV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AuditEventV1 is not found in the empty" + + " JSON string", + AuditEventV1.openapiRequiredFields.toString())); + } + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuditEventV1 auditEventV1 = (AuditEventV1) o; - return Objects.equals(this.id, auditEventV1.id) && - Objects.equals(this.timestamp, auditEventV1.timestamp) && - Objects.equals(this.type, auditEventV1.type) && - Objects.equals(this.actor, auditEventV1.actor) && - Objects.equals(this.resourceId, auditEventV1.resourceId) && - Objects.equals(this.resourceType, auditEventV1.resourceType) && - Objects.equals(this.resourceName, auditEventV1.resourceName); - } - - @Override - public int hashCode() { - return Objects.hash(id, timestamp, type, actor, resourceId, resourceType, resourceName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuditEventV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" actor: ").append(toIndentedString(actor)).append("\n"); - sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" resourceName: ").append(toIndentedString(resourceName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("timestamp"); - openapiFields.add("type"); - openapiFields.add("actor"); - openapiFields.add("resourceId"); - openapiFields.add("resourceType"); - openapiFields.add("resourceName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("timestamp"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("actor"); - openapiRequiredFields.add("resourceId"); - openapiRequiredFields.add("resourceType"); - openapiRequiredFields.add("resourceName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AuditEventV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AuditEventV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuditEventV1 is not found in the empty JSON string", AuditEventV1.openapiRequiredFields.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AuditEventV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AuditEventV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AuditEventV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuditEventV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuditEventV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timestamp` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timestamp").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("actor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("actor").toString())); + } + if (!jsonObj.get("resourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceId").toString())); + } + if (!jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); } - } + if (!jsonObj.get("resourceName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceName").toString())); + } + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AuditEventV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuditEventV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuditEventV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AuditEventV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AuditEventV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuditEventV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("timestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("actor").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actor").toString())); - } - if (!jsonObj.get("resourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceId").toString())); - } - if (!jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString())); - } - if (!jsonObj.get("resourceName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuditEventV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuditEventV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuditEventV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuditEventV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AuditEventV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of AuditEventV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuditEventV1 - * @throws IOException if the JSON string is invalid with respect to AuditEventV1 - */ - public static AuditEventV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuditEventV1.class); - } - - /** - * Convert an instance of AuditEventV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of AuditEventV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuditEventV1 + * @throws IOException if the JSON string is invalid with respect to AuditEventV1 + */ + public static AuditEventV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuditEventV1.class); + } + + /** + * Convert an instance of AuditEventV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java index 85e5b6f3..23138a97 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,205 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpaceAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * BatchQueryMessagingSubscriptionsForSpace200Response - */ - +/** BatchQueryMessagingSubscriptionsForSpace200Response */ public class BatchQueryMessagingSubscriptionsForSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private BatchQueryMessagingSubscriptionsForSpaceAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public BatchQueryMessagingSubscriptionsForSpace200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private BatchQueryMessagingSubscriptionsForSpaceAlphaOutput data; - public BatchQueryMessagingSubscriptionsForSpace200Response data(BatchQueryMessagingSubscriptionsForSpaceAlphaOutput data) { - - this.data = data; - return this; - } + public BatchQueryMessagingSubscriptionsForSpace200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public BatchQueryMessagingSubscriptionsForSpace200Response data( + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput data) { - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput getData() { + return data; + } - public void setData(BatchQueryMessagingSubscriptionsForSpaceAlphaOutput data) { - this.data = data; - } + public void setData(BatchQueryMessagingSubscriptionsForSpaceAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchQueryMessagingSubscriptionsForSpace200Response + batchQueryMessagingSubscriptionsForSpace200Response = + (BatchQueryMessagingSubscriptionsForSpace200Response) o; + return Objects.equals(this.data, batchQueryMessagingSubscriptionsForSpace200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchQueryMessagingSubscriptionsForSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - BatchQueryMessagingSubscriptionsForSpace200Response batchQueryMessagingSubscriptionsForSpace200Response = (BatchQueryMessagingSubscriptionsForSpace200Response) o; - return Objects.equals(this.data, batchQueryMessagingSubscriptionsForSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchQueryMessagingSubscriptionsForSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to BatchQueryMessagingSubscriptionsForSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!BatchQueryMessagingSubscriptionsForSpace200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in BatchQueryMessagingSubscriptionsForSpace200Response is not found in the empty JSON string", BatchQueryMessagingSubscriptionsForSpace200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * BatchQueryMessagingSubscriptionsForSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BatchQueryMessagingSubscriptionsForSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BatchQueryMessagingSubscriptionsForSpace200Response is not" + + " found in the empty JSON string", + BatchQueryMessagingSubscriptionsForSpace200Response + .openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!BatchQueryMessagingSubscriptionsForSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BatchQueryMessagingSubscriptionsForSpace200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BatchQueryMessagingSubscriptionsForSpace200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `BatchQueryMessagingSubscriptionsForSpace200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BatchQueryMessagingSubscriptionsForSpace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BatchQueryMessagingSubscriptionsForSpace200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BatchQueryMessagingSubscriptionsForSpace200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BatchQueryMessagingSubscriptionsForSpace200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public BatchQueryMessagingSubscriptionsForSpace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchQueryMessagingSubscriptionsForSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'BatchQueryMessagingSubscriptionsForSpace200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BatchQueryMessagingSubscriptionsForSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + BatchQueryMessagingSubscriptionsForSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchQueryMessagingSubscriptionsForSpace200Response read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BatchQueryMessagingSubscriptionsForSpace200Response given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of BatchQueryMessagingSubscriptionsForSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * BatchQueryMessagingSubscriptionsForSpace200Response + */ + public static BatchQueryMessagingSubscriptionsForSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, BatchQueryMessagingSubscriptionsForSpace200Response.class); } - } - - /** - * Create an instance of BatchQueryMessagingSubscriptionsForSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of BatchQueryMessagingSubscriptionsForSpace200Response - * @throws IOException if the JSON string is invalid with respect to BatchQueryMessagingSubscriptionsForSpace200Response - */ - public static BatchQueryMessagingSubscriptionsForSpace200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BatchQueryMessagingSubscriptionsForSpace200Response.class); - } - - /** - * Convert an instance of BatchQueryMessagingSubscriptionsForSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of BatchQueryMessagingSubscriptionsForSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java index 2fe8625e..953c4217 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,241 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSubscriptionRequest; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Batch get request. - */ +/** Batch get request. */ @ApiModel(description = "Batch get request.") - public class BatchQueryMessagingSubscriptionsForSpaceAlphaInput { - public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions"; - @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS) - private List subscriptions = new ArrayList<>(); + public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions"; - public BatchQueryMessagingSubscriptionsForSpaceAlphaInput() { - } + @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS) + private List subscriptions = new ArrayList<>(); - public BatchQueryMessagingSubscriptionsForSpaceAlphaInput subscriptions(List subscriptions) { - - this.subscriptions = subscriptions; - return this; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaInput() {} - public BatchQueryMessagingSubscriptionsForSpaceAlphaInput addSubscriptionsItem(GetSubscriptionRequest subscriptionsItem) { - this.subscriptions.add(subscriptionsItem); - return this; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaInput subscriptions( + List subscriptions) { - /** - * A list of subscriptions to retrieve subscription status. - * @return subscriptions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of subscriptions to retrieve subscription status.") + this.subscriptions = subscriptions; + return this; + } - public List getSubscriptions() { - return subscriptions; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaInput addSubscriptionsItem( + GetSubscriptionRequest subscriptionsItem) { + this.subscriptions.add(subscriptionsItem); + return this; + } + /** + * A list of subscriptions to retrieve subscription status. + * + * @return subscriptions + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list of subscriptions to retrieve subscription status.") + public List getSubscriptions() { + return subscriptions; + } - public void setSubscriptions(List subscriptions) { - this.subscriptions = subscriptions; - } + public void setSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + batchQueryMessagingSubscriptionsForSpaceAlphaInput = + (BatchQueryMessagingSubscriptionsForSpaceAlphaInput) o; + return Objects.equals( + this.subscriptions, + batchQueryMessagingSubscriptionsForSpaceAlphaInput.subscriptions); + } + @Override + public int hashCode() { + return Objects.hash(subscriptions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchQueryMessagingSubscriptionsForSpaceAlphaInput {\n"); + sb.append(" subscriptions: ").append(toIndentedString(subscriptions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - BatchQueryMessagingSubscriptionsForSpaceAlphaInput batchQueryMessagingSubscriptionsForSpaceAlphaInput = (BatchQueryMessagingSubscriptionsForSpaceAlphaInput) o; - return Objects.equals(this.subscriptions, batchQueryMessagingSubscriptionsForSpaceAlphaInput.subscriptions); - } - - @Override - public int hashCode() { - return Objects.hash(subscriptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchQueryMessagingSubscriptionsForSpaceAlphaInput {\n"); - sb.append(" subscriptions: ").append(toIndentedString(subscriptions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscriptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscriptions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("subscriptions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("subscriptions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to BatchQueryMessagingSubscriptionsForSpaceAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in BatchQueryMessagingSubscriptionsForSpaceAlphaInput is not found in the empty JSON string", BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * BatchQueryMessagingSubscriptionsForSpaceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BatchQueryMessagingSubscriptionsForSpaceAlphaInput is not" + + " found in the empty JSON string", + BatchQueryMessagingSubscriptionsForSpaceAlphaInput + .openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BatchQueryMessagingSubscriptionsForSpaceAlphaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `BatchQueryMessagingSubscriptionsForSpaceAlphaInput`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("subscriptions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subscriptions` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("subscriptions").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("subscriptions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subscriptions` to be an array in the JSON string but got `%s`", jsonObj.get("subscriptions").toString())); - } - JsonArray jsonArraysubscriptions = jsonObj.getAsJsonArray("subscriptions"); - } + JsonArray jsonArraysubscriptions = jsonObj.getAsJsonArray("subscriptions"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BatchQueryMessagingSubscriptionsForSpaceAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BatchQueryMessagingSubscriptionsForSpaceAlphaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BatchQueryMessagingSubscriptionsForSpaceAlphaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public BatchQueryMessagingSubscriptionsForSpaceAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'BatchQueryMessagingSubscriptionsForSpaceAlphaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BatchQueryMessagingSubscriptionsForSpaceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + BatchQueryMessagingSubscriptionsForSpaceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchQueryMessagingSubscriptionsForSpaceAlphaInput read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchQueryMessagingSubscriptionsForSpaceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * BatchQueryMessagingSubscriptionsForSpaceAlphaInput + */ + public static BatchQueryMessagingSubscriptionsForSpaceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, BatchQueryMessagingSubscriptionsForSpaceAlphaInput.class); } - } - - /** - * Create an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of BatchQueryMessagingSubscriptionsForSpaceAlphaInput - * @throws IOException if the JSON string is invalid with respect to BatchQueryMessagingSubscriptionsForSpaceAlphaInput - */ - public static BatchQueryMessagingSubscriptionsForSpaceAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BatchQueryMessagingSubscriptionsForSpaceAlphaInput.class); - } - - /** - * Convert an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java index 02b4b234..7913e1ce 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,336 +10,373 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetMessagingSubscriptionFailureResponse; -import com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse; -import com.segment.publicapi.models.MessageSubscriptionResponseError; -import com.segment.publicapi.models.Pagination; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Batch get response. - */ +/** Batch get response. */ @ApiModel(description = "Batch get response.") - public class BatchQueryMessagingSubscriptionsForSpaceAlphaOutput { - public static final String SERIALIZED_NAME_SUCCESSES = "successes"; - @SerializedName(SERIALIZED_NAME_SUCCESSES) - private List successes = new ArrayList<>(); + public static final String SERIALIZED_NAME_SUCCESSES = "successes"; + + @SerializedName(SERIALIZED_NAME_SUCCESSES) + private List successes = new ArrayList<>(); - public static final String SERIALIZED_NAME_FAILURES = "failures"; - @SerializedName(SERIALIZED_NAME_FAILURES) - private List failures = new ArrayList<>(); - - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) - private List errors = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; - - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput() { - } - - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput successes(List successes) { - - this.successes = successes; - return this; - } + public static final String SERIALIZED_NAME_FAILURES = "failures"; - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addSuccessesItem(GetMessagingSubscriptionSuccessResponse successesItem) { - this.successes.add(successesItem); - return this; - } + @SerializedName(SERIALIZED_NAME_FAILURES) + private List failures = new ArrayList<>(); - /** - * Array of successful subscription status. - * @return successes - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array of successful subscription status.") + public static final String SERIALIZED_NAME_ERRORS = "errors"; - public List getSuccesses() { - return successes; - } + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = new ArrayList<>(); + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public void setSuccesses(List successes) { - this.successes = successes; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput() {} - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput failures(List failures) { - - this.failures = failures; - return this; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput successes( + List successes) { - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addFailuresItem(GetMessagingSubscriptionFailureResponse failuresItem) { - this.failures.add(failuresItem); - return this; - } + this.successes = successes; + return this; + } - /** - * Validation errors due to invalid types or email/phone numbers. - * @return failures - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Validation errors due to invalid types or email/phone numbers.") + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addSuccessesItem( + GetMessagingSubscriptionSuccessResponse successesItem) { + this.successes.add(successesItem); + return this; + } - public List getFailures() { - return failures; - } + /** + * Array of successful subscription status. + * + * @return successes + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Array of successful subscription status.") + public List getSuccesses() { + return successes; + } + public void setSuccesses(List successes) { + this.successes = successes; + } - public void setFailures(List failures) { - this.failures = failures; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput failures( + List failures) { + this.failures = failures; + return this; + } - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput errors(List errors) { - - this.errors = errors; - return this; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addFailuresItem( + GetMessagingSubscriptionFailureResponse failuresItem) { + this.failures.add(failuresItem); + return this; + } - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addErrorsItem(MessageSubscriptionResponseError errorsItem) { - this.errors.add(errorsItem); - return this; - } + /** + * Validation errors due to invalid types or email/phone numbers. + * + * @return failures + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Validation errors due to invalid types or email/phone numbers.") + public List getFailures() { + return failures; + } - /** - * General errors when making the request such as invalid payload or wrong http method errors. - * @return errors - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "General errors when making the request such as invalid payload or wrong http method errors.") + public void setFailures(List failures) { + this.failures = failures; + } - public List getErrors() { - return errors; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput errors( + List errors) { + this.errors = errors; + return this; + } - public void setErrors(List errors) { - this.errors = errors; - } + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addErrorsItem( + MessageSubscriptionResponseError errorsItem) { + this.errors.add(errorsItem); + return this; + } + /** + * General errors when making the request such as invalid payload or wrong http method errors. + * + * @return errors + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "General errors when making the request such as invalid payload or wrong http" + + " method errors.") + public List getErrors() { + return errors; + } - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setErrors(List errors) { + this.errors = errors; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput + batchQueryMessagingSubscriptionsForSpaceAlphaOutput = + (BatchQueryMessagingSubscriptionsForSpaceAlphaOutput) o; + return Objects.equals( + this.successes, + batchQueryMessagingSubscriptionsForSpaceAlphaOutput.successes) + && Objects.equals( + this.failures, batchQueryMessagingSubscriptionsForSpaceAlphaOutput.failures) + && Objects.equals( + this.errors, batchQueryMessagingSubscriptionsForSpaceAlphaOutput.errors) + && Objects.equals( + this.pagination, + batchQueryMessagingSubscriptionsForSpaceAlphaOutput.pagination); + } + @Override + public int hashCode() { + return Objects.hash(successes, failures, errors, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchQueryMessagingSubscriptionsForSpaceAlphaOutput {\n"); + sb.append(" successes: ").append(toIndentedString(successes)).append("\n"); + sb.append(" failures: ").append(toIndentedString(failures)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - BatchQueryMessagingSubscriptionsForSpaceAlphaOutput batchQueryMessagingSubscriptionsForSpaceAlphaOutput = (BatchQueryMessagingSubscriptionsForSpaceAlphaOutput) o; - return Objects.equals(this.successes, batchQueryMessagingSubscriptionsForSpaceAlphaOutput.successes) && - Objects.equals(this.failures, batchQueryMessagingSubscriptionsForSpaceAlphaOutput.failures) && - Objects.equals(this.errors, batchQueryMessagingSubscriptionsForSpaceAlphaOutput.errors) && - Objects.equals(this.pagination, batchQueryMessagingSubscriptionsForSpaceAlphaOutput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(successes, failures, errors, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchQueryMessagingSubscriptionsForSpaceAlphaOutput {\n"); - sb.append(" successes: ").append(toIndentedString(successes)).append("\n"); - sb.append(" failures: ").append(toIndentedString(failures)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("successes"); + openapiFields.add("failures"); + openapiFields.add("errors"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("successes"); + openapiRequiredFields.add("failures"); + openapiRequiredFields.add("errors"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("successes"); - openapiFields.add("failures"); - openapiFields.add("errors"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("successes"); - openapiRequiredFields.add("failures"); - openapiRequiredFields.add("errors"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to BatchQueryMessagingSubscriptionsForSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in BatchQueryMessagingSubscriptionsForSpaceAlphaOutput is not found in the empty JSON string", BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * BatchQueryMessagingSubscriptionsForSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " BatchQueryMessagingSubscriptionsForSpaceAlphaOutput is not" + + " found in the empty JSON string", + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput + .openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BatchQueryMessagingSubscriptionsForSpaceAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `BatchQueryMessagingSubscriptionsForSpaceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("successes").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `successes` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("successes").toString())); + } + + JsonArray jsonArraysuccesses = jsonObj.getAsJsonArray("successes"); + // ensure the json data is an array + if (!jsonObj.get("failures").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `failures` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("failures").toString())); + } + + JsonArray jsonArrayfailures = jsonObj.getAsJsonArray("failures"); + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errors` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'BatchQueryMessagingSubscriptionsForSpaceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - // ensure the json data is an array - if (!jsonObj.get("successes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `successes` to be an array in the JSON string but got `%s`", jsonObj.get("successes").toString())); - } - - JsonArray jsonArraysuccesses = jsonObj.getAsJsonArray("successes"); - // ensure the json data is an array - if (!jsonObj.get("failures").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `failures` to be an array in the JSON string but got `%s`", jsonObj.get("failures").toString())); - } - - JsonArray jsonArrayfailures = jsonObj.getAsJsonArray("failures"); - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BatchQueryMessagingSubscriptionsForSpaceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BatchQueryMessagingSubscriptionsForSpaceAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of BatchQueryMessagingSubscriptionsForSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to BatchQueryMessagingSubscriptionsForSpaceAlphaOutput - */ - public static BatchQueryMessagingSubscriptionsForSpaceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.class); - } - - /** - * Convert an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaOutput given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of BatchQueryMessagingSubscriptionsForSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * BatchQueryMessagingSubscriptionsForSpaceAlphaOutput + */ + public static BatchQueryMessagingSubscriptionsForSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.class); + } + + /** + * Convert an instance of BatchQueryMessagingSubscriptionsForSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java index 222f51f3..a0858f78 100644 --- a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java +++ b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,240 +10,233 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The breakdown of a metric. - */ +/** The breakdown of a metric. */ @ApiModel(description = "The breakdown of a metric.") - public class BreakdownBeta { - public static final String SERIALIZED_NAME_METRIC_NAME = "metricName"; - @SerializedName(SERIALIZED_NAME_METRIC_NAME) - private String metricName; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private BigDecimal value; + public static final String SERIALIZED_NAME_METRIC_NAME = "metricName"; - public BreakdownBeta() { - } + @SerializedName(SERIALIZED_NAME_METRIC_NAME) + private String metricName; - public BreakdownBeta metricName(String metricName) { - - this.metricName = metricName; - return this; - } + public static final String SERIALIZED_NAME_VALUE = "value"; - /** - * The name of the metric. - * @return metricName - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the metric.") + @SerializedName(SERIALIZED_NAME_VALUE) + private BigDecimal value; - public String getMetricName() { - return metricName; - } + public BreakdownBeta() {} + public BreakdownBeta metricName(String metricName) { - public void setMetricName(String metricName) { - this.metricName = metricName; - } + this.metricName = metricName; + return this; + } + /** + * The name of the metric. + * + * @return metricName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the metric.") + public String getMetricName() { + return metricName; + } - public BreakdownBeta value(BigDecimal value) { - - this.value = value; - return this; - } + public void setMetricName(String metricName) { + this.metricName = metricName; + } - /** - * Number of occurrences of the metric. - * @return value - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Number of occurrences of the metric.") + public BreakdownBeta value(BigDecimal value) { - public BigDecimal getValue() { - return value; - } + this.value = value; + return this; + } + /** + * Number of occurrences of the metric. + * + * @return value + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Number of occurrences of the metric.") + public BigDecimal getValue() { + return value; + } - public void setValue(BigDecimal value) { - this.value = value; - } + public void setValue(BigDecimal value) { + this.value = value; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BreakdownBeta breakdownBeta = (BreakdownBeta) o; + return Objects.equals(this.metricName, breakdownBeta.metricName) + && Objects.equals(this.value, breakdownBeta.value); + } + @Override + public int hashCode() { + return Objects.hash(metricName, value); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BreakdownBeta {\n"); + sb.append(" metricName: ").append(toIndentedString(metricName)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - BreakdownBeta breakdownBeta = (BreakdownBeta) o; - return Objects.equals(this.metricName, breakdownBeta.metricName) && - Objects.equals(this.value, breakdownBeta.value); - } - - @Override - public int hashCode() { - return Objects.hash(metricName, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BreakdownBeta {\n"); - sb.append(" metricName: ").append(toIndentedString(metricName)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("metricName"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("metricName"); + openapiRequiredFields.add("value"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("metricName"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("metricName"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to BreakdownBeta - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!BreakdownBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in BreakdownBeta is not found in the empty JSON string", BreakdownBeta.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BreakdownBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BreakdownBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BreakdownBeta is not found in the" + + " empty JSON string", + BreakdownBeta.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!BreakdownBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BreakdownBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BreakdownBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `BreakdownBeta` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BreakdownBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BreakdownBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("metricName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metricName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metricName").toString())); } - } - if (!jsonObj.get("metricName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metricName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metricName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BreakdownBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BreakdownBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BreakdownBeta.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, BreakdownBeta value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public BreakdownBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of BreakdownBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of BreakdownBeta - * @throws IOException if the JSON string is invalid with respect to BreakdownBeta - */ - public static BreakdownBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BreakdownBeta.class); - } - - /** - * Convert an instance of BreakdownBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BreakdownBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BreakdownBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(BreakdownBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BreakdownBeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BreakdownBeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BreakdownBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of BreakdownBeta + * @throws IOException if the JSON string is invalid with respect to BreakdownBeta + */ + public static BreakdownBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BreakdownBeta.class); + } + + /** + * Convert an instance of BreakdownBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java index 15ee36ef..629f773d 100644 --- a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,325 +10,326 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Group; -import com.segment.publicapi.models.Identify; -import com.segment.publicapi.models.Track; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** CommonSourceSettingsV1 */ +public class CommonSourceSettingsV1 { + public static final String SERIALIZED_NAME_TRACK = "track"; -/** - * CommonSourceSettingsV1 - */ + @SerializedName(SERIALIZED_NAME_TRACK) + private Track track; -public class CommonSourceSettingsV1 { - public static final String SERIALIZED_NAME_TRACK = "track"; - @SerializedName(SERIALIZED_NAME_TRACK) - private Track track; - - public static final String SERIALIZED_NAME_IDENTIFY = "identify"; - @SerializedName(SERIALIZED_NAME_IDENTIFY) - private Identify identify; - - public static final String SERIALIZED_NAME_GROUP = "group"; - @SerializedName(SERIALIZED_NAME_GROUP) - private Group group; + public static final String SERIALIZED_NAME_IDENTIFY = "identify"; - public static final String SERIALIZED_NAME_FORWARDING_VIOLATIONS_TO = "forwardingViolationsTo"; - @SerializedName(SERIALIZED_NAME_FORWARDING_VIOLATIONS_TO) - private String forwardingViolationsTo; + @SerializedName(SERIALIZED_NAME_IDENTIFY) + private Identify identify; - public static final String SERIALIZED_NAME_FORWARDING_BLOCKED_EVENTS_TO = "forwardingBlockedEventsTo"; - @SerializedName(SERIALIZED_NAME_FORWARDING_BLOCKED_EVENTS_TO) - private String forwardingBlockedEventsTo; + public static final String SERIALIZED_NAME_GROUP = "group"; - public CommonSourceSettingsV1() { - } + @SerializedName(SERIALIZED_NAME_GROUP) + private Group group; - public CommonSourceSettingsV1 track(Track track) { - - this.track = track; - return this; - } + public static final String SERIALIZED_NAME_FORWARDING_VIOLATIONS_TO = "forwardingViolationsTo"; - /** - * Get track - * @return track - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + @SerializedName(SERIALIZED_NAME_FORWARDING_VIOLATIONS_TO) + private String forwardingViolationsTo; - public Track getTrack() { - return track; - } + public static final String SERIALIZED_NAME_FORWARDING_BLOCKED_EVENTS_TO = + "forwardingBlockedEventsTo"; + @SerializedName(SERIALIZED_NAME_FORWARDING_BLOCKED_EVENTS_TO) + private String forwardingBlockedEventsTo; - public void setTrack(Track track) { - this.track = track; - } + public CommonSourceSettingsV1() {} + public CommonSourceSettingsV1 track(Track track) { - public CommonSourceSettingsV1 identify(Identify identify) { - - this.identify = identify; - return this; - } + this.track = track; + return this; + } - /** - * Get identify - * @return identify - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + /** + * Get track + * + * @return track + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Track getTrack() { + return track; + } - public Identify getIdentify() { - return identify; - } + public void setTrack(Track track) { + this.track = track; + } + public CommonSourceSettingsV1 identify(Identify identify) { - public void setIdentify(Identify identify) { - this.identify = identify; - } + this.identify = identify; + return this; + } + /** + * Get identify + * + * @return identify + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Identify getIdentify() { + return identify; + } - public CommonSourceSettingsV1 group(Group group) { - - this.group = group; - return this; - } + public void setIdentify(Identify identify) { + this.identify = identify; + } + + public CommonSourceSettingsV1 group(Group group) { + + this.group = group; + return this; + } - /** - * Get group - * @return group - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + /** + * Get group + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Group getGroup() { + return group; + } - public Group getGroup() { - return group; - } + public void setGroup(Group group) { + this.group = group; + } + public CommonSourceSettingsV1 forwardingViolationsTo(String forwardingViolationsTo) { - public void setGroup(Group group) { - this.group = group; - } + this.forwardingViolationsTo = forwardingViolationsTo; + return this; + } + /** + * SourceId to forward violations to. + * + * @return forwardingViolationsTo + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "SourceId to forward violations to.") + public String getForwardingViolationsTo() { + return forwardingViolationsTo; + } - public CommonSourceSettingsV1 forwardingViolationsTo(String forwardingViolationsTo) { - - this.forwardingViolationsTo = forwardingViolationsTo; - return this; - } + public void setForwardingViolationsTo(String forwardingViolationsTo) { + this.forwardingViolationsTo = forwardingViolationsTo; + } - /** - * SourceId to forward violations to. - * @return forwardingViolationsTo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "SourceId to forward violations to.") + public CommonSourceSettingsV1 forwardingBlockedEventsTo(String forwardingBlockedEventsTo) { - public String getForwardingViolationsTo() { - return forwardingViolationsTo; - } + this.forwardingBlockedEventsTo = forwardingBlockedEventsTo; + return this; + } + /** + * SourceId to forward blocked events to. + * + * @return forwardingBlockedEventsTo + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "SourceId to forward blocked events to.") + public String getForwardingBlockedEventsTo() { + return forwardingBlockedEventsTo; + } - public void setForwardingViolationsTo(String forwardingViolationsTo) { - this.forwardingViolationsTo = forwardingViolationsTo; - } + public void setForwardingBlockedEventsTo(String forwardingBlockedEventsTo) { + this.forwardingBlockedEventsTo = forwardingBlockedEventsTo; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommonSourceSettingsV1 commonSourceSettingsV1 = (CommonSourceSettingsV1) o; + return Objects.equals(this.track, commonSourceSettingsV1.track) + && Objects.equals(this.identify, commonSourceSettingsV1.identify) + && Objects.equals(this.group, commonSourceSettingsV1.group) + && Objects.equals( + this.forwardingViolationsTo, commonSourceSettingsV1.forwardingViolationsTo) + && Objects.equals( + this.forwardingBlockedEventsTo, + commonSourceSettingsV1.forwardingBlockedEventsTo); + } - public CommonSourceSettingsV1 forwardingBlockedEventsTo(String forwardingBlockedEventsTo) { - - this.forwardingBlockedEventsTo = forwardingBlockedEventsTo; - return this; - } + @Override + public int hashCode() { + return Objects.hash( + track, identify, group, forwardingViolationsTo, forwardingBlockedEventsTo); + } - /** - * SourceId to forward blocked events to. - * @return forwardingBlockedEventsTo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "SourceId to forward blocked events to.") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommonSourceSettingsV1 {\n"); + sb.append(" track: ").append(toIndentedString(track)).append("\n"); + sb.append(" identify: ").append(toIndentedString(identify)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" forwardingViolationsTo: ") + .append(toIndentedString(forwardingViolationsTo)) + .append("\n"); + sb.append(" forwardingBlockedEventsTo: ") + .append(toIndentedString(forwardingBlockedEventsTo)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } - public String getForwardingBlockedEventsTo() { - return forwardingBlockedEventsTo; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; - public void setForwardingBlockedEventsTo(String forwardingBlockedEventsTo) { - this.forwardingBlockedEventsTo = forwardingBlockedEventsTo; - } + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("track"); + openapiFields.add("identify"); + openapiFields.add("group"); + openapiFields.add("forwardingViolationsTo"); + openapiFields.add("forwardingBlockedEventsTo"); + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommonSourceSettingsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommonSourceSettingsV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CommonSourceSettingsV1 is not found in" + + " the empty JSON string", + CommonSourceSettingsV1.openapiRequiredFields.toString())); + } + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommonSourceSettingsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CommonSourceSettingsV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("forwardingViolationsTo") != null + && !jsonObj.get("forwardingViolationsTo").isJsonNull()) + && !jsonObj.get("forwardingViolationsTo").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `forwardingViolationsTo` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("forwardingViolationsTo").toString())); + } + if ((jsonObj.get("forwardingBlockedEventsTo") != null + && !jsonObj.get("forwardingBlockedEventsTo").isJsonNull()) + && !jsonObj.get("forwardingBlockedEventsTo").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `forwardingBlockedEventsTo` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("forwardingBlockedEventsTo").toString())); + } } - if (o == null || getClass() != o.getClass()) { - return false; + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommonSourceSettingsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommonSourceSettingsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CommonSourceSettingsV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CommonSourceSettingsV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommonSourceSettingsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } } - CommonSourceSettingsV1 commonSourceSettingsV1 = (CommonSourceSettingsV1) o; - return Objects.equals(this.track, commonSourceSettingsV1.track) && - Objects.equals(this.identify, commonSourceSettingsV1.identify) && - Objects.equals(this.group, commonSourceSettingsV1.group) && - Objects.equals(this.forwardingViolationsTo, commonSourceSettingsV1.forwardingViolationsTo) && - Objects.equals(this.forwardingBlockedEventsTo, commonSourceSettingsV1.forwardingBlockedEventsTo); - } - - @Override - public int hashCode() { - return Objects.hash(track, identify, group, forwardingViolationsTo, forwardingBlockedEventsTo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CommonSourceSettingsV1 {\n"); - sb.append(" track: ").append(toIndentedString(track)).append("\n"); - sb.append(" identify: ").append(toIndentedString(identify)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" forwardingViolationsTo: ").append(toIndentedString(forwardingViolationsTo)).append("\n"); - sb.append(" forwardingBlockedEventsTo: ").append(toIndentedString(forwardingBlockedEventsTo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + /** + * Create an instance of CommonSourceSettingsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommonSourceSettingsV1 + * @throws IOException if the JSON string is invalid with respect to CommonSourceSettingsV1 + */ + public static CommonSourceSettingsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommonSourceSettingsV1.class); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("track"); - openapiFields.add("identify"); - openapiFields.add("group"); - openapiFields.add("forwardingViolationsTo"); - openapiFields.add("forwardingBlockedEventsTo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CommonSourceSettingsV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CommonSourceSettingsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CommonSourceSettingsV1 is not found in the empty JSON string", CommonSourceSettingsV1.openapiRequiredFields.toString())); - } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CommonSourceSettingsV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommonSourceSettingsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("forwardingViolationsTo") != null && !jsonObj.get("forwardingViolationsTo").isJsonNull()) && !jsonObj.get("forwardingViolationsTo").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `forwardingViolationsTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("forwardingViolationsTo").toString())); - } - if ((jsonObj.get("forwardingBlockedEventsTo") != null && !jsonObj.get("forwardingBlockedEventsTo").isJsonNull()) && !jsonObj.get("forwardingBlockedEventsTo").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `forwardingBlockedEventsTo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("forwardingBlockedEventsTo").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CommonSourceSettingsV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CommonSourceSettingsV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CommonSourceSettingsV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CommonSourceSettingsV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CommonSourceSettingsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + /** + * Convert an instance of CommonSourceSettingsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); } - } - - /** - * Create an instance of CommonSourceSettingsV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommonSourceSettingsV1 - * @throws IOException if the JSON string is invalid with respect to CommonSourceSettingsV1 - */ - public static CommonSourceSettingsV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CommonSourceSettingsV1.class); - } - - /** - * Convert an instance of CommonSourceSettingsV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } } - diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index ac8852b7..649c3664 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,307 +10,306 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The contact info for Integration Owners. - */ +/** The contact info for Integration Owners. */ @ApiModel(description = "The contact info for Integration Owners.") - public class Contact { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_ROLE = "role"; - @SerializedName(SERIALIZED_NAME_ROLE) - private String role; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_IS_PRIMARY = "isPrimary"; - @SerializedName(SERIALIZED_NAME_IS_PRIMARY) - private Boolean isPrimary; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public Contact() { - } + public static final String SERIALIZED_NAME_EMAIL = "email"; - public Contact name(String name) { - - this.name = name; - return this; - } + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; - /** - * Name of this contact. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of this contact.") + public static final String SERIALIZED_NAME_ROLE = "role"; - public String getName() { - return name; - } + @SerializedName(SERIALIZED_NAME_ROLE) + private String role; + public static final String SERIALIZED_NAME_IS_PRIMARY = "isPrimary"; - public void setName(String name) { - this.name = name; - } + @SerializedName(SERIALIZED_NAME_IS_PRIMARY) + private Boolean isPrimary; + public Contact() {} - public Contact email(String email) { - - this.email = email; - return this; - } + public Contact name(String name) { - /** - * Email of this contact. - * @return email - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Email of this contact.") - - public String getEmail() { - return email; - } + this.name = name; + return this; + } + /** + * Name of this contact. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of this contact.") + public String getName() { + return name; + } - public void setEmail(String email) { - this.email = email; - } + public void setName(String name) { + this.name = name; + } + public Contact email(String email) { - public Contact role(String role) { - - this.role = role; - return this; - } + this.email = email; + return this; + } - /** - * Role of this contact. - * @return role - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Role of this contact.") + /** + * Email of this contact. + * + * @return email + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Email of this contact.") + public String getEmail() { + return email; + } - public String getRole() { - return role; - } + public void setEmail(String email) { + this.email = email; + } + public Contact role(String role) { - public void setRole(String role) { - this.role = role; - } + this.role = role; + return this; + } + /** + * Role of this contact. + * + * @return role + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Role of this contact.") + public String getRole() { + return role; + } - public Contact isPrimary(Boolean isPrimary) { - - this.isPrimary = isPrimary; - return this; - } + public void setRole(String role) { + this.role = role; + } - /** - * Whether this is a primary contact. - * @return isPrimary - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this is a primary contact.") + public Contact isPrimary(Boolean isPrimary) { - public Boolean getIsPrimary() { - return isPrimary; - } + this.isPrimary = isPrimary; + return this; + } + /** + * Whether this is a primary contact. + * + * @return isPrimary + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Whether this is a primary contact.") + public Boolean getIsPrimary() { + return isPrimary; + } - public void setIsPrimary(Boolean isPrimary) { - this.isPrimary = isPrimary; - } + public void setIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Contact contact = (Contact) o; + return Objects.equals(this.name, contact.name) + && Objects.equals(this.email, contact.email) + && Objects.equals(this.role, contact.role) + && Objects.equals(this.isPrimary, contact.isPrimary); + } + @Override + public int hashCode() { + return Objects.hash(name, email, role, isPrimary); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Contact {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Contact contact = (Contact) o; - return Objects.equals(this.name, contact.name) && - Objects.equals(this.email, contact.email) && - Objects.equals(this.role, contact.role) && - Objects.equals(this.isPrimary, contact.isPrimary); - } - - @Override - public int hashCode() { - return Objects.hash(name, email, role, isPrimary); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Contact {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("email"); + openapiFields.add("role"); + openapiFields.add("isPrimary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("role"); + openapiRequiredFields.add("isPrimary"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("email"); - openapiFields.add("role"); - openapiFields.add("isPrimary"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("role"); - openapiRequiredFields.add("isPrimary"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Contact - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Contact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Contact is not found in the empty JSON string", Contact.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Contact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Contact.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Contact is not found in the empty JSON" + + " string", + Contact.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Contact.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Contact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Contact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Contact`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Contact.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Contact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `email` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("email").toString())); + } + if (!jsonObj.get("role").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `role` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("role").toString())); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if (!jsonObj.get("role").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Contact.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Contact' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Contact.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Contact value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Contact read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Contact given an JSON string - * - * @param jsonString JSON string - * @return An instance of Contact - * @throws IOException if the JSON string is invalid with respect to Contact - */ - public static Contact fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Contact.class); - } - - /** - * Convert an instance of Contact to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Contact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Contact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Contact.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Contact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Contact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Contact given an JSON string + * + * @param jsonString JSON string + * @return An instance of Contact + * @throws IOException if the JSON string is invalid with respect to Contact + */ + public static Contact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Contact.class); + } + + /** + * Convert an instance of Contact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java index 5beed2b2..cadf8f61 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateCloudSourceRegulationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateCloudSourceRegulation200Response - */ - +/** CreateCloudSourceRegulation200Response */ public class CreateCloudSourceRegulation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateCloudSourceRegulationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateCloudSourceRegulation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateCloudSourceRegulationV1Output data; - public CreateCloudSourceRegulation200Response data(CreateCloudSourceRegulationV1Output data) { - - this.data = data; - return this; - } + public CreateCloudSourceRegulation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateCloudSourceRegulation200Response data(CreateCloudSourceRegulationV1Output data) { - public CreateCloudSourceRegulationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateCloudSourceRegulationV1Output getData() { + return data; + } - public void setData(CreateCloudSourceRegulationV1Output data) { - this.data = data; - } + public void setData(CreateCloudSourceRegulationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCloudSourceRegulation200Response createCloudSourceRegulation200Response = + (CreateCloudSourceRegulation200Response) o; + return Objects.equals(this.data, createCloudSourceRegulation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCloudSourceRegulation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateCloudSourceRegulation200Response createCloudSourceRegulation200Response = (CreateCloudSourceRegulation200Response) o; - return Objects.equals(this.data, createCloudSourceRegulation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateCloudSourceRegulation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateCloudSourceRegulation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateCloudSourceRegulation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateCloudSourceRegulation200Response is not found in the empty JSON string", CreateCloudSourceRegulation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateCloudSourceRegulation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateCloudSourceRegulation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateCloudSourceRegulation200Response" + + " is not found in the empty JSON string", + CreateCloudSourceRegulation200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateCloudSourceRegulation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCloudSourceRegulation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateCloudSourceRegulation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateCloudSourceRegulation200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateCloudSourceRegulation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateCloudSourceRegulation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateCloudSourceRegulation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateCloudSourceRegulation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateCloudSourceRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCloudSourceRegulation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCloudSourceRegulation200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateCloudSourceRegulation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateCloudSourceRegulation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateCloudSourceRegulation200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateCloudSourceRegulation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCloudSourceRegulation200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateCloudSourceRegulation200Response + */ + public static CreateCloudSourceRegulation200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCloudSourceRegulation200Response.class); } - } - - /** - * Create an instance of CreateCloudSourceRegulation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateCloudSourceRegulation200Response - * @throws IOException if the JSON string is invalid with respect to CreateCloudSourceRegulation200Response - */ - public static CreateCloudSourceRegulation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateCloudSourceRegulation200Response.class); - } - - /** - * Convert an instance of CreateCloudSourceRegulation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateCloudSourceRegulation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 07fb6c1b..17bb737d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,419 +10,436 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The input to create a Cloud Source-scoped regulation. - */ +/** The input to create a Cloud Source-scoped regulation. */ @ApiModel(description = "The input to create a Cloud Source-scoped regulation.") - public class CreateCloudSourceRegulationV1Input { - /** - * The regulation type to create. - */ - @JsonAdapter(RegulationTypeEnum.Adapter.class) - public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - - DELETE_INTERNAL("DELETE_INTERNAL"), - - DELETE_ONLY("DELETE_ONLY"), - - SUPPRESS_ONLY("SUPPRESS_ONLY"), - - SUPPRESS_WITH_DELETE("SUPPRESS_WITH_DELETE"), - - UNSUPPRESS("UNSUPPRESS"); - - private String value; - - RegulationTypeEnum(String value) { - this.value = value; - } + /** The regulation type to create. */ + @JsonAdapter(RegulationTypeEnum.Adapter.class) + public enum RegulationTypeEnum { + BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - public String getValue() { - return value; - } + DELETE_INTERNAL("DELETE_INTERNAL"), - @Override - public String toString() { - return String.valueOf(value); - } + DELETE_ONLY("DELETE_ONLY"), - public static RegulationTypeEnum fromValue(String value) { - for (RegulationTypeEnum b : RegulationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + SUPPRESS_ONLY("SUPPRESS_ONLY"), - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final RegulationTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return RegulationTypeEnum.fromValue(value); - } - } - } + SUPPRESS_WITH_DELETE("SUPPRESS_WITH_DELETE"), - public static final String SERIALIZED_NAME_REGULATION_TYPE = "regulationType"; - @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) - private RegulationTypeEnum regulationType; + UNSUPPRESS("UNSUPPRESS"); - /** - * The subject type. Must be `objectId` for Cloud Sources. - */ - @JsonAdapter(SubjectTypeEnum.Adapter.class) - public enum SubjectTypeEnum { - OBJECT_ID("OBJECT_ID"); + private String value; - private String value; + RegulationTypeEnum(String value) { + this.value = value; + } - SubjectTypeEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); - } + public static RegulationTypeEnum fromValue(String value) { + for (RegulationTypeEnum b : RegulationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static SubjectTypeEnum fromValue(String value) { - for (SubjectTypeEnum b : SubjectTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RegulationTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RegulationTypeEnum.fromValue(value); + } } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SubjectTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SubjectTypeEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_REGULATION_TYPE = "regulationType"; + + @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) + private RegulationTypeEnum regulationType; + + /** The subject type. Must be `objectId` for Cloud Sources. */ + @JsonAdapter(SubjectTypeEnum.Adapter.class) + public enum SubjectTypeEnum { + OBJECT_ID("OBJECT_ID"); + + private String value; + + SubjectTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_SUBJECT_TYPE = "subjectType"; - @SerializedName(SERIALIZED_NAME_SUBJECT_TYPE) - private SubjectTypeEnum subjectType; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; - @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) - private List subjectIds = null; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_COLLECTION = "collection"; - @SerializedName(SERIALIZED_NAME_COLLECTION) - private String collection; + public static SubjectTypeEnum fromValue(String value) { + for (SubjectTypeEnum b : SubjectTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public CreateCloudSourceRegulationV1Input() { - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SubjectTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SubjectTypeEnum.fromValue(value); + } + } + } - public CreateCloudSourceRegulationV1Input regulationType(RegulationTypeEnum regulationType) { - - this.regulationType = regulationType; - return this; - } + public static final String SERIALIZED_NAME_SUBJECT_TYPE = "subjectType"; - /** - * The regulation type to create. - * @return regulationType - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The regulation type to create.") + @SerializedName(SERIALIZED_NAME_SUBJECT_TYPE) + private SubjectTypeEnum subjectType; - public RegulationTypeEnum getRegulationType() { - return regulationType; - } + public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; + @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) + private List subjectIds = null; - public void setRegulationType(RegulationTypeEnum regulationType) { - this.regulationType = regulationType; - } + public static final String SERIALIZED_NAME_COLLECTION = "collection"; + @SerializedName(SERIALIZED_NAME_COLLECTION) + private String collection; - public CreateCloudSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { - - this.subjectType = subjectType; - return this; - } + public CreateCloudSourceRegulationV1Input() {} - /** - * The subject type. Must be `objectId` for Cloud Sources. - * @return subjectType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The subject type. Must be `objectId` for Cloud Sources.") + public CreateCloudSourceRegulationV1Input regulationType(RegulationTypeEnum regulationType) { - public SubjectTypeEnum getSubjectType() { - return subjectType; - } + this.regulationType = regulationType; + return this; + } + /** + * The regulation type to create. + * + * @return regulationType + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The regulation type to create.") + public RegulationTypeEnum getRegulationType() { + return regulationType; + } - public void setSubjectType(SubjectTypeEnum subjectType) { - this.subjectType = subjectType; - } + public void setRegulationType(RegulationTypeEnum regulationType) { + this.regulationType = regulationType; + } + public CreateCloudSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { - public CreateCloudSourceRegulationV1Input subjectIds(List subjectIds) { - - this.subjectIds = subjectIds; - return this; - } + this.subjectType = subjectType; + return this; + } - public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { - if (this.subjectIds == null) { - this.subjectIds = new ArrayList<>(); + /** + * The subject type. Must be `objectId` for Cloud Sources. + * + * @return subjectType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The subject type. Must be `objectId` for Cloud Sources.") + public SubjectTypeEnum getSubjectType() { + return subjectType; } - this.subjectIds.add(subjectIdsItem); - return this; - } - /** - * The user or object ids of the subjects to regulate. Config API note: equal to `parent` but allows an array. - * @return subjectIds - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The user or object ids of the subjects to regulate. Config API note: equal to `parent` but allows an array.") + public void setSubjectType(SubjectTypeEnum subjectType) { + this.subjectType = subjectType; + } - public List getSubjectIds() { - return subjectIds; - } + public CreateCloudSourceRegulationV1Input subjectIds(List subjectIds) { + this.subjectIds = subjectIds; + return this; + } - public void setSubjectIds(List subjectIds) { - this.subjectIds = subjectIds; - } + public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { + if (this.subjectIds == null) { + this.subjectIds = new ArrayList<>(); + } + this.subjectIds.add(subjectIdsItem); + return this; + } + /** + * The user or object ids of the subjects to regulate. Config API note: equal to + * `parent` but allows an array. + * + * @return subjectIds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The user or object ids of the subjects to regulate. Config API note: equal to" + + " `parent` but allows an array.") + public List getSubjectIds() { + return subjectIds; + } - public CreateCloudSourceRegulationV1Input collection(String collection) { - - this.collection = collection; - return this; - } + public void setSubjectIds(List subjectIds) { + this.subjectIds = subjectIds; + } - /** - * The Cloud Source collection to regulate. - * @return collection - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Cloud Source collection to regulate.") + public CreateCloudSourceRegulationV1Input collection(String collection) { - public String getCollection() { - return collection; - } + this.collection = collection; + return this; + } + /** + * The Cloud Source collection to regulate. + * + * @return collection + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Cloud Source collection to regulate.") + public String getCollection() { + return collection; + } - public void setCollection(String collection) { - this.collection = collection; - } + public void setCollection(String collection) { + this.collection = collection; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input = + (CreateCloudSourceRegulationV1Input) o; + return Objects.equals( + this.regulationType, createCloudSourceRegulationV1Input.regulationType) + && Objects.equals(this.subjectType, createCloudSourceRegulationV1Input.subjectType) + && Objects.equals(this.subjectIds, createCloudSourceRegulationV1Input.subjectIds) + && Objects.equals(this.collection, createCloudSourceRegulationV1Input.collection); + } + @Override + public int hashCode() { + return Objects.hash(regulationType, subjectType, subjectIds, collection); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCloudSourceRegulationV1Input {\n"); + sb.append(" regulationType: ").append(toIndentedString(regulationType)).append("\n"); + sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); + sb.append(" subjectIds: ").append(toIndentedString(subjectIds)).append("\n"); + sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input = (CreateCloudSourceRegulationV1Input) o; - return Objects.equals(this.regulationType, createCloudSourceRegulationV1Input.regulationType) && - Objects.equals(this.subjectType, createCloudSourceRegulationV1Input.subjectType) && - Objects.equals(this.subjectIds, createCloudSourceRegulationV1Input.subjectIds) && - Objects.equals(this.collection, createCloudSourceRegulationV1Input.collection); - } - - @Override - public int hashCode() { - return Objects.hash(regulationType, subjectType, subjectIds, collection); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateCloudSourceRegulationV1Input {\n"); - sb.append(" regulationType: ").append(toIndentedString(regulationType)).append("\n"); - sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); - sb.append(" subjectIds: ").append(toIndentedString(subjectIds)).append("\n"); - sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulationType"); + openapiFields.add("subjectType"); + openapiFields.add("subjectIds"); + openapiFields.add("collection"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulationType"); + openapiRequiredFields.add("collection"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulationType"); - openapiFields.add("subjectType"); - openapiFields.add("subjectIds"); - openapiFields.add("collection"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulationType"); - openapiRequiredFields.add("collection"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateCloudSourceRegulationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateCloudSourceRegulationV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateCloudSourceRegulationV1Input is not found in the empty JSON string", CreateCloudSourceRegulationV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateCloudSourceRegulationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateCloudSourceRegulationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateCloudSourceRegulationV1Input is" + + " not found in the empty JSON string", + CreateCloudSourceRegulationV1Input.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateCloudSourceRegulationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCloudSourceRegulationV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateCloudSourceRegulationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateCloudSourceRegulationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateCloudSourceRegulationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateCloudSourceRegulationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("regulationType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regulationType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("regulationType").toString())); + } + if ((jsonObj.get("subjectType") != null && !jsonObj.get("subjectType").isJsonNull()) + && !jsonObj.get("subjectType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subjectType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("subjectType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("subjectIds") != null && !jsonObj.get("subjectIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subjectIds` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("subjectIds").toString())); + } + if (!jsonObj.get("collection").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `collection` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("collection").toString())); } - } - if (!jsonObj.get("regulationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regulationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regulationType").toString())); - } - if ((jsonObj.get("subjectType") != null && !jsonObj.get("subjectType").isJsonNull()) && !jsonObj.get("subjectType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subjectType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subjectType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("subjectIds") != null && !jsonObj.get("subjectIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subjectIds` to be an array in the JSON string but got `%s`", jsonObj.get("subjectIds").toString())); - } - if (!jsonObj.get("collection").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `collection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collection").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateCloudSourceRegulationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateCloudSourceRegulationV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateCloudSourceRegulationV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateCloudSourceRegulationV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateCloudSourceRegulationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateCloudSourceRegulationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateCloudSourceRegulationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateCloudSourceRegulationV1Input - */ - public static CreateCloudSourceRegulationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateCloudSourceRegulationV1Input.class); - } - - /** - * Convert an instance of CreateCloudSourceRegulationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCloudSourceRegulationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCloudSourceRegulationV1Input' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateCloudSourceRegulationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateCloudSourceRegulationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateCloudSourceRegulationV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateCloudSourceRegulationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCloudSourceRegulationV1Input + * @throws IOException if the JSON string is invalid with respect to + * CreateCloudSourceRegulationV1Input + */ + public static CreateCloudSourceRegulationV1Input fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCloudSourceRegulationV1Input.class); + } + + /** + * Convert an instance of CreateCloudSourceRegulationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java index 175d13c7..15ee4f6c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,208 +10,211 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of a create Cloud Source regulation call. - */ +/** The output of a create Cloud Source regulation call. */ @ApiModel(description = "The output of a create Cloud Source regulation call.") - public class CreateCloudSourceRegulationV1Output { - public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; - @SerializedName(SERIALIZED_NAME_REGULATE_ID) - private String regulateId; + public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; - public CreateCloudSourceRegulationV1Output() { - } + @SerializedName(SERIALIZED_NAME_REGULATE_ID) + private String regulateId; - public CreateCloudSourceRegulationV1Output regulateId(String regulateId) { - - this.regulateId = regulateId; - return this; - } + public CreateCloudSourceRegulationV1Output() {} - /** - * The id of the created regulation. - * @return regulateId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the created regulation.") + public CreateCloudSourceRegulationV1Output regulateId(String regulateId) { - public String getRegulateId() { - return regulateId; - } + this.regulateId = regulateId; + return this; + } + /** + * The id of the created regulation. + * + * @return regulateId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the created regulation.") + public String getRegulateId() { + return regulateId; + } - public void setRegulateId(String regulateId) { - this.regulateId = regulateId; - } + public void setRegulateId(String regulateId) { + this.regulateId = regulateId; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCloudSourceRegulationV1Output createCloudSourceRegulationV1Output = + (CreateCloudSourceRegulationV1Output) o; + return Objects.equals(this.regulateId, createCloudSourceRegulationV1Output.regulateId); + } + @Override + public int hashCode() { + return Objects.hash(regulateId); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCloudSourceRegulationV1Output {\n"); + sb.append(" regulateId: ").append(toIndentedString(regulateId)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateCloudSourceRegulationV1Output createCloudSourceRegulationV1Output = (CreateCloudSourceRegulationV1Output) o; - return Objects.equals(this.regulateId, createCloudSourceRegulationV1Output.regulateId); - } - - @Override - public int hashCode() { - return Objects.hash(regulateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateCloudSourceRegulationV1Output {\n"); - sb.append(" regulateId: ").append(toIndentedString(regulateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulateId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulateId"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulateId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulateId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateCloudSourceRegulationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateCloudSourceRegulationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateCloudSourceRegulationV1Output is not found in the empty JSON string", CreateCloudSourceRegulationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateCloudSourceRegulationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateCloudSourceRegulationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateCloudSourceRegulationV1Output is" + + " not found in the empty JSON string", + CreateCloudSourceRegulationV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateCloudSourceRegulationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCloudSourceRegulationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateCloudSourceRegulationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateCloudSourceRegulationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateCloudSourceRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateCloudSourceRegulationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("regulateId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regulateId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("regulateId").toString())); } - } - if (!jsonObj.get("regulateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regulateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regulateId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateCloudSourceRegulationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateCloudSourceRegulationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateCloudSourceRegulationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateCloudSourceRegulationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateCloudSourceRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateCloudSourceRegulationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateCloudSourceRegulationV1Output - * @throws IOException if the JSON string is invalid with respect to CreateCloudSourceRegulationV1Output - */ - public static CreateCloudSourceRegulationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateCloudSourceRegulationV1Output.class); - } - - /** - * Convert an instance of CreateCloudSourceRegulationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCloudSourceRegulationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCloudSourceRegulationV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateCloudSourceRegulationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateCloudSourceRegulationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateCloudSourceRegulationV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateCloudSourceRegulationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCloudSourceRegulationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateCloudSourceRegulationV1Output + */ + public static CreateCloudSourceRegulationV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCloudSourceRegulationV1Output.class); + } + + /** + * Convert an instance of CreateCloudSourceRegulationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java index 6599162c..61c2c2b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,188 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateDestinationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateDestination200Response - */ - +/** CreateDestination200Response */ public class CreateDestination200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateDestinationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateDestination200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateDestinationV1Output data; - public CreateDestination200Response data(CreateDestinationV1Output data) { - - this.data = data; - return this; - } + public CreateDestination200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateDestination200Response data(CreateDestinationV1Output data) { - public CreateDestinationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateDestinationV1Output getData() { + return data; + } - public void setData(CreateDestinationV1Output data) { - this.data = data; - } + public void setData(CreateDestinationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDestination200Response createDestination200Response = + (CreateDestination200Response) o; + return Objects.equals(this.data, createDestination200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDestination200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateDestination200Response createDestination200Response = (CreateDestination200Response) o; - return Objects.equals(this.data, createDestination200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDestination200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestination200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateDestination200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDestination200Response is not found in the empty JSON string", CreateDestination200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateDestination200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDestination200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDestination200Response is not" + + " found in the empty JSON string", + CreateDestination200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateDestination200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDestination200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDestination200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDestination200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDestination200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDestination200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateDestination200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDestination200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDestination200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDestination200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDestination200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDestination200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDestination200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDestination200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDestination200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateDestination200Response + */ + public static CreateDestination200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDestination200Response.class); } - } - - /** - * Create an instance of CreateDestination200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDestination200Response - * @throws IOException if the JSON string is invalid with respect to CreateDestination200Response - */ - public static CreateDestination200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDestination200Response.class); - } - - /** - * Convert an instance of CreateDestination200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateDestination200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java index 9877a221..d996b509 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateDestinationSubscriptionAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateDestinationSubscription200Response - */ - +/** CreateDestinationSubscription200Response */ public class CreateDestinationSubscription200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateDestinationSubscriptionAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateDestinationSubscription200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateDestinationSubscriptionAlphaOutput data; - public CreateDestinationSubscription200Response data(CreateDestinationSubscriptionAlphaOutput data) { - - this.data = data; - return this; - } + public CreateDestinationSubscription200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateDestinationSubscription200Response data( + CreateDestinationSubscriptionAlphaOutput data) { - public CreateDestinationSubscriptionAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateDestinationSubscriptionAlphaOutput getData() { + return data; + } - public void setData(CreateDestinationSubscriptionAlphaOutput data) { - this.data = data; - } + public void setData(CreateDestinationSubscriptionAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDestinationSubscription200Response createDestinationSubscription200Response = + (CreateDestinationSubscription200Response) o; + return Objects.equals(this.data, createDestinationSubscription200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDestinationSubscription200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateDestinationSubscription200Response createDestinationSubscription200Response = (CreateDestinationSubscription200Response) o; - return Objects.equals(this.data, createDestinationSubscription200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDestinationSubscription200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationSubscription200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateDestinationSubscription200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDestinationSubscription200Response is not found in the empty JSON string", CreateDestinationSubscription200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateDestinationSubscription200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDestinationSubscription200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateDestinationSubscription200Response is not found in" + + " the empty JSON string", + CreateDestinationSubscription200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateDestinationSubscription200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDestinationSubscription200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDestinationSubscription200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDestinationSubscription200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDestinationSubscription200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDestinationSubscription200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationSubscription200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDestinationSubscription200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDestinationSubscription200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDestinationSubscription200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'CreateDestinationSubscription200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDestinationSubscription200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateDestinationSubscription200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDestinationSubscription200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDestinationSubscription200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDestinationSubscription200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateDestinationSubscription200Response + */ + public static CreateDestinationSubscription200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDestinationSubscription200Response.class); } - } - - /** - * Create an instance of CreateDestinationSubscription200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDestinationSubscription200Response - * @throws IOException if the JSON string is invalid with respect to CreateDestinationSubscription200Response - */ - public static CreateDestinationSubscription200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDestinationSubscription200Response.class); - } - - /** - * Convert an instance of CreateDestinationSubscription200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateDestinationSubscription200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index 8a6fece9..6fbf273a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,338 +10,369 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * The basic input parameters for creating a Destination subscription. - */ +/** The basic input parameters for creating a Destination subscription. */ @ApiModel(description = "The basic input parameters for creating a Destination subscription.") - public class CreateDestinationSubscriptionAlphaInput { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - @SerializedName(SERIALIZED_NAME_ACTION_ID) - private String actionId; - - public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - @SerializedName(SERIALIZED_NAME_TRIGGER) - private String trigger; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - public CreateDestinationSubscriptionAlphaInput() { - } + @SerializedName(SERIALIZED_NAME_ACTION_ID) + private String actionId; - public CreateDestinationSubscriptionAlphaInput name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - /** - * A user-defined name for the subscription. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A user-defined name for the subscription.") + @SerializedName(SERIALIZED_NAME_TRIGGER) + private String trigger; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public void setName(String name) { - this.name = name; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public CreateDestinationSubscriptionAlphaInput actionId(String actionId) { - - this.actionId = actionId; - return this; - } + public CreateDestinationSubscriptionAlphaInput() {} - /** - * The associated action id the subscription should trigger. - * @return actionId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The associated action id the subscription should trigger.") + public CreateDestinationSubscriptionAlphaInput name(String name) { - public String getActionId() { - return actionId; - } + this.name = name; + return this; + } + /** + * A user-defined name for the subscription. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A user-defined name for the subscription.") + public String getName() { + return name; + } - public void setActionId(String actionId) { - this.actionId = actionId; - } + public void setName(String name) { + this.name = name; + } + public CreateDestinationSubscriptionAlphaInput actionId(String actionId) { - public CreateDestinationSubscriptionAlphaInput trigger(String trigger) { - - this.trigger = trigger; - return this; - } + this.actionId = actionId; + return this; + } - /** - * The FQL statement. - * @return trigger - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The FQL statement.") + /** + * The associated action id the subscription should trigger. + * + * @return actionId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The associated action id the subscription should trigger.") + public String getActionId() { + return actionId; + } - public String getTrigger() { - return trigger; - } + public void setActionId(String actionId) { + this.actionId = actionId; + } + public CreateDestinationSubscriptionAlphaInput trigger(String trigger) { - public void setTrigger(String trigger) { - this.trigger = trigger; - } + this.trigger = trigger; + return this; + } + /** + * The FQL statement. + * + * @return trigger + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The FQL statement.") + public String getTrigger() { + return trigger; + } - public CreateDestinationSubscriptionAlphaInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public void setTrigger(String trigger) { + this.trigger = trigger; + } - /** - * Is the subscription enabled. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Is the subscription enabled.") + public CreateDestinationSubscriptionAlphaInput enabled(Boolean enabled) { - public Boolean getEnabled() { - return enabled; - } + this.enabled = enabled; + return this; + } + /** + * Is the subscription enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Is the subscription enabled.") + public Boolean getEnabled() { + return enabled; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public CreateDestinationSubscriptionAlphaInput settings(Map settings) { - public CreateDestinationSubscriptionAlphaInput settings(Map settings) { - - this.settings = settings; - return this; - } + this.settings = settings; + return this; + } - /** - * The fields used for configuring this action. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fields used for configuring this action.") + /** + * The fields used for configuring this action. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The fields used for configuring this action.") + public Map getSettings() { + return settings; + } - public Map getSettings() { - return settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput = + (CreateDestinationSubscriptionAlphaInput) o; + return Objects.equals(this.name, createDestinationSubscriptionAlphaInput.name) + && Objects.equals(this.actionId, createDestinationSubscriptionAlphaInput.actionId) + && Objects.equals(this.trigger, createDestinationSubscriptionAlphaInput.trigger) + && Objects.equals(this.enabled, createDestinationSubscriptionAlphaInput.enabled) + && Objects.equals(this.settings, createDestinationSubscriptionAlphaInput.settings); + } - public void setSettings(Map settings) { - this.settings = settings; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash(name, actionId, trigger, enabled, settings); + } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDestinationSubscriptionAlphaInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput = (CreateDestinationSubscriptionAlphaInput) o; - return Objects.equals(this.name, createDestinationSubscriptionAlphaInput.name) && - Objects.equals(this.actionId, createDestinationSubscriptionAlphaInput.actionId) && - Objects.equals(this.trigger, createDestinationSubscriptionAlphaInput.trigger) && - Objects.equals(this.enabled, createDestinationSubscriptionAlphaInput.enabled) && - Objects.equals(this.settings, createDestinationSubscriptionAlphaInput.settings); - } - - @Override - public int hashCode() { - return Objects.hash(name, actionId, trigger, enabled, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDestinationSubscriptionAlphaInput {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); - sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("actionId"); + openapiFields.add("trigger"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("actionId"); + openapiRequiredFields.add("trigger"); + openapiRequiredFields.add("enabled"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("actionId"); - openapiFields.add("trigger"); - openapiFields.add("enabled"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("actionId"); - openapiRequiredFields.add("trigger"); - openapiRequiredFields.add("enabled"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationSubscriptionAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateDestinationSubscriptionAlphaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDestinationSubscriptionAlphaInput is not found in the empty JSON string", CreateDestinationSubscriptionAlphaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateDestinationSubscriptionAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDestinationSubscriptionAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateDestinationSubscriptionAlphaInput is not found in the" + + " empty JSON string", + CreateDestinationSubscriptionAlphaInput.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateDestinationSubscriptionAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDestinationSubscriptionAlphaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDestinationSubscriptionAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDestinationSubscriptionAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateDestinationSubscriptionAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDestinationSubscriptionAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("actionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actionId").toString())); + } + if (!jsonObj.get("trigger").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trigger` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("trigger").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDestinationSubscriptionAlphaInput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateDestinationSubscriptionAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDestinationSubscriptionAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateDestinationSubscriptionAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDestinationSubscriptionAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("actionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionId").toString())); - } - if (!jsonObj.get("trigger").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `trigger` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trigger").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDestinationSubscriptionAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDestinationSubscriptionAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationSubscriptionAlphaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDestinationSubscriptionAlphaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDestinationSubscriptionAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateDestinationSubscriptionAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDestinationSubscriptionAlphaInput - * @throws IOException if the JSON string is invalid with respect to CreateDestinationSubscriptionAlphaInput - */ - public static CreateDestinationSubscriptionAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDestinationSubscriptionAlphaInput.class); - } - - /** - * Convert an instance of CreateDestinationSubscriptionAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of CreateDestinationSubscriptionAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDestinationSubscriptionAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateDestinationSubscriptionAlphaInput + */ + public static CreateDestinationSubscriptionAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDestinationSubscriptionAlphaInput.class); + } + + /** + * Convert an instance of CreateDestinationSubscriptionAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java index 4681d4df..9981793c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,214 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationSubscription; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a newly created Destination subscription. - */ +/** Returns a newly created Destination subscription. */ @ApiModel(description = "Returns a newly created Destination subscription.") - public class CreateDestinationSubscriptionAlphaOutput { - public static final String SERIALIZED_NAME_DESTINATION_SUBSCRIPTION = "destinationSubscription"; - @SerializedName(SERIALIZED_NAME_DESTINATION_SUBSCRIPTION) - private DestinationSubscription destinationSubscription; + public static final String SERIALIZED_NAME_DESTINATION_SUBSCRIPTION = "destinationSubscription"; - public CreateDestinationSubscriptionAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_DESTINATION_SUBSCRIPTION) + private DestinationSubscription destinationSubscription; - public CreateDestinationSubscriptionAlphaOutput destinationSubscription(DestinationSubscription destinationSubscription) { - - this.destinationSubscription = destinationSubscription; - return this; - } + public CreateDestinationSubscriptionAlphaOutput() {} - /** - * Get destinationSubscription - * @return destinationSubscription - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateDestinationSubscriptionAlphaOutput destinationSubscription( + DestinationSubscription destinationSubscription) { - public DestinationSubscription getDestinationSubscription() { - return destinationSubscription; - } + this.destinationSubscription = destinationSubscription; + return this; + } + /** + * Get destinationSubscription + * + * @return destinationSubscription + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public DestinationSubscription getDestinationSubscription() { + return destinationSubscription; + } - public void setDestinationSubscription(DestinationSubscription destinationSubscription) { - this.destinationSubscription = destinationSubscription; - } + public void setDestinationSubscription(DestinationSubscription destinationSubscription) { + this.destinationSubscription = destinationSubscription; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDestinationSubscriptionAlphaOutput createDestinationSubscriptionAlphaOutput = + (CreateDestinationSubscriptionAlphaOutput) o; + return Objects.equals( + this.destinationSubscription, + createDestinationSubscriptionAlphaOutput.destinationSubscription); + } + @Override + public int hashCode() { + return Objects.hash(destinationSubscription); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDestinationSubscriptionAlphaOutput {\n"); + sb.append(" destinationSubscription: ") + .append(toIndentedString(destinationSubscription)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateDestinationSubscriptionAlphaOutput createDestinationSubscriptionAlphaOutput = (CreateDestinationSubscriptionAlphaOutput) o; - return Objects.equals(this.destinationSubscription, createDestinationSubscriptionAlphaOutput.destinationSubscription); - } - - @Override - public int hashCode() { - return Objects.hash(destinationSubscription); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDestinationSubscriptionAlphaOutput {\n"); - sb.append(" destinationSubscription: ").append(toIndentedString(destinationSubscription)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("destinationSubscription"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("destinationSubscription"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("destinationSubscription"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("destinationSubscription"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationSubscriptionAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDestinationSubscriptionAlphaOutput is not found in the empty JSON string", CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateDestinationSubscriptionAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateDestinationSubscriptionAlphaOutput is not found in" + + " the empty JSON string", + CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateDestinationSubscriptionAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDestinationSubscriptionAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDestinationSubscriptionAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDestinationSubscriptionAlphaOutput` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDestinationSubscriptionAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDestinationSubscriptionAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationSubscriptionAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDestinationSubscriptionAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDestinationSubscriptionAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDestinationSubscriptionAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'CreateDestinationSubscriptionAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDestinationSubscriptionAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateDestinationSubscriptionAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDestinationSubscriptionAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDestinationSubscriptionAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDestinationSubscriptionAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateDestinationSubscriptionAlphaOutput + */ + public static CreateDestinationSubscriptionAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDestinationSubscriptionAlphaOutput.class); } - } - - /** - * Create an instance of CreateDestinationSubscriptionAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDestinationSubscriptionAlphaOutput - * @throws IOException if the JSON string is invalid with respect to CreateDestinationSubscriptionAlphaOutput - */ - public static CreateDestinationSubscriptionAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDestinationSubscriptionAlphaOutput.class); - } - - /** - * Convert an instance of CreateDestinationSubscriptionAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateDestinationSubscriptionAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java index 9f950dce..7d2163ab 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,343 +10,362 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a new Destination. - */ +/** Creates a new Destination. */ @ApiModel(description = "Creates a new Destination.") - public class CreateDestinationV1Input { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - @SerializedName(SERIALIZED_NAME_METADATA_ID) - private String metadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public CreateDestinationV1Input() { - } + public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - public CreateDestinationV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_METADATA_ID) + private String metadataId; - /** - * The id of the Source to connect to this Destination instance. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source to connect to this Destination instance. Config API note: analogous to `parent`.") - - public String getSourceId() { - return sourceId; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public CreateDestinationV1Input metadataId(String metadataId) { - - this.metadataId = metadataId; - return this; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - /** - * The id of the metadata to link to the new Destination. - * @return metadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the metadata to link to the new Destination.") + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); - public String getMetadataId() { - return metadataId; - } + public CreateDestinationV1Input() {} + public CreateDestinationV1Input sourceId(String sourceId) { - public void setMetadataId(String metadataId) { - this.metadataId = metadataId; - } + this.sourceId = sourceId; + return this; + } + /** + * The id of the Source to connect to this Destination instance. Config API note: analogous to + * `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of the Source to connect to this Destination instance. Config API" + + " note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public CreateDestinationV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - /** - * Whether this Destination should receive data. - * @return enabled - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination should receive data.") + public CreateDestinationV1Input metadataId(String metadataId) { - public Boolean getEnabled() { - return enabled; - } + this.metadataId = metadataId; + return this; + } + /** + * The id of the metadata to link to the new Destination. + * + * @return metadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the metadata to link to the new Destination.") + public String getMetadataId() { + return metadataId; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setMetadataId(String metadataId) { + this.metadataId = metadataId; + } + public CreateDestinationV1Input enabled(Boolean enabled) { - public CreateDestinationV1Input name(String name) { - - this.name = name; - return this; - } + this.enabled = enabled; + return this; + } - /** - * Defines the display name of the Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Defines the display name of the Destination. Config API note: equal to `displayName`.") + /** + * Whether this Destination should receive data. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination should receive data.") + public Boolean getEnabled() { + return enabled; + } - public String getName() { - return name; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public CreateDestinationV1Input name(String name) { - public void setName(String name) { - this.name = name; - } + this.name = name; + return this; + } + /** + * Defines the display name of the Destination. Config API note: equal to + * `displayName`. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Defines the display name of the Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } - public CreateDestinationV1Input settings(Map settings) { - - this.settings = settings; - return this; - } + public void setName(String name) { + this.name = name; + } - public CreateDestinationV1Input putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } + public CreateDestinationV1Input settings(Map settings) { - /** - * An object that contains settings for the Destination based on the \"required\" and \"advanced\" settings present in the Destination metadata. Config API note: equal to `config`. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An object that contains settings for the Destination based on the \"required\" and \"advanced\" settings present in the Destination metadata. Config API note: equal to `config`.") + this.settings = settings; + return this; + } - public Map getSettings() { - return settings; - } + public CreateDestinationV1Input putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + /** + * An object that contains settings for the Destination based on the \"required\" and + * \"advanced\" settings present in the Destination metadata. Config API note: equal + * to `config`. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for the Destination based on the \"required\"" + + " and \"advanced\" settings present in the Destination metadata. Config" + + " API note: equal to `config`.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDestinationV1Input createDestinationV1Input = (CreateDestinationV1Input) o; + return Objects.equals(this.sourceId, createDestinationV1Input.sourceId) + && Objects.equals(this.metadataId, createDestinationV1Input.metadataId) + && Objects.equals(this.enabled, createDestinationV1Input.enabled) + && Objects.equals(this.name, createDestinationV1Input.name) + && Objects.equals(this.settings, createDestinationV1Input.settings); + } + @Override + public int hashCode() { + return Objects.hash(sourceId, metadataId, enabled, name, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDestinationV1Input {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateDestinationV1Input createDestinationV1Input = (CreateDestinationV1Input) o; - return Objects.equals(this.sourceId, createDestinationV1Input.sourceId) && - Objects.equals(this.metadataId, createDestinationV1Input.metadataId) && - Objects.equals(this.enabled, createDestinationV1Input.enabled) && - Objects.equals(this.name, createDestinationV1Input.name) && - Objects.equals(this.settings, createDestinationV1Input.settings); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId, metadataId, enabled, name, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDestinationV1Input {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + openapiFields.add("metadataId"); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("metadataId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - openapiFields.add("metadataId"); - openapiFields.add("enabled"); - openapiFields.add("name"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("metadataId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateDestinationV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDestinationV1Input is not found in the empty JSON string", CreateDestinationV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateDestinationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDestinationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDestinationV1Input is not found" + + " in the empty JSON string", + CreateDestinationV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateDestinationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDestinationV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDestinationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDestinationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateDestinationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDestinationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("metadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metadataId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metadataId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); } - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("metadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadataId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDestinationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDestinationV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDestinationV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDestinationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateDestinationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDestinationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateDestinationV1Input - */ - public static CreateDestinationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDestinationV1Input.class); - } - - /** - * Convert an instance of CreateDestinationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDestinationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDestinationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDestinationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDestinationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDestinationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDestinationV1Input + * @throws IOException if the JSON string is invalid with respect to CreateDestinationV1Input + */ + public static CreateDestinationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDestinationV1Input.class); + } + + /** + * Convert an instance of CreateDestinationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java index ad32f479..23f751b2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Destination2; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a new Destination. - */ +/** Creates a new Destination. */ @ApiModel(description = "Creates a new Destination.") - public class CreateDestinationV1Output { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - @SerializedName(SERIALIZED_NAME_DESTINATION) - private Destination2 destination; + public static final String SERIALIZED_NAME_DESTINATION = "destination"; - public CreateDestinationV1Output() { - } + @SerializedName(SERIALIZED_NAME_DESTINATION) + private Destination2 destination; - public CreateDestinationV1Output destination(Destination2 destination) { - - this.destination = destination; - return this; - } + public CreateDestinationV1Output() {} - /** - * Get destination - * @return destination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateDestinationV1Output destination(Destination2 destination) { - public Destination2 getDestination() { - return destination; - } + this.destination = destination; + return this; + } + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Destination2 getDestination() { + return destination; + } - public void setDestination(Destination2 destination) { - this.destination = destination; - } + public void setDestination(Destination2 destination) { + this.destination = destination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDestinationV1Output createDestinationV1Output = (CreateDestinationV1Output) o; + return Objects.equals(this.destination, createDestinationV1Output.destination); + } + @Override + public int hashCode() { + return Objects.hash(destination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDestinationV1Output {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateDestinationV1Output createDestinationV1Output = (CreateDestinationV1Output) o; - return Objects.equals(this.destination, createDestinationV1Output.destination); - } - - @Override - public int hashCode() { - return Objects.hash(destination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDestinationV1Output {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("destination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("destination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("destination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("destination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateDestinationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDestinationV1Output is not found in the empty JSON string", CreateDestinationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateDestinationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDestinationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDestinationV1Output is not found" + + " in the empty JSON string", + CreateDestinationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateDestinationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDestinationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDestinationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDestinationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDestinationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDestinationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDestinationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDestinationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDestinationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDestinationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateDestinationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDestinationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDestinationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDestinationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDestinationV1Output + * @throws IOException if the JSON string is invalid with respect to CreateDestinationV1Output + */ + public static CreateDestinationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDestinationV1Output.class); } - } - - /** - * Create an instance of CreateDestinationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDestinationV1Output - * @throws IOException if the JSON string is invalid with respect to CreateDestinationV1Output - */ - public static CreateDestinationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDestinationV1Output.class); - } - - /** - * Convert an instance of CreateDestinationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateDestinationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java index 46338e3e..86d552c8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateEdgeFunctionsAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateEdgeFunctions200Response - */ - +/** CreateEdgeFunctions200Response */ public class CreateEdgeFunctions200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateEdgeFunctionsAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateEdgeFunctions200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateEdgeFunctionsAlphaOutput data; - public CreateEdgeFunctions200Response data(CreateEdgeFunctionsAlphaOutput data) { - - this.data = data; - return this; - } + public CreateEdgeFunctions200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateEdgeFunctions200Response data(CreateEdgeFunctionsAlphaOutput data) { - public CreateEdgeFunctionsAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateEdgeFunctionsAlphaOutput getData() { + return data; + } - public void setData(CreateEdgeFunctionsAlphaOutput data) { - this.data = data; - } + public void setData(CreateEdgeFunctionsAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeFunctions200Response createEdgeFunctions200Response = + (CreateEdgeFunctions200Response) o; + return Objects.equals(this.data, createEdgeFunctions200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeFunctions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateEdgeFunctions200Response createEdgeFunctions200Response = (CreateEdgeFunctions200Response) o; - return Objects.equals(this.data, createEdgeFunctions200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEdgeFunctions200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateEdgeFunctions200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateEdgeFunctions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeFunctions200Response is not found in the empty JSON string", CreateEdgeFunctions200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateEdgeFunctions200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateEdgeFunctions200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateEdgeFunctions200Response is not" + + " found in the empty JSON string", + CreateEdgeFunctions200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeFunctions200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateEdgeFunctions200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateEdgeFunctions200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeFunctions200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateEdgeFunctions200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeFunctions200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateEdgeFunctions200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeFunctions200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeFunctions200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeFunctions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeFunctions200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateEdgeFunctions200Response + */ + public static CreateEdgeFunctions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeFunctions200Response.class); } - } - - /** - * Create an instance of CreateEdgeFunctions200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateEdgeFunctions200Response - * @throws IOException if the JSON string is invalid with respect to CreateEdgeFunctions200Response - */ - public static CreateEdgeFunctions200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateEdgeFunctions200Response.class); - } - - /** - * Convert an instance of CreateEdgeFunctions200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateEdgeFunctions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java index 8d1345d1..89a9adaf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,208 +10,211 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Input for CreateEdgeFunctions. - */ +/** Input for CreateEdgeFunctions. */ @ApiModel(description = "Input for CreateEdgeFunctions.") - public class CreateEdgeFunctionsAlphaInput { - public static final String SERIALIZED_NAME_UPLOAD_U_R_L = "uploadURL"; - @SerializedName(SERIALIZED_NAME_UPLOAD_U_R_L) - private String uploadURL; + public static final String SERIALIZED_NAME_UPLOAD_U_R_L = "uploadURL"; - public CreateEdgeFunctionsAlphaInput() { - } + @SerializedName(SERIALIZED_NAME_UPLOAD_U_R_L) + private String uploadURL; - public CreateEdgeFunctionsAlphaInput uploadURL(String uploadURL) { - - this.uploadURL = uploadURL; - return this; - } + public CreateEdgeFunctionsAlphaInput() {} - /** - * The id of the Source associated with this Edge Function. - * @return uploadURL - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this Edge Function.") + public CreateEdgeFunctionsAlphaInput uploadURL(String uploadURL) { - public String getUploadURL() { - return uploadURL; - } + this.uploadURL = uploadURL; + return this; + } + /** + * The id of the Source associated with this Edge Function. + * + * @return uploadURL + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Source associated with this Edge Function.") + public String getUploadURL() { + return uploadURL; + } - public void setUploadURL(String uploadURL) { - this.uploadURL = uploadURL; - } + public void setUploadURL(String uploadURL) { + this.uploadURL = uploadURL; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput = + (CreateEdgeFunctionsAlphaInput) o; + return Objects.equals(this.uploadURL, createEdgeFunctionsAlphaInput.uploadURL); + } + @Override + public int hashCode() { + return Objects.hash(uploadURL); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeFunctionsAlphaInput {\n"); + sb.append(" uploadURL: ").append(toIndentedString(uploadURL)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput = (CreateEdgeFunctionsAlphaInput) o; - return Objects.equals(this.uploadURL, createEdgeFunctionsAlphaInput.uploadURL); - } - - @Override - public int hashCode() { - return Objects.hash(uploadURL); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEdgeFunctionsAlphaInput {\n"); - sb.append(" uploadURL: ").append(toIndentedString(uploadURL)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uploadURL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("uploadURL"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("uploadURL"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("uploadURL"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateEdgeFunctionsAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateEdgeFunctionsAlphaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeFunctionsAlphaInput is not found in the empty JSON string", CreateEdgeFunctionsAlphaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateEdgeFunctionsAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateEdgeFunctionsAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateEdgeFunctionsAlphaInput is not" + + " found in the empty JSON string", + CreateEdgeFunctionsAlphaInput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateEdgeFunctionsAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeFunctionsAlphaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateEdgeFunctionsAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateEdgeFunctionsAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateEdgeFunctionsAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEdgeFunctionsAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("uploadURL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `uploadURL` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("uploadURL").toString())); } - } - if (!jsonObj.get("uploadURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `uploadURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateEdgeFunctionsAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateEdgeFunctionsAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeFunctionsAlphaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateEdgeFunctionsAlphaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateEdgeFunctionsAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateEdgeFunctionsAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateEdgeFunctionsAlphaInput - * @throws IOException if the JSON string is invalid with respect to CreateEdgeFunctionsAlphaInput - */ - public static CreateEdgeFunctionsAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateEdgeFunctionsAlphaInput.class); - } - - /** - * Convert an instance of CreateEdgeFunctionsAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeFunctionsAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeFunctionsAlphaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateEdgeFunctionsAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeFunctionsAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeFunctionsAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeFunctionsAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeFunctionsAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateEdgeFunctionsAlphaInput + */ + public static CreateEdgeFunctionsAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeFunctionsAlphaInput.class); + } + + /** + * Convert an instance of CreateEdgeFunctionsAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java index f3b3f9ea..1ed058da 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,202 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.EdgeFunctions; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Output for CreateEdgeFunctions. - */ +/** Output for CreateEdgeFunctions. */ @ApiModel(description = "Output for CreateEdgeFunctions.") - public class CreateEdgeFunctionsAlphaOutput { - public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; - @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) - private EdgeFunctions edgeFunctions; + public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; - public CreateEdgeFunctionsAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) + private EdgeFunctions edgeFunctions; - public CreateEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions edgeFunctions) { - - this.edgeFunctions = edgeFunctions; - return this; - } + public CreateEdgeFunctionsAlphaOutput() {} - /** - * Get edgeFunctions - * @return edgeFunctions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions edgeFunctions) { - public EdgeFunctions getEdgeFunctions() { - return edgeFunctions; - } + this.edgeFunctions = edgeFunctions; + return this; + } + /** + * Get edgeFunctions + * + * @return edgeFunctions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public EdgeFunctions getEdgeFunctions() { + return edgeFunctions; + } - public void setEdgeFunctions(EdgeFunctions edgeFunctions) { - this.edgeFunctions = edgeFunctions; - } + public void setEdgeFunctions(EdgeFunctions edgeFunctions) { + this.edgeFunctions = edgeFunctions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeFunctionsAlphaOutput createEdgeFunctionsAlphaOutput = + (CreateEdgeFunctionsAlphaOutput) o; + return Objects.equals(this.edgeFunctions, createEdgeFunctionsAlphaOutput.edgeFunctions); + } + @Override + public int hashCode() { + return Objects.hash(edgeFunctions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeFunctionsAlphaOutput {\n"); + sb.append(" edgeFunctions: ").append(toIndentedString(edgeFunctions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateEdgeFunctionsAlphaOutput createEdgeFunctionsAlphaOutput = (CreateEdgeFunctionsAlphaOutput) o; - return Objects.equals(this.edgeFunctions, createEdgeFunctionsAlphaOutput.edgeFunctions); - } - - @Override - public int hashCode() { - return Objects.hash(edgeFunctions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateEdgeFunctionsAlphaOutput {\n"); - sb.append(" edgeFunctions: ").append(toIndentedString(edgeFunctions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("edgeFunctions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("edgeFunctions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("edgeFunctions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("edgeFunctions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateEdgeFunctionsAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateEdgeFunctionsAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeFunctionsAlphaOutput is not found in the empty JSON string", CreateEdgeFunctionsAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateEdgeFunctionsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateEdgeFunctionsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateEdgeFunctionsAlphaOutput is not" + + " found in the empty JSON string", + CreateEdgeFunctionsAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeFunctionsAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateEdgeFunctionsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEdgeFunctionsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateEdgeFunctionsAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeFunctionsAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateEdgeFunctionsAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeFunctionsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateEdgeFunctionsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeFunctionsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeFunctionsAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeFunctionsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeFunctionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateEdgeFunctionsAlphaOutput + */ + public static CreateEdgeFunctionsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeFunctionsAlphaOutput.class); } - } - - /** - * Create an instance of CreateEdgeFunctionsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateEdgeFunctionsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to CreateEdgeFunctionsAlphaOutput - */ - public static CreateEdgeFunctionsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateEdgeFunctionsAlphaOutput.class); - } - - /** - * Convert an instance of CreateEdgeFunctionsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateEdgeFunctionsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java index 816d2203..75c95647 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateFilterForDestinationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateFilterForDestination200Response - */ - +/** CreateFilterForDestination200Response */ public class CreateFilterForDestination200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateFilterForDestinationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateFilterForDestination200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateFilterForDestinationV1Output data; - public CreateFilterForDestination200Response data(CreateFilterForDestinationV1Output data) { - - this.data = data; - return this; - } + public CreateFilterForDestination200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateFilterForDestination200Response data(CreateFilterForDestinationV1Output data) { - public CreateFilterForDestinationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateFilterForDestinationV1Output getData() { + return data; + } - public void setData(CreateFilterForDestinationV1Output data) { - this.data = data; - } + public void setData(CreateFilterForDestinationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilterForDestination200Response createFilterForDestination200Response = + (CreateFilterForDestination200Response) o; + return Objects.equals(this.data, createFilterForDestination200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilterForDestination200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFilterForDestination200Response createFilterForDestination200Response = (CreateFilterForDestination200Response) o; - return Objects.equals(this.data, createFilterForDestination200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFilterForDestination200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFilterForDestination200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFilterForDestination200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFilterForDestination200Response is not found in the empty JSON string", CreateFilterForDestination200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateFilterForDestination200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFilterForDestination200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFilterForDestination200Response" + + " is not found in the empty JSON string", + CreateFilterForDestination200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFilterForDestination200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFilterForDestination200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFilterForDestination200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFilterForDestination200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFilterForDestination200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFilterForDestination200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFilterForDestination200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFilterForDestination200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFilterForDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFilterForDestination200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterForDestination200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateFilterForDestination200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateFilterForDestination200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFilterForDestination200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFilterForDestination200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFilterForDestination200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateFilterForDestination200Response + */ + public static CreateFilterForDestination200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterForDestination200Response.class); } - } - - /** - * Create an instance of CreateFilterForDestination200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFilterForDestination200Response - * @throws IOException if the JSON string is invalid with respect to CreateFilterForDestination200Response - */ - public static CreateFilterForDestination200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFilterForDestination200Response.class); - } - - /** - * Convert an instance of CreateFilterForDestination200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateFilterForDestination200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index 64ce9512..b3b85ac1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,383 +10,401 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationFilterActionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Input for CreateDestinationFilterV1. - */ +/** Input for CreateDestinationFilterV1. */ @ApiModel(description = "Input for CreateDestinationFilterV1.") - public class CreateFilterForDestinationV1Input { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TITLE = "title"; - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_IF = "if"; - public CreateFilterForDestinationV1Input() { - } + @SerializedName(SERIALIZED_NAME_IF) + private String _if; - public CreateFilterForDestinationV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - /** - * The id of the Source associated with this filter. - * @return sourceId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Source associated with this filter.") - - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); + public static final String SERIALIZED_NAME_TITLE = "title"; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public CreateFilterForDestinationV1Input _if(String _if) { - - this._if = _if; - return this; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - /** - * The filter's condition. - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The filter's condition.") + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public String getIf() { - return _if; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + public CreateFilterForDestinationV1Input() {} - public void setIf(String _if) { - this._if = _if; - } + public CreateFilterForDestinationV1Input sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public CreateFilterForDestinationV1Input actions(List actions) { - - this.actions = actions; - return this; - } - - public CreateFilterForDestinationV1Input addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + /** + * The id of the Source associated with this filter. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The id of the Source associated with this filter.") + public String getSourceId() { + return sourceId; + } - /** - * Actions for the Destination filter. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Actions for the Destination filter.") + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public List getActions() { - return actions; - } + public CreateFilterForDestinationV1Input _if(String _if) { + this._if = _if; + return this; + } - public void setActions(List actions) { - this.actions = actions; - } + /** + * The filter's condition. + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The filter's condition.") + public String getIf() { + return _if; + } + public void setIf(String _if) { + this._if = _if; + } - public CreateFilterForDestinationV1Input title(String title) { - - this.title = title; - return this; - } + public CreateFilterForDestinationV1Input actions(List actions) { - /** - * The title of the filter. - * @return title - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The title of the filter.") + this.actions = actions; + return this; + } - public String getTitle() { - return title; - } + public CreateFilterForDestinationV1Input addActionsItem(DestinationFilterActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } + /** + * Actions for the Destination filter. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Actions for the Destination filter.") + public List getActions() { + return actions; + } - public void setTitle(String title) { - this.title = title; - } + public void setActions(List actions) { + this.actions = actions; + } + public CreateFilterForDestinationV1Input title(String title) { - public CreateFilterForDestinationV1Input description(String description) { - - this.description = description; - return this; - } + this.title = title; + return this; + } - /** - * The description of the filter. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The description of the filter.") + /** + * The title of the filter. + * + * @return title + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The title of the filter.") + public String getTitle() { + return title; + } - public String getDescription() { - return description; - } + public void setTitle(String title) { + this.title = title; + } + public CreateFilterForDestinationV1Input description(String description) { - public void setDescription(String description) { - this.description = description; - } + this.description = description; + return this; + } + /** + * The description of the filter. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The description of the filter.") + public String getDescription() { + return description; + } - public CreateFilterForDestinationV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public void setDescription(String description) { + this.description = description; + } - /** - * When set to true, the Destination filter is active. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, the Destination filter is active.") + public CreateFilterForDestinationV1Input enabled(Boolean enabled) { - public Boolean getEnabled() { - return enabled; - } + this.enabled = enabled; + return this; + } + /** + * When set to true, the Destination filter is active. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "When set to true, the Destination filter is active.") + public Boolean getEnabled() { + return enabled; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilterForDestinationV1Input createFilterForDestinationV1Input = + (CreateFilterForDestinationV1Input) o; + return Objects.equals(this.sourceId, createFilterForDestinationV1Input.sourceId) + && Objects.equals(this._if, createFilterForDestinationV1Input._if) + && Objects.equals(this.actions, createFilterForDestinationV1Input.actions) + && Objects.equals(this.title, createFilterForDestinationV1Input.title) + && Objects.equals(this.description, createFilterForDestinationV1Input.description) + && Objects.equals(this.enabled, createFilterForDestinationV1Input.enabled); + } + @Override + public int hashCode() { + return Objects.hash(sourceId, _if, actions, title, description, enabled); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilterForDestinationV1Input {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFilterForDestinationV1Input createFilterForDestinationV1Input = (CreateFilterForDestinationV1Input) o; - return Objects.equals(this.sourceId, createFilterForDestinationV1Input.sourceId) && - Objects.equals(this._if, createFilterForDestinationV1Input._if) && - Objects.equals(this.actions, createFilterForDestinationV1Input.actions) && - Objects.equals(this.title, createFilterForDestinationV1Input.title) && - Objects.equals(this.description, createFilterForDestinationV1Input.description) && - Objects.equals(this.enabled, createFilterForDestinationV1Input.enabled); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId, _if, actions, title, description, enabled); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFilterForDestinationV1Input {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + openapiFields.add("if"); + openapiFields.add("actions"); + openapiFields.add("title"); + openapiFields.add("description"); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("if"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("enabled"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("enabled"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFilterForDestinationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFilterForDestinationV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFilterForDestinationV1Input is not found in the empty JSON string", CreateFilterForDestinationV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateFilterForDestinationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFilterForDestinationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFilterForDestinationV1Input is" + + " not found in the empty JSON string", + CreateFilterForDestinationV1Input.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFilterForDestinationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFilterForDestinationV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFilterForDestinationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFilterForDestinationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFilterForDestinationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFilterForDestinationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) + && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `title` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("title").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFilterForDestinationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterForDestinationV1Input' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateFilterForDestinationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFilterForDestinationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFilterForDestinationV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) && !jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFilterForDestinationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFilterForDestinationV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFilterForDestinationV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFilterForDestinationV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFilterForDestinationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateFilterForDestinationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFilterForDestinationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateFilterForDestinationV1Input - */ - public static CreateFilterForDestinationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFilterForDestinationV1Input.class); - } - - /** - * Convert an instance of CreateFilterForDestinationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of CreateFilterForDestinationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFilterForDestinationV1Input + * @throws IOException if the JSON string is invalid with respect to + * CreateFilterForDestinationV1Input + */ + public static CreateFilterForDestinationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterForDestinationV1Input.class); + } + + /** + * Convert an instance of CreateFilterForDestinationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java index 94977b50..1101d177 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,204 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Filter2; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Output for CreateDestinationFiltersV1. - */ +/** Output for CreateDestinationFiltersV1. */ @ApiModel(description = "Output for CreateDestinationFiltersV1.") - public class CreateFilterForDestinationV1Output { - public static final String SERIALIZED_NAME_FILTER = "filter"; - @SerializedName(SERIALIZED_NAME_FILTER) - private Filter2 filter; + public static final String SERIALIZED_NAME_FILTER = "filter"; - public CreateFilterForDestinationV1Output() { - } + @SerializedName(SERIALIZED_NAME_FILTER) + private Filter2 filter; - public CreateFilterForDestinationV1Output filter(Filter2 filter) { - - this.filter = filter; - return this; - } + public CreateFilterForDestinationV1Output() {} - /** - * Get filter - * @return filter - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateFilterForDestinationV1Output filter(Filter2 filter) { - public Filter2 getFilter() { - return filter; - } + this.filter = filter; + return this; + } + /** + * Get filter + * + * @return filter + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Filter2 getFilter() { + return filter; + } - public void setFilter(Filter2 filter) { - this.filter = filter; - } + public void setFilter(Filter2 filter) { + this.filter = filter; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilterForDestinationV1Output createFilterForDestinationV1Output = + (CreateFilterForDestinationV1Output) o; + return Objects.equals(this.filter, createFilterForDestinationV1Output.filter); + } + @Override + public int hashCode() { + return Objects.hash(filter); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilterForDestinationV1Output {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFilterForDestinationV1Output createFilterForDestinationV1Output = (CreateFilterForDestinationV1Output) o; - return Objects.equals(this.filter, createFilterForDestinationV1Output.filter); - } - - @Override - public int hashCode() { - return Objects.hash(filter); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFilterForDestinationV1Output {\n"); - sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filter"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filter"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filter"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFilterForDestinationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFilterForDestinationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFilterForDestinationV1Output is not found in the empty JSON string", CreateFilterForDestinationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateFilterForDestinationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFilterForDestinationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFilterForDestinationV1Output is" + + " not found in the empty JSON string", + CreateFilterForDestinationV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFilterForDestinationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFilterForDestinationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFilterForDestinationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFilterForDestinationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFilterForDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFilterForDestinationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFilterForDestinationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFilterForDestinationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFilterForDestinationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFilterForDestinationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFilterForDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFilterForDestinationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterForDestinationV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateFilterForDestinationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFilterForDestinationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFilterForDestinationV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFilterForDestinationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFilterForDestinationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateFilterForDestinationV1Output + */ + public static CreateFilterForDestinationV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterForDestinationV1Output.class); } - } - - /** - * Create an instance of CreateFilterForDestinationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFilterForDestinationV1Output - * @throws IOException if the JSON string is invalid with respect to CreateFilterForDestinationV1Output - */ - public static CreateFilterForDestinationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFilterForDestinationV1Output.class); - } - - /** - * Convert an instance of CreateFilterForDestinationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateFilterForDestinationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java index 334720d5..6ef412c2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateFunctionV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateFunction200Response - */ - +/** CreateFunction200Response */ public class CreateFunction200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateFunctionV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateFunction200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateFunctionV1Output data; - public CreateFunction200Response data(CreateFunctionV1Output data) { - - this.data = data; - return this; - } + public CreateFunction200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateFunction200Response data(CreateFunctionV1Output data) { - public CreateFunctionV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateFunctionV1Output getData() { + return data; + } - public void setData(CreateFunctionV1Output data) { - this.data = data; - } + public void setData(CreateFunctionV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFunction200Response createFunction200Response = (CreateFunction200Response) o; + return Objects.equals(this.data, createFunction200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFunction200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFunction200Response createFunction200Response = (CreateFunction200Response) o; - return Objects.equals(this.data, createFunction200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFunction200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunction200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFunction200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFunction200Response is not found in the empty JSON string", CreateFunction200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateFunction200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFunction200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFunction200Response is not found" + + " in the empty JSON string", + CreateFunction200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFunction200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFunction200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFunction200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFunction200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFunction200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFunction200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFunction200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFunction200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFunction200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFunction200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFunction200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFunction200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFunction200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFunction200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFunction200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFunction200Response + * @throws IOException if the JSON string is invalid with respect to CreateFunction200Response + */ + public static CreateFunction200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFunction200Response.class); } - } - - /** - * Create an instance of CreateFunction200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFunction200Response - * @throws IOException if the JSON string is invalid with respect to CreateFunction200Response - */ - public static CreateFunction200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFunction200Response.class); - } - - /** - * Convert an instance of CreateFunction200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateFunction200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java index 4547cf1a..9934d7a3 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,191 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateFunctionDeploymentV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateFunctionDeployment200Response - */ - +/** CreateFunctionDeployment200Response */ public class CreateFunctionDeployment200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateFunctionDeploymentV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateFunctionDeployment200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateFunctionDeploymentV1Output data; - public CreateFunctionDeployment200Response data(CreateFunctionDeploymentV1Output data) { - - this.data = data; - return this; - } + public CreateFunctionDeployment200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateFunctionDeployment200Response data(CreateFunctionDeploymentV1Output data) { - public CreateFunctionDeploymentV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateFunctionDeploymentV1Output getData() { + return data; + } - public void setData(CreateFunctionDeploymentV1Output data) { - this.data = data; - } + public void setData(CreateFunctionDeploymentV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFunctionDeployment200Response createFunctionDeployment200Response = + (CreateFunctionDeployment200Response) o; + return Objects.equals(this.data, createFunctionDeployment200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFunctionDeployment200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFunctionDeployment200Response createFunctionDeployment200Response = (CreateFunctionDeployment200Response) o; - return Objects.equals(this.data, createFunctionDeployment200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFunctionDeployment200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunctionDeployment200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFunctionDeployment200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFunctionDeployment200Response is not found in the empty JSON string", CreateFunctionDeployment200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateFunctionDeployment200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFunctionDeployment200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFunctionDeployment200Response is" + + " not found in the empty JSON string", + CreateFunctionDeployment200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFunctionDeployment200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFunctionDeployment200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFunctionDeployment200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFunctionDeployment200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFunctionDeployment200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFunctionDeployment200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFunctionDeployment200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFunctionDeployment200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFunctionDeployment200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFunctionDeployment200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFunctionDeployment200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateFunctionDeployment200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFunctionDeployment200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFunctionDeployment200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFunctionDeployment200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFunctionDeployment200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateFunctionDeployment200Response + */ + public static CreateFunctionDeployment200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFunctionDeployment200Response.class); } - } - - /** - * Create an instance of CreateFunctionDeployment200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFunctionDeployment200Response - * @throws IOException if the JSON string is invalid with respect to CreateFunctionDeployment200Response - */ - public static CreateFunctionDeployment200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFunctionDeployment200Response.class); - } - - /** - * Convert an instance of CreateFunctionDeployment200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateFunctionDeployment200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java index ebcd2358..3c80d404 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,206 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.FunctionDeployment; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Updates the deployment for a Source Function instance. - */ +/** Updates the deployment for a Source Function instance. */ @ApiModel(description = "Updates the deployment for a Source Function instance.") - public class CreateFunctionDeploymentV1Output { - public static final String SERIALIZED_NAME_FUNCTION_DEPLOYMENT = "functionDeployment"; - @SerializedName(SERIALIZED_NAME_FUNCTION_DEPLOYMENT) - private FunctionDeployment functionDeployment; + public static final String SERIALIZED_NAME_FUNCTION_DEPLOYMENT = "functionDeployment"; - public CreateFunctionDeploymentV1Output() { - } + @SerializedName(SERIALIZED_NAME_FUNCTION_DEPLOYMENT) + private FunctionDeployment functionDeployment; - public CreateFunctionDeploymentV1Output functionDeployment(FunctionDeployment functionDeployment) { - - this.functionDeployment = functionDeployment; - return this; - } + public CreateFunctionDeploymentV1Output() {} - /** - * Get functionDeployment - * @return functionDeployment - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateFunctionDeploymentV1Output functionDeployment( + FunctionDeployment functionDeployment) { - public FunctionDeployment getFunctionDeployment() { - return functionDeployment; - } + this.functionDeployment = functionDeployment; + return this; + } + /** + * Get functionDeployment + * + * @return functionDeployment + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public FunctionDeployment getFunctionDeployment() { + return functionDeployment; + } - public void setFunctionDeployment(FunctionDeployment functionDeployment) { - this.functionDeployment = functionDeployment; - } + public void setFunctionDeployment(FunctionDeployment functionDeployment) { + this.functionDeployment = functionDeployment; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFunctionDeploymentV1Output createFunctionDeploymentV1Output = + (CreateFunctionDeploymentV1Output) o; + return Objects.equals( + this.functionDeployment, createFunctionDeploymentV1Output.functionDeployment); + } + @Override + public int hashCode() { + return Objects.hash(functionDeployment); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFunctionDeploymentV1Output {\n"); + sb.append(" functionDeployment: ") + .append(toIndentedString(functionDeployment)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFunctionDeploymentV1Output createFunctionDeploymentV1Output = (CreateFunctionDeploymentV1Output) o; - return Objects.equals(this.functionDeployment, createFunctionDeploymentV1Output.functionDeployment); - } - - @Override - public int hashCode() { - return Objects.hash(functionDeployment); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFunctionDeploymentV1Output {\n"); - sb.append(" functionDeployment: ").append(toIndentedString(functionDeployment)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("functionDeployment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("functionDeployment"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("functionDeployment"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("functionDeployment"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunctionDeploymentV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFunctionDeploymentV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFunctionDeploymentV1Output is not found in the empty JSON string", CreateFunctionDeploymentV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateFunctionDeploymentV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFunctionDeploymentV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFunctionDeploymentV1Output is" + + " not found in the empty JSON string", + CreateFunctionDeploymentV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFunctionDeploymentV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFunctionDeploymentV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFunctionDeploymentV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFunctionDeploymentV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFunctionDeploymentV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFunctionDeploymentV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFunctionDeploymentV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFunctionDeploymentV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFunctionDeploymentV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFunctionDeploymentV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFunctionDeploymentV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFunctionDeploymentV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFunctionDeploymentV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateFunctionDeploymentV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFunctionDeploymentV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFunctionDeploymentV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFunctionDeploymentV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFunctionDeploymentV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateFunctionDeploymentV1Output + */ + public static CreateFunctionDeploymentV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFunctionDeploymentV1Output.class); } - } - - /** - * Create an instance of CreateFunctionDeploymentV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFunctionDeploymentV1Output - * @throws IOException if the JSON string is invalid with respect to CreateFunctionDeploymentV1Output - */ - public static CreateFunctionDeploymentV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFunctionDeploymentV1Output.class); - } - - /** - * Convert an instance of CreateFunctionDeploymentV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateFunctionDeploymentV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 762824af..49f961a5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,439 +10,458 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.FunctionSettingV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a Function. - */ +/** Creates a Function. */ @ApiModel(description = "Creates a Function.") - public class CreateFunctionV1Input { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; - - /** - * The Function type. Config API note: equal to `type`. - */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - SOURCE("SOURCE"); - - private String value; - - ResourceTypeEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_CODE = "code"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_CODE) + private String code; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = null; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - public CreateFunctionV1Input() { - } + @SerializedName(SERIALIZED_NAME_LOGO_URL) + private String logoUrl; - public CreateFunctionV1Input code(String code) { - - this.code = code; - return this; - } + /** The Function type. Config API note: equal to `type`. */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + DESTINATION("DESTINATION"), - /** - * The Function code. - * @return code - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Function code.") + SOURCE("SOURCE"); - public String getCode() { - return code; - } + private String value; + ResourceTypeEnum(String value) { + this.value = value; + } - public void setCode(String code) { - this.code = code; - } + public String getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } - public CreateFunctionV1Input settings(List settings) { - - this.settings = settings; - return this; - } + public static ResourceTypeEnum fromValue(String value) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public CreateFunctionV1Input addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(value); + } + } } - this.settings.add(settingsItem); - return this; - } - /** - * The list of settings for this Function. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - public List getSettings() { - return settings; - } + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private ResourceTypeEnum resourceType; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public void setSettings(List settings) { - this.settings = settings; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public CreateFunctionV1Input() {} - public CreateFunctionV1Input displayName(String displayName) { - - this.displayName = displayName; - return this; - } + public CreateFunctionV1Input code(String code) { - /** - * A display name for this Function. Note that Destination Functions append the Workspace to the display name. - * @return displayName - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A display name for this Function. Note that Destination Functions append the Workspace to the display name.") + this.code = code; + return this; + } - public String getDisplayName() { - return displayName; - } + /** + * The Function code. + * + * @return code + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Function code.") + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } - public void setDisplayName(String displayName) { - this.displayName = displayName; - } + public CreateFunctionV1Input settings(List settings) { + this.settings = settings; + return this; + } - public CreateFunctionV1Input logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } + public CreateFunctionV1Input addSettingsItem(FunctionSettingV1 settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } - /** - * The URL of the logo for this Function. - * @return logoUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") + /** + * The list of settings for this Function. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of settings for this Function.") + public List getSettings() { + return settings; + } - public String getLogoUrl() { - return logoUrl; - } + public void setSettings(List settings) { + this.settings = settings; + } + public CreateFunctionV1Input displayName(String displayName) { - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } + this.displayName = displayName; + return this; + } + /** + * A display name for this Function. Note that Destination Functions append the Workspace to the + * display name. + * + * @return displayName + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "A display name for this Function. Note that Destination Functions append the" + + " Workspace to the display name.") + public String getDisplayName() { + return displayName; + } - public CreateFunctionV1Input resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } + public void setDisplayName(String displayName) { + this.displayName = displayName; + } - /** - * The Function type. Config API note: equal to `type`. - * @return resourceType - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Function type. Config API note: equal to `type`.") + public CreateFunctionV1Input logoUrl(String logoUrl) { - public ResourceTypeEnum getResourceType() { - return resourceType; - } + this.logoUrl = logoUrl; + return this; + } + /** + * The URL of the logo for this Function. + * + * @return logoUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL of the logo for this Function.") + public String getLogoUrl() { + return logoUrl; + } - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + public CreateFunctionV1Input resourceType(ResourceTypeEnum resourceType) { - public CreateFunctionV1Input description(String description) { - - this.description = description; - return this; - } + this.resourceType = resourceType; + return this; + } - /** - * A description for this Function. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") + /** + * The Function type. Config API note: equal to `type`. + * + * @return resourceType + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Function type. Config API note: equal to `type`.") + public ResourceTypeEnum getResourceType() { + return resourceType; + } - public String getDescription() { - return description; - } + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + public CreateFunctionV1Input description(String description) { - public void setDescription(String description) { - this.description = description; - } + this.description = description; + return this; + } + + /** + * A description for this Function. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this Function.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFunctionV1Input createFunctionV1Input = (CreateFunctionV1Input) o; + return Objects.equals(this.code, createFunctionV1Input.code) + && Objects.equals(this.settings, createFunctionV1Input.settings) + && Objects.equals(this.displayName, createFunctionV1Input.displayName) + && Objects.equals(this.logoUrl, createFunctionV1Input.logoUrl) + && Objects.equals(this.resourceType, createFunctionV1Input.resourceType) + && Objects.equals(this.description, createFunctionV1Input.description); + } + @Override + public int hashCode() { + return Objects.hash(code, settings, displayName, logoUrl, resourceType, description); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFunctionV1Input {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFunctionV1Input createFunctionV1Input = (CreateFunctionV1Input) o; - return Objects.equals(this.code, createFunctionV1Input.code) && - Objects.equals(this.settings, createFunctionV1Input.settings) && - Objects.equals(this.displayName, createFunctionV1Input.displayName) && - Objects.equals(this.logoUrl, createFunctionV1Input.logoUrl) && - Objects.equals(this.resourceType, createFunctionV1Input.resourceType) && - Objects.equals(this.description, createFunctionV1Input.description); - } - - @Override - public int hashCode() { - return Objects.hash(code, settings, displayName, logoUrl, resourceType, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFunctionV1Input {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("settings"); + openapiFields.add("displayName"); + openapiFields.add("logoUrl"); + openapiFields.add("resourceType"); + openapiFields.add("description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("displayName"); + openapiRequiredFields.add("resourceType"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("logoUrl"); - openapiFields.add("resourceType"); - openapiFields.add("description"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("code"); - openapiRequiredFields.add("displayName"); - openapiRequiredFields.add("resourceType"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunctionV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFunctionV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFunctionV1Input is not found in the empty JSON string", CreateFunctionV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateFunctionV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFunctionV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFunctionV1Input is not found in" + + " the empty JSON string", + CreateFunctionV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFunctionV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFunctionV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFunctionV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFunctionV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFunctionV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFunctionV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); - } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `settings` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("settings").toString())); + } + } + } + if (!jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `displayName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if (!jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); } - } - if (!jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoUrl").toString())); - } - if (!jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFunctionV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFunctionV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFunctionV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFunctionV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFunctionV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateFunctionV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFunctionV1Input - * @throws IOException if the JSON string is invalid with respect to CreateFunctionV1Input - */ - public static CreateFunctionV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFunctionV1Input.class); - } - - /** - * Convert an instance of CreateFunctionV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFunctionV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFunctionV1Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFunctionV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFunctionV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFunctionV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFunctionV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFunctionV1Input + * @throws IOException if the JSON string is invalid with respect to CreateFunctionV1Input + */ + public static CreateFunctionV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFunctionV1Input.class); + } + + /** + * Convert an instance of CreateFunctionV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java index b26e70f3..5c3c6767 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Function1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Create a Function. - */ +/** Create a Function. */ @ApiModel(description = "Create a Function.") - public class CreateFunctionV1Output { - public static final String SERIALIZED_NAME_FUNCTION = "function"; - @SerializedName(SERIALIZED_NAME_FUNCTION) - private Function1 function; + public static final String SERIALIZED_NAME_FUNCTION = "function"; - public CreateFunctionV1Output() { - } + @SerializedName(SERIALIZED_NAME_FUNCTION) + private Function1 function; - public CreateFunctionV1Output function(Function1 function) { - - this.function = function; - return this; - } + public CreateFunctionV1Output() {} - /** - * Get function - * @return function - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateFunctionV1Output function(Function1 function) { - public Function1 getFunction() { - return function; - } + this.function = function; + return this; + } + /** + * Get function + * + * @return function + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Function1 getFunction() { + return function; + } - public void setFunction(Function1 function) { - this.function = function; - } + public void setFunction(Function1 function) { + this.function = function; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFunctionV1Output createFunctionV1Output = (CreateFunctionV1Output) o; + return Objects.equals(this.function, createFunctionV1Output.function); + } + @Override + public int hashCode() { + return Objects.hash(function); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFunctionV1Output {\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateFunctionV1Output createFunctionV1Output = (CreateFunctionV1Output) o; - return Objects.equals(this.function, createFunctionV1Output.function); - } - - @Override - public int hashCode() { - return Objects.hash(function); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateFunctionV1Output {\n"); - sb.append(" function: ").append(toIndentedString(function)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("function"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("function"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("function"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("function"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunctionV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateFunctionV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateFunctionV1Output is not found in the empty JSON string", CreateFunctionV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateFunctionV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateFunctionV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFunctionV1Output is not found in" + + " the empty JSON string", + CreateFunctionV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateFunctionV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateFunctionV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateFunctionV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFunctionV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFunctionV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFunctionV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFunctionV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFunctionV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateFunctionV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateFunctionV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateFunctionV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFunctionV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFunctionV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFunctionV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFunctionV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFunctionV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFunctionV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFunctionV1Output + * @throws IOException if the JSON string is invalid with respect to CreateFunctionV1Output + */ + public static CreateFunctionV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFunctionV1Output.class); } - } - - /** - * Create an instance of CreateFunctionV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateFunctionV1Output - * @throws IOException if the JSON string is invalid with respect to CreateFunctionV1Output - */ - public static CreateFunctionV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFunctionV1Output.class); - } - - /** - * Convert an instance of CreateFunctionV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateFunctionV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java index c8c3a9b6..6760324e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateInvitesV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateInvites200Response - */ - +/** CreateInvites200Response */ public class CreateInvites200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateInvitesV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateInvites200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateInvitesV1Output data; - public CreateInvites200Response data(CreateInvitesV1Output data) { - - this.data = data; - return this; - } + public CreateInvites200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateInvites200Response data(CreateInvitesV1Output data) { - public CreateInvitesV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateInvitesV1Output getData() { + return data; + } - public void setData(CreateInvitesV1Output data) { - this.data = data; - } + public void setData(CreateInvitesV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInvites200Response createInvites200Response = (CreateInvites200Response) o; + return Objects.equals(this.data, createInvites200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInvites200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateInvites200Response createInvites200Response = (CreateInvites200Response) o; - return Objects.equals(this.data, createInvites200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateInvites200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateInvites200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateInvites200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInvites200Response is not found in the empty JSON string", CreateInvites200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateInvites200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInvites200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateInvites200Response is not found" + + " in the empty JSON string", + CreateInvites200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateInvites200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInvites200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInvites200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInvites200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateInvites200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateInvites200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateInvites200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateInvites200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateInvites200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInvites200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInvites200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateInvites200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateInvites200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInvites200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInvites200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInvites200Response + * @throws IOException if the JSON string is invalid with respect to CreateInvites200Response + */ + public static CreateInvites200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInvites200Response.class); } - } - - /** - * Create an instance of CreateInvites200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateInvites200Response - * @throws IOException if the JSON string is invalid with respect to CreateInvites200Response - */ - public static CreateInvites200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateInvites200Response.class); - } - - /** - * Convert an instance of CreateInvites200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateInvites200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java index 50136e91..5f1c280d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,214 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.InviteV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Invites a user to a Workspace with specified permissions. - */ +/** Invites a user to a Workspace with specified permissions. */ @ApiModel(description = "Invites a user to a Workspace with specified permissions.") - public class CreateInvitesV1Input { - public static final String SERIALIZED_NAME_INVITES = "invites"; - @SerializedName(SERIALIZED_NAME_INVITES) - private List invites = new ArrayList<>(); + public static final String SERIALIZED_NAME_INVITES = "invites"; - public CreateInvitesV1Input() { - } + @SerializedName(SERIALIZED_NAME_INVITES) + private List invites = new ArrayList<>(); - public CreateInvitesV1Input invites(List invites) { - - this.invites = invites; - return this; - } + public CreateInvitesV1Input() {} - public CreateInvitesV1Input addInvitesItem(InviteV1 invitesItem) { - this.invites.add(invitesItem); - return this; - } + public CreateInvitesV1Input invites(List invites) { - /** - * The list of invites. - * @return invites - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of invites.") + this.invites = invites; + return this; + } - public List getInvites() { - return invites; - } + public CreateInvitesV1Input addInvitesItem(InviteV1 invitesItem) { + this.invites.add(invitesItem); + return this; + } + /** + * The list of invites. + * + * @return invites + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The list of invites.") + public List getInvites() { + return invites; + } - public void setInvites(List invites) { - this.invites = invites; - } + public void setInvites(List invites) { + this.invites = invites; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInvitesV1Input createInvitesV1Input = (CreateInvitesV1Input) o; + return Objects.equals(this.invites, createInvitesV1Input.invites); + } + @Override + public int hashCode() { + return Objects.hash(invites); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInvitesV1Input {\n"); + sb.append(" invites: ").append(toIndentedString(invites)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateInvitesV1Input createInvitesV1Input = (CreateInvitesV1Input) o; - return Objects.equals(this.invites, createInvitesV1Input.invites); - } - - @Override - public int hashCode() { - return Objects.hash(invites); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateInvitesV1Input {\n"); - sb.append(" invites: ").append(toIndentedString(invites)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("invites"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("invites"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("invites"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("invites"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateInvitesV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateInvitesV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInvitesV1Input is not found in the empty JSON string", CreateInvitesV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateInvitesV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInvitesV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateInvitesV1Input is not found in" + + " the empty JSON string", + CreateInvitesV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateInvitesV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInvitesV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInvitesV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInvitesV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateInvitesV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInvitesV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("invites").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `invites` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("invites").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("invites").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `invites` to be an array in the JSON string but got `%s`", jsonObj.get("invites").toString())); - } - JsonArray jsonArrayinvites = jsonObj.getAsJsonArray("invites"); - } + JsonArray jsonArrayinvites = jsonObj.getAsJsonArray("invites"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateInvitesV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateInvitesV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateInvitesV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateInvitesV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateInvitesV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInvitesV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInvitesV1Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateInvitesV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateInvitesV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInvitesV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInvitesV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInvitesV1Input + * @throws IOException if the JSON string is invalid with respect to CreateInvitesV1Input + */ + public static CreateInvitesV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInvitesV1Input.class); } - } - - /** - * Create an instance of CreateInvitesV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateInvitesV1Input - * @throws IOException if the JSON string is invalid with respect to CreateInvitesV1Input - */ - public static CreateInvitesV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateInvitesV1Input.class); - } - - /** - * Convert an instance of CreateInvitesV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateInvitesV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java index b1179726..c173fb9d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,218 +10,215 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the emails of the invited users. - */ +/** Returns the emails of the invited users. */ @ApiModel(description = "Returns the emails of the invited users.") - public class CreateInvitesV1Output { - public static final String SERIALIZED_NAME_EMAILS = "emails"; - @SerializedName(SERIALIZED_NAME_EMAILS) - private List emails = new ArrayList<>(); + public static final String SERIALIZED_NAME_EMAILS = "emails"; - public CreateInvitesV1Output() { - } + @SerializedName(SERIALIZED_NAME_EMAILS) + private List emails = new ArrayList<>(); - public CreateInvitesV1Output emails(List emails) { - - this.emails = emails; - return this; - } + public CreateInvitesV1Output() {} - public CreateInvitesV1Output addEmailsItem(String emailsItem) { - this.emails.add(emailsItem); - return this; - } + public CreateInvitesV1Output emails(List emails) { - /** - * The list of emails invited to the Workspace. - * @return emails - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of emails invited to the Workspace.") + this.emails = emails; + return this; + } - public List getEmails() { - return emails; - } + public CreateInvitesV1Output addEmailsItem(String emailsItem) { + this.emails.add(emailsItem); + return this; + } + /** + * The list of emails invited to the Workspace. + * + * @return emails + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The list of emails invited to the Workspace.") + public List getEmails() { + return emails; + } - public void setEmails(List emails) { - this.emails = emails; - } + public void setEmails(List emails) { + this.emails = emails; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInvitesV1Output createInvitesV1Output = (CreateInvitesV1Output) o; + return Objects.equals(this.emails, createInvitesV1Output.emails); + } + @Override + public int hashCode() { + return Objects.hash(emails); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInvitesV1Output {\n"); + sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateInvitesV1Output createInvitesV1Output = (CreateInvitesV1Output) o; - return Objects.equals(this.emails, createInvitesV1Output.emails); - } - - @Override - public int hashCode() { - return Objects.hash(emails); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateInvitesV1Output {\n"); - sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emails"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emails"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emails"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emails"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateInvitesV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateInvitesV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateInvitesV1Output is not found in the empty JSON string", CreateInvitesV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateInvitesV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInvitesV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateInvitesV1Output is not found in" + + " the empty JSON string", + CreateInvitesV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateInvitesV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateInvitesV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInvitesV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInvitesV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateInvitesV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInvitesV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("emails") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `emails` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("emails").toString())); } - } - // ensure the required json array is present - if (jsonObj.get("emails") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateInvitesV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateInvitesV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateInvitesV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateInvitesV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateInvitesV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateInvitesV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateInvitesV1Output - * @throws IOException if the JSON string is invalid with respect to CreateInvitesV1Output - */ - public static CreateInvitesV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateInvitesV1Output.class); - } - - /** - * Convert an instance of CreateInvitesV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInvitesV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInvitesV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateInvitesV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateInvitesV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInvitesV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInvitesV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInvitesV1Output + * @throws IOException if the JSON string is invalid with respect to CreateInvitesV1Output + */ + public static CreateInvitesV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInvitesV1Output.class); + } + + /** + * Convert an instance of CreateInvitesV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java index 0cc9033f..d71b8d08 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateLabelAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateLabel200Response - */ - +/** CreateLabel200Response */ public class CreateLabel200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateLabelAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateLabel200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateLabelV1Output data; - public CreateLabel200Response data(CreateLabelAlphaOutput data) { - - this.data = data; - return this; - } + public CreateLabel200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateLabel200Response data(CreateLabelV1Output data) { - public CreateLabelAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateLabelV1Output getData() { + return data; + } - public void setData(CreateLabelAlphaOutput data) { - this.data = data; - } + public void setData(CreateLabelV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLabel200Response createLabel200Response = (CreateLabel200Response) o; + return Objects.equals(this.data, createLabel200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateLabel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateLabel200Response createLabel200Response = (CreateLabel200Response) o; - return Objects.equals(this.data, createLabel200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabel200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabel200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabel200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateLabel200Response is not found in the empty JSON string", CreateLabel200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateLabel200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateLabel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateLabel200Response is not found in" + + " the empty JSON string", + CreateLabel200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabel200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateLabel200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateLabel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateLabel200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabel200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabel200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateLabel200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabel200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateLabel200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateLabel200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateLabel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateLabel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateLabel200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateLabel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateLabel200Response + * @throws IOException if the JSON string is invalid with respect to CreateLabel200Response + */ + public static CreateLabel200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateLabel200Response.class); } - } - - /** - * Create an instance of CreateLabel200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabel200Response - * @throws IOException if the JSON string is invalid with respect to CreateLabel200Response - */ - public static CreateLabel200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabel200Response.class); - } - - /** - * Convert an instance of CreateLabel200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateLabel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java index 374dee80..e64d84f8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateLabelV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateLabel200Response1 - */ - +/** CreateLabel200Response1 */ public class CreateLabel200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateLabelV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateLabel200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateLabelAlphaOutput data; - public CreateLabel200Response1 data(CreateLabelV1Output data) { - - this.data = data; - return this; - } + public CreateLabel200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateLabel200Response1 data(CreateLabelAlphaOutput data) { - public CreateLabelV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateLabelAlphaOutput getData() { + return data; + } - public void setData(CreateLabelV1Output data) { - this.data = data; - } + public void setData(CreateLabelAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLabel200Response1 createLabel200Response1 = (CreateLabel200Response1) o; + return Objects.equals(this.data, createLabel200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateLabel200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateLabel200Response1 createLabel200Response1 = (CreateLabel200Response1) o; - return Objects.equals(this.data, createLabel200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabel200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabel200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabel200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateLabel200Response1 is not found in the empty JSON string", CreateLabel200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateLabel200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateLabel200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateLabel200Response1 is not found" + + " in the empty JSON string", + CreateLabel200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabel200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateLabel200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateLabel200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateLabel200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabel200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabel200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateLabel200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabel200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabel200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateLabel200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateLabel200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateLabel200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateLabel200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateLabel200Response1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateLabel200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateLabel200Response1 + * @throws IOException if the JSON string is invalid with respect to CreateLabel200Response1 + */ + public static CreateLabel200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateLabel200Response1.class); } - } - - /** - * Create an instance of CreateLabel200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabel200Response1 - * @throws IOException if the JSON string is invalid with respect to CreateLabel200Response1 - */ - public static CreateLabel200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabel200Response1.class); - } - - /** - * Convert an instance of CreateLabel200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateLabel200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java index 655c4954..1139acbe 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Label; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a new label in the current Workspace. - */ +/** Creates a new label in the current Workspace. */ @ApiModel(description = "Creates a new label in the current Workspace.") - public class CreateLabelAlphaInput { - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private Label label; + public static final String SERIALIZED_NAME_LABEL = "label"; - public CreateLabelAlphaInput() { - } + @SerializedName(SERIALIZED_NAME_LABEL) + private Label label; - public CreateLabelAlphaInput label(Label label) { - - this.label = label; - return this; - } + public CreateLabelAlphaInput() {} - /** - * Get label - * @return label - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateLabelAlphaInput label(Label label) { - public Label getLabel() { - return label; - } + this.label = label; + return this; + } + /** + * Get label + * + * @return label + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Label getLabel() { + return label; + } - public void setLabel(Label label) { - this.label = label; - } + public void setLabel(Label label) { + this.label = label; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLabelAlphaInput createLabelAlphaInput = (CreateLabelAlphaInput) o; + return Objects.equals(this.label, createLabelAlphaInput.label); + } + @Override + public int hashCode() { + return Objects.hash(label); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateLabelAlphaInput {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateLabelAlphaInput createLabelAlphaInput = (CreateLabelAlphaInput) o; - return Objects.equals(this.label, createLabelAlphaInput.label); - } - - @Override - public int hashCode() { - return Objects.hash(label); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabelAlphaInput {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("label"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("label"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("label"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("label"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabelAlphaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateLabelAlphaInput is not found in the empty JSON string", CreateLabelAlphaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateLabelAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateLabelAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateLabelAlphaInput is not found in" + + " the empty JSON string", + CreateLabelAlphaInput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabelAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateLabelAlphaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateLabelAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateLabelAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateLabelAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateLabelAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabelAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabelAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateLabelAlphaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabelAlphaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabelAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateLabelAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateLabelAlphaInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateLabelAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateLabelAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateLabelAlphaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateLabelAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateLabelAlphaInput + * @throws IOException if the JSON string is invalid with respect to CreateLabelAlphaInput + */ + public static CreateLabelAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateLabelAlphaInput.class); } - } - - /** - * Create an instance of CreateLabelAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabelAlphaInput - * @throws IOException if the JSON string is invalid with respect to CreateLabelAlphaInput - */ - public static CreateLabelAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabelAlphaInput.class); - } - - /** - * Convert an instance of CreateLabelAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateLabelAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java index e1b3f994..6de301bd 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,219 +10,214 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.LabelAlpha; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Result of creating a new label in the current Workspace. - */ +/** Result of creating a new label in the current Workspace. */ @ApiModel(description = "Result of creating a new label in the current Workspace.") - public class CreateLabelAlphaOutput { - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = new ArrayList<>(); + public static final String SERIALIZED_NAME_LABELS = "labels"; - public CreateLabelAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_LABELS) + private List labels = new ArrayList<>(); - public CreateLabelAlphaOutput labels(List labels) { - - this.labels = labels; - return this; - } + public CreateLabelAlphaOutput() {} - public CreateLabelAlphaOutput addLabelsItem(LabelAlpha labelsItem) { - this.labels.add(labelsItem); - return this; - } + public CreateLabelAlphaOutput labels(List labels) { - /** - * All labels associated with the current Workspace. - * @return labels - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All labels associated with the current Workspace.") + this.labels = labels; + return this; + } - public List getLabels() { - return labels; - } + public CreateLabelAlphaOutput addLabelsItem(LabelAlpha labelsItem) { + this.labels.add(labelsItem); + return this; + } + /** + * All labels associated with the current Workspace. + * + * @return labels + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "All labels associated with the current Workspace.") + public List getLabels() { + return labels; + } - public void setLabels(List labels) { - this.labels = labels; - } + public void setLabels(List labels) { + this.labels = labels; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLabelAlphaOutput createLabelAlphaOutput = (CreateLabelAlphaOutput) o; + return Objects.equals(this.labels, createLabelAlphaOutput.labels); + } + @Override + public int hashCode() { + return Objects.hash(labels); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateLabelAlphaOutput {\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateLabelAlphaOutput createLabelAlphaOutput = (CreateLabelAlphaOutput) o; - return Objects.equals(this.labels, createLabelAlphaOutput.labels); - } - - @Override - public int hashCode() { - return Objects.hash(labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabelAlphaOutput {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("labels"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("labels"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("labels"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabelAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateLabelAlphaOutput is not found in the empty JSON string", CreateLabelAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateLabelAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateLabelAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateLabelAlphaOutput is not found in" + + " the empty JSON string", + CreateLabelAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabelAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateLabelAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateLabelAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateLabelAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateLabelAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateLabelAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("labels").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `labels` to be an array in the JSON string but got `%s`", jsonObj.get("labels").toString())); - } - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - } + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabelAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabelAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateLabelAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabelAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabelAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateLabelAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateLabelAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateLabelAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateLabelAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateLabelAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateLabelAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateLabelAlphaOutput + * @throws IOException if the JSON string is invalid with respect to CreateLabelAlphaOutput + */ + public static CreateLabelAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateLabelAlphaOutput.class); } - } - - /** - * Create an instance of CreateLabelAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabelAlphaOutput - * @throws IOException if the JSON string is invalid with respect to CreateLabelAlphaOutput - */ - public static CreateLabelAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabelAlphaOutput.class); - } - - /** - * Convert an instance of CreateLabelAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateLabelAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index 7238fdab..77b39b39 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Label1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a new label in the current Workspace. - */ +/** Creates a new label in the current Workspace. */ @ApiModel(description = "Creates a new label in the current Workspace.") - public class CreateLabelV1Input { - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private Label1 label; + public static final String SERIALIZED_NAME_LABEL = "label"; - public CreateLabelV1Input() { - } + @SerializedName(SERIALIZED_NAME_LABEL) + private Label1 label; - public CreateLabelV1Input label(Label1 label) { - - this.label = label; - return this; - } + public CreateLabelV1Input() {} - /** - * Get label - * @return label - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateLabelV1Input label(Label1 label) { - public Label1 getLabel() { - return label; - } + this.label = label; + return this; + } + /** + * Get label + * + * @return label + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Label1 getLabel() { + return label; + } - public void setLabel(Label1 label) { - this.label = label; - } + public void setLabel(Label1 label) { + this.label = label; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLabelV1Input createLabelV1Input = (CreateLabelV1Input) o; + return Objects.equals(this.label, createLabelV1Input.label); + } + @Override + public int hashCode() { + return Objects.hash(label); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateLabelV1Input {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateLabelV1Input createLabelV1Input = (CreateLabelV1Input) o; - return Objects.equals(this.label, createLabelV1Input.label); - } - - @Override - public int hashCode() { - return Objects.hash(label); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabelV1Input {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("label"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("label"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("label"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("label"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabelV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateLabelV1Input is not found in the empty JSON string", CreateLabelV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateLabelV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateLabelV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateLabelV1Input is not found in the" + + " empty JSON string", + CreateLabelV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabelV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateLabelV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateLabelV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateLabelV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateLabelV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateLabelV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabelV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabelV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateLabelV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabelV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabelV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateLabelV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateLabelV1Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateLabelV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateLabelV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateLabelV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateLabelV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateLabelV1Input + * @throws IOException if the JSON string is invalid with respect to CreateLabelV1Input + */ + public static CreateLabelV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateLabelV1Input.class); } - } - - /** - * Create an instance of CreateLabelV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabelV1Input - * @throws IOException if the JSON string is invalid with respect to CreateLabelV1Input - */ - public static CreateLabelV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabelV1Input.class); - } - - /** - * Convert an instance of CreateLabelV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateLabelV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index b9b5ba78..3213637c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Label2; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Result of creating a new label in the current Workspace. - */ +/** Result of creating a new label in the current Workspace. */ @ApiModel(description = "Result of creating a new label in the current Workspace.") - public class CreateLabelV1Output { - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private Label2 label; + public static final String SERIALIZED_NAME_LABEL = "label"; - public CreateLabelV1Output() { - } + @SerializedName(SERIALIZED_NAME_LABEL) + private Label2 label; - public CreateLabelV1Output label(Label2 label) { - - this.label = label; - return this; - } + public CreateLabelV1Output() {} - /** - * Get label - * @return label - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateLabelV1Output label(Label2 label) { - public Label2 getLabel() { - return label; - } + this.label = label; + return this; + } + /** + * Get label + * + * @return label + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Label2 getLabel() { + return label; + } - public void setLabel(Label2 label) { - this.label = label; - } + public void setLabel(Label2 label) { + this.label = label; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateLabelV1Output createLabelV1Output = (CreateLabelV1Output) o; + return Objects.equals(this.label, createLabelV1Output.label); + } + @Override + public int hashCode() { + return Objects.hash(label); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateLabelV1Output {\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateLabelV1Output createLabelV1Output = (CreateLabelV1Output) o; - return Objects.equals(this.label, createLabelV1Output.label); - } - - @Override - public int hashCode() { - return Objects.hash(label); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabelV1Output {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("label"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("label"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("label"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("label"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabelV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateLabelV1Output is not found in the empty JSON string", CreateLabelV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateLabelV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateLabelV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateLabelV1Output is not found in" + + " the empty JSON string", + CreateLabelV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabelV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateLabelV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateLabelV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateLabelV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateLabelV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateLabelV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabelV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabelV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateLabelV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabelV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabelV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateLabelV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateLabelV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateLabelV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateLabelV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateLabelV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateLabelV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateLabelV1Output + * @throws IOException if the JSON string is invalid with respect to CreateLabelV1Output + */ + public static CreateLabelV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateLabelV1Output.class); } - } - - /** - * Create an instance of CreateLabelV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabelV1Output - * @throws IOException if the JSON string is invalid with respect to CreateLabelV1Output - */ - public static CreateLabelV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabelV1Output.class); - } - - /** - * Convert an instance of CreateLabelV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateLabelV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java index f8b36225..e3814147 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateSourceAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateSource200Response - */ - +/** CreateSource200Response */ public class CreateSource200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateSourceAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateSource200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateSourceV1Output data; - public CreateSource200Response data(CreateSourceAlphaOutput data) { - - this.data = data; - return this; - } + public CreateSource200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateSource200Response data(CreateSourceV1Output data) { - public CreateSourceAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateSourceV1Output getData() { + return data; + } - public void setData(CreateSourceAlphaOutput data) { - this.data = data; - } + public void setData(CreateSourceV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSource200Response createSource200Response = (CreateSource200Response) o; + return Objects.equals(this.data, createSource200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSource200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSource200Response createSource200Response = (CreateSource200Response) o; - return Objects.equals(this.data, createSource200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSource200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSource200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSource200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSource200Response is not found in the empty JSON string", CreateSource200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateSource200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSource200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSource200Response is not found" + + " in the empty JSON string", + CreateSource200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSource200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSource200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSource200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSource200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSource200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSource200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSource200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSource200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSource200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSource200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSource200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSource200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSource200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSource200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSource200Response + * @throws IOException if the JSON string is invalid with respect to CreateSource200Response + */ + public static CreateSource200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSource200Response.class); } - } - - /** - * Create an instance of CreateSource200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSource200Response - * @throws IOException if the JSON string is invalid with respect to CreateSource200Response - */ - public static CreateSource200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSource200Response.class); - } - - /** - * Convert an instance of CreateSource200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateSource200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java index 0901aa0a..78461580 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateSourceV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateSource200Response1 - */ - +/** CreateSource200Response1 */ public class CreateSource200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateSourceV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateSource200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateSourceAlphaOutput data; - public CreateSource200Response1 data(CreateSourceV1Output data) { - - this.data = data; - return this; - } + public CreateSource200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateSource200Response1 data(CreateSourceAlphaOutput data) { - public CreateSourceV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateSourceAlphaOutput getData() { + return data; + } - public void setData(CreateSourceV1Output data) { - this.data = data; - } + public void setData(CreateSourceAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSource200Response1 createSource200Response1 = (CreateSource200Response1) o; + return Objects.equals(this.data, createSource200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSource200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSource200Response1 createSource200Response1 = (CreateSource200Response1) o; - return Objects.equals(this.data, createSource200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSource200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSource200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSource200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSource200Response1 is not found in the empty JSON string", CreateSource200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateSource200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSource200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSource200Response1 is not found" + + " in the empty JSON string", + CreateSource200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSource200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSource200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSource200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSource200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSource200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSource200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSource200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSource200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSource200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSource200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSource200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSource200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSource200Response1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSource200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSource200Response1 + * @throws IOException if the JSON string is invalid with respect to CreateSource200Response1 + */ + public static CreateSource200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSource200Response1.class); } - } - - /** - * Create an instance of CreateSource200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSource200Response1 - * @throws IOException if the JSON string is invalid with respect to CreateSource200Response1 - */ - public static CreateSource200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSource200Response1.class); - } - - /** - * Convert an instance of CreateSource200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateSource200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java index 4d620872..822b86d2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,337 +10,365 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * Create a new Source based on a set of parameters. - */ +/** Create a new Source based on a set of parameters. */ @ApiModel(description = "Create a new Source based on a set of parameters.") - public class CreateSourceAlphaInput { - public static final String SERIALIZED_NAME_SLUG = "slug"; - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_SLUG = "slug"; - public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - @SerializedName(SERIALIZED_NAME_METADATA_ID) - private String metadataId; + @SerializedName(SERIALIZED_NAME_SLUG) + private String slug; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public CreateSourceAlphaInput() { - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public CreateSourceAlphaInput slug(String slug) { - - this.slug = slug; - return this; - } + public static final String SERIALIZED_NAME_NAME = "name"; - /** - * The slug by which to identify the Source in the Segment app. - * @return slug - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The slug by which to identify the Source in the Segment app.") + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public String getSlug() { - return slug; - } + public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; + @SerializedName(SERIALIZED_NAME_METADATA_ID) + private String metadataId; - public void setSlug(String slug) { - this.slug = slug; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public CreateSourceAlphaInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public CreateSourceAlphaInput() {} - /** - * Enable to allow this Source to send data. Defaults to true. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enable to allow this Source to send data. Defaults to true.") + public CreateSourceAlphaInput slug(String slug) { - public Boolean getEnabled() { - return enabled; - } + this.slug = slug; + return this; + } + /** + * The slug by which to identify the Source in the Segment app. + * + * @return slug + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The slug by which to identify the Source in the Segment app.") + public String getSlug() { + return slug; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setSlug(String slug) { + this.slug = slug; + } + public CreateSourceAlphaInput enabled(Boolean enabled) { - public CreateSourceAlphaInput name(String name) { - - this.name = name; - return this; - } + this.enabled = enabled; + return this; + } - /** - * An optional human-readable name for this Source. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional human-readable name for this Source.") + /** + * Enable to allow this Source to send data. Defaults to true. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Enable to allow this Source to send data. Defaults to true.") + public Boolean getEnabled() { + return enabled; + } - public String getName() { - return name; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public CreateSourceAlphaInput name(String name) { - public void setName(String name) { - this.name = name; - } + this.name = name; + return this; + } + /** + * An optional human-readable name for this Source. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional human-readable name for this Source.") + public String getName() { + return name; + } - public CreateSourceAlphaInput metadataId(String metadataId) { - - this.metadataId = metadataId; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * The id of the Source metadata from which this instance of the Source derives. All Source metadata is available under `/catalog/sources`. - * @return metadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source metadata from which this instance of the Source derives. All Source metadata is available under `/catalog/sources`.") + public CreateSourceAlphaInput metadataId(String metadataId) { - public String getMetadataId() { - return metadataId; - } + this.metadataId = metadataId; + return this; + } + /** + * The id of the Source metadata from which this instance of the Source derives. All Source + * metadata is available under `/catalog/sources`. + * + * @return metadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of the Source metadata from which this instance of the Source derives. " + + " All Source metadata is available under `/catalog/sources`.") + public String getMetadataId() { + return metadataId; + } - public void setMetadataId(String metadataId) { - this.metadataId = metadataId; - } + public void setMetadataId(String metadataId) { + this.metadataId = metadataId; + } + public CreateSourceAlphaInput settings(Map settings) { - public CreateSourceAlphaInput settings(Map settings) { - - this.settings = settings; - return this; - } + this.settings = settings; + return this; + } - /** - * A key-value object that contains instance-specific settings for the Source. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A key-value object that contains instance-specific settings for the Source.") + /** + * A key-value object that contains instance-specific settings for the Source. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "A key-value object that contains instance-specific settings for the Source.") + public Map getSettings() { + return settings; + } - public Map getSettings() { - return settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSourceAlphaInput createSourceAlphaInput = (CreateSourceAlphaInput) o; + return Objects.equals(this.slug, createSourceAlphaInput.slug) + && Objects.equals(this.enabled, createSourceAlphaInput.enabled) + && Objects.equals(this.name, createSourceAlphaInput.name) + && Objects.equals(this.metadataId, createSourceAlphaInput.metadataId) + && Objects.equals(this.settings, createSourceAlphaInput.settings); + } - public void setSettings(Map settings) { - this.settings = settings; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash(slug, enabled, name, metadataId, settings); + } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceAlphaInput {\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSourceAlphaInput createSourceAlphaInput = (CreateSourceAlphaInput) o; - return Objects.equals(this.slug, createSourceAlphaInput.slug) && - Objects.equals(this.enabled, createSourceAlphaInput.enabled) && - Objects.equals(this.name, createSourceAlphaInput.name) && - Objects.equals(this.metadataId, createSourceAlphaInput.metadataId) && - Objects.equals(this.settings, createSourceAlphaInput.settings); - } - - @Override - public int hashCode() { - return Objects.hash(slug, enabled, name, metadataId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceAlphaInput {\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("slug"); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("metadataId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("slug"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("metadataId"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("slug"); - openapiFields.add("enabled"); - openapiFields.add("name"); - openapiFields.add("metadataId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("slug"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadataId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceAlphaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceAlphaInput is not found in the empty JSON string", CreateSourceAlphaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateSourceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceAlphaInput is not found in" + + " the empty JSON string", + CreateSourceAlphaInput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceAlphaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSourceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSourceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slug` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slug").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("metadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metadataId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metadataId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceAlphaInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSourceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceAlphaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("metadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadataId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceAlphaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceAlphaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateSourceAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceAlphaInput - * @throws IOException if the JSON string is invalid with respect to CreateSourceAlphaInput - */ - public static CreateSourceAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceAlphaInput.class); - } - - /** - * Convert an instance of CreateSourceAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of CreateSourceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceAlphaInput + * @throws IOException if the JSON string is invalid with respect to CreateSourceAlphaInput + */ + public static CreateSourceAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceAlphaInput.class); + } + + /** + * Convert an instance of CreateSourceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java index 1c0da3aa..673dd8f9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Source2; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the newly Source. - */ +/** Returns the newly Source. */ @ApiModel(description = "Returns the newly Source.") - public class CreateSourceAlphaOutput { - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - private Source2 source; + public static final String SERIALIZED_NAME_SOURCE = "source"; - public CreateSourceAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_SOURCE) + private Source2 source; - public CreateSourceAlphaOutput source(Source2 source) { - - this.source = source; - return this; - } + public CreateSourceAlphaOutput() {} - /** - * Get source - * @return source - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateSourceAlphaOutput source(Source2 source) { - public Source2 getSource() { - return source; - } + this.source = source; + return this; + } + /** + * Get source + * + * @return source + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Source2 getSource() { + return source; + } - public void setSource(Source2 source) { - this.source = source; - } + public void setSource(Source2 source) { + this.source = source; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSourceAlphaOutput createSourceAlphaOutput = (CreateSourceAlphaOutput) o; + return Objects.equals(this.source, createSourceAlphaOutput.source); + } + @Override + public int hashCode() { + return Objects.hash(source); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceAlphaOutput {\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSourceAlphaOutput createSourceAlphaOutput = (CreateSourceAlphaOutput) o; - return Objects.equals(this.source, createSourceAlphaOutput.source); - } - - @Override - public int hashCode() { - return Objects.hash(source); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceAlphaOutput {\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("source"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("source"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("source"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("source"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceAlphaOutput is not found in the empty JSON string", CreateSourceAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateSourceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceAlphaOutput is not found" + + " in the empty JSON string", + CreateSourceAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSourceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSourceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSourceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to CreateSourceAlphaOutput + */ + public static CreateSourceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceAlphaOutput.class); } - } - - /** - * Create an instance of CreateSourceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to CreateSourceAlphaOutput - */ - public static CreateSourceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceAlphaOutput.class); - } - - /** - * Convert an instance of CreateSourceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateSourceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java index 227227e8..6f36f4d4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,190 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateSourceRegulationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateSourceRegulation200Response - */ - +/** CreateSourceRegulation200Response */ public class CreateSourceRegulation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateSourceRegulationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateSourceRegulation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateSourceRegulationV1Output data; - public CreateSourceRegulation200Response data(CreateSourceRegulationV1Output data) { - - this.data = data; - return this; - } + public CreateSourceRegulation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateSourceRegulation200Response data(CreateSourceRegulationV1Output data) { - public CreateSourceRegulationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateSourceRegulationV1Output getData() { + return data; + } - public void setData(CreateSourceRegulationV1Output data) { - this.data = data; - } + public void setData(CreateSourceRegulationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSourceRegulation200Response createSourceRegulation200Response = + (CreateSourceRegulation200Response) o; + return Objects.equals(this.data, createSourceRegulation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceRegulation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSourceRegulation200Response createSourceRegulation200Response = (CreateSourceRegulation200Response) o; - return Objects.equals(this.data, createSourceRegulation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceRegulation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceRegulation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceRegulation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceRegulation200Response is not found in the empty JSON string", CreateSourceRegulation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateSourceRegulation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceRegulation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceRegulation200Response is" + + " not found in the empty JSON string", + CreateSourceRegulation200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceRegulation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceRegulation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceRegulation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceRegulation200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceRegulation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceRegulation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceRegulation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceRegulation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceRegulation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceRegulation200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateSourceRegulation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceRegulation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceRegulation200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSourceRegulation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceRegulation200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateSourceRegulation200Response + */ + public static CreateSourceRegulation200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceRegulation200Response.class); } - } - - /** - * Create an instance of CreateSourceRegulation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceRegulation200Response - * @throws IOException if the JSON string is invalid with respect to CreateSourceRegulation200Response - */ - public static CreateSourceRegulation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceRegulation200Response.class); - } - - /** - * Convert an instance of CreateSourceRegulation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateSourceRegulation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index f5eae79f..2345d64b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,385 +10,396 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The input to create a Source-scoped regulation. - */ +/** The input to create a Source-scoped regulation. */ @ApiModel(description = "The input to create a Source-scoped regulation.") - public class CreateSourceRegulationV1Input { - /** - * The regulation type to create. - */ - @JsonAdapter(RegulationTypeEnum.Adapter.class) - public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - - DELETE_INTERNAL("DELETE_INTERNAL"), - - DELETE_ONLY("DELETE_ONLY"), - - SUPPRESS_ONLY("SUPPRESS_ONLY"), - - SUPPRESS_WITH_DELETE("SUPPRESS_WITH_DELETE"), - - UNSUPPRESS("UNSUPPRESS"); - - private String value; - - RegulationTypeEnum(String value) { - this.value = value; - } + /** The regulation type to create. */ + @JsonAdapter(RegulationTypeEnum.Adapter.class) + public enum RegulationTypeEnum { + BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - public String getValue() { - return value; - } + DELETE_INTERNAL("DELETE_INTERNAL"), - @Override - public String toString() { - return String.valueOf(value); - } + DELETE_ONLY("DELETE_ONLY"), - public static RegulationTypeEnum fromValue(String value) { - for (RegulationTypeEnum b : RegulationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + SUPPRESS_ONLY("SUPPRESS_ONLY"), - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final RegulationTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return RegulationTypeEnum.fromValue(value); - } - } - } + SUPPRESS_WITH_DELETE("SUPPRESS_WITH_DELETE"), - public static final String SERIALIZED_NAME_REGULATION_TYPE = "regulationType"; - @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) - private RegulationTypeEnum regulationType; + UNSUPPRESS("UNSUPPRESS"); - /** - * The subject type. - */ - @JsonAdapter(SubjectTypeEnum.Adapter.class) - public enum SubjectTypeEnum { - USER_ID("USER_ID"); + private String value; - private String value; + RegulationTypeEnum(String value) { + this.value = value; + } - SubjectTypeEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); - } + public static RegulationTypeEnum fromValue(String value) { + for (RegulationTypeEnum b : RegulationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static SubjectTypeEnum fromValue(String value) { - for (SubjectTypeEnum b : SubjectTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RegulationTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RegulationTypeEnum.fromValue(value); + } } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SubjectTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SubjectTypeEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_REGULATION_TYPE = "regulationType"; - public static final String SERIALIZED_NAME_SUBJECT_TYPE = "subjectType"; - @SerializedName(SERIALIZED_NAME_SUBJECT_TYPE) - private SubjectTypeEnum subjectType; + @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) + private RegulationTypeEnum regulationType; - public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; - @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) - private List subjectIds = null; + /** The subject type. */ + @JsonAdapter(SubjectTypeEnum.Adapter.class) + public enum SubjectTypeEnum { + USER_ID("USER_ID"); - public CreateSourceRegulationV1Input() { - } + private String value; - public CreateSourceRegulationV1Input regulationType(RegulationTypeEnum regulationType) { - - this.regulationType = regulationType; - return this; - } + SubjectTypeEnum(String value) { + this.value = value; + } - /** - * The regulation type to create. - * @return regulationType - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The regulation type to create.") + public String getValue() { + return value; + } - public RegulationTypeEnum getRegulationType() { - return regulationType; - } + @Override + public String toString() { + return String.valueOf(value); + } + public static SubjectTypeEnum fromValue(String value) { + for (SubjectTypeEnum b : SubjectTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public void setRegulationType(RegulationTypeEnum regulationType) { - this.regulationType = regulationType; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SubjectTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SubjectTypeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_SUBJECT_TYPE = "subjectType"; - public CreateSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { - - this.subjectType = subjectType; - return this; - } + @SerializedName(SERIALIZED_NAME_SUBJECT_TYPE) + private SubjectTypeEnum subjectType; - /** - * The subject type. - * @return subjectType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The subject type.") + public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; - public SubjectTypeEnum getSubjectType() { - return subjectType; - } + @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) + private List subjectIds = null; + public CreateSourceRegulationV1Input() {} - public void setSubjectType(SubjectTypeEnum subjectType) { - this.subjectType = subjectType; - } + public CreateSourceRegulationV1Input regulationType(RegulationTypeEnum regulationType) { + this.regulationType = regulationType; + return this; + } - public CreateSourceRegulationV1Input subjectIds(List subjectIds) { - - this.subjectIds = subjectIds; - return this; - } + /** + * The regulation type to create. + * + * @return regulationType + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The regulation type to create.") + public RegulationTypeEnum getRegulationType() { + return regulationType; + } - public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { - if (this.subjectIds == null) { - this.subjectIds = new ArrayList<>(); + public void setRegulationType(RegulationTypeEnum regulationType) { + this.regulationType = regulationType; } - this.subjectIds.add(subjectIdsItem); - return this; - } - /** - * The user or object ids of the subjects to regulate. Config API note: equal to `parent` but allows an array. - * @return subjectIds - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The user or object ids of the subjects to regulate. Config API note: equal to `parent` but allows an array.") + public CreateSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { - public List getSubjectIds() { - return subjectIds; - } + this.subjectType = subjectType; + return this; + } + /** + * The subject type. + * + * @return subjectType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The subject type.") + public SubjectTypeEnum getSubjectType() { + return subjectType; + } - public void setSubjectIds(List subjectIds) { - this.subjectIds = subjectIds; - } + public void setSubjectType(SubjectTypeEnum subjectType) { + this.subjectType = subjectType; + } + public CreateSourceRegulationV1Input subjectIds(List subjectIds) { + this.subjectIds = subjectIds; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { + if (this.subjectIds == null) { + this.subjectIds = new ArrayList<>(); + } + this.subjectIds.add(subjectIdsItem); + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The user or object ids of the subjects to regulate. Config API note: equal to + * `parent` but allows an array. + * + * @return subjectIds + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The user or object ids of the subjects to regulate. Config API note: equal to" + + " `parent` but allows an array.") + public List getSubjectIds() { + return subjectIds; } - CreateSourceRegulationV1Input createSourceRegulationV1Input = (CreateSourceRegulationV1Input) o; - return Objects.equals(this.regulationType, createSourceRegulationV1Input.regulationType) && - Objects.equals(this.subjectType, createSourceRegulationV1Input.subjectType) && - Objects.equals(this.subjectIds, createSourceRegulationV1Input.subjectIds); - } - - @Override - public int hashCode() { - return Objects.hash(regulationType, subjectType, subjectIds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceRegulationV1Input {\n"); - sb.append(" regulationType: ").append(toIndentedString(regulationType)).append("\n"); - sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); - sb.append(" subjectIds: ").append(toIndentedString(subjectIds)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public void setSubjectIds(List subjectIds) { + this.subjectIds = subjectIds; } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulationType"); - openapiFields.add("subjectType"); - openapiFields.add("subjectIds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulationType"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceRegulationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceRegulationV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceRegulationV1Input is not found in the empty JSON string", CreateSourceRegulationV1Input.openapiRequiredFields.toString())); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } + CreateSourceRegulationV1Input createSourceRegulationV1Input = + (CreateSourceRegulationV1Input) o; + return Objects.equals(this.regulationType, createSourceRegulationV1Input.regulationType) + && Objects.equals(this.subjectType, createSourceRegulationV1Input.subjectType) + && Objects.equals(this.subjectIds, createSourceRegulationV1Input.subjectIds); + } + + @Override + public int hashCode() { + return Objects.hash(regulationType, subjectType, subjectIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceRegulationV1Input {\n"); + sb.append(" regulationType: ").append(toIndentedString(regulationType)).append("\n"); + sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); + sb.append(" subjectIds: ").append(toIndentedString(subjectIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceRegulationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceRegulationV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulationType"); + openapiFields.add("subjectType"); + openapiFields.add("subjectIds"); - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSourceRegulationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulationType"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateSourceRegulationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceRegulationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceRegulationV1Input is not" + + " found in the empty JSON string", + CreateSourceRegulationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceRegulationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceRegulationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSourceRegulationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("regulationType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regulationType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("regulationType").toString())); + } + if ((jsonObj.get("subjectType") != null && !jsonObj.get("subjectType").isJsonNull()) + && !jsonObj.get("subjectType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subjectType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("subjectType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("subjectIds") != null && !jsonObj.get("subjectIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subjectIds` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("subjectIds").toString())); } - } - if (!jsonObj.get("regulationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regulationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regulationType").toString())); - } - if ((jsonObj.get("subjectType") != null && !jsonObj.get("subjectType").isJsonNull()) && !jsonObj.get("subjectType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subjectType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subjectType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("subjectIds") != null && !jsonObj.get("subjectIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subjectIds` to be an array in the JSON string but got `%s`", jsonObj.get("subjectIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceRegulationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceRegulationV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceRegulationV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceRegulationV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceRegulationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateSourceRegulationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceRegulationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateSourceRegulationV1Input - */ - public static CreateSourceRegulationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceRegulationV1Input.class); - } - - /** - * Convert an instance of CreateSourceRegulationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceRegulationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceRegulationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateSourceRegulationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceRegulationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceRegulationV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSourceRegulationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceRegulationV1Input + * @throws IOException if the JSON string is invalid with respect to + * CreateSourceRegulationV1Input + */ + public static CreateSourceRegulationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceRegulationV1Input.class); + } + + /** + * Convert an instance of CreateSourceRegulationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java index faf92c92..e56ee96e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,208 +10,209 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of a create Source regulation call. - */ +/** The output of a create Source regulation call. */ @ApiModel(description = "The output of a create Source regulation call.") - public class CreateSourceRegulationV1Output { - public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; - @SerializedName(SERIALIZED_NAME_REGULATE_ID) - private String regulateId; + public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; - public CreateSourceRegulationV1Output() { - } + @SerializedName(SERIALIZED_NAME_REGULATE_ID) + private String regulateId; - public CreateSourceRegulationV1Output regulateId(String regulateId) { - - this.regulateId = regulateId; - return this; - } + public CreateSourceRegulationV1Output() {} - /** - * The id of the created regulation. - * @return regulateId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the created regulation.") + public CreateSourceRegulationV1Output regulateId(String regulateId) { - public String getRegulateId() { - return regulateId; - } + this.regulateId = regulateId; + return this; + } + /** + * The id of the created regulation. + * + * @return regulateId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the created regulation.") + public String getRegulateId() { + return regulateId; + } - public void setRegulateId(String regulateId) { - this.regulateId = regulateId; - } + public void setRegulateId(String regulateId) { + this.regulateId = regulateId; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSourceRegulationV1Output createSourceRegulationV1Output = + (CreateSourceRegulationV1Output) o; + return Objects.equals(this.regulateId, createSourceRegulationV1Output.regulateId); + } + @Override + public int hashCode() { + return Objects.hash(regulateId); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceRegulationV1Output {\n"); + sb.append(" regulateId: ").append(toIndentedString(regulateId)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSourceRegulationV1Output createSourceRegulationV1Output = (CreateSourceRegulationV1Output) o; - return Objects.equals(this.regulateId, createSourceRegulationV1Output.regulateId); - } - - @Override - public int hashCode() { - return Objects.hash(regulateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceRegulationV1Output {\n"); - sb.append(" regulateId: ").append(toIndentedString(regulateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulateId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulateId"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulateId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulateId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceRegulationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceRegulationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceRegulationV1Output is not found in the empty JSON string", CreateSourceRegulationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateSourceRegulationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceRegulationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceRegulationV1Output is not" + + " found in the empty JSON string", + CreateSourceRegulationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceRegulationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceRegulationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceRegulationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceRegulationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSourceRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSourceRegulationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("regulateId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regulateId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("regulateId").toString())); } - } - if (!jsonObj.get("regulateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regulateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regulateId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceRegulationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceRegulationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceRegulationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceRegulationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateSourceRegulationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceRegulationV1Output - * @throws IOException if the JSON string is invalid with respect to CreateSourceRegulationV1Output - */ - public static CreateSourceRegulationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceRegulationV1Output.class); - } - - /** - * Convert an instance of CreateSourceRegulationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceRegulationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceRegulationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateSourceRegulationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceRegulationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceRegulationV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSourceRegulationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceRegulationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateSourceRegulationV1Output + */ + public static CreateSourceRegulationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceRegulationV1Output.class); + } + + /** + * Convert an instance of CreateSourceRegulationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index 3ca61c52..3f993547 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,304 +10,328 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * Create a new Source based on a set of parameters. - */ +/** Create a new Source based on a set of parameters. */ @ApiModel(description = "Create a new Source based on a set of parameters.") - public class CreateSourceV1Input { - public static final String SERIALIZED_NAME_SLUG = "slug"; - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_SLUG = "slug"; - public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - @SerializedName(SERIALIZED_NAME_METADATA_ID) - private String metadataId; + @SerializedName(SERIALIZED_NAME_SLUG) + private String slug; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public CreateSourceV1Input() { - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public CreateSourceV1Input slug(String slug) { - - this.slug = slug; - return this; - } + public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - /** - * The slug by which to identify the Source in the Segment app. - * @return slug - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The slug by which to identify the Source in the Segment app.") + @SerializedName(SERIALIZED_NAME_METADATA_ID) + private String metadataId; - public String getSlug() { - return slug; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public void setSlug(String slug) { - this.slug = slug; - } + public CreateSourceV1Input() {} + public CreateSourceV1Input slug(String slug) { - public CreateSourceV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + this.slug = slug; + return this; + } - /** - * Enable to allow this Source to send data. Defaults to true. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enable to allow this Source to send data. Defaults to true.") + /** + * The slug by which to identify the Source in the Segment app. + * + * @return slug + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The slug by which to identify the Source in the Segment app.") + public String getSlug() { + return slug; + } - public Boolean getEnabled() { - return enabled; - } + public void setSlug(String slug) { + this.slug = slug; + } + public CreateSourceV1Input enabled(Boolean enabled) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + return this; + } + /** + * Enable to allow this Source to send data. Defaults to true. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Enable to allow this Source to send data. Defaults to true.") + public Boolean getEnabled() { + return enabled; + } - public CreateSourceV1Input metadataId(String metadataId) { - - this.metadataId = metadataId; - return this; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } - /** - * The id of the Source metadata from which this instance of the Source derives. All Source metadata is available under `/catalog/sources`. - * @return metadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source metadata from which this instance of the Source derives. All Source metadata is available under `/catalog/sources`.") + public CreateSourceV1Input metadataId(String metadataId) { - public String getMetadataId() { - return metadataId; - } + this.metadataId = metadataId; + return this; + } + /** + * The id of the Source metadata from which this instance of the Source derives. All Source + * metadata is available under `/catalog/sources`. + * + * @return metadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of the Source metadata from which this instance of the Source derives. " + + " All Source metadata is available under `/catalog/sources`.") + public String getMetadataId() { + return metadataId; + } - public void setMetadataId(String metadataId) { - this.metadataId = metadataId; - } + public void setMetadataId(String metadataId) { + this.metadataId = metadataId; + } + public CreateSourceV1Input settings(Map settings) { - public CreateSourceV1Input settings(Map settings) { - - this.settings = settings; - return this; - } + this.settings = settings; + return this; + } - /** - * A key-value object that contains instance-specific settings for the Source. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A key-value object that contains instance-specific settings for the Source.") + /** + * A key-value object that contains instance-specific settings for the Source. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "A key-value object that contains instance-specific settings for the Source.") + public Map getSettings() { + return settings; + } - public Map getSettings() { - return settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSourceV1Input createSourceV1Input = (CreateSourceV1Input) o; + return Objects.equals(this.slug, createSourceV1Input.slug) + && Objects.equals(this.enabled, createSourceV1Input.enabled) + && Objects.equals(this.metadataId, createSourceV1Input.metadataId) + && Objects.equals(this.settings, createSourceV1Input.settings); + } - public void setSettings(Map settings) { - this.settings = settings; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash(slug, enabled, metadataId, settings); + } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceV1Input {\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSourceV1Input createSourceV1Input = (CreateSourceV1Input) o; - return Objects.equals(this.slug, createSourceV1Input.slug) && - Objects.equals(this.enabled, createSourceV1Input.enabled) && - Objects.equals(this.metadataId, createSourceV1Input.metadataId) && - Objects.equals(this.settings, createSourceV1Input.settings); - } - - @Override - public int hashCode() { - return Objects.hash(slug, enabled, metadataId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceV1Input {\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("slug"); + openapiFields.add("enabled"); + openapiFields.add("metadataId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("slug"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("metadataId"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("slug"); - openapiFields.add("enabled"); - openapiFields.add("metadataId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("slug"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadataId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceV1Input is not found in the empty JSON string", CreateSourceV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateSourceV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceV1Input is not found in" + + " the empty JSON string", + CreateSourceV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSourceV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSourceV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slug` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slug").toString())); + } + if (!jsonObj.get("metadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metadataId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metadataId").toString())); } - } - if (!jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); - } - if (!jsonObj.get("metadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadataId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateSourceV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceV1Input - * @throws IOException if the JSON string is invalid with respect to CreateSourceV1Input - */ - public static CreateSourceV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceV1Input.class); - } - - /** - * Convert an instance of CreateSourceV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceV1Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSourceV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSourceV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceV1Input + * @throws IOException if the JSON string is invalid with respect to CreateSourceV1Input + */ + public static CreateSourceV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceV1Input.class); + } + + /** + * Convert an instance of CreateSourceV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java index f2d72c75..db520440 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Source5; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a newly created Source. - */ +/** Returns a newly created Source. */ @ApiModel(description = "Returns a newly created Source.") - public class CreateSourceV1Output { - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - private Source5 source; + public static final String SERIALIZED_NAME_SOURCE = "source"; - public CreateSourceV1Output() { - } + @SerializedName(SERIALIZED_NAME_SOURCE) + private Source5 source; - public CreateSourceV1Output source(Source5 source) { - - this.source = source; - return this; - } + public CreateSourceV1Output() {} - /** - * Get source - * @return source - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateSourceV1Output source(Source5 source) { - public Source5 getSource() { - return source; - } + this.source = source; + return this; + } + /** + * Get source + * + * @return source + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Source5 getSource() { + return source; + } - public void setSource(Source5 source) { - this.source = source; - } + public void setSource(Source5 source) { + this.source = source; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSourceV1Output createSourceV1Output = (CreateSourceV1Output) o; + return Objects.equals(this.source, createSourceV1Output.source); + } + @Override + public int hashCode() { + return Objects.hash(source); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSourceV1Output {\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateSourceV1Output createSourceV1Output = (CreateSourceV1Output) o; - return Objects.equals(this.source, createSourceV1Output.source); - } - - @Override - public int hashCode() { - return Objects.hash(source); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateSourceV1Output {\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("source"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("source"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("source"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("source"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateSourceV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSourceV1Output is not found in the empty JSON string", CreateSourceV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateSourceV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateSourceV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateSourceV1Output is not found in" + + " the empty JSON string", + CreateSourceV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateSourceV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateSourceV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateSourceV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateSourceV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSourceV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateSourceV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateSourceV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateSourceV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateSourceV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSourceV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSourceV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateSourceV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSourceV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSourceV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSourceV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSourceV1Output + * @throws IOException if the JSON string is invalid with respect to CreateSourceV1Output + */ + public static CreateSourceV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSourceV1Output.class); } - } - - /** - * Create an instance of CreateSourceV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateSourceV1Output - * @throws IOException if the JSON string is invalid with respect to CreateSourceV1Output - */ - public static CreateSourceV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateSourceV1Output.class); - } - - /** - * Convert an instance of CreateSourceV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateSourceV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java index 6478d140..9f64dd07 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateTrackingPlanV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateTrackingPlan200Response - */ - +/** CreateTrackingPlan200Response */ public class CreateTrackingPlan200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateTrackingPlanV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateTrackingPlan200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateTrackingPlanV1Output data; - public CreateTrackingPlan200Response data(CreateTrackingPlanV1Output data) { - - this.data = data; - return this; - } + public CreateTrackingPlan200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateTrackingPlan200Response data(CreateTrackingPlanV1Output data) { - public CreateTrackingPlanV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateTrackingPlanV1Output getData() { + return data; + } - public void setData(CreateTrackingPlanV1Output data) { - this.data = data; - } + public void setData(CreateTrackingPlanV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTrackingPlan200Response createTrackingPlan200Response = + (CreateTrackingPlan200Response) o; + return Objects.equals(this.data, createTrackingPlan200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTrackingPlan200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateTrackingPlan200Response createTrackingPlan200Response = (CreateTrackingPlan200Response) o; - return Objects.equals(this.data, createTrackingPlan200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTrackingPlan200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlan200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTrackingPlan200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTrackingPlan200Response is not found in the empty JSON string", CreateTrackingPlan200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTrackingPlan200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTrackingPlan200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTrackingPlan200Response is not" + + " found in the empty JSON string", + CreateTrackingPlan200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTrackingPlan200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTrackingPlan200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTrackingPlan200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTrackingPlan200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTrackingPlan200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTrackingPlan200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTrackingPlan200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTrackingPlan200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTrackingPlan200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTrackingPlan200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTrackingPlan200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTrackingPlan200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTrackingPlan200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateTrackingPlan200Response + */ + public static CreateTrackingPlan200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTrackingPlan200Response.class); } - } - - /** - * Create an instance of CreateTrackingPlan200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTrackingPlan200Response - * @throws IOException if the JSON string is invalid with respect to CreateTrackingPlan200Response - */ - public static CreateTrackingPlan200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTrackingPlan200Response.class); - } - - /** - * Convert an instance of CreateTrackingPlan200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateTrackingPlan200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index 06c420fe..c0dbe528 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,326 +10,331 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a Tracking Plan in the Workspace. - */ +/** Creates a Tracking Plan in the Workspace. */ @ApiModel(description = "Creates a Tracking Plan in the Workspace.") - public class CreateTrackingPlanV1Input { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - /** - * The Tracking Plan's type. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - LIVE("LIVE"), - - PROPERTY_LIBRARY("PROPERTY_LIBRARY"), - - RULE_LIBRARY("RULE_LIBRARY"), - - TEMPLATE("TEMPLATE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_NAME = "name"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } + /** The Tracking Plan's type. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + LIVE("LIVE"), - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + PROPERTY_LIBRARY("PROPERTY_LIBRARY"), - public CreateTrackingPlanV1Input() { - } + RULE_LIBRARY("RULE_LIBRARY"), - public CreateTrackingPlanV1Input name(String name) { - - this.name = name; - return this; - } + TEMPLATE("TEMPLATE"); - /** - * The Tracking Plan's name. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Tracking Plan's name. Config API note: equal to `displayName`.") + private String value; - public String getName() { - return name; - } + TypeEnum(String value) { + this.value = value; + } + public String getValue() { + return value; + } - public void setName(String name) { - this.name = name; - } + @Override + public String toString() { + return String.valueOf(value); + } + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public CreateTrackingPlanV1Input description(String description) { - - this.description = description; - return this; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } - /** - * The Tracking Plan's description. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Tracking Plan's description.") + public static final String SERIALIZED_NAME_TYPE = "type"; - public String getDescription() { - return description; - } + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + public CreateTrackingPlanV1Input() {} - public void setDescription(String description) { - this.description = description; - } + public CreateTrackingPlanV1Input name(String name) { + this.name = name; + return this; + } - public CreateTrackingPlanV1Input type(TypeEnum type) { - - this.type = type; - return this; - } + /** + * The Tracking Plan's name. Config API note: equal to `displayName`. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Tracking Plan's name. Config API note: equal to `displayName`.") + public String getName() { + return name; + } - /** - * The Tracking Plan's type. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Tracking Plan's type.") + public void setName(String name) { + this.name = name; + } - public TypeEnum getType() { - return type; - } + public CreateTrackingPlanV1Input description(String description) { + this.description = description; + return this; + } - public void setType(TypeEnum type) { - this.type = type; - } + /** + * The Tracking Plan's description. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Tracking Plan's description.") + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public CreateTrackingPlanV1Input type(TypeEnum type) { - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + this.type = type; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The Tracking Plan's type. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Tracking Plan's type.") + public TypeEnum getType() { + return type; } - CreateTrackingPlanV1Input createTrackingPlanV1Input = (CreateTrackingPlanV1Input) o; - return Objects.equals(this.name, createTrackingPlanV1Input.name) && - Objects.equals(this.description, createTrackingPlanV1Input.description) && - Objects.equals(this.type, createTrackingPlanV1Input.type); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTrackingPlanV1Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public void setType(TypeEnum type) { + this.type = type; } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlanV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTrackingPlanV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTrackingPlanV1Input is not found in the empty JSON string", CreateTrackingPlanV1Input.openapiRequiredFields.toString())); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } + CreateTrackingPlanV1Input createTrackingPlanV1Input = (CreateTrackingPlanV1Input) o; + return Objects.equals(this.name, createTrackingPlanV1Input.name) + && Objects.equals(this.description, createTrackingPlanV1Input.description) + && Objects.equals(this.type, createTrackingPlanV1Input.type); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTrackingPlanV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTrackingPlanV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + @Override + public int hashCode() { + return Objects.hash(name, description, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTrackingPlanV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("type"); - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTrackingPlanV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlanV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTrackingPlanV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTrackingPlanV1Input is not found" + + " in the empty JSON string", + CreateTrackingPlanV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTrackingPlanV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTrackingPlanV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTrackingPlanV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTrackingPlanV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTrackingPlanV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateTrackingPlanV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTrackingPlanV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTrackingPlanV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTrackingPlanV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTrackingPlanV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTrackingPlanV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTrackingPlanV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTrackingPlanV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateTrackingPlanV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTrackingPlanV1Input - * @throws IOException if the JSON string is invalid with respect to CreateTrackingPlanV1Input - */ - public static CreateTrackingPlanV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTrackingPlanV1Input.class); - } - - /** - * Convert an instance of CreateTrackingPlanV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of CreateTrackingPlanV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTrackingPlanV1Input + * @throws IOException if the JSON string is invalid with respect to CreateTrackingPlanV1Input + */ + public static CreateTrackingPlanV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTrackingPlanV1Input.class); + } + + /** + * Convert an instance of CreateTrackingPlanV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java index e2269ee8..cece15d2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.TrackingPlan1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Result of a CreateTrackingPlan call. - */ +/** Result of a CreateTrackingPlan call. */ @ApiModel(description = "Result of a CreateTrackingPlan call.") - public class CreateTrackingPlanV1Output { - public static final String SERIALIZED_NAME_TRACKING_PLAN = "trackingPlan"; - @SerializedName(SERIALIZED_NAME_TRACKING_PLAN) - private TrackingPlan1 trackingPlan; + public static final String SERIALIZED_NAME_TRACKING_PLAN = "trackingPlan"; - public CreateTrackingPlanV1Output() { - } + @SerializedName(SERIALIZED_NAME_TRACKING_PLAN) + private TrackingPlan1 trackingPlan; - public CreateTrackingPlanV1Output trackingPlan(TrackingPlan1 trackingPlan) { - - this.trackingPlan = trackingPlan; - return this; - } + public CreateTrackingPlanV1Output() {} - /** - * Get trackingPlan - * @return trackingPlan - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateTrackingPlanV1Output trackingPlan(TrackingPlan1 trackingPlan) { - public TrackingPlan1 getTrackingPlan() { - return trackingPlan; - } + this.trackingPlan = trackingPlan; + return this; + } + /** + * Get trackingPlan + * + * @return trackingPlan + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public TrackingPlan1 getTrackingPlan() { + return trackingPlan; + } - public void setTrackingPlan(TrackingPlan1 trackingPlan) { - this.trackingPlan = trackingPlan; - } + public void setTrackingPlan(TrackingPlan1 trackingPlan) { + this.trackingPlan = trackingPlan; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTrackingPlanV1Output createTrackingPlanV1Output = (CreateTrackingPlanV1Output) o; + return Objects.equals(this.trackingPlan, createTrackingPlanV1Output.trackingPlan); + } + @Override + public int hashCode() { + return Objects.hash(trackingPlan); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTrackingPlanV1Output {\n"); + sb.append(" trackingPlan: ").append(toIndentedString(trackingPlan)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateTrackingPlanV1Output createTrackingPlanV1Output = (CreateTrackingPlanV1Output) o; - return Objects.equals(this.trackingPlan, createTrackingPlanV1Output.trackingPlan); - } - - @Override - public int hashCode() { - return Objects.hash(trackingPlan); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTrackingPlanV1Output {\n"); - sb.append(" trackingPlan: ").append(toIndentedString(trackingPlan)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("trackingPlan"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("trackingPlan"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("trackingPlan"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("trackingPlan"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlanV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTrackingPlanV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTrackingPlanV1Output is not found in the empty JSON string", CreateTrackingPlanV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlanV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTrackingPlanV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTrackingPlanV1Output is not" + + " found in the empty JSON string", + CreateTrackingPlanV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTrackingPlanV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTrackingPlanV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTrackingPlanV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTrackingPlanV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTrackingPlanV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTrackingPlanV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTrackingPlanV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateTrackingPlanV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTrackingPlanV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTrackingPlanV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTrackingPlanV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTrackingPlanV1Output + * @throws IOException if the JSON string is invalid with respect to CreateTrackingPlanV1Output + */ + public static CreateTrackingPlanV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTrackingPlanV1Output.class); } - } - - /** - * Create an instance of CreateTrackingPlanV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTrackingPlanV1Output - * @throws IOException if the JSON string is invalid with respect to CreateTrackingPlanV1Output - */ - public static CreateTrackingPlanV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTrackingPlanV1Output.class); - } - - /** - * Convert an instance of CreateTrackingPlanV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateTrackingPlanV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 308fe4de..408667f6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateTransformationBetaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateTransformation200Response - */ - +/** CreateTransformation200Response */ public class CreateTransformation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateTransformationBetaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateTransformation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateTransformationBetaOutput data; - public CreateTransformation200Response data(CreateTransformationBetaOutput data) { - - this.data = data; - return this; - } + public CreateTransformation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateTransformation200Response data(CreateTransformationBetaOutput data) { - public CreateTransformationBetaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateTransformationBetaOutput getData() { + return data; + } - public void setData(CreateTransformationBetaOutput data) { - this.data = data; - } + public void setData(CreateTransformationBetaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformation200Response createTransformation200Response = + (CreateTransformation200Response) o; + return Objects.equals(this.data, createTransformation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateTransformation200Response createTransformation200Response = (CreateTransformation200Response) o; - return Objects.equals(this.data, createTransformation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTransformation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTransformation200Response is not found in the empty JSON string", CreateTransformation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTransformation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformation200Response is not" + + " found in the empty JSON string", + CreateTransformation200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTransformation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformation200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTransformation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformation200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTransformation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformation200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformation200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateTransformation200Response + */ + public static CreateTransformation200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformation200Response.class); } - } - - /** - * Create an instance of CreateTransformation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformation200Response - * @throws IOException if the JSON string is invalid with respect to CreateTransformation200Response - */ - public static CreateTransformation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformation200Response.class); - } - - /** - * Convert an instance of CreateTransformation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateTransformation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index ab4e8c32..46742fdd 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,471 +10,467 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.PropertyRenameBeta; -import com.segment.publicapi.models.PropertyValueTransformationBeta; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The input to create a Transformation. - */ +/** The input to create a Transformation. */ @ApiModel(description = "The input to create a Transformation.") - public class CreateTransformationBetaInput { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public CreateTransformationBetaInput() { - } + public static final String SERIALIZED_NAME_NAME = "name"; - public CreateTransformationBetaInput name(String name) { - - this.name = name; - return this; - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - /** - * The name of the Transformation. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public String getName() { - return name; - } + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - public void setName(String name) { - this.name = name; - } + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public CreateTransformationBetaInput sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - /** - * The Source to be associated with the Transformation. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source to be associated with the Transformation.") + public static final String SERIALIZED_NAME_IF = "if"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - public CreateTransformationBetaInput destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; - /** - * The optional Destination metadata id to be associated with the Transformation. - * @return destinationMetadataId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The optional Destination metadata id to be associated with the Transformation.") + public CreateTransformationBetaInput() {} - public String getDestinationMetadataId() { - return destinationMetadataId; - } + public CreateTransformationBetaInput name(String name) { + this.name = name; + return this; + } - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - - public CreateTransformationBetaInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation should be enabled. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") - - public Boolean getEnabled() { - return enabled; - } - + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setName(String name) { + this.name = name; + } + public CreateTransformationBetaInput sourceId(String sourceId) { - public CreateTransformationBetaInput _if(String _if) { - - this._if = _if; - return this; - } + this.sourceId = sourceId; + return this; + } - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard event matchers, use the following: Track -\\> \"event='\\<eventName\\>'\" Identify -\\> \"type='identify'\" Group -\\> \"type='group'\" - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard event matchers, use the following: Track -\\> \"event='\\'\" Identify -\\> \"type='identify'\" Group -\\> \"type='group'\"") + /** + * The Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } - public String getIf() { - return _if; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + public CreateTransformationBetaInput destinationMetadataId(String destinationMetadataId) { - public void setIf(String _if) { - this._if = _if; - } + this.destinationMetadataId = destinationMetadataId; + return this; + } + /** + * The optional Destination metadata id to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The optional Destination metadata id to be associated with the" + + " Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } - public CreateTransformationBetaInput newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * @return newEventName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional new event name for renaming events. Works only for 'track' event type.") + public CreateTransformationBetaInput enabled(Boolean enabled) { - public String getNewEventName() { - return newEventName; - } + this.enabled = enabled; + return this; + } + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public CreateTransformationBetaInput _if(String _if) { - public CreateTransformationBetaInput propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } + this._if = _if; + return this; + } - public CreateTransformationBetaInput addPropertyRenamesItem(PropertyRenameBeta propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - /** - * Optional array for renaming properties collected by your events. - * @return propertyRenames - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public void setIf(String _if) { + this._if = _if; + } - public List getPropertyRenames() { - return propertyRenames; - } + public CreateTransformationBetaInput newEventName(String newEventName) { + this.newEventName = newEventName; + return this; + } - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } - public CreateTransformationBetaInput propertyValueTransformations(List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } + public CreateTransformationBetaInput propertyRenames(List propertyRenames) { - public CreateTransformationBetaInput addPropertyValueTransformationsItem(PropertyValueTransformationBeta propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); + this.propertyRenames = propertyRenames; + return this; } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. - * @return propertyValueTransformations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for transforming properties and values collected by your events.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } + public CreateTransformationBetaInput addPropertyRenamesItem( + PropertyRenameBeta propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } - public void setPropertyValueTransformations(List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationBetaInput createTransformationBetaInput = + (CreateTransformationBetaInput) o; + return Objects.equals(this.name, createTransformationBetaInput.name) + && Objects.equals(this.sourceId, createTransformationBetaInput.sourceId) + && Objects.equals( + this.destinationMetadataId, + createTransformationBetaInput.destinationMetadataId) + && Objects.equals(this.enabled, createTransformationBetaInput.enabled) + && Objects.equals(this._if, createTransformationBetaInput._if) + && Objects.equals(this.newEventName, createTransformationBetaInput.newEventName) + && Objects.equals( + this.propertyRenames, createTransformationBetaInput.propertyRenames); + } + @Override + public int hashCode() { + return Objects.hash( + name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationBetaInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateTransformationBetaInput createTransformationBetaInput = (CreateTransformationBetaInput) o; - return Objects.equals(this.name, createTransformationBetaInput.name) && - Objects.equals(this.sourceId, createTransformationBetaInput.sourceId) && - Objects.equals(this.destinationMetadataId, createTransformationBetaInput.destinationMetadataId) && - Objects.equals(this.enabled, createTransformationBetaInput.enabled) && - Objects.equals(this._if, createTransformationBetaInput._if) && - Objects.equals(this.newEventName, createTransformationBetaInput.newEventName) && - Objects.equals(this.propertyRenames, createTransformationBetaInput.propertyRenames) && - Objects.equals(this.propertyValueTransformations, createTransformationBetaInput.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash(name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames, propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformationBetaInput {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ").append(toIndentedString(destinationMetadataId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ").append(toIndentedString(propertyValueTransformations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTransformationBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformationBetaInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTransformationBetaInput is not found in the empty JSON string", CreateTransformationBetaInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationBetaInput is not" + + " found in the empty JSON string", + CreateTransformationBetaInput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformationBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTransformationBetaInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null && !jsonObj.get("destinationMetadataId").isJsonNull()) && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationMetadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `newEventName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyRenames` to be an array in the JSON string but got `%s`", jsonObj.get("propertyRenames").toString())); - } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); } - } - if (jsonObj.get("propertyValueTransformations") != null && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `propertyValueTransformations` to be an array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); - } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); } - } - } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformationBetaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationBetaInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformationBetaInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformationBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationBetaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateTransformationBetaInput + */ + public static CreateTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationBetaInput.class); } - } - - /** - * Create an instance of CreateTransformationBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformationBetaInput - * @throws IOException if the JSON string is invalid with respect to CreateTransformationBetaInput - */ - public static CreateTransformationBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformationBetaInput.class); - } - - /** - * Convert an instance of CreateTransformationBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java index fac7e493..3b935df5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,202 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Transformation2; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of a created Transformation. - */ +/** The output of a created Transformation. */ @ApiModel(description = "The output of a created Transformation.") - public class CreateTransformationBetaOutput { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation2 transformation; + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - public CreateTransformationBetaOutput() { - } + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation2 transformation; - public CreateTransformationBetaOutput transformation(Transformation2 transformation) { - - this.transformation = transformation; - return this; - } + public CreateTransformationBetaOutput() {} - /** - * Get transformation - * @return transformation - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateTransformationBetaOutput transformation(Transformation2 transformation) { - public Transformation2 getTransformation() { - return transformation; - } + this.transformation = transformation; + return this; + } + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation2 getTransformation() { + return transformation; + } - public void setTransformation(Transformation2 transformation) { - this.transformation = transformation; - } + public void setTransformation(Transformation2 transformation) { + this.transformation = transformation; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationBetaOutput createTransformationBetaOutput = + (CreateTransformationBetaOutput) o; + return Objects.equals(this.transformation, createTransformationBetaOutput.transformation); + } + @Override + public int hashCode() { + return Objects.hash(transformation); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationBetaOutput {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateTransformationBetaOutput createTransformationBetaOutput = (CreateTransformationBetaOutput) o; - return Objects.equals(this.transformation, createTransformationBetaOutput.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformationBetaOutput {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTransformationBetaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformationBetaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateTransformationBetaOutput is not found in the empty JSON string", CreateTransformationBetaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTransformationBetaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationBetaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationBetaOutput is not" + + " found in the empty JSON string", + CreateTransformationBetaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformationBetaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateTransformationBetaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationBetaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationBetaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTransformationBetaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationBetaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformationBetaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformationBetaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationBetaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformationBetaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformationBetaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationBetaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationBetaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTransformationBetaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationBetaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationBetaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationBetaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationBetaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateTransformationBetaOutput + */ + public static CreateTransformationBetaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationBetaOutput.class); } - } - - /** - * Create an instance of CreateTransformationBetaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformationBetaOutput - * @throws IOException if the JSON string is invalid with respect to CreateTransformationBetaOutput - */ - public static CreateTransformationBetaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformationBetaOutput.class); - } - - /** - * Convert an instance of CreateTransformationBetaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateTransformationBetaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java index 34938a21..8be574e1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateUserGroupV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateUserGroup200Response - */ - +/** CreateUserGroup200Response */ public class CreateUserGroup200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateUserGroupV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateUserGroup200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateUserGroupV1Output data; - public CreateUserGroup200Response data(CreateUserGroupV1Output data) { - - this.data = data; - return this; - } + public CreateUserGroup200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateUserGroup200Response data(CreateUserGroupV1Output data) { - public CreateUserGroupV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateUserGroupV1Output getData() { + return data; + } - public void setData(CreateUserGroupV1Output data) { - this.data = data; - } + public void setData(CreateUserGroupV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserGroup200Response createUserGroup200Response = (CreateUserGroup200Response) o; + return Objects.equals(this.data, createUserGroup200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUserGroup200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateUserGroup200Response createUserGroup200Response = (CreateUserGroup200Response) o; - return Objects.equals(this.data, createUserGroup200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateUserGroup200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateUserGroup200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateUserGroup200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateUserGroup200Response is not found in the empty JSON string", CreateUserGroup200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateUserGroup200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateUserGroup200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateUserGroup200Response is not" + + " found in the empty JSON string", + CreateUserGroup200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateUserGroup200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateUserGroup200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateUserGroup200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateUserGroup200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateUserGroup200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateUserGroup200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateUserGroup200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateUserGroup200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateUserGroup200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateUserGroup200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateUserGroup200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateUserGroup200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateUserGroup200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateUserGroup200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateUserGroup200Response + * @throws IOException if the JSON string is invalid with respect to CreateUserGroup200Response + */ + public static CreateUserGroup200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateUserGroup200Response.class); } - } - - /** - * Create an instance of CreateUserGroup200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateUserGroup200Response - * @throws IOException if the JSON string is invalid with respect to CreateUserGroup200Response - */ - public static CreateUserGroup200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateUserGroup200Response.class); - } - - /** - * Convert an instance of CreateUserGroup200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateUserGroup200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java index ebfade04..bf769efc 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,208 +10,206 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Creates a user group, used to bundle permissions for its members, within a Workspace. - */ -@ApiModel(description = "Creates a user group, used to bundle permissions for its members, within a Workspace.") - +/** Creates a user group, used to bundle permissions for its members, within a Workspace. */ +@ApiModel( + description = + "Creates a user group, used to bundle permissions for its members, within a" + + " Workspace.") public class CreateUserGroupV1Input { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_NAME = "name"; - public CreateUserGroupV1Input() { - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public CreateUserGroupV1Input name(String name) { - - this.name = name; - return this; - } + public CreateUserGroupV1Input() {} - /** - * The name of the user group to create. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the user group to create.") + public CreateUserGroupV1Input name(String name) { - public String getName() { - return name; - } + this.name = name; + return this; + } + /** + * The name of the user group to create. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the user group to create.") + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserGroupV1Input createUserGroupV1Input = (CreateUserGroupV1Input) o; + return Objects.equals(this.name, createUserGroupV1Input.name); + } + @Override + public int hashCode() { + return Objects.hash(name); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUserGroupV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateUserGroupV1Input createUserGroupV1Input = (CreateUserGroupV1Input) o; - return Objects.equals(this.name, createUserGroupV1Input.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateUserGroupV1Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateUserGroupV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateUserGroupV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateUserGroupV1Input is not found in the empty JSON string", CreateUserGroupV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateUserGroupV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateUserGroupV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateUserGroupV1Input is not found in" + + " the empty JSON string", + CreateUserGroupV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateUserGroupV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateUserGroupV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateUserGroupV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateUserGroupV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateUserGroupV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateUserGroupV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateUserGroupV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateUserGroupV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateUserGroupV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateUserGroupV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateUserGroupV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateUserGroupV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateUserGroupV1Input - * @throws IOException if the JSON string is invalid with respect to CreateUserGroupV1Input - */ - public static CreateUserGroupV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateUserGroupV1Input.class); - } - - /** - * Convert an instance of CreateUserGroupV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateUserGroupV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateUserGroupV1Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateUserGroupV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateUserGroupV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateUserGroupV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateUserGroupV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateUserGroupV1Input + * @throws IOException if the JSON string is invalid with respect to CreateUserGroupV1Input + */ + public static CreateUserGroupV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateUserGroupV1Input.class); + } + + /** + * Convert an instance of CreateUserGroupV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java index f84f99c3..e750b2e2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.UserGroup; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the newly created user group. - */ +/** Returns the newly created user group. */ @ApiModel(description = "Returns the newly created user group.") - public class CreateUserGroupV1Output { - public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; - @SerializedName(SERIALIZED_NAME_USER_GROUP) - private UserGroup userGroup; + public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; - public CreateUserGroupV1Output() { - } + @SerializedName(SERIALIZED_NAME_USER_GROUP) + private UserGroup userGroup; - public CreateUserGroupV1Output userGroup(UserGroup userGroup) { - - this.userGroup = userGroup; - return this; - } + public CreateUserGroupV1Output() {} - /** - * Get userGroup - * @return userGroup - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateUserGroupV1Output userGroup(UserGroup userGroup) { - public UserGroup getUserGroup() { - return userGroup; - } + this.userGroup = userGroup; + return this; + } + /** + * Get userGroup + * + * @return userGroup + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public UserGroup getUserGroup() { + return userGroup; + } - public void setUserGroup(UserGroup userGroup) { - this.userGroup = userGroup; - } + public void setUserGroup(UserGroup userGroup) { + this.userGroup = userGroup; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateUserGroupV1Output createUserGroupV1Output = (CreateUserGroupV1Output) o; + return Objects.equals(this.userGroup, createUserGroupV1Output.userGroup); + } + @Override + public int hashCode() { + return Objects.hash(userGroup); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateUserGroupV1Output {\n"); + sb.append(" userGroup: ").append(toIndentedString(userGroup)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateUserGroupV1Output createUserGroupV1Output = (CreateUserGroupV1Output) o; - return Objects.equals(this.userGroup, createUserGroupV1Output.userGroup); - } - - @Override - public int hashCode() { - return Objects.hash(userGroup); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateUserGroupV1Output {\n"); - sb.append(" userGroup: ").append(toIndentedString(userGroup)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userGroup"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userGroup"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userGroup"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userGroup"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateUserGroupV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateUserGroupV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateUserGroupV1Output is not found in the empty JSON string", CreateUserGroupV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateUserGroupV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateUserGroupV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateUserGroupV1Output is not found" + + " in the empty JSON string", + CreateUserGroupV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateUserGroupV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateUserGroupV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateUserGroupV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateUserGroupV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateUserGroupV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateUserGroupV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateUserGroupV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateUserGroupV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateUserGroupV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateUserGroupV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateUserGroupV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateUserGroupV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateUserGroupV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateUserGroupV1Output + * @throws IOException if the JSON string is invalid with respect to CreateUserGroupV1Output + */ + public static CreateUserGroupV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateUserGroupV1Output.class); } - } - - /** - * Create an instance of CreateUserGroupV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateUserGroupV1Output - * @throws IOException if the JSON string is invalid with respect to CreateUserGroupV1Output - */ - public static CreateUserGroupV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateUserGroupV1Output.class); - } - - /** - * Convert an instance of CreateUserGroupV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateUserGroupV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java index 2f5237eb..73110d39 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateValidationInWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateValidationInWarehouse200Response - */ - +/** CreateValidationInWarehouse200Response */ public class CreateValidationInWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateValidationInWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateValidationInWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateValidationInWarehouseV1Output data; - public CreateValidationInWarehouse200Response data(CreateValidationInWarehouseV1Output data) { - - this.data = data; - return this; - } + public CreateValidationInWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateValidationInWarehouse200Response data(CreateValidationInWarehouseV1Output data) { - public CreateValidationInWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateValidationInWarehouseV1Output getData() { + return data; + } - public void setData(CreateValidationInWarehouseV1Output data) { - this.data = data; - } + public void setData(CreateValidationInWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateValidationInWarehouse200Response createValidationInWarehouse200Response = + (CreateValidationInWarehouse200Response) o; + return Objects.equals(this.data, createValidationInWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateValidationInWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateValidationInWarehouse200Response createValidationInWarehouse200Response = (CreateValidationInWarehouse200Response) o; - return Objects.equals(this.data, createValidationInWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateValidationInWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateValidationInWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateValidationInWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateValidationInWarehouse200Response is not found in the empty JSON string", CreateValidationInWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateValidationInWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateValidationInWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateValidationInWarehouse200Response" + + " is not found in the empty JSON string", + CreateValidationInWarehouse200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateValidationInWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateValidationInWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateValidationInWarehouse200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateValidationInWarehouse200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateValidationInWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateValidationInWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateValidationInWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateValidationInWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateValidationInWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateValidationInWarehouse200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateValidationInWarehouse200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateValidationInWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateValidationInWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateValidationInWarehouse200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateValidationInWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateValidationInWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateValidationInWarehouse200Response + */ + public static CreateValidationInWarehouse200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateValidationInWarehouse200Response.class); } - } - - /** - * Create an instance of CreateValidationInWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateValidationInWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to CreateValidationInWarehouse200Response - */ - public static CreateValidationInWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateValidationInWarehouse200Response.class); - } - - /** - * Convert an instance of CreateValidationInWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateValidationInWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java index 9a9c276f..7b7f3402 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,240 +10,242 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Verifies a set of Warehouse credentials by attempting to connect to it. - */ +/** Verifies a set of Warehouse credentials by attempting to connect to it. */ @ApiModel(description = "Verifies a set of Warehouse credentials by attempting to connect to it.") - public class CreateValidationInWarehouseV1Input { - public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - @SerializedName(SERIALIZED_NAME_METADATA_ID) - private String metadataId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - public CreateValidationInWarehouseV1Input() { - } + @SerializedName(SERIALIZED_NAME_METADATA_ID) + private String metadataId; - public CreateValidationInWarehouseV1Input metadataId(String metadataId) { - - this.metadataId = metadataId; - return this; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - /** - * The id of the Warehouse metadata type. - * @return metadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Warehouse metadata type.") + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public String getMetadataId() { - return metadataId; - } + public CreateValidationInWarehouseV1Input() {} + public CreateValidationInWarehouseV1Input metadataId(String metadataId) { - public void setMetadataId(String metadataId) { - this.metadataId = metadataId; - } + this.metadataId = metadataId; + return this; + } + /** + * The id of the Warehouse metadata type. + * + * @return metadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Warehouse metadata type.") + public String getMetadataId() { + return metadataId; + } - public CreateValidationInWarehouseV1Input settings(Map settings) { - - this.settings = settings; - return this; - } + public void setMetadataId(String metadataId) { + this.metadataId = metadataId; + } - /** - * The settings to check. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The settings to check.") + public CreateValidationInWarehouseV1Input settings(Map settings) { - public Map getSettings() { - return settings; - } + this.settings = settings; + return this; + } + /** + * The settings to check. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(required = true, value = "The settings to check.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input = + (CreateValidationInWarehouseV1Input) o; + return Objects.equals(this.metadataId, createValidationInWarehouseV1Input.metadataId) + && Objects.equals(this.settings, createValidationInWarehouseV1Input.settings); + } + @Override + public int hashCode() { + return Objects.hash(metadataId, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateValidationInWarehouseV1Input {\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input = (CreateValidationInWarehouseV1Input) o; - return Objects.equals(this.metadataId, createValidationInWarehouseV1Input.metadataId) && - Objects.equals(this.settings, createValidationInWarehouseV1Input.settings); - } - - @Override - public int hashCode() { - return Objects.hash(metadataId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateValidationInWarehouseV1Input {\n"); - sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("metadataId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("metadataId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("metadataId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("metadataId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateValidationInWarehouseV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateValidationInWarehouseV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateValidationInWarehouseV1Input is not found in the empty JSON string", CreateValidationInWarehouseV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateValidationInWarehouseV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateValidationInWarehouseV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateValidationInWarehouseV1Input is" + + " not found in the empty JSON string", + CreateValidationInWarehouseV1Input.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateValidationInWarehouseV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateValidationInWarehouseV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateValidationInWarehouseV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateValidationInWarehouseV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateValidationInWarehouseV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateValidationInWarehouseV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("metadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metadataId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metadataId").toString())); } - } - if (!jsonObj.get("metadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadataId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateValidationInWarehouseV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateValidationInWarehouseV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateValidationInWarehouseV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateValidationInWarehouseV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateValidationInWarehouseV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateValidationInWarehouseV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateValidationInWarehouseV1Input - * @throws IOException if the JSON string is invalid with respect to CreateValidationInWarehouseV1Input - */ - public static CreateValidationInWarehouseV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateValidationInWarehouseV1Input.class); - } - - /** - * Convert an instance of CreateValidationInWarehouseV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateValidationInWarehouseV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateValidationInWarehouseV1Input' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateValidationInWarehouseV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateValidationInWarehouseV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateValidationInWarehouseV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateValidationInWarehouseV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateValidationInWarehouseV1Input + * @throws IOException if the JSON string is invalid with respect to + * CreateValidationInWarehouseV1Input + */ + public static CreateValidationInWarehouseV1Input fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateValidationInWarehouseV1Input.class); + } + + /** + * Convert an instance of CreateValidationInWarehouseV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java index f7f9b6c1..95ba9a3e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,255 +10,263 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** Returns the status of a Warehouse connection settings after an attempt to connect to it. */ +@ApiModel( + description = + "Returns the status of a Warehouse connection settings after an attempt to connect" + + " to it.") +public class CreateValidationInWarehouseV1Output { + /** Represents the status for the current connection settings. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + CONNECTED("CONNECTED"), -/** - * Returns the status of a Warehouse connection settings after an attempt to connect to it. - */ -@ApiModel(description = "Returns the status of a Warehouse connection settings after an attempt to connect to it.") + FAILED("FAILED"); -public class CreateValidationInWarehouseV1Output { - /** - * Represents the status for the current connection settings. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - CONNECTED("CONNECTED"), - - FAILED("FAILED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } + private String value; - public String getValue() { - return value; - } + StatusEnum(String value) { + this.value = value; + } - @Override - public String toString() { - return String.valueOf(value); - } + public String getValue() { + return value; + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public CreateValidationInWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public CreateValidationInWarehouseV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public CreateValidationInWarehouseV1Output() {} - /** - * Represents the status for the current connection settings. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Represents the status for the current connection settings.") + public CreateValidationInWarehouseV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * Represents the status for the current connection settings. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Represents the status for the current connection settings.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateValidationInWarehouseV1Output createValidationInWarehouseV1Output = + (CreateValidationInWarehouseV1Output) o; + return Objects.equals(this.status, createValidationInWarehouseV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateValidationInWarehouseV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateValidationInWarehouseV1Output createValidationInWarehouseV1Output = (CreateValidationInWarehouseV1Output) o; - return Objects.equals(this.status, createValidationInWarehouseV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateValidationInWarehouseV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateValidationInWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateValidationInWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateValidationInWarehouseV1Output is not found in the empty JSON string", CreateValidationInWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateValidationInWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateValidationInWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateValidationInWarehouseV1Output is" + + " not found in the empty JSON string", + CreateValidationInWarehouseV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateValidationInWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateValidationInWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateValidationInWarehouseV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateValidationInWarehouseV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateValidationInWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateValidationInWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateValidationInWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateValidationInWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateValidationInWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateValidationInWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateValidationInWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateValidationInWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateValidationInWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to CreateValidationInWarehouseV1Output - */ - public static CreateValidationInWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateValidationInWarehouseV1Output.class); - } - - /** - * Convert an instance of CreateValidationInWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateValidationInWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateValidationInWarehouseV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateValidationInWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateValidationInWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateValidationInWarehouseV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateValidationInWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateValidationInWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateValidationInWarehouseV1Output + */ + public static CreateValidationInWarehouseV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateValidationInWarehouseV1Output.class); + } + + /** + * Convert an instance of CreateValidationInWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java index ed5411ae..c4f557b1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateWarehouse200Response - */ - +/** CreateWarehouse200Response */ public class CreateWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateWarehouseV1Output data; - public CreateWarehouse200Response data(CreateWarehouseV1Output data) { - - this.data = data; - return this; - } + public CreateWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateWarehouse200Response data(CreateWarehouseV1Output data) { - public CreateWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateWarehouseV1Output getData() { + return data; + } - public void setData(CreateWarehouseV1Output data) { - this.data = data; - } + public void setData(CreateWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWarehouse200Response createWarehouse200Response = (CreateWarehouse200Response) o; + return Objects.equals(this.data, createWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateWarehouse200Response createWarehouse200Response = (CreateWarehouse200Response) o; - return Objects.equals(this.data, createWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWarehouse200Response is not found in the empty JSON string", CreateWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateWarehouse200Response is not" + + " found in the empty JSON string", + CreateWarehouse200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateWarehouse200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateWarehouse200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWarehouse200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWarehouse200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateWarehouse200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to CreateWarehouse200Response + */ + public static CreateWarehouse200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWarehouse200Response.class); } - } - - /** - * Create an instance of CreateWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to CreateWarehouse200Response - */ - public static CreateWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateWarehouse200Response.class); - } - - /** - * Convert an instance of CreateWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index 76107a6e..e8ec13c8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,303 +10,312 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Create a new Warehouse based on a set of parameters. - */ +/** Create a new Warehouse based on a set of parameters. */ @ApiModel(description = "Create a new Warehouse based on a set of parameters.") - public class CreateWarehouseV1Input { - public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - @SerializedName(SERIALIZED_NAME_METADATA_ID) - private String metadataId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + @SerializedName(SERIALIZED_NAME_METADATA_ID) + private String metadataId; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_NAME = "name"; - public CreateWarehouseV1Input() { - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public CreateWarehouseV1Input metadataId(String metadataId) { - - this.metadataId = metadataId; - return this; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - /** - * The Warehouse metadata to use. - * @return metadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Warehouse metadata to use.") + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public String getMetadataId() { - return metadataId; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public void setMetadataId(String metadataId) { - this.metadataId = metadataId; - } + public CreateWarehouseV1Input() {} + public CreateWarehouseV1Input metadataId(String metadataId) { - public CreateWarehouseV1Input name(String name) { - - this.name = name; - return this; - } - - /** - * An optional human-readable name for this Warehouse. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional human-readable name for this Warehouse.") - - public String getName() { - return name; - } + this.metadataId = metadataId; + return this; + } + /** + * The Warehouse metadata to use. + * + * @return metadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Warehouse metadata to use.") + public String getMetadataId() { + return metadataId; + } - public void setName(String name) { - this.name = name; - } + public void setMetadataId(String metadataId) { + this.metadataId = metadataId; + } + public CreateWarehouseV1Input name(String name) { - public CreateWarehouseV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + this.name = name; + return this; + } - /** - * Enable to allow this Warehouse to receive data. Defaults to true. - * @return enabled - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow this Warehouse to receive data. Defaults to true.") + /** + * An optional human-readable name for this Warehouse. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional human-readable name for this Warehouse.") + public String getName() { + return name; + } - public Boolean getEnabled() { - return enabled; - } + public void setName(String name) { + this.name = name; + } + public CreateWarehouseV1Input enabled(Boolean enabled) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + return this; + } + /** + * Enable to allow this Warehouse to receive data. Defaults to true. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Enable to allow this Warehouse to receive data. Defaults to true.") + public Boolean getEnabled() { + return enabled; + } - public CreateWarehouseV1Input settings(Map settings) { - - this.settings = settings; - return this; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } - /** - * A key-value object that contains instance-specific settings for a Warehouse. Different kinds of Warehouses require different settings. The required and optional settings for a Warehouse are described in the `options` object of the associated Warehouse metadata. You can find the full list of Warehouse metadata and related settings information in the `/catalog/warehouses` endpoint. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A key-value object that contains instance-specific settings for a Warehouse. Different kinds of Warehouses require different settings. The required and optional settings for a Warehouse are described in the `options` object of the associated Warehouse metadata. You can find the full list of Warehouse metadata and related settings information in the `/catalog/warehouses` endpoint.") + public CreateWarehouseV1Input settings(Map settings) { - public Map getSettings() { - return settings; - } + this.settings = settings; + return this; + } + /** + * A key-value object that contains instance-specific settings for a Warehouse. Different kinds + * of Warehouses require different settings. The required and optional settings for a Warehouse + * are described in the `options` object of the associated Warehouse metadata. You can + * find the full list of Warehouse metadata and related settings information in the + * `/catalog/warehouses` endpoint. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = + "A key-value object that contains instance-specific settings for a Warehouse. " + + " Different kinds of Warehouses require different settings. The required" + + " and optional settings for a Warehouse are described in the `options`" + + " object of the associated Warehouse metadata. You can find the full" + + " list of Warehouse metadata and related settings information in the" + + " `/catalog/warehouses` endpoint.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWarehouseV1Input createWarehouseV1Input = (CreateWarehouseV1Input) o; + return Objects.equals(this.metadataId, createWarehouseV1Input.metadataId) + && Objects.equals(this.name, createWarehouseV1Input.name) + && Objects.equals(this.enabled, createWarehouseV1Input.enabled) + && Objects.equals(this.settings, createWarehouseV1Input.settings); + } + @Override + public int hashCode() { + return Objects.hash(metadataId, name, enabled, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWarehouseV1Input {\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateWarehouseV1Input createWarehouseV1Input = (CreateWarehouseV1Input) o; - return Objects.equals(this.metadataId, createWarehouseV1Input.metadataId) && - Objects.equals(this.name, createWarehouseV1Input.name) && - Objects.equals(this.enabled, createWarehouseV1Input.enabled) && - Objects.equals(this.settings, createWarehouseV1Input.settings); - } - - @Override - public int hashCode() { - return Objects.hash(metadataId, name, enabled, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateWarehouseV1Input {\n"); - sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("metadataId"); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("metadataId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("metadataId"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("metadataId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWarehouseV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateWarehouseV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWarehouseV1Input is not found in the empty JSON string", CreateWarehouseV1Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateWarehouseV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateWarehouseV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateWarehouseV1Input is not found in" + + " the empty JSON string", + CreateWarehouseV1Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateWarehouseV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWarehouseV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateWarehouseV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateWarehouseV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateWarehouseV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateWarehouseV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("metadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metadataId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metadataId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); } - } - if (!jsonObj.get("metadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `metadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadataId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateWarehouseV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateWarehouseV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateWarehouseV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateWarehouseV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateWarehouseV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateWarehouseV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateWarehouseV1Input - * @throws IOException if the JSON string is invalid with respect to CreateWarehouseV1Input - */ - public static CreateWarehouseV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateWarehouseV1Input.class); - } - - /** - * Convert an instance of CreateWarehouseV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWarehouseV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWarehouseV1Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateWarehouseV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateWarehouseV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateWarehouseV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWarehouseV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWarehouseV1Input + * @throws IOException if the JSON string is invalid with respect to CreateWarehouseV1Input + */ + public static CreateWarehouseV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWarehouseV1Input.class); + } + + /** + * Convert an instance of CreateWarehouseV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java index a5d4da62..30777dac 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Warehouse1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the newly created Warehouse. - */ +/** Returns the newly created Warehouse. */ @ApiModel(description = "Returns the newly created Warehouse.") - public class CreateWarehouseV1Output { - public static final String SERIALIZED_NAME_WAREHOUSE = "warehouse"; - @SerializedName(SERIALIZED_NAME_WAREHOUSE) - private Warehouse1 warehouse; + public static final String SERIALIZED_NAME_WAREHOUSE = "warehouse"; - public CreateWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_WAREHOUSE) + private Warehouse1 warehouse; - public CreateWarehouseV1Output warehouse(Warehouse1 warehouse) { - - this.warehouse = warehouse; - return this; - } + public CreateWarehouseV1Output() {} - /** - * Get warehouse - * @return warehouse - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public CreateWarehouseV1Output warehouse(Warehouse1 warehouse) { - public Warehouse1 getWarehouse() { - return warehouse; - } + this.warehouse = warehouse; + return this; + } + /** + * Get warehouse + * + * @return warehouse + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Warehouse1 getWarehouse() { + return warehouse; + } - public void setWarehouse(Warehouse1 warehouse) { - this.warehouse = warehouse; - } + public void setWarehouse(Warehouse1 warehouse) { + this.warehouse = warehouse; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWarehouseV1Output createWarehouseV1Output = (CreateWarehouseV1Output) o; + return Objects.equals(this.warehouse, createWarehouseV1Output.warehouse); + } + @Override + public int hashCode() { + return Objects.hash(warehouse); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWarehouseV1Output {\n"); + sb.append(" warehouse: ").append(toIndentedString(warehouse)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateWarehouseV1Output createWarehouseV1Output = (CreateWarehouseV1Output) o; - return Objects.equals(this.warehouse, createWarehouseV1Output.warehouse); - } - - @Override - public int hashCode() { - return Objects.hash(warehouse); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateWarehouseV1Output {\n"); - sb.append(" warehouse: ").append(toIndentedString(warehouse)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("warehouse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("warehouse"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("warehouse"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("warehouse"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWarehouseV1Output is not found in the empty JSON string", CreateWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateWarehouseV1Output is not found" + + " in the empty JSON string", + CreateWarehouseV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateWarehouseV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateWarehouseV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWarehouseV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateWarehouseV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to CreateWarehouseV1Output + */ + public static CreateWarehouseV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWarehouseV1Output.class); } - } - - /** - * Create an instance of CreateWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to CreateWarehouseV1Output - */ - public static CreateWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateWarehouseV1Output.class); - } - - /** - * Convert an instance of CreateWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java index 19377d4a..458f9990 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.CreateWorkspaceRegulationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * CreateWorkspaceRegulation200Response - */ - +/** CreateWorkspaceRegulation200Response */ public class CreateWorkspaceRegulation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private CreateWorkspaceRegulationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public CreateWorkspaceRegulation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private CreateWorkspaceRegulationV1Output data; - public CreateWorkspaceRegulation200Response data(CreateWorkspaceRegulationV1Output data) { - - this.data = data; - return this; - } + public CreateWorkspaceRegulation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public CreateWorkspaceRegulation200Response data(CreateWorkspaceRegulationV1Output data) { - public CreateWorkspaceRegulationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateWorkspaceRegulationV1Output getData() { + return data; + } - public void setData(CreateWorkspaceRegulationV1Output data) { - this.data = data; - } + public void setData(CreateWorkspaceRegulationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWorkspaceRegulation200Response createWorkspaceRegulation200Response = + (CreateWorkspaceRegulation200Response) o; + return Objects.equals(this.data, createWorkspaceRegulation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWorkspaceRegulation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateWorkspaceRegulation200Response createWorkspaceRegulation200Response = (CreateWorkspaceRegulation200Response) o; - return Objects.equals(this.data, createWorkspaceRegulation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateWorkspaceRegulation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWorkspaceRegulation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateWorkspaceRegulation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWorkspaceRegulation200Response is not found in the empty JSON string", CreateWorkspaceRegulation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateWorkspaceRegulation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateWorkspaceRegulation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateWorkspaceRegulation200Response" + + " is not found in the empty JSON string", + CreateWorkspaceRegulation200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateWorkspaceRegulation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWorkspaceRegulation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateWorkspaceRegulation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateWorkspaceRegulation200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateWorkspaceRegulation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateWorkspaceRegulation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateWorkspaceRegulation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateWorkspaceRegulation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateWorkspaceRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWorkspaceRegulation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWorkspaceRegulation200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateWorkspaceRegulation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateWorkspaceRegulation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateWorkspaceRegulation200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWorkspaceRegulation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWorkspaceRegulation200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateWorkspaceRegulation200Response + */ + public static CreateWorkspaceRegulation200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWorkspaceRegulation200Response.class); } - } - - /** - * Create an instance of CreateWorkspaceRegulation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateWorkspaceRegulation200Response - * @throws IOException if the JSON string is invalid with respect to CreateWorkspaceRegulation200Response - */ - public static CreateWorkspaceRegulation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateWorkspaceRegulation200Response.class); - } - - /** - * Convert an instance of CreateWorkspaceRegulation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of CreateWorkspaceRegulation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index 5256527e..b841249b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,388 +10,403 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The input to create a Workspace regulation. - */ +/** The input to create a Workspace regulation. */ @ApiModel(description = "The input to create a Workspace regulation.") - public class CreateWorkspaceRegulationV1Input { - /** - * The regulation type to create. - */ - @JsonAdapter(RegulationTypeEnum.Adapter.class) - public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - - DELETE_INTERNAL("DELETE_INTERNAL"), - - DELETE_ONLY("DELETE_ONLY"), - - SUPPRESS_ONLY("SUPPRESS_ONLY"), - - SUPPRESS_WITH_DELETE("SUPPRESS_WITH_DELETE"), - - UNSUPPRESS("UNSUPPRESS"); - - private String value; - - RegulationTypeEnum(String value) { - this.value = value; - } + /** The regulation type to create. */ + @JsonAdapter(RegulationTypeEnum.Adapter.class) + public enum RegulationTypeEnum { + BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - public String getValue() { - return value; - } + DELETE_INTERNAL("DELETE_INTERNAL"), - @Override - public String toString() { - return String.valueOf(value); - } + DELETE_ONLY("DELETE_ONLY"), - public static RegulationTypeEnum fromValue(String value) { - for (RegulationTypeEnum b : RegulationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + SUPPRESS_ONLY("SUPPRESS_ONLY"), - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final RegulationTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return RegulationTypeEnum.fromValue(value); - } - } - } + SUPPRESS_WITH_DELETE("SUPPRESS_WITH_DELETE"), - public static final String SERIALIZED_NAME_REGULATION_TYPE = "regulationType"; - @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) - private RegulationTypeEnum regulationType; + UNSUPPRESS("UNSUPPRESS"); - /** - * The subject type. Use `objectId` for Cloud Source regulations. - */ - @JsonAdapter(SubjectTypeEnum.Adapter.class) - public enum SubjectTypeEnum { - OBJECT_ID("OBJECT_ID"), - - USER_ID("USER_ID"); + private String value; - private String value; + RegulationTypeEnum(String value) { + this.value = value; + } - SubjectTypeEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); - } + public static RegulationTypeEnum fromValue(String value) { + for (RegulationTypeEnum b : RegulationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static SubjectTypeEnum fromValue(String value) { - for (SubjectTypeEnum b : SubjectTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RegulationTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RegulationTypeEnum.fromValue(value); + } } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SubjectTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SubjectTypeEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_REGULATION_TYPE = "regulationType"; + + @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) + private RegulationTypeEnum regulationType; + + /** The subject type. Use `objectId` for Cloud Source regulations. */ + @JsonAdapter(SubjectTypeEnum.Adapter.class) + public enum SubjectTypeEnum { + OBJECT_ID("OBJECT_ID"), + + USER_ID("USER_ID"); - public static final String SERIALIZED_NAME_SUBJECT_TYPE = "subjectType"; - @SerializedName(SERIALIZED_NAME_SUBJECT_TYPE) - private SubjectTypeEnum subjectType; + private String value; - public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; - @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) - private List subjectIds = new ArrayList<>(); + SubjectTypeEnum(String value) { + this.value = value; + } - public CreateWorkspaceRegulationV1Input() { - } + public String getValue() { + return value; + } - public CreateWorkspaceRegulationV1Input regulationType(RegulationTypeEnum regulationType) { - - this.regulationType = regulationType; - return this; - } + @Override + public String toString() { + return String.valueOf(value); + } - /** - * The regulation type to create. - * @return regulationType - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The regulation type to create.") + public static SubjectTypeEnum fromValue(String value) { + for (SubjectTypeEnum b : SubjectTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public RegulationTypeEnum getRegulationType() { - return regulationType; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SubjectTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SubjectTypeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_SUBJECT_TYPE = "subjectType"; - public void setRegulationType(RegulationTypeEnum regulationType) { - this.regulationType = regulationType; - } + @SerializedName(SERIALIZED_NAME_SUBJECT_TYPE) + private SubjectTypeEnum subjectType; + public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; - public CreateWorkspaceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { - - this.subjectType = subjectType; - return this; - } + @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) + private List subjectIds = new ArrayList<>(); - /** - * The subject type. Use `objectId` for Cloud Source regulations. - * @return subjectType - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The subject type. Use `objectId` for Cloud Source regulations.") + public CreateWorkspaceRegulationV1Input() {} - public SubjectTypeEnum getSubjectType() { - return subjectType; - } + public CreateWorkspaceRegulationV1Input regulationType(RegulationTypeEnum regulationType) { + this.regulationType = regulationType; + return this; + } - public void setSubjectType(SubjectTypeEnum subjectType) { - this.subjectType = subjectType; - } + /** + * The regulation type to create. + * + * @return regulationType + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The regulation type to create.") + public RegulationTypeEnum getRegulationType() { + return regulationType; + } + public void setRegulationType(RegulationTypeEnum regulationType) { + this.regulationType = regulationType; + } - public CreateWorkspaceRegulationV1Input subjectIds(List subjectIds) { - - this.subjectIds = subjectIds; - return this; - } + public CreateWorkspaceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { - public CreateWorkspaceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { - this.subjectIds.add(subjectIdsItem); - return this; - } + this.subjectType = subjectType; + return this; + } - /** - * The user or object ids of the subjects to regulate. Config API note: equal to `parent` but allows an array. - * @return subjectIds - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The user or object ids of the subjects to regulate. Config API note: equal to `parent` but allows an array.") + /** + * The subject type. Use `objectId` for Cloud Source regulations. + * + * @return subjectType + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The subject type. Use `objectId` for Cloud Source regulations.") + public SubjectTypeEnum getSubjectType() { + return subjectType; + } - public List getSubjectIds() { - return subjectIds; - } + public void setSubjectType(SubjectTypeEnum subjectType) { + this.subjectType = subjectType; + } + public CreateWorkspaceRegulationV1Input subjectIds(List subjectIds) { - public void setSubjectIds(List subjectIds) { - this.subjectIds = subjectIds; - } + this.subjectIds = subjectIds; + return this; + } + public CreateWorkspaceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { + this.subjectIds.add(subjectIdsItem); + return this; + } + /** + * The user or object ids of the subjects to regulate. Config API note: equal to + * `parent` but allows an array. + * + * @return subjectIds + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The user or object ids of the subjects to regulate. Config API note: equal to" + + " `parent` but allows an array.") + public List getSubjectIds() { + return subjectIds; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public void setSubjectIds(List subjectIds) { + this.subjectIds = subjectIds; } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input = + (CreateWorkspaceRegulationV1Input) o; + return Objects.equals(this.regulationType, createWorkspaceRegulationV1Input.regulationType) + && Objects.equals(this.subjectType, createWorkspaceRegulationV1Input.subjectType) + && Objects.equals(this.subjectIds, createWorkspaceRegulationV1Input.subjectIds); } - CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input = (CreateWorkspaceRegulationV1Input) o; - return Objects.equals(this.regulationType, createWorkspaceRegulationV1Input.regulationType) && - Objects.equals(this.subjectType, createWorkspaceRegulationV1Input.subjectType) && - Objects.equals(this.subjectIds, createWorkspaceRegulationV1Input.subjectIds); - } - - @Override - public int hashCode() { - return Objects.hash(regulationType, subjectType, subjectIds); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateWorkspaceRegulationV1Input {\n"); - sb.append(" regulationType: ").append(toIndentedString(regulationType)).append("\n"); - sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); - sb.append(" subjectIds: ").append(toIndentedString(subjectIds)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + @Override + public int hashCode() { + return Objects.hash(regulationType, subjectType, subjectIds); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulationType"); - openapiFields.add("subjectType"); - openapiFields.add("subjectIds"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulationType"); - openapiRequiredFields.add("subjectType"); - openapiRequiredFields.add("subjectIds"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWorkspaceRegulationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateWorkspaceRegulationV1Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWorkspaceRegulationV1Input is not found in the empty JSON string", CreateWorkspaceRegulationV1Input.openapiRequiredFields.toString())); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWorkspaceRegulationV1Input {\n"); + sb.append(" regulationType: ").append(toIndentedString(regulationType)).append("\n"); + sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); + sb.append(" subjectIds: ").append(toIndentedString(subjectIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateWorkspaceRegulationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWorkspaceRegulationV1Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulationType"); + openapiFields.add("subjectType"); + openapiFields.add("subjectIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulationType"); + openapiRequiredFields.add("subjectType"); + openapiRequiredFields.add("subjectIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateWorkspaceRegulationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateWorkspaceRegulationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateWorkspaceRegulationV1Input is" + + " not found in the empty JSON string", + CreateWorkspaceRegulationV1Input.openapiRequiredFields.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateWorkspaceRegulationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateWorkspaceRegulationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateWorkspaceRegulationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateWorkspaceRegulationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("regulationType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regulationType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("regulationType").toString())); + } + if (!jsonObj.get("subjectType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subjectType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("subjectType").toString())); + } + // ensure the required json array is present + if (jsonObj.get("subjectIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("subjectIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `subjectIds` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("subjectIds").toString())); } - } - if (!jsonObj.get("regulationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regulationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regulationType").toString())); - } - if (!jsonObj.get("subjectType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subjectType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subjectType").toString())); - } - // ensure the required json array is present - if (jsonObj.get("subjectIds") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("subjectIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subjectIds` to be an array in the JSON string but got `%s`", jsonObj.get("subjectIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateWorkspaceRegulationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateWorkspaceRegulationV1Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateWorkspaceRegulationV1Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateWorkspaceRegulationV1Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateWorkspaceRegulationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateWorkspaceRegulationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateWorkspaceRegulationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateWorkspaceRegulationV1Input - */ - public static CreateWorkspaceRegulationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateWorkspaceRegulationV1Input.class); - } - - /** - * Convert an instance of CreateWorkspaceRegulationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWorkspaceRegulationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWorkspaceRegulationV1Input' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateWorkspaceRegulationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateWorkspaceRegulationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateWorkspaceRegulationV1Input read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWorkspaceRegulationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWorkspaceRegulationV1Input + * @throws IOException if the JSON string is invalid with respect to + * CreateWorkspaceRegulationV1Input + */ + public static CreateWorkspaceRegulationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWorkspaceRegulationV1Input.class); + } + + /** + * Convert an instance of CreateWorkspaceRegulationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java index 4abc1ce7..39c2bf7f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,208 +10,210 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of a create Workspace regulation call. - */ +/** The output of a create Workspace regulation call. */ @ApiModel(description = "The output of a create Workspace regulation call.") - public class CreateWorkspaceRegulationV1Output { - public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; - @SerializedName(SERIALIZED_NAME_REGULATE_ID) - private String regulateId; + public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; - public CreateWorkspaceRegulationV1Output() { - } + @SerializedName(SERIALIZED_NAME_REGULATE_ID) + private String regulateId; - public CreateWorkspaceRegulationV1Output regulateId(String regulateId) { - - this.regulateId = regulateId; - return this; - } + public CreateWorkspaceRegulationV1Output() {} - /** - * The id of the created regulation. - * @return regulateId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the created regulation.") + public CreateWorkspaceRegulationV1Output regulateId(String regulateId) { - public String getRegulateId() { - return regulateId; - } + this.regulateId = regulateId; + return this; + } + /** + * The id of the created regulation. + * + * @return regulateId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the created regulation.") + public String getRegulateId() { + return regulateId; + } - public void setRegulateId(String regulateId) { - this.regulateId = regulateId; - } + public void setRegulateId(String regulateId) { + this.regulateId = regulateId; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWorkspaceRegulationV1Output createWorkspaceRegulationV1Output = + (CreateWorkspaceRegulationV1Output) o; + return Objects.equals(this.regulateId, createWorkspaceRegulationV1Output.regulateId); + } + @Override + public int hashCode() { + return Objects.hash(regulateId); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWorkspaceRegulationV1Output {\n"); + sb.append(" regulateId: ").append(toIndentedString(regulateId)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - CreateWorkspaceRegulationV1Output createWorkspaceRegulationV1Output = (CreateWorkspaceRegulationV1Output) o; - return Objects.equals(this.regulateId, createWorkspaceRegulationV1Output.regulateId); - } - - @Override - public int hashCode() { - return Objects.hash(regulateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateWorkspaceRegulationV1Output {\n"); - sb.append(" regulateId: ").append(toIndentedString(regulateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulateId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulateId"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulateId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulateId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWorkspaceRegulationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateWorkspaceRegulationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CreateWorkspaceRegulationV1Output is not found in the empty JSON string", CreateWorkspaceRegulationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateWorkspaceRegulationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateWorkspaceRegulationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateWorkspaceRegulationV1Output is" + + " not found in the empty JSON string", + CreateWorkspaceRegulationV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateWorkspaceRegulationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateWorkspaceRegulationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateWorkspaceRegulationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateWorkspaceRegulationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateWorkspaceRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateWorkspaceRegulationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("regulateId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regulateId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("regulateId").toString())); } - } - if (!jsonObj.get("regulateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regulateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regulateId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateWorkspaceRegulationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateWorkspaceRegulationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CreateWorkspaceRegulationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateWorkspaceRegulationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateWorkspaceRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of CreateWorkspaceRegulationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateWorkspaceRegulationV1Output - * @throws IOException if the JSON string is invalid with respect to CreateWorkspaceRegulationV1Output - */ - public static CreateWorkspaceRegulationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateWorkspaceRegulationV1Output.class); - } - - /** - * Convert an instance of CreateWorkspaceRegulationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateWorkspaceRegulationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateWorkspaceRegulationV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateWorkspaceRegulationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateWorkspaceRegulationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateWorkspaceRegulationV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateWorkspaceRegulationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateWorkspaceRegulationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateWorkspaceRegulationV1Output + */ + public static CreateWorkspaceRegulationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateWorkspaceRegulationV1Output.class); + } + + /** + * Convert an instance of CreateWorkspaceRegulationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java index dea6ea0a..62576565 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,188 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteDestinationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteDestination200Response - */ - +/** DeleteDestination200Response */ public class DeleteDestination200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteDestinationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteDestination200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteDestinationV1Output data; - public DeleteDestination200Response data(DeleteDestinationV1Output data) { - - this.data = data; - return this; - } + public DeleteDestination200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteDestination200Response data(DeleteDestinationV1Output data) { - public DeleteDestinationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteDestinationV1Output getData() { + return data; + } - public void setData(DeleteDestinationV1Output data) { - this.data = data; - } + public void setData(DeleteDestinationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteDestination200Response deleteDestination200Response = + (DeleteDestination200Response) o; + return Objects.equals(this.data, deleteDestination200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteDestination200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteDestination200Response deleteDestination200Response = (DeleteDestination200Response) o; - return Objects.equals(this.data, deleteDestination200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteDestination200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteDestination200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteDestination200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteDestination200Response is not found in the empty JSON string", DeleteDestination200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteDestination200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteDestination200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteDestination200Response is not" + + " found in the empty JSON string", + DeleteDestination200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteDestination200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteDestination200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteDestination200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteDestination200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteDestination200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteDestination200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteDestination200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteDestination200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteDestination200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteDestination200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteDestination200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteDestination200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteDestination200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteDestination200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteDestination200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteDestination200Response + */ + public static DeleteDestination200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteDestination200Response.class); } - } - - /** - * Create an instance of DeleteDestination200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteDestination200Response - * @throws IOException if the JSON string is invalid with respect to DeleteDestination200Response - */ - public static DeleteDestination200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteDestination200Response.class); - } - - /** - * Convert an instance of DeleteDestination200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteDestination200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java index e94147b2..cc72f524 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,249 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of a Destination deletion. - */ +/** Returns the status of a Destination deletion. */ @ApiModel(description = "Returns the status of a Destination deletion.") - public class DeleteDestinationV1Output { - /** - * The status of the Warehouse deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the Warehouse deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteDestinationV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteDestinationV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteDestinationV1Output() {} - /** - * The status of the Warehouse deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") + public DeleteDestinationV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the Warehouse deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteDestinationV1Output deleteDestinationV1Output = (DeleteDestinationV1Output) o; + return Objects.equals(this.status, deleteDestinationV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteDestinationV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteDestinationV1Output deleteDestinationV1Output = (DeleteDestinationV1Output) o; - return Objects.equals(this.status, deleteDestinationV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteDestinationV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteDestinationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteDestinationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteDestinationV1Output is not found in the empty JSON string", DeleteDestinationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteDestinationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteDestinationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteDestinationV1Output is not found" + + " in the empty JSON string", + DeleteDestinationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteDestinationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteDestinationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteDestinationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteDestinationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteDestinationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteDestinationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteDestinationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteDestinationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteDestinationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteDestinationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteDestinationV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteDestinationV1Output - */ - public static DeleteDestinationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteDestinationV1Output.class); - } - - /** - * Convert an instance of DeleteDestinationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteDestinationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteDestinationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteDestinationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteDestinationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteDestinationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteDestinationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteDestinationV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteDestinationV1Output + */ + public static DeleteDestinationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteDestinationV1Output.class); + } + + /** + * Convert an instance of DeleteDestinationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java index cf9f0057..f4764bb7 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteFunctionV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteFunction200Response - */ - +/** DeleteFunction200Response */ public class DeleteFunction200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteFunctionV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteFunction200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteFunctionV1Output data; - public DeleteFunction200Response data(DeleteFunctionV1Output data) { - - this.data = data; - return this; - } + public DeleteFunction200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteFunction200Response data(DeleteFunctionV1Output data) { - public DeleteFunctionV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteFunctionV1Output getData() { + return data; + } - public void setData(DeleteFunctionV1Output data) { - this.data = data; - } + public void setData(DeleteFunctionV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteFunction200Response deleteFunction200Response = (DeleteFunction200Response) o; + return Objects.equals(this.data, deleteFunction200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteFunction200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteFunction200Response deleteFunction200Response = (DeleteFunction200Response) o; - return Objects.equals(this.data, deleteFunction200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteFunction200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteFunction200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteFunction200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteFunction200Response is not found in the empty JSON string", DeleteFunction200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteFunction200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteFunction200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteFunction200Response is not found" + + " in the empty JSON string", + DeleteFunction200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteFunction200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteFunction200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteFunction200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteFunction200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteFunction200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteFunction200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteFunction200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteFunction200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteFunction200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteFunction200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteFunction200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteFunction200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteFunction200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteFunction200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteFunction200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteFunction200Response + * @throws IOException if the JSON string is invalid with respect to DeleteFunction200Response + */ + public static DeleteFunction200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteFunction200Response.class); } - } - - /** - * Create an instance of DeleteFunction200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteFunction200Response - * @throws IOException if the JSON string is invalid with respect to DeleteFunction200Response - */ - public static DeleteFunction200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteFunction200Response.class); - } - - /** - * Convert an instance of DeleteFunction200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteFunction200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java index db510a17..235daeb4 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,248 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Delete a single Function. - */ +/** Delete a single Function. */ @ApiModel(description = "Delete a single Function.") - public class DeleteFunctionV1Output { - /** - * The status of the operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteFunctionV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteFunctionV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteFunctionV1Output() {} - /** - * The status of the operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") + public DeleteFunctionV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteFunctionV1Output deleteFunctionV1Output = (DeleteFunctionV1Output) o; + return Objects.equals(this.status, deleteFunctionV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteFunctionV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteFunctionV1Output deleteFunctionV1Output = (DeleteFunctionV1Output) o; - return Objects.equals(this.status, deleteFunctionV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteFunctionV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteFunctionV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteFunctionV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteFunctionV1Output is not found in the empty JSON string", DeleteFunctionV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteFunctionV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteFunctionV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteFunctionV1Output is not found in" + + " the empty JSON string", + DeleteFunctionV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteFunctionV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteFunctionV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteFunctionV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteFunctionV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteFunctionV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteFunctionV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteFunctionV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteFunctionV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteFunctionV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteFunctionV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteFunctionV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteFunctionV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteFunctionV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteFunctionV1Output - */ - public static DeleteFunctionV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteFunctionV1Output.class); - } - - /** - * Convert an instance of DeleteFunctionV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteFunctionV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteFunctionV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteFunctionV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteFunctionV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteFunctionV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteFunctionV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteFunctionV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteFunctionV1Output + */ + public static DeleteFunctionV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteFunctionV1Output.class); + } + + /** + * Convert an instance of DeleteFunctionV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java index 7fe21153..1d215577 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteInvitesV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteInvites200Response - */ - +/** DeleteInvites200Response */ public class DeleteInvites200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteInvitesV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteInvites200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteInvitesV1Output data; - public DeleteInvites200Response data(DeleteInvitesV1Output data) { - - this.data = data; - return this; - } + public DeleteInvites200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteInvites200Response data(DeleteInvitesV1Output data) { - public DeleteInvitesV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteInvitesV1Output getData() { + return data; + } - public void setData(DeleteInvitesV1Output data) { - this.data = data; - } + public void setData(DeleteInvitesV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInvites200Response deleteInvites200Response = (DeleteInvites200Response) o; + return Objects.equals(this.data, deleteInvites200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInvites200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteInvites200Response deleteInvites200Response = (DeleteInvites200Response) o; - return Objects.equals(this.data, deleteInvites200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteInvites200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteInvites200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteInvites200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteInvites200Response is not found in the empty JSON string", DeleteInvites200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteInvites200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInvites200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteInvites200Response is not found" + + " in the empty JSON string", + DeleteInvites200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteInvites200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteInvites200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInvites200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInvites200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteInvites200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteInvites200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteInvites200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteInvites200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteInvites200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInvites200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteInvites200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteInvites200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteInvites200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInvites200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInvites200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInvites200Response + * @throws IOException if the JSON string is invalid with respect to DeleteInvites200Response + */ + public static DeleteInvites200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInvites200Response.class); } - } - - /** - * Create an instance of DeleteInvites200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteInvites200Response - * @throws IOException if the JSON string is invalid with respect to DeleteInvites200Response - */ - public static DeleteInvites200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteInvites200Response.class); - } - - /** - * Convert an instance of DeleteInvites200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteInvites200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java index 09c0e161..24ae6f08 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,248 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of the removal operation. - */ +/** Returns the status of the removal operation. */ @ApiModel(description = "Returns the status of the removal operation.") - public class DeleteInvitesV1Output { - /** - * The status of the invite deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the invite deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteInvitesV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteInvitesV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteInvitesV1Output() {} - /** - * The status of the invite deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the invite deletion operation.") + public DeleteInvitesV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the invite deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the invite deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInvitesV1Output deleteInvitesV1Output = (DeleteInvitesV1Output) o; + return Objects.equals(this.status, deleteInvitesV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInvitesV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteInvitesV1Output deleteInvitesV1Output = (DeleteInvitesV1Output) o; - return Objects.equals(this.status, deleteInvitesV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteInvitesV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteInvitesV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteInvitesV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteInvitesV1Output is not found in the empty JSON string", DeleteInvitesV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteInvitesV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInvitesV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteInvitesV1Output is not found in" + + " the empty JSON string", + DeleteInvitesV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteInvitesV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteInvitesV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInvitesV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInvitesV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteInvitesV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteInvitesV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteInvitesV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteInvitesV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteInvitesV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteInvitesV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteInvitesV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteInvitesV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteInvitesV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteInvitesV1Output - */ - public static DeleteInvitesV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteInvitesV1Output.class); - } - - /** - * Convert an instance of DeleteInvitesV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInvitesV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteInvitesV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteInvitesV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteInvitesV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInvitesV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInvitesV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInvitesV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteInvitesV1Output + */ + public static DeleteInvitesV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInvitesV1Output.class); + } + + /** + * Convert an instance of DeleteInvitesV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java index c79b2320..2fe7c3ee 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteLabelAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteLabel200Response - */ - +/** DeleteLabel200Response */ public class DeleteLabel200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteLabelAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteLabel200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteLabelV1Output data; - public DeleteLabel200Response data(DeleteLabelAlphaOutput data) { - - this.data = data; - return this; - } + public DeleteLabel200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteLabel200Response data(DeleteLabelV1Output data) { - public DeleteLabelAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteLabelV1Output getData() { + return data; + } - public void setData(DeleteLabelAlphaOutput data) { - this.data = data; - } + public void setData(DeleteLabelV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLabel200Response deleteLabel200Response = (DeleteLabel200Response) o; + return Objects.equals(this.data, deleteLabel200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteLabel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteLabel200Response deleteLabel200Response = (DeleteLabel200Response) o; - return Objects.equals(this.data, deleteLabel200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteLabel200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabel200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteLabel200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteLabel200Response is not found in the empty JSON string", DeleteLabel200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteLabel200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteLabel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteLabel200Response is not found in" + + " the empty JSON string", + DeleteLabel200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteLabel200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteLabel200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteLabel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteLabel200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteLabel200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteLabel200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteLabel200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteLabel200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteLabel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteLabel200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteLabel200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteLabel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteLabel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteLabel200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteLabel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteLabel200Response + * @throws IOException if the JSON string is invalid with respect to DeleteLabel200Response + */ + public static DeleteLabel200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteLabel200Response.class); } - } - - /** - * Create an instance of DeleteLabel200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteLabel200Response - * @throws IOException if the JSON string is invalid with respect to DeleteLabel200Response - */ - public static DeleteLabel200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteLabel200Response.class); - } - - /** - * Convert an instance of DeleteLabel200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteLabel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java index a708c89c..2f2eff55 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteLabelV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteLabel200Response1 - */ - +/** DeleteLabel200Response1 */ public class DeleteLabel200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteLabelV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteLabel200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteLabelAlphaOutput data; - public DeleteLabel200Response1 data(DeleteLabelV1Output data) { - - this.data = data; - return this; - } + public DeleteLabel200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteLabel200Response1 data(DeleteLabelAlphaOutput data) { - public DeleteLabelV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteLabelAlphaOutput getData() { + return data; + } - public void setData(DeleteLabelV1Output data) { - this.data = data; - } + public void setData(DeleteLabelAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLabel200Response1 deleteLabel200Response1 = (DeleteLabel200Response1) o; + return Objects.equals(this.data, deleteLabel200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteLabel200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteLabel200Response1 deleteLabel200Response1 = (DeleteLabel200Response1) o; - return Objects.equals(this.data, deleteLabel200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteLabel200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabel200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteLabel200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteLabel200Response1 is not found in the empty JSON string", DeleteLabel200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteLabel200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteLabel200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteLabel200Response1 is not found" + + " in the empty JSON string", + DeleteLabel200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteLabel200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteLabel200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteLabel200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteLabel200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteLabel200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteLabel200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteLabel200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteLabel200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteLabel200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteLabel200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteLabel200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteLabel200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteLabel200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteLabel200Response1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteLabel200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteLabel200Response1 + * @throws IOException if the JSON string is invalid with respect to DeleteLabel200Response1 + */ + public static DeleteLabel200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteLabel200Response1.class); } - } - - /** - * Create an instance of DeleteLabel200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteLabel200Response1 - * @throws IOException if the JSON string is invalid with respect to DeleteLabel200Response1 - */ - public static DeleteLabel200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteLabel200Response1.class); - } - - /** - * Convert an instance of DeleteLabel200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteLabel200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java index 01fed1a1..d249a822 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,248 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of a label deletion. - */ +/** Returns the status of a label deletion. */ @ApiModel(description = "Returns the status of a label deletion.") - public class DeleteLabelAlphaOutput { - /** - * The status of the label deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the label deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteLabelAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteLabelAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteLabelAlphaOutput() {} - /** - * The status of the label deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the label deletion operation.") + public DeleteLabelAlphaOutput status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the label deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the label deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLabelAlphaOutput deleteLabelAlphaOutput = (DeleteLabelAlphaOutput) o; + return Objects.equals(this.status, deleteLabelAlphaOutput.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteLabelAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteLabelAlphaOutput deleteLabelAlphaOutput = (DeleteLabelAlphaOutput) o; - return Objects.equals(this.status, deleteLabelAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteLabelAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabelAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteLabelAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteLabelAlphaOutput is not found in the empty JSON string", DeleteLabelAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteLabelAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteLabelAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteLabelAlphaOutput is not found in" + + " the empty JSON string", + DeleteLabelAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteLabelAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteLabelAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteLabelAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteLabelAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteLabelAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteLabelAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteLabelAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteLabelAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteLabelAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteLabelAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteLabelAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteLabelAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteLabelAlphaOutput - * @throws IOException if the JSON string is invalid with respect to DeleteLabelAlphaOutput - */ - public static DeleteLabelAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteLabelAlphaOutput.class); - } - - /** - * Convert an instance of DeleteLabelAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteLabelAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteLabelAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteLabelAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteLabelAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteLabelAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteLabelAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteLabelAlphaOutput + * @throws IOException if the JSON string is invalid with respect to DeleteLabelAlphaOutput + */ + public static DeleteLabelAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteLabelAlphaOutput.class); + } + + /** + * Convert an instance of DeleteLabelAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java index dc65d9ad..c68c0e08 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,248 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of a label deletion. - */ +/** Returns the status of a label deletion. */ @ApiModel(description = "Returns the status of a label deletion.") - public class DeleteLabelV1Output { - /** - * The status of the label deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the label deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteLabelV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteLabelV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteLabelV1Output() {} - /** - * The status of the label deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the label deletion operation.") + public DeleteLabelV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the label deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the label deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLabelV1Output deleteLabelV1Output = (DeleteLabelV1Output) o; + return Objects.equals(this.status, deleteLabelV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteLabelV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteLabelV1Output deleteLabelV1Output = (DeleteLabelV1Output) o; - return Objects.equals(this.status, deleteLabelV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteLabelV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabelV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteLabelV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteLabelV1Output is not found in the empty JSON string", DeleteLabelV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteLabelV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteLabelV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteLabelV1Output is not found in" + + " the empty JSON string", + DeleteLabelV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteLabelV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteLabelV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteLabelV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteLabelV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteLabelV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteLabelV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteLabelV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteLabelV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteLabelV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteLabelV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteLabelV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteLabelV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteLabelV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteLabelV1Output - */ - public static DeleteLabelV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteLabelV1Output.class); - } - - /** - * Convert an instance of DeleteLabelV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteLabelV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteLabelV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteLabelV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteLabelV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteLabelV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteLabelV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteLabelV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteLabelV1Output + */ + public static DeleteLabelV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteLabelV1Output.class); + } + + /** + * Convert an instance of DeleteLabelV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java index 05fb14c1..da2d4e2e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteRegulationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteRegulation200Response - */ - +/** DeleteRegulation200Response */ public class DeleteRegulation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteRegulationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteRegulation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteRegulationV1Output data; - public DeleteRegulation200Response data(DeleteRegulationV1Output data) { - - this.data = data; - return this; - } + public DeleteRegulation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteRegulation200Response data(DeleteRegulationV1Output data) { - public DeleteRegulationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteRegulationV1Output getData() { + return data; + } - public void setData(DeleteRegulationV1Output data) { - this.data = data; - } + public void setData(DeleteRegulationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteRegulation200Response deleteRegulation200Response = (DeleteRegulation200Response) o; + return Objects.equals(this.data, deleteRegulation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteRegulation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteRegulation200Response deleteRegulation200Response = (DeleteRegulation200Response) o; - return Objects.equals(this.data, deleteRegulation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteRegulation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteRegulation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteRegulation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteRegulation200Response is not found in the empty JSON string", DeleteRegulation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteRegulation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteRegulation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteRegulation200Response is not" + + " found in the empty JSON string", + DeleteRegulation200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteRegulation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteRegulation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteRegulation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteRegulation200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteRegulation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteRegulation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteRegulation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteRegulation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteRegulation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteRegulation200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteRegulation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteRegulation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteRegulation200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteRegulation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteRegulation200Response + * @throws IOException if the JSON string is invalid with respect to DeleteRegulation200Response + */ + public static DeleteRegulation200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteRegulation200Response.class); } - } - - /** - * Create an instance of DeleteRegulation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteRegulation200Response - * @throws IOException if the JSON string is invalid with respect to DeleteRegulation200Response - */ - public static DeleteRegulation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteRegulation200Response.class); - } - - /** - * Convert an instance of DeleteRegulation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteRegulation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java index ae77dac6..b033fc03 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,249 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of the delete regulation call. - */ +/** The output of the delete regulation call. */ @ApiModel(description = "The output of the delete regulation call.") - public class DeleteRegulationV1Output { - /** - * The status of the deletion call. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the deletion call. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteRegulationV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteRegulationV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteRegulationV1Output() {} - /** - * The status of the deletion call. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the deletion call.") + public DeleteRegulationV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the deletion call. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the deletion call.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteRegulationV1Output deleteRegulationV1Output = (DeleteRegulationV1Output) o; + return Objects.equals(this.status, deleteRegulationV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteRegulationV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteRegulationV1Output deleteRegulationV1Output = (DeleteRegulationV1Output) o; - return Objects.equals(this.status, deleteRegulationV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteRegulationV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteRegulationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteRegulationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteRegulationV1Output is not found in the empty JSON string", DeleteRegulationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteRegulationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteRegulationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteRegulationV1Output is not found" + + " in the empty JSON string", + DeleteRegulationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteRegulationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteRegulationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteRegulationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteRegulationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteRegulationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteRegulationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteRegulationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteRegulationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteRegulationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteRegulationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteRegulationV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteRegulationV1Output - */ - public static DeleteRegulationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteRegulationV1Output.class); - } - - /** - * Convert an instance of DeleteRegulationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteRegulationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteRegulationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteRegulationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteRegulationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteRegulationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteRegulationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteRegulationV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteRegulationV1Output + */ + public static DeleteRegulationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteRegulationV1Output.class); + } + + /** + * Convert an instance of DeleteRegulationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java index 657359f9..5e1a34dd 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteSourceAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteSource200Response - */ - +/** DeleteSource200Response */ public class DeleteSource200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteSourceAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteSource200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteSourceV1Output data; - public DeleteSource200Response data(DeleteSourceAlphaOutput data) { - - this.data = data; - return this; - } + public DeleteSource200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteSource200Response data(DeleteSourceV1Output data) { - public DeleteSourceAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteSourceV1Output getData() { + return data; + } - public void setData(DeleteSourceAlphaOutput data) { - this.data = data; - } + public void setData(DeleteSourceV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSource200Response deleteSource200Response = (DeleteSource200Response) o; + return Objects.equals(this.data, deleteSource200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteSource200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteSource200Response deleteSource200Response = (DeleteSource200Response) o; - return Objects.equals(this.data, deleteSource200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteSource200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSource200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteSource200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteSource200Response is not found in the empty JSON string", DeleteSource200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteSource200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteSource200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteSource200Response is not found" + + " in the empty JSON string", + DeleteSource200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteSource200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteSource200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteSource200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteSource200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteSource200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteSource200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteSource200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteSource200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteSource200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteSource200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteSource200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteSource200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteSource200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteSource200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteSource200Response + * @throws IOException if the JSON string is invalid with respect to DeleteSource200Response + */ + public static DeleteSource200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteSource200Response.class); } - } - - /** - * Create an instance of DeleteSource200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteSource200Response - * @throws IOException if the JSON string is invalid with respect to DeleteSource200Response - */ - public static DeleteSource200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteSource200Response.class); - } - - /** - * Convert an instance of DeleteSource200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteSource200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java index f3130083..e45d3c7e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteSourceV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteSource200Response1 - */ - +/** DeleteSource200Response1 */ public class DeleteSource200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteSourceV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteSource200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteSourceAlphaOutput data; - public DeleteSource200Response1 data(DeleteSourceV1Output data) { - - this.data = data; - return this; - } + public DeleteSource200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteSource200Response1 data(DeleteSourceAlphaOutput data) { - public DeleteSourceV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteSourceAlphaOutput getData() { + return data; + } - public void setData(DeleteSourceV1Output data) { - this.data = data; - } + public void setData(DeleteSourceAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSource200Response1 deleteSource200Response1 = (DeleteSource200Response1) o; + return Objects.equals(this.data, deleteSource200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteSource200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteSource200Response1 deleteSource200Response1 = (DeleteSource200Response1) o; - return Objects.equals(this.data, deleteSource200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteSource200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSource200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteSource200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteSource200Response1 is not found in the empty JSON string", DeleteSource200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteSource200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteSource200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteSource200Response1 is not found" + + " in the empty JSON string", + DeleteSource200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteSource200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteSource200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteSource200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteSource200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteSource200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteSource200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteSource200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteSource200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteSource200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteSource200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteSource200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteSource200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteSource200Response1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteSource200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteSource200Response1 + * @throws IOException if the JSON string is invalid with respect to DeleteSource200Response1 + */ + public static DeleteSource200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteSource200Response1.class); } - } - - /** - * Create an instance of DeleteSource200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteSource200Response1 - * @throws IOException if the JSON string is invalid with respect to DeleteSource200Response1 - */ - public static DeleteSource200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteSource200Response1.class); - } - - /** - * Convert an instance of DeleteSource200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteSource200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java index de7ff898..1d96829d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,249 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of a Source deletion. - */ +/** Returns the status of a Source deletion. */ @ApiModel(description = "Returns the status of a Source deletion.") - public class DeleteSourceAlphaOutput { - /** - * The status of the Source deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the Source deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteSourceAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteSourceAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteSourceAlphaOutput() {} - /** - * The status of the Source deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Source deletion operation.") + public DeleteSourceAlphaOutput status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the Source deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the Source deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSourceAlphaOutput deleteSourceAlphaOutput = (DeleteSourceAlphaOutput) o; + return Objects.equals(this.status, deleteSourceAlphaOutput.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteSourceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteSourceAlphaOutput deleteSourceAlphaOutput = (DeleteSourceAlphaOutput) o; - return Objects.equals(this.status, deleteSourceAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteSourceAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSourceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteSourceAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteSourceAlphaOutput is not found in the empty JSON string", DeleteSourceAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteSourceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteSourceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteSourceAlphaOutput is not found" + + " in the empty JSON string", + DeleteSourceAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteSourceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteSourceAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteSourceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteSourceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteSourceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteSourceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteSourceAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteSourceAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteSourceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteSourceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to DeleteSourceAlphaOutput - */ - public static DeleteSourceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteSourceAlphaOutput.class); - } - - /** - * Convert an instance of DeleteSourceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteSourceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteSourceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteSourceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteSourceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteSourceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteSourceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to DeleteSourceAlphaOutput + */ + public static DeleteSourceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteSourceAlphaOutput.class); + } + + /** + * Convert an instance of DeleteSourceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java index 50bc2f1f..f05522d2 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,248 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of a Source deletion. - */ +/** Returns the status of a Source deletion. */ @ApiModel(description = "Returns the status of a Source deletion.") - public class DeleteSourceV1Output { - /** - * The status of the Source deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the Source deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteSourceV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteSourceV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteSourceV1Output() {} - /** - * The status of the Source deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Source deletion operation.") + public DeleteSourceV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the Source deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the Source deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSourceV1Output deleteSourceV1Output = (DeleteSourceV1Output) o; + return Objects.equals(this.status, deleteSourceV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteSourceV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteSourceV1Output deleteSourceV1Output = (DeleteSourceV1Output) o; - return Objects.equals(this.status, deleteSourceV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteSourceV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSourceV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteSourceV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteSourceV1Output is not found in the empty JSON string", DeleteSourceV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteSourceV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteSourceV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteSourceV1Output is not found in" + + " the empty JSON string", + DeleteSourceV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteSourceV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteSourceV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteSourceV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteSourceV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteSourceV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteSourceV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteSourceV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteSourceV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteSourceV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteSourceV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteSourceV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteSourceV1Output - */ - public static DeleteSourceV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteSourceV1Output.class); - } - - /** - * Convert an instance of DeleteSourceV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteSourceV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteSourceV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteSourceV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteSourceV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteSourceV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteSourceV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteSourceV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteSourceV1Output + */ + public static DeleteSourceV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteSourceV1Output.class); + } + + /** + * Convert an instance of DeleteSourceV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java index 8ad14f44..4636fad0 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteTrackingPlanV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteTrackingPlan200Response - */ - +/** DeleteTrackingPlan200Response */ public class DeleteTrackingPlan200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTrackingPlanV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteTrackingPlan200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteTrackingPlanV1Output data; - public DeleteTrackingPlan200Response data(DeleteTrackingPlanV1Output data) { - - this.data = data; - return this; - } + public DeleteTrackingPlan200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteTrackingPlan200Response data(DeleteTrackingPlanV1Output data) { - public DeleteTrackingPlanV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteTrackingPlanV1Output getData() { + return data; + } - public void setData(DeleteTrackingPlanV1Output data) { - this.data = data; - } + public void setData(DeleteTrackingPlanV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTrackingPlan200Response deleteTrackingPlan200Response = + (DeleteTrackingPlan200Response) o; + return Objects.equals(this.data, deleteTrackingPlan200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTrackingPlan200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteTrackingPlan200Response deleteTrackingPlan200Response = (DeleteTrackingPlan200Response) o; - return Objects.equals(this.data, deleteTrackingPlan200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTrackingPlan200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteTrackingPlan200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTrackingPlan200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteTrackingPlan200Response is not found in the empty JSON string", DeleteTrackingPlan200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTrackingPlan200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTrackingPlan200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTrackingPlan200Response is not" + + " found in the empty JSON string", + DeleteTrackingPlan200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTrackingPlan200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteTrackingPlan200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTrackingPlan200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTrackingPlan200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTrackingPlan200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteTrackingPlan200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTrackingPlan200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTrackingPlan200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTrackingPlan200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTrackingPlan200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTrackingPlan200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTrackingPlan200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTrackingPlan200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteTrackingPlan200Response + */ + public static DeleteTrackingPlan200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTrackingPlan200Response.class); } - } - - /** - * Create an instance of DeleteTrackingPlan200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTrackingPlan200Response - * @throws IOException if the JSON string is invalid with respect to DeleteTrackingPlan200Response - */ - public static DeleteTrackingPlan200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTrackingPlan200Response.class); - } - - /** - * Convert an instance of DeleteTrackingPlan200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteTrackingPlan200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java index efda298a..689bd19d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,249 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Result of a DeleteTrackingPlan call. - */ +/** Result of a DeleteTrackingPlan call. */ @ApiModel(description = "Result of a DeleteTrackingPlan call.") - public class DeleteTrackingPlanV1Output { - /** - * The operation status. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The operation status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteTrackingPlanV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteTrackingPlanV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteTrackingPlanV1Output() {} - /** - * The operation status. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") + public DeleteTrackingPlanV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The operation status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The operation status.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTrackingPlanV1Output deleteTrackingPlanV1Output = (DeleteTrackingPlanV1Output) o; + return Objects.equals(this.status, deleteTrackingPlanV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTrackingPlanV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteTrackingPlanV1Output deleteTrackingPlanV1Output = (DeleteTrackingPlanV1Output) o; - return Objects.equals(this.status, deleteTrackingPlanV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTrackingPlanV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteTrackingPlanV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTrackingPlanV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteTrackingPlanV1Output is not found in the empty JSON string", DeleteTrackingPlanV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteTrackingPlanV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTrackingPlanV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTrackingPlanV1Output is not" + + " found in the empty JSON string", + DeleteTrackingPlanV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteTrackingPlanV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTrackingPlanV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTrackingPlanV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTrackingPlanV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteTrackingPlanV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTrackingPlanV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteTrackingPlanV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTrackingPlanV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteTrackingPlanV1Output - */ - public static DeleteTrackingPlanV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTrackingPlanV1Output.class); - } - - /** - * Convert an instance of DeleteTrackingPlanV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTrackingPlanV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteTrackingPlanV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTrackingPlanV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTrackingPlanV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTrackingPlanV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTrackingPlanV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteTrackingPlanV1Output + */ + public static DeleteTrackingPlanV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTrackingPlanV1Output.class); + } + + /** + * Convert an instance of DeleteTrackingPlanV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index 7db4a34a..f589305d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteTransformationBetaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteTransformation200Response - */ - +/** DeleteTransformation200Response */ public class DeleteTransformation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTransformationBetaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteTransformation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteTransformationBetaOutput data; - public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { - - this.data = data; - return this; - } + public DeleteTransformation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { - public DeleteTransformationBetaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteTransformationBetaOutput getData() { + return data; + } - public void setData(DeleteTransformationBetaOutput data) { - this.data = data; - } + public void setData(DeleteTransformationBetaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformation200Response deleteTransformation200Response = + (DeleteTransformation200Response) o; + return Objects.equals(this.data, deleteTransformation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteTransformation200Response deleteTransformation200Response = (DeleteTransformation200Response) o; - return Objects.equals(this.data, deleteTransformation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTransformation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteTransformation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTransformation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteTransformation200Response is not found in the empty JSON string", DeleteTransformation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformation200Response is not" + + " found in the empty JSON string", + DeleteTransformation200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTransformation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteTransformation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformation200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTransformation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTransformation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteTransformation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTransformation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTransformation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformation200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformation200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformation200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformation200Response + */ + public static DeleteTransformation200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformation200Response.class); } - } - - /** - * Create an instance of DeleteTransformation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTransformation200Response - * @throws IOException if the JSON string is invalid with respect to DeleteTransformation200Response - */ - public static DeleteTransformation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTransformation200Response.class); - } - - /** - * Convert an instance of DeleteTransformation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteTransformation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java index 900a9722..7e945d45 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,254 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of delete Transformation. - */ +/** The output of delete Transformation. */ @ApiModel(description = "The output of delete Transformation.") - public class DeleteTransformationBetaOutput { - /** - * The operation status. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The operation status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteTransformationBetaOutput() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteTransformationBetaOutput status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteTransformationBetaOutput() {} - /** - * The operation status. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") + public DeleteTransformationBetaOutput status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The operation status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The operation status.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationBetaOutput deleteTransformationBetaOutput = + (DeleteTransformationBetaOutput) o; + return Objects.equals(this.status, deleteTransformationBetaOutput.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationBetaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteTransformationBetaOutput deleteTransformationBetaOutput = (DeleteTransformationBetaOutput) o; - return Objects.equals(this.status, deleteTransformationBetaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTransformationBetaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteTransformationBetaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTransformationBetaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteTransformationBetaOutput is not found in the empty JSON string", DeleteTransformationBetaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationBetaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationBetaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationBetaOutput is not" + + " found in the empty JSON string", + DeleteTransformationBetaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTransformationBetaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteTransformationBetaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationBetaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationBetaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteTransformationBetaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationBetaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTransformationBetaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTransformationBetaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteTransformationBetaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTransformationBetaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTransformationBetaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteTransformationBetaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTransformationBetaOutput - * @throws IOException if the JSON string is invalid with respect to DeleteTransformationBetaOutput - */ - public static DeleteTransformationBetaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaOutput.class); - } - - /** - * Convert an instance of DeleteTransformationBetaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationBetaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationBetaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationBetaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationBetaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationBetaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationBetaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationBetaOutput + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationBetaOutput + */ + public static DeleteTransformationBetaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaOutput.class); + } + + /** + * Convert an instance of DeleteTransformationBetaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java index f273034c..96d43d9e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteUserGroupV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteUserGroup200Response - */ - +/** DeleteUserGroup200Response */ public class DeleteUserGroup200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteUserGroupV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteUserGroup200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteUserGroupV1Output data; - public DeleteUserGroup200Response data(DeleteUserGroupV1Output data) { - - this.data = data; - return this; - } + public DeleteUserGroup200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteUserGroup200Response data(DeleteUserGroupV1Output data) { - public DeleteUserGroupV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteUserGroupV1Output getData() { + return data; + } - public void setData(DeleteUserGroupV1Output data) { - this.data = data; - } + public void setData(DeleteUserGroupV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserGroup200Response deleteUserGroup200Response = (DeleteUserGroup200Response) o; + return Objects.equals(this.data, deleteUserGroup200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteUserGroup200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteUserGroup200Response deleteUserGroup200Response = (DeleteUserGroup200Response) o; - return Objects.equals(this.data, deleteUserGroup200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteUserGroup200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUserGroup200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteUserGroup200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteUserGroup200Response is not found in the empty JSON string", DeleteUserGroup200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteUserGroup200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteUserGroup200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteUserGroup200Response is not" + + " found in the empty JSON string", + DeleteUserGroup200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteUserGroup200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteUserGroup200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteUserGroup200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteUserGroup200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteUserGroup200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteUserGroup200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteUserGroup200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteUserGroup200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteUserGroup200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteUserGroup200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteUserGroup200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteUserGroup200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteUserGroup200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteUserGroup200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteUserGroup200Response + * @throws IOException if the JSON string is invalid with respect to DeleteUserGroup200Response + */ + public static DeleteUserGroup200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteUserGroup200Response.class); } - } - - /** - * Create an instance of DeleteUserGroup200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteUserGroup200Response - * @throws IOException if the JSON string is invalid with respect to DeleteUserGroup200Response - */ - public static DeleteUserGroup200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteUserGroup200Response.class); - } - - /** - * Convert an instance of DeleteUserGroup200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteUserGroup200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java index 103398b7..5c4ebfbb 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,251 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of the completed deletion operation. - */ +/** Returns the status of the completed deletion operation. */ @ApiModel(description = "Returns the status of the completed deletion operation.") - public class DeleteUserGroupV1Output { - /** - * A flag indicating the status of a successful deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** A flag indicating the status of a successful deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteUserGroupV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteUserGroupV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteUserGroupV1Output() {} - /** - * A flag indicating the status of a successful deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A flag indicating the status of a successful deletion operation.") + public DeleteUserGroupV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * A flag indicating the status of a successful deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A flag indicating the status of a successful deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserGroupV1Output deleteUserGroupV1Output = (DeleteUserGroupV1Output) o; + return Objects.equals(this.status, deleteUserGroupV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteUserGroupV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteUserGroupV1Output deleteUserGroupV1Output = (DeleteUserGroupV1Output) o; - return Objects.equals(this.status, deleteUserGroupV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteUserGroupV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUserGroupV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteUserGroupV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteUserGroupV1Output is not found in the empty JSON string", DeleteUserGroupV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteUserGroupV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteUserGroupV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteUserGroupV1Output is not found" + + " in the empty JSON string", + DeleteUserGroupV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteUserGroupV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteUserGroupV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteUserGroupV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteUserGroupV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteUserGroupV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteUserGroupV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteUserGroupV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteUserGroupV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteUserGroupV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteUserGroupV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteUserGroupV1Output - */ - public static DeleteUserGroupV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteUserGroupV1Output.class); - } - - /** - * Convert an instance of DeleteUserGroupV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteUserGroupV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteUserGroupV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteUserGroupV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteUserGroupV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteUserGroupV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteUserGroupV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteUserGroupV1Output + */ + public static DeleteUserGroupV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteUserGroupV1Output.class); + } + + /** + * Convert an instance of DeleteUserGroupV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java index f915668e..5fe2f85c 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteUsersV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteUsers200Response - */ - +/** DeleteUsers200Response */ public class DeleteUsers200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteUsersV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteUsers200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteUsersV1Output data; - public DeleteUsers200Response data(DeleteUsersV1Output data) { - - this.data = data; - return this; - } + public DeleteUsers200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteUsers200Response data(DeleteUsersV1Output data) { - public DeleteUsersV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteUsersV1Output getData() { + return data; + } - public void setData(DeleteUsersV1Output data) { - this.data = data; - } + public void setData(DeleteUsersV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUsers200Response deleteUsers200Response = (DeleteUsers200Response) o; + return Objects.equals(this.data, deleteUsers200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteUsers200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteUsers200Response deleteUsers200Response = (DeleteUsers200Response) o; - return Objects.equals(this.data, deleteUsers200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteUsers200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUsers200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteUsers200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteUsers200Response is not found in the empty JSON string", DeleteUsers200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteUsers200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteUsers200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteUsers200Response is not found in" + + " the empty JSON string", + DeleteUsers200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteUsers200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteUsers200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteUsers200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteUsers200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteUsers200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteUsers200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteUsers200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteUsers200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteUsers200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteUsers200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteUsers200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteUsers200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteUsers200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteUsers200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteUsers200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteUsers200Response + * @throws IOException if the JSON string is invalid with respect to DeleteUsers200Response + */ + public static DeleteUsers200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteUsers200Response.class); } - } - - /** - * Create an instance of DeleteUsers200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteUsers200Response - * @throws IOException if the JSON string is invalid with respect to DeleteUsers200Response - */ - public static DeleteUsers200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteUsers200Response.class); - } - - /** - * Convert an instance of DeleteUsers200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteUsers200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java index 2e17f1e0..a9f74677 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,250 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of the removal operation. - */ +/** Returns the status of the removal operation. */ @ApiModel(description = "Returns the status of the removal operation.") - public class DeleteUsersV1Output { - /** - * A flag that indicates the status of a successful deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** A flag that indicates the status of a successful deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteUsersV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteUsersV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteUsersV1Output() {} - /** - * A flag that indicates the status of a successful deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A flag that indicates the status of a successful deletion operation.") + public DeleteUsersV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * A flag that indicates the status of a successful deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A flag that indicates the status of a successful deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUsersV1Output deleteUsersV1Output = (DeleteUsersV1Output) o; + return Objects.equals(this.status, deleteUsersV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteUsersV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteUsersV1Output deleteUsersV1Output = (DeleteUsersV1Output) o; - return Objects.equals(this.status, deleteUsersV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteUsersV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUsersV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteUsersV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteUsersV1Output is not found in the empty JSON string", DeleteUsersV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteUsersV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteUsersV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteUsersV1Output is not found in" + + " the empty JSON string", + DeleteUsersV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteUsersV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteUsersV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteUsersV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteUsersV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteUsersV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteUsersV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteUsersV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteUsersV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteUsersV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteUsersV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteUsersV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteUsersV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteUsersV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteUsersV1Output - */ - public static DeleteUsersV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteUsersV1Output.class); - } - - /** - * Convert an instance of DeleteUsersV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteUsersV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteUsersV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteUsersV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteUsersV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteUsersV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteUsersV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteUsersV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteUsersV1Output + */ + public static DeleteUsersV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteUsersV1Output.class); + } + + /** + * Convert an instance of DeleteUsersV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java index 39898d08..95c7c25f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DeleteWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DeleteWarehouse200Response - */ - +/** DeleteWarehouse200Response */ public class DeleteWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DeleteWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteWarehouseV1Output data; - public DeleteWarehouse200Response data(DeleteWarehouseV1Output data) { - - this.data = data; - return this; - } + public DeleteWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DeleteWarehouse200Response data(DeleteWarehouseV1Output data) { - public DeleteWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteWarehouseV1Output getData() { + return data; + } - public void setData(DeleteWarehouseV1Output data) { - this.data = data; - } + public void setData(DeleteWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteWarehouse200Response deleteWarehouse200Response = (DeleteWarehouse200Response) o; + return Objects.equals(this.data, deleteWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteWarehouse200Response deleteWarehouse200Response = (DeleteWarehouse200Response) o; - return Objects.equals(this.data, deleteWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteWarehouse200Response is not found in the empty JSON string", DeleteWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteWarehouse200Response is not" + + " found in the empty JSON string", + DeleteWarehouse200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteWarehouse200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteWarehouse200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteWarehouse200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteWarehouse200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteWarehouse200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to DeleteWarehouse200Response + */ + public static DeleteWarehouse200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteWarehouse200Response.class); } - } - - /** - * Create an instance of DeleteWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to DeleteWarehouse200Response - */ - public static DeleteWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteWarehouse200Response.class); - } - - /** - * Convert an instance of DeleteWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DeleteWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java index 101e82b0..12046fd1 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,249 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the status of a Warehouse deletion. - */ +/** Returns the status of a Warehouse deletion. */ @ApiModel(description = "Returns the status of a Warehouse deletion.") - public class DeleteWarehouseV1Output { - /** - * The status of the Warehouse deletion operation. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** The status of the Warehouse deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public DeleteWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public DeleteWarehouseV1Output status(StatusEnum status) { - - this.status = status; - return this; - } + public DeleteWarehouseV1Output() {} - /** - * The status of the Warehouse deletion operation. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") + public DeleteWarehouseV1Output status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * The status of the Warehouse deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteWarehouseV1Output deleteWarehouseV1Output = (DeleteWarehouseV1Output) o; + return Objects.equals(this.status, deleteWarehouseV1Output.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteWarehouseV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeleteWarehouseV1Output deleteWarehouseV1Output = (DeleteWarehouseV1Output) o; - return Objects.equals(this.status, deleteWarehouseV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteWarehouseV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteWarehouseV1Output is not found in the empty JSON string", DeleteWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteWarehouseV1Output is not found" + + " in the empty JSON string", + DeleteWarehouseV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteWarehouseV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteWarehouseV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeleteWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DeleteWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to DeleteWarehouseV1Output - */ - public static DeleteWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteWarehouseV1Output.class); - } - - /** - * Convert an instance of DeleteWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteWarehouseV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteWarehouseV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to DeleteWarehouseV1Output + */ + public static DeleteWarehouseV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteWarehouseV1Output.class); + } + + /** + * Convert an instance of DeleteWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java index 3b10e83d..9b9a1b5e 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,287 +10,295 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.MetricBeta; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The delivery metrics summary returned. - */ +/** The delivery metrics summary returned. */ @ApiModel(description = "The delivery metrics summary returned.") - public class DeliveryMetricsSummary { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_METRICS = "metrics"; - @SerializedName(SERIALIZED_NAME_METRICS) - private List metrics = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public DeliveryMetricsSummary() { - } + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - public DeliveryMetricsSummary sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; - /** - * The Source id. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id. Config API note: analogous to `parent`.") + public static final String SERIALIZED_NAME_METRICS = "metrics"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_METRICS) + private List metrics = new ArrayList<>(); + public DeliveryMetricsSummary() {} - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + public DeliveryMetricsSummary sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public DeliveryMetricsSummary destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The Destination metadata id. - * @return destinationMetadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Destination metadata id.") + /** + * The Source id. Config API note: analogous to `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source id. Config API note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public String getDestinationMetadataId() { - return destinationMetadataId; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + public DeliveryMetricsSummary destinationMetadataId(String destinationMetadataId) { - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } + this.destinationMetadataId = destinationMetadataId; + return this; + } + /** + * The Destination metadata id. + * + * @return destinationMetadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Destination metadata id.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } - public DeliveryMetricsSummary metrics(List metrics) { - - this.metrics = metrics; - return this; - } + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } - public DeliveryMetricsSummary addMetricsItem(MetricBeta metricsItem) { - this.metrics.add(metricsItem); - return this; - } + public DeliveryMetricsSummary metrics(List metrics) { - /** - * The summary of event delivery metrics for the requested Destination. - * @return metrics - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The summary of event delivery metrics for the requested Destination.") + this.metrics = metrics; + return this; + } - public List getMetrics() { - return metrics; - } + public DeliveryMetricsSummary addMetricsItem(MetricBeta metricsItem) { + this.metrics.add(metricsItem); + return this; + } + /** + * The summary of event delivery metrics for the requested Destination. + * + * @return metrics + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The summary of event delivery metrics for the requested Destination.") + public List getMetrics() { + return metrics; + } - public void setMetrics(List metrics) { - this.metrics = metrics; - } + public void setMetrics(List metrics) { + this.metrics = metrics; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryMetricsSummary deliveryMetricsSummary = (DeliveryMetricsSummary) o; + return Objects.equals(this.sourceId, deliveryMetricsSummary.sourceId) + && Objects.equals( + this.destinationMetadataId, deliveryMetricsSummary.destinationMetadataId) + && Objects.equals(this.metrics, deliveryMetricsSummary.metrics); + } + @Override + public int hashCode() { + return Objects.hash(sourceId, destinationMetadataId, metrics); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryMetricsSummary {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeliveryMetricsSummary deliveryMetricsSummary = (DeliveryMetricsSummary) o; - return Objects.equals(this.sourceId, deliveryMetricsSummary.sourceId) && - Objects.equals(this.destinationMetadataId, deliveryMetricsSummary.destinationMetadataId) && - Objects.equals(this.metrics, deliveryMetricsSummary.metrics); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId, destinationMetadataId, metrics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeliveryMetricsSummary {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ").append(toIndentedString(destinationMetadataId)).append("\n"); - sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("metrics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("destinationMetadataId"); + openapiRequiredFields.add("metrics"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("metrics"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationMetadataId"); - openapiRequiredFields.add("metrics"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeliveryMetricsSummary - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeliveryMetricsSummary.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeliveryMetricsSummary is not found in the empty JSON string", DeliveryMetricsSummary.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeliveryMetricsSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeliveryMetricsSummary.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeliveryMetricsSummary is not found in" + + " the empty JSON string", + DeliveryMetricsSummary.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeliveryMetricsSummary.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeliveryMetricsSummary` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeliveryMetricsSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeliveryMetricsSummary` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeliveryMetricsSummary.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeliveryMetricsSummary.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationMetadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationMetadataId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("metrics").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metrics` to be an array in the JSON string but got `%s`", jsonObj.get("metrics").toString())); - } - - JsonArray jsonArraymetrics = jsonObj.getAsJsonArray("metrics"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeliveryMetricsSummary.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeliveryMetricsSummary' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeliveryMetricsSummary.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeliveryMetricsSummary value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeliveryMetricsSummary read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("metrics").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metrics` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("metrics").toString())); + } + + JsonArray jsonArraymetrics = jsonObj.getAsJsonArray("metrics"); } - } - - /** - * Create an instance of DeliveryMetricsSummary given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeliveryMetricsSummary - * @throws IOException if the JSON string is invalid with respect to DeliveryMetricsSummary - */ - public static DeliveryMetricsSummary fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeliveryMetricsSummary.class); - } - - /** - * Convert an instance of DeliveryMetricsSummary to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeliveryMetricsSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeliveryMetricsSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeliveryMetricsSummary.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeliveryMetricsSummary value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeliveryMetricsSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeliveryMetricsSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeliveryMetricsSummary + * @throws IOException if the JSON string is invalid with respect to DeliveryMetricsSummary + */ + public static DeliveryMetricsSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeliveryMetricsSummary.class); + } + + /** + * Convert an instance of DeliveryMetricsSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java index a24f143d..322a5a9f 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,287 +10,297 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.MetricBeta; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Defines the summary of delivery metrics for a Destination. - */ +/** Defines the summary of delivery metrics for a Destination. */ @ApiModel(description = "Defines the summary of delivery metrics for a Destination.") - public class DeliveryMetricsSummaryBeta { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_METRICS = "metrics"; - @SerializedName(SERIALIZED_NAME_METRICS) - private List metrics = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public DeliveryMetricsSummaryBeta() { - } + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - public DeliveryMetricsSummaryBeta sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; - /** - * The Source id. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id. Config API note: analogous to `parent`.") + public static final String SERIALIZED_NAME_METRICS = "metrics"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_METRICS) + private List metrics = new ArrayList<>(); + public DeliveryMetricsSummaryBeta() {} - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + public DeliveryMetricsSummaryBeta sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public DeliveryMetricsSummaryBeta destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The Destination metadata id. - * @return destinationMetadataId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Destination metadata id.") + /** + * The Source id. Config API note: analogous to `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source id. Config API note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public String getDestinationMetadataId() { - return destinationMetadataId; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + public DeliveryMetricsSummaryBeta destinationMetadataId(String destinationMetadataId) { - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } + this.destinationMetadataId = destinationMetadataId; + return this; + } + /** + * The Destination metadata id. + * + * @return destinationMetadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Destination metadata id.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } - public DeliveryMetricsSummaryBeta metrics(List metrics) { - - this.metrics = metrics; - return this; - } + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } - public DeliveryMetricsSummaryBeta addMetricsItem(MetricBeta metricsItem) { - this.metrics.add(metricsItem); - return this; - } + public DeliveryMetricsSummaryBeta metrics(List metrics) { - /** - * The summary of event delivery metrics for the requested Destination. - * @return metrics - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The summary of event delivery metrics for the requested Destination.") + this.metrics = metrics; + return this; + } - public List getMetrics() { - return metrics; - } + public DeliveryMetricsSummaryBeta addMetricsItem(MetricBeta metricsItem) { + this.metrics.add(metricsItem); + return this; + } + /** + * The summary of event delivery metrics for the requested Destination. + * + * @return metrics + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The summary of event delivery metrics for the requested Destination.") + public List getMetrics() { + return metrics; + } - public void setMetrics(List metrics) { - this.metrics = metrics; - } + public void setMetrics(List metrics) { + this.metrics = metrics; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryMetricsSummaryBeta deliveryMetricsSummaryBeta = (DeliveryMetricsSummaryBeta) o; + return Objects.equals(this.sourceId, deliveryMetricsSummaryBeta.sourceId) + && Objects.equals( + this.destinationMetadataId, + deliveryMetricsSummaryBeta.destinationMetadataId) + && Objects.equals(this.metrics, deliveryMetricsSummaryBeta.metrics); + } + @Override + public int hashCode() { + return Objects.hash(sourceId, destinationMetadataId, metrics); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryMetricsSummaryBeta {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DeliveryMetricsSummaryBeta deliveryMetricsSummaryBeta = (DeliveryMetricsSummaryBeta) o; - return Objects.equals(this.sourceId, deliveryMetricsSummaryBeta.sourceId) && - Objects.equals(this.destinationMetadataId, deliveryMetricsSummaryBeta.destinationMetadataId) && - Objects.equals(this.metrics, deliveryMetricsSummaryBeta.metrics); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId, destinationMetadataId, metrics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeliveryMetricsSummaryBeta {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ").append(toIndentedString(destinationMetadataId)).append("\n"); - sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("metrics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("destinationMetadataId"); + openapiRequiredFields.add("metrics"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("metrics"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationMetadataId"); - openapiRequiredFields.add("metrics"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeliveryMetricsSummaryBeta - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeliveryMetricsSummaryBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DeliveryMetricsSummaryBeta is not found in the empty JSON string", DeliveryMetricsSummaryBeta.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeliveryMetricsSummaryBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeliveryMetricsSummaryBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeliveryMetricsSummaryBeta is not" + + " found in the empty JSON string", + DeliveryMetricsSummaryBeta.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeliveryMetricsSummaryBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeliveryMetricsSummaryBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeliveryMetricsSummaryBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeliveryMetricsSummaryBeta` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeliveryMetricsSummaryBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeliveryMetricsSummaryBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationMetadataId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationMetadataId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("metrics").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `metrics` to be an array in the JSON string but got `%s`", jsonObj.get("metrics").toString())); - } - - JsonArray jsonArraymetrics = jsonObj.getAsJsonArray("metrics"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeliveryMetricsSummaryBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeliveryMetricsSummaryBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DeliveryMetricsSummaryBeta.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DeliveryMetricsSummaryBeta value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeliveryMetricsSummaryBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("metrics").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metrics` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("metrics").toString())); + } + + JsonArray jsonArraymetrics = jsonObj.getAsJsonArray("metrics"); } - } - - /** - * Create an instance of DeliveryMetricsSummaryBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeliveryMetricsSummaryBeta - * @throws IOException if the JSON string is invalid with respect to DeliveryMetricsSummaryBeta - */ - public static DeliveryMetricsSummaryBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeliveryMetricsSummaryBeta.class); - } - - /** - * Convert an instance of DeliveryMetricsSummaryBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeliveryMetricsSummaryBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeliveryMetricsSummaryBeta' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeliveryMetricsSummaryBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeliveryMetricsSummaryBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeliveryMetricsSummaryBeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeliveryMetricsSummaryBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeliveryMetricsSummaryBeta + * @throws IOException if the JSON string is invalid with respect to DeliveryMetricsSummaryBeta + */ + public static DeliveryMetricsSummaryBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeliveryMetricsSummaryBeta.class); + } + + /** + * Convert an instance of DeliveryMetricsSummaryBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java index 1472c8e4..fd2cba60 100644 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ b/src/main/java/com/segment/publicapi/models/Destination.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,394 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Metadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The Destination looked up. - */ +/** The Destination looked up. */ @ApiModel(description = "The Destination looked up.") - public class Destination { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); + public static final String SERIALIZED_NAME_ID = "id"; - public Destination() { - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public Destination id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_NAME = "name"; - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to `name`. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier of this instance of a Destination. Config API note: analogous to `name`.") + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata metadata; - public Destination name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - /** - * The name of this instance of a Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of this instance of a Destination. Config API note: equal to `displayName`.") + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); - public void setName(String name) { - this.name = name; - } + public Destination() {} + public Destination id(String id) { - public Destination enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + this.id = id; + return this; + } - /** - * Whether this instance of a Destination receives data. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this instance of a Destination receives data.") + /** + * The unique identifier of this instance of a Destination. Config API note: analogous to + * `name`. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The unique identifier of this instance of a Destination. Config API note:" + + " analogous to `name`.") + public String getId() { + return id; + } - public Boolean getEnabled() { - return enabled; - } + public void setId(String id) { + this.id = id; + } + public Destination name(String name) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.name = name; + return this; + } + /** + * The name of this instance of a Destination. Config API note: equal to + * `displayName`. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of this instance of a Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } - public Destination metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public Destination enabled(Boolean enabled) { - public Metadata getMetadata() { - return metadata; - } + this.enabled = enabled; + return this; + } + /** + * Whether this instance of a Destination receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether this instance of a Destination receives data.") + public Boolean getEnabled() { + return enabled; + } - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public Destination metadata(Metadata metadata) { - public Destination sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + this.metadata = metadata; + return this; + } - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`.") + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata getMetadata() { + return metadata; + } - public String getSourceId() { - return sourceId; - } + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + public Destination sourceId(String sourceId) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + this.sourceId = sourceId; + return this; + } + /** + * The id of a Source connected to this instance of a Destination. Config API note: analogous to + * `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of a Source connected to this instance of a Destination. Config API" + + " note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public Destination settings(Map settings) { - - this.settings = settings; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public Destination putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } + public Destination settings(Map settings) { - /** - * The collection of settings associated with a Destination. Config API note: equal to `config`. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The collection of settings associated with a Destination. Config API note: equal to `config`.") + this.settings = settings; + return this; + } - public Map getSettings() { - return settings; - } + public Destination putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + /** + * The collection of settings associated with a Destination. Config API note: equal to + * `config`. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The collection of settings associated with a Destination. Config API note:" + + " equal to `config`.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Destination destination = (Destination) o; + return Objects.equals(this.id, destination.id) + && Objects.equals(this.name, destination.name) + && Objects.equals(this.enabled, destination.enabled) + && Objects.equals(this.metadata, destination.metadata) + && Objects.equals(this.sourceId, destination.sourceId) + && Objects.equals(this.settings, destination.settings); + } + @Override + public int hashCode() { + return Objects.hash(id, name, enabled, metadata, sourceId, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Destination {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Destination destination = (Destination) o; - return Objects.equals(this.id, destination.id) && - Objects.equals(this.name, destination.name) && - Objects.equals(this.enabled, destination.enabled) && - Objects.equals(this.metadata, destination.metadata) && - Objects.equals(this.sourceId, destination.sourceId) && - Objects.equals(this.settings, destination.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("metadata"); + openapiFields.add("sourceId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Destination - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Destination.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Destination is not found in the empty JSON string", Destination.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Destination + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Destination.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Destination is not found in the empty" + + " JSON string", + Destination.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Destination.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Destination` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Destination.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Destination` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Destination.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Destination.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Destination' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Destination.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Destination value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Destination read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Destination.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Destination given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination - * @throws IOException if the JSON string is invalid with respect to Destination - */ - public static Destination fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination.class); - } - - /** - * Convert an instance of Destination to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of Destination given an JSON string + * + * @param jsonString JSON string + * @return An instance of Destination + * @throws IOException if the JSON string is invalid with respect to Destination + */ + public static Destination fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Destination.class); + } + + /** + * Convert an instance of Destination to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Destination1.java b/src/main/java/com/segment/publicapi/models/Destination1.java index 7f0e381f..61a64d3c 100644 --- a/src/main/java/com/segment/publicapi/models/Destination1.java +++ b/src/main/java/com/segment/publicapi/models/Destination1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,394 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Metadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The updated Destination. - */ +/** The updated Destination. */ @ApiModel(description = "The updated Destination.") - public class Destination1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); + public static final String SERIALIZED_NAME_ID = "id"; - public Destination1() { - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public Destination1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_NAME = "name"; - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to `name`. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier of this instance of a Destination. Config API note: analogous to `name`.") + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata metadata; - public Destination1 name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - /** - * The name of this instance of a Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of this instance of a Destination. Config API note: equal to `displayName`.") + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); - public void setName(String name) { - this.name = name; - } + public Destination1() {} + public Destination1 id(String id) { - public Destination1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + this.id = id; + return this; + } - /** - * Whether this instance of a Destination receives data. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this instance of a Destination receives data.") + /** + * The unique identifier of this instance of a Destination. Config API note: analogous to + * `name`. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The unique identifier of this instance of a Destination. Config API note:" + + " analogous to `name`.") + public String getId() { + return id; + } - public Boolean getEnabled() { - return enabled; - } + public void setId(String id) { + this.id = id; + } + public Destination1 name(String name) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.name = name; + return this; + } + /** + * The name of this instance of a Destination. Config API note: equal to + * `displayName`. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of this instance of a Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } - public Destination1 metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public Destination1 enabled(Boolean enabled) { - public Metadata getMetadata() { - return metadata; - } + this.enabled = enabled; + return this; + } + /** + * Whether this instance of a Destination receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether this instance of a Destination receives data.") + public Boolean getEnabled() { + return enabled; + } - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public Destination1 metadata(Metadata metadata) { - public Destination1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + this.metadata = metadata; + return this; + } - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`.") + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata getMetadata() { + return metadata; + } - public String getSourceId() { - return sourceId; - } + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + public Destination1 sourceId(String sourceId) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + this.sourceId = sourceId; + return this; + } + /** + * The id of a Source connected to this instance of a Destination. Config API note: analogous to + * `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of a Source connected to this instance of a Destination. Config API" + + " note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public Destination1 settings(Map settings) { - - this.settings = settings; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public Destination1 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } + public Destination1 settings(Map settings) { - /** - * The collection of settings associated with a Destination. Config API note: equal to `config`. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The collection of settings associated with a Destination. Config API note: equal to `config`.") + this.settings = settings; + return this; + } - public Map getSettings() { - return settings; - } + public Destination1 putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + /** + * The collection of settings associated with a Destination. Config API note: equal to + * `config`. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The collection of settings associated with a Destination. Config API note:" + + " equal to `config`.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Destination1 destination1 = (Destination1) o; + return Objects.equals(this.id, destination1.id) + && Objects.equals(this.name, destination1.name) + && Objects.equals(this.enabled, destination1.enabled) + && Objects.equals(this.metadata, destination1.metadata) + && Objects.equals(this.sourceId, destination1.sourceId) + && Objects.equals(this.settings, destination1.settings); + } + @Override + public int hashCode() { + return Objects.hash(id, name, enabled, metadata, sourceId, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Destination1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Destination1 destination1 = (Destination1) o; - return Objects.equals(this.id, destination1.id) && - Objects.equals(this.name, destination1.name) && - Objects.equals(this.enabled, destination1.enabled) && - Objects.equals(this.metadata, destination1.metadata) && - Objects.equals(this.sourceId, destination1.sourceId) && - Objects.equals(this.settings, destination1.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("metadata"); + openapiFields.add("sourceId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Destination1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Destination1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Destination1 is not found in the empty JSON string", Destination1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Destination1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Destination1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Destination1 is not found in the empty" + + " JSON string", + Destination1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Destination1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Destination1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Destination1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Destination1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Destination1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Destination1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Destination1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Destination1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Destination1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Destination1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Destination1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Destination1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination1 - * @throws IOException if the JSON string is invalid with respect to Destination1 - */ - public static Destination1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination1.class); - } - - /** - * Convert an instance of Destination1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of Destination1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Destination1 + * @throws IOException if the JSON string is invalid with respect to Destination1 + */ + public static Destination1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Destination1.class); + } + + /** + * Convert an instance of Destination1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Destination2.java b/src/main/java/com/segment/publicapi/models/Destination2.java index ca1ec12f..dca4749c 100644 --- a/src/main/java/com/segment/publicapi/models/Destination2.java +++ b/src/main/java/com/segment/publicapi/models/Destination2.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,394 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Metadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The created Destination. - */ +/** The created Destination. */ @ApiModel(description = "The created Destination.") - public class Destination2 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); + public static final String SERIALIZED_NAME_ID = "id"; - public Destination2() { - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public Destination2 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_NAME = "name"; - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to `name`. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier of this instance of a Destination. Config API note: analogous to `name`.") + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata metadata; - public Destination2 name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - /** - * The name of this instance of a Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of this instance of a Destination. Config API note: equal to `displayName`.") + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); - public void setName(String name) { - this.name = name; - } + public Destination2() {} + public Destination2 id(String id) { - public Destination2 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + this.id = id; + return this; + } - /** - * Whether this instance of a Destination receives data. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this instance of a Destination receives data.") + /** + * The unique identifier of this instance of a Destination. Config API note: analogous to + * `name`. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The unique identifier of this instance of a Destination. Config API note:" + + " analogous to `name`.") + public String getId() { + return id; + } - public Boolean getEnabled() { - return enabled; - } + public void setId(String id) { + this.id = id; + } + public Destination2 name(String name) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.name = name; + return this; + } + /** + * The name of this instance of a Destination. Config API note: equal to + * `displayName`. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of this instance of a Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } - public Destination2 metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public Destination2 enabled(Boolean enabled) { - public Metadata getMetadata() { - return metadata; - } + this.enabled = enabled; + return this; + } + /** + * Whether this instance of a Destination receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether this instance of a Destination receives data.") + public Boolean getEnabled() { + return enabled; + } - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public Destination2 metadata(Metadata metadata) { - public Destination2 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + this.metadata = metadata; + return this; + } - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`.") + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata getMetadata() { + return metadata; + } - public String getSourceId() { - return sourceId; - } + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + public Destination2 sourceId(String sourceId) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + this.sourceId = sourceId; + return this; + } + /** + * The id of a Source connected to this instance of a Destination. Config API note: analogous to + * `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of a Source connected to this instance of a Destination. Config API" + + " note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public Destination2 settings(Map settings) { - - this.settings = settings; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public Destination2 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } + public Destination2 settings(Map settings) { - /** - * The collection of settings associated with a Destination. Config API note: equal to `config`. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The collection of settings associated with a Destination. Config API note: equal to `config`.") + this.settings = settings; + return this; + } - public Map getSettings() { - return settings; - } + public Destination2 putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + /** + * The collection of settings associated with a Destination. Config API note: equal to + * `config`. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The collection of settings associated with a Destination. Config API note:" + + " equal to `config`.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Destination2 destination2 = (Destination2) o; + return Objects.equals(this.id, destination2.id) + && Objects.equals(this.name, destination2.name) + && Objects.equals(this.enabled, destination2.enabled) + && Objects.equals(this.metadata, destination2.metadata) + && Objects.equals(this.sourceId, destination2.sourceId) + && Objects.equals(this.settings, destination2.settings); + } + @Override + public int hashCode() { + return Objects.hash(id, name, enabled, metadata, sourceId, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Destination2 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Destination2 destination2 = (Destination2) o; - return Objects.equals(this.id, destination2.id) && - Objects.equals(this.name, destination2.name) && - Objects.equals(this.enabled, destination2.enabled) && - Objects.equals(this.metadata, destination2.metadata) && - Objects.equals(this.sourceId, destination2.sourceId) && - Objects.equals(this.settings, destination2.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("metadata"); + openapiFields.add("sourceId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Destination2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Destination2.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Destination2 is not found in the empty JSON string", Destination2.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Destination2 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Destination2.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Destination2 is not found in the empty" + + " JSON string", + Destination2.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Destination2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Destination2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Destination2.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Destination2` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Destination2.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Destination2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Destination2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Destination2.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Destination2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Destination2 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Destination2.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Destination2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination2 - * @throws IOException if the JSON string is invalid with respect to Destination2 - */ - public static Destination2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination2.class); - } - - /** - * Convert an instance of Destination2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of Destination2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Destination2 + * @throws IOException if the JSON string is invalid with respect to Destination2 + */ + public static Destination2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Destination2.class); + } + + /** + * Convert an instance of Destination2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java index 0ab61c17..476611b3 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,363 +10,375 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents a Destination filter action. - */ +/** Represents a Destination filter action. */ @ApiModel(description = "Represents a Destination filter action.") - public class DestinationFilterActionV1 { - /** - * The kind of Transformation to apply to any matched properties. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ALLOW_PROPERTIES("ALLOW_PROPERTIES"), - - DROP("DROP"), - - DROP_PROPERTIES("DROP_PROPERTIES"), - - SAMPLE("SAMPLE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } + /** The kind of Transformation to apply to any matched properties. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ALLOW_PROPERTIES("ALLOW_PROPERTIES"), - public String getValue() { - return value; - } + DROP("DROP"), - @Override - public String toString() { - return String.valueOf(value); - } + DROP_PROPERTIES("DROP_PROPERTIES"), + + SAMPLE("SAMPLE"); + + private String value; - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + TypeEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_FIELDS = "fields"; - @SerializedName(SERIALIZED_NAME_FIELDS) - private Map fields = null; + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static final String SERIALIZED_NAME_PERCENT = "percent"; - @SerializedName(SERIALIZED_NAME_PERCENT) - private BigDecimal percent; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } - public static final String SERIALIZED_NAME_PATH = "path"; - @SerializedName(SERIALIZED_NAME_PATH) - private String path; + public static final String SERIALIZED_NAME_TYPE = "type"; - public DestinationFilterActionV1() { - } + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; - public DestinationFilterActionV1 type(TypeEnum type) { - - this.type = type; - return this; - } + public static final String SERIALIZED_NAME_FIELDS = "fields"; - /** - * The kind of Transformation to apply to any matched properties. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The kind of Transformation to apply to any matched properties.") + @SerializedName(SERIALIZED_NAME_FIELDS) + private Map fields = null; - public TypeEnum getType() { - return type; - } + public static final String SERIALIZED_NAME_PERCENT = "percent"; + @SerializedName(SERIALIZED_NAME_PERCENT) + private BigDecimal percent; - public void setType(TypeEnum type) { - this.type = type; - } + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + private String path; - public DestinationFilterActionV1 fields(Map fields) { - - this.fields = fields; - return this; - } + public DestinationFilterActionV1() {} - public DestinationFilterActionV1 putFieldsItem(String key, Object fieldsItem) { - if (this.fields == null) { - this.fields = new HashMap<>(); - } - this.fields.put(key, fieldsItem); - return this; - } + public DestinationFilterActionV1 type(TypeEnum type) { - /** - * A dictionary of paths to object keys that this filter applies to. The literal string '' represents the top level of the object. - * @return fields - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A dictionary of paths to object keys that this filter applies to. The literal string '' represents the top level of the object.") + this.type = type; + return this; + } - public Map getFields() { - return fields; - } + /** + * The kind of Transformation to apply to any matched properties. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The kind of Transformation to apply to any matched properties.") + public TypeEnum getType() { + return type; + } + public void setType(TypeEnum type) { + this.type = type; + } - public void setFields(Map fields) { - this.fields = fields; - } + public DestinationFilterActionV1 fields(Map fields) { + this.fields = fields; + return this; + } - public DestinationFilterActionV1 percent(BigDecimal percent) { - - this.percent = percent; - return this; - } + public DestinationFilterActionV1 putFieldsItem(String key, Object fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } + this.fields.put(key, fieldsItem); + return this; + } - /** - * A decimal between 0 and 1 used for 'sample' type events and influences the likelihood of sampling to occur. - * @return percent - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A decimal between 0 and 1 used for 'sample' type events and influences the likelihood of sampling to occur.") + /** + * A dictionary of paths to object keys that this filter applies to. The literal string + * '' represents the top level of the object. + * + * @return fields + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A dictionary of paths to object keys that this filter applies to. The" + + " literal string '' represents the top level of the object.") + public Map getFields() { + return fields; + } - public BigDecimal getPercent() { - return percent; - } + public void setFields(Map fields) { + this.fields = fields; + } + public DestinationFilterActionV1 percent(BigDecimal percent) { - public void setPercent(BigDecimal percent) { - this.percent = percent; - } + this.percent = percent; + return this; + } + /** + * A decimal between 0 and 1 used for 'sample' type events and influences the likelihood + * of sampling to occur. + * + * @return percent + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A decimal between 0 and 1 used for 'sample' type events and influences the" + + " likelihood of sampling to occur.") + public BigDecimal getPercent() { + return percent; + } - public DestinationFilterActionV1 path(String path) { - - this.path = path; - return this; - } + public void setPercent(BigDecimal percent) { + this.percent = percent; + } - /** - * The JSON path to a property within a payload object from which Segment generates a deterministic sampling rate. - * @return path - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The JSON path to a property within a payload object from which Segment generates a deterministic sampling rate.") + public DestinationFilterActionV1 path(String path) { - public String getPath() { - return path; - } + this.path = path; + return this; + } + /** + * The JSON path to a property within a payload object from which Segment generates a + * deterministic sampling rate. + * + * @return path + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The JSON path to a property within a payload object from which Segment" + + " generates a deterministic sampling rate.") + public String getPath() { + return path; + } - public void setPath(String path) { - this.path = path; - } + public void setPath(String path) { + this.path = path; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationFilterActionV1 destinationFilterActionV1 = (DestinationFilterActionV1) o; + return Objects.equals(this.type, destinationFilterActionV1.type) + && Objects.equals(this.fields, destinationFilterActionV1.fields) + && Objects.equals(this.percent, destinationFilterActionV1.percent) + && Objects.equals(this.path, destinationFilterActionV1.path); + } + @Override + public int hashCode() { + return Objects.hash(type, fields, percent, path); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationFilterActionV1 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" percent: ").append(toIndentedString(percent)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationFilterActionV1 destinationFilterActionV1 = (DestinationFilterActionV1) o; - return Objects.equals(this.type, destinationFilterActionV1.type) && - Objects.equals(this.fields, destinationFilterActionV1.fields) && - Objects.equals(this.percent, destinationFilterActionV1.percent) && - Objects.equals(this.path, destinationFilterActionV1.path); - } - - @Override - public int hashCode() { - return Objects.hash(type, fields, percent, path); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationFilterActionV1 {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); - sb.append(" percent: ").append(toIndentedString(percent)).append("\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("fields"); + openapiFields.add("percent"); + openapiFields.add("path"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("fields"); - openapiFields.add("percent"); - openapiFields.add("path"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationFilterActionV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationFilterActionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationFilterActionV1 is not found in the empty JSON string", DestinationFilterActionV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationFilterActionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationFilterActionV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationFilterActionV1 is not found" + + " in the empty JSON string", + DestinationFilterActionV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationFilterActionV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationFilterActionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationFilterActionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationFilterActionV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationFilterActionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationFilterActionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) + && !jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `path` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("path").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationFilterActionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationFilterActionV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationFilterActionV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationFilterActionV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationFilterActionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationFilterActionV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationFilterActionV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationFilterActionV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationFilterActionV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationFilterActionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationFilterActionV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationFilterActionV1 - * @throws IOException if the JSON string is invalid with respect to DestinationFilterActionV1 - */ - public static DestinationFilterActionV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationFilterActionV1.class); - } - - /** - * Convert an instance of DestinationFilterActionV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of DestinationFilterActionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationFilterActionV1 + * @throws IOException if the JSON string is invalid with respect to DestinationFilterActionV1 + */ + public static DestinationFilterActionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationFilterActionV1.class); + } + + /** + * Convert an instance of DestinationFilterActionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java index 75d014a3..1309d666 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,521 +10,554 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationFilterActionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents a Destination filter. - */ +/** Represents a Destination filter. */ @ApiModel(description = "Represents a Destination filter.") - public class DestinationFilterV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; - public static final String SERIALIZED_NAME_TITLE = "title"; - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_IF = "if"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_IF) + private String _if; - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public DestinationFilterV1() { - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); - public DestinationFilterV1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_TITLE = "title"; - /** - * The unique id of this filter. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public void setId(String id) { - this.id = id; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public DestinationFilterV1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - /** - * The id of the Source associated with this filter. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + public DestinationFilterV1() {} - public DestinationFilterV1 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } + public DestinationFilterV1 id(String id) { - /** - * The id of the Destination associated with this filter. - * @return destinationId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Destination associated with this filter.") + this.id = id; + return this; + } - public String getDestinationId() { - return destinationId; - } + /** + * The unique id of this filter. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The unique id of this filter.") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } + public DestinationFilterV1 sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public DestinationFilterV1 _if(String _if) { - - this._if = _if; - return this; - } + /** + * The id of the Source associated with this filter. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public String getSourceId() { + return sourceId; + } - /** - * A condition that defines whether to apply this filter to a payload. - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A condition that defines whether to apply this filter to a payload.") + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public String getIf() { - return _if; - } + public DestinationFilterV1 destinationId(String destinationId) { + this.destinationId = destinationId; + return this; + } - public void setIf(String _if) { - this._if = _if; - } + /** + * The id of the Destination associated with this filter. + * + * @return destinationId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Destination associated with this filter.") + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + public DestinationFilterV1 _if(String _if) { - public DestinationFilterV1 actions(List actions) { - - this.actions = actions; - return this; - } + this._if = _if; + return this; + } - public DestinationFilterV1 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + /** + * A condition that defines whether to apply this filter to a payload. + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A condition that defines whether to apply this filter to a payload.") + public String getIf() { + return _if; + } - /** - * A list of actions this filter performs. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public void setIf(String _if) { + this._if = _if; + } - public List getActions() { - return actions; - } + public DestinationFilterV1 actions(List actions) { + this.actions = actions; + return this; + } - public void setActions(List actions) { - this.actions = actions; - } + public DestinationFilterV1 addActionsItem(DestinationFilterActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } + /** + * A list of actions this filter performs. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public List getActions() { + return actions; + } - public DestinationFilterV1 title(String title) { - - this.title = title; - return this; - } + public void setActions(List actions) { + this.actions = actions; + } - /** - * A title for this filter. - * @return title - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") + public DestinationFilterV1 title(String title) { - public String getTitle() { - return title; - } + this.title = title; + return this; + } + /** + * A title for this filter. + * + * @return title + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A title for this filter.") + public String getTitle() { + return title; + } - public void setTitle(String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } + public DestinationFilterV1 description(String description) { - public DestinationFilterV1 description(String description) { - - this.description = description; - return this; - } + this.description = description; + return this; + } - /** - * A description for this filter. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") + /** + * A description for this filter. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this filter.") + public String getDescription() { + return description; + } - public String getDescription() { - return description; - } + public void setDescription(String description) { + this.description = description; + } + public DestinationFilterV1 enabled(Boolean enabled) { - public void setDescription(String description) { - this.description = description; - } + this.enabled = enabled; + return this; + } + /** + * When set to true, this filter is active. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this filter is active.") + public Boolean getEnabled() { + return enabled; + } - public DestinationFilterV1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - - public Boolean getEnabled() { - return enabled; - } - - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - - public DestinationFilterV1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - - public String getCreatedAt() { - return createdAt; - } - - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - - public DestinationFilterV1 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * @return updatedAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - - public String getUpdatedAt() { - return updatedAt; - } - - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationFilterV1 destinationFilterV1 = (DestinationFilterV1) o; - return Objects.equals(this.id, destinationFilterV1.id) && - Objects.equals(this.sourceId, destinationFilterV1.sourceId) && - Objects.equals(this.destinationId, destinationFilterV1.destinationId) && - Objects.equals(this._if, destinationFilterV1._if) && - Objects.equals(this.actions, destinationFilterV1.actions) && - Objects.equals(this.title, destinationFilterV1.title) && - Objects.equals(this.description, destinationFilterV1.description) && - Objects.equals(this.enabled, destinationFilterV1.enabled) && - Objects.equals(this.createdAt, destinationFilterV1.createdAt) && - Objects.equals(this.updatedAt, destinationFilterV1.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, destinationId, _if, actions, title, description, enabled, createdAt, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationFilterV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationFilterV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationFilterV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationFilterV1 is not found in the empty JSON string", DestinationFilterV1.openapiRequiredFields.toString())); + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public DestinationFilterV1 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of this filter's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public DestinationFilterV1 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this filter's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } + DestinationFilterV1 destinationFilterV1 = (DestinationFilterV1) o; + return Objects.equals(this.id, destinationFilterV1.id) + && Objects.equals(this.sourceId, destinationFilterV1.sourceId) + && Objects.equals(this.destinationId, destinationFilterV1.destinationId) + && Objects.equals(this._if, destinationFilterV1._if) + && Objects.equals(this.actions, destinationFilterV1.actions) + && Objects.equals(this.title, destinationFilterV1.title) + && Objects.equals(this.description, destinationFilterV1.description) + && Objects.equals(this.enabled, destinationFilterV1.enabled) + && Objects.equals(this.createdAt, destinationFilterV1.createdAt) + && Objects.equals(this.updatedAt, destinationFilterV1.updatedAt); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationFilterV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationFilterV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + @Override + public int hashCode() { + return Objects.hash( + id, + sourceId, + destinationId, + _if, + actions, + title, + description, + enabled, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationFilterV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationFilterV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("destinationId"); + openapiFields.add("if"); + openapiFields.add("actions"); + openapiFields.add("title"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("if"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationFilterV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationFilterV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationFilterV1 is not found in" + + " the empty JSON string", + DestinationFilterV1.openapiRequiredFields.toString())); + } } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updatedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationFilterV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationFilterV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationFilterV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationFilterV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationFilterV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationFilterV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationFilterV1 - * @throws IOException if the JSON string is invalid with respect to DestinationFilterV1 - */ - public static DestinationFilterV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationFilterV1.class); - } - - /** - * Convert an instance of DestinationFilterV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationFilterV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationFilterV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationFilterV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `title` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("title").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationFilterV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationFilterV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationFilterV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationFilterV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationFilterV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationFilterV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationFilterV1 + * @throws IOException if the JSON string is invalid with respect to DestinationFilterV1 + */ + public static DestinationFilterV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationFilterV1.class); + } + + /** + * Convert an instance of DestinationFilterV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java index c4641dcb..f84d64ae 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,899 +10,960 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Contact; -import com.segment.publicapi.models.DestinationMetadataActionV1; -import com.segment.publicapi.models.DestinationMetadataComponentV1; -import com.segment.publicapi.models.DestinationMetadataSubscriptionPresetV1; -import com.segment.publicapi.models.IntegrationOptionBeta; -import com.segment.publicapi.models.Logos; -import com.segment.publicapi.models.SupportedFeatures; -import com.segment.publicapi.models.SupportedMethods; -import com.segment.publicapi.models.SupportedPlatforms; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The catalog item matched by id. - */ +/** The catalog item matched by id. */ @ApiModel(description = "The catalog item matched by id.") - public class DestinationMetadata { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_SLUG = "slug"; - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; - - public static final String SERIALIZED_NAME_LOGOS = "logos"; - @SerializedName(SERIALIZED_NAME_LOGOS) - private Logos logos; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - @SerializedName(SERIALIZED_NAME_OPTIONS) - private List options = new ArrayList<>(); - - /** - * Support status of the Destination. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - DEPRECATED("DEPRECATED"), - - PRIVATE_BETA("PRIVATE_BETA"), - - PRIVATE_BUILDING("PRIVATE_BUILDING"), - - PRIVATE_SUBMITTED("PRIVATE_SUBMITTED"), - - PUBLIC("PUBLIC"), - - PUBLIC_BETA("PUBLIC_BETA"), - - UNAVAILABLE("UNAVAILABLE"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } + public static final String SERIALIZED_NAME_ID = "id"; - @Override - public String toString() { - return String.valueOf(value); - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_SLUG = "slug"; + + @SerializedName(SERIALIZED_NAME_SLUG) + private String slug; + + public static final String SERIALIZED_NAME_LOGOS = "logos"; + + @SerializedName(SERIALIZED_NAME_LOGOS) + private Logos logos; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private List options = new ArrayList<>(); + + /** Support status of the Destination. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DEPRECATED("DEPRECATED"), - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + PRIVATE_BETA("PRIVATE_BETA"), + + PRIVATE_BUILDING("PRIVATE_BUILDING"), + + PRIVATE_SUBMITTED("PRIVATE_SUBMITTED"), + + PUBLIC("PUBLIC"), + + PUBLIC_BETA("PUBLIC_BETA"), + + UNAVAILABLE("UNAVAILABLE"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public static final String SERIALIZED_NAME_PREVIOUS_NAMES = "previousNames"; - @SerializedName(SERIALIZED_NAME_PREVIOUS_NAMES) - private List previousNames = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public static final String SERIALIZED_NAME_CATEGORIES = "categories"; - @SerializedName(SERIALIZED_NAME_CATEGORIES) - private List categories = new ArrayList<>(); + public static final String SERIALIZED_NAME_PREVIOUS_NAMES = "previousNames"; - public static final String SERIALIZED_NAME_WEBSITE = "website"; - @SerializedName(SERIALIZED_NAME_WEBSITE) - private String website; + @SerializedName(SERIALIZED_NAME_PREVIOUS_NAMES) + private List previousNames = new ArrayList<>(); - public static final String SERIALIZED_NAME_COMPONENTS = "components"; - @SerializedName(SERIALIZED_NAME_COMPONENTS) - private List components = new ArrayList<>(); + public static final String SERIALIZED_NAME_CATEGORIES = "categories"; - public static final String SERIALIZED_NAME_SUPPORTED_FEATURES = "supportedFeatures"; - @SerializedName(SERIALIZED_NAME_SUPPORTED_FEATURES) - private SupportedFeatures supportedFeatures; + @SerializedName(SERIALIZED_NAME_CATEGORIES) + private List categories = new ArrayList<>(); - public static final String SERIALIZED_NAME_SUPPORTED_METHODS = "supportedMethods"; - @SerializedName(SERIALIZED_NAME_SUPPORTED_METHODS) - private SupportedMethods supportedMethods; + public static final String SERIALIZED_NAME_WEBSITE = "website"; - public static final String SERIALIZED_NAME_SUPPORTED_PLATFORMS = "supportedPlatforms"; - @SerializedName(SERIALIZED_NAME_SUPPORTED_PLATFORMS) - private SupportedPlatforms supportedPlatforms; + @SerializedName(SERIALIZED_NAME_WEBSITE) + private String website; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + public static final String SERIALIZED_NAME_COMPONENTS = "components"; - public static final String SERIALIZED_NAME_PRESETS = "presets"; - @SerializedName(SERIALIZED_NAME_PRESETS) - private List presets = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_COMPONENTS) + private List components = new ArrayList<>(); - public static final String SERIALIZED_NAME_CONTACTS = "contacts"; - @SerializedName(SERIALIZED_NAME_CONTACTS) - private List contacts = null; + public static final String SERIALIZED_NAME_SUPPORTED_FEATURES = "supportedFeatures"; - public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; - @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) - private Boolean partnerOwned; + @SerializedName(SERIALIZED_NAME_SUPPORTED_FEATURES) + private SupportedFeatures supportedFeatures; - public DestinationMetadata() { - } + public static final String SERIALIZED_NAME_SUPPORTED_METHODS = "supportedMethods"; - public DestinationMetadata id(String id) { - - this.id = id; - return this; - } + @SerializedName(SERIALIZED_NAME_SUPPORTED_METHODS) + private SupportedMethods supportedMethods; - /** - * The id of the Destination metadata. Config API note: analogous to `name`. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Destination metadata. Config API note: analogous to `name`.") + public static final String SERIALIZED_NAME_SUPPORTED_PLATFORMS = "supportedPlatforms"; - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_SUPPORTED_PLATFORMS) + private SupportedPlatforms supportedPlatforms; + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public void setId(String id) { - this.id = id; - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); + public static final String SERIALIZED_NAME_PRESETS = "presets"; - public DestinationMetadata name(String name) { - - this.name = name; - return this; - } + @SerializedName(SERIALIZED_NAME_PRESETS) + private List presets = new ArrayList<>(); - /** - * The user-friendly name of the Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The user-friendly name of the Destination. Config API note: equal to `displayName`.") - - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_CONTACTS = "contacts"; + @SerializedName(SERIALIZED_NAME_CONTACTS) + private List contacts = null; - public void setName(String name) { - this.name = name; - } + public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; + @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) + private Boolean partnerOwned; - public DestinationMetadata description(String description) { - - this.description = description; - return this; - } + public DestinationMetadata() {} - /** - * The description of the Destination. - * @return description - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The description of the Destination.") + public DestinationMetadata id(String id) { - public String getDescription() { - return description; - } + this.id = id; + return this; + } + /** + * The id of the Destination metadata. Config API note: analogous to `name`. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Destination metadata. Config API note: analogous to `name`.") + public String getId() { + return id; + } - public void setDescription(String description) { - this.description = description; - } + public void setId(String id) { + this.id = id; + } + public DestinationMetadata name(String name) { - public DestinationMetadata slug(String slug) { - - this.slug = slug; - return this; - } + this.name = name; + return this; + } - /** - * The slug used to identify the Destination in the Segment app. - * @return slug - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The slug used to identify the Destination in the Segment app.") + /** + * The user-friendly name of the Destination. Config API note: equal to `displayName`. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The user-friendly name of the Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } - public String getSlug() { - return slug; - } + public void setName(String name) { + this.name = name; + } + public DestinationMetadata description(String description) { - public void setSlug(String slug) { - this.slug = slug; - } + this.description = description; + return this; + } + /** + * The description of the Destination. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The description of the Destination.") + public String getDescription() { + return description; + } - public DestinationMetadata logos(Logos logos) { - - this.logos = logos; - return this; - } + public void setDescription(String description) { + this.description = description; + } - /** - * Get logos - * @return logos - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DestinationMetadata slug(String slug) { - public Logos getLogos() { - return logos; - } + this.slug = slug; + return this; + } + /** + * The slug used to identify the Destination in the Segment app. + * + * @return slug + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The slug used to identify the Destination in the Segment app.") + public String getSlug() { + return slug; + } - public void setLogos(Logos logos) { - this.logos = logos; - } + public void setSlug(String slug) { + this.slug = slug; + } + public DestinationMetadata logos(Logos logos) { - public DestinationMetadata options(List options) { - - this.options = options; - return this; - } + this.logos = logos; + return this; + } - public DestinationMetadata addOptionsItem(IntegrationOptionBeta optionsItem) { - this.options.add(optionsItem); - return this; - } + /** + * Get logos + * + * @return logos + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Logos getLogos() { + return logos; + } - /** - * Options configured for the Destination. - * @return options - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Options configured for the Destination.") + public void setLogos(Logos logos) { + this.logos = logos; + } - public List getOptions() { - return options; - } + public DestinationMetadata options(List options) { + this.options = options; + return this; + } - public void setOptions(List options) { - this.options = options; - } + public DestinationMetadata addOptionsItem(IntegrationOptionBeta optionsItem) { + this.options.add(optionsItem); + return this; + } + /** + * Options configured for the Destination. + * + * @return options + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Options configured for the Destination.") + public List getOptions() { + return options; + } - public DestinationMetadata status(StatusEnum status) { - - this.status = status; - return this; - } + public void setOptions(List options) { + this.options = options; + } - /** - * Support status of the Destination. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Support status of the Destination.") + public DestinationMetadata status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * Support status of the Destination. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Support status of the Destination.") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + public DestinationMetadata previousNames(List previousNames) { - public DestinationMetadata previousNames(List previousNames) { - - this.previousNames = previousNames; - return this; - } + this.previousNames = previousNames; + return this; + } - public DestinationMetadata addPreviousNamesItem(String previousNamesItem) { - this.previousNames.add(previousNamesItem); - return this; - } + public DestinationMetadata addPreviousNamesItem(String previousNamesItem) { + this.previousNames.add(previousNamesItem); + return this; + } - /** - * A list of names previously used by the Destination. - * @return previousNames - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of names previously used by the Destination.") + /** + * A list of names previously used by the Destination. + * + * @return previousNames + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list of names previously used by the Destination.") + public List getPreviousNames() { + return previousNames; + } - public List getPreviousNames() { - return previousNames; - } + public void setPreviousNames(List previousNames) { + this.previousNames = previousNames; + } + public DestinationMetadata categories(List categories) { - public void setPreviousNames(List previousNames) { - this.previousNames = previousNames; - } + this.categories = categories; + return this; + } + public DestinationMetadata addCategoriesItem(String categoriesItem) { + this.categories.add(categoriesItem); + return this; + } - public DestinationMetadata categories(List categories) { - - this.categories = categories; - return this; - } + /** + * A list of categories with which the Destination is associated. + * + * @return categories + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list of categories with which the Destination is associated.") + public List getCategories() { + return categories; + } - public DestinationMetadata addCategoriesItem(String categoriesItem) { - this.categories.add(categoriesItem); - return this; - } + public void setCategories(List categories) { + this.categories = categories; + } - /** - * A list of categories with which the Destination is associated. - * @return categories - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of categories with which the Destination is associated.") + public DestinationMetadata website(String website) { - public List getCategories() { - return categories; - } + this.website = website; + return this; + } + /** + * A website URL for this Destination. + * + * @return website + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A website URL for this Destination.") + public String getWebsite() { + return website; + } - public void setCategories(List categories) { - this.categories = categories; - } + public void setWebsite(String website) { + this.website = website; + } + public DestinationMetadata components(List components) { - public DestinationMetadata website(String website) { - - this.website = website; - return this; - } + this.components = components; + return this; + } - /** - * A website URL for this Destination. - * @return website - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A website URL for this Destination.") + public DestinationMetadata addComponentsItem(DestinationMetadataComponentV1 componentsItem) { + this.components.add(componentsItem); + return this; + } - public String getWebsite() { - return website; - } + /** + * A list of components this Destination provides. + * + * @return components + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of components this Destination provides.") + public List getComponents() { + return components; + } + public void setComponents(List components) { + this.components = components; + } - public void setWebsite(String website) { - this.website = website; - } + public DestinationMetadata supportedFeatures(SupportedFeatures supportedFeatures) { + this.supportedFeatures = supportedFeatures; + return this; + } - public DestinationMetadata components(List components) { - - this.components = components; - return this; - } + /** + * Get supportedFeatures + * + * @return supportedFeatures + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SupportedFeatures getSupportedFeatures() { + return supportedFeatures; + } - public DestinationMetadata addComponentsItem(DestinationMetadataComponentV1 componentsItem) { - this.components.add(componentsItem); - return this; - } + public void setSupportedFeatures(SupportedFeatures supportedFeatures) { + this.supportedFeatures = supportedFeatures; + } - /** - * A list of components this Destination provides. - * @return components - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of components this Destination provides.") + public DestinationMetadata supportedMethods(SupportedMethods supportedMethods) { - public List getComponents() { - return components; - } + this.supportedMethods = supportedMethods; + return this; + } + /** + * Get supportedMethods + * + * @return supportedMethods + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SupportedMethods getSupportedMethods() { + return supportedMethods; + } - public void setComponents(List components) { - this.components = components; - } + public void setSupportedMethods(SupportedMethods supportedMethods) { + this.supportedMethods = supportedMethods; + } + public DestinationMetadata supportedPlatforms(SupportedPlatforms supportedPlatforms) { - public DestinationMetadata supportedFeatures(SupportedFeatures supportedFeatures) { - - this.supportedFeatures = supportedFeatures; - return this; - } + this.supportedPlatforms = supportedPlatforms; + return this; + } - /** - * Get supportedFeatures - * @return supportedFeatures - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + /** + * Get supportedPlatforms + * + * @return supportedPlatforms + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SupportedPlatforms getSupportedPlatforms() { + return supportedPlatforms; + } - public SupportedFeatures getSupportedFeatures() { - return supportedFeatures; - } + public void setSupportedPlatforms(SupportedPlatforms supportedPlatforms) { + this.supportedPlatforms = supportedPlatforms; + } + public DestinationMetadata actions(List actions) { - public void setSupportedFeatures(SupportedFeatures supportedFeatures) { - this.supportedFeatures = supportedFeatures; - } + this.actions = actions; + return this; + } + public DestinationMetadata addActionsItem(DestinationMetadataActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } - public DestinationMetadata supportedMethods(SupportedMethods supportedMethods) { - - this.supportedMethods = supportedMethods; - return this; - } + /** + * Actions available for the Destination. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Actions available for the Destination.") + public List getActions() { + return actions; + } - /** - * Get supportedMethods - * @return supportedMethods - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public void setActions(List actions) { + this.actions = actions; + } - public SupportedMethods getSupportedMethods() { - return supportedMethods; - } + public DestinationMetadata presets(List presets) { + this.presets = presets; + return this; + } - public void setSupportedMethods(SupportedMethods supportedMethods) { - this.supportedMethods = supportedMethods; - } + public DestinationMetadata addPresetsItem(DestinationMetadataSubscriptionPresetV1 presetsItem) { + this.presets.add(presetsItem); + return this; + } + /** + * Predefined Destination subscriptions that can optionally be applied when connecting a new + * instance of the Destination. + * + * @return presets + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Predefined Destination subscriptions that can optionally be applied when" + + " connecting a new instance of the Destination.") + public List getPresets() { + return presets; + } - public DestinationMetadata supportedPlatforms(SupportedPlatforms supportedPlatforms) { - - this.supportedPlatforms = supportedPlatforms; - return this; - } + public void setPresets(List presets) { + this.presets = presets; + } - /** - * Get supportedPlatforms - * @return supportedPlatforms - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DestinationMetadata contacts(List contacts) { - public SupportedPlatforms getSupportedPlatforms() { - return supportedPlatforms; - } + this.contacts = contacts; + return this; + } + public DestinationMetadata addContactsItem(Contact contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } - public void setSupportedPlatforms(SupportedPlatforms supportedPlatforms) { - this.supportedPlatforms = supportedPlatforms; - } + /** + * Contact info for Integration Owners. + * + * @return contacts + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Contact info for Integration Owners.") + public List getContacts() { + return contacts; + } + public void setContacts(List contacts) { + this.contacts = contacts; + } - public DestinationMetadata actions(List actions) { - - this.actions = actions; - return this; - } + public DestinationMetadata partnerOwned(Boolean partnerOwned) { - public DestinationMetadata addActionsItem(DestinationMetadataActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + this.partnerOwned = partnerOwned; + return this; + } - /** - * Actions available for the Destination. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Actions available for the Destination.") + /** + * Partner Owned flag. + * + * @return partnerOwned + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Partner Owned flag.") + public Boolean getPartnerOwned() { + return partnerOwned; + } - public List getActions() { - return actions; - } + public void setPartnerOwned(Boolean partnerOwned) { + this.partnerOwned = partnerOwned; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadata destinationMetadata = (DestinationMetadata) o; + return Objects.equals(this.id, destinationMetadata.id) + && Objects.equals(this.name, destinationMetadata.name) + && Objects.equals(this.description, destinationMetadata.description) + && Objects.equals(this.slug, destinationMetadata.slug) + && Objects.equals(this.logos, destinationMetadata.logos) + && Objects.equals(this.options, destinationMetadata.options) + && Objects.equals(this.status, destinationMetadata.status) + && Objects.equals(this.previousNames, destinationMetadata.previousNames) + && Objects.equals(this.categories, destinationMetadata.categories) + && Objects.equals(this.website, destinationMetadata.website) + && Objects.equals(this.components, destinationMetadata.components) + && Objects.equals(this.supportedFeatures, destinationMetadata.supportedFeatures) + && Objects.equals(this.supportedMethods, destinationMetadata.supportedMethods) + && Objects.equals(this.supportedPlatforms, destinationMetadata.supportedPlatforms) + && Objects.equals(this.actions, destinationMetadata.actions) + && Objects.equals(this.presets, destinationMetadata.presets) + && Objects.equals(this.contacts, destinationMetadata.contacts) + && Objects.equals(this.partnerOwned, destinationMetadata.partnerOwned); + } - public void setActions(List actions) { - this.actions = actions; - } + @Override + public int hashCode() { + return Objects.hash( + id, + name, + description, + slug, + logos, + options, + status, + previousNames, + categories, + website, + components, + supportedFeatures, + supportedMethods, + supportedPlatforms, + actions, + presets, + contacts, + partnerOwned); + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadata {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" previousNames: ").append(toIndentedString(previousNames)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" components: ").append(toIndentedString(components)).append("\n"); + sb.append(" supportedFeatures: ") + .append(toIndentedString(supportedFeatures)) + .append("\n"); + sb.append(" supportedMethods: ").append(toIndentedString(supportedMethods)).append("\n"); + sb.append(" supportedPlatforms: ") + .append(toIndentedString(supportedPlatforms)) + .append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public DestinationMetadata presets(List presets) { - - this.presets = presets; - return this; - } - - public DestinationMetadata addPresetsItem(DestinationMetadataSubscriptionPresetV1 presetsItem) { - this.presets.add(presetsItem); - return this; - } - - /** - * Predefined Destination subscriptions that can optionally be applied when connecting a new instance of the Destination. - * @return presets - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Predefined Destination subscriptions that can optionally be applied when connecting a new instance of the Destination.") - - public List getPresets() { - return presets; - } - - - public void setPresets(List presets) { - this.presets = presets; - } - - - public DestinationMetadata contacts(List contacts) { - - this.contacts = contacts; - return this; - } - - public DestinationMetadata addContactsItem(Contact contactsItem) { - if (this.contacts == null) { - this.contacts = new ArrayList<>(); - } - this.contacts.add(contactsItem); - return this; - } - - /** - * Contact info for Integration Owners. - * @return contacts - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contact info for Integration Owners.") - - public List getContacts() { - return contacts; - } - - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - - public DestinationMetadata partnerOwned(Boolean partnerOwned) { - - this.partnerOwned = partnerOwned; - return this; - } - - /** - * Partner Owned flag. - * @return partnerOwned - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Partner Owned flag.") - - public Boolean getPartnerOwned() { - return partnerOwned; - } - - - public void setPartnerOwned(Boolean partnerOwned) { - this.partnerOwned = partnerOwned; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationMetadata destinationMetadata = (DestinationMetadata) o; - return Objects.equals(this.id, destinationMetadata.id) && - Objects.equals(this.name, destinationMetadata.name) && - Objects.equals(this.description, destinationMetadata.description) && - Objects.equals(this.slug, destinationMetadata.slug) && - Objects.equals(this.logos, destinationMetadata.logos) && - Objects.equals(this.options, destinationMetadata.options) && - Objects.equals(this.status, destinationMetadata.status) && - Objects.equals(this.previousNames, destinationMetadata.previousNames) && - Objects.equals(this.categories, destinationMetadata.categories) && - Objects.equals(this.website, destinationMetadata.website) && - Objects.equals(this.components, destinationMetadata.components) && - Objects.equals(this.supportedFeatures, destinationMetadata.supportedFeatures) && - Objects.equals(this.supportedMethods, destinationMetadata.supportedMethods) && - Objects.equals(this.supportedPlatforms, destinationMetadata.supportedPlatforms) && - Objects.equals(this.actions, destinationMetadata.actions) && - Objects.equals(this.presets, destinationMetadata.presets) && - Objects.equals(this.contacts, destinationMetadata.contacts) && - Objects.equals(this.partnerOwned, destinationMetadata.partnerOwned); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, description, slug, logos, options, status, previousNames, categories, website, components, supportedFeatures, supportedMethods, supportedPlatforms, actions, presets, contacts, partnerOwned); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadata {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" previousNames: ").append(toIndentedString(previousNames)).append("\n"); - sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); - sb.append(" website: ").append(toIndentedString(website)).append("\n"); - sb.append(" components: ").append(toIndentedString(components)).append("\n"); - sb.append(" supportedFeatures: ").append(toIndentedString(supportedFeatures)).append("\n"); - sb.append(" supportedMethods: ").append(toIndentedString(supportedMethods)).append("\n"); - sb.append(" supportedPlatforms: ").append(toIndentedString(supportedPlatforms)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); - sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); - sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("slug"); - openapiFields.add("logos"); - openapiFields.add("options"); - openapiFields.add("status"); - openapiFields.add("previousNames"); - openapiFields.add("categories"); - openapiFields.add("website"); - openapiFields.add("components"); - openapiFields.add("supportedFeatures"); - openapiFields.add("supportedMethods"); - openapiFields.add("supportedPlatforms"); - openapiFields.add("actions"); - openapiFields.add("presets"); - openapiFields.add("contacts"); - openapiFields.add("partnerOwned"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("slug"); - openapiRequiredFields.add("logos"); - openapiRequiredFields.add("options"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("previousNames"); - openapiRequiredFields.add("categories"); - openapiRequiredFields.add("website"); - openapiRequiredFields.add("components"); - openapiRequiredFields.add("supportedFeatures"); - openapiRequiredFields.add("supportedMethods"); - openapiRequiredFields.add("supportedPlatforms"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("presets"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadata is not found in the empty JSON string", DestinationMetadata.openapiRequiredFields.toString())); + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadata` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("slug"); + openapiFields.add("logos"); + openapiFields.add("options"); + openapiFields.add("status"); + openapiFields.add("previousNames"); + openapiFields.add("categories"); + openapiFields.add("website"); + openapiFields.add("components"); + openapiFields.add("supportedFeatures"); + openapiFields.add("supportedMethods"); + openapiFields.add("supportedPlatforms"); + openapiFields.add("actions"); + openapiFields.add("presets"); + openapiFields.add("contacts"); + openapiFields.add("partnerOwned"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("slug"); + openapiRequiredFields.add("logos"); + openapiRequiredFields.add("options"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("previousNames"); + openapiRequiredFields.add("categories"); + openapiRequiredFields.add("website"); + openapiRequiredFields.add("components"); + openapiRequiredFields.add("supportedFeatures"); + openapiRequiredFields.add("supportedMethods"); + openapiRequiredFields.add("supportedPlatforms"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("presets"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationMetadata + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadata.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadata is not found in" + + " the empty JSON string", + DestinationMetadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadata` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadata.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationMetadata.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("options").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `options` to be an array in the JSON string but got `%s`", jsonObj.get("options").toString())); - } - - JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // ensure the required json array is present - if (jsonObj.get("previousNames") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("previousNames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `previousNames` to be an array in the JSON string but got `%s`", jsonObj.get("previousNames").toString())); - } - // ensure the required json array is present - if (jsonObj.get("categories") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("categories").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `categories` to be an array in the JSON string but got `%s`", jsonObj.get("categories").toString())); - } - if (!jsonObj.get("website").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("website").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("components").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `components` to be an array in the JSON string but got `%s`", jsonObj.get("components").toString())); - } - - JsonArray jsonArraycomponents = jsonObj.getAsJsonArray("components"); - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - // ensure the json data is an array - if (!jsonObj.get("presets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `presets` to be an array in the JSON string but got `%s`", jsonObj.get("presets").toString())); - } - - JsonArray jsonArraypresets = jsonObj.getAsJsonArray("presets"); - if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull()) { - JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts"); - if (jsonArraycontacts != null) { - // ensure the json data is an array - if (!jsonObj.get("contacts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `contacts` to be an array in the JSON string but got `%s`", jsonObj.get("contacts").toString())); - } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slug` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slug").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("options").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `options` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("options").toString())); } - } - } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadata - * @throws IOException if the JSON string is invalid with respect to DestinationMetadata - */ - public static DestinationMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadata.class); - } - - /** - * Convert an instance of DestinationMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the required json array is present + if (jsonObj.get("previousNames") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("previousNames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previousNames` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("previousNames").toString())); + } + // ensure the required json array is present + if (jsonObj.get("categories") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("categories").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `categories` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("categories").toString())); + } + if (!jsonObj.get("website").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `website` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("website").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("components").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `components` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("components").toString())); + } + JsonArray jsonArraycomponents = jsonObj.getAsJsonArray("components"); + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + // ensure the json data is an array + if (!jsonObj.get("presets").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `presets` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("presets").toString())); + } + + JsonArray jsonArraypresets = jsonObj.getAsJsonArray("presets"); + if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull()) { + JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts"); + if (jsonArraycontacts != null) { + // ensure the json data is an array + if (!jsonObj.get("contacts").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `contacts` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("contacts").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadata.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadata value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadata read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadata + * @throws IOException if the JSON string is invalid with respect to DestinationMetadata + */ + public static DestinationMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadata.class); + } + + /** + * Convert an instance of DestinationMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index 2ac0e45c..315cb2f2 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,666 +10,715 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * Represents a field used in configuring an action. - */ +/** Represents a field used in configuring an action. */ @ApiModel(description = "Represents a field used in configuring an action.") - public class DestinationMetadataActionFieldV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SORT_ORDER = "sortOrder"; - @SerializedName(SERIALIZED_NAME_SORT_ORDER) - private BigDecimal sortOrder; - - public static final String SERIALIZED_NAME_FIELD_KEY = "fieldKey"; - @SerializedName(SERIALIZED_NAME_FIELD_KEY) - private String fieldKey; - - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private String label; - - /** - * The data type for this value. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - BOOLEAN("BOOLEAN"), - - DATETIME("DATETIME"), - - HIDDEN("HIDDEN"), - - INTEGER("INTEGER"), - - NUMBER("NUMBER"), - - OBJECT("OBJECT"), - - PASSWORD("PASSWORD"), - - STRING("STRING"), - - TEXT("TEXT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } + public static final String SERIALIZED_NAME_ID = "id"; - @Override - public String toString() { - return String.valueOf(value); - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SORT_ORDER = "sortOrder"; + + @SerializedName(SERIALIZED_NAME_SORT_ORDER) + private BigDecimal sortOrder; + + public static final String SERIALIZED_NAME_FIELD_KEY = "fieldKey"; - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + @SerializedName(SERIALIZED_NAME_FIELD_KEY) + private String fieldKey; + + public static final String SERIALIZED_NAME_LABEL = "label"; + + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + /** The data type for this value. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BOOLEAN("BOOLEAN"), + + DATETIME("DATETIME"), + + HIDDEN("HIDDEN"), + + INTEGER("INTEGER"), + + NUMBER("NUMBER"), + + OBJECT("OBJECT"), + + PASSWORD("PASSWORD"), + + STRING("STRING"), + + TEXT("TEXT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_PLACEHOLDER = "placeholder"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_PLACEHOLDER) + private String placeholder; - public static final String SERIALIZED_NAME_PLACEHOLDER = "placeholder"; - @SerializedName(SERIALIZED_NAME_PLACEHOLDER) - private String placeholder; + public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private Object defaultValue = null; + @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) + private Object defaultValue = null; - public static final String SERIALIZED_NAME_REQUIRED = "required"; - @SerializedName(SERIALIZED_NAME_REQUIRED) - private Boolean required; + public static final String SERIALIZED_NAME_REQUIRED = "required"; - public static final String SERIALIZED_NAME_MULTIPLE = "multiple"; - @SerializedName(SERIALIZED_NAME_MULTIPLE) - private Boolean multiple; + @SerializedName(SERIALIZED_NAME_REQUIRED) + private Boolean required; - public static final String SERIALIZED_NAME_CHOICES = "choices"; - @SerializedName(SERIALIZED_NAME_CHOICES) - private Object choices = null; + public static final String SERIALIZED_NAME_MULTIPLE = "multiple"; - public static final String SERIALIZED_NAME_DYNAMIC = "dynamic"; - @SerializedName(SERIALIZED_NAME_DYNAMIC) - private Boolean dynamic; + @SerializedName(SERIALIZED_NAME_MULTIPLE) + private Boolean multiple; - public static final String SERIALIZED_NAME_ALLOW_NULL = "allowNull"; - @SerializedName(SERIALIZED_NAME_ALLOW_NULL) - private Boolean allowNull; + public static final String SERIALIZED_NAME_CHOICES = "choices"; - public DestinationMetadataActionFieldV1() { - } + @SerializedName(SERIALIZED_NAME_CHOICES) + private Object choices = null; - public DestinationMetadataActionFieldV1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_DYNAMIC = "dynamic"; - /** - * The primary key of the field. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The primary key of the field.") + @SerializedName(SERIALIZED_NAME_DYNAMIC) + private Boolean dynamic; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_ALLOW_NULL = "allowNull"; + @SerializedName(SERIALIZED_NAME_ALLOW_NULL) + private Boolean allowNull; - public void setId(String id) { - this.id = id; - } + public DestinationMetadataActionFieldV1() {} + public DestinationMetadataActionFieldV1 id(String id) { - public DestinationMetadataActionFieldV1 sortOrder(BigDecimal sortOrder) { - - this.sortOrder = sortOrder; - return this; - } + this.id = id; + return this; + } + + /** + * The primary key of the field. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The primary key of the field.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DestinationMetadataActionFieldV1 sortOrder(BigDecimal sortOrder) { - /** - * The order this particular field is (used in the UI for displaying the fields in a specified order). - * @return sortOrder - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The order this particular field is (used in the UI for displaying the fields in a specified order).") + this.sortOrder = sortOrder; + return this; + } - public BigDecimal getSortOrder() { - return sortOrder; - } + /** + * The order this particular field is (used in the UI for displaying the fields in a specified + * order). + * + * @return sortOrder + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The order this particular field is (used in the UI for displaying the fields" + + " in a specified order).") + public BigDecimal getSortOrder() { + return sortOrder; + } + public void setSortOrder(BigDecimal sortOrder) { + this.sortOrder = sortOrder; + } - public void setSortOrder(BigDecimal sortOrder) { - this.sortOrder = sortOrder; - } + public DestinationMetadataActionFieldV1 fieldKey(String fieldKey) { + this.fieldKey = fieldKey; + return this; + } - public DestinationMetadataActionFieldV1 fieldKey(String fieldKey) { - - this.fieldKey = fieldKey; - return this; - } + /** + * A unique machine-readable key for the field. Should ideally match the expected key in the + * action\\'s API request. + * + * @return fieldKey + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "A unique machine-readable key for the field. Should ideally match the expected" + + " key in the action\\'s API request.") + public String getFieldKey() { + return fieldKey; + } - /** - * A unique machine-readable key for the field. Should ideally match the expected key in the action\\'s API request. - * @return fieldKey - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A unique machine-readable key for the field. Should ideally match the expected key in the action\\'s API request.") + public void setFieldKey(String fieldKey) { + this.fieldKey = fieldKey; + } - public String getFieldKey() { - return fieldKey; - } + public DestinationMetadataActionFieldV1 label(String label) { + this.label = label; + return this; + } - public void setFieldKey(String fieldKey) { - this.fieldKey = fieldKey; - } + /** + * A human-readable label for this value. + * + * @return label + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A human-readable label for this value.") + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } - public DestinationMetadataActionFieldV1 label(String label) { - - this.label = label; - return this; - } + public DestinationMetadataActionFieldV1 type(TypeEnum type) { - /** - * A human-readable label for this value. - * @return label - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable label for this value.") + this.type = type; + return this; + } - public String getLabel() { - return label; - } + /** + * The data type for this value. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The data type for this value.") + public TypeEnum getType() { + return type; + } + public void setType(TypeEnum type) { + this.type = type; + } - public void setLabel(String label) { - this.label = label; - } + public DestinationMetadataActionFieldV1 description(String description) { + this.description = description; + return this; + } - public DestinationMetadataActionFieldV1 type(TypeEnum type) { - - this.type = type; - return this; - } + /** + * A human-readable description of this value. You can use Markdown. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A human-readable description of this value. You can use Markdown.") + public String getDescription() { + return description; + } - /** - * The data type for this value. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The data type for this value.") + public void setDescription(String description) { + this.description = description; + } - public TypeEnum getType() { - return type; - } + public DestinationMetadataActionFieldV1 placeholder(String placeholder) { + this.placeholder = placeholder; + return this; + } - public void setType(TypeEnum type) { - this.type = type; - } + /** + * An example value displayed but not saved. + * + * @return placeholder + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An example value displayed but not saved.") + public String getPlaceholder() { + return placeholder; + } + public void setPlaceholder(String placeholder) { + this.placeholder = placeholder; + } - public DestinationMetadataActionFieldV1 description(String description) { - - this.description = description; - return this; - } + public DestinationMetadataActionFieldV1 defaultValue(Object defaultValue) { - /** - * A human-readable description of this value. You can use Markdown. - * @return description - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable description of this value. You can use Markdown.") + this.defaultValue = defaultValue; + return this; + } - public String getDescription() { - return description; - } + /** + * A default value that is saved the first time an action is created. + * + * @return defaultValue + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A default value that is saved the first time an action is created.") + public Object getDefaultValue() { + return defaultValue; + } + public void setDefaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + } - public void setDescription(String description) { - this.description = description; - } + public DestinationMetadataActionFieldV1 required(Boolean required) { + this.required = required; + return this; + } - public DestinationMetadataActionFieldV1 placeholder(String placeholder) { - - this.placeholder = placeholder; - return this; - } + /** + * Whether this field is required. + * + * @return required + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Whether this field is required.") + public Boolean getRequired() { + return required; + } - /** - * An example value displayed but not saved. - * @return placeholder - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An example value displayed but not saved.") + public void setRequired(Boolean required) { + this.required = required; + } - public String getPlaceholder() { - return placeholder; - } + public DestinationMetadataActionFieldV1 multiple(Boolean multiple) { + this.multiple = multiple; + return this; + } - public void setPlaceholder(String placeholder) { - this.placeholder = placeholder; - } + /** + * Whether a user can provide multiples of this field. + * + * @return multiple + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether a user can provide multiples of this field.") + public Boolean getMultiple() { + return multiple; + } + public void setMultiple(Boolean multiple) { + this.multiple = multiple; + } - public DestinationMetadataActionFieldV1 defaultValue(Object defaultValue) { - - this.defaultValue = defaultValue; - return this; - } + public DestinationMetadataActionFieldV1 choices(Object choices) { - /** - * A default value that is saved the first time an action is created. - * @return defaultValue - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A default value that is saved the first time an action is created.") + this.choices = choices; + return this; + } - public Object getDefaultValue() { - return defaultValue; - } + /** + * A list of machine-readable value/label pairs to populate a static dropdown. + * + * @return choices + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "A list of machine-readable value/label pairs to populate a static dropdown.") + public Object getChoices() { + return choices; + } + public void setChoices(Object choices) { + this.choices = choices; + } - public void setDefaultValue(Object defaultValue) { - this.defaultValue = defaultValue; - } + public DestinationMetadataActionFieldV1 dynamic(Boolean dynamic) { + this.dynamic = dynamic; + return this; + } - public DestinationMetadataActionFieldV1 required(Boolean required) { - - this.required = required; - return this; - } + /** + * Whether this field should execute a dynamic request to fetch choices to populate a dropdown. + * When true, `choices` is ignored. + * + * @return dynamic + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Whether this field should execute a dynamic request to fetch choices to" + + " populate a dropdown. When true, `choices` is ignored.") + public Boolean getDynamic() { + return dynamic; + } - /** - * Whether this field is required. - * @return required - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field is required.") + public void setDynamic(Boolean dynamic) { + this.dynamic = dynamic; + } - public Boolean getRequired() { - return required; - } + public DestinationMetadataActionFieldV1 allowNull(Boolean allowNull) { + this.allowNull = allowNull; + return this; + } - public void setRequired(Boolean required) { - this.required = required; - } + /** + * Whether this field allows null values. + * + * @return allowNull + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Whether this field allows null values.") + public Boolean getAllowNull() { + return allowNull; + } + public void setAllowNull(Boolean allowNull) { + this.allowNull = allowNull; + } - public DestinationMetadataActionFieldV1 multiple(Boolean multiple) { - - this.multiple = multiple; - return this; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataActionFieldV1 destinationMetadataActionFieldV1 = + (DestinationMetadataActionFieldV1) o; + return Objects.equals(this.id, destinationMetadataActionFieldV1.id) + && Objects.equals(this.sortOrder, destinationMetadataActionFieldV1.sortOrder) + && Objects.equals(this.fieldKey, destinationMetadataActionFieldV1.fieldKey) + && Objects.equals(this.label, destinationMetadataActionFieldV1.label) + && Objects.equals(this.type, destinationMetadataActionFieldV1.type) + && Objects.equals(this.description, destinationMetadataActionFieldV1.description) + && Objects.equals(this.placeholder, destinationMetadataActionFieldV1.placeholder) + && Objects.equals(this.defaultValue, destinationMetadataActionFieldV1.defaultValue) + && Objects.equals(this.required, destinationMetadataActionFieldV1.required) + && Objects.equals(this.multiple, destinationMetadataActionFieldV1.multiple) + && Objects.equals(this.choices, destinationMetadataActionFieldV1.choices) + && Objects.equals(this.dynamic, destinationMetadataActionFieldV1.dynamic) + && Objects.equals(this.allowNull, destinationMetadataActionFieldV1.allowNull); + } - /** - * Whether a user can provide multiples of this field. - * @return multiple - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether a user can provide multiples of this field.") + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } - public Boolean getMultiple() { - return multiple; - } + @Override + public int hashCode() { + return Objects.hash( + id, + sortOrder, + fieldKey, + label, + type, + description, + placeholder, + defaultValue, + required, + multiple, + choices, + dynamic, + allowNull); + } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - public void setMultiple(Boolean multiple) { - this.multiple = multiple; - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataActionFieldV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); + sb.append(" fieldKey: ").append(toIndentedString(fieldKey)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" placeholder: ").append(toIndentedString(placeholder)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" multiple: ").append(toIndentedString(multiple)).append("\n"); + sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); + sb.append(" dynamic: ").append(toIndentedString(dynamic)).append("\n"); + sb.append(" allowNull: ").append(toIndentedString(allowNull)).append("\n"); + sb.append("}"); + return sb.toString(); + } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - public DestinationMetadataActionFieldV1 choices(Object choices) { - - this.choices = choices; - return this; - } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sortOrder"); + openapiFields.add("fieldKey"); + openapiFields.add("label"); + openapiFields.add("type"); + openapiFields.add("description"); + openapiFields.add("placeholder"); + openapiFields.add("defaultValue"); + openapiFields.add("required"); + openapiFields.add("multiple"); + openapiFields.add("choices"); + openapiFields.add("dynamic"); + openapiFields.add("allowNull"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sortOrder"); + openapiRequiredFields.add("fieldKey"); + openapiRequiredFields.add("label"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("required"); + openapiRequiredFields.add("multiple"); + openapiRequiredFields.add("dynamic"); + openapiRequiredFields.add("allowNull"); + } - /** - * A list of machine-readable value/label pairs to populate a static dropdown. - * @return choices - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of machine-readable value/label pairs to populate a static dropdown.") + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationMetadataActionFieldV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataActionFieldV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataActionFieldV1 is" + + " not found in the empty JSON string", + DestinationMetadataActionFieldV1.openapiRequiredFields.toString())); + } + } - public Object getChoices() { - return choices; - } - - - public void setChoices(Object choices) { - this.choices = choices; - } - - - public DestinationMetadataActionFieldV1 dynamic(Boolean dynamic) { - - this.dynamic = dynamic; - return this; - } - - /** - * Whether this field should execute a dynamic request to fetch choices to populate a dropdown. When true, `choices` is ignored. - * @return dynamic - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field should execute a dynamic request to fetch choices to populate a dropdown. When true, `choices` is ignored.") - - public Boolean getDynamic() { - return dynamic; - } - - - public void setDynamic(Boolean dynamic) { - this.dynamic = dynamic; - } - - - public DestinationMetadataActionFieldV1 allowNull(Boolean allowNull) { - - this.allowNull = allowNull; - return this; - } - - /** - * Whether this field allows null values. - * @return allowNull - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field allows null values.") - - public Boolean getAllowNull() { - return allowNull; - } - - - public void setAllowNull(Boolean allowNull) { - this.allowNull = allowNull; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationMetadataActionFieldV1 destinationMetadataActionFieldV1 = (DestinationMetadataActionFieldV1) o; - return Objects.equals(this.id, destinationMetadataActionFieldV1.id) && - Objects.equals(this.sortOrder, destinationMetadataActionFieldV1.sortOrder) && - Objects.equals(this.fieldKey, destinationMetadataActionFieldV1.fieldKey) && - Objects.equals(this.label, destinationMetadataActionFieldV1.label) && - Objects.equals(this.type, destinationMetadataActionFieldV1.type) && - Objects.equals(this.description, destinationMetadataActionFieldV1.description) && - Objects.equals(this.placeholder, destinationMetadataActionFieldV1.placeholder) && - Objects.equals(this.defaultValue, destinationMetadataActionFieldV1.defaultValue) && - Objects.equals(this.required, destinationMetadataActionFieldV1.required) && - Objects.equals(this.multiple, destinationMetadataActionFieldV1.multiple) && - Objects.equals(this.choices, destinationMetadataActionFieldV1.choices) && - Objects.equals(this.dynamic, destinationMetadataActionFieldV1.dynamic) && - Objects.equals(this.allowNull, destinationMetadataActionFieldV1.allowNull); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, sortOrder, fieldKey, label, type, description, placeholder, defaultValue, required, multiple, choices, dynamic, allowNull); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataActionFieldV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n"); - sb.append(" fieldKey: ").append(toIndentedString(fieldKey)).append("\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" placeholder: ").append(toIndentedString(placeholder)).append("\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" multiple: ").append(toIndentedString(multiple)).append("\n"); - sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); - sb.append(" dynamic: ").append(toIndentedString(dynamic)).append("\n"); - sb.append(" allowNull: ").append(toIndentedString(allowNull)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sortOrder"); - openapiFields.add("fieldKey"); - openapiFields.add("label"); - openapiFields.add("type"); - openapiFields.add("description"); - openapiFields.add("placeholder"); - openapiFields.add("defaultValue"); - openapiFields.add("required"); - openapiFields.add("multiple"); - openapiFields.add("choices"); - openapiFields.add("dynamic"); - openapiFields.add("allowNull"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sortOrder"); - openapiRequiredFields.add("fieldKey"); - openapiRequiredFields.add("label"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("required"); - openapiRequiredFields.add("multiple"); - openapiRequiredFields.add("dynamic"); - openapiRequiredFields.add("allowNull"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataActionFieldV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataActionFieldV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataActionFieldV1 is not found in the empty JSON string", DestinationMetadataActionFieldV1.openapiRequiredFields.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataActionFieldV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataActionFieldV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataActionFieldV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataActionFieldV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationMetadataActionFieldV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("fieldKey").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fieldKey` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fieldKey").toString())); + } + if (!jsonObj.get("label").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `label` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("label").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("placeholder") != null && !jsonObj.get("placeholder").isJsonNull()) + && !jsonObj.get("placeholder").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `placeholder` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("placeholder").toString())); } - } + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadataActionFieldV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataActionFieldV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataActionFieldV1' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationMetadataActionFieldV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataActionFieldV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataActionFieldV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("fieldKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fieldKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldKey").toString())); - } - if (!jsonObj.get("label").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("label").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("placeholder") != null && !jsonObj.get("placeholder").isJsonNull()) && !jsonObj.get("placeholder").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `placeholder` to be a primitive type in the JSON string but got `%s`", jsonObj.get("placeholder").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataActionFieldV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataActionFieldV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataActionFieldV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataActionFieldV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataActionFieldV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationMetadataActionFieldV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataActionFieldV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataActionFieldV1 - */ - public static DestinationMetadataActionFieldV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataActionFieldV1.class); - } - - /** - * Convert an instance of DestinationMetadataActionFieldV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + } + /** + * Create an instance of DestinationMetadataActionFieldV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataActionFieldV1 + * @throws IOException if the JSON string is invalid with respect to + * DestinationMetadataActionFieldV1 + */ + public static DestinationMetadataActionFieldV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataActionFieldV1.class); + } + + /** + * Convert an instance of DestinationMetadataActionFieldV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java index 8907af76..cf87abc3 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,503 +10,527 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationMetadataActionFieldV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** Represents an Action, a building block of behavior that can be performed by the Destination. */ +@ApiModel( + description = + "Represents an Action, a building block of behavior that can be performed by the" + + " Destination.") +public class DestinationMetadataActionV1 { + public static final String SERIALIZED_NAME_ID = "id"; -/** - * Represents an Action, a building block of behavior that can be performed by the Destination. - */ -@ApiModel(description = "Represents an Action, a building block of behavior that can be performed by the Destination.") + @SerializedName(SERIALIZED_NAME_ID) + private String id; -public class DestinationMetadataActionV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_SLUG = "slug"; - public static final String SERIALIZED_NAME_SLUG = "slug"; - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; + @SerializedName(SERIALIZED_NAME_SLUG) + private String slug; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - /** - * The platform on which this action runs. - */ - @JsonAdapter(PlatformEnum.Adapter.class) - public enum PlatformEnum { - CLOUD("CLOUD"), - - MOBILE("MOBILE"), - - WEB("WEB"); + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - private String value; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - PlatformEnum(String value) { - this.value = value; - } + /** The platform on which this action runs. */ + @JsonAdapter(PlatformEnum.Adapter.class) + public enum PlatformEnum { + CLOUD("CLOUD"), - public String getValue() { - return value; - } + MOBILE("MOBILE"), - @Override - public String toString() { - return String.valueOf(value); - } + WEB("WEB"); + + private String value; - public static PlatformEnum fromValue(String value) { - for (PlatformEnum b : PlatformEnum.values()) { - if (b.value.equals(value)) { - return b; + PlatformEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlatformEnum fromValue(String value) { + for (PlatformEnum b : PlatformEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PlatformEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlatformEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlatformEnum.fromValue(value); + } } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PlatformEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + public static final String SERIALIZED_NAME_PLATFORM = "platform"; + + @SerializedName(SERIALIZED_NAME_PLATFORM) + private PlatformEnum platform; - @Override - public PlatformEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PlatformEnum.fromValue(value); - } + public static final String SERIALIZED_NAME_HIDDEN = "hidden"; + + @SerializedName(SERIALIZED_NAME_HIDDEN) + private Boolean hidden; + + public static final String SERIALIZED_NAME_DEFAULT_TRIGGER = "defaultTrigger"; + + @SerializedName(SERIALIZED_NAME_DEFAULT_TRIGGER) + private String defaultTrigger; + + public static final String SERIALIZED_NAME_FIELDS = "fields"; + + @SerializedName(SERIALIZED_NAME_FIELDS) + private List fields = new ArrayList<>(); + + public DestinationMetadataActionV1() {} + + public DestinationMetadataActionV1 id(String id) { + + this.id = id; + return this; } - } - public static final String SERIALIZED_NAME_PLATFORM = "platform"; - @SerializedName(SERIALIZED_NAME_PLATFORM) - private PlatformEnum platform; + /** + * The primary key of the action. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The primary key of the action.") + public String getId() { + return id; + } - public static final String SERIALIZED_NAME_HIDDEN = "hidden"; - @SerializedName(SERIALIZED_NAME_HIDDEN) - private Boolean hidden; + public void setId(String id) { + this.id = id; + } - public static final String SERIALIZED_NAME_DEFAULT_TRIGGER = "defaultTrigger"; - @SerializedName(SERIALIZED_NAME_DEFAULT_TRIGGER) - private String defaultTrigger; + public DestinationMetadataActionV1 slug(String slug) { - public static final String SERIALIZED_NAME_FIELDS = "fields"; - @SerializedName(SERIALIZED_NAME_FIELDS) - private List fields = new ArrayList<>(); + this.slug = slug; + return this; + } - public DestinationMetadataActionV1() { - } + /** + * A machine-readable key unique to the action definition. + * + * @return slug + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A machine-readable key unique to the action definition.") + public String getSlug() { + return slug; + } - public DestinationMetadataActionV1 id(String id) { - - this.id = id; - return this; - } + public void setSlug(String slug) { + this.slug = slug; + } - /** - * The primary key of the action. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The primary key of the action.") + public DestinationMetadataActionV1 name(String name) { - public String getId() { - return id; - } + this.name = name; + return this; + } + /** + * A human-readable name for the action. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A human-readable name for the action.") + public String getName() { + return name; + } - public void setId(String id) { - this.id = id; - } + public void setName(String name) { + this.name = name; + } + public DestinationMetadataActionV1 description(String description) { - public DestinationMetadataActionV1 slug(String slug) { - - this.slug = slug; - return this; - } + this.description = description; + return this; + } - /** - * A machine-readable key unique to the action definition. - * @return slug - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A machine-readable key unique to the action definition.") + /** + * A human-readable description of the action. May include Markdown. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A human-readable description of the action. May include Markdown.") + public String getDescription() { + return description; + } - public String getSlug() { - return slug; - } + public void setDescription(String description) { + this.description = description; + } + public DestinationMetadataActionV1 platform(PlatformEnum platform) { - public void setSlug(String slug) { - this.slug = slug; - } + this.platform = platform; + return this; + } + /** + * The platform on which this action runs. + * + * @return platform + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The platform on which this action runs.") + public PlatformEnum getPlatform() { + return platform; + } - public DestinationMetadataActionV1 name(String name) { - - this.name = name; - return this; - } + public void setPlatform(PlatformEnum platform) { + this.platform = platform; + } - /** - * A human-readable name for the action. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable name for the action.") + public DestinationMetadataActionV1 hidden(Boolean hidden) { - public String getName() { - return name; - } + this.hidden = hidden; + return this; + } + /** + * Whether the action should be hidden. + * + * @return hidden + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Whether the action should be hidden.") + public Boolean getHidden() { + return hidden; + } - public void setName(String name) { - this.name = name; - } + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + public DestinationMetadataActionV1 defaultTrigger(String defaultTrigger) { - public DestinationMetadataActionV1 description(String description) { - - this.description = description; - return this; - } + this.defaultTrigger = defaultTrigger; + return this; + } + + /** + * The default value used as the trigger when connecting this action. + * + * @return defaultTrigger + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = "The default value used as the trigger when connecting this action.") + public String getDefaultTrigger() { + return defaultTrigger; + } - /** - * A human-readable description of the action. May include Markdown. - * @return description - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable description of the action. May include Markdown.") + public void setDefaultTrigger(String defaultTrigger) { + this.defaultTrigger = defaultTrigger; + } - public String getDescription() { - return description; - } + public DestinationMetadataActionV1 fields(List fields) { + this.fields = fields; + return this; + } - public void setDescription(String description) { - this.description = description; - } + public DestinationMetadataActionV1 addFieldsItem(DestinationMetadataActionFieldV1 fieldsItem) { + this.fields.add(fieldsItem); + return this; + } + /** + * The fields expected in order to perform the action. + * + * @return fields + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The fields expected in order to perform the action.") + public List getFields() { + return fields; + } - public DestinationMetadataActionV1 platform(PlatformEnum platform) { - - this.platform = platform; - return this; - } + public void setFields(List fields) { + this.fields = fields; + } - /** - * The platform on which this action runs. - * @return platform - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The platform on which this action runs.") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataActionV1 destinationMetadataActionV1 = (DestinationMetadataActionV1) o; + return Objects.equals(this.id, destinationMetadataActionV1.id) + && Objects.equals(this.slug, destinationMetadataActionV1.slug) + && Objects.equals(this.name, destinationMetadataActionV1.name) + && Objects.equals(this.description, destinationMetadataActionV1.description) + && Objects.equals(this.platform, destinationMetadataActionV1.platform) + && Objects.equals(this.hidden, destinationMetadataActionV1.hidden) + && Objects.equals(this.defaultTrigger, destinationMetadataActionV1.defaultTrigger) + && Objects.equals(this.fields, destinationMetadataActionV1.fields); + } - public PlatformEnum getPlatform() { - return platform; - } + @Override + public int hashCode() { + return Objects.hash(id, slug, name, description, platform, hidden, defaultTrigger, fields); + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataActionV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); + sb.append(" defaultTrigger: ").append(toIndentedString(defaultTrigger)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public void setPlatform(PlatformEnum platform) { - this.platform = platform; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("slug"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("platform"); + openapiFields.add("hidden"); + openapiFields.add("defaultTrigger"); + openapiFields.add("fields"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("slug"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("platform"); + openapiRequiredFields.add("hidden"); + openapiRequiredFields.add("defaultTrigger"); + openapiRequiredFields.add("fields"); + } - public DestinationMetadataActionV1 hidden(Boolean hidden) { - - this.hidden = hidden; - return this; - } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataActionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataActionV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataActionV1 is not" + + " found in the empty JSON string", + DestinationMetadataActionV1.openapiRequiredFields.toString())); + } + } - /** - * Whether the action should be hidden. - * @return hidden - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether the action should be hidden.") - - public Boolean getHidden() { - return hidden; - } - - - public void setHidden(Boolean hidden) { - this.hidden = hidden; - } - - - public DestinationMetadataActionV1 defaultTrigger(String defaultTrigger) { - - this.defaultTrigger = defaultTrigger; - return this; - } - - /** - * The default value used as the trigger when connecting this action. - * @return defaultTrigger - **/ - @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "The default value used as the trigger when connecting this action.") - - public String getDefaultTrigger() { - return defaultTrigger; - } - - - public void setDefaultTrigger(String defaultTrigger) { - this.defaultTrigger = defaultTrigger; - } - - - public DestinationMetadataActionV1 fields(List fields) { - - this.fields = fields; - return this; - } - - public DestinationMetadataActionV1 addFieldsItem(DestinationMetadataActionFieldV1 fieldsItem) { - this.fields.add(fieldsItem); - return this; - } - - /** - * The fields expected in order to perform the action. - * @return fields - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The fields expected in order to perform the action.") - - public List getFields() { - return fields; - } - - - public void setFields(List fields) { - this.fields = fields; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationMetadataActionV1 destinationMetadataActionV1 = (DestinationMetadataActionV1) o; - return Objects.equals(this.id, destinationMetadataActionV1.id) && - Objects.equals(this.slug, destinationMetadataActionV1.slug) && - Objects.equals(this.name, destinationMetadataActionV1.name) && - Objects.equals(this.description, destinationMetadataActionV1.description) && - Objects.equals(this.platform, destinationMetadataActionV1.platform) && - Objects.equals(this.hidden, destinationMetadataActionV1.hidden) && - Objects.equals(this.defaultTrigger, destinationMetadataActionV1.defaultTrigger) && - Objects.equals(this.fields, destinationMetadataActionV1.fields); - } - - @Override - public int hashCode() { - return Objects.hash(id, slug, name, description, platform, hidden, defaultTrigger, fields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataActionV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); - sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); - sb.append(" defaultTrigger: ").append(toIndentedString(defaultTrigger)).append("\n"); - sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("slug"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("platform"); - openapiFields.add("hidden"); - openapiFields.add("defaultTrigger"); - openapiFields.add("fields"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("slug"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("platform"); - openapiRequiredFields.add("hidden"); - openapiRequiredFields.add("defaultTrigger"); - openapiRequiredFields.add("fields"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataActionV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataActionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataActionV1 is not found in the empty JSON string", DestinationMetadataActionV1.openapiRequiredFields.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataActionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataActionV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataActionV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataActionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationMetadataActionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slug` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slug").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("platform").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `platform` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("platform").toString())); + } + if (!jsonObj.get("defaultTrigger").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `defaultTrigger` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("defaultTrigger").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fields` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("fields").toString())); } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadataActionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataActionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataActionV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataActionV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataActionV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataActionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("platform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `platform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("platform").toString())); - } - if (!jsonObj.get("defaultTrigger").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `defaultTrigger` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultTrigger").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("fields").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); - } - - JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataActionV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataActionV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataActionV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataActionV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataActionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationMetadataActionV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataActionV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataActionV1 - */ - public static DestinationMetadataActionV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataActionV1.class); - } - - /** - * Convert an instance of DestinationMetadataActionV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + } + + /** + * Create an instance of DestinationMetadataActionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataActionV1 + * @throws IOException if the JSON string is invalid with respect to DestinationMetadataActionV1 + */ + public static DestinationMetadataActionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataActionV1.class); + } + /** + * Convert an instance of DestinationMetadataActionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java index 642b4a07..665a5c94 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,373 +10,382 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents a component this Destination provides. - */ +/** Represents a component this Destination provides. */ @ApiModel(description = "Represents a component this Destination provides.") - public class DestinationMetadataComponentV1 { - /** - * The component type. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ANDROID("ANDROID"), - - BROWSER("BROWSER"), - - IOS("IOS"), - - SERVER("SERVER"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } + /** The component type. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ANDROID("ANDROID"), - public String getValue() { - return value; - } + BROWSER("BROWSER"), - @Override - public String toString() { - return String.valueOf(value); - } + IOS("IOS"), + + SERVER("SERVER"); - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + private String value; + + TypeEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + public static final String SERIALIZED_NAME_TYPE = "type"; - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; - /** - * The owner of this component. Either 'SEGMENT' or 'PARTNER'. - */ - @JsonAdapter(OwnerEnum.Adapter.class) - public enum OwnerEnum { - PARTNER("PARTNER"), - - SEGMENT("SEGMENT"); + public static final String SERIALIZED_NAME_CODE = "code"; - private String value; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; - OwnerEnum(String value) { - this.value = value; - } + /** The owner of this component. Either 'SEGMENT' or 'PARTNER'. */ + @JsonAdapter(OwnerEnum.Adapter.class) + public enum OwnerEnum { + PARTNER("PARTNER"), - public String getValue() { - return value; - } + SEGMENT("SEGMENT"); - @Override - public String toString() { - return String.valueOf(value); - } + private String value; - public static OwnerEnum fromValue(String value) { - for (OwnerEnum b : OwnerEnum.values()) { - if (b.value.equals(value)) { - return b; + OwnerEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final OwnerEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OwnerEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OwnerEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_OWNER = "owner"; - @SerializedName(SERIALIZED_NAME_OWNER) - private OwnerEnum owner; + public String getValue() { + return value; + } - public DestinationMetadataComponentV1() { - } + @Override + public String toString() { + return String.valueOf(value); + } - public DestinationMetadataComponentV1 type(TypeEnum type) { - - this.type = type; - return this; - } + public static OwnerEnum fromValue(String value) { + for (OwnerEnum b : OwnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * The component type. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The component type.") + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OwnerEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OwnerEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OwnerEnum.fromValue(value); + } + } + } - public TypeEnum getType() { - return type; - } + public static final String SERIALIZED_NAME_OWNER = "owner"; + @SerializedName(SERIALIZED_NAME_OWNER) + private OwnerEnum owner; - public void setType(TypeEnum type) { - this.type = type; - } + public DestinationMetadataComponentV1() {} + public DestinationMetadataComponentV1 type(TypeEnum type) { - public DestinationMetadataComponentV1 code(String code) { - - this.code = code; - return this; - } + this.type = type; + return this; + } - /** - * Link to the repository hosting the code for this component. - * @return code - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link to the repository hosting the code for this component.") + /** + * The component type. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The component type.") + public TypeEnum getType() { + return type; + } - public String getCode() { - return code; - } + public void setType(TypeEnum type) { + this.type = type; + } + public DestinationMetadataComponentV1 code(String code) { - public void setCode(String code) { - this.code = code; - } + this.code = code; + return this; + } + /** + * Link to the repository hosting the code for this component. + * + * @return code + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Link to the repository hosting the code for this component.") + public String getCode() { + return code; + } - public DestinationMetadataComponentV1 owner(OwnerEnum owner) { - - this.owner = owner; - return this; - } + public void setCode(String code) { + this.code = code; + } - /** - * The owner of this component. Either 'SEGMENT' or 'PARTNER'. - * @return owner - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The owner of this component. Either 'SEGMENT' or 'PARTNER'.") + public DestinationMetadataComponentV1 owner(OwnerEnum owner) { - public OwnerEnum getOwner() { - return owner; - } + this.owner = owner; + return this; + } + /** + * The owner of this component. Either 'SEGMENT' or 'PARTNER'. + * + * @return owner + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The owner of this component. Either 'SEGMENT' or 'PARTNER'.") + public OwnerEnum getOwner() { + return owner; + } - public void setOwner(OwnerEnum owner) { - this.owner = owner; - } + public void setOwner(OwnerEnum owner) { + this.owner = owner; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataComponentV1 destinationMetadataComponentV1 = + (DestinationMetadataComponentV1) o; + return Objects.equals(this.type, destinationMetadataComponentV1.type) + && Objects.equals(this.code, destinationMetadataComponentV1.code) + && Objects.equals(this.owner, destinationMetadataComponentV1.owner); + } + @Override + public int hashCode() { + return Objects.hash(type, code, owner); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataComponentV1 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationMetadataComponentV1 destinationMetadataComponentV1 = (DestinationMetadataComponentV1) o; - return Objects.equals(this.type, destinationMetadataComponentV1.type) && - Objects.equals(this.code, destinationMetadataComponentV1.code) && - Objects.equals(this.owner, destinationMetadataComponentV1.owner); - } - - @Override - public int hashCode() { - return Objects.hash(type, code, owner); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataComponentV1 {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("code"); + openapiFields.add("owner"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("code"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("code"); - openapiFields.add("owner"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("code"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataComponentV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataComponentV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataComponentV1 is not found in the empty JSON string", DestinationMetadataComponentV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationMetadataComponentV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataComponentV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataComponentV1 is not" + + " found in the empty JSON string", + DestinationMetadataComponentV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataComponentV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataComponentV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataComponentV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataComponentV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadataComponentV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationMetadataComponentV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("owner") != null && !jsonObj.get("owner").isJsonNull()) + && !jsonObj.get("owner").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `owner` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("owner").toString())); } - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if ((jsonObj.get("owner") != null && !jsonObj.get("owner").isJsonNull()) && !jsonObj.get("owner").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `owner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataComponentV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataComponentV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataComponentV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataComponentV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataComponentV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationMetadataComponentV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataComponentV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataComponentV1 - */ - public static DestinationMetadataComponentV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataComponentV1.class); - } - - /** - * Convert an instance of DestinationMetadataComponentV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataComponentV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataComponentV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationMetadataComponentV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataComponentV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataComponentV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationMetadataComponentV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataComponentV1 + * @throws IOException if the JSON string is invalid with respect to + * DestinationMetadataComponentV1 + */ + public static DestinationMetadataComponentV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataComponentV1.class); + } + + /** + * Convert an instance of DestinationMetadataComponentV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java index 4dfa96d9..5ea8e9b8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,427 +10,467 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents features that a given Destination supports. - */ +/** Represents features that a given Destination supports. */ @ApiModel(description = "Represents features that a given Destination supports.") - public class DestinationMetadataFeaturesV1 { - /** - * This Destination's support level for cloud mode instances. The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent. - */ - @JsonAdapter(CloudModeInstancesEnum.Adapter.class) - public enum CloudModeInstancesEnum { - _0("0"), - - _1("1"), - - MULTIPLE("MULTIPLE"), - - NONE("NONE"), - - SINGLE("SINGLE"); - - private String value; - - CloudModeInstancesEnum(String value) { - this.value = value; - } + /** + * This Destination's support level for cloud mode instances. The values '0' and + * 'NONE', and '1' and 'SINGLE' are equivalent. + */ + @JsonAdapter(CloudModeInstancesEnum.Adapter.class) + public enum CloudModeInstancesEnum { + _0("0"), - public String getValue() { - return value; - } + _1("1"), - @Override - public String toString() { - return String.valueOf(value); - } + MULTIPLE("MULTIPLE"), + + NONE("NONE"), + + SINGLE("SINGLE"); + + private String value; - public static CloudModeInstancesEnum fromValue(String value) { - for (CloudModeInstancesEnum b : CloudModeInstancesEnum.values()) { - if (b.value.equals(value)) { - return b; + CloudModeInstancesEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CloudModeInstancesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CloudModeInstancesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CloudModeInstancesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_CLOUD_MODE_INSTANCES = "cloudModeInstances"; - @SerializedName(SERIALIZED_NAME_CLOUD_MODE_INSTANCES) - private CloudModeInstancesEnum cloudModeInstances; - - /** - * This Destination's support level for device mode instances. Support for multiple device mode instances is currently not planned. The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent. - */ - @JsonAdapter(DeviceModeInstancesEnum.Adapter.class) - public enum DeviceModeInstancesEnum { - _0("0"), - - _1("1"), - - NONE("NONE"), - - SINGLE("SINGLE"); - - private String value; - - DeviceModeInstancesEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); - } + public static CloudModeInstancesEnum fromValue(String value) { + for (CloudModeInstancesEnum b : CloudModeInstancesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static DeviceModeInstancesEnum fromValue(String value) { - for (DeviceModeInstancesEnum b : DeviceModeInstancesEnum.values()) { - if (b.value.equals(value)) { - return b; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CloudModeInstancesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CloudModeInstancesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CloudModeInstancesEnum.fromValue(value); + } } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final DeviceModeInstancesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public DeviceModeInstancesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return DeviceModeInstancesEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_CLOUD_MODE_INSTANCES = "cloudModeInstances"; + + @SerializedName(SERIALIZED_NAME_CLOUD_MODE_INSTANCES) + private CloudModeInstancesEnum cloudModeInstances; + + /** + * This Destination's support level for device mode instances. Support for multiple device + * mode instances is currently not planned. The values '0' and 'NONE', and + * '1' and 'SINGLE' are equivalent. + */ + @JsonAdapter(DeviceModeInstancesEnum.Adapter.class) + public enum DeviceModeInstancesEnum { + _0("0"), + + _1("1"), + + NONE("NONE"), + + SINGLE("SINGLE"); + + private String value; - public static final String SERIALIZED_NAME_DEVICE_MODE_INSTANCES = "deviceModeInstances"; - @SerializedName(SERIALIZED_NAME_DEVICE_MODE_INSTANCES) - private DeviceModeInstancesEnum deviceModeInstances; + DeviceModeInstancesEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_REPLAY = "replay"; - @SerializedName(SERIALIZED_NAME_REPLAY) - private Boolean replay; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_BROWSER_UNBUNDLING = "browserUnbundling"; - @SerializedName(SERIALIZED_NAME_BROWSER_UNBUNDLING) - private Boolean browserUnbundling; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_BROWSER_UNBUNDLING_PUBLIC = "browserUnbundlingPublic"; - @SerializedName(SERIALIZED_NAME_BROWSER_UNBUNDLING_PUBLIC) - private Boolean browserUnbundlingPublic; + public static DeviceModeInstancesEnum fromValue(String value) { + for (DeviceModeInstancesEnum b : DeviceModeInstancesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public DestinationMetadataFeaturesV1() { - } + public static class Adapter extends TypeAdapter { + @Override + public void write( + final JsonWriter jsonWriter, final DeviceModeInstancesEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DeviceModeInstancesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DeviceModeInstancesEnum.fromValue(value); + } + } + } - public DestinationMetadataFeaturesV1 cloudModeInstances(CloudModeInstancesEnum cloudModeInstances) { - - this.cloudModeInstances = cloudModeInstances; - return this; - } + public static final String SERIALIZED_NAME_DEVICE_MODE_INSTANCES = "deviceModeInstances"; - /** - * This Destination's support level for cloud mode instances. The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent. - * @return cloudModeInstances - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "This Destination's support level for cloud mode instances. The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent.") + @SerializedName(SERIALIZED_NAME_DEVICE_MODE_INSTANCES) + private DeviceModeInstancesEnum deviceModeInstances; - public CloudModeInstancesEnum getCloudModeInstances() { - return cloudModeInstances; - } + public static final String SERIALIZED_NAME_REPLAY = "replay"; + @SerializedName(SERIALIZED_NAME_REPLAY) + private Boolean replay; - public void setCloudModeInstances(CloudModeInstancesEnum cloudModeInstances) { - this.cloudModeInstances = cloudModeInstances; - } + public static final String SERIALIZED_NAME_BROWSER_UNBUNDLING = "browserUnbundling"; + @SerializedName(SERIALIZED_NAME_BROWSER_UNBUNDLING) + private Boolean browserUnbundling; - public DestinationMetadataFeaturesV1 deviceModeInstances(DeviceModeInstancesEnum deviceModeInstances) { - - this.deviceModeInstances = deviceModeInstances; - return this; - } + public static final String SERIALIZED_NAME_BROWSER_UNBUNDLING_PUBLIC = + "browserUnbundlingPublic"; - /** - * This Destination's support level for device mode instances. Support for multiple device mode instances is currently not planned. The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent. - * @return deviceModeInstances - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "This Destination's support level for device mode instances. Support for multiple device mode instances is currently not planned. The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent.") + @SerializedName(SERIALIZED_NAME_BROWSER_UNBUNDLING_PUBLIC) + private Boolean browserUnbundlingPublic; - public DeviceModeInstancesEnum getDeviceModeInstances() { - return deviceModeInstances; - } + public DestinationMetadataFeaturesV1() {} + public DestinationMetadataFeaturesV1 cloudModeInstances( + CloudModeInstancesEnum cloudModeInstances) { - public void setDeviceModeInstances(DeviceModeInstancesEnum deviceModeInstances) { - this.deviceModeInstances = deviceModeInstances; - } + this.cloudModeInstances = cloudModeInstances; + return this; + } + /** + * This Destination's support level for cloud mode instances. The values '0' and + * 'NONE', and '1' and 'SINGLE' are equivalent. + * + * @return cloudModeInstances + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "This Destination's support level for cloud mode instances. The values '0' and" + + " 'NONE', and '1' and 'SINGLE' are equivalent.") + public CloudModeInstancesEnum getCloudModeInstances() { + return cloudModeInstances; + } - public DestinationMetadataFeaturesV1 replay(Boolean replay) { - - this.replay = replay; - return this; - } + public void setCloudModeInstances(CloudModeInstancesEnum cloudModeInstances) { + this.cloudModeInstances = cloudModeInstances; + } - /** - * Whether this Destination supports replays. - * @return replay - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports replays.") + public DestinationMetadataFeaturesV1 deviceModeInstances( + DeviceModeInstancesEnum deviceModeInstances) { - public Boolean getReplay() { - return replay; - } + this.deviceModeInstances = deviceModeInstances; + return this; + } + /** + * This Destination's support level for device mode instances. Support for multiple device + * mode instances is currently not planned. The values '0' and 'NONE', and + * '1' and 'SINGLE' are equivalent. + * + * @return deviceModeInstances + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "This Destination's support level for device mode instances. Support for" + + " multiple device mode instances is currently not planned. The values '0'" + + " and 'NONE', and '1' and 'SINGLE' are equivalent.") + public DeviceModeInstancesEnum getDeviceModeInstances() { + return deviceModeInstances; + } - public void setReplay(Boolean replay) { - this.replay = replay; - } + public void setDeviceModeInstances(DeviceModeInstancesEnum deviceModeInstances) { + this.deviceModeInstances = deviceModeInstances; + } + public DestinationMetadataFeaturesV1 replay(Boolean replay) { - public DestinationMetadataFeaturesV1 browserUnbundling(Boolean browserUnbundling) { - - this.browserUnbundling = browserUnbundling; - return this; - } + this.replay = replay; + return this; + } - /** - * Whether this Destination supports browser unbundling. - * @return browserUnbundling - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports browser unbundling.") + /** + * Whether this Destination supports replays. + * + * @return replay + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination supports replays.") + public Boolean getReplay() { + return replay; + } - public Boolean getBrowserUnbundling() { - return browserUnbundling; - } + public void setReplay(Boolean replay) { + this.replay = replay; + } + public DestinationMetadataFeaturesV1 browserUnbundling(Boolean browserUnbundling) { - public void setBrowserUnbundling(Boolean browserUnbundling) { - this.browserUnbundling = browserUnbundling; - } + this.browserUnbundling = browserUnbundling; + return this; + } + /** + * Whether this Destination supports browser unbundling. + * + * @return browserUnbundling + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination supports browser unbundling.") + public Boolean getBrowserUnbundling() { + return browserUnbundling; + } - public DestinationMetadataFeaturesV1 browserUnbundlingPublic(Boolean browserUnbundlingPublic) { - - this.browserUnbundlingPublic = browserUnbundlingPublic; - return this; - } + public void setBrowserUnbundling(Boolean browserUnbundling) { + this.browserUnbundling = browserUnbundling; + } - /** - * Whether this Destination supports public browser unbundling. - * @return browserUnbundlingPublic - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports public browser unbundling.") + public DestinationMetadataFeaturesV1 browserUnbundlingPublic(Boolean browserUnbundlingPublic) { - public Boolean getBrowserUnbundlingPublic() { - return browserUnbundlingPublic; - } + this.browserUnbundlingPublic = browserUnbundlingPublic; + return this; + } + /** + * Whether this Destination supports public browser unbundling. + * + * @return browserUnbundlingPublic + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination supports public browser unbundling.") + public Boolean getBrowserUnbundlingPublic() { + return browserUnbundlingPublic; + } - public void setBrowserUnbundlingPublic(Boolean browserUnbundlingPublic) { - this.browserUnbundlingPublic = browserUnbundlingPublic; - } + public void setBrowserUnbundlingPublic(Boolean browserUnbundlingPublic) { + this.browserUnbundlingPublic = browserUnbundlingPublic; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataFeaturesV1 destinationMetadataFeaturesV1 = + (DestinationMetadataFeaturesV1) o; + return Objects.equals( + this.cloudModeInstances, destinationMetadataFeaturesV1.cloudModeInstances) + && Objects.equals( + this.deviceModeInstances, destinationMetadataFeaturesV1.deviceModeInstances) + && Objects.equals(this.replay, destinationMetadataFeaturesV1.replay) + && Objects.equals( + this.browserUnbundling, destinationMetadataFeaturesV1.browserUnbundling) + && Objects.equals( + this.browserUnbundlingPublic, + destinationMetadataFeaturesV1.browserUnbundlingPublic); + } + @Override + public int hashCode() { + return Objects.hash( + cloudModeInstances, + deviceModeInstances, + replay, + browserUnbundling, + browserUnbundlingPublic); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataFeaturesV1 {\n"); + sb.append(" cloudModeInstances: ") + .append(toIndentedString(cloudModeInstances)) + .append("\n"); + sb.append(" deviceModeInstances: ") + .append(toIndentedString(deviceModeInstances)) + .append("\n"); + sb.append(" replay: ").append(toIndentedString(replay)).append("\n"); + sb.append(" browserUnbundling: ") + .append(toIndentedString(browserUnbundling)) + .append("\n"); + sb.append(" browserUnbundlingPublic: ") + .append(toIndentedString(browserUnbundlingPublic)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationMetadataFeaturesV1 destinationMetadataFeaturesV1 = (DestinationMetadataFeaturesV1) o; - return Objects.equals(this.cloudModeInstances, destinationMetadataFeaturesV1.cloudModeInstances) && - Objects.equals(this.deviceModeInstances, destinationMetadataFeaturesV1.deviceModeInstances) && - Objects.equals(this.replay, destinationMetadataFeaturesV1.replay) && - Objects.equals(this.browserUnbundling, destinationMetadataFeaturesV1.browserUnbundling) && - Objects.equals(this.browserUnbundlingPublic, destinationMetadataFeaturesV1.browserUnbundlingPublic); - } - - @Override - public int hashCode() { - return Objects.hash(cloudModeInstances, deviceModeInstances, replay, browserUnbundling, browserUnbundlingPublic); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataFeaturesV1 {\n"); - sb.append(" cloudModeInstances: ").append(toIndentedString(cloudModeInstances)).append("\n"); - sb.append(" deviceModeInstances: ").append(toIndentedString(deviceModeInstances)).append("\n"); - sb.append(" replay: ").append(toIndentedString(replay)).append("\n"); - sb.append(" browserUnbundling: ").append(toIndentedString(browserUnbundling)).append("\n"); - sb.append(" browserUnbundlingPublic: ").append(toIndentedString(browserUnbundlingPublic)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cloudModeInstances"); + openapiFields.add("deviceModeInstances"); + openapiFields.add("replay"); + openapiFields.add("browserUnbundling"); + openapiFields.add("browserUnbundlingPublic"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cloudModeInstances"); - openapiFields.add("deviceModeInstances"); - openapiFields.add("replay"); - openapiFields.add("browserUnbundling"); - openapiFields.add("browserUnbundlingPublic"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataFeaturesV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataFeaturesV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataFeaturesV1 is not found in the empty JSON string", DestinationMetadataFeaturesV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationMetadataFeaturesV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataFeaturesV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataFeaturesV1 is not" + + " found in the empty JSON string", + DestinationMetadataFeaturesV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataFeaturesV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataFeaturesV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataFeaturesV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataFeaturesV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("cloudModeInstances") != null + && !jsonObj.get("cloudModeInstances").isJsonNull()) + && !jsonObj.get("cloudModeInstances").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cloudModeInstances` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("cloudModeInstances").toString())); + } + if ((jsonObj.get("deviceModeInstances") != null + && !jsonObj.get("deviceModeInstances").isJsonNull()) + && !jsonObj.get("deviceModeInstances").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deviceModeInstances` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("deviceModeInstances").toString())); } - } - if ((jsonObj.get("cloudModeInstances") != null && !jsonObj.get("cloudModeInstances").isJsonNull()) && !jsonObj.get("cloudModeInstances").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cloudModeInstances` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cloudModeInstances").toString())); - } - if ((jsonObj.get("deviceModeInstances") != null && !jsonObj.get("deviceModeInstances").isJsonNull()) && !jsonObj.get("deviceModeInstances").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceModeInstances` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceModeInstances").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataFeaturesV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataFeaturesV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataFeaturesV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataFeaturesV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataFeaturesV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationMetadataFeaturesV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataFeaturesV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataFeaturesV1 - */ - public static DestinationMetadataFeaturesV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataFeaturesV1.class); - } - - /** - * Convert an instance of DestinationMetadataFeaturesV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataFeaturesV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataFeaturesV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationMetadataFeaturesV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataFeaturesV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataFeaturesV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationMetadataFeaturesV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataFeaturesV1 + * @throws IOException if the JSON string is invalid with respect to + * DestinationMetadataFeaturesV1 + */ + public static DestinationMetadataFeaturesV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataFeaturesV1.class); + } + + /** + * Convert an instance of DestinationMetadataFeaturesV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java index 68da12c3..43bd017e 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,317 +10,306 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents methods that a given Destination supports. - */ +/** Represents methods that a given Destination supports. */ @ApiModel(description = "Represents methods that a given Destination supports.") - public class DestinationMetadataMethodsV1 { - public static final String SERIALIZED_NAME_PAGEVIEW = "pageview"; - @SerializedName(SERIALIZED_NAME_PAGEVIEW) - private Boolean pageview; - - public static final String SERIALIZED_NAME_IDENTIFY = "identify"; - @SerializedName(SERIALIZED_NAME_IDENTIFY) - private Boolean identify; - - public static final String SERIALIZED_NAME_ALIAS = "alias"; - @SerializedName(SERIALIZED_NAME_ALIAS) - private Boolean alias; - - public static final String SERIALIZED_NAME_TRACK = "track"; - @SerializedName(SERIALIZED_NAME_TRACK) - private Boolean track; - - public static final String SERIALIZED_NAME_GROUP = "group"; - @SerializedName(SERIALIZED_NAME_GROUP) - private Boolean group; + public static final String SERIALIZED_NAME_PAGEVIEW = "pageview"; - public DestinationMetadataMethodsV1() { - } + @SerializedName(SERIALIZED_NAME_PAGEVIEW) + private Boolean pageview; - public DestinationMetadataMethodsV1 pageview(Boolean pageview) { - - this.pageview = pageview; - return this; - } + public static final String SERIALIZED_NAME_IDENTIFY = "identify"; - /** - * Identifies if the Destination supports the `pageview` method. - * @return pageview - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `pageview` method.") + @SerializedName(SERIALIZED_NAME_IDENTIFY) + private Boolean identify; - public Boolean getPageview() { - return pageview; - } + public static final String SERIALIZED_NAME_ALIAS = "alias"; + @SerializedName(SERIALIZED_NAME_ALIAS) + private Boolean alias; - public void setPageview(Boolean pageview) { - this.pageview = pageview; - } + public static final String SERIALIZED_NAME_TRACK = "track"; + @SerializedName(SERIALIZED_NAME_TRACK) + private Boolean track; - public DestinationMetadataMethodsV1 identify(Boolean identify) { - - this.identify = identify; - return this; - } + public static final String SERIALIZED_NAME_GROUP = "group"; - /** - * Identifies if the Destination supports the `identify` method. - * @return identify - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `identify` method.") + @SerializedName(SERIALIZED_NAME_GROUP) + private Boolean group; - public Boolean getIdentify() { - return identify; - } + public DestinationMetadataMethodsV1() {} + public DestinationMetadataMethodsV1 pageview(Boolean pageview) { - public void setIdentify(Boolean identify) { - this.identify = identify; - } + this.pageview = pageview; + return this; + } + /** + * Identifies if the Destination supports the `pageview` method. + * + * @return pageview + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Identifies if the Destination supports the `pageview` method.") + public Boolean getPageview() { + return pageview; + } - public DestinationMetadataMethodsV1 alias(Boolean alias) { - - this.alias = alias; - return this; - } + public void setPageview(Boolean pageview) { + this.pageview = pageview; + } - /** - * Identifies if the Destination supports the `alias` method. - * @return alias - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `alias` method.") + public DestinationMetadataMethodsV1 identify(Boolean identify) { - public Boolean getAlias() { - return alias; - } + this.identify = identify; + return this; + } + /** + * Identifies if the Destination supports the `identify` method. + * + * @return identify + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Identifies if the Destination supports the `identify` method.") + public Boolean getIdentify() { + return identify; + } - public void setAlias(Boolean alias) { - this.alias = alias; - } + public void setIdentify(Boolean identify) { + this.identify = identify; + } + public DestinationMetadataMethodsV1 alias(Boolean alias) { - public DestinationMetadataMethodsV1 track(Boolean track) { - - this.track = track; - return this; - } + this.alias = alias; + return this; + } - /** - * Identifies if the Destination supports the `track` method. - * @return track - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `track` method.") + /** + * Identifies if the Destination supports the `alias` method. + * + * @return alias + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Identifies if the Destination supports the `alias` method.") + public Boolean getAlias() { + return alias; + } - public Boolean getTrack() { - return track; - } + public void setAlias(Boolean alias) { + this.alias = alias; + } + public DestinationMetadataMethodsV1 track(Boolean track) { - public void setTrack(Boolean track) { - this.track = track; - } + this.track = track; + return this; + } + /** + * Identifies if the Destination supports the `track` method. + * + * @return track + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Identifies if the Destination supports the `track` method.") + public Boolean getTrack() { + return track; + } - public DestinationMetadataMethodsV1 group(Boolean group) { - - this.group = group; - return this; - } + public void setTrack(Boolean track) { + this.track = track; + } - /** - * Identifies if the Destination supports the `group` method. - * @return group - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `group` method.") + public DestinationMetadataMethodsV1 group(Boolean group) { - public Boolean getGroup() { - return group; - } + this.group = group; + return this; + } + /** + * Identifies if the Destination supports the `group` method. + * + * @return group + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Identifies if the Destination supports the `group` method.") + public Boolean getGroup() { + return group; + } - public void setGroup(Boolean group) { - this.group = group; - } + public void setGroup(Boolean group) { + this.group = group; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataMethodsV1 destinationMetadataMethodsV1 = + (DestinationMetadataMethodsV1) o; + return Objects.equals(this.pageview, destinationMetadataMethodsV1.pageview) + && Objects.equals(this.identify, destinationMetadataMethodsV1.identify) + && Objects.equals(this.alias, destinationMetadataMethodsV1.alias) + && Objects.equals(this.track, destinationMetadataMethodsV1.track) + && Objects.equals(this.group, destinationMetadataMethodsV1.group); + } + @Override + public int hashCode() { + return Objects.hash(pageview, identify, alias, track, group); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataMethodsV1 {\n"); + sb.append(" pageview: ").append(toIndentedString(pageview)).append("\n"); + sb.append(" identify: ").append(toIndentedString(identify)).append("\n"); + sb.append(" alias: ").append(toIndentedString(alias)).append("\n"); + sb.append(" track: ").append(toIndentedString(track)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationMetadataMethodsV1 destinationMetadataMethodsV1 = (DestinationMetadataMethodsV1) o; - return Objects.equals(this.pageview, destinationMetadataMethodsV1.pageview) && - Objects.equals(this.identify, destinationMetadataMethodsV1.identify) && - Objects.equals(this.alias, destinationMetadataMethodsV1.alias) && - Objects.equals(this.track, destinationMetadataMethodsV1.track) && - Objects.equals(this.group, destinationMetadataMethodsV1.group); - } - - @Override - public int hashCode() { - return Objects.hash(pageview, identify, alias, track, group); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataMethodsV1 {\n"); - sb.append(" pageview: ").append(toIndentedString(pageview)).append("\n"); - sb.append(" identify: ").append(toIndentedString(identify)).append("\n"); - sb.append(" alias: ").append(toIndentedString(alias)).append("\n"); - sb.append(" track: ").append(toIndentedString(track)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pageview"); + openapiFields.add("identify"); + openapiFields.add("alias"); + openapiFields.add("track"); + openapiFields.add("group"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("pageview"); - openapiFields.add("identify"); - openapiFields.add("alias"); - openapiFields.add("track"); - openapiFields.add("group"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataMethodsV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataMethodsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataMethodsV1 is not found in the empty JSON string", DestinationMetadataMethodsV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationMetadataMethodsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataMethodsV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataMethodsV1 is not" + + " found in the empty JSON string", + DestinationMetadataMethodsV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataMethodsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataMethodsV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataMethodsV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataMethodsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataMethodsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataMethodsV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationMetadataMethodsV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataMethodsV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataMethodsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataMethodsV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataMethodsV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataMethodsV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataMethodsV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataMethodsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + /** + * Create an instance of DestinationMetadataMethodsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataMethodsV1 + * @throws IOException if the JSON string is invalid with respect to + * DestinationMetadataMethodsV1 + */ + public static DestinationMetadataMethodsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataMethodsV1.class); } - } - - /** - * Create an instance of DestinationMetadataMethodsV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataMethodsV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataMethodsV1 - */ - public static DestinationMetadataMethodsV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataMethodsV1.class); - } - - /** - * Convert an instance of DestinationMetadataMethodsV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DestinationMetadataMethodsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index e36d591f..bb95447f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,257 +10,249 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents platforms that a given Destination supports. - */ +/** Represents platforms that a given Destination supports. */ @ApiModel(description = "Represents platforms that a given Destination supports.") - public class DestinationMetadataPlatformsV1 { - public static final String SERIALIZED_NAME_BROWSER = "browser"; - @SerializedName(SERIALIZED_NAME_BROWSER) - private Boolean browser; + public static final String SERIALIZED_NAME_BROWSER = "browser"; - public static final String SERIALIZED_NAME_SERVER = "server"; - @SerializedName(SERIALIZED_NAME_SERVER) - private Boolean server; + @SerializedName(SERIALIZED_NAME_BROWSER) + private Boolean browser; - public static final String SERIALIZED_NAME_MOBILE = "mobile"; - @SerializedName(SERIALIZED_NAME_MOBILE) - private Boolean mobile; + public static final String SERIALIZED_NAME_SERVER = "server"; - public DestinationMetadataPlatformsV1() { - } + @SerializedName(SERIALIZED_NAME_SERVER) + private Boolean server; - public DestinationMetadataPlatformsV1 browser(Boolean browser) { - - this.browser = browser; - return this; - } + public static final String SERIALIZED_NAME_MOBILE = "mobile"; - /** - * Whether this Destination supports browser events. - * @return browser - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports browser events.") + @SerializedName(SERIALIZED_NAME_MOBILE) + private Boolean mobile; - public Boolean getBrowser() { - return browser; - } + public DestinationMetadataPlatformsV1() {} + public DestinationMetadataPlatformsV1 browser(Boolean browser) { - public void setBrowser(Boolean browser) { - this.browser = browser; - } - - - public DestinationMetadataPlatformsV1 server(Boolean server) { - - this.server = server; - return this; - } + this.browser = browser; + return this; + } - /** - * Whether this Destination supports server events. - * @return server - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports server events.") + /** + * Whether this Destination supports browser events. + * + * @return browser + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination supports browser events.") + public Boolean getBrowser() { + return browser; + } - public Boolean getServer() { - return server; - } + public void setBrowser(Boolean browser) { + this.browser = browser; + } + public DestinationMetadataPlatformsV1 server(Boolean server) { - public void setServer(Boolean server) { - this.server = server; - } + this.server = server; + return this; + } + /** + * Whether this Destination supports server events. + * + * @return server + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination supports server events.") + public Boolean getServer() { + return server; + } - public DestinationMetadataPlatformsV1 mobile(Boolean mobile) { - - this.mobile = mobile; - return this; - } + public void setServer(Boolean server) { + this.server = server; + } - /** - * Whether this Destination supports mobile events. - * @return mobile - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports mobile events.") + public DestinationMetadataPlatformsV1 mobile(Boolean mobile) { - public Boolean getMobile() { - return mobile; - } + this.mobile = mobile; + return this; + } + /** + * Whether this Destination supports mobile events. + * + * @return mobile + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this Destination supports mobile events.") + public Boolean getMobile() { + return mobile; + } - public void setMobile(Boolean mobile) { - this.mobile = mobile; - } + public void setMobile(Boolean mobile) { + this.mobile = mobile; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataPlatformsV1 destinationMetadataPlatformsV1 = + (DestinationMetadataPlatformsV1) o; + return Objects.equals(this.browser, destinationMetadataPlatformsV1.browser) + && Objects.equals(this.server, destinationMetadataPlatformsV1.server) + && Objects.equals(this.mobile, destinationMetadataPlatformsV1.mobile); + } + @Override + public int hashCode() { + return Objects.hash(browser, server, mobile); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataPlatformsV1 {\n"); + sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); + sb.append(" server: ").append(toIndentedString(server)).append("\n"); + sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationMetadataPlatformsV1 destinationMetadataPlatformsV1 = (DestinationMetadataPlatformsV1) o; - return Objects.equals(this.browser, destinationMetadataPlatformsV1.browser) && - Objects.equals(this.server, destinationMetadataPlatformsV1.server) && - Objects.equals(this.mobile, destinationMetadataPlatformsV1.mobile); - } - - @Override - public int hashCode() { - return Objects.hash(browser, server, mobile); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataPlatformsV1 {\n"); - sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); - sb.append(" server: ").append(toIndentedString(server)).append("\n"); - sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("browser"); + openapiFields.add("server"); + openapiFields.add("mobile"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("browser"); - openapiFields.add("server"); - openapiFields.add("mobile"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataPlatformsV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataPlatformsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataPlatformsV1 is not found in the empty JSON string", DestinationMetadataPlatformsV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationMetadataPlatformsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataPlatformsV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataPlatformsV1 is not" + + " found in the empty JSON string", + DestinationMetadataPlatformsV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataPlatformsV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataPlatformsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataPlatformsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataPlatformsV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataPlatformsV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataPlatformsV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataPlatformsV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataPlatformsV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataPlatformsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataPlatformsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataPlatformsV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationMetadataPlatformsV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataPlatformsV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataPlatformsV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationMetadataPlatformsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataPlatformsV1 + * @throws IOException if the JSON string is invalid with respect to + * DestinationMetadataPlatformsV1 + */ + public static DestinationMetadataPlatformsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataPlatformsV1.class); } - } - - /** - * Create an instance of DestinationMetadataPlatformsV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataPlatformsV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataPlatformsV1 - */ - public static DestinationMetadataPlatformsV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataPlatformsV1.class); - } - - /** - * Convert an instance of DestinationMetadataPlatformsV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DestinationMetadataPlatformsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java index 9de1bc8c..6291c65d 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,314 +10,335 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents a set of defaults for a Destination subscription. - */ +/** Represents a set of defaults for a Destination subscription. */ @ApiModel(description = "Represents a set of defaults for a Destination subscription.") - public class DestinationMetadataSubscriptionPresetV1 { - public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - @SerializedName(SERIALIZED_NAME_ACTION_ID) - private String actionId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_FIELDS = "fields"; - @SerializedName(SERIALIZED_NAME_FIELDS) - private Map fields = new HashMap<>(); + public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - @SerializedName(SERIALIZED_NAME_TRIGGER) - private String trigger; + @SerializedName(SERIALIZED_NAME_ACTION_ID) + private String actionId; - public DestinationMetadataSubscriptionPresetV1() { - } + public static final String SERIALIZED_NAME_NAME = "name"; - public DestinationMetadataSubscriptionPresetV1 actionId(String actionId) { - - this.actionId = actionId; - return this; - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - /** - * The unique identifier for the Destination Action to trigger. - * @return actionId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier for the Destination Action to trigger.") + public static final String SERIALIZED_NAME_FIELDS = "fields"; - public String getActionId() { - return actionId; - } + @SerializedName(SERIALIZED_NAME_FIELDS) + private Map fields = new HashMap<>(); + public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - public void setActionId(String actionId) { - this.actionId = actionId; - } + @SerializedName(SERIALIZED_NAME_TRIGGER) + private String trigger; + public DestinationMetadataSubscriptionPresetV1() {} - public DestinationMetadataSubscriptionPresetV1 name(String name) { - - this.name = name; - return this; - } + public DestinationMetadataSubscriptionPresetV1 actionId(String actionId) { - /** - * The name of the subscription. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the subscription.") - - public String getName() { - return name; - } + this.actionId = actionId; + return this; + } + /** + * The unique identifier for the Destination Action to trigger. + * + * @return actionId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The unique identifier for the Destination Action to trigger.") + public String getActionId() { + return actionId; + } - public void setName(String name) { - this.name = name; - } + public void setActionId(String actionId) { + this.actionId = actionId; + } + public DestinationMetadataSubscriptionPresetV1 name(String name) { - public DestinationMetadataSubscriptionPresetV1 fields(Map fields) { - - this.fields = fields; - return this; - } + this.name = name; + return this; + } - public DestinationMetadataSubscriptionPresetV1 putFieldsItem(String key, Object fieldsItem) { - this.fields.put(key, fieldsItem); - return this; - } + /** + * The name of the subscription. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the subscription.") + public String getName() { + return name; + } - /** - * The default settings for action fields. - * @return fields - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The default settings for action fields.") + public void setName(String name) { + this.name = name; + } - public Map getFields() { - return fields; - } + public DestinationMetadataSubscriptionPresetV1 fields(Map fields) { + this.fields = fields; + return this; + } - public void setFields(Map fields) { - this.fields = fields; - } + public DestinationMetadataSubscriptionPresetV1 putFieldsItem(String key, Object fieldsItem) { + this.fields.put(key, fieldsItem); + return this; + } + /** + * The default settings for action fields. + * + * @return fields + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The default settings for action fields.") + public Map getFields() { + return fields; + } - public DestinationMetadataSubscriptionPresetV1 trigger(String trigger) { - - this.trigger = trigger; - return this; - } + public void setFields(Map fields) { + this.fields = fields; + } - /** - * FQL string that describes what events should trigger an action. See https://segment.com/docs/config-api/fql/ for more information regarding Segment's Filter Query Language (FQL). - * @return trigger - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "FQL string that describes what events should trigger an action. See https://segment.com/docs/config-api/fql/ for more information regarding Segment's Filter Query Language (FQL).") + public DestinationMetadataSubscriptionPresetV1 trigger(String trigger) { - public String getTrigger() { - return trigger; - } + this.trigger = trigger; + return this; + } + /** + * FQL string that describes what events should trigger an action. See + * https://segment.com/docs/config-api/fql/ for more information regarding Segment's Filter + * Query Language (FQL). + * + * @return trigger + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "FQL string that describes what events should trigger an action. See" + + " https://segment.com/docs/config-api/fql/ for more information regarding" + + " Segment's Filter Query Language (FQL).") + public String getTrigger() { + return trigger; + } - public void setTrigger(String trigger) { - this.trigger = trigger; - } + public void setTrigger(String trigger) { + this.trigger = trigger; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataSubscriptionPresetV1 destinationMetadataSubscriptionPresetV1 = + (DestinationMetadataSubscriptionPresetV1) o; + return Objects.equals(this.actionId, destinationMetadataSubscriptionPresetV1.actionId) + && Objects.equals(this.name, destinationMetadataSubscriptionPresetV1.name) + && Objects.equals(this.fields, destinationMetadataSubscriptionPresetV1.fields) + && Objects.equals(this.trigger, destinationMetadataSubscriptionPresetV1.trigger); + } + @Override + public int hashCode() { + return Objects.hash(actionId, name, fields, trigger); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataSubscriptionPresetV1 {\n"); + sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationMetadataSubscriptionPresetV1 destinationMetadataSubscriptionPresetV1 = (DestinationMetadataSubscriptionPresetV1) o; - return Objects.equals(this.actionId, destinationMetadataSubscriptionPresetV1.actionId) && - Objects.equals(this.name, destinationMetadataSubscriptionPresetV1.name) && - Objects.equals(this.fields, destinationMetadataSubscriptionPresetV1.fields) && - Objects.equals(this.trigger, destinationMetadataSubscriptionPresetV1.trigger); - } - - @Override - public int hashCode() { - return Objects.hash(actionId, name, fields, trigger); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataSubscriptionPresetV1 {\n"); - sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); - sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("actionId"); + openapiFields.add("name"); + openapiFields.add("fields"); + openapiFields.add("trigger"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("actionId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("fields"); + openapiRequiredFields.add("trigger"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("actionId"); - openapiFields.add("name"); - openapiFields.add("fields"); - openapiFields.add("trigger"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("actionId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("fields"); - openapiRequiredFields.add("trigger"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataSubscriptionPresetV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataSubscriptionPresetV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataSubscriptionPresetV1 is not found in the empty JSON string", DestinationMetadataSubscriptionPresetV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationMetadataSubscriptionPresetV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataSubscriptionPresetV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DestinationMetadataSubscriptionPresetV1 is not found in the" + + " empty JSON string", + DestinationMetadataSubscriptionPresetV1.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataSubscriptionPresetV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataSubscriptionPresetV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataSubscriptionPresetV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataSubscriptionPresetV1` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadataSubscriptionPresetV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationMetadataSubscriptionPresetV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("actionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actionId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("trigger").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trigger` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("trigger").toString())); } - } - if (!jsonObj.get("actionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("trigger").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `trigger` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trigger").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataSubscriptionPresetV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataSubscriptionPresetV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataSubscriptionPresetV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataSubscriptionPresetV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataSubscriptionPresetV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationMetadataSubscriptionPresetV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataSubscriptionPresetV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataSubscriptionPresetV1 - */ - public static DestinationMetadataSubscriptionPresetV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataSubscriptionPresetV1.class); - } - - /** - * Convert an instance of DestinationMetadataSubscriptionPresetV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataSubscriptionPresetV1.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataSubscriptionPresetV1' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationMetadataSubscriptionPresetV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DestinationMetadataSubscriptionPresetV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataSubscriptionPresetV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationMetadataSubscriptionPresetV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataSubscriptionPresetV1 + * @throws IOException if the JSON string is invalid with respect to + * DestinationMetadataSubscriptionPresetV1 + */ + public static DestinationMetadataSubscriptionPresetV1 fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataSubscriptionPresetV1.class); + } + + /** + * Convert an instance of DestinationMetadataSubscriptionPresetV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 996da12a..23f73803 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,899 +10,967 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Contact; -import com.segment.publicapi.models.DestinationMetadataActionV1; -import com.segment.publicapi.models.DestinationMetadataComponentV1; -import com.segment.publicapi.models.DestinationMetadataSubscriptionPresetV1; -import com.segment.publicapi.models.IntegrationOptionBeta; -import com.segment.publicapi.models.Logos; -import com.segment.publicapi.models.SupportedFeatures; -import com.segment.publicapi.models.SupportedMethods; -import com.segment.publicapi.models.SupportedPlatforms; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - /** - * Represents a Destination within Segment. A Destination is a target for Segment to forward data to, and represents a tool or storage Destination. + * Represents a Destination within Segment. A Destination is a target for Segment to forward data + * to, and represents a tool or storage Destination. */ -@ApiModel(description = "Represents a Destination within Segment. A Destination is a target for Segment to forward data to, and represents a tool or storage Destination.") - +@ApiModel( + description = + "Represents a Destination within Segment. A Destination is a target for Segment to" + + " forward data to, and represents a tool or storage Destination.") public class DestinationMetadataV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_SLUG = "slug"; - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; - - public static final String SERIALIZED_NAME_LOGOS = "logos"; - @SerializedName(SERIALIZED_NAME_LOGOS) - private Logos logos; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - @SerializedName(SERIALIZED_NAME_OPTIONS) - private List options = new ArrayList<>(); - - /** - * Support status of the Destination. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - DEPRECATED("DEPRECATED"), - - PRIVATE_BETA("PRIVATE_BETA"), - - PRIVATE_BUILDING("PRIVATE_BUILDING"), - - PRIVATE_SUBMITTED("PRIVATE_SUBMITTED"), - - PUBLIC("PUBLIC"), - - PUBLIC_BETA("PUBLIC_BETA"), - - UNAVAILABLE("UNAVAILABLE"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } + public static final String SERIALIZED_NAME_ID = "id"; - @Override - public String toString() { - return String.valueOf(value); - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_SLUG = "slug"; + + @SerializedName(SERIALIZED_NAME_SLUG) + private String slug; + + public static final String SERIALIZED_NAME_LOGOS = "logos"; + + @SerializedName(SERIALIZED_NAME_LOGOS) + private Logos logos; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private List options = new ArrayList<>(); + + /** Support status of the Destination. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DEPRECATED("DEPRECATED"), + + PRIVATE_BETA("PRIVATE_BETA"), - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + PRIVATE_BUILDING("PRIVATE_BUILDING"), + + PRIVATE_SUBMITTED("PRIVATE_SUBMITTED"), + + PUBLIC("PUBLIC"), + + PUBLIC_BETA("PUBLIC_BETA"), + + UNAVAILABLE("UNAVAILABLE"); + + private String value; + + StatusEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_PREVIOUS_NAMES = "previousNames"; + + @SerializedName(SERIALIZED_NAME_PREVIOUS_NAMES) + private List previousNames = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CATEGORIES = "categories"; + + @SerializedName(SERIALIZED_NAME_CATEGORIES) + private List categories = new ArrayList<>(); - public static final String SERIALIZED_NAME_PREVIOUS_NAMES = "previousNames"; - @SerializedName(SERIALIZED_NAME_PREVIOUS_NAMES) - private List previousNames = new ArrayList<>(); + public static final String SERIALIZED_NAME_WEBSITE = "website"; - public static final String SERIALIZED_NAME_CATEGORIES = "categories"; - @SerializedName(SERIALIZED_NAME_CATEGORIES) - private List categories = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_WEBSITE) + private String website; - public static final String SERIALIZED_NAME_WEBSITE = "website"; - @SerializedName(SERIALIZED_NAME_WEBSITE) - private String website; + public static final String SERIALIZED_NAME_COMPONENTS = "components"; - public static final String SERIALIZED_NAME_COMPONENTS = "components"; - @SerializedName(SERIALIZED_NAME_COMPONENTS) - private List components = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_COMPONENTS) + private List components = new ArrayList<>(); - public static final String SERIALIZED_NAME_SUPPORTED_FEATURES = "supportedFeatures"; - @SerializedName(SERIALIZED_NAME_SUPPORTED_FEATURES) - private SupportedFeatures supportedFeatures; + public static final String SERIALIZED_NAME_SUPPORTED_FEATURES = "supportedFeatures"; - public static final String SERIALIZED_NAME_SUPPORTED_METHODS = "supportedMethods"; - @SerializedName(SERIALIZED_NAME_SUPPORTED_METHODS) - private SupportedMethods supportedMethods; + @SerializedName(SERIALIZED_NAME_SUPPORTED_FEATURES) + private SupportedFeatures supportedFeatures; - public static final String SERIALIZED_NAME_SUPPORTED_PLATFORMS = "supportedPlatforms"; - @SerializedName(SERIALIZED_NAME_SUPPORTED_PLATFORMS) - private SupportedPlatforms supportedPlatforms; + public static final String SERIALIZED_NAME_SUPPORTED_METHODS = "supportedMethods"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_SUPPORTED_METHODS) + private SupportedMethods supportedMethods; - public static final String SERIALIZED_NAME_PRESETS = "presets"; - @SerializedName(SERIALIZED_NAME_PRESETS) - private List presets = new ArrayList<>(); + public static final String SERIALIZED_NAME_SUPPORTED_PLATFORMS = "supportedPlatforms"; - public static final String SERIALIZED_NAME_CONTACTS = "contacts"; - @SerializedName(SERIALIZED_NAME_CONTACTS) - private List contacts = null; + @SerializedName(SERIALIZED_NAME_SUPPORTED_PLATFORMS) + private SupportedPlatforms supportedPlatforms; - public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; - @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) - private Boolean partnerOwned; + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public DestinationMetadataV1() { - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); - public DestinationMetadataV1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_PRESETS = "presets"; - /** - * The id of the Destination metadata. Config API note: analogous to `name`. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Destination metadata. Config API note: analogous to `name`.") + @SerializedName(SERIALIZED_NAME_PRESETS) + private List presets = new ArrayList<>(); - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_CONTACTS = "contacts"; + @SerializedName(SERIALIZED_NAME_CONTACTS) + private List contacts = null; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; + @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) + private Boolean partnerOwned; - public DestinationMetadataV1 name(String name) { - - this.name = name; - return this; - } + public DestinationMetadataV1() {} - /** - * The user-friendly name of the Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The user-friendly name of the Destination. Config API note: equal to `displayName`.") - - public String getName() { - return name; - } + public DestinationMetadataV1 id(String id) { + this.id = id; + return this; + } - public void setName(String name) { - this.name = name; - } + /** + * The id of the Destination metadata. Config API note: analogous to `name`. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Destination metadata. Config API note: analogous to `name`.") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } - public DestinationMetadataV1 description(String description) { - - this.description = description; - return this; - } + public DestinationMetadataV1 name(String name) { - /** - * The description of the Destination. - * @return description - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The description of the Destination.") + this.name = name; + return this; + } - public String getDescription() { - return description; - } + /** + * The user-friendly name of the Destination. Config API note: equal to `displayName`. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The user-friendly name of the Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - public void setDescription(String description) { - this.description = description; - } + public DestinationMetadataV1 description(String description) { + this.description = description; + return this; + } - public DestinationMetadataV1 slug(String slug) { - - this.slug = slug; - return this; - } + /** + * The description of the Destination. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The description of the Destination.") + public String getDescription() { + return description; + } - /** - * The slug used to identify the Destination in the Segment app. - * @return slug - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The slug used to identify the Destination in the Segment app.") + public void setDescription(String description) { + this.description = description; + } - public String getSlug() { - return slug; - } + public DestinationMetadataV1 slug(String slug) { + this.slug = slug; + return this; + } - public void setSlug(String slug) { - this.slug = slug; - } + /** + * The slug used to identify the Destination in the Segment app. + * + * @return slug + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The slug used to identify the Destination in the Segment app.") + public String getSlug() { + return slug; + } + public void setSlug(String slug) { + this.slug = slug; + } - public DestinationMetadataV1 logos(Logos logos) { - - this.logos = logos; - return this; - } + public DestinationMetadataV1 logos(Logos logos) { - /** - * Get logos - * @return logos - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + this.logos = logos; + return this; + } - public Logos getLogos() { - return logos; - } + /** + * Get logos + * + * @return logos + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Logos getLogos() { + return logos; + } + public void setLogos(Logos logos) { + this.logos = logos; + } - public void setLogos(Logos logos) { - this.logos = logos; - } + public DestinationMetadataV1 options(List options) { + this.options = options; + return this; + } + + public DestinationMetadataV1 addOptionsItem(IntegrationOptionBeta optionsItem) { + this.options.add(optionsItem); + return this; + } - public DestinationMetadataV1 options(List options) { - - this.options = options; - return this; - } + /** + * Options configured for the Destination. + * + * @return options + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Options configured for the Destination.") + public List getOptions() { + return options; + } - public DestinationMetadataV1 addOptionsItem(IntegrationOptionBeta optionsItem) { - this.options.add(optionsItem); - return this; - } + public void setOptions(List options) { + this.options = options; + } - /** - * Options configured for the Destination. - * @return options - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Options configured for the Destination.") + public DestinationMetadataV1 status(StatusEnum status) { - public List getOptions() { - return options; - } + this.status = status; + return this; + } + /** + * Support status of the Destination. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Support status of the Destination.") + public StatusEnum getStatus() { + return status; + } - public void setOptions(List options) { - this.options = options; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + public DestinationMetadataV1 previousNames(List previousNames) { - public DestinationMetadataV1 status(StatusEnum status) { - - this.status = status; - return this; - } + this.previousNames = previousNames; + return this; + } - /** - * Support status of the Destination. - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Support status of the Destination.") + public DestinationMetadataV1 addPreviousNamesItem(String previousNamesItem) { + this.previousNames.add(previousNamesItem); + return this; + } - public StatusEnum getStatus() { - return status; - } + /** + * A list of names previously used by the Destination. + * + * @return previousNames + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list of names previously used by the Destination.") + public List getPreviousNames() { + return previousNames; + } + public void setPreviousNames(List previousNames) { + this.previousNames = previousNames; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public DestinationMetadataV1 categories(List categories) { + this.categories = categories; + return this; + } - public DestinationMetadataV1 previousNames(List previousNames) { - - this.previousNames = previousNames; - return this; - } + public DestinationMetadataV1 addCategoriesItem(String categoriesItem) { + this.categories.add(categoriesItem); + return this; + } - public DestinationMetadataV1 addPreviousNamesItem(String previousNamesItem) { - this.previousNames.add(previousNamesItem); - return this; - } + /** + * A list of categories with which the Destination is associated. + * + * @return categories + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list of categories with which the Destination is associated.") + public List getCategories() { + return categories; + } - /** - * A list of names previously used by the Destination. - * @return previousNames - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of names previously used by the Destination.") + public void setCategories(List categories) { + this.categories = categories; + } - public List getPreviousNames() { - return previousNames; - } + public DestinationMetadataV1 website(String website) { + this.website = website; + return this; + } - public void setPreviousNames(List previousNames) { - this.previousNames = previousNames; - } + /** + * A website URL for this Destination. + * + * @return website + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A website URL for this Destination.") + public String getWebsite() { + return website; + } + public void setWebsite(String website) { + this.website = website; + } - public DestinationMetadataV1 categories(List categories) { - - this.categories = categories; - return this; - } + public DestinationMetadataV1 components(List components) { - public DestinationMetadataV1 addCategoriesItem(String categoriesItem) { - this.categories.add(categoriesItem); - return this; - } + this.components = components; + return this; + } - /** - * A list of categories with which the Destination is associated. - * @return categories - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of categories with which the Destination is associated.") + public DestinationMetadataV1 addComponentsItem(DestinationMetadataComponentV1 componentsItem) { + this.components.add(componentsItem); + return this; + } - public List getCategories() { - return categories; - } + /** + * A list of components this Destination provides. + * + * @return components + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of components this Destination provides.") + public List getComponents() { + return components; + } + public void setComponents(List components) { + this.components = components; + } - public void setCategories(List categories) { - this.categories = categories; - } + public DestinationMetadataV1 supportedFeatures(SupportedFeatures supportedFeatures) { + this.supportedFeatures = supportedFeatures; + return this; + } - public DestinationMetadataV1 website(String website) { - - this.website = website; - return this; - } + /** + * Get supportedFeatures + * + * @return supportedFeatures + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SupportedFeatures getSupportedFeatures() { + return supportedFeatures; + } - /** - * A website URL for this Destination. - * @return website - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A website URL for this Destination.") + public void setSupportedFeatures(SupportedFeatures supportedFeatures) { + this.supportedFeatures = supportedFeatures; + } - public String getWebsite() { - return website; - } + public DestinationMetadataV1 supportedMethods(SupportedMethods supportedMethods) { + this.supportedMethods = supportedMethods; + return this; + } - public void setWebsite(String website) { - this.website = website; - } + /** + * Get supportedMethods + * + * @return supportedMethods + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SupportedMethods getSupportedMethods() { + return supportedMethods; + } + public void setSupportedMethods(SupportedMethods supportedMethods) { + this.supportedMethods = supportedMethods; + } - public DestinationMetadataV1 components(List components) { - - this.components = components; - return this; - } + public DestinationMetadataV1 supportedPlatforms(SupportedPlatforms supportedPlatforms) { - public DestinationMetadataV1 addComponentsItem(DestinationMetadataComponentV1 componentsItem) { - this.components.add(componentsItem); - return this; - } + this.supportedPlatforms = supportedPlatforms; + return this; + } - /** - * A list of components this Destination provides. - * @return components - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of components this Destination provides.") + /** + * Get supportedPlatforms + * + * @return supportedPlatforms + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SupportedPlatforms getSupportedPlatforms() { + return supportedPlatforms; + } - public List getComponents() { - return components; - } + public void setSupportedPlatforms(SupportedPlatforms supportedPlatforms) { + this.supportedPlatforms = supportedPlatforms; + } + public DestinationMetadataV1 actions(List actions) { - public void setComponents(List components) { - this.components = components; - } + this.actions = actions; + return this; + } + public DestinationMetadataV1 addActionsItem(DestinationMetadataActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } - public DestinationMetadataV1 supportedFeatures(SupportedFeatures supportedFeatures) { - - this.supportedFeatures = supportedFeatures; - return this; - } + /** + * Actions available for the Destination. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Actions available for the Destination.") + public List getActions() { + return actions; + } - /** - * Get supportedFeatures - * @return supportedFeatures - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public void setActions(List actions) { + this.actions = actions; + } - public SupportedFeatures getSupportedFeatures() { - return supportedFeatures; - } + public DestinationMetadataV1 presets(List presets) { + this.presets = presets; + return this; + } - public void setSupportedFeatures(SupportedFeatures supportedFeatures) { - this.supportedFeatures = supportedFeatures; - } + public DestinationMetadataV1 addPresetsItem( + DestinationMetadataSubscriptionPresetV1 presetsItem) { + this.presets.add(presetsItem); + return this; + } + /** + * Predefined Destination subscriptions that can optionally be applied when connecting a new + * instance of the Destination. + * + * @return presets + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Predefined Destination subscriptions that can optionally be applied when" + + " connecting a new instance of the Destination.") + public List getPresets() { + return presets; + } - public DestinationMetadataV1 supportedMethods(SupportedMethods supportedMethods) { - - this.supportedMethods = supportedMethods; - return this; - } + public void setPresets(List presets) { + this.presets = presets; + } - /** - * Get supportedMethods - * @return supportedMethods - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DestinationMetadataV1 contacts(List contacts) { - public SupportedMethods getSupportedMethods() { - return supportedMethods; - } + this.contacts = contacts; + return this; + } + public DestinationMetadataV1 addContactsItem(Contact contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } - public void setSupportedMethods(SupportedMethods supportedMethods) { - this.supportedMethods = supportedMethods; - } + /** + * Contact info for Integration Owners. + * + * @return contacts + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Contact info for Integration Owners.") + public List getContacts() { + return contacts; + } + public void setContacts(List contacts) { + this.contacts = contacts; + } - public DestinationMetadataV1 supportedPlatforms(SupportedPlatforms supportedPlatforms) { - - this.supportedPlatforms = supportedPlatforms; - return this; - } + public DestinationMetadataV1 partnerOwned(Boolean partnerOwned) { - /** - * Get supportedPlatforms - * @return supportedPlatforms - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + this.partnerOwned = partnerOwned; + return this; + } - public SupportedPlatforms getSupportedPlatforms() { - return supportedPlatforms; - } + /** + * Partner Owned flag. + * + * @return partnerOwned + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Partner Owned flag.") + public Boolean getPartnerOwned() { + return partnerOwned; + } + public void setPartnerOwned(Boolean partnerOwned) { + this.partnerOwned = partnerOwned; + } - public void setSupportedPlatforms(SupportedPlatforms supportedPlatforms) { - this.supportedPlatforms = supportedPlatforms; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationMetadataV1 destinationMetadataV1 = (DestinationMetadataV1) o; + return Objects.equals(this.id, destinationMetadataV1.id) + && Objects.equals(this.name, destinationMetadataV1.name) + && Objects.equals(this.description, destinationMetadataV1.description) + && Objects.equals(this.slug, destinationMetadataV1.slug) + && Objects.equals(this.logos, destinationMetadataV1.logos) + && Objects.equals(this.options, destinationMetadataV1.options) + && Objects.equals(this.status, destinationMetadataV1.status) + && Objects.equals(this.previousNames, destinationMetadataV1.previousNames) + && Objects.equals(this.categories, destinationMetadataV1.categories) + && Objects.equals(this.website, destinationMetadataV1.website) + && Objects.equals(this.components, destinationMetadataV1.components) + && Objects.equals(this.supportedFeatures, destinationMetadataV1.supportedFeatures) + && Objects.equals(this.supportedMethods, destinationMetadataV1.supportedMethods) + && Objects.equals(this.supportedPlatforms, destinationMetadataV1.supportedPlatforms) + && Objects.equals(this.actions, destinationMetadataV1.actions) + && Objects.equals(this.presets, destinationMetadataV1.presets) + && Objects.equals(this.contacts, destinationMetadataV1.contacts) + && Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned); + } + @Override + public int hashCode() { + return Objects.hash( + id, + name, + description, + slug, + logos, + options, + status, + previousNames, + categories, + website, + components, + supportedFeatures, + supportedMethods, + supportedPlatforms, + actions, + presets, + contacts, + partnerOwned); + } - public DestinationMetadataV1 actions(List actions) { - - this.actions = actions; - return this; - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationMetadataV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" previousNames: ").append(toIndentedString(previousNames)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" components: ").append(toIndentedString(components)).append("\n"); + sb.append(" supportedFeatures: ") + .append(toIndentedString(supportedFeatures)) + .append("\n"); + sb.append(" supportedMethods: ").append(toIndentedString(supportedMethods)).append("\n"); + sb.append(" supportedPlatforms: ") + .append(toIndentedString(supportedPlatforms)) + .append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public DestinationMetadataV1 addActionsItem(DestinationMetadataActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - /** - * Actions available for the Destination. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Actions available for the Destination.") + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("slug"); + openapiFields.add("logos"); + openapiFields.add("options"); + openapiFields.add("status"); + openapiFields.add("previousNames"); + openapiFields.add("categories"); + openapiFields.add("website"); + openapiFields.add("components"); + openapiFields.add("supportedFeatures"); + openapiFields.add("supportedMethods"); + openapiFields.add("supportedPlatforms"); + openapiFields.add("actions"); + openapiFields.add("presets"); + openapiFields.add("contacts"); + openapiFields.add("partnerOwned"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("slug"); + openapiRequiredFields.add("logos"); + openapiRequiredFields.add("options"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("previousNames"); + openapiRequiredFields.add("categories"); + openapiRequiredFields.add("website"); + openapiRequiredFields.add("components"); + openapiRequiredFields.add("supportedFeatures"); + openapiRequiredFields.add("supportedMethods"); + openapiRequiredFields.add("supportedPlatforms"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("presets"); + } - public List getActions() { - return actions; - } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationMetadataV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationMetadataV1 is not found in" + + " the empty JSON string", + DestinationMetadataV1.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationMetadataV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationMetadataV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } - public void setActions(List actions) { - this.actions = actions; - } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationMetadataV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slug` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slug").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("options").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `options` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("options").toString())); + } + JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the required json array is present + if (jsonObj.get("previousNames") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("previousNames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previousNames` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("previousNames").toString())); + } + // ensure the required json array is present + if (jsonObj.get("categories") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("categories").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `categories` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("categories").toString())); + } + if (!jsonObj.get("website").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `website` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("website").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("components").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `components` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("components").toString())); + } - public DestinationMetadataV1 presets(List presets) { - - this.presets = presets; - return this; - } - - public DestinationMetadataV1 addPresetsItem(DestinationMetadataSubscriptionPresetV1 presetsItem) { - this.presets.add(presetsItem); - return this; - } - - /** - * Predefined Destination subscriptions that can optionally be applied when connecting a new instance of the Destination. - * @return presets - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Predefined Destination subscriptions that can optionally be applied when connecting a new instance of the Destination.") - - public List getPresets() { - return presets; - } - - - public void setPresets(List presets) { - this.presets = presets; - } - - - public DestinationMetadataV1 contacts(List contacts) { - - this.contacts = contacts; - return this; - } - - public DestinationMetadataV1 addContactsItem(Contact contactsItem) { - if (this.contacts == null) { - this.contacts = new ArrayList<>(); - } - this.contacts.add(contactsItem); - return this; - } - - /** - * Contact info for Integration Owners. - * @return contacts - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contact info for Integration Owners.") - - public List getContacts() { - return contacts; - } - - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - - public DestinationMetadataV1 partnerOwned(Boolean partnerOwned) { - - this.partnerOwned = partnerOwned; - return this; - } - - /** - * Partner Owned flag. - * @return partnerOwned - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Partner Owned flag.") - - public Boolean getPartnerOwned() { - return partnerOwned; - } - - - public void setPartnerOwned(Boolean partnerOwned) { - this.partnerOwned = partnerOwned; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationMetadataV1 destinationMetadataV1 = (DestinationMetadataV1) o; - return Objects.equals(this.id, destinationMetadataV1.id) && - Objects.equals(this.name, destinationMetadataV1.name) && - Objects.equals(this.description, destinationMetadataV1.description) && - Objects.equals(this.slug, destinationMetadataV1.slug) && - Objects.equals(this.logos, destinationMetadataV1.logos) && - Objects.equals(this.options, destinationMetadataV1.options) && - Objects.equals(this.status, destinationMetadataV1.status) && - Objects.equals(this.previousNames, destinationMetadataV1.previousNames) && - Objects.equals(this.categories, destinationMetadataV1.categories) && - Objects.equals(this.website, destinationMetadataV1.website) && - Objects.equals(this.components, destinationMetadataV1.components) && - Objects.equals(this.supportedFeatures, destinationMetadataV1.supportedFeatures) && - Objects.equals(this.supportedMethods, destinationMetadataV1.supportedMethods) && - Objects.equals(this.supportedPlatforms, destinationMetadataV1.supportedPlatforms) && - Objects.equals(this.actions, destinationMetadataV1.actions) && - Objects.equals(this.presets, destinationMetadataV1.presets) && - Objects.equals(this.contacts, destinationMetadataV1.contacts) && - Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, description, slug, logos, options, status, previousNames, categories, website, components, supportedFeatures, supportedMethods, supportedPlatforms, actions, presets, contacts, partnerOwned); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadataV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" previousNames: ").append(toIndentedString(previousNames)).append("\n"); - sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); - sb.append(" website: ").append(toIndentedString(website)).append("\n"); - sb.append(" components: ").append(toIndentedString(components)).append("\n"); - sb.append(" supportedFeatures: ").append(toIndentedString(supportedFeatures)).append("\n"); - sb.append(" supportedMethods: ").append(toIndentedString(supportedMethods)).append("\n"); - sb.append(" supportedPlatforms: ").append(toIndentedString(supportedPlatforms)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); - sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); - sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("slug"); - openapiFields.add("logos"); - openapiFields.add("options"); - openapiFields.add("status"); - openapiFields.add("previousNames"); - openapiFields.add("categories"); - openapiFields.add("website"); - openapiFields.add("components"); - openapiFields.add("supportedFeatures"); - openapiFields.add("supportedMethods"); - openapiFields.add("supportedPlatforms"); - openapiFields.add("actions"); - openapiFields.add("presets"); - openapiFields.add("contacts"); - openapiFields.add("partnerOwned"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("slug"); - openapiRequiredFields.add("logos"); - openapiRequiredFields.add("options"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("previousNames"); - openapiRequiredFields.add("categories"); - openapiRequiredFields.add("website"); - openapiRequiredFields.add("components"); - openapiRequiredFields.add("supportedFeatures"); - openapiRequiredFields.add("supportedMethods"); - openapiRequiredFields.add("supportedPlatforms"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("presets"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadataV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationMetadataV1 is not found in the empty JSON string", DestinationMetadataV1.openapiRequiredFields.toString())); + JsonArray jsonArraycomponents = jsonObj.getAsJsonArray("components"); + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadataV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationMetadataV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + // ensure the json data is an array + if (!jsonObj.get("presets").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `presets` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("presets").toString())); } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadataV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + JsonArray jsonArraypresets = jsonObj.getAsJsonArray("presets"); + if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull()) { + JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts"); + if (jsonArraycontacts != null) { + // ensure the json data is an array + if (!jsonObj.get("contacts").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `contacts` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("contacts").toString())); + } + } } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("options").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `options` to be an array in the JSON string but got `%s`", jsonObj.get("options").toString())); - } - - JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // ensure the required json array is present - if (jsonObj.get("previousNames") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("previousNames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `previousNames` to be an array in the JSON string but got `%s`", jsonObj.get("previousNames").toString())); - } - // ensure the required json array is present - if (jsonObj.get("categories") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("categories").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `categories` to be an array in the JSON string but got `%s`", jsonObj.get("categories").toString())); - } - if (!jsonObj.get("website").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("website").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("components").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `components` to be an array in the JSON string but got `%s`", jsonObj.get("components").toString())); - } - - JsonArray jsonArraycomponents = jsonObj.getAsJsonArray("components"); - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - // ensure the json data is an array - if (!jsonObj.get("presets").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `presets` to be an array in the JSON string but got `%s`", jsonObj.get("presets").toString())); - } - - JsonArray jsonArraypresets = jsonObj.getAsJsonArray("presets"); - if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull()) { - JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts"); - if (jsonArraycontacts != null) { - // ensure the json data is an array - if (!jsonObj.get("contacts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `contacts` to be an array in the JSON string but got `%s`", jsonObj.get("contacts").toString())); - } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationMetadataV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationMetadataV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationMetadataV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationMetadataV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadataV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadataV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadataV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadataV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadataV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationMetadataV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadataV1 - * @throws IOException if the JSON string is invalid with respect to DestinationMetadataV1 - */ - public static DestinationMetadataV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadataV1.class); - } - - /** - * Convert an instance of DestinationMetadataV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of DestinationMetadataV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationMetadataV1 + * @throws IOException if the JSON string is invalid with respect to DestinationMetadataV1 + */ + public static DestinationMetadataV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationMetadataV1.class); + } + /** + * Convert an instance of DestinationMetadataV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index 9c9683ef..8c2247bd 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,401 +10,408 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DestinationStatus represents status of each Destination in a stream. - */ +/** DestinationStatus represents status of each Destination in a stream. */ @ApiModel(description = "DestinationStatus represents status of each Destination in a stream.") - public class DestinationStatusV1 { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** - * Gets or Sets status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - FAILED("FAILED"), - - FINISHED("FINISHED"), - - INITIALIZED("INITIALIZED"), - - INVALID("INVALID"), - - NOT_SUPPORTED("NOT_SUPPORTED"), - - PARTIAL_SUCCESS("PARTIAL_SUCCESS"), - - RUNNING("RUNNING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_NAME = "name"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_ID = "id"; - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } + /** Gets or Sets status */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + FAILED("FAILED"), + + FINISHED("FINISHED"), + + INITIALIZED("INITIALIZED"), - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + INVALID("INVALID"), - public static final String SERIALIZED_NAME_ERR_STRING = "errString"; - @SerializedName(SERIALIZED_NAME_ERR_STRING) - private String errString; + NOT_SUPPORTED("NOT_SUPPORTED"), - public static final String SERIALIZED_NAME_FINISHED_AT = "finishedAt"; - @SerializedName(SERIALIZED_NAME_FINISHED_AT) - private String finishedAt; + PARTIAL_SUCCESS("PARTIAL_SUCCESS"), - public DestinationStatusV1() { - } + RUNNING("RUNNING"); - public DestinationStatusV1 name(String name) { - - this.name = name; - return this; - } + private String value; - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public void setName(String name) { - this.name = name; - } + public static final String SERIALIZED_NAME_ERR_STRING = "errString"; + @SerializedName(SERIALIZED_NAME_ERR_STRING) + private String errString; - public DestinationStatusV1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_FINISHED_AT = "finishedAt"; - /** - * Get id - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @SerializedName(SERIALIZED_NAME_FINISHED_AT) + private String finishedAt; - public String getId() { - return id; - } + public DestinationStatusV1() {} + public DestinationStatusV1 name(String name) { - public void setId(String id) { - this.id = id; - } + this.name = name; + return this; + } + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getName() { + return name; + } - public DestinationStatusV1 status(StatusEnum status) { - - this.status = status; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DestinationStatusV1 id(String id) { - public StatusEnum getStatus() { - return status; - } + this.id = id; + return this; + } + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setId(String id) { + this.id = id; + } + public DestinationStatusV1 status(StatusEnum status) { - public DestinationStatusV1 errString(String errString) { - - this.errString = errString; - return this; - } + this.status = status; + return this; + } - /** - * Get errString - * @return errString - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + /** + * Get status + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public StatusEnum getStatus() { + return status; + } - public String getErrString() { - return errString; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + public DestinationStatusV1 errString(String errString) { - public void setErrString(String errString) { - this.errString = errString; - } + this.errString = errString; + return this; + } + /** + * Get errString + * + * @return errString + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getErrString() { + return errString; + } - public DestinationStatusV1 finishedAt(String finishedAt) { - - this.finishedAt = finishedAt; - return this; - } + public void setErrString(String errString) { + this.errString = errString; + } - /** - * Get finishedAt - * @return finishedAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DestinationStatusV1 finishedAt(String finishedAt) { - public String getFinishedAt() { - return finishedAt; - } + this.finishedAt = finishedAt; + return this; + } + /** + * Get finishedAt + * + * @return finishedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getFinishedAt() { + return finishedAt; + } - public void setFinishedAt(String finishedAt) { - this.finishedAt = finishedAt; - } + public void setFinishedAt(String finishedAt) { + this.finishedAt = finishedAt; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationStatusV1 destinationStatusV1 = (DestinationStatusV1) o; + return Objects.equals(this.name, destinationStatusV1.name) + && Objects.equals(this.id, destinationStatusV1.id) + && Objects.equals(this.status, destinationStatusV1.status) + && Objects.equals(this.errString, destinationStatusV1.errString) + && Objects.equals(this.finishedAt, destinationStatusV1.finishedAt); + } + @Override + public int hashCode() { + return Objects.hash(name, id, status, errString, finishedAt); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationStatusV1 {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" errString: ").append(toIndentedString(errString)).append("\n"); + sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationStatusV1 destinationStatusV1 = (DestinationStatusV1) o; - return Objects.equals(this.name, destinationStatusV1.name) && - Objects.equals(this.id, destinationStatusV1.id) && - Objects.equals(this.status, destinationStatusV1.status) && - Objects.equals(this.errString, destinationStatusV1.errString) && - Objects.equals(this.finishedAt, destinationStatusV1.finishedAt); - } - - @Override - public int hashCode() { - return Objects.hash(name, id, status, errString, finishedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationStatusV1 {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" errString: ").append(toIndentedString(errString)).append("\n"); - sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("errString"); + openapiFields.add("finishedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("errString"); + openapiRequiredFields.add("finishedAt"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("id"); - openapiFields.add("status"); - openapiFields.add("errString"); - openapiFields.add("finishedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("errString"); - openapiRequiredFields.add("finishedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationStatusV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationStatusV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationStatusV1 is not found in the empty JSON string", DestinationStatusV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationStatusV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationStatusV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationStatusV1 is not found in" + + " the empty JSON string", + DestinationStatusV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationStatusV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationStatusV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationStatusV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationStatusV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationStatusV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationStatusV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("errString").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errString` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errString").toString())); + } + if (!jsonObj.get("finishedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `finishedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("finishedAt").toString())); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - if (!jsonObj.get("errString").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `errString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errString").toString())); - } - if (!jsonObj.get("finishedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `finishedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("finishedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationStatusV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationStatusV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationStatusV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationStatusV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationStatusV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationStatusV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationStatusV1 - * @throws IOException if the JSON string is invalid with respect to DestinationStatusV1 - */ - public static DestinationStatusV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationStatusV1.class); - } - - /** - * Convert an instance of DestinationStatusV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationStatusV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationStatusV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationStatusV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationStatusV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationStatusV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationStatusV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationStatusV1 + * @throws IOException if the JSON string is invalid with respect to DestinationStatusV1 + */ + public static DestinationStatusV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationStatusV1.class); + } + + /** + * Convert an instance of DestinationStatusV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index c564d9e3..c365875f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,441 +10,457 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The Destination subscription. - */ +/** The Destination subscription. */ @ApiModel(description = "The Destination subscription.") - public class DestinationSubscription { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - @SerializedName(SERIALIZED_NAME_ACTION_ID) - private String actionId; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_ACTION_SLUG = "actionSlug"; - @SerializedName(SERIALIZED_NAME_ACTION_SLUG) - private String actionSlug; - - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + @SerializedName(SERIALIZED_NAME_ACTION_ID) + private String actionId; - public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - @SerializedName(SERIALIZED_NAME_TRIGGER) - private String trigger; + public static final String SERIALIZED_NAME_ACTION_SLUG = "actionSlug"; + + @SerializedName(SERIALIZED_NAME_ACTION_SLUG) + private String actionSlug; + + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; + + public static final String SERIALIZED_NAME_TRIGGER = "trigger"; + + @SerializedName(SERIALIZED_NAME_TRIGGER) + private String trigger; + + public DestinationSubscription() {} + + public DestinationSubscription id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for the subscription. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The unique identifier for the subscription.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DestinationSubscription name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the subscription. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the subscription.") + public String getName() { + return name; + } - public DestinationSubscription() { - } + public void setName(String name) { + this.name = name; + } - public DestinationSubscription id(String id) { - - this.id = id; - return this; - } + public DestinationSubscription actionId(String actionId) { - /** - * The unique identifier for the subscription. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier for the subscription.") + this.actionId = actionId; + return this; + } - public String getId() { - return id; - } + /** + * The unique identifier for the Destination action to trigger. + * + * @return actionId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The unique identifier for the Destination action to trigger.") + public String getActionId() { + return actionId; + } + public void setActionId(String actionId) { + this.actionId = actionId; + } - public void setId(String id) { - this.id = id; - } + public DestinationSubscription actionSlug(String actionSlug) { + this.actionSlug = actionSlug; + return this; + } - public DestinationSubscription name(String name) { - - this.name = name; - return this; - } + /** + * The URL-friendly key for the associated Destination action. + * + * @return actionSlug + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The URL-friendly key for the associated Destination action.") + public String getActionSlug() { + return actionSlug; + } - /** - * The name of the subscription. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the subscription.") + public void setActionSlug(String actionSlug) { + this.actionSlug = actionSlug; + } - public String getName() { - return name; - } + public DestinationSubscription destinationId(String destinationId) { + this.destinationId = destinationId; + return this; + } - public void setName(String name) { - this.name = name; - } + /** + * The associated Destination instance id. + * + * @return destinationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The associated Destination instance id.") + public String getDestinationId() { + return destinationId; + } + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } - public DestinationSubscription actionId(String actionId) { - - this.actionId = actionId; - return this; - } + public DestinationSubscription enabled(Boolean enabled) { - /** - * The unique identifier for the Destination action to trigger. - * @return actionId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier for the Destination action to trigger.") + this.enabled = enabled; + return this; + } - public String getActionId() { - return actionId; - } + /** + * Is the subscription enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Is the subscription enabled.") + public Boolean getEnabled() { + return enabled; + } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } - public void setActionId(String actionId) { - this.actionId = actionId; - } + public DestinationSubscription settings(Map settings) { + this.settings = settings; + return this; + } - public DestinationSubscription actionSlug(String actionSlug) { - - this.actionSlug = actionSlug; - return this; - } + /** + * The customer settings for action fields. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(required = true, value = "The customer settings for action fields.") + public Map getSettings() { + return settings; + } - /** - * The URL-friendly key for the associated Destination action. - * @return actionSlug - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The URL-friendly key for the associated Destination action.") + public void setSettings(Map settings) { + this.settings = settings; + } - public String getActionSlug() { - return actionSlug; - } + public DestinationSubscription trigger(String trigger) { + this.trigger = trigger; + return this; + } - public void setActionSlug(String actionSlug) { - this.actionSlug = actionSlug; - } + /** + * FQL string that describes what events should trigger a Destination action. + * + * @return trigger + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "FQL string that describes what events should trigger a Destination action.") + public String getTrigger() { + return trigger; + } + public void setTrigger(String trigger) { + this.trigger = trigger; + } - public DestinationSubscription destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationSubscription destinationSubscription = (DestinationSubscription) o; + return Objects.equals(this.id, destinationSubscription.id) + && Objects.equals(this.name, destinationSubscription.name) + && Objects.equals(this.actionId, destinationSubscription.actionId) + && Objects.equals(this.actionSlug, destinationSubscription.actionSlug) + && Objects.equals(this.destinationId, destinationSubscription.destinationId) + && Objects.equals(this.enabled, destinationSubscription.enabled) + && Objects.equals(this.settings, destinationSubscription.settings) + && Objects.equals(this.trigger, destinationSubscription.trigger); + } - /** - * The associated Destination instance id. - * @return destinationId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The associated Destination instance id.") + @Override + public int hashCode() { + return Objects.hash( + id, name, actionId, actionSlug, destinationId, enabled, settings, trigger); + } - public String getDestinationId() { - return destinationId; - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationSubscription {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); + sb.append(" actionSlug: ").append(toIndentedString(actionSlug)).append("\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append("}"); + return sb.toString(); + } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("actionId"); + openapiFields.add("actionSlug"); + openapiFields.add("destinationId"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + openapiFields.add("trigger"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("actionId"); + openapiRequiredFields.add("actionSlug"); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("trigger"); + } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationSubscription + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationSubscription.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationSubscription is not found" + + " in the empty JSON string", + DestinationSubscription.openapiRequiredFields.toString())); + } + } - public DestinationSubscription enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Is the subscription enabled. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Is the subscription enabled.") - - public Boolean getEnabled() { - return enabled; - } - - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - - public DestinationSubscription settings(Map settings) { - - this.settings = settings; - return this; - } - - /** - * The customer settings for action fields. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The customer settings for action fields.") - - public Map getSettings() { - return settings; - } - - - public void setSettings(Map settings) { - this.settings = settings; - } - - - public DestinationSubscription trigger(String trigger) { - - this.trigger = trigger; - return this; - } - - /** - * FQL string that describes what events should trigger a Destination action. - * @return trigger - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "FQL string that describes what events should trigger a Destination action.") - - public String getTrigger() { - return trigger; - } - - - public void setTrigger(String trigger) { - this.trigger = trigger; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationSubscription destinationSubscription = (DestinationSubscription) o; - return Objects.equals(this.id, destinationSubscription.id) && - Objects.equals(this.name, destinationSubscription.name) && - Objects.equals(this.actionId, destinationSubscription.actionId) && - Objects.equals(this.actionSlug, destinationSubscription.actionSlug) && - Objects.equals(this.destinationId, destinationSubscription.destinationId) && - Objects.equals(this.enabled, destinationSubscription.enabled) && - Objects.equals(this.settings, destinationSubscription.settings) && - Objects.equals(this.trigger, destinationSubscription.trigger); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, actionId, actionSlug, destinationId, enabled, settings, trigger); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationSubscription {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); - sb.append(" actionSlug: ").append(toIndentedString(actionSlug)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("actionId"); - openapiFields.add("actionSlug"); - openapiFields.add("destinationId"); - openapiFields.add("enabled"); - openapiFields.add("settings"); - openapiFields.add("trigger"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("actionId"); - openapiRequiredFields.add("actionSlug"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("settings"); - openapiRequiredFields.add("trigger"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationSubscription - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationSubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationSubscription is not found in the empty JSON string", DestinationSubscription.openapiRequiredFields.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationSubscription.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationSubscription` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationSubscription.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationSubscription` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationSubscription.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("actionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actionId").toString())); } - } + if (!jsonObj.get("actionSlug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actionSlug` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actionSlug").toString())); + } + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + if (!jsonObj.get("trigger").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trigger` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("trigger").toString())); + } + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationSubscription.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationSubscription' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationSubscription.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationSubscription value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationSubscription read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("actionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionId").toString())); - } - if (!jsonObj.get("actionSlug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actionSlug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionSlug").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("trigger").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `trigger` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trigger").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationSubscription.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationSubscription' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationSubscription.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationSubscription value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationSubscription read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationSubscription given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationSubscription - * @throws IOException if the JSON string is invalid with respect to DestinationSubscription - */ - public static DestinationSubscription fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationSubscription.class); - } - - /** - * Convert an instance of DestinationSubscription to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + } + + /** + * Create an instance of DestinationSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationSubscription + * @throws IOException if the JSON string is invalid with respect to DestinationSubscription + */ + public static DestinationSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationSubscription.class); + } + /** + * Convert an instance of DestinationSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 9f400508..8b37ae24 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,294 +10,315 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * The input parameters for updating a Destination subscription. - */ +/** The input parameters for updating a Destination subscription. */ @ApiModel(description = "The input parameters for updating a Destination subscription.") - public class DestinationSubscriptionUpdateInput { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - @SerializedName(SERIALIZED_NAME_TRIGGER) - private String trigger; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - public DestinationSubscriptionUpdateInput() { - } + @SerializedName(SERIALIZED_NAME_TRIGGER) + private String trigger; - public DestinationSubscriptionUpdateInput name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - /** - * The user-defined name for the subscription. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The user-defined name for the subscription.") + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public void setName(String name) { - this.name = name; - } + public DestinationSubscriptionUpdateInput() {} + public DestinationSubscriptionUpdateInput name(String name) { - public DestinationSubscriptionUpdateInput trigger(String trigger) { - - this.trigger = trigger; - return this; - } + this.name = name; + return this; + } - /** - * The fql statement. - * @return trigger - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fql statement.") + /** + * The user-defined name for the subscription. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The user-defined name for the subscription.") + public String getName() { + return name; + } - public String getTrigger() { - return trigger; - } + public void setName(String name) { + this.name = name; + } + public DestinationSubscriptionUpdateInput trigger(String trigger) { - public void setTrigger(String trigger) { - this.trigger = trigger; - } + this.trigger = trigger; + return this; + } + /** + * The fql statement. + * + * @return trigger + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The fql statement.") + public String getTrigger() { + return trigger; + } - public DestinationSubscriptionUpdateInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public void setTrigger(String trigger) { + this.trigger = trigger; + } - /** - * Is the subscription enabled. - * @return enabled - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Is the subscription enabled.") + public DestinationSubscriptionUpdateInput enabled(Boolean enabled) { - public Boolean getEnabled() { - return enabled; - } + this.enabled = enabled; + return this; + } + /** + * Is the subscription enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Is the subscription enabled.") + public Boolean getEnabled() { + return enabled; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public DestinationSubscriptionUpdateInput settings(Map settings) { - public DestinationSubscriptionUpdateInput settings(Map settings) { - - this.settings = settings; - return this; - } + this.settings = settings; + return this; + } - /** - * The fields used for configuring this action. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fields used for configuring this action.") + /** + * The fields used for configuring this action. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The fields used for configuring this action.") + public Map getSettings() { + return settings; + } - public Map getSettings() { - return settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationSubscriptionUpdateInput destinationSubscriptionUpdateInput = + (DestinationSubscriptionUpdateInput) o; + return Objects.equals(this.name, destinationSubscriptionUpdateInput.name) + && Objects.equals(this.trigger, destinationSubscriptionUpdateInput.trigger) + && Objects.equals(this.enabled, destinationSubscriptionUpdateInput.enabled) + && Objects.equals(this.settings, destinationSubscriptionUpdateInput.settings); + } - public void setSettings(Map settings) { - this.settings = settings; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash(name, trigger, enabled, settings); + } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationSubscriptionUpdateInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationSubscriptionUpdateInput destinationSubscriptionUpdateInput = (DestinationSubscriptionUpdateInput) o; - return Objects.equals(this.name, destinationSubscriptionUpdateInput.name) && - Objects.equals(this.trigger, destinationSubscriptionUpdateInput.trigger) && - Objects.equals(this.enabled, destinationSubscriptionUpdateInput.enabled) && - Objects.equals(this.settings, destinationSubscriptionUpdateInput.settings); - } - - @Override - public int hashCode() { - return Objects.hash(name, trigger, enabled, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationSubscriptionUpdateInput {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("trigger"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("trigger"); - openapiFields.add("enabled"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationSubscriptionUpdateInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationSubscriptionUpdateInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationSubscriptionUpdateInput is not found in the empty JSON string", DestinationSubscriptionUpdateInput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DestinationSubscriptionUpdateInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationSubscriptionUpdateInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationSubscriptionUpdateInput is" + + " not found in the empty JSON string", + DestinationSubscriptionUpdateInput.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationSubscriptionUpdateInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationSubscriptionUpdateInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationSubscriptionUpdateInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationSubscriptionUpdateInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("trigger") != null && !jsonObj.get("trigger").isJsonNull()) + && !jsonObj.get("trigger").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trigger` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("trigger").toString())); } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("trigger") != null && !jsonObj.get("trigger").isJsonNull()) && !jsonObj.get("trigger").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `trigger` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trigger").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationSubscriptionUpdateInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationSubscriptionUpdateInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationSubscriptionUpdateInput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationSubscriptionUpdateInput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationSubscriptionUpdateInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationSubscriptionUpdateInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationSubscriptionUpdateInput - * @throws IOException if the JSON string is invalid with respect to DestinationSubscriptionUpdateInput - */ - public static DestinationSubscriptionUpdateInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationSubscriptionUpdateInput.class); - } - - /** - * Convert an instance of DestinationSubscriptionUpdateInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationSubscriptionUpdateInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationSubscriptionUpdateInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DestinationSubscriptionUpdateInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationSubscriptionUpdateInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationSubscriptionUpdateInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationSubscriptionUpdateInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationSubscriptionUpdateInput + * @throws IOException if the JSON string is invalid with respect to + * DestinationSubscriptionUpdateInput + */ + public static DestinationSubscriptionUpdateInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationSubscriptionUpdateInput.class); + } + + /** + * Convert an instance of DestinationSubscriptionUpdateInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationV1.java b/src/main/java/com/segment/publicapi/models/DestinationV1.java index e5666464..29775c10 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,402 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Metadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - /** - * Business tools or apps that you can connect to the data flowing through Segment. This is equal to the Destination object in Config API, with the following fields omitted: - catalogId - createTime - updateTime - connectionMode. + * Business tools or apps that you can connect to the data flowing through Segment. This is equal to + * the Destination object in Config API, with the following fields omitted: - catalogId - createTime + * - updateTime - connectionMode. */ -@ApiModel(description = "Business tools or apps that you can connect to the data flowing through Segment. This is equal to the Destination object in Config API, with the following fields omitted: - catalogId - createTime - updateTime - connectionMode.") - +@ApiModel( + description = + "Business tools or apps that you can connect to the data flowing through Segment. " + + " This is equal to the Destination object in Config API, with the following" + + " fields omitted: - catalogId - createTime - updateTime - connectionMode.") public class DestinationV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public DestinationV1() { - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public DestinationV1 id(String id) { - - this.id = id; - return this; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to `name`. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier of this instance of a Destination. Config API note: analogous to `name`.") + public static final String SERIALIZED_NAME_METADATA = "metadata"; - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata metadata; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public void setId(String id) { - this.id = id; - } + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - public DestinationV1 name(String name) { - - this.name = name; - return this; - } + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); - /** - * The name of this instance of a Destination. Config API note: equal to `displayName`. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of this instance of a Destination. Config API note: equal to `displayName`.") + public DestinationV1() {} - public String getName() { - return name; - } + public DestinationV1 id(String id) { + this.id = id; + return this; + } - public void setName(String name) { - this.name = name; - } - - - public DestinationV1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether this instance of a Destination receives data. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this instance of a Destination receives data.") + /** + * The unique identifier of this instance of a Destination. Config API note: analogous to + * `name`. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The unique identifier of this instance of a Destination. Config API note:" + + " analogous to `name`.") + public String getId() { + return id; + } - public Boolean getEnabled() { - return enabled; - } + public void setId(String id) { + this.id = id; + } + public DestinationV1 name(String name) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.name = name; + return this; + } + /** + * The name of this instance of a Destination. Config API note: equal to + * `displayName`. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The name of this instance of a Destination. Config API note: equal to" + + " `displayName`.") + public String getName() { + return name; + } - public DestinationV1 metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * Get metadata - * @return metadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DestinationV1 enabled(Boolean enabled) { - public Metadata getMetadata() { - return metadata; - } + this.enabled = enabled; + return this; + } + /** + * Whether this instance of a Destination receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether this instance of a Destination receives data.") + public Boolean getEnabled() { + return enabled; + } - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public DestinationV1 metadata(Metadata metadata) { - public DestinationV1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + this.metadata = metadata; + return this; + } - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of a Source connected to this instance of a Destination. Config API note: analogous to `parent`.") + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata getMetadata() { + return metadata; + } - public String getSourceId() { - return sourceId; - } + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + public DestinationV1 sourceId(String sourceId) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + this.sourceId = sourceId; + return this; + } + /** + * The id of a Source connected to this instance of a Destination. Config API note: analogous to + * `parent`. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The id of a Source connected to this instance of a Destination. Config API" + + " note: analogous to `parent`.") + public String getSourceId() { + return sourceId; + } - public DestinationV1 settings(Map settings) { - - this.settings = settings; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public DestinationV1 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } + public DestinationV1 settings(Map settings) { - /** - * The collection of settings associated with a Destination. Config API note: equal to `config`. - * @return settings - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The collection of settings associated with a Destination. Config API note: equal to `config`.") + this.settings = settings; + return this; + } - public Map getSettings() { - return settings; - } + public DestinationV1 putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + /** + * The collection of settings associated with a Destination. Config API note: equal to + * `config`. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The collection of settings associated with a Destination. Config API note:" + + " equal to `config`.") + public Map getSettings() { + return settings; + } - public void setSettings(Map settings) { - this.settings = settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationV1 destinationV1 = (DestinationV1) o; + return Objects.equals(this.id, destinationV1.id) + && Objects.equals(this.name, destinationV1.name) + && Objects.equals(this.enabled, destinationV1.enabled) + && Objects.equals(this.metadata, destinationV1.metadata) + && Objects.equals(this.sourceId, destinationV1.sourceId) + && Objects.equals(this.settings, destinationV1.settings); + } + @Override + public int hashCode() { + return Objects.hash(id, name, enabled, metadata, sourceId, settings); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DestinationV1 destinationV1 = (DestinationV1) o; - return Objects.equals(this.id, destinationV1.id) && - Objects.equals(this.name, destinationV1.name) && - Objects.equals(this.enabled, destinationV1.enabled) && - Objects.equals(this.metadata, destinationV1.metadata) && - Objects.equals(this.sourceId, destinationV1.sourceId) && - Objects.equals(this.settings, destinationV1.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("metadata"); + openapiFields.add("sourceId"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("settings"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DestinationV1 is not found in the empty JSON string", DestinationV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DestinationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DestinationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationV1 is not found in the" + + " empty JSON string", + DestinationV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DestinationV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DestinationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DestinationV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of DestinationV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationV1 - * @throws IOException if the JSON string is invalid with respect to DestinationV1 - */ - public static DestinationV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationV1.class); - } - - /** - * Convert an instance of DestinationV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of DestinationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationV1 + * @throws IOException if the JSON string is invalid with respect to DestinationV1 + */ + public static DestinationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationV1.class); + } + + /** + * Convert an instance of DestinationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java index db8370ee..af52e869 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DisableEdgeFunctionsAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * DisableEdgeFunctions200Response - */ - +/** DisableEdgeFunctions200Response */ public class DisableEdgeFunctions200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private DisableEdgeFunctionsAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public DisableEdgeFunctions200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private DisableEdgeFunctionsAlphaOutput data; - public DisableEdgeFunctions200Response data(DisableEdgeFunctionsAlphaOutput data) { - - this.data = data; - return this; - } + public DisableEdgeFunctions200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public DisableEdgeFunctions200Response data(DisableEdgeFunctionsAlphaOutput data) { - public DisableEdgeFunctionsAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DisableEdgeFunctionsAlphaOutput getData() { + return data; + } - public void setData(DisableEdgeFunctionsAlphaOutput data) { - this.data = data; - } + public void setData(DisableEdgeFunctionsAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisableEdgeFunctions200Response disableEdgeFunctions200Response = + (DisableEdgeFunctions200Response) o; + return Objects.equals(this.data, disableEdgeFunctions200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisableEdgeFunctions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DisableEdgeFunctions200Response disableEdgeFunctions200Response = (DisableEdgeFunctions200Response) o; - return Objects.equals(this.data, disableEdgeFunctions200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DisableEdgeFunctions200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DisableEdgeFunctions200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DisableEdgeFunctions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DisableEdgeFunctions200Response is not found in the empty JSON string", DisableEdgeFunctions200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DisableEdgeFunctions200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DisableEdgeFunctions200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DisableEdgeFunctions200Response is not" + + " found in the empty JSON string", + DisableEdgeFunctions200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DisableEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DisableEdgeFunctions200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DisableEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DisableEdgeFunctions200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DisableEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DisableEdgeFunctions200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DisableEdgeFunctions200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DisableEdgeFunctions200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DisableEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DisableEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DisableEdgeFunctions200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DisableEdgeFunctions200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DisableEdgeFunctions200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DisableEdgeFunctions200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DisableEdgeFunctions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisableEdgeFunctions200Response + * @throws IOException if the JSON string is invalid with respect to + * DisableEdgeFunctions200Response + */ + public static DisableEdgeFunctions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DisableEdgeFunctions200Response.class); } - } - - /** - * Create an instance of DisableEdgeFunctions200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DisableEdgeFunctions200Response - * @throws IOException if the JSON string is invalid with respect to DisableEdgeFunctions200Response - */ - public static DisableEdgeFunctions200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DisableEdgeFunctions200Response.class); - } - - /** - * Convert an instance of DisableEdgeFunctions200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DisableEdgeFunctions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java index 2f045ac7..18d83c41 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,202 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.EdgeFunctions1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Output for DisableEdgeFunctions. - */ +/** Output for DisableEdgeFunctions. */ @ApiModel(description = "Output for DisableEdgeFunctions.") - public class DisableEdgeFunctionsAlphaOutput { - public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; - @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) - private EdgeFunctions1 edgeFunctions; + public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; - public DisableEdgeFunctionsAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) + private EdgeFunctions1 edgeFunctions; - public DisableEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunctions) { - - this.edgeFunctions = edgeFunctions; - return this; - } + public DisableEdgeFunctionsAlphaOutput() {} - /** - * Get edgeFunctions - * @return edgeFunctions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public DisableEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunctions) { - public EdgeFunctions1 getEdgeFunctions() { - return edgeFunctions; - } + this.edgeFunctions = edgeFunctions; + return this; + } + /** + * Get edgeFunctions + * + * @return edgeFunctions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public EdgeFunctions1 getEdgeFunctions() { + return edgeFunctions; + } - public void setEdgeFunctions(EdgeFunctions1 edgeFunctions) { - this.edgeFunctions = edgeFunctions; - } + public void setEdgeFunctions(EdgeFunctions1 edgeFunctions) { + this.edgeFunctions = edgeFunctions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisableEdgeFunctionsAlphaOutput disableEdgeFunctionsAlphaOutput = + (DisableEdgeFunctionsAlphaOutput) o; + return Objects.equals(this.edgeFunctions, disableEdgeFunctionsAlphaOutput.edgeFunctions); + } + @Override + public int hashCode() { + return Objects.hash(edgeFunctions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisableEdgeFunctionsAlphaOutput {\n"); + sb.append(" edgeFunctions: ").append(toIndentedString(edgeFunctions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - DisableEdgeFunctionsAlphaOutput disableEdgeFunctionsAlphaOutput = (DisableEdgeFunctionsAlphaOutput) o; - return Objects.equals(this.edgeFunctions, disableEdgeFunctionsAlphaOutput.edgeFunctions); - } - - @Override - public int hashCode() { - return Objects.hash(edgeFunctions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DisableEdgeFunctionsAlphaOutput {\n"); - sb.append(" edgeFunctions: ").append(toIndentedString(edgeFunctions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("edgeFunctions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("edgeFunctions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("edgeFunctions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("edgeFunctions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DisableEdgeFunctionsAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DisableEdgeFunctionsAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DisableEdgeFunctionsAlphaOutput is not found in the empty JSON string", DisableEdgeFunctionsAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DisableEdgeFunctionsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DisableEdgeFunctionsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DisableEdgeFunctionsAlphaOutput is not" + + " found in the empty JSON string", + DisableEdgeFunctionsAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DisableEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DisableEdgeFunctionsAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DisableEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DisableEdgeFunctionsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DisableEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DisableEdgeFunctionsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DisableEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DisableEdgeFunctionsAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DisableEdgeFunctionsAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DisableEdgeFunctionsAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DisableEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DisableEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DisableEdgeFunctionsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DisableEdgeFunctionsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DisableEdgeFunctionsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DisableEdgeFunctionsAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DisableEdgeFunctionsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisableEdgeFunctionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * DisableEdgeFunctionsAlphaOutput + */ + public static DisableEdgeFunctionsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DisableEdgeFunctionsAlphaOutput.class); } - } - - /** - * Create an instance of DisableEdgeFunctionsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DisableEdgeFunctionsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to DisableEdgeFunctionsAlphaOutput - */ - public static DisableEdgeFunctionsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DisableEdgeFunctionsAlphaOutput.class); - } - - /** - * Convert an instance of DisableEdgeFunctionsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of DisableEdgeFunctionsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response.java b/src/main/java/com/segment/publicapi/models/Echo200Response.java index 5878e4ba..a6f12160 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.EchoAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Echo200Response - */ - +/** Echo200Response */ public class Echo200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EchoAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public Echo200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private EchoV1Output data; - public Echo200Response data(EchoAlphaOutput data) { - - this.data = data; - return this; - } + public Echo200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public Echo200Response data(EchoV1Output data) { - public EchoAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public EchoV1Output getData() { + return data; + } - public void setData(EchoAlphaOutput data) { - this.data = data; - } + public void setData(EchoV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Echo200Response echo200Response = (Echo200Response) o; + return Objects.equals(this.data, echo200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Echo200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Echo200Response echo200Response = (Echo200Response) o; - return Objects.equals(this.data, echo200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Echo200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Echo200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Echo200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Echo200Response is not found in the empty JSON string", Echo200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Echo200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Echo200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Echo200Response is not found in the" + + " empty JSON string", + Echo200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Echo200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Echo200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Echo200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Echo200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Echo200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Echo200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Echo200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Echo200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Echo200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Echo200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Echo200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Echo200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Echo200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Echo200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Echo200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Echo200Response + * @throws IOException if the JSON string is invalid with respect to Echo200Response + */ + public static Echo200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Echo200Response.class); } - } - - /** - * Create an instance of Echo200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of Echo200Response - * @throws IOException if the JSON string is invalid with respect to Echo200Response - */ - public static Echo200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Echo200Response.class); - } - - /** - * Convert an instance of Echo200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of Echo200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response1.java b/src/main/java/com/segment/publicapi/models/Echo200Response1.java index 237ce0f8..eb00f98b 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response1.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.EchoV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Echo200Response1 - */ - +/** Echo200Response1 */ public class Echo200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EchoV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public Echo200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private EchoAlphaOutput data; - public Echo200Response1 data(EchoV1Output data) { - - this.data = data; - return this; - } + public Echo200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public Echo200Response1 data(EchoAlphaOutput data) { - public EchoV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public EchoAlphaOutput getData() { + return data; + } - public void setData(EchoV1Output data) { - this.data = data; - } + public void setData(EchoAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Echo200Response1 echo200Response1 = (Echo200Response1) o; + return Objects.equals(this.data, echo200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Echo200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Echo200Response1 echo200Response1 = (Echo200Response1) o; - return Objects.equals(this.data, echo200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Echo200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Echo200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Echo200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Echo200Response1 is not found in the empty JSON string", Echo200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Echo200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Echo200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Echo200Response1 is not found in the" + + " empty JSON string", + Echo200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Echo200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Echo200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Echo200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Echo200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Echo200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Echo200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Echo200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Echo200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Echo200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Echo200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Echo200Response1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Echo200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Echo200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Echo200Response1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Echo200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Echo200Response1 + * @throws IOException if the JSON string is invalid with respect to Echo200Response1 + */ + public static Echo200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Echo200Response1.class); } - } - - /** - * Create an instance of Echo200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Echo200Response1 - * @throws IOException if the JSON string is invalid with respect to Echo200Response1 - */ - public static Echo200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Echo200Response1.class); - } - - /** - * Convert an instance of Echo200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of Echo200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java index 7632b6df..923673f4 100644 --- a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,327 +10,332 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Echo response. - */ +/** Echo response. */ @ApiModel(description = "Echo response.") - public class EchoAlphaOutput { - /** - * The HTTP method used for this round-trip. Currently, this endpoint supports only `get` and `post` methods. - */ - @JsonAdapter(MethodEnum.Adapter.class) - public enum MethodEnum { - GET("get"), - - POST("post"); - - private String value; - - MethodEnum(String value) { - this.value = value; - } + /** + * The HTTP method used for this round-trip. Currently, this endpoint supports only + * `get` and `post` methods. + */ + @JsonAdapter(MethodEnum.Adapter.class) + public enum MethodEnum { + GET("get"), - public String getValue() { - return value; - } + POST("post"); - @Override - public String toString() { - return String.valueOf(value); - } + private String value; - public static MethodEnum fromValue(String value) { - for (MethodEnum b : MethodEnum.values()) { - if (b.value.equals(value)) { - return b; + MethodEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return MethodEnum.fromValue(value); - } - } - } + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_METHOD = "method"; - @SerializedName(SERIALIZED_NAME_METHOD) - private MethodEnum method; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; + public static MethodEnum fromValue(String value) { + for (MethodEnum b : MethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static final String SERIALIZED_NAME_HEADERS = "headers"; - @SerializedName(SERIALIZED_NAME_HEADERS) - private Map headers = new HashMap<>(); + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MethodEnum.fromValue(value); + } + } + } - public EchoAlphaOutput() { - } + public static final String SERIALIZED_NAME_METHOD = "method"; - public EchoAlphaOutput method(MethodEnum method) { - - this.method = method; - return this; - } + @SerializedName(SERIALIZED_NAME_METHOD) + private MethodEnum method; - /** - * The HTTP method used for this round-trip. Currently, this endpoint supports only `get` and `post` methods. - * @return method - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The HTTP method used for this round-trip. Currently, this endpoint supports only `get` and `post` methods.") + public static final String SERIALIZED_NAME_MESSAGE = "message"; - public MethodEnum getMethod() { - return method; - } + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + public static final String SERIALIZED_NAME_HEADERS = "headers"; - public void setMethod(MethodEnum method) { - this.method = method; - } + @SerializedName(SERIALIZED_NAME_HEADERS) + private Map headers = new HashMap<>(); + public EchoAlphaOutput() {} - public EchoAlphaOutput message(String message) { - - this.message = message; - return this; - } + public EchoAlphaOutput method(MethodEnum method) { - /** - * The string passed in the `message` input field. - * @return message - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The string passed in the `message` input field.") + this.method = method; + return this; + } - public String getMessage() { - return message; - } + /** + * The HTTP method used for this round-trip. Currently, this endpoint supports only + * `get` and `post` methods. + * + * @return method + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The HTTP method used for this round-trip. Currently, this endpoint supports" + + " only `get` and `post` methods.") + public MethodEnum getMethod() { + return method; + } + public void setMethod(MethodEnum method) { + this.method = method; + } - public void setMessage(String message) { - this.message = message; - } + public EchoAlphaOutput message(String message) { + this.message = message; + return this; + } - public EchoAlphaOutput headers(Map headers) { - - this.headers = headers; - return this; - } + /** + * The string passed in the `message` input field. + * + * @return message + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The string passed in the `message` input field.") + public String getMessage() { + return message; + } - public EchoAlphaOutput putHeadersItem(String key, Object headersItem) { - this.headers.put(key, headersItem); - return this; - } + public void setMessage(String message) { + this.message = message; + } - /** - * The request's HTTP headers. - * @return headers - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The request's HTTP headers.") + public EchoAlphaOutput headers(Map headers) { - public Map getHeaders() { - return headers; - } + this.headers = headers; + return this; + } + public EchoAlphaOutput putHeadersItem(String key, Object headersItem) { + this.headers.put(key, headersItem); + return this; + } - public void setHeaders(Map headers) { - this.headers = headers; - } + /** + * The request's HTTP headers. + * + * @return headers + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The request's HTTP headers.") + public Map getHeaders() { + return headers; + } + public void setHeaders(Map headers) { + this.headers = headers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EchoAlphaOutput echoAlphaOutput = (EchoAlphaOutput) o; + return Objects.equals(this.method, echoAlphaOutput.method) + && Objects.equals(this.message, echoAlphaOutput.message) + && Objects.equals(this.headers, echoAlphaOutput.headers); + } + @Override + public int hashCode() { + return Objects.hash(method, message, headers); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EchoAlphaOutput {\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - EchoAlphaOutput echoAlphaOutput = (EchoAlphaOutput) o; - return Objects.equals(this.method, echoAlphaOutput.method) && - Objects.equals(this.message, echoAlphaOutput.message) && - Objects.equals(this.headers, echoAlphaOutput.headers); - } - - @Override - public int hashCode() { - return Objects.hash(method, message, headers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EchoAlphaOutput {\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("method"); + openapiFields.add("message"); + openapiFields.add("headers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("method"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("headers"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("method"); - openapiFields.add("message"); - openapiFields.add("headers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("method"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("headers"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EchoAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EchoAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EchoAlphaOutput is not found in the empty JSON string", EchoAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EchoAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EchoAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EchoAlphaOutput is not found in the" + + " empty JSON string", + EchoAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EchoAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EchoAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EchoAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EchoAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EchoAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EchoAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("method").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `method` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("method").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `message` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EchoAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EchoAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EchoAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EchoAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EchoAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); - } - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EchoAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EchoAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EchoAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EchoAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EchoAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of EchoAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of EchoAlphaOutput - * @throws IOException if the JSON string is invalid with respect to EchoAlphaOutput - */ - public static EchoAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EchoAlphaOutput.class); - } - - /** - * Convert an instance of EchoAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of EchoAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of EchoAlphaOutput + * @throws IOException if the JSON string is invalid with respect to EchoAlphaOutput + */ + public static EchoAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EchoAlphaOutput.class); + } + + /** + * Convert an instance of EchoAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EchoV1Output.java b/src/main/java/com/segment/publicapi/models/EchoV1Output.java index fb4d25f7..1772428d 100644 --- a/src/main/java/com/segment/publicapi/models/EchoV1Output.java +++ b/src/main/java/com/segment/publicapi/models/EchoV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,327 +10,331 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Echo response. - */ +/** Echo response. */ @ApiModel(description = "Echo response.") - public class EchoV1Output { - /** - * The HTTP method used for this round-trip. Currently, this endpoint supports only `get` and `post` methods. - */ - @JsonAdapter(MethodEnum.Adapter.class) - public enum MethodEnum { - GET("get"), - - POST("post"); - - private String value; - - MethodEnum(String value) { - this.value = value; - } + /** + * The HTTP method used for this round-trip. Currently, this endpoint supports only + * `get` and `post` methods. + */ + @JsonAdapter(MethodEnum.Adapter.class) + public enum MethodEnum { + GET("get"), - public String getValue() { - return value; - } + POST("post"); - @Override - public String toString() { - return String.valueOf(value); - } + private String value; - public static MethodEnum fromValue(String value) { - for (MethodEnum b : MethodEnum.values()) { - if (b.value.equals(value)) { - return b; + MethodEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public MethodEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return MethodEnum.fromValue(value); - } - } - } + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_METHOD = "method"; - @SerializedName(SERIALIZED_NAME_METHOD) - private MethodEnum method; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; + public static MethodEnum fromValue(String value) { + for (MethodEnum b : MethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static final String SERIALIZED_NAME_HEADERS = "headers"; - @SerializedName(SERIALIZED_NAME_HEADERS) - private Map headers = new HashMap<>(); + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MethodEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MethodEnum.fromValue(value); + } + } + } - public EchoV1Output() { - } + public static final String SERIALIZED_NAME_METHOD = "method"; - public EchoV1Output method(MethodEnum method) { - - this.method = method; - return this; - } + @SerializedName(SERIALIZED_NAME_METHOD) + private MethodEnum method; - /** - * The HTTP method used for this round-trip. Currently, this endpoint supports only `get` and `post` methods. - * @return method - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The HTTP method used for this round-trip. Currently, this endpoint supports only `get` and `post` methods.") + public static final String SERIALIZED_NAME_MESSAGE = "message"; - public MethodEnum getMethod() { - return method; - } + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + public static final String SERIALIZED_NAME_HEADERS = "headers"; - public void setMethod(MethodEnum method) { - this.method = method; - } + @SerializedName(SERIALIZED_NAME_HEADERS) + private Map headers = new HashMap<>(); + public EchoV1Output() {} - public EchoV1Output message(String message) { - - this.message = message; - return this; - } + public EchoV1Output method(MethodEnum method) { - /** - * The string passed in the `message` input field. - * @return message - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The string passed in the `message` input field.") + this.method = method; + return this; + } - public String getMessage() { - return message; - } + /** + * The HTTP method used for this round-trip. Currently, this endpoint supports only + * `get` and `post` methods. + * + * @return method + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The HTTP method used for this round-trip. Currently, this endpoint supports" + + " only `get` and `post` methods.") + public MethodEnum getMethod() { + return method; + } + public void setMethod(MethodEnum method) { + this.method = method; + } - public void setMessage(String message) { - this.message = message; - } + public EchoV1Output message(String message) { + this.message = message; + return this; + } - public EchoV1Output headers(Map headers) { - - this.headers = headers; - return this; - } + /** + * The string passed in the `message` input field. + * + * @return message + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The string passed in the `message` input field.") + public String getMessage() { + return message; + } - public EchoV1Output putHeadersItem(String key, Object headersItem) { - this.headers.put(key, headersItem); - return this; - } + public void setMessage(String message) { + this.message = message; + } - /** - * The request's HTTP headers. - * @return headers - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The request's HTTP headers.") + public EchoV1Output headers(Map headers) { - public Map getHeaders() { - return headers; - } + this.headers = headers; + return this; + } + public EchoV1Output putHeadersItem(String key, Object headersItem) { + this.headers.put(key, headersItem); + return this; + } - public void setHeaders(Map headers) { - this.headers = headers; - } + /** + * The request's HTTP headers. + * + * @return headers + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The request's HTTP headers.") + public Map getHeaders() { + return headers; + } + public void setHeaders(Map headers) { + this.headers = headers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EchoV1Output echoV1Output = (EchoV1Output) o; + return Objects.equals(this.method, echoV1Output.method) + && Objects.equals(this.message, echoV1Output.message) + && Objects.equals(this.headers, echoV1Output.headers); + } + @Override + public int hashCode() { + return Objects.hash(method, message, headers); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EchoV1Output {\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - EchoV1Output echoV1Output = (EchoV1Output) o; - return Objects.equals(this.method, echoV1Output.method) && - Objects.equals(this.message, echoV1Output.message) && - Objects.equals(this.headers, echoV1Output.headers); - } - - @Override - public int hashCode() { - return Objects.hash(method, message, headers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EchoV1Output {\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("method"); + openapiFields.add("message"); + openapiFields.add("headers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("method"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("headers"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("method"); - openapiFields.add("message"); - openapiFields.add("headers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("method"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("headers"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EchoV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EchoV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EchoV1Output is not found in the empty JSON string", EchoV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EchoV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EchoV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EchoV1Output is not found in the empty" + + " JSON string", + EchoV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EchoV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EchoV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EchoV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EchoV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EchoV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EchoV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("method").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `method` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("method").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `message` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EchoV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EchoV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EchoV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EchoV1Output value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EchoV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); - } - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EchoV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EchoV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EchoV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EchoV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EchoV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of EchoV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of EchoV1Output - * @throws IOException if the JSON string is invalid with respect to EchoV1Output - */ - public static EchoV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EchoV1Output.class); - } - - /** - * Convert an instance of EchoV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of EchoV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of EchoV1Output + * @throws IOException if the JSON string is invalid with respect to EchoV1Output + */ + public static EchoV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EchoV1Output.class); + } + + /** + * Convert an instance of EchoV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java index 117c1dfb..67c54a71 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,385 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The created Edge Function. - */ +/** The created Edge Function. */ @ApiModel(description = "The created Edge Function.") - public class EdgeFunctions { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_ID = "id"; - public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; - @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) - private String downloadURL; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public EdgeFunctions() { - } + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public EdgeFunctions id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - /** - * The Edge Function id. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Edge Function id.") + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; + @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) + private String downloadURL; - public EdgeFunctions sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + public static final String SERIALIZED_NAME_VERSION = "version"; - /** - * The Source id. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id.") + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; - public String getSourceId() { - return sourceId; - } + public EdgeFunctions() {} + public EdgeFunctions id(String id) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - - public EdgeFunctions createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + this.id = id; + return this; + } - /** - * Creation date. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creation date.") + /** + * The Edge Function id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Edge Function id.") + public String getId() { + return id; + } - public String getCreatedAt() { - return createdAt; - } + public void setId(String id) { + this.id = id; + } + public EdgeFunctions sourceId(String sourceId) { - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + this.sourceId = sourceId; + return this; + } + /** + * The Source id. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source id.") + public String getSourceId() { + return sourceId; + } - public EdgeFunctions createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - /** - * Creating user's id. - * @return createdBy - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creating user's id.") + public EdgeFunctions createdAt(String createdAt) { - public String getCreatedBy() { - return createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * Creation date. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Creation date.") + public String getCreatedAt() { + return createdAt; + } - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + public EdgeFunctions createdBy(String createdBy) { - public EdgeFunctions downloadURL(String downloadURL) { - - this.downloadURL = downloadURL; - return this; - } + this.createdBy = createdBy; + return this; + } - /** - * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. - * @return downloadURL - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") + /** + * Creating user's id. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Creating user's id.") + public String getCreatedBy() { + return createdBy; + } - public String getDownloadURL() { - return downloadURL; - } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + public EdgeFunctions downloadURL(String downloadURL) { - public void setDownloadURL(String downloadURL) { - this.downloadURL = downloadURL; - } + this.downloadURL = downloadURL; + return this; + } + /** + * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. + * + * @return downloadURL + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") + public String getDownloadURL() { + return downloadURL; + } - public EdgeFunctions version(BigDecimal version) { - - this.version = version; - return this; - } + public void setDownloadURL(String downloadURL) { + this.downloadURL = downloadURL; + } - /** - * Revision number associated with the latest Edge Function. - * @return version - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Revision number associated with the latest Edge Function.") + public EdgeFunctions version(BigDecimal version) { - public BigDecimal getVersion() { - return version; - } + this.version = version; + return this; + } + /** + * Revision number associated with the latest Edge Function. + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Revision number associated with the latest Edge Function.") + public BigDecimal getVersion() { + return version; + } - public void setVersion(BigDecimal version) { - this.version = version; - } + public void setVersion(BigDecimal version) { + this.version = version; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeFunctions edgeFunctions = (EdgeFunctions) o; + return Objects.equals(this.id, edgeFunctions.id) + && Objects.equals(this.sourceId, edgeFunctions.sourceId) + && Objects.equals(this.createdAt, edgeFunctions.createdAt) + && Objects.equals(this.createdBy, edgeFunctions.createdBy) + && Objects.equals(this.downloadURL, edgeFunctions.downloadURL) + && Objects.equals(this.version, edgeFunctions.version); + } + @Override + public int hashCode() { + return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeFunctions {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - EdgeFunctions edgeFunctions = (EdgeFunctions) o; - return Objects.equals(this.id, edgeFunctions.id) && - Objects.equals(this.sourceId, edgeFunctions.sourceId) && - Objects.equals(this.createdAt, edgeFunctions.createdAt) && - Objects.equals(this.createdBy, edgeFunctions.createdBy) && - Objects.equals(this.downloadURL, edgeFunctions.downloadURL) && - Objects.equals(this.version, edgeFunctions.version); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeFunctions {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("downloadURL"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("downloadURL"); + openapiRequiredFields.add("version"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("downloadURL"); - openapiFields.add("version"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("downloadURL"); - openapiRequiredFields.add("version"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EdgeFunctions - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EdgeFunctions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EdgeFunctions is not found in the empty JSON string", EdgeFunctions.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EdgeFunctions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EdgeFunctions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EdgeFunctions is not found in the" + + " empty JSON string", + EdgeFunctions.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EdgeFunctions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EdgeFunctions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EdgeFunctions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EdgeFunctions` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EdgeFunctions.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EdgeFunctions.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("downloadURL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `downloadURL` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("downloadURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EdgeFunctions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EdgeFunctions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EdgeFunctions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EdgeFunctions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("downloadURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `downloadURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EdgeFunctions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EdgeFunctions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctions.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EdgeFunctions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EdgeFunctions read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of EdgeFunctions given an JSON string - * - * @param jsonString JSON string - * @return An instance of EdgeFunctions - * @throws IOException if the JSON string is invalid with respect to EdgeFunctions - */ - public static EdgeFunctions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EdgeFunctions.class); - } - - /** - * Convert an instance of EdgeFunctions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of EdgeFunctions given an JSON string + * + * @param jsonString JSON string + * @return An instance of EdgeFunctions + * @throws IOException if the JSON string is invalid with respect to EdgeFunctions + */ + public static EdgeFunctions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EdgeFunctions.class); + } + + /** + * Convert an instance of EdgeFunctions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java index 2f450246..3a0b7c3f 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,385 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The latest version of Edge Function bundle. - */ +/** The latest version of Edge Function bundle. */ @ApiModel(description = "The latest version of Edge Function bundle.") - public class EdgeFunctions1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_ID = "id"; - public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; - @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) - private String downloadURL; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public EdgeFunctions1() { - } + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public EdgeFunctions1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - /** - * The Edge Function id. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Edge Function id.") + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; + @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) + private String downloadURL; - public EdgeFunctions1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + public static final String SERIALIZED_NAME_VERSION = "version"; - /** - * The Source id. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id.") + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; - public String getSourceId() { - return sourceId; - } + public EdgeFunctions1() {} + public EdgeFunctions1 id(String id) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - - public EdgeFunctions1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + this.id = id; + return this; + } - /** - * Creation date. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creation date.") + /** + * The Edge Function id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Edge Function id.") + public String getId() { + return id; + } - public String getCreatedAt() { - return createdAt; - } + public void setId(String id) { + this.id = id; + } + public EdgeFunctions1 sourceId(String sourceId) { - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + this.sourceId = sourceId; + return this; + } + /** + * The Source id. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source id.") + public String getSourceId() { + return sourceId; + } - public EdgeFunctions1 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - /** - * Creating user's id. - * @return createdBy - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creating user's id.") + public EdgeFunctions1 createdAt(String createdAt) { - public String getCreatedBy() { - return createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * Creation date. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Creation date.") + public String getCreatedAt() { + return createdAt; + } - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + public EdgeFunctions1 createdBy(String createdBy) { - public EdgeFunctions1 downloadURL(String downloadURL) { - - this.downloadURL = downloadURL; - return this; - } + this.createdBy = createdBy; + return this; + } - /** - * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. - * @return downloadURL - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") + /** + * Creating user's id. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Creating user's id.") + public String getCreatedBy() { + return createdBy; + } - public String getDownloadURL() { - return downloadURL; - } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + public EdgeFunctions1 downloadURL(String downloadURL) { - public void setDownloadURL(String downloadURL) { - this.downloadURL = downloadURL; - } + this.downloadURL = downloadURL; + return this; + } + /** + * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. + * + * @return downloadURL + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") + public String getDownloadURL() { + return downloadURL; + } - public EdgeFunctions1 version(BigDecimal version) { - - this.version = version; - return this; - } + public void setDownloadURL(String downloadURL) { + this.downloadURL = downloadURL; + } - /** - * Revision number associated with the latest Edge Function. - * @return version - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Revision number associated with the latest Edge Function.") + public EdgeFunctions1 version(BigDecimal version) { - public BigDecimal getVersion() { - return version; - } + this.version = version; + return this; + } + /** + * Revision number associated with the latest Edge Function. + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Revision number associated with the latest Edge Function.") + public BigDecimal getVersion() { + return version; + } - public void setVersion(BigDecimal version) { - this.version = version; - } + public void setVersion(BigDecimal version) { + this.version = version; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeFunctions1 edgeFunctions1 = (EdgeFunctions1) o; + return Objects.equals(this.id, edgeFunctions1.id) + && Objects.equals(this.sourceId, edgeFunctions1.sourceId) + && Objects.equals(this.createdAt, edgeFunctions1.createdAt) + && Objects.equals(this.createdBy, edgeFunctions1.createdBy) + && Objects.equals(this.downloadURL, edgeFunctions1.downloadURL) + && Objects.equals(this.version, edgeFunctions1.version); + } + @Override + public int hashCode() { + return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeFunctions1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - EdgeFunctions1 edgeFunctions1 = (EdgeFunctions1) o; - return Objects.equals(this.id, edgeFunctions1.id) && - Objects.equals(this.sourceId, edgeFunctions1.sourceId) && - Objects.equals(this.createdAt, edgeFunctions1.createdAt) && - Objects.equals(this.createdBy, edgeFunctions1.createdBy) && - Objects.equals(this.downloadURL, edgeFunctions1.downloadURL) && - Objects.equals(this.version, edgeFunctions1.version); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeFunctions1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("downloadURL"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("downloadURL"); + openapiRequiredFields.add("version"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("downloadURL"); - openapiFields.add("version"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("downloadURL"); - openapiRequiredFields.add("version"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EdgeFunctions1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EdgeFunctions1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EdgeFunctions1 is not found in the empty JSON string", EdgeFunctions1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EdgeFunctions1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EdgeFunctions1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EdgeFunctions1 is not found in the" + + " empty JSON string", + EdgeFunctions1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EdgeFunctions1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EdgeFunctions1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EdgeFunctions1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EdgeFunctions1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EdgeFunctions1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EdgeFunctions1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("downloadURL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `downloadURL` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("downloadURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EdgeFunctions1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EdgeFunctions1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctions1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EdgeFunctions1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EdgeFunctions1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("downloadURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `downloadURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EdgeFunctions1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EdgeFunctions1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctions1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EdgeFunctions1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EdgeFunctions1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of EdgeFunctions1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of EdgeFunctions1 - * @throws IOException if the JSON string is invalid with respect to EdgeFunctions1 - */ - public static EdgeFunctions1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EdgeFunctions1.class); - } - - /** - * Convert an instance of EdgeFunctions1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of EdgeFunctions1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of EdgeFunctions1 + * @throws IOException if the JSON string is invalid with respect to EdgeFunctions1 + */ + public static EdgeFunctions1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EdgeFunctions1.class); + } + + /** + * Convert an instance of EdgeFunctions1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java index 4a14e427..5b0a52dd 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,376 +10,386 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents an Edge Function bundle. - */ +/** Represents an Edge Function bundle. */ @ApiModel(description = "Represents an Edge Function bundle.") - public class EdgeFunctionsAlpha { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_ID = "id"; - public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; - @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) - private String downloadURL; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public static final String SERIALIZED_NAME_VERSION = "version"; - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public EdgeFunctionsAlpha() { - } + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public EdgeFunctionsAlpha id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - /** - * The Edge Function id. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Edge Function id.") + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; + @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) + private String downloadURL; - public EdgeFunctionsAlpha sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + public static final String SERIALIZED_NAME_VERSION = "version"; - /** - * The Source id. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id.") + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; - public String getSourceId() { - return sourceId; - } + public EdgeFunctionsAlpha() {} + public EdgeFunctionsAlpha id(String id) { - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - - public EdgeFunctionsAlpha createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + this.id = id; + return this; + } - /** - * Creation date. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creation date.") + /** + * The Edge Function id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Edge Function id.") + public String getId() { + return id; + } - public String getCreatedAt() { - return createdAt; - } + public void setId(String id) { + this.id = id; + } + public EdgeFunctionsAlpha sourceId(String sourceId) { - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + this.sourceId = sourceId; + return this; + } + /** + * The Source id. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source id.") + public String getSourceId() { + return sourceId; + } - public EdgeFunctionsAlpha createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - /** - * Creating user's id. - * @return createdBy - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creating user's id.") + public EdgeFunctionsAlpha createdAt(String createdAt) { - public String getCreatedBy() { - return createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * Creation date. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Creation date.") + public String getCreatedAt() { + return createdAt; + } - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + public EdgeFunctionsAlpha createdBy(String createdBy) { - public EdgeFunctionsAlpha downloadURL(String downloadURL) { - - this.downloadURL = downloadURL; - return this; - } + this.createdBy = createdBy; + return this; + } - /** - * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. - * @return downloadURL - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") + /** + * Creating user's id. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Creating user's id.") + public String getCreatedBy() { + return createdBy; + } - public String getDownloadURL() { - return downloadURL; - } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + public EdgeFunctionsAlpha downloadURL(String downloadURL) { - public void setDownloadURL(String downloadURL) { - this.downloadURL = downloadURL; - } + this.downloadURL = downloadURL; + return this; + } + /** + * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. + * + * @return downloadURL + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") + public String getDownloadURL() { + return downloadURL; + } - public EdgeFunctionsAlpha version(BigDecimal version) { - - this.version = version; - return this; - } + public void setDownloadURL(String downloadURL) { + this.downloadURL = downloadURL; + } - /** - * Revision number associated with the latest Edge Function. - * @return version - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Revision number associated with the latest Edge Function.") + public EdgeFunctionsAlpha version(BigDecimal version) { - public BigDecimal getVersion() { - return version; - } + this.version = version; + return this; + } + /** + * Revision number associated with the latest Edge Function. + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Revision number associated with the latest Edge Function.") + public BigDecimal getVersion() { + return version; + } - public void setVersion(BigDecimal version) { - this.version = version; - } + public void setVersion(BigDecimal version) { + this.version = version; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EdgeFunctionsAlpha edgeFunctionsAlpha = (EdgeFunctionsAlpha) o; + return Objects.equals(this.id, edgeFunctionsAlpha.id) + && Objects.equals(this.sourceId, edgeFunctionsAlpha.sourceId) + && Objects.equals(this.createdAt, edgeFunctionsAlpha.createdAt) + && Objects.equals(this.createdBy, edgeFunctionsAlpha.createdBy) + && Objects.equals(this.downloadURL, edgeFunctionsAlpha.downloadURL) + && Objects.equals(this.version, edgeFunctionsAlpha.version); + } + @Override + public int hashCode() { + return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EdgeFunctionsAlpha {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - EdgeFunctionsAlpha edgeFunctionsAlpha = (EdgeFunctionsAlpha) o; - return Objects.equals(this.id, edgeFunctionsAlpha.id) && - Objects.equals(this.sourceId, edgeFunctionsAlpha.sourceId) && - Objects.equals(this.createdAt, edgeFunctionsAlpha.createdAt) && - Objects.equals(this.createdBy, edgeFunctionsAlpha.createdBy) && - Objects.equals(this.downloadURL, edgeFunctionsAlpha.downloadURL) && - Objects.equals(this.version, edgeFunctionsAlpha.version); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeFunctionsAlpha {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("downloadURL"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("downloadURL"); + openapiRequiredFields.add("version"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("downloadURL"); - openapiFields.add("version"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("downloadURL"); - openapiRequiredFields.add("version"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EdgeFunctionsAlpha - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EdgeFunctionsAlpha.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EdgeFunctionsAlpha is not found in the empty JSON string", EdgeFunctionsAlpha.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EdgeFunctionsAlpha + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EdgeFunctionsAlpha.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EdgeFunctionsAlpha is not found in the" + + " empty JSON string", + EdgeFunctionsAlpha.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EdgeFunctionsAlpha.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EdgeFunctionsAlpha` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EdgeFunctionsAlpha.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EdgeFunctionsAlpha` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EdgeFunctionsAlpha.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EdgeFunctionsAlpha.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("downloadURL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `downloadURL` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("downloadURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EdgeFunctionsAlpha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EdgeFunctionsAlpha' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctionsAlpha.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EdgeFunctionsAlpha value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EdgeFunctionsAlpha read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("downloadURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `downloadURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EdgeFunctionsAlpha.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EdgeFunctionsAlpha' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctionsAlpha.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EdgeFunctionsAlpha value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EdgeFunctionsAlpha read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of EdgeFunctionsAlpha given an JSON string - * - * @param jsonString JSON string - * @return An instance of EdgeFunctionsAlpha - * @throws IOException if the JSON string is invalid with respect to EdgeFunctionsAlpha - */ - public static EdgeFunctionsAlpha fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EdgeFunctionsAlpha.class); - } - - /** - * Convert an instance of EdgeFunctionsAlpha to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of EdgeFunctionsAlpha given an JSON string + * + * @param jsonString JSON string + * @return An instance of EdgeFunctionsAlpha + * @throws IOException if the JSON string is invalid with respect to EdgeFunctionsAlpha + */ + public static EdgeFunctionsAlpha fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EdgeFunctionsAlpha.class); + } + + /** + * Convert an instance of EdgeFunctionsAlpha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EventSourceV1.java b/src/main/java/com/segment/publicapi/models/EventSourceV1.java index 9cdfa2cd..8285c002 100644 --- a/src/main/java/com/segment/publicapi/models/EventSourceV1.java +++ b/src/main/java/com/segment/publicapi/models/EventSourceV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,274 +10,276 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Source represents a Segment Source. - */ +/** Source represents a Segment Source. */ @ApiModel(description = "Source represents a Segment Source.") - public class EventSourceV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_ID = "id"; - public static final String SERIALIZED_NAME_SLUG = "slug"; - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public EventSourceV1() { - } + public static final String SERIALIZED_NAME_NAME = "name"; - public EventSourceV1 id(String id) { - - this.id = id; - return this; - } + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - /** - * The id of the Source where the events came from. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source where the events came from.") + public static final String SERIALIZED_NAME_SLUG = "slug"; - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_SLUG) + private String slug; + public EventSourceV1() {} - public void setId(String id) { - this.id = id; - } + public EventSourceV1 id(String id) { + this.id = id; + return this; + } - public EventSourceV1 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Source, if applicable. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Source, if applicable.") + /** + * The id of the Source where the events came from. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Source where the events came from.") + public String getId() { + return id; + } - public String getName() { - return name; - } + public void setId(String id) { + this.id = id; + } + public EventSourceV1 name(String name) { - public void setName(String name) { - this.name = name; - } + this.name = name; + return this; + } + /** + * The name of the Source, if applicable. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Source, if applicable.") + public String getName() { + return name; + } - public EventSourceV1 slug(String slug) { - - this.slug = slug; - return this; - } + public void setName(String name) { + this.name = name; + } - /** - * The slug of the Source, if applicable. - * @return slug - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The slug of the Source, if applicable.") + public EventSourceV1 slug(String slug) { - public String getSlug() { - return slug; - } + this.slug = slug; + return this; + } + /** + * The slug of the Source, if applicable. + * + * @return slug + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The slug of the Source, if applicable.") + public String getSlug() { + return slug; + } - public void setSlug(String slug) { - this.slug = slug; - } + public void setSlug(String slug) { + this.slug = slug; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSourceV1 eventSourceV1 = (EventSourceV1) o; + return Objects.equals(this.id, eventSourceV1.id) + && Objects.equals(this.name, eventSourceV1.name) + && Objects.equals(this.slug, eventSourceV1.slug); + } + @Override + public int hashCode() { + return Objects.hash(id, name, slug); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSourceV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - EventSourceV1 eventSourceV1 = (EventSourceV1) o; - return Objects.equals(this.id, eventSourceV1.id) && - Objects.equals(this.name, eventSourceV1.name) && - Objects.equals(this.slug, eventSourceV1.slug); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, slug); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventSourceV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("slug"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("slug"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EventSourceV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EventSourceV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EventSourceV1 is not found in the empty JSON string", EventSourceV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EventSourceV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EventSourceV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EventSourceV1 is not found in the" + + " empty JSON string", + EventSourceV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EventSourceV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EventSourceV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EventSourceV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EventSourceV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EventSourceV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventSourceV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("slug") != null && !jsonObj.get("slug").isJsonNull()) + && !jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `slug` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("slug").toString())); } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("slug") != null && !jsonObj.get("slug").isJsonNull()) && !jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EventSourceV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EventSourceV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EventSourceV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EventSourceV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EventSourceV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of EventSourceV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of EventSourceV1 - * @throws IOException if the JSON string is invalid with respect to EventSourceV1 - */ - public static EventSourceV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EventSourceV1.class); - } - - /** - * Convert an instance of EventSourceV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventSourceV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventSourceV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EventSourceV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EventSourceV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventSourceV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EventSourceV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventSourceV1 + * @throws IOException if the JSON string is invalid with respect to EventSourceV1 + */ + public static EventSourceV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventSourceV1.class); + } + + /** + * Convert an instance of EventSourceV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index d40fa789..48a45b5d 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,264 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationFilterActionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The filter to preview. - */ +/** The filter to preview. */ @ApiModel(description = "The filter to preview.") - public class Filter { - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; + public static final String SERIALIZED_NAME_IF = "if"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_IF) + private String _if; - public Filter() { - } + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public Filter _if(String _if) { - - this._if = _if; - return this; - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); - /** - * A FQL statement which determines if the provided filter's actions will apply to the provided JSON payload. The literal string \"all\" will result in this filter to all events. For guidance on using FQL, see the Segment documentation site. - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A FQL statement which determines if the provided filter's actions will apply to the provided JSON payload. The literal string \"all\" will result in this filter to all events. For guidance on using FQL, see the Segment documentation site.") + public Filter() {} - public String getIf() { - return _if; - } + public Filter _if(String _if) { + this._if = _if; + return this; + } - public void setIf(String _if) { - this._if = _if; - } - + /** + * A FQL statement which determines if the provided filter's actions will apply to the + * provided JSON payload. The literal string \"all\" will result in this filter to all + * events. For guidance on using FQL, see the Segment documentation site. + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "A FQL statement which determines if the provided filter's actions will apply" + + " to the provided JSON payload. The literal string \"all\" will result in" + + " this filter to all events. For guidance on using FQL, see the Segment" + + " documentation site.") + public String getIf() { + return _if; + } - public Filter actions(List actions) { - - this.actions = actions; - return this; - } + public void setIf(String _if) { + this._if = _if; + } - public Filter addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + public Filter actions(List actions) { - /** - * The filtering action to take on events that match the \"if\" statement. Action types must be one of: \"drop\", \"allow_properties\", \"drop_properties\" or \"sample\". - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The filtering action to take on events that match the \"if\" statement. Action types must be one of: \"drop\", \"allow_properties\", \"drop_properties\" or \"sample\".") + this.actions = actions; + return this; + } - public List getActions() { - return actions; - } + public Filter addActionsItem(DestinationFilterActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } + /** + * The filtering action to take on events that match the \"if\" statement. Action + * types must be one of: \"drop\", \"allow_properties\", + * \"drop_properties\" or \"sample\". + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The filtering action to take on events that match the \"if\" statement. Action" + + " types must be one of: \"drop\", \"allow_properties\"," + + " \"drop_properties\" or \"sample\".") + public List getActions() { + return actions; + } - public void setActions(List actions) { - this.actions = actions; - } + public void setActions(List actions) { + this.actions = actions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Filter filter = (Filter) o; + return Objects.equals(this._if, filter._if) && Objects.equals(this.actions, filter.actions); + } + @Override + public int hashCode() { + return Objects.hash(_if, actions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Filter {\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Filter filter = (Filter) o; - return Objects.equals(this._if, filter._if) && - Objects.equals(this.actions, filter.actions); - } - - @Override - public int hashCode() { - return Objects.hash(_if, actions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter {\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("if"); + openapiFields.add("actions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("if"); + openapiRequiredFields.add("actions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("if"); - openapiFields.add("actions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Filter is not found in the empty JSON string", Filter.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Filter + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Filter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Filter is not found in the empty JSON" + + " string", + Filter.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Filter` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Filter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Filter`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Filter.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Filter.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); } - } - - /** - * Create an instance of Filter given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter - * @throws IOException if the JSON string is invalid with respect to Filter - */ - public static Filter fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter.class); - } - - /** - * Convert an instance of Filter to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Filter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Filter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Filter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Filter value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Filter read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Filter given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter + * @throws IOException if the JSON string is invalid with respect to Filter + */ + public static Filter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Filter.class); + } + + /** + * Convert an instance of Filter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Filter1.java b/src/main/java/com/segment/publicapi/models/Filter1.java index 304395fb..e6e192ee 100644 --- a/src/main/java/com/segment/publicapi/models/Filter1.java +++ b/src/main/java/com/segment/publicapi/models/Filter1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,521 +10,553 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationFilterActionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The requested Destination filter. - */ +/** The requested Destination filter. */ @ApiModel(description = "The requested Destination filter.") - public class Filter1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; - public static final String SERIALIZED_NAME_TITLE = "title"; - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_IF = "if"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_IF) + private String _if; - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public Filter1() { - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); - public Filter1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_TITLE = "title"; - /** - * The unique id of this filter. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public void setId(String id) { - this.id = id; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public Filter1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - /** - * The id of the Source associated with this filter. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + public Filter1() {} - public Filter1 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } + public Filter1 id(String id) { - /** - * The id of the Destination associated with this filter. - * @return destinationId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Destination associated with this filter.") + this.id = id; + return this; + } - public String getDestinationId() { - return destinationId; - } + /** + * The unique id of this filter. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The unique id of this filter.") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } + public Filter1 sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public Filter1 _if(String _if) { - - this._if = _if; - return this; - } + /** + * The id of the Source associated with this filter. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public String getSourceId() { + return sourceId; + } - /** - * A condition that defines whether to apply this filter to a payload. - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A condition that defines whether to apply this filter to a payload.") + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public String getIf() { - return _if; - } + public Filter1 destinationId(String destinationId) { + this.destinationId = destinationId; + return this; + } - public void setIf(String _if) { - this._if = _if; - } + /** + * The id of the Destination associated with this filter. + * + * @return destinationId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Destination associated with this filter.") + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + public Filter1 _if(String _if) { - public Filter1 actions(List actions) { - - this.actions = actions; - return this; - } + this._if = _if; + return this; + } - public Filter1 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + /** + * A condition that defines whether to apply this filter to a payload. + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A condition that defines whether to apply this filter to a payload.") + public String getIf() { + return _if; + } - /** - * A list of actions this filter performs. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public void setIf(String _if) { + this._if = _if; + } - public List getActions() { - return actions; - } + public Filter1 actions(List actions) { + this.actions = actions; + return this; + } - public void setActions(List actions) { - this.actions = actions; - } + public Filter1 addActionsItem(DestinationFilterActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } + /** + * A list of actions this filter performs. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public List getActions() { + return actions; + } - public Filter1 title(String title) { - - this.title = title; - return this; - } + public void setActions(List actions) { + this.actions = actions; + } - /** - * A title for this filter. - * @return title - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") + public Filter1 title(String title) { - public String getTitle() { - return title; - } + this.title = title; + return this; + } + /** + * A title for this filter. + * + * @return title + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A title for this filter.") + public String getTitle() { + return title; + } - public void setTitle(String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } + public Filter1 description(String description) { - public Filter1 description(String description) { - - this.description = description; - return this; - } + this.description = description; + return this; + } - /** - * A description for this filter. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") + /** + * A description for this filter. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this filter.") + public String getDescription() { + return description; + } - public String getDescription() { - return description; - } + public void setDescription(String description) { + this.description = description; + } + public Filter1 enabled(Boolean enabled) { - public void setDescription(String description) { - this.description = description; - } + this.enabled = enabled; + return this; + } + /** + * When set to true, this filter is active. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this filter is active.") + public Boolean getEnabled() { + return enabled; + } - public Filter1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - - public Boolean getEnabled() { - return enabled; - } - - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - - public Filter1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - - public String getCreatedAt() { - return createdAt; - } - - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - - public Filter1 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * @return updatedAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - - public String getUpdatedAt() { - return updatedAt; - } - - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter1 filter1 = (Filter1) o; - return Objects.equals(this.id, filter1.id) && - Objects.equals(this.sourceId, filter1.sourceId) && - Objects.equals(this.destinationId, filter1.destinationId) && - Objects.equals(this._if, filter1._if) && - Objects.equals(this.actions, filter1.actions) && - Objects.equals(this.title, filter1.title) && - Objects.equals(this.description, filter1.description) && - Objects.equals(this.enabled, filter1.enabled) && - Objects.equals(this.createdAt, filter1.createdAt) && - Objects.equals(this.updatedAt, filter1.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, destinationId, _if, actions, title, description, enabled, createdAt, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Filter1 is not found in the empty JSON string", Filter1.openapiRequiredFields.toString())); + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Filter1 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of this filter's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Filter1 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this filter's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } + Filter1 filter1 = (Filter1) o; + return Objects.equals(this.id, filter1.id) + && Objects.equals(this.sourceId, filter1.sourceId) + && Objects.equals(this.destinationId, filter1.destinationId) + && Objects.equals(this._if, filter1._if) + && Objects.equals(this.actions, filter1.actions) + && Objects.equals(this.title, filter1.title) + && Objects.equals(this.description, filter1.description) + && Objects.equals(this.enabled, filter1.enabled) + && Objects.equals(this.createdAt, filter1.createdAt) + && Objects.equals(this.updatedAt, filter1.updatedAt); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Filter1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + @Override + public int hashCode() { + return Objects.hash( + id, + sourceId, + destinationId, + _if, + actions, + title, + description, + enabled, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Filter1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("destinationId"); + openapiFields.add("if"); + openapiFields.add("actions"); + openapiFields.add("title"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("if"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Filter1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Filter1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Filter1 is not found in the empty JSON" + + " string", + Filter1.openapiRequiredFields.toString())); + } } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updatedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Filter1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Filter1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter1 - * @throws IOException if the JSON string is invalid with respect to Filter1 - */ - public static Filter1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter1.class); - } - - /** - * Convert an instance of Filter1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Filter1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Filter1`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Filter1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `title` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("title").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Filter1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Filter1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Filter1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Filter1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Filter1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Filter1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter1 + * @throws IOException if the JSON string is invalid with respect to Filter1 + */ + public static Filter1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Filter1.class); + } + + /** + * Convert an instance of Filter1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Filter2.java b/src/main/java/com/segment/publicapi/models/Filter2.java index 1bc7325e..9816aabd 100644 --- a/src/main/java/com/segment/publicapi/models/Filter2.java +++ b/src/main/java/com/segment/publicapi/models/Filter2.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,521 +10,553 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationFilterActionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The newly created Destination filter. - */ +/** The newly created Destination filter. */ @ApiModel(description = "The newly created Destination filter.") - public class Filter2 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; - public static final String SERIALIZED_NAME_TITLE = "title"; - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_IF = "if"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_IF) + private String _if; - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public Filter2() { - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); - public Filter2 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_TITLE = "title"; - /** - * The unique id of this filter. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public void setId(String id) { - this.id = id; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public Filter2 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - /** - * The id of the Source associated with this filter. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + public Filter2() {} - public Filter2 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } + public Filter2 id(String id) { - /** - * The id of the Destination associated with this filter. - * @return destinationId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Destination associated with this filter.") + this.id = id; + return this; + } - public String getDestinationId() { - return destinationId; - } + /** + * The unique id of this filter. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The unique id of this filter.") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } + public Filter2 sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public Filter2 _if(String _if) { - - this._if = _if; - return this; - } + /** + * The id of the Source associated with this filter. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public String getSourceId() { + return sourceId; + } - /** - * A condition that defines whether to apply this filter to a payload. - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A condition that defines whether to apply this filter to a payload.") + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public String getIf() { - return _if; - } + public Filter2 destinationId(String destinationId) { + this.destinationId = destinationId; + return this; + } - public void setIf(String _if) { - this._if = _if; - } + /** + * The id of the Destination associated with this filter. + * + * @return destinationId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Destination associated with this filter.") + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + public Filter2 _if(String _if) { - public Filter2 actions(List actions) { - - this.actions = actions; - return this; - } + this._if = _if; + return this; + } - public Filter2 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + /** + * A condition that defines whether to apply this filter to a payload. + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A condition that defines whether to apply this filter to a payload.") + public String getIf() { + return _if; + } - /** - * A list of actions this filter performs. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public void setIf(String _if) { + this._if = _if; + } - public List getActions() { - return actions; - } + public Filter2 actions(List actions) { + this.actions = actions; + return this; + } - public void setActions(List actions) { - this.actions = actions; - } + public Filter2 addActionsItem(DestinationFilterActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } + /** + * A list of actions this filter performs. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public List getActions() { + return actions; + } - public Filter2 title(String title) { - - this.title = title; - return this; - } + public void setActions(List actions) { + this.actions = actions; + } - /** - * A title for this filter. - * @return title - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") + public Filter2 title(String title) { - public String getTitle() { - return title; - } + this.title = title; + return this; + } + /** + * A title for this filter. + * + * @return title + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A title for this filter.") + public String getTitle() { + return title; + } - public void setTitle(String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } + public Filter2 description(String description) { - public Filter2 description(String description) { - - this.description = description; - return this; - } + this.description = description; + return this; + } - /** - * A description for this filter. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") + /** + * A description for this filter. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this filter.") + public String getDescription() { + return description; + } - public String getDescription() { - return description; - } + public void setDescription(String description) { + this.description = description; + } + public Filter2 enabled(Boolean enabled) { - public void setDescription(String description) { - this.description = description; - } + this.enabled = enabled; + return this; + } + /** + * When set to true, this filter is active. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this filter is active.") + public Boolean getEnabled() { + return enabled; + } - public Filter2 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - - public Boolean getEnabled() { - return enabled; - } - - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - - public Filter2 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - - public String getCreatedAt() { - return createdAt; - } - - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - - public Filter2 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * @return updatedAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - - public String getUpdatedAt() { - return updatedAt; - } - - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter2 filter2 = (Filter2) o; - return Objects.equals(this.id, filter2.id) && - Objects.equals(this.sourceId, filter2.sourceId) && - Objects.equals(this.destinationId, filter2.destinationId) && - Objects.equals(this._if, filter2._if) && - Objects.equals(this.actions, filter2.actions) && - Objects.equals(this.title, filter2.title) && - Objects.equals(this.description, filter2.description) && - Objects.equals(this.enabled, filter2.enabled) && - Objects.equals(this.createdAt, filter2.createdAt) && - Objects.equals(this.updatedAt, filter2.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, destinationId, _if, actions, title, description, enabled, createdAt, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter2.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Filter2 is not found in the empty JSON string", Filter2.openapiRequiredFields.toString())); + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Filter2 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of this filter's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Filter2 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this filter's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } + Filter2 filter2 = (Filter2) o; + return Objects.equals(this.id, filter2.id) + && Objects.equals(this.sourceId, filter2.sourceId) + && Objects.equals(this.destinationId, filter2.destinationId) + && Objects.equals(this._if, filter2._if) + && Objects.equals(this.actions, filter2.actions) + && Objects.equals(this.title, filter2.title) + && Objects.equals(this.description, filter2.description) + && Objects.equals(this.enabled, filter2.enabled) + && Objects.equals(this.createdAt, filter2.createdAt) + && Objects.equals(this.updatedAt, filter2.updatedAt); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Filter2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + @Override + public int hashCode() { + return Objects.hash( + id, + sourceId, + destinationId, + _if, + actions, + title, + description, + enabled, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Filter2 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("destinationId"); + openapiFields.add("if"); + openapiFields.add("actions"); + openapiFields.add("title"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("if"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Filter2 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Filter2.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Filter2 is not found in the empty JSON" + + " string", + Filter2.openapiRequiredFields.toString())); + } } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updatedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Filter2.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Filter2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter2 - * @throws IOException if the JSON string is invalid with respect to Filter2 - */ - public static Filter2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter2.class); - } - - /** - * Convert an instance of Filter2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Filter2.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Filter2`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Filter2.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `title` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("title").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Filter2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Filter2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Filter2.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Filter2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Filter2 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Filter2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter2 + * @throws IOException if the JSON string is invalid with respect to Filter2 + */ + public static Filter2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Filter2.class); + } + + /** + * Convert an instance of Filter2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Filter3.java b/src/main/java/com/segment/publicapi/models/Filter3.java index eb7930e3..0cab7a1e 100644 --- a/src/main/java/com/segment/publicapi/models/Filter3.java +++ b/src/main/java/com/segment/publicapi/models/Filter3.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,521 +10,553 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationFilterActionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The updated Destination filter. - */ +/** The updated Destination filter. */ @ApiModel(description = "The updated Destination filter.") - public class Filter3 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; - public static final String SERIALIZED_NAME_IF = "if"; - @SerializedName(SERIALIZED_NAME_IF) - private String _if; + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; - public static final String SERIALIZED_NAME_TITLE = "title"; - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + public static final String SERIALIZED_NAME_IF = "if"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_IF) + private String _if; - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; + public static final String SERIALIZED_NAME_ACTIONS = "actions"; - public Filter3() { - } + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions = new ArrayList<>(); - public Filter3 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_TITLE = "title"; - /** - * The unique id of this filter. - * @return id - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - - public String getId() { - return id; - } + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public void setId(String id) { - this.id = id; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public Filter3 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - /** - * The id of the Source associated with this filter. - * @return sourceId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public String getSourceId() { - return sourceId; - } + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + public Filter3() {} - public Filter3 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } + public Filter3 id(String id) { - /** - * The id of the Destination associated with this filter. - * @return destinationId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Destination associated with this filter.") + this.id = id; + return this; + } - public String getDestinationId() { - return destinationId; - } + /** + * The unique id of this filter. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The unique id of this filter.") + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } + public Filter3 sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } - public Filter3 _if(String _if) { - - this._if = _if; - return this; - } + /** + * The id of the Source associated with this filter. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") + public String getSourceId() { + return sourceId; + } - /** - * A condition that defines whether to apply this filter to a payload. - * @return _if - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A condition that defines whether to apply this filter to a payload.") + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } - public String getIf() { - return _if; - } + public Filter3 destinationId(String destinationId) { + this.destinationId = destinationId; + return this; + } - public void setIf(String _if) { - this._if = _if; - } + /** + * The id of the Destination associated with this filter. + * + * @return destinationId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the Destination associated with this filter.") + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + public Filter3 _if(String _if) { - public Filter3 actions(List actions) { - - this.actions = actions; - return this; - } + this._if = _if; + return this; + } - public Filter3 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } + /** + * A condition that defines whether to apply this filter to a payload. + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A condition that defines whether to apply this filter to a payload.") + public String getIf() { + return _if; + } - /** - * A list of actions this filter performs. - * @return actions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public void setIf(String _if) { + this._if = _if; + } - public List getActions() { - return actions; - } + public Filter3 actions(List actions) { + this.actions = actions; + return this; + } - public void setActions(List actions) { - this.actions = actions; - } + public Filter3 addActionsItem(DestinationFilterActionV1 actionsItem) { + this.actions.add(actionsItem); + return this; + } + /** + * A list of actions this filter performs. + * + * @return actions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of actions this filter performs.") + public List getActions() { + return actions; + } - public Filter3 title(String title) { - - this.title = title; - return this; - } + public void setActions(List actions) { + this.actions = actions; + } - /** - * A title for this filter. - * @return title - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") + public Filter3 title(String title) { - public String getTitle() { - return title; - } + this.title = title; + return this; + } + /** + * A title for this filter. + * + * @return title + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A title for this filter.") + public String getTitle() { + return title; + } - public void setTitle(String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } + public Filter3 description(String description) { - public Filter3 description(String description) { - - this.description = description; - return this; - } + this.description = description; + return this; + } - /** - * A description for this filter. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") + /** + * A description for this filter. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this filter.") + public String getDescription() { + return description; + } - public String getDescription() { - return description; - } + public void setDescription(String description) { + this.description = description; + } + public Filter3 enabled(Boolean enabled) { - public void setDescription(String description) { - this.description = description; - } + this.enabled = enabled; + return this; + } + /** + * When set to true, this filter is active. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this filter is active.") + public Boolean getEnabled() { + return enabled; + } - public Filter3 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - - public Boolean getEnabled() { - return enabled; - } - - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - - public Filter3 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * @return createdAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - - public String getCreatedAt() { - return createdAt; - } - - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - - public Filter3 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * @return updatedAt - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - - public String getUpdatedAt() { - return updatedAt; - } - - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter3 filter3 = (Filter3) o; - return Objects.equals(this.id, filter3.id) && - Objects.equals(this.sourceId, filter3.sourceId) && - Objects.equals(this.destinationId, filter3.destinationId) && - Objects.equals(this._if, filter3._if) && - Objects.equals(this.actions, filter3.actions) && - Objects.equals(this.title, filter3.title) && - Objects.equals(this.description, filter3.description) && - Objects.equals(this.enabled, filter3.enabled) && - Objects.equals(this.createdAt, filter3.createdAt) && - Objects.equals(this.updatedAt, filter3.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, destinationId, _if, actions, title, description, enabled, createdAt, updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter3 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter3 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter3.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Filter3 is not found in the empty JSON string", Filter3.openapiRequiredFields.toString())); + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Filter3 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of this filter's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Filter3 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this filter's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - } + Filter3 filter3 = (Filter3) o; + return Objects.equals(this.id, filter3.id) + && Objects.equals(this.sourceId, filter3.sourceId) + && Objects.equals(this.destinationId, filter3.destinationId) + && Objects.equals(this._if, filter3._if) + && Objects.equals(this.actions, filter3.actions) + && Objects.equals(this.title, filter3.title) + && Objects.equals(this.description, filter3.description) + && Objects.equals(this.enabled, filter3.enabled) + && Objects.equals(this.createdAt, filter3.createdAt) + && Objects.equals(this.updatedAt, filter3.updatedAt); + } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Filter3` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + @Override + public int hashCode() { + return Objects.hash( + id, + sourceId, + destinationId, + _if, + actions, + title, + description, + enabled, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Filter3 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } + return o.toString().replace("\n", "\n "); + } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter3.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("destinationId"); + openapiFields.add("if"); + openapiFields.add("actions"); + openapiFields.add("title"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("if"); + openapiRequiredFields.add("actions"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Filter3 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Filter3.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Filter3 is not found in the empty JSON" + + " string", + Filter3.openapiRequiredFields.toString())); + } } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `if` to be a primitive type in the JSON string but got `%s`", jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `actions` to be an array in the JSON string but got `%s`", jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updatedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter3.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter3' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Filter3.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter3 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter3 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Filter3 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter3 - * @throws IOException if the JSON string is invalid with respect to Filter3 - */ - public static Filter3 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter3.class); - } - - /** - * Convert an instance of Filter3 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Filter3.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Filter3`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Filter3.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("actions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actions` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("actions").toString())); + } + + JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `title` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("title").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Filter3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Filter3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Filter3.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Filter3 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Filter3 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Filter3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter3 + * @throws IOException if the JSON string is invalid with respect to Filter3 + */ + public static Filter3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Filter3.class); + } + + /** + * Convert an instance of Filter3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index e4ff434a..90744e66 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,700 +10,756 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.FunctionSettingV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * A Function object. - */ +/** A Function object. */ @ApiModel(description = "A Function object.") - public class Function { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; - /** - * The Function type. Config API note: equal to `type`. - */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - SOURCE("SOURCE"); + @SerializedName(SERIALIZED_NAME_ID) + private String id; - private String value; + /** The Function type. Config API note: equal to `type`. */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + DESTINATION("DESTINATION"), - ResourceTypeEnum(String value) { - this.value = value; - } + SOURCE("SOURCE"); - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } + ResourceTypeEnum(String value) { + this.value = value; + } - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + public static ResourceTypeEnum fromValue(String value) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private ResourceTypeEnum resourceType; - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; + public static final String SERIALIZED_NAME_CODE = "code"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = null; - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - public Function() { - } + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; - public Function id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - /** - * An identifier for this Function. - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + @SerializedName(SERIALIZED_NAME_LOGO_URL) + private String logoUrl; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; + @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) + private String previewWebhookUrl; - public Function resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } + public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - /** - * The Function type. Config API note: equal to `type`. - * @return resourceType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) + private BigDecimal batchMaxCount; - public ResourceTypeEnum getResourceType() { - return resourceType; - } + public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; + @SerializedName(SERIALIZED_NAME_CATALOG_ID) + private String catalogId; - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } + public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; + @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) + private Boolean isLatestVersion; - public Function createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + public Function() {} - /** - * The time this Function was created. - * @return createdAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") + public Function id(String id) { - public String getCreatedAt() { - return createdAt; - } + this.id = id; + return this; + } + /** + * An identifier for this Function. + * + * @return id + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An identifier for this Function.") + public String getId() { + return id; + } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + public void setId(String id) { + this.id = id; + } + public Function resourceType(ResourceTypeEnum resourceType) { - public Function createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + this.resourceType = resourceType; + return this; + } - /** - * The id of the user who created this Function. - * @return createdBy - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") + /** + * The Function type. Config API note: equal to `type`. + * + * @return resourceType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + public ResourceTypeEnum getResourceType() { + return resourceType; + } - public String getCreatedBy() { - return createdBy; - } + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + public Function createdAt(String createdAt) { - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * The time this Function was created. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time this Function was created.") + public String getCreatedAt() { + return createdAt; + } - public Function code(String code) { - - this.code = code; - return this; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } - /** - * The Function code. - * @return code - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") + public Function createdBy(String createdBy) { - public String getCode() { - return code; - } + this.createdBy = createdBy; + return this; + } + + /** + * The id of the user who created this Function. + * + * @return createdBy + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The id of the user who created this Function.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Function code(String code) { + + this.code = code; + return this; + } + + /** + * The Function code. + * + * @return code + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function code.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Function deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + /** + * The time of this Function's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Function's last deployment.") + public String getDeployedAt() { + return deployedAt; + } - public void setCode(String code) { - this.code = code; - } + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + public Function settings(List settings) { - public Function deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } + this.settings = settings; + return this; + } - /** - * The time of this Function's last deployment. - * @return deployedAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") + public Function addSettingsItem(FunctionSettingV1 settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } - public String getDeployedAt() { - return deployedAt; - } + /** + * The list of settings for this Function. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of settings for this Function.") + public List getSettings() { + return settings; + } + public void setSettings(List settings) { + this.settings = settings; + } - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } + public Function displayName(String displayName) { + this.displayName = displayName; + return this; + } - public Function settings(List settings) { - - this.settings = settings; - return this; - } + /** + * A display name for this Function. + * + * @return displayName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A display name for this Function.") + public String getDisplayName() { + return displayName; + } - public Function addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); + public void setDisplayName(String displayName) { + this.displayName = displayName; } - this.settings.add(settingsItem); - return this; - } - /** - * The list of settings for this Function. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") + public Function description(String description) { - public List getSettings() { - return settings; - } + this.description = description; + return this; + } + /** + * A description for this Function. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this Function.") + public String getDescription() { + return description; + } - public void setSettings(List settings) { - this.settings = settings; - } + public void setDescription(String description) { + this.description = description; + } + public Function logoUrl(String logoUrl) { - public Function displayName(String displayName) { - - this.displayName = displayName; - return this; - } + this.logoUrl = logoUrl; + return this; + } - /** - * A display name for this Function. - * @return displayName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") + /** + * The URL of the logo for this Function. + * + * @return logoUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL of the logo for this Function.") + public String getLogoUrl() { + return logoUrl; + } - public String getDisplayName() { - return displayName; - } + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + public Function previewWebhookUrl(String previewWebhookUrl) { - public void setDisplayName(String displayName) { - this.displayName = displayName; - } + this.previewWebhookUrl = previewWebhookUrl; + return this; + } + /** + * The preview webhook URL for this Function. + * + * @return previewWebhookUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The preview webhook URL for this Function.") + public String getPreviewWebhookUrl() { + return previewWebhookUrl; + } - public Function description(String description) { - - this.description = description; - return this; - } + public void setPreviewWebhookUrl(String previewWebhookUrl) { + this.previewWebhookUrl = previewWebhookUrl; + } - /** - * A description for this Function. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") + public Function batchMaxCount(BigDecimal batchMaxCount) { - public String getDescription() { - return description; - } + this.batchMaxCount = batchMaxCount; + return this; + } + /** + * The max count of the batch for this Function. + * + * @return batchMaxCount + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The max count of the batch for this Function.") + public BigDecimal getBatchMaxCount() { + return batchMaxCount; + } - public void setDescription(String description) { - this.description = description; - } + public void setBatchMaxCount(BigDecimal batchMaxCount) { + this.batchMaxCount = batchMaxCount; + } + public Function catalogId(String catalogId) { - public Function logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } + this.catalogId = catalogId; + return this; + } - /** - * The URL of the logo for this Function. - * @return logoUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") + /** + * The catalog id of this Function. + * + * @return catalogId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The catalog id of this Function.") + public String getCatalogId() { + return catalogId; + } - public String getLogoUrl() { - return logoUrl; - } + public void setCatalogId(String catalogId) { + this.catalogId = catalogId; + } + public Function isLatestVersion(Boolean isLatestVersion) { - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } + this.isLatestVersion = isLatestVersion; + return this; + } + /** + * Whether the deployment of this Function is the latest version. + * + * @return isLatestVersion + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") + public Boolean getIsLatestVersion() { + return isLatestVersion; + } - public Function previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } + public void setIsLatestVersion(Boolean isLatestVersion) { + this.isLatestVersion = isLatestVersion; + } - /** - * The preview webhook URL for this Function. - * @return previewWebhookUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Function function = (Function) o; + return Objects.equals(this.id, function.id) + && Objects.equals(this.resourceType, function.resourceType) + && Objects.equals(this.createdAt, function.createdAt) + && Objects.equals(this.createdBy, function.createdBy) + && Objects.equals(this.code, function.code) + && Objects.equals(this.deployedAt, function.deployedAt) + && Objects.equals(this.settings, function.settings) + && Objects.equals(this.displayName, function.displayName) + && Objects.equals(this.description, function.description) + && Objects.equals(this.logoUrl, function.logoUrl) + && Objects.equals(this.previewWebhookUrl, function.previewWebhookUrl) + && Objects.equals(this.batchMaxCount, function.batchMaxCount) + && Objects.equals(this.catalogId, function.catalogId) + && Objects.equals(this.isLatestVersion, function.isLatestVersion); + } - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash( + id, + resourceType, + createdAt, + createdBy, + code, + deployedAt, + settings, + displayName, + description, + logoUrl, + previewWebhookUrl, + batchMaxCount, + catalogId, + isLatestVersion); + } - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Function {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" previewWebhookUrl: ") + .append(toIndentedString(previewWebhookUrl)) + .append("\n"); + sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); + sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); + sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public Function batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - /** - * The max count of the batch for this Function. - * @return batchMaxCount - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("resourceType"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("code"); + openapiFields.add("deployedAt"); + openapiFields.add("settings"); + openapiFields.add("displayName"); + openapiFields.add("description"); + openapiFields.add("logoUrl"); + openapiFields.add("previewWebhookUrl"); + openapiFields.add("batchMaxCount"); + openapiFields.add("catalogId"); + openapiFields.add("isLatestVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - - public Function catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * @return catalogId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") - - public String getCatalogId() { - return catalogId; - } - - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - - public Function isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * @return isLatestVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") - - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function function = (Function) o; - return Objects.equals(this.id, function.id) && - Objects.equals(this.resourceType, function.resourceType) && - Objects.equals(this.createdAt, function.createdAt) && - Objects.equals(this.createdBy, function.createdBy) && - Objects.equals(this.code, function.code) && - Objects.equals(this.deployedAt, function.deployedAt) && - Objects.equals(this.settings, function.settings) && - Objects.equals(this.displayName, function.displayName) && - Objects.equals(this.description, function.description) && - Objects.equals(this.logoUrl, function.logoUrl) && - Objects.equals(this.previewWebhookUrl, function.previewWebhookUrl) && - Objects.equals(this.batchMaxCount, function.batchMaxCount) && - Objects.equals(this.catalogId, function.catalogId) && - Objects.equals(this.isLatestVersion, function.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, resourceType, createdAt, createdBy, code, deployedAt, settings, displayName, description, logoUrl, previewWebhookUrl, batchMaxCount, catalogId, isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ").append(toIndentedString(previewWebhookUrl)).append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Function - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Function.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Function is not found in the empty JSON string", Function.openapiRequiredFields.toString())); + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Function + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Function.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Function is not found in the empty" + + " JSON string", + Function.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Function.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Function` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Function.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Function`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deployedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); - } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null && !jsonObj.get("previewWebhookUrl").isJsonNull()) && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `previewWebhookUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `catalogId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Function.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Function value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Function given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function - * @throws IOException if the JSON string is invalid with respect to Function - */ - public static Function fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function.class); - } - - /** - * Convert an instance of Function to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) + && !jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) + && !jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `settings` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("settings").toString())); + } + } + } + if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) + && !jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `displayName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if ((jsonObj.get("previewWebhookUrl") != null + && !jsonObj.get("previewWebhookUrl").isJsonNull()) + && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previewWebhookUrl` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("previewWebhookUrl").toString())); + } + if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) + && !jsonObj.get("catalogId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `catalogId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("catalogId").toString())); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Function.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Function' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Function.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Function value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Function read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Function given an JSON string + * + * @param jsonString JSON string + * @return An instance of Function + * @throws IOException if the JSON string is invalid with respect to Function + */ + public static Function fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Function.class); + } + + /** + * Convert an instance of Function to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java index a351abf5..c1ba336d 100644 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ b/src/main/java/com/segment/publicapi/models/Function1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,700 +10,756 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.FunctionSettingV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * A Function object. - */ +/** A Function object. */ @ApiModel(description = "A Function object.") - public class Function1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; - /** - * The Function type. Config API note: equal to `type`. - */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - SOURCE("SOURCE"); + @SerializedName(SERIALIZED_NAME_ID) + private String id; - private String value; + /** The Function type. Config API note: equal to `type`. */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + DESTINATION("DESTINATION"), - ResourceTypeEnum(String value) { - this.value = value; - } + SOURCE("SOURCE"); - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } + ResourceTypeEnum(String value) { + this.value = value; + } - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + public static ResourceTypeEnum fromValue(String value) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private ResourceTypeEnum resourceType; - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; + public static final String SERIALIZED_NAME_CODE = "code"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = null; - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - public Function1() { - } + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; - public Function1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - /** - * An identifier for this Function. - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + @SerializedName(SERIALIZED_NAME_LOGO_URL) + private String logoUrl; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; + @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) + private String previewWebhookUrl; - public Function1 resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } + public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - /** - * The Function type. Config API note: equal to `type`. - * @return resourceType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) + private BigDecimal batchMaxCount; - public ResourceTypeEnum getResourceType() { - return resourceType; - } + public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; + @SerializedName(SERIALIZED_NAME_CATALOG_ID) + private String catalogId; - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } + public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; + @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) + private Boolean isLatestVersion; - public Function1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + public Function1() {} - /** - * The time this Function was created. - * @return createdAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") + public Function1 id(String id) { - public String getCreatedAt() { - return createdAt; - } + this.id = id; + return this; + } + /** + * An identifier for this Function. + * + * @return id + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An identifier for this Function.") + public String getId() { + return id; + } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + public void setId(String id) { + this.id = id; + } + public Function1 resourceType(ResourceTypeEnum resourceType) { - public Function1 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + this.resourceType = resourceType; + return this; + } - /** - * The id of the user who created this Function. - * @return createdBy - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") + /** + * The Function type. Config API note: equal to `type`. + * + * @return resourceType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + public ResourceTypeEnum getResourceType() { + return resourceType; + } - public String getCreatedBy() { - return createdBy; - } + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + public Function1 createdAt(String createdAt) { - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * The time this Function was created. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time this Function was created.") + public String getCreatedAt() { + return createdAt; + } - public Function1 code(String code) { - - this.code = code; - return this; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } - /** - * The Function code. - * @return code - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") + public Function1 createdBy(String createdBy) { - public String getCode() { - return code; - } + this.createdBy = createdBy; + return this; + } + + /** + * The id of the user who created this Function. + * + * @return createdBy + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The id of the user who created this Function.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Function1 code(String code) { + + this.code = code; + return this; + } + + /** + * The Function code. + * + * @return code + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function code.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Function1 deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + /** + * The time of this Function's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Function's last deployment.") + public String getDeployedAt() { + return deployedAt; + } - public void setCode(String code) { - this.code = code; - } + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + public Function1 settings(List settings) { - public Function1 deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } + this.settings = settings; + return this; + } - /** - * The time of this Function's last deployment. - * @return deployedAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") + public Function1 addSettingsItem(FunctionSettingV1 settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } - public String getDeployedAt() { - return deployedAt; - } + /** + * The list of settings for this Function. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of settings for this Function.") + public List getSettings() { + return settings; + } + public void setSettings(List settings) { + this.settings = settings; + } - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } + public Function1 displayName(String displayName) { + this.displayName = displayName; + return this; + } - public Function1 settings(List settings) { - - this.settings = settings; - return this; - } + /** + * A display name for this Function. + * + * @return displayName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A display name for this Function.") + public String getDisplayName() { + return displayName; + } - public Function1 addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); + public void setDisplayName(String displayName) { + this.displayName = displayName; } - this.settings.add(settingsItem); - return this; - } - /** - * The list of settings for this Function. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") + public Function1 description(String description) { - public List getSettings() { - return settings; - } + this.description = description; + return this; + } + /** + * A description for this Function. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this Function.") + public String getDescription() { + return description; + } - public void setSettings(List settings) { - this.settings = settings; - } + public void setDescription(String description) { + this.description = description; + } + public Function1 logoUrl(String logoUrl) { - public Function1 displayName(String displayName) { - - this.displayName = displayName; - return this; - } + this.logoUrl = logoUrl; + return this; + } - /** - * A display name for this Function. - * @return displayName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") + /** + * The URL of the logo for this Function. + * + * @return logoUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL of the logo for this Function.") + public String getLogoUrl() { + return logoUrl; + } - public String getDisplayName() { - return displayName; - } + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + public Function1 previewWebhookUrl(String previewWebhookUrl) { - public void setDisplayName(String displayName) { - this.displayName = displayName; - } + this.previewWebhookUrl = previewWebhookUrl; + return this; + } + /** + * The preview webhook URL for this Function. + * + * @return previewWebhookUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The preview webhook URL for this Function.") + public String getPreviewWebhookUrl() { + return previewWebhookUrl; + } - public Function1 description(String description) { - - this.description = description; - return this; - } + public void setPreviewWebhookUrl(String previewWebhookUrl) { + this.previewWebhookUrl = previewWebhookUrl; + } - /** - * A description for this Function. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") + public Function1 batchMaxCount(BigDecimal batchMaxCount) { - public String getDescription() { - return description; - } + this.batchMaxCount = batchMaxCount; + return this; + } + /** + * The max count of the batch for this Function. + * + * @return batchMaxCount + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The max count of the batch for this Function.") + public BigDecimal getBatchMaxCount() { + return batchMaxCount; + } - public void setDescription(String description) { - this.description = description; - } + public void setBatchMaxCount(BigDecimal batchMaxCount) { + this.batchMaxCount = batchMaxCount; + } + public Function1 catalogId(String catalogId) { - public Function1 logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } + this.catalogId = catalogId; + return this; + } - /** - * The URL of the logo for this Function. - * @return logoUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") + /** + * The catalog id of this Function. + * + * @return catalogId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The catalog id of this Function.") + public String getCatalogId() { + return catalogId; + } - public String getLogoUrl() { - return logoUrl; - } + public void setCatalogId(String catalogId) { + this.catalogId = catalogId; + } + public Function1 isLatestVersion(Boolean isLatestVersion) { - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } + this.isLatestVersion = isLatestVersion; + return this; + } + /** + * Whether the deployment of this Function is the latest version. + * + * @return isLatestVersion + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") + public Boolean getIsLatestVersion() { + return isLatestVersion; + } - public Function1 previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } + public void setIsLatestVersion(Boolean isLatestVersion) { + this.isLatestVersion = isLatestVersion; + } - /** - * The preview webhook URL for this Function. - * @return previewWebhookUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Function1 function1 = (Function1) o; + return Objects.equals(this.id, function1.id) + && Objects.equals(this.resourceType, function1.resourceType) + && Objects.equals(this.createdAt, function1.createdAt) + && Objects.equals(this.createdBy, function1.createdBy) + && Objects.equals(this.code, function1.code) + && Objects.equals(this.deployedAt, function1.deployedAt) + && Objects.equals(this.settings, function1.settings) + && Objects.equals(this.displayName, function1.displayName) + && Objects.equals(this.description, function1.description) + && Objects.equals(this.logoUrl, function1.logoUrl) + && Objects.equals(this.previewWebhookUrl, function1.previewWebhookUrl) + && Objects.equals(this.batchMaxCount, function1.batchMaxCount) + && Objects.equals(this.catalogId, function1.catalogId) + && Objects.equals(this.isLatestVersion, function1.isLatestVersion); + } - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash( + id, + resourceType, + createdAt, + createdBy, + code, + deployedAt, + settings, + displayName, + description, + logoUrl, + previewWebhookUrl, + batchMaxCount, + catalogId, + isLatestVersion); + } - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Function1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" previewWebhookUrl: ") + .append(toIndentedString(previewWebhookUrl)) + .append("\n"); + sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); + sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); + sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public Function1 batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - /** - * The max count of the batch for this Function. - * @return batchMaxCount - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("resourceType"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("code"); + openapiFields.add("deployedAt"); + openapiFields.add("settings"); + openapiFields.add("displayName"); + openapiFields.add("description"); + openapiFields.add("logoUrl"); + openapiFields.add("previewWebhookUrl"); + openapiFields.add("batchMaxCount"); + openapiFields.add("catalogId"); + openapiFields.add("isLatestVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - - public Function1 catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * @return catalogId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") - - public String getCatalogId() { - return catalogId; - } - - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - - public Function1 isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * @return isLatestVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") - - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function1 function1 = (Function1) o; - return Objects.equals(this.id, function1.id) && - Objects.equals(this.resourceType, function1.resourceType) && - Objects.equals(this.createdAt, function1.createdAt) && - Objects.equals(this.createdBy, function1.createdBy) && - Objects.equals(this.code, function1.code) && - Objects.equals(this.deployedAt, function1.deployedAt) && - Objects.equals(this.settings, function1.settings) && - Objects.equals(this.displayName, function1.displayName) && - Objects.equals(this.description, function1.description) && - Objects.equals(this.logoUrl, function1.logoUrl) && - Objects.equals(this.previewWebhookUrl, function1.previewWebhookUrl) && - Objects.equals(this.batchMaxCount, function1.batchMaxCount) && - Objects.equals(this.catalogId, function1.catalogId) && - Objects.equals(this.isLatestVersion, function1.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, resourceType, createdAt, createdBy, code, deployedAt, settings, displayName, description, logoUrl, previewWebhookUrl, batchMaxCount, catalogId, isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ").append(toIndentedString(previewWebhookUrl)).append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Function1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Function1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Function1 is not found in the empty JSON string", Function1.openapiRequiredFields.toString())); + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Function1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Function1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Function1 is not found in the empty" + + " JSON string", + Function1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Function1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Function1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Function1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Function1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deployedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); - } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null && !jsonObj.get("previewWebhookUrl").isJsonNull()) && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `previewWebhookUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `catalogId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Function1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Function1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Function1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function1 - * @throws IOException if the JSON string is invalid with respect to Function1 - */ - public static Function1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function1.class); - } - - /** - * Convert an instance of Function1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) + && !jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) + && !jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `settings` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("settings").toString())); + } + } + } + if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) + && !jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `displayName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if ((jsonObj.get("previewWebhookUrl") != null + && !jsonObj.get("previewWebhookUrl").isJsonNull()) + && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previewWebhookUrl` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("previewWebhookUrl").toString())); + } + if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) + && !jsonObj.get("catalogId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `catalogId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("catalogId").toString())); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Function1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Function1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Function1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Function1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Function1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Function1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Function1 + * @throws IOException if the JSON string is invalid with respect to Function1 + */ + public static Function1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Function1.class); + } + + /** + * Convert an instance of Function1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java index 68a53f10..02352bca 100644 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ b/src/main/java/com/segment/publicapi/models/Function2.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,700 +10,756 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.FunctionSettingV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * The updated Function object. - */ +/** The updated Function object. */ @ApiModel(description = "The updated Function object.") - public class Function2 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; - /** - * The Function type. Config API note: equal to `type`. - */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - SOURCE("SOURCE"); + @SerializedName(SERIALIZED_NAME_ID) + private String id; - private String value; + /** The Function type. Config API note: equal to `type`. */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + DESTINATION("DESTINATION"), - ResourceTypeEnum(String value) { - this.value = value; - } + SOURCE("SOURCE"); - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } + ResourceTypeEnum(String value) { + this.value = value; + } - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + public static ResourceTypeEnum fromValue(String value) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private ResourceTypeEnum resourceType; - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; + public static final String SERIALIZED_NAME_CODE = "code"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = null; - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - public Function2() { - } + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; - public Function2 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - /** - * An identifier for this Function. - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + @SerializedName(SERIALIZED_NAME_LOGO_URL) + private String logoUrl; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; + @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) + private String previewWebhookUrl; - public Function2 resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } + public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - /** - * The Function type. Config API note: equal to `type`. - * @return resourceType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) + private BigDecimal batchMaxCount; - public ResourceTypeEnum getResourceType() { - return resourceType; - } + public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; + @SerializedName(SERIALIZED_NAME_CATALOG_ID) + private String catalogId; - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } + public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; + @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) + private Boolean isLatestVersion; - public Function2 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + public Function2() {} - /** - * The time this Function was created. - * @return createdAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") + public Function2 id(String id) { - public String getCreatedAt() { - return createdAt; - } + this.id = id; + return this; + } + /** + * An identifier for this Function. + * + * @return id + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An identifier for this Function.") + public String getId() { + return id; + } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + public void setId(String id) { + this.id = id; + } + public Function2 resourceType(ResourceTypeEnum resourceType) { - public Function2 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + this.resourceType = resourceType; + return this; + } - /** - * The id of the user who created this Function. - * @return createdBy - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") + /** + * The Function type. Config API note: equal to `type`. + * + * @return resourceType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + public ResourceTypeEnum getResourceType() { + return resourceType; + } - public String getCreatedBy() { - return createdBy; - } + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + public Function2 createdAt(String createdAt) { - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * The time this Function was created. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time this Function was created.") + public String getCreatedAt() { + return createdAt; + } - public Function2 code(String code) { - - this.code = code; - return this; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } - /** - * The Function code. - * @return code - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") + public Function2 createdBy(String createdBy) { - public String getCode() { - return code; - } + this.createdBy = createdBy; + return this; + } + + /** + * The id of the user who created this Function. + * + * @return createdBy + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The id of the user who created this Function.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Function2 code(String code) { + + this.code = code; + return this; + } + + /** + * The Function code. + * + * @return code + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function code.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Function2 deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + /** + * The time of this Function's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Function's last deployment.") + public String getDeployedAt() { + return deployedAt; + } - public void setCode(String code) { - this.code = code; - } + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + public Function2 settings(List settings) { - public Function2 deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } + this.settings = settings; + return this; + } - /** - * The time of this Function's last deployment. - * @return deployedAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") + public Function2 addSettingsItem(FunctionSettingV1 settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } - public String getDeployedAt() { - return deployedAt; - } + /** + * The list of settings for this Function. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of settings for this Function.") + public List getSettings() { + return settings; + } + public void setSettings(List settings) { + this.settings = settings; + } - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } + public Function2 displayName(String displayName) { + this.displayName = displayName; + return this; + } - public Function2 settings(List settings) { - - this.settings = settings; - return this; - } + /** + * A display name for this Function. + * + * @return displayName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A display name for this Function.") + public String getDisplayName() { + return displayName; + } - public Function2 addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); + public void setDisplayName(String displayName) { + this.displayName = displayName; } - this.settings.add(settingsItem); - return this; - } - /** - * The list of settings for this Function. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") + public Function2 description(String description) { - public List getSettings() { - return settings; - } + this.description = description; + return this; + } + /** + * A description for this Function. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this Function.") + public String getDescription() { + return description; + } - public void setSettings(List settings) { - this.settings = settings; - } + public void setDescription(String description) { + this.description = description; + } + public Function2 logoUrl(String logoUrl) { - public Function2 displayName(String displayName) { - - this.displayName = displayName; - return this; - } + this.logoUrl = logoUrl; + return this; + } - /** - * A display name for this Function. - * @return displayName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") + /** + * The URL of the logo for this Function. + * + * @return logoUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL of the logo for this Function.") + public String getLogoUrl() { + return logoUrl; + } - public String getDisplayName() { - return displayName; - } + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + public Function2 previewWebhookUrl(String previewWebhookUrl) { - public void setDisplayName(String displayName) { - this.displayName = displayName; - } + this.previewWebhookUrl = previewWebhookUrl; + return this; + } + /** + * The preview webhook URL for this Function. + * + * @return previewWebhookUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The preview webhook URL for this Function.") + public String getPreviewWebhookUrl() { + return previewWebhookUrl; + } - public Function2 description(String description) { - - this.description = description; - return this; - } + public void setPreviewWebhookUrl(String previewWebhookUrl) { + this.previewWebhookUrl = previewWebhookUrl; + } - /** - * A description for this Function. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") + public Function2 batchMaxCount(BigDecimal batchMaxCount) { - public String getDescription() { - return description; - } + this.batchMaxCount = batchMaxCount; + return this; + } + /** + * The max count of the batch for this Function. + * + * @return batchMaxCount + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The max count of the batch for this Function.") + public BigDecimal getBatchMaxCount() { + return batchMaxCount; + } - public void setDescription(String description) { - this.description = description; - } + public void setBatchMaxCount(BigDecimal batchMaxCount) { + this.batchMaxCount = batchMaxCount; + } + public Function2 catalogId(String catalogId) { - public Function2 logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } + this.catalogId = catalogId; + return this; + } - /** - * The URL of the logo for this Function. - * @return logoUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") + /** + * The catalog id of this Function. + * + * @return catalogId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The catalog id of this Function.") + public String getCatalogId() { + return catalogId; + } - public String getLogoUrl() { - return logoUrl; - } + public void setCatalogId(String catalogId) { + this.catalogId = catalogId; + } + public Function2 isLatestVersion(Boolean isLatestVersion) { - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } + this.isLatestVersion = isLatestVersion; + return this; + } + /** + * Whether the deployment of this Function is the latest version. + * + * @return isLatestVersion + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") + public Boolean getIsLatestVersion() { + return isLatestVersion; + } - public Function2 previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } + public void setIsLatestVersion(Boolean isLatestVersion) { + this.isLatestVersion = isLatestVersion; + } - /** - * The preview webhook URL for this Function. - * @return previewWebhookUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Function2 function2 = (Function2) o; + return Objects.equals(this.id, function2.id) + && Objects.equals(this.resourceType, function2.resourceType) + && Objects.equals(this.createdAt, function2.createdAt) + && Objects.equals(this.createdBy, function2.createdBy) + && Objects.equals(this.code, function2.code) + && Objects.equals(this.deployedAt, function2.deployedAt) + && Objects.equals(this.settings, function2.settings) + && Objects.equals(this.displayName, function2.displayName) + && Objects.equals(this.description, function2.description) + && Objects.equals(this.logoUrl, function2.logoUrl) + && Objects.equals(this.previewWebhookUrl, function2.previewWebhookUrl) + && Objects.equals(this.batchMaxCount, function2.batchMaxCount) + && Objects.equals(this.catalogId, function2.catalogId) + && Objects.equals(this.isLatestVersion, function2.isLatestVersion); + } - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash( + id, + resourceType, + createdAt, + createdBy, + code, + deployedAt, + settings, + displayName, + description, + logoUrl, + previewWebhookUrl, + batchMaxCount, + catalogId, + isLatestVersion); + } - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Function2 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" previewWebhookUrl: ") + .append(toIndentedString(previewWebhookUrl)) + .append("\n"); + sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); + sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); + sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public Function2 batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - /** - * The max count of the batch for this Function. - * @return batchMaxCount - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("resourceType"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("code"); + openapiFields.add("deployedAt"); + openapiFields.add("settings"); + openapiFields.add("displayName"); + openapiFields.add("description"); + openapiFields.add("logoUrl"); + openapiFields.add("previewWebhookUrl"); + openapiFields.add("batchMaxCount"); + openapiFields.add("catalogId"); + openapiFields.add("isLatestVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - - public Function2 catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * @return catalogId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") - - public String getCatalogId() { - return catalogId; - } - - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - - public Function2 isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * @return isLatestVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") - - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function2 function2 = (Function2) o; - return Objects.equals(this.id, function2.id) && - Objects.equals(this.resourceType, function2.resourceType) && - Objects.equals(this.createdAt, function2.createdAt) && - Objects.equals(this.createdBy, function2.createdBy) && - Objects.equals(this.code, function2.code) && - Objects.equals(this.deployedAt, function2.deployedAt) && - Objects.equals(this.settings, function2.settings) && - Objects.equals(this.displayName, function2.displayName) && - Objects.equals(this.description, function2.description) && - Objects.equals(this.logoUrl, function2.logoUrl) && - Objects.equals(this.previewWebhookUrl, function2.previewWebhookUrl) && - Objects.equals(this.batchMaxCount, function2.batchMaxCount) && - Objects.equals(this.catalogId, function2.catalogId) && - Objects.equals(this.isLatestVersion, function2.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, resourceType, createdAt, createdBy, code, deployedAt, settings, displayName, description, logoUrl, previewWebhookUrl, batchMaxCount, catalogId, isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ").append(toIndentedString(previewWebhookUrl)).append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Function2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Function2.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Function2 is not found in the empty JSON string", Function2.openapiRequiredFields.toString())); + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Function2 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Function2.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Function2 is not found in the empty" + + " JSON string", + Function2.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Function2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Function2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Function2.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Function2` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deployedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); - } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null && !jsonObj.get("previewWebhookUrl").isJsonNull()) && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `previewWebhookUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `catalogId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Function2.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Function2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Function2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function2 - * @throws IOException if the JSON string is invalid with respect to Function2 - */ - public static Function2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function2.class); - } - - /** - * Convert an instance of Function2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) + && !jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) + && !jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `settings` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("settings").toString())); + } + } + } + if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) + && !jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `displayName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if ((jsonObj.get("previewWebhookUrl") != null + && !jsonObj.get("previewWebhookUrl").isJsonNull()) + && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previewWebhookUrl` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("previewWebhookUrl").toString())); + } + if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) + && !jsonObj.get("catalogId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `catalogId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("catalogId").toString())); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Function2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Function2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Function2.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Function2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Function2 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Function2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Function2 + * @throws IOException if the JSON string is invalid with respect to Function2 + */ + public static Function2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Function2.class); + } + + /** + * Convert an instance of Function2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java index 2d7a82f6..e49f77b0 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java +++ b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,253 +10,248 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The status of the operation. - */ +/** The status of the operation. */ @ApiModel(description = "The status of the operation.") - public class FunctionDeployment { - /** - * Gets or Sets status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); + /** Gets or Sets status */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); - private String value; + private String value; - StatusEnum(String value) { - this.value = value; - } + StatusEnum(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @Override + public String toString() { + return String.valueOf(value); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_STATUS = "status"; - public FunctionDeployment() { - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public FunctionDeployment status(StatusEnum status) { - - this.status = status; - return this; - } + public FunctionDeployment() {} - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public FunctionDeployment status(StatusEnum status) { - public StatusEnum getStatus() { - return status; - } + this.status = status; + return this; + } + /** + * Get status + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public StatusEnum getStatus() { + return status; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionDeployment functionDeployment = (FunctionDeployment) o; + return Objects.equals(this.status, functionDeployment.status); + } + @Override + public int hashCode() { + return Objects.hash(status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionDeployment {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - FunctionDeployment functionDeployment = (FunctionDeployment) o; - return Objects.equals(this.status, functionDeployment.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionDeployment {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FunctionDeployment - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!FunctionDeployment.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FunctionDeployment is not found in the empty JSON string", FunctionDeployment.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FunctionDeployment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FunctionDeployment.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FunctionDeployment is not found in the" + + " empty JSON string", + FunctionDeployment.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!FunctionDeployment.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FunctionDeployment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FunctionDeployment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FunctionDeployment` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionDeployment.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionDeployment.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionDeployment.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionDeployment' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionDeployment.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionDeployment value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FunctionDeployment read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of FunctionDeployment given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionDeployment - * @throws IOException if the JSON string is invalid with respect to FunctionDeployment - */ - public static FunctionDeployment fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionDeployment.class); - } - - /** - * Convert an instance of FunctionDeployment to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionDeployment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionDeployment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FunctionDeployment.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionDeployment value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FunctionDeployment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionDeployment given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionDeployment + * @throws IOException if the JSON string is invalid with respect to FunctionDeployment + */ + public static FunctionDeployment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionDeployment.class); + } + + /** + * Convert an instance of FunctionDeployment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index a81fc488..04239fea 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,422 +10,425 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** FunctionSettingV1 */ +public class FunctionSettingV1 { + public static final String SERIALIZED_NAME_NAME = "name"; -/** - * FunctionSettingV1 - */ + @SerializedName(SERIALIZED_NAME_NAME) + private String name; -public class FunctionSettingV1 { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private String label; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - /** - * The Function type. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ARRAY("ARRAY"), - - BOOLEAN("BOOLEAN"), - - STRING("STRING"), - - TEXT_MAP("TEXT_MAP"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_LABEL = "label"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } + /** The Function type. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ARRAY("ARRAY"), - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + BOOLEAN("BOOLEAN"), - public static final String SERIALIZED_NAME_REQUIRED = "required"; - @SerializedName(SERIALIZED_NAME_REQUIRED) - private Boolean required; + STRING("STRING"), - public static final String SERIALIZED_NAME_SENSITIVE = "sensitive"; - @SerializedName(SERIALIZED_NAME_SENSITIVE) - private Boolean sensitive; + TEXT_MAP("TEXT_MAP"); - public FunctionSettingV1() { - } + private String value; - public FunctionSettingV1 name(String name) { - - this.name = name; - return this; - } + TypeEnum(String value) { + this.value = value; + } - /** - * The name of this Function. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this Function.") + public String getValue() { + return value; + } - public String getName() { - return name; - } + @Override + public String toString() { + return String.valueOf(value); + } + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public void setName(String name) { - this.name = name; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_TYPE = "type"; - public FunctionSettingV1 label(String label) { - - this.label = label; - return this; - } + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; - /** - * The label for this Function. - * @return label - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The label for this Function.") + public static final String SERIALIZED_NAME_REQUIRED = "required"; - public String getLabel() { - return label; - } + @SerializedName(SERIALIZED_NAME_REQUIRED) + private Boolean required; + public static final String SERIALIZED_NAME_SENSITIVE = "sensitive"; - public void setLabel(String label) { - this.label = label; - } + @SerializedName(SERIALIZED_NAME_SENSITIVE) + private Boolean sensitive; + public FunctionSettingV1() {} - public FunctionSettingV1 description(String description) { - - this.description = description; - return this; - } + public FunctionSettingV1 name(String name) { - /** - * A description of this Function. - * @return description - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A description of this Function.") + this.name = name; + return this; + } - public String getDescription() { - return description; - } + /** + * The name of this Function. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of this Function.") + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } - public void setDescription(String description) { - this.description = description; - } + public FunctionSettingV1 label(String label) { + this.label = label; + return this; + } - public FunctionSettingV1 type(TypeEnum type) { - - this.type = type; - return this; - } + /** + * The label for this Function. + * + * @return label + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The label for this Function.") + public String getLabel() { + return label; + } - /** - * The Function type. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Function type.") + public void setLabel(String label) { + this.label = label; + } - public TypeEnum getType() { - return type; - } + public FunctionSettingV1 description(String description) { + this.description = description; + return this; + } - public void setType(TypeEnum type) { - this.type = type; - } + /** + * A description of this Function. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A description of this Function.") + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } - public FunctionSettingV1 required(Boolean required) { - - this.required = required; - return this; - } + public FunctionSettingV1 type(TypeEnum type) { - /** - * Whether this Function is required. - * @return required - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this Function is required.") + this.type = type; + return this; + } - public Boolean getRequired() { - return required; - } + /** + * The Function type. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Function type.") + public TypeEnum getType() { + return type; + } + public void setType(TypeEnum type) { + this.type = type; + } - public void setRequired(Boolean required) { - this.required = required; - } + public FunctionSettingV1 required(Boolean required) { + this.required = required; + return this; + } - public FunctionSettingV1 sensitive(Boolean sensitive) { - - this.sensitive = sensitive; - return this; - } + /** + * Whether this Function is required. + * + * @return required + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Whether this Function is required.") + public Boolean getRequired() { + return required; + } - /** - * Whether this Function contains sensitive information. - * @return sensitive - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this Function contains sensitive information.") + public void setRequired(Boolean required) { + this.required = required; + } - public Boolean getSensitive() { - return sensitive; - } + public FunctionSettingV1 sensitive(Boolean sensitive) { + this.sensitive = sensitive; + return this; + } - public void setSensitive(Boolean sensitive) { - this.sensitive = sensitive; - } + /** + * Whether this Function contains sensitive information. + * + * @return sensitive + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether this Function contains sensitive information.") + public Boolean getSensitive() { + return sensitive; + } + public void setSensitive(Boolean sensitive) { + this.sensitive = sensitive; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionSettingV1 functionSettingV1 = (FunctionSettingV1) o; + return Objects.equals(this.name, functionSettingV1.name) + && Objects.equals(this.label, functionSettingV1.label) + && Objects.equals(this.description, functionSettingV1.description) + && Objects.equals(this.type, functionSettingV1.type) + && Objects.equals(this.required, functionSettingV1.required) + && Objects.equals(this.sensitive, functionSettingV1.sensitive); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public int hashCode() { + return Objects.hash(name, label, description, type, required, sensitive); } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionSettingV1 {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" sensitive: ").append(toIndentedString(sensitive)).append("\n"); + sb.append("}"); + return sb.toString(); } - FunctionSettingV1 functionSettingV1 = (FunctionSettingV1) o; - return Objects.equals(this.name, functionSettingV1.name) && - Objects.equals(this.label, functionSettingV1.label) && - Objects.equals(this.description, functionSettingV1.description) && - Objects.equals(this.type, functionSettingV1.type) && - Objects.equals(this.required, functionSettingV1.required) && - Objects.equals(this.sensitive, functionSettingV1.sensitive); - } - - @Override - public int hashCode() { - return Objects.hash(name, label, description, type, required, sensitive); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionSettingV1 {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" sensitive: ").append(toIndentedString(sensitive)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("label"); + openapiFields.add("description"); + openapiFields.add("type"); + openapiFields.add("required"); + openapiFields.add("sensitive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("label"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("required"); + openapiRequiredFields.add("sensitive"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("label"); - openapiFields.add("description"); - openapiFields.add("type"); - openapiFields.add("required"); - openapiFields.add("sensitive"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("label"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("required"); - openapiRequiredFields.add("sensitive"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FunctionSettingV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!FunctionSettingV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FunctionSettingV1 is not found in the empty JSON string", FunctionSettingV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FunctionSettingV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FunctionSettingV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FunctionSettingV1 is not found in the" + + " empty JSON string", + FunctionSettingV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!FunctionSettingV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FunctionSettingV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FunctionSettingV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FunctionSettingV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FunctionSettingV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FunctionSettingV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("label").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `label` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("label").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionSettingV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionSettingV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FunctionSettingV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionSettingV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FunctionSettingV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("label").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("label").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionSettingV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionSettingV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionSettingV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionSettingV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FunctionSettingV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of FunctionSettingV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionSettingV1 - * @throws IOException if the JSON string is invalid with respect to FunctionSettingV1 - */ - public static FunctionSettingV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionSettingV1.class); - } - - /** - * Convert an instance of FunctionSettingV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of FunctionSettingV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionSettingV1 + * @throws IOException if the JSON string is invalid with respect to FunctionSettingV1 + */ + public static FunctionSettingV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionSettingV1.class); + } + + /** + * Convert an instance of FunctionSettingV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index b17078fe..0c8d3040 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,700 +10,756 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.FunctionSettingV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * Represents a Function. - */ +/** Represents a Function. */ @ApiModel(description = "Represents a Function.") - public class FunctionV1 { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_ID = "id"; - /** - * The Function type. Config API note: equal to `type`. - */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - SOURCE("SOURCE"); + @SerializedName(SERIALIZED_NAME_ID) + private String id; - private String value; + /** The Function type. Config API note: equal to `type`. */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + DESTINATION("DESTINATION"), - ResourceTypeEnum(String value) { - this.value = value; - } + SOURCE("SOURCE"); - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } + ResourceTypeEnum(String value) { + this.value = value; + } - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + public static ResourceTypeEnum fromValue(String value) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private ResourceTypeEnum resourceType; - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; + public static final String SERIALIZED_NAME_CODE = "code"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; + public static final String SERIALIZED_NAME_SETTINGS = "settings"; - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = null; - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - public FunctionV1() { - } + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; - public FunctionV1 id(String id) { - - this.id = id; - return this; - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - /** - * An identifier for this Function. - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public String getId() { - return id; - } + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + @SerializedName(SERIALIZED_NAME_LOGO_URL) + private String logoUrl; - public void setId(String id) { - this.id = id; - } + public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; + @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) + private String previewWebhookUrl; - public FunctionV1 resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } + public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - /** - * The Function type. Config API note: equal to `type`. - * @return resourceType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) + private BigDecimal batchMaxCount; - public ResourceTypeEnum getResourceType() { - return resourceType; - } + public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; + @SerializedName(SERIALIZED_NAME_CATALOG_ID) + private String catalogId; - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } + public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; + @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) + private Boolean isLatestVersion; - public FunctionV1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } + public FunctionV1() {} - /** - * The time this Function was created. - * @return createdAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") + public FunctionV1 id(String id) { - public String getCreatedAt() { - return createdAt; - } + this.id = id; + return this; + } + /** + * An identifier for this Function. + * + * @return id + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An identifier for this Function.") + public String getId() { + return id; + } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } + public void setId(String id) { + this.id = id; + } + public FunctionV1 resourceType(ResourceTypeEnum resourceType) { - public FunctionV1 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } + this.resourceType = resourceType; + return this; + } - /** - * The id of the user who created this Function. - * @return createdBy - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") + /** + * The Function type. Config API note: equal to `type`. + * + * @return resourceType + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") + public ResourceTypeEnum getResourceType() { + return resourceType; + } - public String getCreatedBy() { - return createdBy; - } + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + public FunctionV1 createdAt(String createdAt) { - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } + this.createdAt = createdAt; + return this; + } + /** + * The time this Function was created. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time this Function was created.") + public String getCreatedAt() { + return createdAt; + } - public FunctionV1 code(String code) { - - this.code = code; - return this; - } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } - /** - * The Function code. - * @return code - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") + public FunctionV1 createdBy(String createdBy) { - public String getCode() { - return code; - } + this.createdBy = createdBy; + return this; + } + + /** + * The id of the user who created this Function. + * + * @return createdBy + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The id of the user who created this Function.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public FunctionV1 code(String code) { + + this.code = code; + return this; + } + + /** + * The Function code. + * + * @return code + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Function code.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public FunctionV1 deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + /** + * The time of this Function's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Function's last deployment.") + public String getDeployedAt() { + return deployedAt; + } - public void setCode(String code) { - this.code = code; - } + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + public FunctionV1 settings(List settings) { - public FunctionV1 deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } + this.settings = settings; + return this; + } - /** - * The time of this Function's last deployment. - * @return deployedAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") + public FunctionV1 addSettingsItem(FunctionSettingV1 settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } - public String getDeployedAt() { - return deployedAt; - } + /** + * The list of settings for this Function. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of settings for this Function.") + public List getSettings() { + return settings; + } + public void setSettings(List settings) { + this.settings = settings; + } - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } + public FunctionV1 displayName(String displayName) { + this.displayName = displayName; + return this; + } - public FunctionV1 settings(List settings) { - - this.settings = settings; - return this; - } + /** + * A display name for this Function. + * + * @return displayName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A display name for this Function.") + public String getDisplayName() { + return displayName; + } - public FunctionV1 addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); + public void setDisplayName(String displayName) { + this.displayName = displayName; } - this.settings.add(settingsItem); - return this; - } - /** - * The list of settings for this Function. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") + public FunctionV1 description(String description) { - public List getSettings() { - return settings; - } + this.description = description; + return this; + } + /** + * A description for this Function. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A description for this Function.") + public String getDescription() { + return description; + } - public void setSettings(List settings) { - this.settings = settings; - } + public void setDescription(String description) { + this.description = description; + } + public FunctionV1 logoUrl(String logoUrl) { - public FunctionV1 displayName(String displayName) { - - this.displayName = displayName; - return this; - } + this.logoUrl = logoUrl; + return this; + } - /** - * A display name for this Function. - * @return displayName - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") + /** + * The URL of the logo for this Function. + * + * @return logoUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The URL of the logo for this Function.") + public String getLogoUrl() { + return logoUrl; + } - public String getDisplayName() { - return displayName; - } + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + public FunctionV1 previewWebhookUrl(String previewWebhookUrl) { - public void setDisplayName(String displayName) { - this.displayName = displayName; - } + this.previewWebhookUrl = previewWebhookUrl; + return this; + } + /** + * The preview webhook URL for this Function. + * + * @return previewWebhookUrl + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The preview webhook URL for this Function.") + public String getPreviewWebhookUrl() { + return previewWebhookUrl; + } - public FunctionV1 description(String description) { - - this.description = description; - return this; - } + public void setPreviewWebhookUrl(String previewWebhookUrl) { + this.previewWebhookUrl = previewWebhookUrl; + } - /** - * A description for this Function. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") + public FunctionV1 batchMaxCount(BigDecimal batchMaxCount) { - public String getDescription() { - return description; - } + this.batchMaxCount = batchMaxCount; + return this; + } + /** + * The max count of the batch for this Function. + * + * @return batchMaxCount + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The max count of the batch for this Function.") + public BigDecimal getBatchMaxCount() { + return batchMaxCount; + } - public void setDescription(String description) { - this.description = description; - } + public void setBatchMaxCount(BigDecimal batchMaxCount) { + this.batchMaxCount = batchMaxCount; + } + public FunctionV1 catalogId(String catalogId) { - public FunctionV1 logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } + this.catalogId = catalogId; + return this; + } - /** - * The URL of the logo for this Function. - * @return logoUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") + /** + * The catalog id of this Function. + * + * @return catalogId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The catalog id of this Function.") + public String getCatalogId() { + return catalogId; + } - public String getLogoUrl() { - return logoUrl; - } + public void setCatalogId(String catalogId) { + this.catalogId = catalogId; + } + public FunctionV1 isLatestVersion(Boolean isLatestVersion) { - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } + this.isLatestVersion = isLatestVersion; + return this; + } + /** + * Whether the deployment of this Function is the latest version. + * + * @return isLatestVersion + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") + public Boolean getIsLatestVersion() { + return isLatestVersion; + } - public FunctionV1 previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } + public void setIsLatestVersion(Boolean isLatestVersion) { + this.isLatestVersion = isLatestVersion; + } - /** - * The preview webhook URL for this Function. - * @return previewWebhookUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FunctionV1 functionV1 = (FunctionV1) o; + return Objects.equals(this.id, functionV1.id) + && Objects.equals(this.resourceType, functionV1.resourceType) + && Objects.equals(this.createdAt, functionV1.createdAt) + && Objects.equals(this.createdBy, functionV1.createdBy) + && Objects.equals(this.code, functionV1.code) + && Objects.equals(this.deployedAt, functionV1.deployedAt) + && Objects.equals(this.settings, functionV1.settings) + && Objects.equals(this.displayName, functionV1.displayName) + && Objects.equals(this.description, functionV1.description) + && Objects.equals(this.logoUrl, functionV1.logoUrl) + && Objects.equals(this.previewWebhookUrl, functionV1.previewWebhookUrl) + && Objects.equals(this.batchMaxCount, functionV1.batchMaxCount) + && Objects.equals(this.catalogId, functionV1.catalogId) + && Objects.equals(this.isLatestVersion, functionV1.isLatestVersion); + } - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash( + id, + resourceType, + createdAt, + createdBy, + code, + deployedAt, + settings, + displayName, + description, + logoUrl, + previewWebhookUrl, + batchMaxCount, + catalogId, + isLatestVersion); + } - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FunctionV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" previewWebhookUrl: ") + .append(toIndentedString(previewWebhookUrl)) + .append("\n"); + sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); + sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); + sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } - public FunctionV1 batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } - /** - * The max count of the batch for this Function. - * @return batchMaxCount - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("resourceType"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("code"); + openapiFields.add("deployedAt"); + openapiFields.add("settings"); + openapiFields.add("displayName"); + openapiFields.add("description"); + openapiFields.add("logoUrl"); + openapiFields.add("previewWebhookUrl"); + openapiFields.add("batchMaxCount"); + openapiFields.add("catalogId"); + openapiFields.add("isLatestVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - - public FunctionV1 catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * @return catalogId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") - - public String getCatalogId() { - return catalogId; - } - - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - - public FunctionV1 isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * @return isLatestVersion - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") - - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FunctionV1 functionV1 = (FunctionV1) o; - return Objects.equals(this.id, functionV1.id) && - Objects.equals(this.resourceType, functionV1.resourceType) && - Objects.equals(this.createdAt, functionV1.createdAt) && - Objects.equals(this.createdBy, functionV1.createdBy) && - Objects.equals(this.code, functionV1.code) && - Objects.equals(this.deployedAt, functionV1.deployedAt) && - Objects.equals(this.settings, functionV1.settings) && - Objects.equals(this.displayName, functionV1.displayName) && - Objects.equals(this.description, functionV1.description) && - Objects.equals(this.logoUrl, functionV1.logoUrl) && - Objects.equals(this.previewWebhookUrl, functionV1.previewWebhookUrl) && - Objects.equals(this.batchMaxCount, functionV1.batchMaxCount) && - Objects.equals(this.catalogId, functionV1.catalogId) && - Objects.equals(this.isLatestVersion, functionV1.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, resourceType, createdAt, createdBy, code, deployedAt, settings, displayName, description, logoUrl, previewWebhookUrl, batchMaxCount, catalogId, isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FunctionV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ").append(toIndentedString(previewWebhookUrl)).append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FunctionV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!FunctionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FunctionV1 is not found in the empty JSON string", FunctionV1.openapiRequiredFields.toString())); + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FunctionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FunctionV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FunctionV1 is not found in the empty" + + " JSON string", + FunctionV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!FunctionV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FunctionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FunctionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FunctionV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deployedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); - } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null && !jsonObj.get("previewWebhookUrl").isJsonNull()) && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `previewWebhookUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `catalogId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FunctionV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FunctionV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FunctionV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FunctionV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FunctionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FunctionV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of FunctionV1 - * @throws IOException if the JSON string is invalid with respect to FunctionV1 - */ - public static FunctionV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FunctionV1.class); - } - - /** - * Convert an instance of FunctionV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) + && !jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) + && !jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `settings` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("settings").toString())); + } + } + } + if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) + && !jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `displayName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if ((jsonObj.get("previewWebhookUrl") != null + && !jsonObj.get("previewWebhookUrl").isJsonNull()) + && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previewWebhookUrl` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("previewWebhookUrl").toString())); + } + if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) + && !jsonObj.get("catalogId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `catalogId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("catalogId").toString())); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FunctionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FunctionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FunctionV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FunctionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FunctionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FunctionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of FunctionV1 + * @throws IOException if the JSON string is invalid with respect to FunctionV1 + */ + public static FunctionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FunctionV1.class); + } + + /** + * Convert an instance of FunctionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java index 32eaff2e..52206370 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,199 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GenerateUploadURLForEdgeFunctionsAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GenerateUploadURLForEdgeFunctions200Response - */ - +/** GenerateUploadURLForEdgeFunctions200Response */ public class GenerateUploadURLForEdgeFunctions200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GenerateUploadURLForEdgeFunctionsAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GenerateUploadURLForEdgeFunctions200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GenerateUploadURLForEdgeFunctionsAlphaOutput data; - public GenerateUploadURLForEdgeFunctions200Response data(GenerateUploadURLForEdgeFunctionsAlphaOutput data) { - - this.data = data; - return this; - } + public GenerateUploadURLForEdgeFunctions200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GenerateUploadURLForEdgeFunctions200Response data( + GenerateUploadURLForEdgeFunctionsAlphaOutput data) { - public GenerateUploadURLForEdgeFunctionsAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GenerateUploadURLForEdgeFunctionsAlphaOutput getData() { + return data; + } - public void setData(GenerateUploadURLForEdgeFunctionsAlphaOutput data) { - this.data = data; - } + public void setData(GenerateUploadURLForEdgeFunctionsAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunctions200Response = + (GenerateUploadURLForEdgeFunctions200Response) o; + return Objects.equals(this.data, generateUploadURLForEdgeFunctions200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateUploadURLForEdgeFunctions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunctions200Response = (GenerateUploadURLForEdgeFunctions200Response) o; - return Objects.equals(this.data, generateUploadURLForEdgeFunctions200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GenerateUploadURLForEdgeFunctions200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GenerateUploadURLForEdgeFunctions200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GenerateUploadURLForEdgeFunctions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateUploadURLForEdgeFunctions200Response is not found in the empty JSON string", GenerateUploadURLForEdgeFunctions200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GenerateUploadURLForEdgeFunctions200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GenerateUploadURLForEdgeFunctions200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GenerateUploadURLForEdgeFunctions200Response is not found" + + " in the empty JSON string", + GenerateUploadURLForEdgeFunctions200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GenerateUploadURLForEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateUploadURLForEdgeFunctions200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GenerateUploadURLForEdgeFunctions200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GenerateUploadURLForEdgeFunctions200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GenerateUploadURLForEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GenerateUploadURLForEdgeFunctions200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GenerateUploadURLForEdgeFunctions200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GenerateUploadURLForEdgeFunctions200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GenerateUploadURLForEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateUploadURLForEdgeFunctions200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GenerateUploadURLForEdgeFunctions200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GenerateUploadURLForEdgeFunctions200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GenerateUploadURLForEdgeFunctions200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenerateUploadURLForEdgeFunctions200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateUploadURLForEdgeFunctions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateUploadURLForEdgeFunctions200Response + * @throws IOException if the JSON string is invalid with respect to + * GenerateUploadURLForEdgeFunctions200Response + */ + public static GenerateUploadURLForEdgeFunctions200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GenerateUploadURLForEdgeFunctions200Response.class); } - } - - /** - * Create an instance of GenerateUploadURLForEdgeFunctions200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GenerateUploadURLForEdgeFunctions200Response - * @throws IOException if the JSON string is invalid with respect to GenerateUploadURLForEdgeFunctions200Response - */ - public static GenerateUploadURLForEdgeFunctions200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GenerateUploadURLForEdgeFunctions200Response.class); - } - - /** - * Convert an instance of GenerateUploadURLForEdgeFunctions200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GenerateUploadURLForEdgeFunctions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java index e6e3929f..244d2137 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,208 +10,224 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Output for GenerateSignedUrl. - */ +/** Output for GenerateSignedUrl. */ @ApiModel(description = "Output for GenerateSignedUrl.") - public class GenerateUploadURLForEdgeFunctionsAlphaOutput { - public static final String SERIALIZED_NAME_UPLOAD_U_R_L = "uploadURL"; - @SerializedName(SERIALIZED_NAME_UPLOAD_U_R_L) - private String uploadURL; + public static final String SERIALIZED_NAME_UPLOAD_U_R_L = "uploadURL"; - public GenerateUploadURLForEdgeFunctionsAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_UPLOAD_U_R_L) + private String uploadURL; - public GenerateUploadURLForEdgeFunctionsAlphaOutput uploadURL(String uploadURL) { - - this.uploadURL = uploadURL; - return this; - } + public GenerateUploadURLForEdgeFunctionsAlphaOutput() {} - /** - * A temporary URL that can be used to upload your Edge Functions bundle. Expires in 15 minutes. - * @return uploadURL - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A temporary URL that can be used to upload your Edge Functions bundle. Expires in 15 minutes.") + public GenerateUploadURLForEdgeFunctionsAlphaOutput uploadURL(String uploadURL) { - public String getUploadURL() { - return uploadURL; - } + this.uploadURL = uploadURL; + return this; + } + /** + * A temporary URL that can be used to upload your Edge Functions bundle. Expires in 15 minutes. + * + * @return uploadURL + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "A temporary URL that can be used to upload your Edge Functions bundle. Expires" + + " in 15 minutes.") + public String getUploadURL() { + return uploadURL; + } - public void setUploadURL(String uploadURL) { - this.uploadURL = uploadURL; - } + public void setUploadURL(String uploadURL) { + this.uploadURL = uploadURL; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateUploadURLForEdgeFunctionsAlphaOutput generateUploadURLForEdgeFunctionsAlphaOutput = + (GenerateUploadURLForEdgeFunctionsAlphaOutput) o; + return Objects.equals( + this.uploadURL, generateUploadURLForEdgeFunctionsAlphaOutput.uploadURL); + } + @Override + public int hashCode() { + return Objects.hash(uploadURL); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateUploadURLForEdgeFunctionsAlphaOutput {\n"); + sb.append(" uploadURL: ").append(toIndentedString(uploadURL)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GenerateUploadURLForEdgeFunctionsAlphaOutput generateUploadURLForEdgeFunctionsAlphaOutput = (GenerateUploadURLForEdgeFunctionsAlphaOutput) o; - return Objects.equals(this.uploadURL, generateUploadURLForEdgeFunctionsAlphaOutput.uploadURL); - } - - @Override - public int hashCode() { - return Objects.hash(uploadURL); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GenerateUploadURLForEdgeFunctionsAlphaOutput {\n"); - sb.append(" uploadURL: ").append(toIndentedString(uploadURL)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uploadURL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("uploadURL"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("uploadURL"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("uploadURL"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GenerateUploadURLForEdgeFunctionsAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateUploadURLForEdgeFunctionsAlphaOutput is not found in the empty JSON string", GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GenerateUploadURLForEdgeFunctionsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GenerateUploadURLForEdgeFunctionsAlphaOutput is not found" + + " in the empty JSON string", + GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateUploadURLForEdgeFunctionsAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GenerateUploadURLForEdgeFunctionsAlphaOutput` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("uploadURL").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `uploadURL` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("uploadURL").toString())); } - } - if (!jsonObj.get("uploadURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `uploadURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uploadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GenerateUploadURLForEdgeFunctionsAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GenerateUploadURLForEdgeFunctionsAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GenerateUploadURLForEdgeFunctionsAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GenerateUploadURLForEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of GenerateUploadURLForEdgeFunctionsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GenerateUploadURLForEdgeFunctionsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GenerateUploadURLForEdgeFunctionsAlphaOutput - */ - public static GenerateUploadURLForEdgeFunctionsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GenerateUploadURLForEdgeFunctionsAlphaOutput.class); - } - - /** - * Convert an instance of GenerateUploadURLForEdgeFunctionsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GenerateUploadURLForEdgeFunctionsAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GenerateUploadURLForEdgeFunctionsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GenerateUploadURLForEdgeFunctionsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenerateUploadURLForEdgeFunctionsAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateUploadURLForEdgeFunctionsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateUploadURLForEdgeFunctionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GenerateUploadURLForEdgeFunctionsAlphaOutput + */ + public static GenerateUploadURLForEdgeFunctionsAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GenerateUploadURLForEdgeFunctionsAlphaOutput.class); + } + + /** + * Convert an instance of GenerateUploadURLForEdgeFunctionsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java index 57187c0d..b34cdc68 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,202 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetAdvancedSyncScheduleFromWarehouse200Response - */ - +/** GetAdvancedSyncScheduleFromWarehouse200Response */ public class GetAdvancedSyncScheduleFromWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetAdvancedSyncScheduleFromWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetAdvancedSyncScheduleFromWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetAdvancedSyncScheduleFromWarehouseV1Output data; - public GetAdvancedSyncScheduleFromWarehouse200Response data(GetAdvancedSyncScheduleFromWarehouseV1Output data) { - - this.data = data; - return this; - } + public GetAdvancedSyncScheduleFromWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetAdvancedSyncScheduleFromWarehouse200Response data( + GetAdvancedSyncScheduleFromWarehouseV1Output data) { - public GetAdvancedSyncScheduleFromWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetAdvancedSyncScheduleFromWarehouseV1Output getData() { + return data; + } - public void setData(GetAdvancedSyncScheduleFromWarehouseV1Output data) { - this.data = data; - } + public void setData(GetAdvancedSyncScheduleFromWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAdvancedSyncScheduleFromWarehouse200Response + getAdvancedSyncScheduleFromWarehouse200Response = + (GetAdvancedSyncScheduleFromWarehouse200Response) o; + return Objects.equals(this.data, getAdvancedSyncScheduleFromWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAdvancedSyncScheduleFromWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetAdvancedSyncScheduleFromWarehouse200Response getAdvancedSyncScheduleFromWarehouse200Response = (GetAdvancedSyncScheduleFromWarehouse200Response) o; - return Objects.equals(this.data, getAdvancedSyncScheduleFromWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAdvancedSyncScheduleFromWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetAdvancedSyncScheduleFromWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetAdvancedSyncScheduleFromWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetAdvancedSyncScheduleFromWarehouse200Response is not found in the empty JSON string", GetAdvancedSyncScheduleFromWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetAdvancedSyncScheduleFromWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAdvancedSyncScheduleFromWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAdvancedSyncScheduleFromWarehouse200Response is not" + + " found in the empty JSON string", + GetAdvancedSyncScheduleFromWarehouse200Response + .openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetAdvancedSyncScheduleFromWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAdvancedSyncScheduleFromWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAdvancedSyncScheduleFromWarehouse200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAdvancedSyncScheduleFromWarehouse200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAdvancedSyncScheduleFromWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAdvancedSyncScheduleFromWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetAdvancedSyncScheduleFromWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAdvancedSyncScheduleFromWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAdvancedSyncScheduleFromWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAdvancedSyncScheduleFromWarehouse200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAdvancedSyncScheduleFromWarehouse200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetAdvancedSyncScheduleFromWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAdvancedSyncScheduleFromWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAdvancedSyncScheduleFromWarehouse200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAdvancedSyncScheduleFromWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAdvancedSyncScheduleFromWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to + * GetAdvancedSyncScheduleFromWarehouse200Response + */ + public static GetAdvancedSyncScheduleFromWarehouse200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAdvancedSyncScheduleFromWarehouse200Response.class); } - } - - /** - * Create an instance of GetAdvancedSyncScheduleFromWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAdvancedSyncScheduleFromWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to GetAdvancedSyncScheduleFromWarehouse200Response - */ - public static GetAdvancedSyncScheduleFromWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAdvancedSyncScheduleFromWarehouse200Response.class); - } - - /** - * Convert an instance of GetAdvancedSyncScheduleFromWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetAdvancedSyncScheduleFromWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java index 907fb380..2c81cdf1 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,236 +10,244 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Schedule; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the advanced sync schedule for a Warehouse. - */ +/** Returns the advanced sync schedule for a Warehouse. */ @ApiModel(description = "Returns the advanced sync schedule for a Warehouse.") - public class GetAdvancedSyncScheduleFromWarehouseV1Output { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; - @SerializedName(SERIALIZED_NAME_SCHEDULE) - private Schedule schedule; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - public GetAdvancedSyncScheduleFromWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public GetAdvancedSyncScheduleFromWarehouseV1Output enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; - /** - * Indicates if an advanced sync schedule is enabled for this Warehouse. - * @return enabled - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Indicates if an advanced sync schedule is enabled for this Warehouse.") + @SerializedName(SERIALIZED_NAME_SCHEDULE) + private Schedule schedule; - public Boolean getEnabled() { - return enabled; - } + public GetAdvancedSyncScheduleFromWarehouseV1Output() {} + public GetAdvancedSyncScheduleFromWarehouseV1Output enabled(Boolean enabled) { - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + this.enabled = enabled; + return this; + } + /** + * Indicates if an advanced sync schedule is enabled for this Warehouse. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Indicates if an advanced sync schedule is enabled for this Warehouse.") + public Boolean getEnabled() { + return enabled; + } - public GetAdvancedSyncScheduleFromWarehouseV1Output schedule(Schedule schedule) { - - this.schedule = schedule; - return this; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } - /** - * Get schedule - * @return schedule - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetAdvancedSyncScheduleFromWarehouseV1Output schedule(Schedule schedule) { - public Schedule getSchedule() { - return schedule; - } + this.schedule = schedule; + return this; + } + /** + * Get schedule + * + * @return schedule + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Schedule getSchedule() { + return schedule; + } - public void setSchedule(Schedule schedule) { - this.schedule = schedule; - } + public void setSchedule(Schedule schedule) { + this.schedule = schedule; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAdvancedSyncScheduleFromWarehouseV1Output getAdvancedSyncScheduleFromWarehouseV1Output = + (GetAdvancedSyncScheduleFromWarehouseV1Output) o; + return Objects.equals(this.enabled, getAdvancedSyncScheduleFromWarehouseV1Output.enabled) + && Objects.equals( + this.schedule, getAdvancedSyncScheduleFromWarehouseV1Output.schedule); + } + @Override + public int hashCode() { + return Objects.hash(enabled, schedule); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAdvancedSyncScheduleFromWarehouseV1Output {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetAdvancedSyncScheduleFromWarehouseV1Output getAdvancedSyncScheduleFromWarehouseV1Output = (GetAdvancedSyncScheduleFromWarehouseV1Output) o; - return Objects.equals(this.enabled, getAdvancedSyncScheduleFromWarehouseV1Output.enabled) && - Objects.equals(this.schedule, getAdvancedSyncScheduleFromWarehouseV1Output.schedule); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, schedule); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAdvancedSyncScheduleFromWarehouseV1Output {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + openapiFields.add("schedule"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enabled"); - openapiFields.add("schedule"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("enabled"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetAdvancedSyncScheduleFromWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetAdvancedSyncScheduleFromWarehouseV1Output is not found in the empty JSON string", GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetAdvancedSyncScheduleFromWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAdvancedSyncScheduleFromWarehouseV1Output is not found" + + " in the empty JSON string", + GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetAdvancedSyncScheduleFromWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAdvancedSyncScheduleFromWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAdvancedSyncScheduleFromWarehouseV1Output.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAdvancedSyncScheduleFromWarehouseV1Output` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAdvancedSyncScheduleFromWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAdvancedSyncScheduleFromWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetAdvancedSyncScheduleFromWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAdvancedSyncScheduleFromWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAdvancedSyncScheduleFromWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAdvancedSyncScheduleFromWarehouseV1Output.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAdvancedSyncScheduleFromWarehouseV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetAdvancedSyncScheduleFromWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetAdvancedSyncScheduleFromWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAdvancedSyncScheduleFromWarehouseV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAdvancedSyncScheduleFromWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAdvancedSyncScheduleFromWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetAdvancedSyncScheduleFromWarehouseV1Output + */ + public static GetAdvancedSyncScheduleFromWarehouseV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAdvancedSyncScheduleFromWarehouseV1Output.class); } - } - - /** - * Create an instance of GetAdvancedSyncScheduleFromWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAdvancedSyncScheduleFromWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to GetAdvancedSyncScheduleFromWarehouseV1Output - */ - public static GetAdvancedSyncScheduleFromWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAdvancedSyncScheduleFromWarehouseV1Output.class); - } - - /** - * Convert an instance of GetAdvancedSyncScheduleFromWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetAdvancedSyncScheduleFromWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java index 8a3f2773..f869f742 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,198 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetConnectionStateFromWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetConnectionStateFromWarehouse200Response - */ - +/** GetConnectionStateFromWarehouse200Response */ public class GetConnectionStateFromWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetConnectionStateFromWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetConnectionStateFromWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetConnectionStateFromWarehouseV1Output data; - public GetConnectionStateFromWarehouse200Response data(GetConnectionStateFromWarehouseV1Output data) { - - this.data = data; - return this; - } + public GetConnectionStateFromWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetConnectionStateFromWarehouse200Response data( + GetConnectionStateFromWarehouseV1Output data) { - public GetConnectionStateFromWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetConnectionStateFromWarehouseV1Output getData() { + return data; + } - public void setData(GetConnectionStateFromWarehouseV1Output data) { - this.data = data; - } + public void setData(GetConnectionStateFromWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetConnectionStateFromWarehouse200Response getConnectionStateFromWarehouse200Response = + (GetConnectionStateFromWarehouse200Response) o; + return Objects.equals(this.data, getConnectionStateFromWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetConnectionStateFromWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetConnectionStateFromWarehouse200Response getConnectionStateFromWarehouse200Response = (GetConnectionStateFromWarehouse200Response) o; - return Objects.equals(this.data, getConnectionStateFromWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetConnectionStateFromWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetConnectionStateFromWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetConnectionStateFromWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetConnectionStateFromWarehouse200Response is not found in the empty JSON string", GetConnectionStateFromWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetConnectionStateFromWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetConnectionStateFromWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetConnectionStateFromWarehouse200Response is not found in" + + " the empty JSON string", + GetConnectionStateFromWarehouse200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetConnectionStateFromWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetConnectionStateFromWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetConnectionStateFromWarehouse200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetConnectionStateFromWarehouse200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetConnectionStateFromWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetConnectionStateFromWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetConnectionStateFromWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetConnectionStateFromWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetConnectionStateFromWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetConnectionStateFromWarehouse200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetConnectionStateFromWarehouse200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetConnectionStateFromWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetConnectionStateFromWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetConnectionStateFromWarehouse200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetConnectionStateFromWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetConnectionStateFromWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to + * GetConnectionStateFromWarehouse200Response + */ + public static GetConnectionStateFromWarehouse200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetConnectionStateFromWarehouse200Response.class); } - } - - /** - * Create an instance of GetConnectionStateFromWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetConnectionStateFromWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to GetConnectionStateFromWarehouse200Response - */ - public static GetConnectionStateFromWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetConnectionStateFromWarehouse200Response.class); - } - - /** - * Convert an instance of GetConnectionStateFromWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetConnectionStateFromWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java index c618c3f9..9ba59b4d 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,255 +10,269 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** Returns the status of a Warehouse connection settings after an attempt to connect to it. */ +@ApiModel( + description = + "Returns the status of a Warehouse connection settings after an attempt to connect" + + " to it.") +public class GetConnectionStateFromWarehouseV1Output { + /** Represents the status for the current connection settings. */ + @JsonAdapter(ConnectionStateEnum.Adapter.class) + public enum ConnectionStateEnum { + CONNECTED("CONNECTED"), -/** - * Returns the status of a Warehouse connection settings after an attempt to connect to it. - */ -@ApiModel(description = "Returns the status of a Warehouse connection settings after an attempt to connect to it.") + FAILED("FAILED"); -public class GetConnectionStateFromWarehouseV1Output { - /** - * Represents the status for the current connection settings. - */ - @JsonAdapter(ConnectionStateEnum.Adapter.class) - public enum ConnectionStateEnum { - CONNECTED("CONNECTED"), - - FAILED("FAILED"); - - private String value; - - ConnectionStateEnum(String value) { - this.value = value; - } + private String value; - public String getValue() { - return value; - } + ConnectionStateEnum(String value) { + this.value = value; + } - @Override - public String toString() { - return String.valueOf(value); - } + public String getValue() { + return value; + } - public static ConnectionStateEnum fromValue(String value) { - for (ConnectionStateEnum b : ConnectionStateEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ConnectionStateEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ConnectionStateEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ConnectionStateEnum.fromValue(value); - } + public static ConnectionStateEnum fromValue(String value) { + for (ConnectionStateEnum b : ConnectionStateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionStateEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionStateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionStateEnum.fromValue(value); + } + } } - } - public static final String SERIALIZED_NAME_CONNECTION_STATE = "connectionState"; - @SerializedName(SERIALIZED_NAME_CONNECTION_STATE) - private ConnectionStateEnum connectionState; + public static final String SERIALIZED_NAME_CONNECTION_STATE = "connectionState"; - public GetConnectionStateFromWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_CONNECTION_STATE) + private ConnectionStateEnum connectionState; - public GetConnectionStateFromWarehouseV1Output connectionState(ConnectionStateEnum connectionState) { - - this.connectionState = connectionState; - return this; - } + public GetConnectionStateFromWarehouseV1Output() {} - /** - * Represents the status for the current connection settings. - * @return connectionState - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Represents the status for the current connection settings.") + public GetConnectionStateFromWarehouseV1Output connectionState( + ConnectionStateEnum connectionState) { - public ConnectionStateEnum getConnectionState() { - return connectionState; - } + this.connectionState = connectionState; + return this; + } + /** + * Represents the status for the current connection settings. + * + * @return connectionState + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Represents the status for the current connection settings.") + public ConnectionStateEnum getConnectionState() { + return connectionState; + } - public void setConnectionState(ConnectionStateEnum connectionState) { - this.connectionState = connectionState; - } + public void setConnectionState(ConnectionStateEnum connectionState) { + this.connectionState = connectionState; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetConnectionStateFromWarehouseV1Output getConnectionStateFromWarehouseV1Output = + (GetConnectionStateFromWarehouseV1Output) o; + return Objects.equals( + this.connectionState, getConnectionStateFromWarehouseV1Output.connectionState); + } + @Override + public int hashCode() { + return Objects.hash(connectionState); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetConnectionStateFromWarehouseV1Output {\n"); + sb.append(" connectionState: ").append(toIndentedString(connectionState)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetConnectionStateFromWarehouseV1Output getConnectionStateFromWarehouseV1Output = (GetConnectionStateFromWarehouseV1Output) o; - return Objects.equals(this.connectionState, getConnectionStateFromWarehouseV1Output.connectionState); - } - - @Override - public int hashCode() { - return Objects.hash(connectionState); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetConnectionStateFromWarehouseV1Output {\n"); - sb.append(" connectionState: ").append(toIndentedString(connectionState)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectionState"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connectionState"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("connectionState"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("connectionState"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetConnectionStateFromWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetConnectionStateFromWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetConnectionStateFromWarehouseV1Output is not found in the empty JSON string", GetConnectionStateFromWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetConnectionStateFromWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetConnectionStateFromWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetConnectionStateFromWarehouseV1Output is not found in the" + + " empty JSON string", + GetConnectionStateFromWarehouseV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetConnectionStateFromWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetConnectionStateFromWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetConnectionStateFromWarehouseV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetConnectionStateFromWarehouseV1Output` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetConnectionStateFromWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetConnectionStateFromWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectionState").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `connectionState` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("connectionState").toString())); } - } - if (!jsonObj.get("connectionState").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `connectionState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectionState").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetConnectionStateFromWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetConnectionStateFromWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetConnectionStateFromWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetConnectionStateFromWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetConnectionStateFromWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of GetConnectionStateFromWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetConnectionStateFromWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to GetConnectionStateFromWarehouseV1Output - */ - public static GetConnectionStateFromWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetConnectionStateFromWarehouseV1Output.class); - } - - /** - * Convert an instance of GetConnectionStateFromWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetConnectionStateFromWarehouseV1Output.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetConnectionStateFromWarehouseV1Output' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetConnectionStateFromWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetConnectionStateFromWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetConnectionStateFromWarehouseV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetConnectionStateFromWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetConnectionStateFromWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetConnectionStateFromWarehouseV1Output + */ + public static GetConnectionStateFromWarehouseV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetConnectionStateFromWarehouseV1Output.class); + } + + /** + * Convert an instance of GetConnectionStateFromWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java index 88b44ff0..8c68b0af 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDailyPerSourceAPICallsUsageV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDailyPerSourceAPICallsUsage200Response - */ - +/** GetDailyPerSourceAPICallsUsage200Response */ public class GetDailyPerSourceAPICallsUsage200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDailyPerSourceAPICallsUsageV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDailyPerSourceAPICallsUsage200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDailyPerSourceAPICallsUsageV1Output data; - public GetDailyPerSourceAPICallsUsage200Response data(GetDailyPerSourceAPICallsUsageV1Output data) { - - this.data = data; - return this; - } + public GetDailyPerSourceAPICallsUsage200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDailyPerSourceAPICallsUsage200Response data( + GetDailyPerSourceAPICallsUsageV1Output data) { - public GetDailyPerSourceAPICallsUsageV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDailyPerSourceAPICallsUsageV1Output getData() { + return data; + } - public void setData(GetDailyPerSourceAPICallsUsageV1Output data) { - this.data = data; - } + public void setData(GetDailyPerSourceAPICallsUsageV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyPerSourceAPICallsUsage200Response getDailyPerSourceAPICallsUsage200Response = + (GetDailyPerSourceAPICallsUsage200Response) o; + return Objects.equals(this.data, getDailyPerSourceAPICallsUsage200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyPerSourceAPICallsUsage200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyPerSourceAPICallsUsage200Response getDailyPerSourceAPICallsUsage200Response = (GetDailyPerSourceAPICallsUsage200Response) o; - return Objects.equals(this.data, getDailyPerSourceAPICallsUsage200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyPerSourceAPICallsUsage200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyPerSourceAPICallsUsage200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyPerSourceAPICallsUsage200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyPerSourceAPICallsUsage200Response is not found in the empty JSON string", GetDailyPerSourceAPICallsUsage200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyPerSourceAPICallsUsage200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyPerSourceAPICallsUsage200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetDailyPerSourceAPICallsUsage200Response is not found in" + + " the empty JSON string", + GetDailyPerSourceAPICallsUsage200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyPerSourceAPICallsUsage200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyPerSourceAPICallsUsage200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyPerSourceAPICallsUsage200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyPerSourceAPICallsUsage200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyPerSourceAPICallsUsage200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyPerSourceAPICallsUsage200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyPerSourceAPICallsUsage200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyPerSourceAPICallsUsage200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyPerSourceAPICallsUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyPerSourceAPICallsUsage200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetDailyPerSourceAPICallsUsage200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyPerSourceAPICallsUsage200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetDailyPerSourceAPICallsUsage200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyPerSourceAPICallsUsage200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyPerSourceAPICallsUsage200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyPerSourceAPICallsUsage200Response + * @throws IOException if the JSON string is invalid with respect to + * GetDailyPerSourceAPICallsUsage200Response + */ + public static GetDailyPerSourceAPICallsUsage200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyPerSourceAPICallsUsage200Response.class); } - } - - /** - * Create an instance of GetDailyPerSourceAPICallsUsage200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyPerSourceAPICallsUsage200Response - * @throws IOException if the JSON string is invalid with respect to GetDailyPerSourceAPICallsUsage200Response - */ - public static GetDailyPerSourceAPICallsUsage200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyPerSourceAPICallsUsage200Response.class); - } - - /** - * Convert an instance of GetDailyPerSourceAPICallsUsage200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyPerSourceAPICallsUsage200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java index 9b5867f0..2f892244 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,266 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Pagination; -import com.segment.publicapi.models.SourceAPICallSnapshotV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of daily aggregations of Source level API calls counts. - */ +/** Returns a list of daily aggregations of Source level API calls counts. */ @ApiModel(description = "Returns a list of daily aggregations of Source level API calls counts.") - public class GetDailyPerSourceAPICallsUsageV1Output { - public static final String SERIALIZED_NAME_DAILY_PER_SOURCE_A_P_I_CALLS_USAGE = "dailyPerSourceAPICallsUsage"; - @SerializedName(SERIALIZED_NAME_DAILY_PER_SOURCE_A_P_I_CALLS_USAGE) - private List dailyPerSourceAPICallsUsage = new ArrayList<>(); + public static final String SERIALIZED_NAME_DAILY_PER_SOURCE_A_P_I_CALLS_USAGE = + "dailyPerSourceAPICallsUsage"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_DAILY_PER_SOURCE_A_P_I_CALLS_USAGE) + private List dailyPerSourceAPICallsUsage = new ArrayList<>(); - public GetDailyPerSourceAPICallsUsageV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetDailyPerSourceAPICallsUsageV1Output dailyPerSourceAPICallsUsage(List dailyPerSourceAPICallsUsage) { - - this.dailyPerSourceAPICallsUsage = dailyPerSourceAPICallsUsage; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetDailyPerSourceAPICallsUsageV1Output addDailyPerSourceAPICallsUsageItem(SourceAPICallSnapshotV1 dailyPerSourceAPICallsUsageItem) { - this.dailyPerSourceAPICallsUsage.add(dailyPerSourceAPICallsUsageItem); - return this; - } + public GetDailyPerSourceAPICallsUsageV1Output() {} - /** - * The list of daily per Source API calls count aggregates. - * @return dailyPerSourceAPICallsUsage - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of daily per Source API calls count aggregates.") - - public List getDailyPerSourceAPICallsUsage() { - return dailyPerSourceAPICallsUsage; - } + public GetDailyPerSourceAPICallsUsageV1Output dailyPerSourceAPICallsUsage( + List dailyPerSourceAPICallsUsage) { + this.dailyPerSourceAPICallsUsage = dailyPerSourceAPICallsUsage; + return this; + } - public void setDailyPerSourceAPICallsUsage(List dailyPerSourceAPICallsUsage) { - this.dailyPerSourceAPICallsUsage = dailyPerSourceAPICallsUsage; - } + public GetDailyPerSourceAPICallsUsageV1Output addDailyPerSourceAPICallsUsageItem( + SourceAPICallSnapshotV1 dailyPerSourceAPICallsUsageItem) { + this.dailyPerSourceAPICallsUsage.add(dailyPerSourceAPICallsUsageItem); + return this; + } + /** + * The list of daily per Source API calls count aggregates. + * + * @return dailyPerSourceAPICallsUsage + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The list of daily per Source API calls count aggregates.") + public List getDailyPerSourceAPICallsUsage() { + return dailyPerSourceAPICallsUsage; + } - public GetDailyPerSourceAPICallsUsageV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setDailyPerSourceAPICallsUsage( + List dailyPerSourceAPICallsUsage) { + this.dailyPerSourceAPICallsUsage = dailyPerSourceAPICallsUsage; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDailyPerSourceAPICallsUsageV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyPerSourceAPICallsUsageV1Output getDailyPerSourceAPICallsUsageV1Output = + (GetDailyPerSourceAPICallsUsageV1Output) o; + return Objects.equals( + this.dailyPerSourceAPICallsUsage, + getDailyPerSourceAPICallsUsageV1Output.dailyPerSourceAPICallsUsage) + && Objects.equals( + this.pagination, getDailyPerSourceAPICallsUsageV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(dailyPerSourceAPICallsUsage, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyPerSourceAPICallsUsageV1Output {\n"); + sb.append(" dailyPerSourceAPICallsUsage: ") + .append(toIndentedString(dailyPerSourceAPICallsUsage)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyPerSourceAPICallsUsageV1Output getDailyPerSourceAPICallsUsageV1Output = (GetDailyPerSourceAPICallsUsageV1Output) o; - return Objects.equals(this.dailyPerSourceAPICallsUsage, getDailyPerSourceAPICallsUsageV1Output.dailyPerSourceAPICallsUsage) && - Objects.equals(this.pagination, getDailyPerSourceAPICallsUsageV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(dailyPerSourceAPICallsUsage, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyPerSourceAPICallsUsageV1Output {\n"); - sb.append(" dailyPerSourceAPICallsUsage: ").append(toIndentedString(dailyPerSourceAPICallsUsage)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dailyPerSourceAPICallsUsage"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("dailyPerSourceAPICallsUsage"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("dailyPerSourceAPICallsUsage"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("dailyPerSourceAPICallsUsage"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyPerSourceAPICallsUsageV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyPerSourceAPICallsUsageV1Output is not found in the empty JSON string", GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyPerSourceAPICallsUsageV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDailyPerSourceAPICallsUsageV1Output" + + " is not found in the empty JSON string", + GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyPerSourceAPICallsUsageV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyPerSourceAPICallsUsageV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyPerSourceAPICallsUsageV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyPerSourceAPICallsUsageV1Output` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("dailyPerSourceAPICallsUsage").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dailyPerSourceAPICallsUsage` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("dailyPerSourceAPICallsUsage").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("dailyPerSourceAPICallsUsage").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `dailyPerSourceAPICallsUsage` to be an array in the JSON string but got `%s`", jsonObj.get("dailyPerSourceAPICallsUsage").toString())); - } - JsonArray jsonArraydailyPerSourceAPICallsUsage = jsonObj.getAsJsonArray("dailyPerSourceAPICallsUsage"); - } + JsonArray jsonArraydailyPerSourceAPICallsUsage = + jsonObj.getAsJsonArray("dailyPerSourceAPICallsUsage"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyPerSourceAPICallsUsageV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyPerSourceAPICallsUsageV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyPerSourceAPICallsUsageV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyPerSourceAPICallsUsageV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyPerSourceAPICallsUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyPerSourceAPICallsUsageV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDailyPerSourceAPICallsUsageV1Output' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyPerSourceAPICallsUsageV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetDailyPerSourceAPICallsUsageV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyPerSourceAPICallsUsageV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyPerSourceAPICallsUsageV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyPerSourceAPICallsUsageV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetDailyPerSourceAPICallsUsageV1Output + */ + public static GetDailyPerSourceAPICallsUsageV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyPerSourceAPICallsUsageV1Output.class); } - } - - /** - * Create an instance of GetDailyPerSourceAPICallsUsageV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyPerSourceAPICallsUsageV1Output - * @throws IOException if the JSON string is invalid with respect to GetDailyPerSourceAPICallsUsageV1Output - */ - public static GetDailyPerSourceAPICallsUsageV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyPerSourceAPICallsUsageV1Output.class); - } - - /** - * Convert an instance of GetDailyPerSourceAPICallsUsageV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyPerSourceAPICallsUsageV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java index 670e1e12..b2df4897 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDailyPerSourceMTUUsageV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDailyPerSourceMTUUsage200Response - */ - +/** GetDailyPerSourceMTUUsage200Response */ public class GetDailyPerSourceMTUUsage200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDailyPerSourceMTUUsageV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDailyPerSourceMTUUsage200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDailyPerSourceMTUUsageV1Output data; - public GetDailyPerSourceMTUUsage200Response data(GetDailyPerSourceMTUUsageV1Output data) { - - this.data = data; - return this; - } + public GetDailyPerSourceMTUUsage200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDailyPerSourceMTUUsage200Response data(GetDailyPerSourceMTUUsageV1Output data) { - public GetDailyPerSourceMTUUsageV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDailyPerSourceMTUUsageV1Output getData() { + return data; + } - public void setData(GetDailyPerSourceMTUUsageV1Output data) { - this.data = data; - } + public void setData(GetDailyPerSourceMTUUsageV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyPerSourceMTUUsage200Response getDailyPerSourceMTUUsage200Response = + (GetDailyPerSourceMTUUsage200Response) o; + return Objects.equals(this.data, getDailyPerSourceMTUUsage200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyPerSourceMTUUsage200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyPerSourceMTUUsage200Response getDailyPerSourceMTUUsage200Response = (GetDailyPerSourceMTUUsage200Response) o; - return Objects.equals(this.data, getDailyPerSourceMTUUsage200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyPerSourceMTUUsage200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyPerSourceMTUUsage200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyPerSourceMTUUsage200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyPerSourceMTUUsage200Response is not found in the empty JSON string", GetDailyPerSourceMTUUsage200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyPerSourceMTUUsage200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyPerSourceMTUUsage200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDailyPerSourceMTUUsage200Response" + + " is not found in the empty JSON string", + GetDailyPerSourceMTUUsage200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyPerSourceMTUUsage200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyPerSourceMTUUsage200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyPerSourceMTUUsage200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyPerSourceMTUUsage200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyPerSourceMTUUsage200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyPerSourceMTUUsage200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyPerSourceMTUUsage200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyPerSourceMTUUsage200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyPerSourceMTUUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyPerSourceMTUUsage200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDailyPerSourceMTUUsage200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyPerSourceMTUUsage200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetDailyPerSourceMTUUsage200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyPerSourceMTUUsage200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyPerSourceMTUUsage200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyPerSourceMTUUsage200Response + * @throws IOException if the JSON string is invalid with respect to + * GetDailyPerSourceMTUUsage200Response + */ + public static GetDailyPerSourceMTUUsage200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyPerSourceMTUUsage200Response.class); } - } - - /** - * Create an instance of GetDailyPerSourceMTUUsage200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyPerSourceMTUUsage200Response - * @throws IOException if the JSON string is invalid with respect to GetDailyPerSourceMTUUsage200Response - */ - public static GetDailyPerSourceMTUUsage200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyPerSourceMTUUsage200Response.class); - } - - /** - * Convert an instance of GetDailyPerSourceMTUUsage200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyPerSourceMTUUsage200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java index dd25f3a6..97416945 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,259 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Pagination; -import com.segment.publicapi.models.UsersPerSourceSnapshotV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of daily aggregations of Source level MTU counts. - */ +/** Returns a list of daily aggregations of Source level MTU counts. */ @ApiModel(description = "Returns a list of daily aggregations of Source level MTU counts.") - public class GetDailyPerSourceMTUUsageV1Output { - public static final String SERIALIZED_NAME_DAILY_PER_SOURCE_M_T_U_USAGE = "dailyPerSourceMTUUsage"; - @SerializedName(SERIALIZED_NAME_DAILY_PER_SOURCE_M_T_U_USAGE) - private List dailyPerSourceMTUUsage = new ArrayList<>(); + public static final String SERIALIZED_NAME_DAILY_PER_SOURCE_M_T_U_USAGE = + "dailyPerSourceMTUUsage"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_DAILY_PER_SOURCE_M_T_U_USAGE) + private List dailyPerSourceMTUUsage = new ArrayList<>(); - public GetDailyPerSourceMTUUsageV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetDailyPerSourceMTUUsageV1Output dailyPerSourceMTUUsage(List dailyPerSourceMTUUsage) { - - this.dailyPerSourceMTUUsage = dailyPerSourceMTUUsage; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetDailyPerSourceMTUUsageV1Output addDailyPerSourceMTUUsageItem(UsersPerSourceSnapshotV1 dailyPerSourceMTUUsageItem) { - this.dailyPerSourceMTUUsage.add(dailyPerSourceMTUUsageItem); - return this; - } + public GetDailyPerSourceMTUUsageV1Output() {} - /** - * The list of daily per Source MTU count aggregates. - * @return dailyPerSourceMTUUsage - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of daily per Source MTU count aggregates.") - - public List getDailyPerSourceMTUUsage() { - return dailyPerSourceMTUUsage; - } + public GetDailyPerSourceMTUUsageV1Output dailyPerSourceMTUUsage( + List dailyPerSourceMTUUsage) { + this.dailyPerSourceMTUUsage = dailyPerSourceMTUUsage; + return this; + } - public void setDailyPerSourceMTUUsage(List dailyPerSourceMTUUsage) { - this.dailyPerSourceMTUUsage = dailyPerSourceMTUUsage; - } + public GetDailyPerSourceMTUUsageV1Output addDailyPerSourceMTUUsageItem( + UsersPerSourceSnapshotV1 dailyPerSourceMTUUsageItem) { + this.dailyPerSourceMTUUsage.add(dailyPerSourceMTUUsageItem); + return this; + } + /** + * The list of daily per Source MTU count aggregates. + * + * @return dailyPerSourceMTUUsage + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The list of daily per Source MTU count aggregates.") + public List getDailyPerSourceMTUUsage() { + return dailyPerSourceMTUUsage; + } - public GetDailyPerSourceMTUUsageV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setDailyPerSourceMTUUsage(List dailyPerSourceMTUUsage) { + this.dailyPerSourceMTUUsage = dailyPerSourceMTUUsage; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDailyPerSourceMTUUsageV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyPerSourceMTUUsageV1Output getDailyPerSourceMTUUsageV1Output = + (GetDailyPerSourceMTUUsageV1Output) o; + return Objects.equals( + this.dailyPerSourceMTUUsage, + getDailyPerSourceMTUUsageV1Output.dailyPerSourceMTUUsage) + && Objects.equals(this.pagination, getDailyPerSourceMTUUsageV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(dailyPerSourceMTUUsage, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyPerSourceMTUUsageV1Output {\n"); + sb.append(" dailyPerSourceMTUUsage: ") + .append(toIndentedString(dailyPerSourceMTUUsage)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyPerSourceMTUUsageV1Output getDailyPerSourceMTUUsageV1Output = (GetDailyPerSourceMTUUsageV1Output) o; - return Objects.equals(this.dailyPerSourceMTUUsage, getDailyPerSourceMTUUsageV1Output.dailyPerSourceMTUUsage) && - Objects.equals(this.pagination, getDailyPerSourceMTUUsageV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(dailyPerSourceMTUUsage, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyPerSourceMTUUsageV1Output {\n"); - sb.append(" dailyPerSourceMTUUsage: ").append(toIndentedString(dailyPerSourceMTUUsage)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dailyPerSourceMTUUsage"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("dailyPerSourceMTUUsage"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("dailyPerSourceMTUUsage"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("dailyPerSourceMTUUsage"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyPerSourceMTUUsageV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyPerSourceMTUUsageV1Output is not found in the empty JSON string", GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyPerSourceMTUUsageV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDailyPerSourceMTUUsageV1Output is" + + " not found in the empty JSON string", + GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyPerSourceMTUUsageV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyPerSourceMTUUsageV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyPerSourceMTUUsageV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyPerSourceMTUUsageV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("dailyPerSourceMTUUsage").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dailyPerSourceMTUUsage` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("dailyPerSourceMTUUsage").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("dailyPerSourceMTUUsage").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `dailyPerSourceMTUUsage` to be an array in the JSON string but got `%s`", jsonObj.get("dailyPerSourceMTUUsage").toString())); - } - JsonArray jsonArraydailyPerSourceMTUUsage = jsonObj.getAsJsonArray("dailyPerSourceMTUUsage"); - } + JsonArray jsonArraydailyPerSourceMTUUsage = + jsonObj.getAsJsonArray("dailyPerSourceMTUUsage"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyPerSourceMTUUsageV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyPerSourceMTUUsageV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyPerSourceMTUUsageV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyPerSourceMTUUsageV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyPerSourceMTUUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyPerSourceMTUUsageV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDailyPerSourceMTUUsageV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyPerSourceMTUUsageV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDailyPerSourceMTUUsageV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyPerSourceMTUUsageV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyPerSourceMTUUsageV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyPerSourceMTUUsageV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetDailyPerSourceMTUUsageV1Output + */ + public static GetDailyPerSourceMTUUsageV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyPerSourceMTUUsageV1Output.class); } - } - - /** - * Create an instance of GetDailyPerSourceMTUUsageV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyPerSourceMTUUsageV1Output - * @throws IOException if the JSON string is invalid with respect to GetDailyPerSourceMTUUsageV1Output - */ - public static GetDailyPerSourceMTUUsageV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyPerSourceMTUUsageV1Output.class); - } - - /** - * Convert an instance of GetDailyPerSourceMTUUsageV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyPerSourceMTUUsageV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java index 22708445..527113c0 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDailyWorkspaceAPICallsUsageV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDailyWorkspaceAPICallsUsage200Response - */ - +/** GetDailyWorkspaceAPICallsUsage200Response */ public class GetDailyWorkspaceAPICallsUsage200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDailyWorkspaceAPICallsUsageV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDailyWorkspaceAPICallsUsage200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDailyWorkspaceAPICallsUsageV1Output data; - public GetDailyWorkspaceAPICallsUsage200Response data(GetDailyWorkspaceAPICallsUsageV1Output data) { - - this.data = data; - return this; - } + public GetDailyWorkspaceAPICallsUsage200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDailyWorkspaceAPICallsUsage200Response data( + GetDailyWorkspaceAPICallsUsageV1Output data) { - public GetDailyWorkspaceAPICallsUsageV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDailyWorkspaceAPICallsUsageV1Output getData() { + return data; + } - public void setData(GetDailyWorkspaceAPICallsUsageV1Output data) { - this.data = data; - } + public void setData(GetDailyWorkspaceAPICallsUsageV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyWorkspaceAPICallsUsage200Response getDailyWorkspaceAPICallsUsage200Response = + (GetDailyWorkspaceAPICallsUsage200Response) o; + return Objects.equals(this.data, getDailyWorkspaceAPICallsUsage200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyWorkspaceAPICallsUsage200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyWorkspaceAPICallsUsage200Response getDailyWorkspaceAPICallsUsage200Response = (GetDailyWorkspaceAPICallsUsage200Response) o; - return Objects.equals(this.data, getDailyWorkspaceAPICallsUsage200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyWorkspaceAPICallsUsage200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyWorkspaceAPICallsUsage200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyWorkspaceAPICallsUsage200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyWorkspaceAPICallsUsage200Response is not found in the empty JSON string", GetDailyWorkspaceAPICallsUsage200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyWorkspaceAPICallsUsage200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyWorkspaceAPICallsUsage200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetDailyWorkspaceAPICallsUsage200Response is not found in" + + " the empty JSON string", + GetDailyWorkspaceAPICallsUsage200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyWorkspaceAPICallsUsage200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyWorkspaceAPICallsUsage200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyWorkspaceAPICallsUsage200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyWorkspaceAPICallsUsage200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyWorkspaceAPICallsUsage200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyWorkspaceAPICallsUsage200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyWorkspaceAPICallsUsage200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyWorkspaceAPICallsUsage200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyWorkspaceAPICallsUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyWorkspaceAPICallsUsage200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetDailyWorkspaceAPICallsUsage200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyWorkspaceAPICallsUsage200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetDailyWorkspaceAPICallsUsage200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyWorkspaceAPICallsUsage200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyWorkspaceAPICallsUsage200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyWorkspaceAPICallsUsage200Response + * @throws IOException if the JSON string is invalid with respect to + * GetDailyWorkspaceAPICallsUsage200Response + */ + public static GetDailyWorkspaceAPICallsUsage200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceAPICallsUsage200Response.class); } - } - - /** - * Create an instance of GetDailyWorkspaceAPICallsUsage200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyWorkspaceAPICallsUsage200Response - * @throws IOException if the JSON string is invalid with respect to GetDailyWorkspaceAPICallsUsage200Response - */ - public static GetDailyWorkspaceAPICallsUsage200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceAPICallsUsage200Response.class); - } - - /** - * Convert an instance of GetDailyWorkspaceAPICallsUsage200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyWorkspaceAPICallsUsage200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java index bbb809a3..fd0382d7 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,266 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.APICallSnapshotV1; -import com.segment.publicapi.models.Pagination; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of daily aggregations of Workspace MTU counts. - */ +/** Returns a list of daily aggregations of Workspace MTU counts. */ @ApiModel(description = "Returns a list of daily aggregations of Workspace MTU counts.") - public class GetDailyWorkspaceAPICallsUsageV1Output { - public static final String SERIALIZED_NAME_DAILY_WORKSPACE_A_P_I_CALLS_USAGE = "dailyWorkspaceAPICallsUsage"; - @SerializedName(SERIALIZED_NAME_DAILY_WORKSPACE_A_P_I_CALLS_USAGE) - private List dailyWorkspaceAPICallsUsage = new ArrayList<>(); + public static final String SERIALIZED_NAME_DAILY_WORKSPACE_A_P_I_CALLS_USAGE = + "dailyWorkspaceAPICallsUsage"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_DAILY_WORKSPACE_A_P_I_CALLS_USAGE) + private List dailyWorkspaceAPICallsUsage = new ArrayList<>(); - public GetDailyWorkspaceAPICallsUsageV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetDailyWorkspaceAPICallsUsageV1Output dailyWorkspaceAPICallsUsage(List dailyWorkspaceAPICallsUsage) { - - this.dailyWorkspaceAPICallsUsage = dailyWorkspaceAPICallsUsage; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetDailyWorkspaceAPICallsUsageV1Output addDailyWorkspaceAPICallsUsageItem(APICallSnapshotV1 dailyWorkspaceAPICallsUsageItem) { - this.dailyWorkspaceAPICallsUsage.add(dailyWorkspaceAPICallsUsageItem); - return this; - } + public GetDailyWorkspaceAPICallsUsageV1Output() {} - /** - * The list of daily Workspace API calls count aggregates. - * @return dailyWorkspaceAPICallsUsage - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of daily Workspace API calls count aggregates.") - - public List getDailyWorkspaceAPICallsUsage() { - return dailyWorkspaceAPICallsUsage; - } + public GetDailyWorkspaceAPICallsUsageV1Output dailyWorkspaceAPICallsUsage( + List dailyWorkspaceAPICallsUsage) { + this.dailyWorkspaceAPICallsUsage = dailyWorkspaceAPICallsUsage; + return this; + } - public void setDailyWorkspaceAPICallsUsage(List dailyWorkspaceAPICallsUsage) { - this.dailyWorkspaceAPICallsUsage = dailyWorkspaceAPICallsUsage; - } + public GetDailyWorkspaceAPICallsUsageV1Output addDailyWorkspaceAPICallsUsageItem( + APICallSnapshotV1 dailyWorkspaceAPICallsUsageItem) { + this.dailyWorkspaceAPICallsUsage.add(dailyWorkspaceAPICallsUsageItem); + return this; + } + /** + * The list of daily Workspace API calls count aggregates. + * + * @return dailyWorkspaceAPICallsUsage + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The list of daily Workspace API calls count aggregates.") + public List getDailyWorkspaceAPICallsUsage() { + return dailyWorkspaceAPICallsUsage; + } - public GetDailyWorkspaceAPICallsUsageV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setDailyWorkspaceAPICallsUsage( + List dailyWorkspaceAPICallsUsage) { + this.dailyWorkspaceAPICallsUsage = dailyWorkspaceAPICallsUsage; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDailyWorkspaceAPICallsUsageV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyWorkspaceAPICallsUsageV1Output getDailyWorkspaceAPICallsUsageV1Output = + (GetDailyWorkspaceAPICallsUsageV1Output) o; + return Objects.equals( + this.dailyWorkspaceAPICallsUsage, + getDailyWorkspaceAPICallsUsageV1Output.dailyWorkspaceAPICallsUsage) + && Objects.equals( + this.pagination, getDailyWorkspaceAPICallsUsageV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(dailyWorkspaceAPICallsUsage, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyWorkspaceAPICallsUsageV1Output {\n"); + sb.append(" dailyWorkspaceAPICallsUsage: ") + .append(toIndentedString(dailyWorkspaceAPICallsUsage)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyWorkspaceAPICallsUsageV1Output getDailyWorkspaceAPICallsUsageV1Output = (GetDailyWorkspaceAPICallsUsageV1Output) o; - return Objects.equals(this.dailyWorkspaceAPICallsUsage, getDailyWorkspaceAPICallsUsageV1Output.dailyWorkspaceAPICallsUsage) && - Objects.equals(this.pagination, getDailyWorkspaceAPICallsUsageV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(dailyWorkspaceAPICallsUsage, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyWorkspaceAPICallsUsageV1Output {\n"); - sb.append(" dailyWorkspaceAPICallsUsage: ").append(toIndentedString(dailyWorkspaceAPICallsUsage)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dailyWorkspaceAPICallsUsage"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("dailyWorkspaceAPICallsUsage"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("dailyWorkspaceAPICallsUsage"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("dailyWorkspaceAPICallsUsage"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyWorkspaceAPICallsUsageV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyWorkspaceAPICallsUsageV1Output is not found in the empty JSON string", GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyWorkspaceAPICallsUsageV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDailyWorkspaceAPICallsUsageV1Output" + + " is not found in the empty JSON string", + GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyWorkspaceAPICallsUsageV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyWorkspaceAPICallsUsageV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyWorkspaceAPICallsUsageV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyWorkspaceAPICallsUsageV1Output` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("dailyWorkspaceAPICallsUsage").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dailyWorkspaceAPICallsUsage` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("dailyWorkspaceAPICallsUsage").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("dailyWorkspaceAPICallsUsage").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `dailyWorkspaceAPICallsUsage` to be an array in the JSON string but got `%s`", jsonObj.get("dailyWorkspaceAPICallsUsage").toString())); - } - JsonArray jsonArraydailyWorkspaceAPICallsUsage = jsonObj.getAsJsonArray("dailyWorkspaceAPICallsUsage"); - } + JsonArray jsonArraydailyWorkspaceAPICallsUsage = + jsonObj.getAsJsonArray("dailyWorkspaceAPICallsUsage"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyWorkspaceAPICallsUsageV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyWorkspaceAPICallsUsageV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyWorkspaceAPICallsUsageV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyWorkspaceAPICallsUsageV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyWorkspaceAPICallsUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyWorkspaceAPICallsUsageV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDailyWorkspaceAPICallsUsageV1Output' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyWorkspaceAPICallsUsageV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetDailyWorkspaceAPICallsUsageV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyWorkspaceAPICallsUsageV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyWorkspaceAPICallsUsageV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyWorkspaceAPICallsUsageV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetDailyWorkspaceAPICallsUsageV1Output + */ + public static GetDailyWorkspaceAPICallsUsageV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceAPICallsUsageV1Output.class); } - } - - /** - * Create an instance of GetDailyWorkspaceAPICallsUsageV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyWorkspaceAPICallsUsageV1Output - * @throws IOException if the JSON string is invalid with respect to GetDailyWorkspaceAPICallsUsageV1Output - */ - public static GetDailyWorkspaceAPICallsUsageV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceAPICallsUsageV1Output.class); - } - - /** - * Convert an instance of GetDailyWorkspaceAPICallsUsageV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyWorkspaceAPICallsUsageV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java index 57128990..6d20b0a7 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDailyWorkspaceMTUUsageV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDailyWorkspaceMTUUsage200Response - */ - +/** GetDailyWorkspaceMTUUsage200Response */ public class GetDailyWorkspaceMTUUsage200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDailyWorkspaceMTUUsageV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDailyWorkspaceMTUUsage200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDailyWorkspaceMTUUsageV1Output data; - public GetDailyWorkspaceMTUUsage200Response data(GetDailyWorkspaceMTUUsageV1Output data) { - - this.data = data; - return this; - } + public GetDailyWorkspaceMTUUsage200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDailyWorkspaceMTUUsage200Response data(GetDailyWorkspaceMTUUsageV1Output data) { - public GetDailyWorkspaceMTUUsageV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDailyWorkspaceMTUUsageV1Output getData() { + return data; + } - public void setData(GetDailyWorkspaceMTUUsageV1Output data) { - this.data = data; - } + public void setData(GetDailyWorkspaceMTUUsageV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyWorkspaceMTUUsage200Response getDailyWorkspaceMTUUsage200Response = + (GetDailyWorkspaceMTUUsage200Response) o; + return Objects.equals(this.data, getDailyWorkspaceMTUUsage200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyWorkspaceMTUUsage200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyWorkspaceMTUUsage200Response getDailyWorkspaceMTUUsage200Response = (GetDailyWorkspaceMTUUsage200Response) o; - return Objects.equals(this.data, getDailyWorkspaceMTUUsage200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyWorkspaceMTUUsage200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyWorkspaceMTUUsage200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyWorkspaceMTUUsage200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyWorkspaceMTUUsage200Response is not found in the empty JSON string", GetDailyWorkspaceMTUUsage200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyWorkspaceMTUUsage200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyWorkspaceMTUUsage200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDailyWorkspaceMTUUsage200Response" + + " is not found in the empty JSON string", + GetDailyWorkspaceMTUUsage200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyWorkspaceMTUUsage200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyWorkspaceMTUUsage200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyWorkspaceMTUUsage200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyWorkspaceMTUUsage200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyWorkspaceMTUUsage200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyWorkspaceMTUUsage200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyWorkspaceMTUUsage200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyWorkspaceMTUUsage200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyWorkspaceMTUUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyWorkspaceMTUUsage200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDailyWorkspaceMTUUsage200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyWorkspaceMTUUsage200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetDailyWorkspaceMTUUsage200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyWorkspaceMTUUsage200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyWorkspaceMTUUsage200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyWorkspaceMTUUsage200Response + * @throws IOException if the JSON string is invalid with respect to + * GetDailyWorkspaceMTUUsage200Response + */ + public static GetDailyWorkspaceMTUUsage200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceMTUUsage200Response.class); } - } - - /** - * Create an instance of GetDailyWorkspaceMTUUsage200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyWorkspaceMTUUsage200Response - * @throws IOException if the JSON string is invalid with respect to GetDailyWorkspaceMTUUsage200Response - */ - public static GetDailyWorkspaceMTUUsage200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceMTUUsage200Response.class); - } - - /** - * Convert an instance of GetDailyWorkspaceMTUUsage200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyWorkspaceMTUUsage200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java index c3d31627..cc181bce 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,259 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.MtuSnapshotV1; -import com.segment.publicapi.models.Pagination; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of daily aggregations of Workspace MTU counts. - */ +/** Returns a list of daily aggregations of Workspace MTU counts. */ @ApiModel(description = "Returns a list of daily aggregations of Workspace MTU counts.") - public class GetDailyWorkspaceMTUUsageV1Output { - public static final String SERIALIZED_NAME_DAILY_WORKSPACE_M_T_U_USAGE = "dailyWorkspaceMTUUsage"; - @SerializedName(SERIALIZED_NAME_DAILY_WORKSPACE_M_T_U_USAGE) - private List dailyWorkspaceMTUUsage = new ArrayList<>(); + public static final String SERIALIZED_NAME_DAILY_WORKSPACE_M_T_U_USAGE = + "dailyWorkspaceMTUUsage"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_DAILY_WORKSPACE_M_T_U_USAGE) + private List dailyWorkspaceMTUUsage = new ArrayList<>(); - public GetDailyWorkspaceMTUUsageV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetDailyWorkspaceMTUUsageV1Output dailyWorkspaceMTUUsage(List dailyWorkspaceMTUUsage) { - - this.dailyWorkspaceMTUUsage = dailyWorkspaceMTUUsage; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetDailyWorkspaceMTUUsageV1Output addDailyWorkspaceMTUUsageItem(MtuSnapshotV1 dailyWorkspaceMTUUsageItem) { - this.dailyWorkspaceMTUUsage.add(dailyWorkspaceMTUUsageItem); - return this; - } + public GetDailyWorkspaceMTUUsageV1Output() {} - /** - * The list of daily Workspace MTU count aggregates. - * @return dailyWorkspaceMTUUsage - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of daily Workspace MTU count aggregates.") - - public List getDailyWorkspaceMTUUsage() { - return dailyWorkspaceMTUUsage; - } + public GetDailyWorkspaceMTUUsageV1Output dailyWorkspaceMTUUsage( + List dailyWorkspaceMTUUsage) { + this.dailyWorkspaceMTUUsage = dailyWorkspaceMTUUsage; + return this; + } - public void setDailyWorkspaceMTUUsage(List dailyWorkspaceMTUUsage) { - this.dailyWorkspaceMTUUsage = dailyWorkspaceMTUUsage; - } + public GetDailyWorkspaceMTUUsageV1Output addDailyWorkspaceMTUUsageItem( + MtuSnapshotV1 dailyWorkspaceMTUUsageItem) { + this.dailyWorkspaceMTUUsage.add(dailyWorkspaceMTUUsageItem); + return this; + } + /** + * The list of daily Workspace MTU count aggregates. + * + * @return dailyWorkspaceMTUUsage + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The list of daily Workspace MTU count aggregates.") + public List getDailyWorkspaceMTUUsage() { + return dailyWorkspaceMTUUsage; + } - public GetDailyWorkspaceMTUUsageV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setDailyWorkspaceMTUUsage(List dailyWorkspaceMTUUsage) { + this.dailyWorkspaceMTUUsage = dailyWorkspaceMTUUsage; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDailyWorkspaceMTUUsageV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDailyWorkspaceMTUUsageV1Output getDailyWorkspaceMTUUsageV1Output = + (GetDailyWorkspaceMTUUsageV1Output) o; + return Objects.equals( + this.dailyWorkspaceMTUUsage, + getDailyWorkspaceMTUUsageV1Output.dailyWorkspaceMTUUsage) + && Objects.equals(this.pagination, getDailyWorkspaceMTUUsageV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(dailyWorkspaceMTUUsage, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDailyWorkspaceMTUUsageV1Output {\n"); + sb.append(" dailyWorkspaceMTUUsage: ") + .append(toIndentedString(dailyWorkspaceMTUUsage)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDailyWorkspaceMTUUsageV1Output getDailyWorkspaceMTUUsageV1Output = (GetDailyWorkspaceMTUUsageV1Output) o; - return Objects.equals(this.dailyWorkspaceMTUUsage, getDailyWorkspaceMTUUsageV1Output.dailyWorkspaceMTUUsage) && - Objects.equals(this.pagination, getDailyWorkspaceMTUUsageV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(dailyWorkspaceMTUUsage, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDailyWorkspaceMTUUsageV1Output {\n"); - sb.append(" dailyWorkspaceMTUUsage: ").append(toIndentedString(dailyWorkspaceMTUUsage)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dailyWorkspaceMTUUsage"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("dailyWorkspaceMTUUsage"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("dailyWorkspaceMTUUsage"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("dailyWorkspaceMTUUsage"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDailyWorkspaceMTUUsageV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDailyWorkspaceMTUUsageV1Output is not found in the empty JSON string", GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDailyWorkspaceMTUUsageV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDailyWorkspaceMTUUsageV1Output is" + + " not found in the empty JSON string", + GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDailyWorkspaceMTUUsageV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDailyWorkspaceMTUUsageV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDailyWorkspaceMTUUsageV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDailyWorkspaceMTUUsageV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("dailyWorkspaceMTUUsage").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dailyWorkspaceMTUUsage` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("dailyWorkspaceMTUUsage").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("dailyWorkspaceMTUUsage").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `dailyWorkspaceMTUUsage` to be an array in the JSON string but got `%s`", jsonObj.get("dailyWorkspaceMTUUsage").toString())); - } - JsonArray jsonArraydailyWorkspaceMTUUsage = jsonObj.getAsJsonArray("dailyWorkspaceMTUUsage"); - } + JsonArray jsonArraydailyWorkspaceMTUUsage = + jsonObj.getAsJsonArray("dailyWorkspaceMTUUsage"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDailyWorkspaceMTUUsageV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDailyWorkspaceMTUUsageV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDailyWorkspaceMTUUsageV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDailyWorkspaceMTUUsageV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDailyWorkspaceMTUUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDailyWorkspaceMTUUsageV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDailyWorkspaceMTUUsageV1Output' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDailyWorkspaceMTUUsageV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDailyWorkspaceMTUUsageV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDailyWorkspaceMTUUsageV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDailyWorkspaceMTUUsageV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDailyWorkspaceMTUUsageV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetDailyWorkspaceMTUUsageV1Output + */ + public static GetDailyWorkspaceMTUUsageV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceMTUUsageV1Output.class); } - } - - /** - * Create an instance of GetDailyWorkspaceMTUUsageV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDailyWorkspaceMTUUsageV1Output - * @throws IOException if the JSON string is invalid with respect to GetDailyWorkspaceMTUUsageV1Output - */ - public static GetDailyWorkspaceMTUUsageV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDailyWorkspaceMTUUsageV1Output.class); - } - - /** - * Convert an instance of GetDailyWorkspaceMTUUsageV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDailyWorkspaceMTUUsageV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java index 81cda05d..11e1c5d1 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDestinationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDestination200Response - */ - +/** GetDestination200Response */ public class GetDestination200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDestinationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDestination200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDestinationV1Output data; - public GetDestination200Response data(GetDestinationV1Output data) { - - this.data = data; - return this; - } + public GetDestination200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDestination200Response data(GetDestinationV1Output data) { - public GetDestinationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDestinationV1Output getData() { + return data; + } - public void setData(GetDestinationV1Output data) { - this.data = data; - } + public void setData(GetDestinationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDestination200Response getDestination200Response = (GetDestination200Response) o; + return Objects.equals(this.data, getDestination200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDestination200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDestination200Response getDestination200Response = (GetDestination200Response) o; - return Objects.equals(this.data, getDestination200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDestination200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestination200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDestination200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDestination200Response is not found in the empty JSON string", GetDestination200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetDestination200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDestination200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDestination200Response is not found" + + " in the empty JSON string", + GetDestination200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDestination200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDestination200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDestination200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDestination200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDestination200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDestination200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDestination200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDestination200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDestination200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDestination200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetDestination200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDestination200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDestination200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDestination200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDestination200Response + * @throws IOException if the JSON string is invalid with respect to GetDestination200Response + */ + public static GetDestination200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDestination200Response.class); } - } - - /** - * Create an instance of GetDestination200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDestination200Response - * @throws IOException if the JSON string is invalid with respect to GetDestination200Response - */ - public static GetDestination200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDestination200Response.class); - } - - /** - * Convert an instance of GetDestination200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDestination200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java index fff6bf73..a73a66ba 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,190 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDestinationMetadataV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDestinationMetadata200Response - */ - +/** GetDestinationMetadata200Response */ public class GetDestinationMetadata200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDestinationMetadataV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDestinationMetadata200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDestinationMetadataV1Output data; - public GetDestinationMetadata200Response data(GetDestinationMetadataV1Output data) { - - this.data = data; - return this; - } + public GetDestinationMetadata200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDestinationMetadata200Response data(GetDestinationMetadataV1Output data) { - public GetDestinationMetadataV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDestinationMetadataV1Output getData() { + return data; + } - public void setData(GetDestinationMetadataV1Output data) { - this.data = data; - } + public void setData(GetDestinationMetadataV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDestinationMetadata200Response getDestinationMetadata200Response = + (GetDestinationMetadata200Response) o; + return Objects.equals(this.data, getDestinationMetadata200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDestinationMetadata200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDestinationMetadata200Response getDestinationMetadata200Response = (GetDestinationMetadata200Response) o; - return Objects.equals(this.data, getDestinationMetadata200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDestinationMetadata200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestinationMetadata200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDestinationMetadata200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDestinationMetadata200Response is not found in the empty JSON string", GetDestinationMetadata200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDestinationMetadata200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDestinationMetadata200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDestinationMetadata200Response is" + + " not found in the empty JSON string", + GetDestinationMetadata200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDestinationMetadata200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDestinationMetadata200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDestinationMetadata200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDestinationMetadata200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDestinationMetadata200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDestinationMetadata200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDestinationMetadata200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDestinationMetadata200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDestinationMetadata200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDestinationMetadata200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDestinationMetadata200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDestinationMetadata200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDestinationMetadata200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDestinationMetadata200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDestinationMetadata200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDestinationMetadata200Response + * @throws IOException if the JSON string is invalid with respect to + * GetDestinationMetadata200Response + */ + public static GetDestinationMetadata200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDestinationMetadata200Response.class); } - } - - /** - * Create an instance of GetDestinationMetadata200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDestinationMetadata200Response - * @throws IOException if the JSON string is invalid with respect to GetDestinationMetadata200Response - */ - public static GetDestinationMetadata200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDestinationMetadata200Response.class); - } - - /** - * Convert an instance of GetDestinationMetadata200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDestinationMetadata200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java index d68a1f2a..740dbd1d 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,206 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationMetadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a Destination catalog item. - */ +/** Returns a Destination catalog item. */ @ApiModel(description = "Returns a Destination catalog item.") - public class GetDestinationMetadataV1Output { - public static final String SERIALIZED_NAME_DESTINATION_METADATA = "destinationMetadata"; - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA) - private DestinationMetadata destinationMetadata; + public static final String SERIALIZED_NAME_DESTINATION_METADATA = "destinationMetadata"; - public GetDestinationMetadataV1Output() { - } + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA) + private DestinationMetadata destinationMetadata; - public GetDestinationMetadataV1Output destinationMetadata(DestinationMetadata destinationMetadata) { - - this.destinationMetadata = destinationMetadata; - return this; - } + public GetDestinationMetadataV1Output() {} - /** - * Get destinationMetadata - * @return destinationMetadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDestinationMetadataV1Output destinationMetadata( + DestinationMetadata destinationMetadata) { - public DestinationMetadata getDestinationMetadata() { - return destinationMetadata; - } + this.destinationMetadata = destinationMetadata; + return this; + } + /** + * Get destinationMetadata + * + * @return destinationMetadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public DestinationMetadata getDestinationMetadata() { + return destinationMetadata; + } - public void setDestinationMetadata(DestinationMetadata destinationMetadata) { - this.destinationMetadata = destinationMetadata; - } + public void setDestinationMetadata(DestinationMetadata destinationMetadata) { + this.destinationMetadata = destinationMetadata; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDestinationMetadataV1Output getDestinationMetadataV1Output = + (GetDestinationMetadataV1Output) o; + return Objects.equals( + this.destinationMetadata, getDestinationMetadataV1Output.destinationMetadata); + } + @Override + public int hashCode() { + return Objects.hash(destinationMetadata); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDestinationMetadataV1Output {\n"); + sb.append(" destinationMetadata: ") + .append(toIndentedString(destinationMetadata)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDestinationMetadataV1Output getDestinationMetadataV1Output = (GetDestinationMetadataV1Output) o; - return Objects.equals(this.destinationMetadata, getDestinationMetadataV1Output.destinationMetadata); - } - - @Override - public int hashCode() { - return Objects.hash(destinationMetadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDestinationMetadataV1Output {\n"); - sb.append(" destinationMetadata: ").append(toIndentedString(destinationMetadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("destinationMetadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("destinationMetadata"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("destinationMetadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("destinationMetadata"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestinationMetadataV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDestinationMetadataV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDestinationMetadataV1Output is not found in the empty JSON string", GetDestinationMetadataV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDestinationMetadataV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDestinationMetadataV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDestinationMetadataV1Output is not" + + " found in the empty JSON string", + GetDestinationMetadataV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDestinationMetadataV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDestinationMetadataV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDestinationMetadataV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDestinationMetadataV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDestinationMetadataV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDestinationMetadataV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDestinationMetadataV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDestinationMetadataV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDestinationMetadataV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDestinationMetadataV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDestinationMetadataV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDestinationMetadataV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDestinationMetadataV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDestinationMetadataV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDestinationMetadataV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDestinationMetadataV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDestinationMetadataV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDestinationMetadataV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetDestinationMetadataV1Output + */ + public static GetDestinationMetadataV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDestinationMetadataV1Output.class); } - } - - /** - * Create an instance of GetDestinationMetadataV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDestinationMetadataV1Output - * @throws IOException if the JSON string is invalid with respect to GetDestinationMetadataV1Output - */ - public static GetDestinationMetadataV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDestinationMetadataV1Output.class); - } - - /** - * Convert an instance of GetDestinationMetadataV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDestinationMetadataV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java index c5820bc8..c33e5aeb 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Destination; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a single Destination by its id. - */ +/** Returns a single Destination by its id. */ @ApiModel(description = "Returns a single Destination by its id.") - public class GetDestinationV1Output { - public static final String SERIALIZED_NAME_DESTINATION = "destination"; - @SerializedName(SERIALIZED_NAME_DESTINATION) - private Destination destination; + public static final String SERIALIZED_NAME_DESTINATION = "destination"; - public GetDestinationV1Output() { - } + @SerializedName(SERIALIZED_NAME_DESTINATION) + private Destination destination; - public GetDestinationV1Output destination(Destination destination) { - - this.destination = destination; - return this; - } + public GetDestinationV1Output() {} - /** - * Get destination - * @return destination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDestinationV1Output destination(Destination destination) { - public Destination getDestination() { - return destination; - } + this.destination = destination; + return this; + } + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Destination getDestination() { + return destination; + } - public void setDestination(Destination destination) { - this.destination = destination; - } + public void setDestination(Destination destination) { + this.destination = destination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDestinationV1Output getDestinationV1Output = (GetDestinationV1Output) o; + return Objects.equals(this.destination, getDestinationV1Output.destination); + } + @Override + public int hashCode() { + return Objects.hash(destination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDestinationV1Output {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDestinationV1Output getDestinationV1Output = (GetDestinationV1Output) o; - return Objects.equals(this.destination, getDestinationV1Output.destination); - } - - @Override - public int hashCode() { - return Objects.hash(destination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDestinationV1Output {\n"); - sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("destination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("destination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("destination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("destination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestinationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDestinationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDestinationV1Output is not found in the empty JSON string", GetDestinationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetDestinationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDestinationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDestinationV1Output is not found in" + + " the empty JSON string", + GetDestinationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDestinationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDestinationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDestinationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDestinationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDestinationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDestinationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDestinationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDestinationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDestinationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDestinationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDestinationV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetDestinationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDestinationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDestinationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDestinationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDestinationV1Output + * @throws IOException if the JSON string is invalid with respect to GetDestinationV1Output + */ + public static GetDestinationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDestinationV1Output.class); } - } - - /** - * Create an instance of GetDestinationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDestinationV1Output - * @throws IOException if the JSON string is invalid with respect to GetDestinationV1Output - */ - public static GetDestinationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDestinationV1Output.class); - } - - /** - * Convert an instance of GetDestinationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDestinationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java index edc048f2..729c746f 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,190 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetDestinationsCatalogV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetDestinationsCatalog200Response - */ - +/** GetDestinationsCatalog200Response */ public class GetDestinationsCatalog200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetDestinationsCatalogV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetDestinationsCatalog200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetDestinationsCatalogV1Output data; - public GetDestinationsCatalog200Response data(GetDestinationsCatalogV1Output data) { - - this.data = data; - return this; - } + public GetDestinationsCatalog200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetDestinationsCatalog200Response data(GetDestinationsCatalogV1Output data) { - public GetDestinationsCatalogV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetDestinationsCatalogV1Output getData() { + return data; + } - public void setData(GetDestinationsCatalogV1Output data) { - this.data = data; - } + public void setData(GetDestinationsCatalogV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDestinationsCatalog200Response getDestinationsCatalog200Response = + (GetDestinationsCatalog200Response) o; + return Objects.equals(this.data, getDestinationsCatalog200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDestinationsCatalog200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDestinationsCatalog200Response getDestinationsCatalog200Response = (GetDestinationsCatalog200Response) o; - return Objects.equals(this.data, getDestinationsCatalog200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDestinationsCatalog200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestinationsCatalog200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDestinationsCatalog200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDestinationsCatalog200Response is not found in the empty JSON string", GetDestinationsCatalog200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDestinationsCatalog200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDestinationsCatalog200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDestinationsCatalog200Response is" + + " not found in the empty JSON string", + GetDestinationsCatalog200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDestinationsCatalog200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDestinationsCatalog200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDestinationsCatalog200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDestinationsCatalog200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDestinationsCatalog200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDestinationsCatalog200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDestinationsCatalog200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDestinationsCatalog200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDestinationsCatalog200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDestinationsCatalog200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDestinationsCatalog200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDestinationsCatalog200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDestinationsCatalog200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDestinationsCatalog200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDestinationsCatalog200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDestinationsCatalog200Response + * @throws IOException if the JSON string is invalid with respect to + * GetDestinationsCatalog200Response + */ + public static GetDestinationsCatalog200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDestinationsCatalog200Response.class); } - } - - /** - * Create an instance of GetDestinationsCatalog200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDestinationsCatalog200Response - * @throws IOException if the JSON string is invalid with respect to GetDestinationsCatalog200Response - */ - public static GetDestinationsCatalog200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDestinationsCatalog200Response.class); - } - - /** - * Convert an instance of GetDestinationsCatalog200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDestinationsCatalog200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java index af4e3cf2..3699e373 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,260 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.DestinationMetadataV1; -import com.segment.publicapi.models.Pagination; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of all Destination catalog items contained within a given page. - */ -@ApiModel(description = "Returns a list of all Destination catalog items contained within a given page.") - +/** Returns a list of all Destination catalog items contained within a given page. */ +@ApiModel( + description = + "Returns a list of all Destination catalog items contained within a given page.") public class GetDestinationsCatalogV1Output { - public static final String SERIALIZED_NAME_DESTINATIONS_CATALOG = "destinationsCatalog"; - @SerializedName(SERIALIZED_NAME_DESTINATIONS_CATALOG) - private List destinationsCatalog = new ArrayList<>(); + public static final String SERIALIZED_NAME_DESTINATIONS_CATALOG = "destinationsCatalog"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_DESTINATIONS_CATALOG) + private List destinationsCatalog = new ArrayList<>(); - public GetDestinationsCatalogV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetDestinationsCatalogV1Output destinationsCatalog(List destinationsCatalog) { - - this.destinationsCatalog = destinationsCatalog; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetDestinationsCatalogV1Output addDestinationsCatalogItem(DestinationMetadataV1 destinationsCatalogItem) { - this.destinationsCatalog.add(destinationsCatalogItem); - return this; - } + public GetDestinationsCatalogV1Output() {} - /** - * All Destination catalog items contained within the requested page. - * @return destinationsCatalog - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All Destination catalog items contained within the requested page.") - - public List getDestinationsCatalog() { - return destinationsCatalog; - } + public GetDestinationsCatalogV1Output destinationsCatalog( + List destinationsCatalog) { + this.destinationsCatalog = destinationsCatalog; + return this; + } - public void setDestinationsCatalog(List destinationsCatalog) { - this.destinationsCatalog = destinationsCatalog; - } + public GetDestinationsCatalogV1Output addDestinationsCatalogItem( + DestinationMetadataV1 destinationsCatalogItem) { + this.destinationsCatalog.add(destinationsCatalogItem); + return this; + } + /** + * All Destination catalog items contained within the requested page. + * + * @return destinationsCatalog + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "All Destination catalog items contained within the requested page.") + public List getDestinationsCatalog() { + return destinationsCatalog; + } - public GetDestinationsCatalogV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setDestinationsCatalog(List destinationsCatalog) { + this.destinationsCatalog = destinationsCatalog; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetDestinationsCatalogV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDestinationsCatalogV1Output getDestinationsCatalogV1Output = + (GetDestinationsCatalogV1Output) o; + return Objects.equals( + this.destinationsCatalog, + getDestinationsCatalogV1Output.destinationsCatalog) + && Objects.equals(this.pagination, getDestinationsCatalogV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(destinationsCatalog, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetDestinationsCatalogV1Output {\n"); + sb.append(" destinationsCatalog: ") + .append(toIndentedString(destinationsCatalog)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetDestinationsCatalogV1Output getDestinationsCatalogV1Output = (GetDestinationsCatalogV1Output) o; - return Objects.equals(this.destinationsCatalog, getDestinationsCatalogV1Output.destinationsCatalog) && - Objects.equals(this.pagination, getDestinationsCatalogV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(destinationsCatalog, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetDestinationsCatalogV1Output {\n"); - sb.append(" destinationsCatalog: ").append(toIndentedString(destinationsCatalog)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("destinationsCatalog"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("destinationsCatalog"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("destinationsCatalog"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("destinationsCatalog"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestinationsCatalogV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetDestinationsCatalogV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetDestinationsCatalogV1Output is not found in the empty JSON string", GetDestinationsCatalogV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetDestinationsCatalogV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetDestinationsCatalogV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetDestinationsCatalogV1Output is not" + + " found in the empty JSON string", + GetDestinationsCatalogV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetDestinationsCatalogV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetDestinationsCatalogV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetDestinationsCatalogV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetDestinationsCatalogV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetDestinationsCatalogV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetDestinationsCatalogV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("destinationsCatalog").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationsCatalog` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("destinationsCatalog").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("destinationsCatalog").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `destinationsCatalog` to be an array in the JSON string but got `%s`", jsonObj.get("destinationsCatalog").toString())); - } - JsonArray jsonArraydestinationsCatalog = jsonObj.getAsJsonArray("destinationsCatalog"); - } + JsonArray jsonArraydestinationsCatalog = jsonObj.getAsJsonArray("destinationsCatalog"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetDestinationsCatalogV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetDestinationsCatalogV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetDestinationsCatalogV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetDestinationsCatalogV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetDestinationsCatalogV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetDestinationsCatalogV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDestinationsCatalogV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetDestinationsCatalogV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetDestinationsCatalogV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetDestinationsCatalogV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetDestinationsCatalogV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetDestinationsCatalogV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetDestinationsCatalogV1Output + */ + public static GetDestinationsCatalogV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDestinationsCatalogV1Output.class); } - } - - /** - * Create an instance of GetDestinationsCatalogV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetDestinationsCatalogV1Output - * @throws IOException if the JSON string is invalid with respect to GetDestinationsCatalogV1Output - */ - public static GetDestinationsCatalogV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetDestinationsCatalogV1Output.class); - } - - /** - * Convert an instance of GetDestinationsCatalogV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetDestinationsCatalogV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java index e95d48d7..cf4ab1a8 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,195 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetEventsVolumeFromWorkspace200Response - */ - +/** GetEventsVolumeFromWorkspace200Response */ public class GetEventsVolumeFromWorkspace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetEventsVolumeFromWorkspaceV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetEventsVolumeFromWorkspace200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetEventsVolumeFromWorkspaceV1Output data; - public GetEventsVolumeFromWorkspace200Response data(GetEventsVolumeFromWorkspaceV1Output data) { - - this.data = data; - return this; - } + public GetEventsVolumeFromWorkspace200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetEventsVolumeFromWorkspace200Response data(GetEventsVolumeFromWorkspaceV1Output data) { - public GetEventsVolumeFromWorkspaceV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetEventsVolumeFromWorkspaceV1Output getData() { + return data; + } - public void setData(GetEventsVolumeFromWorkspaceV1Output data) { - this.data = data; - } + public void setData(GetEventsVolumeFromWorkspaceV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace200Response = + (GetEventsVolumeFromWorkspace200Response) o; + return Objects.equals(this.data, getEventsVolumeFromWorkspace200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventsVolumeFromWorkspace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace200Response = (GetEventsVolumeFromWorkspace200Response) o; - return Objects.equals(this.data, getEventsVolumeFromWorkspace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetEventsVolumeFromWorkspace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetEventsVolumeFromWorkspace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetEventsVolumeFromWorkspace200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetEventsVolumeFromWorkspace200Response is not found in the empty JSON string", GetEventsVolumeFromWorkspace200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetEventsVolumeFromWorkspace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetEventsVolumeFromWorkspace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetEventsVolumeFromWorkspace200Response is not found in the" + + " empty JSON string", + GetEventsVolumeFromWorkspace200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetEventsVolumeFromWorkspace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetEventsVolumeFromWorkspace200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetEventsVolumeFromWorkspace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetEventsVolumeFromWorkspace200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetEventsVolumeFromWorkspace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetEventsVolumeFromWorkspace200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetEventsVolumeFromWorkspace200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetEventsVolumeFromWorkspace200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetEventsVolumeFromWorkspace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetEventsVolumeFromWorkspace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetEventsVolumeFromWorkspace200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetEventsVolumeFromWorkspace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetEventsVolumeFromWorkspace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetEventsVolumeFromWorkspace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetEventsVolumeFromWorkspace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEventsVolumeFromWorkspace200Response + * @throws IOException if the JSON string is invalid with respect to + * GetEventsVolumeFromWorkspace200Response + */ + public static GetEventsVolumeFromWorkspace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspace200Response.class); } - } - - /** - * Create an instance of GetEventsVolumeFromWorkspace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetEventsVolumeFromWorkspace200Response - * @throws IOException if the JSON string is invalid with respect to GetEventsVolumeFromWorkspace200Response - */ - public static GetEventsVolumeFromWorkspace200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspace200Response.class); - } - - /** - * Convert an instance of GetEventsVolumeFromWorkspace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetEventsVolumeFromWorkspace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index c1442717..8fdebbb8 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,250 +10,263 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Pagination; -import com.segment.publicapi.models.SourceEventVolumeV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetEventsVolumeFromWorkspaceV1Output represents the results given the input query. - */ -@ApiModel(description = "GetEventsVolumeFromWorkspaceV1Output represents the results given the input query.") - +/** GetEventsVolumeFromWorkspaceV1Output represents the results given the input query. */ +@ApiModel( + description = + "GetEventsVolumeFromWorkspaceV1Output represents the results given the input" + + " query.") public class GetEventsVolumeFromWorkspaceV1Output { - public static final String SERIALIZED_NAME_RESULT = "result"; - @SerializedName(SERIALIZED_NAME_RESULT) - private List result = new ArrayList<>(); + public static final String SERIALIZED_NAME_RESULT = "result"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_RESULT) + private List result = new ArrayList<>(); - public GetEventsVolumeFromWorkspaceV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetEventsVolumeFromWorkspaceV1Output result(List result) { - - this.result = result; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetEventsVolumeFromWorkspaceV1Output addResultItem(SourceEventVolumeV1 resultItem) { - this.result.add(resultItem); - return this; - } + public GetEventsVolumeFromWorkspaceV1Output() {} - /** - * The resultant list of series broken down by the dimensions requested over the time frame requested and ordered by the total count of events in all series. Note: The limit of entries returned is 5000. - * @return result - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The resultant list of series broken down by the dimensions requested over the time frame requested and ordered by the total count of events in all series. Note: The limit of entries returned is 5000.") - - public List getResult() { - return result; - } + public GetEventsVolumeFromWorkspaceV1Output result(List result) { + this.result = result; + return this; + } - public void setResult(List result) { - this.result = result; - } + public GetEventsVolumeFromWorkspaceV1Output addResultItem(SourceEventVolumeV1 resultItem) { + this.result.add(resultItem); + return this; + } + /** + * The resultant list of series broken down by the dimensions requested over the time frame + * requested and ordered by the total count of events in all series. Note: The limit of entries + * returned is 5000. + * + * @return result + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The resultant list of series broken down by the dimensions requested over the" + + " time frame requested and ordered by the total count of events in all" + + " series. Note: The limit of entries returned is 5000.") + public List getResult() { + return result; + } - public GetEventsVolumeFromWorkspaceV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setResult(List result) { + this.result = result; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetEventsVolumeFromWorkspaceV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventsVolumeFromWorkspaceV1Output getEventsVolumeFromWorkspaceV1Output = + (GetEventsVolumeFromWorkspaceV1Output) o; + return Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) + && Objects.equals(this.pagination, getEventsVolumeFromWorkspaceV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(result, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventsVolumeFromWorkspaceV1Output {\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetEventsVolumeFromWorkspaceV1Output getEventsVolumeFromWorkspaceV1Output = (GetEventsVolumeFromWorkspaceV1Output) o; - return Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) && - Objects.equals(this.pagination, getEventsVolumeFromWorkspaceV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(result, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetEventsVolumeFromWorkspaceV1Output {\n"); - sb.append(" result: ").append(toIndentedString(result)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("result"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("result"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("result"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("result"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetEventsVolumeFromWorkspaceV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetEventsVolumeFromWorkspaceV1Output is not found in the empty JSON string", GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetEventsVolumeFromWorkspaceV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetEventsVolumeFromWorkspaceV1Output" + + " is not found in the empty JSON string", + GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetEventsVolumeFromWorkspaceV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetEventsVolumeFromWorkspaceV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetEventsVolumeFromWorkspaceV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetEventsVolumeFromWorkspaceV1Output` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("result").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `result` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("result").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("result").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `result` to be an array in the JSON string but got `%s`", jsonObj.get("result").toString())); - } - JsonArray jsonArrayresult = jsonObj.getAsJsonArray("result"); - } + JsonArray jsonArrayresult = jsonObj.getAsJsonArray("result"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetEventsVolumeFromWorkspaceV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetEventsVolumeFromWorkspaceV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetEventsVolumeFromWorkspaceV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetEventsVolumeFromWorkspaceV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetEventsVolumeFromWorkspaceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetEventsVolumeFromWorkspaceV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetEventsVolumeFromWorkspaceV1Output' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetEventsVolumeFromWorkspaceV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetEventsVolumeFromWorkspaceV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetEventsVolumeFromWorkspaceV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetEventsVolumeFromWorkspaceV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEventsVolumeFromWorkspaceV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetEventsVolumeFromWorkspaceV1Output + */ + public static GetEventsVolumeFromWorkspaceV1Output fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspaceV1Output.class); } - } - - /** - * Create an instance of GetEventsVolumeFromWorkspaceV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetEventsVolumeFromWorkspaceV1Output - * @throws IOException if the JSON string is invalid with respect to GetEventsVolumeFromWorkspaceV1Output - */ - public static GetEventsVolumeFromWorkspaceV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspaceV1Output.class); - } - - /** - * Convert an instance of GetEventsVolumeFromWorkspaceV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetEventsVolumeFromWorkspaceV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java index bfb94747..40be0ad8 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,190 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetFilterInDestinationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetFilterInDestination200Response - */ - +/** GetFilterInDestination200Response */ public class GetFilterInDestination200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetFilterInDestinationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetFilterInDestination200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetFilterInDestinationV1Output data; - public GetFilterInDestination200Response data(GetFilterInDestinationV1Output data) { - - this.data = data; - return this; - } + public GetFilterInDestination200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetFilterInDestination200Response data(GetFilterInDestinationV1Output data) { - public GetFilterInDestinationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetFilterInDestinationV1Output getData() { + return data; + } - public void setData(GetFilterInDestinationV1Output data) { - this.data = data; - } + public void setData(GetFilterInDestinationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFilterInDestination200Response getFilterInDestination200Response = + (GetFilterInDestination200Response) o; + return Objects.equals(this.data, getFilterInDestination200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFilterInDestination200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetFilterInDestination200Response getFilterInDestination200Response = (GetFilterInDestination200Response) o; - return Objects.equals(this.data, getFilterInDestination200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetFilterInDestination200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetFilterInDestination200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetFilterInDestination200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetFilterInDestination200Response is not found in the empty JSON string", GetFilterInDestination200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetFilterInDestination200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetFilterInDestination200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFilterInDestination200Response is" + + " not found in the empty JSON string", + GetFilterInDestination200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetFilterInDestination200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetFilterInDestination200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetFilterInDestination200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFilterInDestination200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetFilterInDestination200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetFilterInDestination200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetFilterInDestination200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetFilterInDestination200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetFilterInDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFilterInDestination200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFilterInDestination200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetFilterInDestination200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFilterInDestination200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFilterInDestination200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFilterInDestination200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFilterInDestination200Response + * @throws IOException if the JSON string is invalid with respect to + * GetFilterInDestination200Response + */ + public static GetFilterInDestination200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFilterInDestination200Response.class); } - } - - /** - * Create an instance of GetFilterInDestination200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetFilterInDestination200Response - * @throws IOException if the JSON string is invalid with respect to GetFilterInDestination200Response - */ - public static GetFilterInDestination200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetFilterInDestination200Response.class); - } - - /** - * Convert an instance of GetFilterInDestination200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetFilterInDestination200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java index 74e53a41..5408adb4 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,202 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Filter1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Output for GetDestinationFiltersV1. - */ +/** Output for GetDestinationFiltersV1. */ @ApiModel(description = "Output for GetDestinationFiltersV1.") - public class GetFilterInDestinationV1Output { - public static final String SERIALIZED_NAME_FILTER = "filter"; - @SerializedName(SERIALIZED_NAME_FILTER) - private Filter1 filter; + public static final String SERIALIZED_NAME_FILTER = "filter"; - public GetFilterInDestinationV1Output() { - } + @SerializedName(SERIALIZED_NAME_FILTER) + private Filter1 filter; - public GetFilterInDestinationV1Output filter(Filter1 filter) { - - this.filter = filter; - return this; - } + public GetFilterInDestinationV1Output() {} - /** - * Get filter - * @return filter - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetFilterInDestinationV1Output filter(Filter1 filter) { - public Filter1 getFilter() { - return filter; - } + this.filter = filter; + return this; + } + /** + * Get filter + * + * @return filter + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Filter1 getFilter() { + return filter; + } - public void setFilter(Filter1 filter) { - this.filter = filter; - } + public void setFilter(Filter1 filter) { + this.filter = filter; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFilterInDestinationV1Output getFilterInDestinationV1Output = + (GetFilterInDestinationV1Output) o; + return Objects.equals(this.filter, getFilterInDestinationV1Output.filter); + } + @Override + public int hashCode() { + return Objects.hash(filter); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFilterInDestinationV1Output {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetFilterInDestinationV1Output getFilterInDestinationV1Output = (GetFilterInDestinationV1Output) o; - return Objects.equals(this.filter, getFilterInDestinationV1Output.filter); - } - - @Override - public int hashCode() { - return Objects.hash(filter); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetFilterInDestinationV1Output {\n"); - sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filter"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filter"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filter"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetFilterInDestinationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetFilterInDestinationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetFilterInDestinationV1Output is not found in the empty JSON string", GetFilterInDestinationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetFilterInDestinationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetFilterInDestinationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFilterInDestinationV1Output is not" + + " found in the empty JSON string", + GetFilterInDestinationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetFilterInDestinationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetFilterInDestinationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetFilterInDestinationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFilterInDestinationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetFilterInDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetFilterInDestinationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetFilterInDestinationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetFilterInDestinationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetFilterInDestinationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetFilterInDestinationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetFilterInDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFilterInDestinationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFilterInDestinationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetFilterInDestinationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFilterInDestinationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFilterInDestinationV1Output read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFilterInDestinationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFilterInDestinationV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetFilterInDestinationV1Output + */ + public static GetFilterInDestinationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFilterInDestinationV1Output.class); } - } - - /** - * Create an instance of GetFilterInDestinationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetFilterInDestinationV1Output - * @throws IOException if the JSON string is invalid with respect to GetFilterInDestinationV1Output - */ - public static GetFilterInDestinationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetFilterInDestinationV1Output.class); - } - - /** - * Convert an instance of GetFilterInDestinationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetFilterInDestinationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java index 49fca5c9..705108ed 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetFunctionV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetFunction200Response - */ - +/** GetFunction200Response */ public class GetFunction200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetFunctionV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetFunction200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetFunctionV1Output data; - public GetFunction200Response data(GetFunctionV1Output data) { - - this.data = data; - return this; - } + public GetFunction200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetFunction200Response data(GetFunctionV1Output data) { - public GetFunctionV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetFunctionV1Output getData() { + return data; + } - public void setData(GetFunctionV1Output data) { - this.data = data; - } + public void setData(GetFunctionV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFunction200Response getFunction200Response = (GetFunction200Response) o; + return Objects.equals(this.data, getFunction200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFunction200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetFunction200Response getFunction200Response = (GetFunction200Response) o; - return Objects.equals(this.data, getFunction200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetFunction200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetFunction200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetFunction200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetFunction200Response is not found in the empty JSON string", GetFunction200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetFunction200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetFunction200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFunction200Response is not found in" + + " the empty JSON string", + GetFunction200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetFunction200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetFunction200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetFunction200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFunction200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetFunction200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetFunction200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetFunction200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetFunction200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetFunction200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFunction200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFunction200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetFunction200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFunction200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFunction200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFunction200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFunction200Response + * @throws IOException if the JSON string is invalid with respect to GetFunction200Response + */ + public static GetFunction200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFunction200Response.class); } - } - - /** - * Create an instance of GetFunction200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetFunction200Response - * @throws IOException if the JSON string is invalid with respect to GetFunction200Response - */ - public static GetFunction200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetFunction200Response.class); - } - - /** - * Convert an instance of GetFunction200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetFunction200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 7bd7cae8..8f033da8 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Function; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Gets a single Function. - */ +/** Gets a single Function. */ @ApiModel(description = "Gets a single Function.") - public class GetFunctionV1Output { - public static final String SERIALIZED_NAME_FUNCTION = "function"; - @SerializedName(SERIALIZED_NAME_FUNCTION) - private Function function; + public static final String SERIALIZED_NAME_FUNCTION = "function"; - public GetFunctionV1Output() { - } + @SerializedName(SERIALIZED_NAME_FUNCTION) + private Function function; - public GetFunctionV1Output function(Function function) { - - this.function = function; - return this; - } + public GetFunctionV1Output() {} - /** - * Get function - * @return function - **/ - @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "") + public GetFunctionV1Output function(Function function) { - public Function getFunction() { - return function; - } + this.function = function; + return this; + } + /** + * Get function + * + * @return function + */ + @javax.annotation.Nullable + @ApiModelProperty(required = true, value = "") + public Function getFunction() { + return function; + } - public void setFunction(Function function) { - this.function = function; - } + public void setFunction(Function function) { + this.function = function; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFunctionV1Output getFunctionV1Output = (GetFunctionV1Output) o; + return Objects.equals(this.function, getFunctionV1Output.function); + } + @Override + public int hashCode() { + return Objects.hash(function); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFunctionV1Output {\n"); + sb.append(" function: ").append(toIndentedString(function)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetFunctionV1Output getFunctionV1Output = (GetFunctionV1Output) o; - return Objects.equals(this.function, getFunctionV1Output.function); - } - - @Override - public int hashCode() { - return Objects.hash(function); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetFunctionV1Output {\n"); - sb.append(" function: ").append(toIndentedString(function)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("function"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("function"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("function"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("function"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetFunctionV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetFunctionV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetFunctionV1Output is not found in the empty JSON string", GetFunctionV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetFunctionV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetFunctionV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFunctionV1Output is not found in" + + " the empty JSON string", + GetFunctionV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetFunctionV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetFunctionV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetFunctionV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFunctionV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetFunctionV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetFunctionV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetFunctionV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetFunctionV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetFunctionV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetFunctionV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetFunctionV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFunctionV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFunctionV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetFunctionV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFunctionV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFunctionV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFunctionV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFunctionV1Output + * @throws IOException if the JSON string is invalid with respect to GetFunctionV1Output + */ + public static GetFunctionV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFunctionV1Output.class); } - } - - /** - * Create an instance of GetFunctionV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetFunctionV1Output - * @throws IOException if the JSON string is invalid with respect to GetFunctionV1Output - */ - public static GetFunctionV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetFunctionV1Output.class); - } - - /** - * Convert an instance of GetFunctionV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetFunctionV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java index 3ec98714..ccf11178 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,193 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetLatestFromEdgeFunctionsAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetLatestFromEdgeFunctions200Response - */ - +/** GetLatestFromEdgeFunctions200Response */ public class GetLatestFromEdgeFunctions200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetLatestFromEdgeFunctionsAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetLatestFromEdgeFunctions200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetLatestFromEdgeFunctionsAlphaOutput data; - public GetLatestFromEdgeFunctions200Response data(GetLatestFromEdgeFunctionsAlphaOutput data) { - - this.data = data; - return this; - } + public GetLatestFromEdgeFunctions200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetLatestFromEdgeFunctions200Response data(GetLatestFromEdgeFunctionsAlphaOutput data) { - public GetLatestFromEdgeFunctionsAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetLatestFromEdgeFunctionsAlphaOutput getData() { + return data; + } - public void setData(GetLatestFromEdgeFunctionsAlphaOutput data) { - this.data = data; - } + public void setData(GetLatestFromEdgeFunctionsAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions200Response = + (GetLatestFromEdgeFunctions200Response) o; + return Objects.equals(this.data, getLatestFromEdgeFunctions200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLatestFromEdgeFunctions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions200Response = (GetLatestFromEdgeFunctions200Response) o; - return Objects.equals(this.data, getLatestFromEdgeFunctions200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLatestFromEdgeFunctions200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetLatestFromEdgeFunctions200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetLatestFromEdgeFunctions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetLatestFromEdgeFunctions200Response is not found in the empty JSON string", GetLatestFromEdgeFunctions200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetLatestFromEdgeFunctions200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetLatestFromEdgeFunctions200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetLatestFromEdgeFunctions200Response" + + " is not found in the empty JSON string", + GetLatestFromEdgeFunctions200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetLatestFromEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetLatestFromEdgeFunctions200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetLatestFromEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetLatestFromEdgeFunctions200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetLatestFromEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetLatestFromEdgeFunctions200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetLatestFromEdgeFunctions200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetLatestFromEdgeFunctions200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetLatestFromEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLatestFromEdgeFunctions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetLatestFromEdgeFunctions200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetLatestFromEdgeFunctions200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetLatestFromEdgeFunctions200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLatestFromEdgeFunctions200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLatestFromEdgeFunctions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLatestFromEdgeFunctions200Response + * @throws IOException if the JSON string is invalid with respect to + * GetLatestFromEdgeFunctions200Response + */ + public static GetLatestFromEdgeFunctions200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetLatestFromEdgeFunctions200Response.class); } - } - - /** - * Create an instance of GetLatestFromEdgeFunctions200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetLatestFromEdgeFunctions200Response - * @throws IOException if the JSON string is invalid with respect to GetLatestFromEdgeFunctions200Response - */ - public static GetLatestFromEdgeFunctions200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetLatestFromEdgeFunctions200Response.class); - } - - /** - * Convert an instance of GetLatestFromEdgeFunctions200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetLatestFromEdgeFunctions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java index 7a35172a..c85bd26c 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,207 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.EdgeFunctions1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Output for GetLatestFromEdgeFunctions. - */ +/** Output for GetLatestFromEdgeFunctions. */ @ApiModel(description = "Output for GetLatestFromEdgeFunctions.") - public class GetLatestFromEdgeFunctionsAlphaOutput { - public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; - @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) - private EdgeFunctions1 edgeFunctions; + public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; - public GetLatestFromEdgeFunctionsAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) + private EdgeFunctions1 edgeFunctions; - public GetLatestFromEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunctions) { - - this.edgeFunctions = edgeFunctions; - return this; - } + public GetLatestFromEdgeFunctionsAlphaOutput() {} - /** - * Get edgeFunctions - * @return edgeFunctions - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetLatestFromEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunctions) { - public EdgeFunctions1 getEdgeFunctions() { - return edgeFunctions; - } + this.edgeFunctions = edgeFunctions; + return this; + } + /** + * Get edgeFunctions + * + * @return edgeFunctions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public EdgeFunctions1 getEdgeFunctions() { + return edgeFunctions; + } - public void setEdgeFunctions(EdgeFunctions1 edgeFunctions) { - this.edgeFunctions = edgeFunctions; - } + public void setEdgeFunctions(EdgeFunctions1 edgeFunctions) { + this.edgeFunctions = edgeFunctions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLatestFromEdgeFunctionsAlphaOutput getLatestFromEdgeFunctionsAlphaOutput = + (GetLatestFromEdgeFunctionsAlphaOutput) o; + return Objects.equals( + this.edgeFunctions, getLatestFromEdgeFunctionsAlphaOutput.edgeFunctions); + } + @Override + public int hashCode() { + return Objects.hash(edgeFunctions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetLatestFromEdgeFunctionsAlphaOutput {\n"); + sb.append(" edgeFunctions: ").append(toIndentedString(edgeFunctions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetLatestFromEdgeFunctionsAlphaOutput getLatestFromEdgeFunctionsAlphaOutput = (GetLatestFromEdgeFunctionsAlphaOutput) o; - return Objects.equals(this.edgeFunctions, getLatestFromEdgeFunctionsAlphaOutput.edgeFunctions); - } - - @Override - public int hashCode() { - return Objects.hash(edgeFunctions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetLatestFromEdgeFunctionsAlphaOutput {\n"); - sb.append(" edgeFunctions: ").append(toIndentedString(edgeFunctions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("edgeFunctions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("edgeFunctions"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("edgeFunctions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("edgeFunctions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetLatestFromEdgeFunctionsAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetLatestFromEdgeFunctionsAlphaOutput is not found in the empty JSON string", GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetLatestFromEdgeFunctionsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetLatestFromEdgeFunctionsAlphaOutput" + + " is not found in the empty JSON string", + GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetLatestFromEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetLatestFromEdgeFunctionsAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetLatestFromEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetLatestFromEdgeFunctionsAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetLatestFromEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetLatestFromEdgeFunctionsAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetLatestFromEdgeFunctionsAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetLatestFromEdgeFunctionsAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetLatestFromEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetLatestFromEdgeFunctionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetLatestFromEdgeFunctionsAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetLatestFromEdgeFunctionsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetLatestFromEdgeFunctionsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetLatestFromEdgeFunctionsAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetLatestFromEdgeFunctionsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetLatestFromEdgeFunctionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetLatestFromEdgeFunctionsAlphaOutput + */ + public static GetLatestFromEdgeFunctionsAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetLatestFromEdgeFunctionsAlphaOutput.class); } - } - - /** - * Create an instance of GetLatestFromEdgeFunctionsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetLatestFromEdgeFunctionsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetLatestFromEdgeFunctionsAlphaOutput - */ - public static GetLatestFromEdgeFunctionsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetLatestFromEdgeFunctionsAlphaOutput.class); - } - - /** - * Convert an instance of GetLatestFromEdgeFunctionsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetLatestFromEdgeFunctionsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java index 75a7baa8..a2a0a7f5 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,286 +10,302 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.MessageSubscriptionResponseError; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetMessagingSubscriptionFailureResponse - */ - +/** GetMessagingSubscriptionFailureResponse */ public class GetMessagingSubscriptionFailureResponse { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + public static final String SERIALIZED_NAME_KEY = "key"; - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) - private List errors = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_KEY) + private String key; - public GetMessagingSubscriptionFailureResponse() { - } + public static final String SERIALIZED_NAME_TYPE = "type"; - public GetMessagingSubscriptionFailureResponse key(String key) { - - this.key = key; - return this; - } + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; - /** - * Key is the phone number or email. - * @return key - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key is the phone number or email.") + public static final String SERIALIZED_NAME_ERRORS = "errors"; - public String getKey() { - return key; - } + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = new ArrayList<>(); + public GetMessagingSubscriptionFailureResponse() {} - public void setKey(String key) { - this.key = key; - } + public GetMessagingSubscriptionFailureResponse key(String key) { + this.key = key; + return this; + } - public GetMessagingSubscriptionFailureResponse type(String type) { - - this.type = type; - return this; - } - - /** - * This will be the exact type as given in the request. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "This will be the exact type as given in the request.") + /** + * Key is the phone number or email. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key is the phone number or email.") + public String getKey() { + return key; + } - public String getType() { - return type; - } + public void setKey(String key) { + this.key = key; + } + public GetMessagingSubscriptionFailureResponse type(String type) { - public void setType(String type) { - this.type = type; - } + this.type = type; + return this; + } + /** + * This will be the exact type as given in the request. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "This will be the exact type as given in the request.") + public String getType() { + return type; + } - public GetMessagingSubscriptionFailureResponse errors(List errors) { - - this.errors = errors; - return this; - } + public void setType(String type) { + this.type = type; + } - public GetMessagingSubscriptionFailureResponse addErrorsItem(MessageSubscriptionResponseError errorsItem) { - this.errors.add(errorsItem); - return this; - } + public GetMessagingSubscriptionFailureResponse errors( + List errors) { - /** - * Per key errors, such as validation errors. - * @return errors - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Per key errors, such as validation errors.") + this.errors = errors; + return this; + } - public List getErrors() { - return errors; - } + public GetMessagingSubscriptionFailureResponse addErrorsItem( + MessageSubscriptionResponseError errorsItem) { + this.errors.add(errorsItem); + return this; + } + /** + * Per key errors, such as validation errors. + * + * @return errors + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Per key errors, such as validation errors.") + public List getErrors() { + return errors; + } - public void setErrors(List errors) { - this.errors = errors; - } + public void setErrors(List errors) { + this.errors = errors; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMessagingSubscriptionFailureResponse getMessagingSubscriptionFailureResponse = + (GetMessagingSubscriptionFailureResponse) o; + return Objects.equals(this.key, getMessagingSubscriptionFailureResponse.key) + && Objects.equals(this.type, getMessagingSubscriptionFailureResponse.type) + && Objects.equals(this.errors, getMessagingSubscriptionFailureResponse.errors); + } + @Override + public int hashCode() { + return Objects.hash(key, type, errors); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMessagingSubscriptionFailureResponse {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetMessagingSubscriptionFailureResponse getMessagingSubscriptionFailureResponse = (GetMessagingSubscriptionFailureResponse) o; - return Objects.equals(this.key, getMessagingSubscriptionFailureResponse.key) && - Objects.equals(this.type, getMessagingSubscriptionFailureResponse.type) && - Objects.equals(this.errors, getMessagingSubscriptionFailureResponse.errors); - } - - @Override - public int hashCode() { - return Objects.hash(key, type, errors); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetMessagingSubscriptionFailureResponse {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("type"); + openapiFields.add("errors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("errors"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("type"); - openapiFields.add("errors"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("errors"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetMessagingSubscriptionFailureResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetMessagingSubscriptionFailureResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetMessagingSubscriptionFailureResponse is not found in the empty JSON string", GetMessagingSubscriptionFailureResponse.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetMessagingSubscriptionFailureResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMessagingSubscriptionFailureResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetMessagingSubscriptionFailureResponse is not found in the" + + " empty JSON string", + GetMessagingSubscriptionFailureResponse.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetMessagingSubscriptionFailureResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMessagingSubscriptionFailureResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMessagingSubscriptionFailureResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetMessagingSubscriptionFailureResponse` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetMessagingSubscriptionFailureResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMessagingSubscriptionFailureResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetMessagingSubscriptionFailureResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetMessagingSubscriptionFailureResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetMessagingSubscriptionFailureResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetMessagingSubscriptionFailureResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetMessagingSubscriptionFailureResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errors` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("errors").toString())); + } + + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); } - } - - /** - * Create an instance of GetMessagingSubscriptionFailureResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetMessagingSubscriptionFailureResponse - * @throws IOException if the JSON string is invalid with respect to GetMessagingSubscriptionFailureResponse - */ - public static GetMessagingSubscriptionFailureResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetMessagingSubscriptionFailureResponse.class); - } - - /** - * Convert an instance of GetMessagingSubscriptionFailureResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMessagingSubscriptionFailureResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetMessagingSubscriptionFailureResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetMessagingSubscriptionFailureResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetMessagingSubscriptionFailureResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMessagingSubscriptionFailureResponse read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetMessagingSubscriptionFailureResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMessagingSubscriptionFailureResponse + * @throws IOException if the JSON string is invalid with respect to + * GetMessagingSubscriptionFailureResponse + */ + public static GetMessagingSubscriptionFailureResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetMessagingSubscriptionFailureResponse.class); + } + + /** + * Convert an instance of GetMessagingSubscriptionFailureResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index 96c4efb0..b99eb3bc 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,370 +10,391 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** GetMessagingSubscriptionSuccessResponse */ +public class GetMessagingSubscriptionSuccessResponse { + public static final String SERIALIZED_NAME_KEY = "key"; -/** - * GetMessagingSubscriptionSuccessResponse - */ + @SerializedName(SERIALIZED_NAME_KEY) + private String key; -public class GetMessagingSubscriptionSuccessResponse { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - /** - * Type is communication medium used. Either EMAIL or SMS. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EMAIL("EMAIL"), - - SMS("SMS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } + /** Type is communication medium used. Either EMAIL or SMS. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EMAIL("EMAIL"), - public String getValue() { - return value; - } + SMS("SMS"); - @Override - public String toString() { - return String.valueOf(value); - } + private String value; - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + TypeEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - /** - * The user subscribed, unsubscribed, or on initial status. This is absent if the phone number or email is not found. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - DID_NOT_SUBSCRIBE("DID_NOT_SUBSCRIBE"), - - SUBSCRIBED("SUBSCRIBED"), - - UNSUBSCRIBED("UNSUBSCRIBED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); - } + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + /** + * The user subscribed, unsubscribed, or on initial status. This is absent if the phone number + * or email is not found. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DID_NOT_SUBSCRIBE("DID_NOT_SUBSCRIBE"), + + SUBSCRIBED("SUBSCRIBED"), + + UNSUBSCRIBED("UNSUBSCRIBED"); + + private String value; - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + StatusEnum(String value) { + this.value = value; + } - public GetMessagingSubscriptionSuccessResponse() { - } + public String getValue() { + return value; + } - public GetMessagingSubscriptionSuccessResponse key(String key) { - - this.key = key; - return this; - } + @Override + public String toString() { + return String.valueOf(value); + } - /** - * Key is the phone number or email. - * @return key - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key is the phone number or email.") + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public String getKey() { - return key; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_STATUS = "status"; - public void setKey(String key) { - this.key = key; - } + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + public GetMessagingSubscriptionSuccessResponse() {} - public GetMessagingSubscriptionSuccessResponse type(TypeEnum type) { - - this.type = type; - return this; - } + public GetMessagingSubscriptionSuccessResponse key(String key) { - /** - * Type is communication medium used. Either EMAIL or SMS. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type is communication medium used. Either EMAIL or SMS.") + this.key = key; + return this; + } - public TypeEnum getType() { - return type; - } + /** + * Key is the phone number or email. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key is the phone number or email.") + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } - public void setType(TypeEnum type) { - this.type = type; - } + public GetMessagingSubscriptionSuccessResponse type(TypeEnum type) { + this.type = type; + return this; + } - public GetMessagingSubscriptionSuccessResponse status(StatusEnum status) { - - this.status = status; - return this; - } + /** + * Type is communication medium used. Either EMAIL or SMS. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Type is communication medium used. Either EMAIL or SMS.") + public TypeEnum getType() { + return type; + } - /** - * The user subscribed, unsubscribed, or on initial status. This is absent if the phone number or email is not found. - * @return status - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The user subscribed, unsubscribed, or on initial status. This is absent if the phone number or email is not found.") + public void setType(TypeEnum type) { + this.type = type; + } - public StatusEnum getStatus() { - return status; - } + public GetMessagingSubscriptionSuccessResponse status(StatusEnum status) { + this.status = status; + return this; + } - public void setStatus(StatusEnum status) { - this.status = status; - } + /** + * The user subscribed, unsubscribed, or on initial status. This is absent if the phone number + * or email is not found. + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The user subscribed, unsubscribed, or on initial status. This is absent if the" + + " phone number or email is not found.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMessagingSubscriptionSuccessResponse getMessagingSubscriptionSuccessResponse = + (GetMessagingSubscriptionSuccessResponse) o; + return Objects.equals(this.key, getMessagingSubscriptionSuccessResponse.key) + && Objects.equals(this.type, getMessagingSubscriptionSuccessResponse.type) + && Objects.equals(this.status, getMessagingSubscriptionSuccessResponse.status); + } + @Override + public int hashCode() { + return Objects.hash(key, type, status); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMessagingSubscriptionSuccessResponse {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetMessagingSubscriptionSuccessResponse getMessagingSubscriptionSuccessResponse = (GetMessagingSubscriptionSuccessResponse) o; - return Objects.equals(this.key, getMessagingSubscriptionSuccessResponse.key) && - Objects.equals(this.type, getMessagingSubscriptionSuccessResponse.type) && - Objects.equals(this.status, getMessagingSubscriptionSuccessResponse.status); - } - - @Override - public int hashCode() { - return Objects.hash(key, type, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetMessagingSubscriptionSuccessResponse {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("type"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("type"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("type"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetMessagingSubscriptionSuccessResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetMessagingSubscriptionSuccessResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetMessagingSubscriptionSuccessResponse is not found in the empty JSON string", GetMessagingSubscriptionSuccessResponse.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetMessagingSubscriptionSuccessResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMessagingSubscriptionSuccessResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetMessagingSubscriptionSuccessResponse is not found in the" + + " empty JSON string", + GetMessagingSubscriptionSuccessResponse.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetMessagingSubscriptionSuccessResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMessagingSubscriptionSuccessResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMessagingSubscriptionSuccessResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetMessagingSubscriptionSuccessResponse` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetMessagingSubscriptionSuccessResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMessagingSubscriptionSuccessResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetMessagingSubscriptionSuccessResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetMessagingSubscriptionSuccessResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetMessagingSubscriptionSuccessResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetMessagingSubscriptionSuccessResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetMessagingSubscriptionSuccessResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of GetMessagingSubscriptionSuccessResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetMessagingSubscriptionSuccessResponse - * @throws IOException if the JSON string is invalid with respect to GetMessagingSubscriptionSuccessResponse - */ - public static GetMessagingSubscriptionSuccessResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetMessagingSubscriptionSuccessResponse.class); - } - - /** - * Convert an instance of GetMessagingSubscriptionSuccessResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMessagingSubscriptionSuccessResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'GetMessagingSubscriptionSuccessResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetMessagingSubscriptionSuccessResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetMessagingSubscriptionSuccessResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMessagingSubscriptionSuccessResponse read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetMessagingSubscriptionSuccessResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMessagingSubscriptionSuccessResponse + * @throws IOException if the JSON string is invalid with respect to + * GetMessagingSubscriptionSuccessResponse + */ + public static GetMessagingSubscriptionSuccessResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetMessagingSubscriptionSuccessResponse.class); + } + + /** + * Convert an instance of GetMessagingSubscriptionSuccessResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java index 55c6543a..0dd11ed8 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetRegulationV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetRegulation200Response - */ - +/** GetRegulation200Response */ public class GetRegulation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetRegulationV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetRegulation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetRegulationV1Output data; - public GetRegulation200Response data(GetRegulationV1Output data) { - - this.data = data; - return this; - } + public GetRegulation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetRegulation200Response data(GetRegulationV1Output data) { - public GetRegulationV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetRegulationV1Output getData() { + return data; + } - public void setData(GetRegulationV1Output data) { - this.data = data; - } + public void setData(GetRegulationV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRegulation200Response getRegulation200Response = (GetRegulation200Response) o; + return Objects.equals(this.data, getRegulation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRegulation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetRegulation200Response getRegulation200Response = (GetRegulation200Response) o; - return Objects.equals(this.data, getRegulation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetRegulation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetRegulation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetRegulation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetRegulation200Response is not found in the empty JSON string", GetRegulation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetRegulation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetRegulation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRegulation200Response is not found" + + " in the empty JSON string", + GetRegulation200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetRegulation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetRegulation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetRegulation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetRegulation200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetRegulation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetRegulation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetRegulation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetRegulation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRegulation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRegulation200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRegulation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRegulation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRegulation200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRegulation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRegulation200Response + * @throws IOException if the JSON string is invalid with respect to GetRegulation200Response + */ + public static GetRegulation200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRegulation200Response.class); } - } - - /** - * Create an instance of GetRegulation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetRegulation200Response - * @throws IOException if the JSON string is invalid with respect to GetRegulation200Response - */ - public static GetRegulation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetRegulation200Response.class); - } - - /** - * Convert an instance of GetRegulation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetRegulation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java index bd1b44e7..510f4e65 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Regulation; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The regulate request returned. - */ +/** The regulate request returned. */ @ApiModel(description = "The regulate request returned.") - public class GetRegulationV1Output { - public static final String SERIALIZED_NAME_REGULATION = "regulation"; - @SerializedName(SERIALIZED_NAME_REGULATION) - private Regulation regulation; + public static final String SERIALIZED_NAME_REGULATION = "regulation"; - public GetRegulationV1Output() { - } + @SerializedName(SERIALIZED_NAME_REGULATION) + private Regulation regulation; - public GetRegulationV1Output regulation(Regulation regulation) { - - this.regulation = regulation; - return this; - } + public GetRegulationV1Output() {} - /** - * Get regulation - * @return regulation - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetRegulationV1Output regulation(Regulation regulation) { - public Regulation getRegulation() { - return regulation; - } + this.regulation = regulation; + return this; + } + /** + * Get regulation + * + * @return regulation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Regulation getRegulation() { + return regulation; + } - public void setRegulation(Regulation regulation) { - this.regulation = regulation; - } + public void setRegulation(Regulation regulation) { + this.regulation = regulation; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRegulationV1Output getRegulationV1Output = (GetRegulationV1Output) o; + return Objects.equals(this.regulation, getRegulationV1Output.regulation); + } + @Override + public int hashCode() { + return Objects.hash(regulation); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRegulationV1Output {\n"); + sb.append(" regulation: ").append(toIndentedString(regulation)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetRegulationV1Output getRegulationV1Output = (GetRegulationV1Output) o; - return Objects.equals(this.regulation, getRegulationV1Output.regulation); - } - - @Override - public int hashCode() { - return Objects.hash(regulation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetRegulationV1Output {\n"); - sb.append(" regulation: ").append(toIndentedString(regulation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regulation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("regulation"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regulation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("regulation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetRegulationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetRegulationV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetRegulationV1Output is not found in the empty JSON string", GetRegulationV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetRegulationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetRegulationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetRegulationV1Output is not found in" + + " the empty JSON string", + GetRegulationV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetRegulationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetRegulationV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetRegulationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetRegulationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetRegulationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetRegulationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetRegulationV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetRegulationV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetRegulationV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRegulationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRegulationV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetRegulationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRegulationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRegulationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetRegulationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRegulationV1Output + * @throws IOException if the JSON string is invalid with respect to GetRegulationV1Output + */ + public static GetRegulationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRegulationV1Output.class); } - } - - /** - * Create an instance of GetRegulationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetRegulationV1Output - * @throws IOException if the JSON string is invalid with respect to GetRegulationV1Output - */ - public static GetRegulationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetRegulationV1Output.class); - } - - /** - * Convert an instance of GetRegulationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetRegulationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response.java b/src/main/java/com/segment/publicapi/models/GetSource200Response.java index 295fb49c..093d3670 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSourceAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetSource200Response - */ - +/** GetSource200Response */ public class GetSource200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetSourceAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetSource200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetSourceV1Output data; - public GetSource200Response data(GetSourceAlphaOutput data) { - - this.data = data; - return this; - } + public GetSource200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetSource200Response data(GetSourceV1Output data) { - public GetSourceAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetSourceV1Output getData() { + return data; + } - public void setData(GetSourceAlphaOutput data) { - this.data = data; - } + public void setData(GetSourceV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSource200Response getSource200Response = (GetSource200Response) o; + return Objects.equals(this.data, getSource200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSource200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSource200Response getSource200Response = (GetSource200Response) o; - return Objects.equals(this.data, getSource200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSource200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSource200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSource200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSource200Response is not found in the empty JSON string", GetSource200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSource200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSource200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSource200Response is not found in" + + " the empty JSON string", + GetSource200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSource200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSource200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSource200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSource200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSource200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSource200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSource200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSource200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSource200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSource200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSource200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSource200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSource200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSource200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSource200Response + * @throws IOException if the JSON string is invalid with respect to GetSource200Response + */ + public static GetSource200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSource200Response.class); } - } - - /** - * Create an instance of GetSource200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSource200Response - * @throws IOException if the JSON string is invalid with respect to GetSource200Response - */ - public static GetSource200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSource200Response.class); - } - - /** - * Convert an instance of GetSource200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSource200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java index 4aeba4ef..ebae583f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSourceV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetSource200Response1 - */ - +/** GetSource200Response1 */ public class GetSource200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetSourceV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetSource200Response1() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetSourceAlphaOutput data; - public GetSource200Response1 data(GetSourceV1Output data) { - - this.data = data; - return this; - } + public GetSource200Response1() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetSource200Response1 data(GetSourceAlphaOutput data) { - public GetSourceV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetSourceAlphaOutput getData() { + return data; + } - public void setData(GetSourceV1Output data) { - this.data = data; - } + public void setData(GetSourceAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSource200Response1 getSource200Response1 = (GetSource200Response1) o; + return Objects.equals(this.data, getSource200Response1.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSource200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSource200Response1 getSource200Response1 = (GetSource200Response1) o; - return Objects.equals(this.data, getSource200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSource200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSource200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSource200Response1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSource200Response1 is not found in the empty JSON string", GetSource200Response1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSource200Response1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSource200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSource200Response1 is not found in" + + " the empty JSON string", + GetSource200Response1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSource200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSource200Response1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSource200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSource200Response1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSource200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSource200Response1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSource200Response1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSource200Response1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSource200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSource200Response1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSource200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSource200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSource200Response1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSource200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSource200Response1 + * @throws IOException if the JSON string is invalid with respect to GetSource200Response1 + */ + public static GetSource200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSource200Response1.class); } - } - - /** - * Create an instance of GetSource200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSource200Response1 - * @throws IOException if the JSON string is invalid with respect to GetSource200Response1 - */ - public static GetSource200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSource200Response1.class); - } - - /** - * Convert an instance of GetSource200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSource200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java index 30d905a8..74654c79 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Source1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a Source. - */ +/** Returns a Source. */ @ApiModel(description = "Returns a Source.") - public class GetSourceAlphaOutput { - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - private Source1 source; + public static final String SERIALIZED_NAME_SOURCE = "source"; - public GetSourceAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_SOURCE) + private Source1 source; - public GetSourceAlphaOutput source(Source1 source) { - - this.source = source; - return this; - } + public GetSourceAlphaOutput() {} - /** - * Get source - * @return source - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetSourceAlphaOutput source(Source1 source) { - public Source1 getSource() { - return source; - } + this.source = source; + return this; + } + /** + * Get source + * + * @return source + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Source1 getSource() { + return source; + } - public void setSource(Source1 source) { - this.source = source; - } + public void setSource(Source1 source) { + this.source = source; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceAlphaOutput getSourceAlphaOutput = (GetSourceAlphaOutput) o; + return Objects.equals(this.source, getSourceAlphaOutput.source); + } + @Override + public int hashCode() { + return Objects.hash(source); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSourceAlphaOutput {\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSourceAlphaOutput getSourceAlphaOutput = (GetSourceAlphaOutput) o; - return Objects.equals(this.source, getSourceAlphaOutput.source); - } - - @Override - public int hashCode() { - return Objects.hash(source); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSourceAlphaOutput {\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("source"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("source"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("source"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("source"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSourceAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSourceAlphaOutput is not found in the empty JSON string", GetSourceAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSourceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSourceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSourceAlphaOutput is not found in" + + " the empty JSON string", + GetSourceAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSourceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSourceAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSourceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSourceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSourceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSourceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSourceAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSourceAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSourceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSourceAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSourceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSourceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSourceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSourceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSourceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetSourceAlphaOutput + */ + public static GetSourceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSourceAlphaOutput.class); } - } - - /** - * Create an instance of GetSourceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSourceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetSourceAlphaOutput - */ - public static GetSourceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSourceAlphaOutput.class); - } - - /** - * Convert an instance of GetSourceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSourceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java index 127f06bb..eccf971c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,188 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSourceMetadataV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetSourceMetadata200Response - */ - +/** GetSourceMetadata200Response */ public class GetSourceMetadata200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetSourceMetadataV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetSourceMetadata200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetSourceMetadataV1Output data; - public GetSourceMetadata200Response data(GetSourceMetadataV1Output data) { - - this.data = data; - return this; - } + public GetSourceMetadata200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetSourceMetadata200Response data(GetSourceMetadataV1Output data) { - public GetSourceMetadataV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetSourceMetadataV1Output getData() { + return data; + } - public void setData(GetSourceMetadataV1Output data) { - this.data = data; - } + public void setData(GetSourceMetadataV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceMetadata200Response getSourceMetadata200Response = + (GetSourceMetadata200Response) o; + return Objects.equals(this.data, getSourceMetadata200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSourceMetadata200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSourceMetadata200Response getSourceMetadata200Response = (GetSourceMetadata200Response) o; - return Objects.equals(this.data, getSourceMetadata200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSourceMetadata200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceMetadata200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSourceMetadata200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSourceMetadata200Response is not found in the empty JSON string", GetSourceMetadata200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetSourceMetadata200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSourceMetadata200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSourceMetadata200Response is not" + + " found in the empty JSON string", + GetSourceMetadata200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSourceMetadata200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSourceMetadata200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSourceMetadata200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSourceMetadata200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSourceMetadata200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSourceMetadata200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSourceMetadata200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSourceMetadata200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSourceMetadata200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSourceMetadata200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSourceMetadata200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSourceMetadata200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSourceMetadata200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSourceMetadata200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSourceMetadata200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSourceMetadata200Response + * @throws IOException if the JSON string is invalid with respect to + * GetSourceMetadata200Response + */ + public static GetSourceMetadata200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSourceMetadata200Response.class); } - } - - /** - * Create an instance of GetSourceMetadata200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSourceMetadata200Response - * @throws IOException if the JSON string is invalid with respect to GetSourceMetadata200Response - */ - public static GetSourceMetadata200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSourceMetadata200Response.class); - } - - /** - * Convert an instance of GetSourceMetadata200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSourceMetadata200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java index 69211839..1f632a6e 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.SourceMetadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the Source catalog item looked up by id. - */ +/** Returns the Source catalog item looked up by id. */ @ApiModel(description = "Returns the Source catalog item looked up by id.") - public class GetSourceMetadataV1Output { - public static final String SERIALIZED_NAME_SOURCE_METADATA = "sourceMetadata"; - @SerializedName(SERIALIZED_NAME_SOURCE_METADATA) - private SourceMetadata sourceMetadata; + public static final String SERIALIZED_NAME_SOURCE_METADATA = "sourceMetadata"; - public GetSourceMetadataV1Output() { - } + @SerializedName(SERIALIZED_NAME_SOURCE_METADATA) + private SourceMetadata sourceMetadata; - public GetSourceMetadataV1Output sourceMetadata(SourceMetadata sourceMetadata) { - - this.sourceMetadata = sourceMetadata; - return this; - } + public GetSourceMetadataV1Output() {} - /** - * Get sourceMetadata - * @return sourceMetadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetSourceMetadataV1Output sourceMetadata(SourceMetadata sourceMetadata) { - public SourceMetadata getSourceMetadata() { - return sourceMetadata; - } + this.sourceMetadata = sourceMetadata; + return this; + } + /** + * Get sourceMetadata + * + * @return sourceMetadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public SourceMetadata getSourceMetadata() { + return sourceMetadata; + } - public void setSourceMetadata(SourceMetadata sourceMetadata) { - this.sourceMetadata = sourceMetadata; - } + public void setSourceMetadata(SourceMetadata sourceMetadata) { + this.sourceMetadata = sourceMetadata; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceMetadataV1Output getSourceMetadataV1Output = (GetSourceMetadataV1Output) o; + return Objects.equals(this.sourceMetadata, getSourceMetadataV1Output.sourceMetadata); + } + @Override + public int hashCode() { + return Objects.hash(sourceMetadata); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSourceMetadataV1Output {\n"); + sb.append(" sourceMetadata: ").append(toIndentedString(sourceMetadata)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSourceMetadataV1Output getSourceMetadataV1Output = (GetSourceMetadataV1Output) o; - return Objects.equals(this.sourceMetadata, getSourceMetadataV1Output.sourceMetadata); - } - - @Override - public int hashCode() { - return Objects.hash(sourceMetadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSourceMetadataV1Output {\n"); - sb.append(" sourceMetadata: ").append(toIndentedString(sourceMetadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceMetadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceMetadata"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceMetadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceMetadata"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceMetadataV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSourceMetadataV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSourceMetadataV1Output is not found in the empty JSON string", GetSourceMetadataV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSourceMetadataV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSourceMetadataV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSourceMetadataV1Output is not found" + + " in the empty JSON string", + GetSourceMetadataV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSourceMetadataV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSourceMetadataV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSourceMetadataV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSourceMetadataV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSourceMetadataV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSourceMetadataV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSourceMetadataV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSourceMetadataV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSourceMetadataV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSourceMetadataV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSourceMetadataV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSourceMetadataV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSourceMetadataV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSourceMetadataV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSourceMetadataV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSourceMetadataV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSourceMetadataV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSourceMetadataV1Output + * @throws IOException if the JSON string is invalid with respect to GetSourceMetadataV1Output + */ + public static GetSourceMetadataV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSourceMetadataV1Output.class); } - } - - /** - * Create an instance of GetSourceMetadataV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSourceMetadataV1Output - * @throws IOException if the JSON string is invalid with respect to GetSourceMetadataV1Output - */ - public static GetSourceMetadataV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSourceMetadataV1Output.class); - } - - /** - * Convert an instance of GetSourceMetadataV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSourceMetadataV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index bed46b92..28e1e965 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Source4; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a Source. - */ +/** Returns a Source. */ @ApiModel(description = "Returns a Source.") - public class GetSourceV1Output { - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - private Source4 source; + public static final String SERIALIZED_NAME_SOURCE = "source"; - public GetSourceV1Output() { - } + @SerializedName(SERIALIZED_NAME_SOURCE) + private Source4 source; - public GetSourceV1Output source(Source4 source) { - - this.source = source; - return this; - } + public GetSourceV1Output() {} - /** - * Get source - * @return source - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetSourceV1Output source(Source4 source) { - public Source4 getSource() { - return source; - } + this.source = source; + return this; + } + /** + * Get source + * + * @return source + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Source4 getSource() { + return source; + } - public void setSource(Source4 source) { - this.source = source; - } + public void setSource(Source4 source) { + this.source = source; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceV1Output getSourceV1Output = (GetSourceV1Output) o; + return Objects.equals(this.source, getSourceV1Output.source); + } + @Override + public int hashCode() { + return Objects.hash(source); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSourceV1Output {\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSourceV1Output getSourceV1Output = (GetSourceV1Output) o; - return Objects.equals(this.source, getSourceV1Output.source); - } - - @Override - public int hashCode() { - return Objects.hash(source); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSourceV1Output {\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("source"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("source"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("source"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("source"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSourceV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSourceV1Output is not found in the empty JSON string", GetSourceV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSourceV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSourceV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSourceV1Output is not found in the" + + " empty JSON string", + GetSourceV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSourceV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSourceV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSourceV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSourceV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSourceV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSourceV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSourceV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSourceV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSourceV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSourceV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSourceV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSourceV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSourceV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSourceV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSourceV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSourceV1Output + * @throws IOException if the JSON string is invalid with respect to GetSourceV1Output + */ + public static GetSourceV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSourceV1Output.class); } - } - - /** - * Create an instance of GetSourceV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSourceV1Output - * @throws IOException if the JSON string is invalid with respect to GetSourceV1Output - */ - public static GetSourceV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSourceV1Output.class); - } - - /** - * Convert an instance of GetSourceV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSourceV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java index 1e5e0958..87960d57 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,188 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSourcesCatalogV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetSourcesCatalog200Response - */ - +/** GetSourcesCatalog200Response */ public class GetSourcesCatalog200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetSourcesCatalogV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetSourcesCatalog200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetSourcesCatalogV1Output data; - public GetSourcesCatalog200Response data(GetSourcesCatalogV1Output data) { - - this.data = data; - return this; - } + public GetSourcesCatalog200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetSourcesCatalog200Response data(GetSourcesCatalogV1Output data) { - public GetSourcesCatalogV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetSourcesCatalogV1Output getData() { + return data; + } - public void setData(GetSourcesCatalogV1Output data) { - this.data = data; - } + public void setData(GetSourcesCatalogV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourcesCatalog200Response getSourcesCatalog200Response = + (GetSourcesCatalog200Response) o; + return Objects.equals(this.data, getSourcesCatalog200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSourcesCatalog200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSourcesCatalog200Response getSourcesCatalog200Response = (GetSourcesCatalog200Response) o; - return Objects.equals(this.data, getSourcesCatalog200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSourcesCatalog200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourcesCatalog200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSourcesCatalog200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSourcesCatalog200Response is not found in the empty JSON string", GetSourcesCatalog200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetSourcesCatalog200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSourcesCatalog200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSourcesCatalog200Response is not" + + " found in the empty JSON string", + GetSourcesCatalog200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSourcesCatalog200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSourcesCatalog200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSourcesCatalog200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSourcesCatalog200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSourcesCatalog200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSourcesCatalog200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSourcesCatalog200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSourcesCatalog200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSourcesCatalog200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSourcesCatalog200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSourcesCatalog200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSourcesCatalog200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSourcesCatalog200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSourcesCatalog200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSourcesCatalog200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSourcesCatalog200Response + * @throws IOException if the JSON string is invalid with respect to + * GetSourcesCatalog200Response + */ + public static GetSourcesCatalog200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSourcesCatalog200Response.class); } - } - - /** - * Create an instance of GetSourcesCatalog200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSourcesCatalog200Response - * @throws IOException if the JSON string is invalid with respect to GetSourcesCatalog200Response - */ - public static GetSourcesCatalog200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSourcesCatalog200Response.class); - } - - /** - * Convert an instance of GetSourcesCatalog200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSourcesCatalog200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java index 3cf0ebe7..089be53c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,247 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Pagination; -import com.segment.publicapi.models.SourceMetadataV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of all Source catalog items contained within a given page. - */ +/** Returns a list of all Source catalog items contained within a given page. */ @ApiModel(description = "Returns a list of all Source catalog items contained within a given page.") - public class GetSourcesCatalogV1Output { - public static final String SERIALIZED_NAME_SOURCES_CATALOG = "sourcesCatalog"; - @SerializedName(SERIALIZED_NAME_SOURCES_CATALOG) - private List sourcesCatalog = new ArrayList<>(); + public static final String SERIALIZED_NAME_SOURCES_CATALOG = "sourcesCatalog"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_SOURCES_CATALOG) + private List sourcesCatalog = new ArrayList<>(); - public GetSourcesCatalogV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetSourcesCatalogV1Output sourcesCatalog(List sourcesCatalog) { - - this.sourcesCatalog = sourcesCatalog; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetSourcesCatalogV1Output addSourcesCatalogItem(SourceMetadataV1 sourcesCatalogItem) { - this.sourcesCatalog.add(sourcesCatalogItem); - return this; - } + public GetSourcesCatalogV1Output() {} - /** - * All Source catalog items contained within the requested page. - * @return sourcesCatalog - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All Source catalog items contained within the requested page.") - - public List getSourcesCatalog() { - return sourcesCatalog; - } + public GetSourcesCatalogV1Output sourcesCatalog(List sourcesCatalog) { + this.sourcesCatalog = sourcesCatalog; + return this; + } - public void setSourcesCatalog(List sourcesCatalog) { - this.sourcesCatalog = sourcesCatalog; - } + public GetSourcesCatalogV1Output addSourcesCatalogItem(SourceMetadataV1 sourcesCatalogItem) { + this.sourcesCatalog.add(sourcesCatalogItem); + return this; + } + /** + * All Source catalog items contained within the requested page. + * + * @return sourcesCatalog + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "All Source catalog items contained within the requested page.") + public List getSourcesCatalog() { + return sourcesCatalog; + } - public GetSourcesCatalogV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setSourcesCatalog(List sourcesCatalog) { + this.sourcesCatalog = sourcesCatalog; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetSourcesCatalogV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourcesCatalogV1Output getSourcesCatalogV1Output = (GetSourcesCatalogV1Output) o; + return Objects.equals(this.sourcesCatalog, getSourcesCatalogV1Output.sourcesCatalog) + && Objects.equals(this.pagination, getSourcesCatalogV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(sourcesCatalog, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSourcesCatalogV1Output {\n"); + sb.append(" sourcesCatalog: ").append(toIndentedString(sourcesCatalog)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSourcesCatalogV1Output getSourcesCatalogV1Output = (GetSourcesCatalogV1Output) o; - return Objects.equals(this.sourcesCatalog, getSourcesCatalogV1Output.sourcesCatalog) && - Objects.equals(this.pagination, getSourcesCatalogV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(sourcesCatalog, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSourcesCatalogV1Output {\n"); - sb.append(" sourcesCatalog: ").append(toIndentedString(sourcesCatalog)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourcesCatalog"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourcesCatalog"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourcesCatalog"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourcesCatalog"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourcesCatalogV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSourcesCatalogV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSourcesCatalogV1Output is not found in the empty JSON string", GetSourcesCatalogV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSourcesCatalogV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSourcesCatalogV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSourcesCatalogV1Output is not found" + + " in the empty JSON string", + GetSourcesCatalogV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSourcesCatalogV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSourcesCatalogV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSourcesCatalogV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSourcesCatalogV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSourcesCatalogV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSourcesCatalogV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("sourcesCatalog").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourcesCatalog` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("sourcesCatalog").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("sourcesCatalog").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sourcesCatalog` to be an array in the JSON string but got `%s`", jsonObj.get("sourcesCatalog").toString())); - } - JsonArray jsonArraysourcesCatalog = jsonObj.getAsJsonArray("sourcesCatalog"); - } + JsonArray jsonArraysourcesCatalog = jsonObj.getAsJsonArray("sourcesCatalog"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSourcesCatalogV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSourcesCatalogV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSourcesCatalogV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSourcesCatalogV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSourcesCatalogV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSourcesCatalogV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSourcesCatalogV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSourcesCatalogV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSourcesCatalogV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSourcesCatalogV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSourcesCatalogV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSourcesCatalogV1Output + * @throws IOException if the JSON string is invalid with respect to GetSourcesCatalogV1Output + */ + public static GetSourcesCatalogV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSourcesCatalogV1Output.class); } - } - - /** - * Create an instance of GetSourcesCatalogV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSourcesCatalogV1Output - * @throws IOException if the JSON string is invalid with respect to GetSourcesCatalogV1Output - */ - public static GetSourcesCatalogV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSourcesCatalogV1Output.class); - } - - /** - * Convert an instance of GetSourcesCatalogV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSourcesCatalogV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java index 61e5d0e5..016ee221 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSpaceAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetSpace200Response - */ - +/** GetSpace200Response */ public class GetSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetSpaceAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetSpace200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetSpaceAlphaOutput data; - public GetSpace200Response data(GetSpaceAlphaOutput data) { - - this.data = data; - return this; - } + public GetSpace200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetSpace200Response data(GetSpaceAlphaOutput data) { - public GetSpaceAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetSpaceAlphaOutput getData() { + return data; + } - public void setData(GetSpaceAlphaOutput data) { - this.data = data; - } + public void setData(GetSpaceAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSpace200Response getSpace200Response = (GetSpace200Response) o; + return Objects.equals(this.data, getSpace200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSpace200Response getSpace200Response = (GetSpace200Response) o; - return Objects.equals(this.data, getSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSpace200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSpace200Response is not found in the empty JSON string", GetSpace200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSpace200Response is not found in" + + " the empty JSON string", + GetSpace200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSpace200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSpace200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSpace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSpace200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSpace200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSpace200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSpace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSpace200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSpace200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSpace200Response + * @throws IOException if the JSON string is invalid with respect to GetSpace200Response + */ + public static GetSpace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSpace200Response.class); } - } - - /** - * Create an instance of GetSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSpace200Response - * @throws IOException if the JSON string is invalid with respect to GetSpace200Response - */ - public static GetSpace200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSpace200Response.class); - } - - /** - * Convert an instance of GetSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java index 72ee2072..83d9e895 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Space; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Response for the getSpaceById endpoint. - */ +/** Response for the getSpaceById endpoint. */ @ApiModel(description = "Response for the getSpaceById endpoint.") - public class GetSpaceAlphaOutput { - public static final String SERIALIZED_NAME_SPACE = "space"; - @SerializedName(SERIALIZED_NAME_SPACE) - private Space space; + public static final String SERIALIZED_NAME_SPACE = "space"; - public GetSpaceAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_SPACE) + private Space space; - public GetSpaceAlphaOutput space(Space space) { - - this.space = space; - return this; - } + public GetSpaceAlphaOutput() {} - /** - * Get space - * @return space - **/ - @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "") + public GetSpaceAlphaOutput space(Space space) { - public Space getSpace() { - return space; - } + this.space = space; + return this; + } + /** + * Get space + * + * @return space + */ + @javax.annotation.Nullable + @ApiModelProperty(required = true, value = "") + public Space getSpace() { + return space; + } - public void setSpace(Space space) { - this.space = space; - } + public void setSpace(Space space) { + this.space = space; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSpaceAlphaOutput getSpaceAlphaOutput = (GetSpaceAlphaOutput) o; + return Objects.equals(this.space, getSpaceAlphaOutput.space); + } + @Override + public int hashCode() { + return Objects.hash(space); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSpaceAlphaOutput {\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSpaceAlphaOutput getSpaceAlphaOutput = (GetSpaceAlphaOutput) o; - return Objects.equals(this.space, getSpaceAlphaOutput.space); - } - - @Override - public int hashCode() { - return Objects.hash(space); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSpaceAlphaOutput {\n"); - sb.append(" space: ").append(toIndentedString(space)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("space"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("space"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("space"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("space"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSpaceAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSpaceAlphaOutput is not found in the empty JSON string", GetSpaceAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSpaceAlphaOutput is not found in" + + " the empty JSON string", + GetSpaceAlphaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSpaceAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSpaceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSpaceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSpaceAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSpaceAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSpaceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSpaceAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSpaceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetSpaceAlphaOutput + */ + public static GetSpaceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSpaceAlphaOutput.class); } - } - - /** - * Create an instance of GetSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetSpaceAlphaOutput - */ - public static GetSpaceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSpaceAlphaOutput.class); - } - - /** - * Convert an instance of GetSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java index 9cf49952..2b346779 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetSubscriptionFromDestinationAlphaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetSubscriptionFromDestination200Response - */ - +/** GetSubscriptionFromDestination200Response */ public class GetSubscriptionFromDestination200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetSubscriptionFromDestinationAlphaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetSubscriptionFromDestination200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetSubscriptionFromDestinationAlphaOutput data; - public GetSubscriptionFromDestination200Response data(GetSubscriptionFromDestinationAlphaOutput data) { - - this.data = data; - return this; - } + public GetSubscriptionFromDestination200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetSubscriptionFromDestination200Response data( + GetSubscriptionFromDestinationAlphaOutput data) { - public GetSubscriptionFromDestinationAlphaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetSubscriptionFromDestinationAlphaOutput getData() { + return data; + } - public void setData(GetSubscriptionFromDestinationAlphaOutput data) { - this.data = data; - } + public void setData(GetSubscriptionFromDestinationAlphaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubscriptionFromDestination200Response getSubscriptionFromDestination200Response = + (GetSubscriptionFromDestination200Response) o; + return Objects.equals(this.data, getSubscriptionFromDestination200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptionFromDestination200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSubscriptionFromDestination200Response getSubscriptionFromDestination200Response = (GetSubscriptionFromDestination200Response) o; - return Objects.equals(this.data, getSubscriptionFromDestination200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSubscriptionFromDestination200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSubscriptionFromDestination200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSubscriptionFromDestination200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSubscriptionFromDestination200Response is not found in the empty JSON string", GetSubscriptionFromDestination200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetSubscriptionFromDestination200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSubscriptionFromDestination200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetSubscriptionFromDestination200Response is not found in" + + " the empty JSON string", + GetSubscriptionFromDestination200Response.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSubscriptionFromDestination200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSubscriptionFromDestination200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSubscriptionFromDestination200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSubscriptionFromDestination200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSubscriptionFromDestination200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSubscriptionFromDestination200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSubscriptionFromDestination200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSubscriptionFromDestination200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSubscriptionFromDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSubscriptionFromDestination200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetSubscriptionFromDestination200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSubscriptionFromDestination200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetSubscriptionFromDestination200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSubscriptionFromDestination200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSubscriptionFromDestination200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSubscriptionFromDestination200Response + * @throws IOException if the JSON string is invalid with respect to + * GetSubscriptionFromDestination200Response + */ + public static GetSubscriptionFromDestination200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetSubscriptionFromDestination200Response.class); } - } - - /** - * Create an instance of GetSubscriptionFromDestination200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSubscriptionFromDestination200Response - * @throws IOException if the JSON string is invalid with respect to GetSubscriptionFromDestination200Response - */ - public static GetSubscriptionFromDestination200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSubscriptionFromDestination200Response.class); - } - - /** - * Convert an instance of GetSubscriptionFromDestination200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSubscriptionFromDestination200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java index 939d2824..e978c45f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,210 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Subscription; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a subscription for a given subscription id. - */ +/** Returns a subscription for a given subscription id. */ @ApiModel(description = "Returns a subscription for a given subscription id.") - public class GetSubscriptionFromDestinationAlphaOutput { - public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription"; - @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) - private Subscription subscription; + public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription"; - public GetSubscriptionFromDestinationAlphaOutput() { - } + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + private Subscription subscription; - public GetSubscriptionFromDestinationAlphaOutput subscription(Subscription subscription) { - - this.subscription = subscription; - return this; - } + public GetSubscriptionFromDestinationAlphaOutput() {} - /** - * Get subscription - * @return subscription - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetSubscriptionFromDestinationAlphaOutput subscription(Subscription subscription) { - public Subscription getSubscription() { - return subscription; - } + this.subscription = subscription; + return this; + } + /** + * Get subscription + * + * @return subscription + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Subscription getSubscription() { + return subscription; + } - public void setSubscription(Subscription subscription) { - this.subscription = subscription; - } + public void setSubscription(Subscription subscription) { + this.subscription = subscription; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubscriptionFromDestinationAlphaOutput getSubscriptionFromDestinationAlphaOutput = + (GetSubscriptionFromDestinationAlphaOutput) o; + return Objects.equals( + this.subscription, getSubscriptionFromDestinationAlphaOutput.subscription); + } + @Override + public int hashCode() { + return Objects.hash(subscription); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptionFromDestinationAlphaOutput {\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSubscriptionFromDestinationAlphaOutput getSubscriptionFromDestinationAlphaOutput = (GetSubscriptionFromDestinationAlphaOutput) o; - return Objects.equals(this.subscription, getSubscriptionFromDestinationAlphaOutput.subscription); - } - - @Override - public int hashCode() { - return Objects.hash(subscription); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSubscriptionFromDestinationAlphaOutput {\n"); - sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("subscription"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("subscription"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSubscriptionFromDestinationAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSubscriptionFromDestinationAlphaOutput is not found in the empty JSON string", GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetSubscriptionFromDestinationAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetSubscriptionFromDestinationAlphaOutput is not found in" + + " the empty JSON string", + GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields + .toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSubscriptionFromDestinationAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSubscriptionFromDestinationAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSubscriptionFromDestinationAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSubscriptionFromDestinationAlphaOutput` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSubscriptionFromDestinationAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSubscriptionFromDestinationAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSubscriptionFromDestinationAlphaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSubscriptionFromDestinationAlphaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSubscriptionFromDestinationAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSubscriptionFromDestinationAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetSubscriptionFromDestinationAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetSubscriptionFromDestinationAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetSubscriptionFromDestinationAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSubscriptionFromDestinationAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetSubscriptionFromDestinationAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSubscriptionFromDestinationAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetSubscriptionFromDestinationAlphaOutput + */ + public static GetSubscriptionFromDestinationAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetSubscriptionFromDestinationAlphaOutput.class); } - } - - /** - * Create an instance of GetSubscriptionFromDestinationAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSubscriptionFromDestinationAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetSubscriptionFromDestinationAlphaOutput - */ - public static GetSubscriptionFromDestinationAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSubscriptionFromDestinationAlphaOutput.class); - } - - /** - * Convert an instance of GetSubscriptionFromDestinationAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetSubscriptionFromDestinationAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index ca415707..9c0f579c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,288 +10,287 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** GetSubscriptionRequest */ +public class GetSubscriptionRequest { + public static final String SERIALIZED_NAME_KEY = "key"; -/** - * GetSubscriptionRequest - */ + @SerializedName(SERIALIZED_NAME_KEY) + private String key; -public class GetSubscriptionRequest { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - /** - * Type is communication medium used. Either EMAIL or SMS. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EMAIL("EMAIL"), - - SMS("SMS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } + /** Type is communication medium used. Either EMAIL or SMS. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EMAIL("EMAIL"), - public String getValue() { - return value; - } + SMS("SMS"); - @Override - public String toString() { - return String.valueOf(value); - } + private String value; - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + TypeEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + @Override + public String toString() { + return String.valueOf(value); + } - public GetSubscriptionRequest() { - } + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public GetSubscriptionRequest key(String key) { - - this.key = key; - return this; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } - /** - * Key is the phone number or email. - * @return key - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key is the phone number or email.") + public static final String SERIALIZED_NAME_TYPE = "type"; - public String getKey() { - return key; - } + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + public GetSubscriptionRequest() {} - public void setKey(String key) { - this.key = key; - } + public GetSubscriptionRequest key(String key) { + this.key = key; + return this; + } + + /** + * Key is the phone number or email. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key is the phone number or email.") + public String getKey() { + return key; + } - public GetSubscriptionRequest type(TypeEnum type) { - - this.type = type; - return this; - } + public void setKey(String key) { + this.key = key; + } - /** - * Type is communication medium used. Either EMAIL or SMS. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type is communication medium used. Either EMAIL or SMS.") + public GetSubscriptionRequest type(TypeEnum type) { - public TypeEnum getType() { - return type; - } + this.type = type; + return this; + } + /** + * Type is communication medium used. Either EMAIL or SMS. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Type is communication medium used. Either EMAIL or SMS.") + public TypeEnum getType() { + return type; + } - public void setType(TypeEnum type) { - this.type = type; - } + public void setType(TypeEnum type) { + this.type = type; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSubscriptionRequest getSubscriptionRequest = (GetSubscriptionRequest) o; + return Objects.equals(this.key, getSubscriptionRequest.key) + && Objects.equals(this.type, getSubscriptionRequest.type); + } + @Override + public int hashCode() { + return Objects.hash(key, type); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSubscriptionRequest {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetSubscriptionRequest getSubscriptionRequest = (GetSubscriptionRequest) o; - return Objects.equals(this.key, getSubscriptionRequest.key) && - Objects.equals(this.type, getSubscriptionRequest.type); - } - - @Override - public int hashCode() { - return Objects.hash(key, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetSubscriptionRequest {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("type"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSubscriptionRequest - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetSubscriptionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetSubscriptionRequest is not found in the empty JSON string", GetSubscriptionRequest.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSubscriptionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSubscriptionRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetSubscriptionRequest is not found in" + + " the empty JSON string", + GetSubscriptionRequest.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetSubscriptionRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSubscriptionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSubscriptionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetSubscriptionRequest` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetSubscriptionRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSubscriptionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSubscriptionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSubscriptionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetSubscriptionRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSubscriptionRequest value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSubscriptionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetSubscriptionRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetSubscriptionRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetSubscriptionRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetSubscriptionRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetSubscriptionRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of GetSubscriptionRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetSubscriptionRequest - * @throws IOException if the JSON string is invalid with respect to GetSubscriptionRequest - */ - public static GetSubscriptionRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetSubscriptionRequest.class); - } - - /** - * Convert an instance of GetSubscriptionRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of GetSubscriptionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSubscriptionRequest + * @throws IOException if the JSON string is invalid with respect to GetSubscriptionRequest + */ + public static GetSubscriptionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSubscriptionRequest.class); + } + + /** + * Convert an instance of GetSubscriptionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java index 08a55453..ab9bbecc 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetTrackingPlanV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetTrackingPlan200Response - */ - +/** GetTrackingPlan200Response */ public class GetTrackingPlan200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetTrackingPlanV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetTrackingPlan200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetTrackingPlanV1Output data; - public GetTrackingPlan200Response data(GetTrackingPlanV1Output data) { - - this.data = data; - return this; - } + public GetTrackingPlan200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetTrackingPlan200Response data(GetTrackingPlanV1Output data) { - public GetTrackingPlanV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetTrackingPlanV1Output getData() { + return data; + } - public void setData(GetTrackingPlanV1Output data) { - this.data = data; - } + public void setData(GetTrackingPlanV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTrackingPlan200Response getTrackingPlan200Response = (GetTrackingPlan200Response) o; + return Objects.equals(this.data, getTrackingPlan200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTrackingPlan200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetTrackingPlan200Response getTrackingPlan200Response = (GetTrackingPlan200Response) o; - return Objects.equals(this.data, getTrackingPlan200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTrackingPlan200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTrackingPlan200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTrackingPlan200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetTrackingPlan200Response is not found in the empty JSON string", GetTrackingPlan200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTrackingPlan200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTrackingPlan200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTrackingPlan200Response is not" + + " found in the empty JSON string", + GetTrackingPlan200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTrackingPlan200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTrackingPlan200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTrackingPlan200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTrackingPlan200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTrackingPlan200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetTrackingPlan200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTrackingPlan200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTrackingPlan200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTrackingPlan200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTrackingPlan200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTrackingPlan200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTrackingPlan200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTrackingPlan200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTrackingPlan200Response + * @throws IOException if the JSON string is invalid with respect to GetTrackingPlan200Response + */ + public static GetTrackingPlan200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTrackingPlan200Response.class); } - } - - /** - * Create an instance of GetTrackingPlan200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTrackingPlan200Response - * @throws IOException if the JSON string is invalid with respect to GetTrackingPlan200Response - */ - public static GetTrackingPlan200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTrackingPlan200Response.class); - } - - /** - * Convert an instance of GetTrackingPlan200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetTrackingPlan200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java index 0bd43183..7cc02cb0 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.TrackingPlan; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Gets a single Tracking Plan. - */ +/** Gets a single Tracking Plan. */ @ApiModel(description = "Gets a single Tracking Plan.") - public class GetTrackingPlanV1Output { - public static final String SERIALIZED_NAME_TRACKING_PLAN = "trackingPlan"; - @SerializedName(SERIALIZED_NAME_TRACKING_PLAN) - private TrackingPlan trackingPlan; + public static final String SERIALIZED_NAME_TRACKING_PLAN = "trackingPlan"; - public GetTrackingPlanV1Output() { - } + @SerializedName(SERIALIZED_NAME_TRACKING_PLAN) + private TrackingPlan trackingPlan; - public GetTrackingPlanV1Output trackingPlan(TrackingPlan trackingPlan) { - - this.trackingPlan = trackingPlan; - return this; - } + public GetTrackingPlanV1Output() {} - /** - * Get trackingPlan - * @return trackingPlan - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetTrackingPlanV1Output trackingPlan(TrackingPlan trackingPlan) { - public TrackingPlan getTrackingPlan() { - return trackingPlan; - } + this.trackingPlan = trackingPlan; + return this; + } + /** + * Get trackingPlan + * + * @return trackingPlan + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public TrackingPlan getTrackingPlan() { + return trackingPlan; + } - public void setTrackingPlan(TrackingPlan trackingPlan) { - this.trackingPlan = trackingPlan; - } + public void setTrackingPlan(TrackingPlan trackingPlan) { + this.trackingPlan = trackingPlan; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTrackingPlanV1Output getTrackingPlanV1Output = (GetTrackingPlanV1Output) o; + return Objects.equals(this.trackingPlan, getTrackingPlanV1Output.trackingPlan); + } + @Override + public int hashCode() { + return Objects.hash(trackingPlan); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTrackingPlanV1Output {\n"); + sb.append(" trackingPlan: ").append(toIndentedString(trackingPlan)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetTrackingPlanV1Output getTrackingPlanV1Output = (GetTrackingPlanV1Output) o; - return Objects.equals(this.trackingPlan, getTrackingPlanV1Output.trackingPlan); - } - - @Override - public int hashCode() { - return Objects.hash(trackingPlan); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTrackingPlanV1Output {\n"); - sb.append(" trackingPlan: ").append(toIndentedString(trackingPlan)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("trackingPlan"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("trackingPlan"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("trackingPlan"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("trackingPlan"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTrackingPlanV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTrackingPlanV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetTrackingPlanV1Output is not found in the empty JSON string", GetTrackingPlanV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTrackingPlanV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTrackingPlanV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTrackingPlanV1Output is not found" + + " in the empty JSON string", + GetTrackingPlanV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTrackingPlanV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTrackingPlanV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTrackingPlanV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTrackingPlanV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetTrackingPlanV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTrackingPlanV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTrackingPlanV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTrackingPlanV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTrackingPlanV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTrackingPlanV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTrackingPlanV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTrackingPlanV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTrackingPlanV1Output + * @throws IOException if the JSON string is invalid with respect to GetTrackingPlanV1Output + */ + public static GetTrackingPlanV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTrackingPlanV1Output.class); } - } - - /** - * Create an instance of GetTrackingPlanV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTrackingPlanV1Output - * @throws IOException if the JSON string is invalid with respect to GetTrackingPlanV1Output - */ - public static GetTrackingPlanV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTrackingPlanV1Output.class); - } - - /** - * Convert an instance of GetTrackingPlanV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetTrackingPlanV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index 16376347..fca531e7 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,188 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetTransformationBetaOutput; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetTransformation200Response - */ - +/** GetTransformation200Response */ public class GetTransformation200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetTransformationBetaOutput data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetTransformation200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetTransformationBetaOutput data; - public GetTransformation200Response data(GetTransformationBetaOutput data) { - - this.data = data; - return this; - } + public GetTransformation200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetTransformation200Response data(GetTransformationBetaOutput data) { - public GetTransformationBetaOutput getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetTransformationBetaOutput getData() { + return data; + } - public void setData(GetTransformationBetaOutput data) { - this.data = data; - } + public void setData(GetTransformationBetaOutput data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformation200Response getTransformation200Response = + (GetTransformation200Response) o; + return Objects.equals(this.data, getTransformation200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformation200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetTransformation200Response getTransformation200Response = (GetTransformation200Response) o; - return Objects.equals(this.data, getTransformation200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTransformation200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformation200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTransformation200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransformation200Response is not found in the empty JSON string", GetTransformation200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetTransformation200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformation200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformation200Response is not" + + " found in the empty JSON string", + GetTransformation200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTransformation200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransformation200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformation200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformation200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTransformation200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTransformation200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetTransformation200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTransformation200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTransformation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformation200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformation200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetTransformation200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformation200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformation200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformation200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformation200Response + * @throws IOException if the JSON string is invalid with respect to + * GetTransformation200Response + */ + public static GetTransformation200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformation200Response.class); } - } - - /** - * Create an instance of GetTransformation200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTransformation200Response - * @throws IOException if the JSON string is invalid with respect to GetTransformation200Response - */ - public static GetTransformation200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTransformation200Response.class); - } - - /** - * Convert an instance of GetTransformation200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetTransformation200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java index c8084adc..1c867754 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,197 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Transformation; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The output of Transformation retrieval. - */ +/** The output of Transformation retrieval. */ @ApiModel(description = "The output of Transformation retrieval.") - public class GetTransformationBetaOutput { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation transformation; + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - public GetTransformationBetaOutput() { - } + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation transformation; - public GetTransformationBetaOutput transformation(Transformation transformation) { - - this.transformation = transformation; - return this; - } + public GetTransformationBetaOutput() {} - /** - * Get transformation - * @return transformation - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetTransformationBetaOutput transformation(Transformation transformation) { - public Transformation getTransformation() { - return transformation; - } + this.transformation = transformation; + return this; + } + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation getTransformation() { + return transformation; + } - public void setTransformation(Transformation transformation) { - this.transformation = transformation; - } + public void setTransformation(Transformation transformation) { + this.transformation = transformation; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationBetaOutput getTransformationBetaOutput = (GetTransformationBetaOutput) o; + return Objects.equals(this.transformation, getTransformationBetaOutput.transformation); + } + @Override + public int hashCode() { + return Objects.hash(transformation); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationBetaOutput {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetTransformationBetaOutput getTransformationBetaOutput = (GetTransformationBetaOutput) o; - return Objects.equals(this.transformation, getTransformationBetaOutput.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTransformationBetaOutput {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTransformationBetaOutput.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransformationBetaOutput is not found in the empty JSON string", GetTransformationBetaOutput.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationBetaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationBetaOutput is not" + + " found in the empty JSON string", + GetTransformationBetaOutput.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTransformationBetaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransformationBetaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationBetaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationBetaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetTransformationBetaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationBetaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTransformationBetaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTransformationBetaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaOutput.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTransformationBetaOutput value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTransformationBetaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationBetaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationBetaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationBetaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationBetaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationBetaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationBetaOutput + * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaOutput + */ + public static GetTransformationBetaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationBetaOutput.class); } - } - - /** - * Create an instance of GetTransformationBetaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTransformationBetaOutput - * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaOutput - */ - public static GetTransformationBetaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTransformationBetaOutput.class); - } - - /** - * Convert an instance of GetTransformationBetaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetTransformationBetaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetUser200Response.java b/src/main/java/com/segment/publicapi/models/GetUser200Response.java index b643bbab..71df8830 100644 --- a/src/main/java/com/segment/publicapi/models/GetUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUser200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,183 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetUserV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetUser200Response - */ - +/** GetUser200Response */ public class GetUser200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetUserV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetUser200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetUserV1Output data; - public GetUser200Response data(GetUserV1Output data) { - - this.data = data; - return this; - } + public GetUser200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetUser200Response data(GetUserV1Output data) { - public GetUserV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetUserV1Output getData() { + return data; + } - public void setData(GetUserV1Output data) { - this.data = data; - } + public void setData(GetUserV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUser200Response getUser200Response = (GetUser200Response) o; + return Objects.equals(this.data, getUser200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetUser200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetUser200Response getUser200Response = (GetUser200Response) o; - return Objects.equals(this.data, getUser200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetUser200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUser200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetUser200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetUser200Response is not found in the empty JSON string", GetUser200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetUser200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetUser200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetUser200Response is not found in the" + + " empty JSON string", + GetUser200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetUser200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetUser200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetUser200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetUser200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetUser200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetUser200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetUser200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetUser200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetUser200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetUser200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetUser200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetUser200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetUser200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetUser200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetUser200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetUser200Response + * @throws IOException if the JSON string is invalid with respect to GetUser200Response + */ + public static GetUser200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetUser200Response.class); } - } - - /** - * Create an instance of GetUser200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetUser200Response - * @throws IOException if the JSON string is invalid with respect to GetUser200Response - */ - public static GetUser200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetUser200Response.class); - } - - /** - * Convert an instance of GetUser200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetUser200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java index 72ccbcf5..89208576 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetUserGroupV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetUserGroup200Response - */ - +/** GetUserGroup200Response */ public class GetUserGroup200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetUserGroupV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetUserGroup200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetUserGroupV1Output data; - public GetUserGroup200Response data(GetUserGroupV1Output data) { - - this.data = data; - return this; - } + public GetUserGroup200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetUserGroup200Response data(GetUserGroupV1Output data) { - public GetUserGroupV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetUserGroupV1Output getData() { + return data; + } - public void setData(GetUserGroupV1Output data) { - this.data = data; - } + public void setData(GetUserGroupV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserGroup200Response getUserGroup200Response = (GetUserGroup200Response) o; + return Objects.equals(this.data, getUserGroup200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetUserGroup200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetUserGroup200Response getUserGroup200Response = (GetUserGroup200Response) o; - return Objects.equals(this.data, getUserGroup200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetUserGroup200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUserGroup200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetUserGroup200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetUserGroup200Response is not found in the empty JSON string", GetUserGroup200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetUserGroup200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetUserGroup200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetUserGroup200Response is not found" + + " in the empty JSON string", + GetUserGroup200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetUserGroup200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetUserGroup200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetUserGroup200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetUserGroup200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetUserGroup200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetUserGroup200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetUserGroup200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetUserGroup200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetUserGroup200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetUserGroup200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetUserGroup200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetUserGroup200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetUserGroup200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetUserGroup200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetUserGroup200Response + * @throws IOException if the JSON string is invalid with respect to GetUserGroup200Response + */ + public static GetUserGroup200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetUserGroup200Response.class); } - } - - /** - * Create an instance of GetUserGroup200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetUserGroup200Response - * @throws IOException if the JSON string is invalid with respect to GetUserGroup200Response - */ - public static GetUserGroup200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetUserGroup200Response.class); - } - - /** - * Convert an instance of GetUserGroup200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetUserGroup200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java index 2cd100a1..22ecbd17 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.UserGroup2; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a user group with the given id. - */ +/** Returns a user group with the given id. */ @ApiModel(description = "Returns a user group with the given id.") - public class GetUserGroupV1Output { - public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; - @SerializedName(SERIALIZED_NAME_USER_GROUP) - private UserGroup2 userGroup; + public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; - public GetUserGroupV1Output() { - } + @SerializedName(SERIALIZED_NAME_USER_GROUP) + private UserGroup2 userGroup; - public GetUserGroupV1Output userGroup(UserGroup2 userGroup) { - - this.userGroup = userGroup; - return this; - } + public GetUserGroupV1Output() {} - /** - * Get userGroup - * @return userGroup - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetUserGroupV1Output userGroup(UserGroup2 userGroup) { - public UserGroup2 getUserGroup() { - return userGroup; - } + this.userGroup = userGroup; + return this; + } + /** + * Get userGroup + * + * @return userGroup + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public UserGroup2 getUserGroup() { + return userGroup; + } - public void setUserGroup(UserGroup2 userGroup) { - this.userGroup = userGroup; - } + public void setUserGroup(UserGroup2 userGroup) { + this.userGroup = userGroup; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserGroupV1Output getUserGroupV1Output = (GetUserGroupV1Output) o; + return Objects.equals(this.userGroup, getUserGroupV1Output.userGroup); + } + @Override + public int hashCode() { + return Objects.hash(userGroup); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetUserGroupV1Output {\n"); + sb.append(" userGroup: ").append(toIndentedString(userGroup)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetUserGroupV1Output getUserGroupV1Output = (GetUserGroupV1Output) o; - return Objects.equals(this.userGroup, getUserGroupV1Output.userGroup); - } - - @Override - public int hashCode() { - return Objects.hash(userGroup); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetUserGroupV1Output {\n"); - sb.append(" userGroup: ").append(toIndentedString(userGroup)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userGroup"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userGroup"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userGroup"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userGroup"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUserGroupV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetUserGroupV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetUserGroupV1Output is not found in the empty JSON string", GetUserGroupV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetUserGroupV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetUserGroupV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetUserGroupV1Output is not found in" + + " the empty JSON string", + GetUserGroupV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetUserGroupV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetUserGroupV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetUserGroupV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetUserGroupV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetUserGroupV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetUserGroupV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetUserGroupV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetUserGroupV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetUserGroupV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetUserGroupV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetUserGroupV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetUserGroupV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetUserGroupV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetUserGroupV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetUserGroupV1Output + * @throws IOException if the JSON string is invalid with respect to GetUserGroupV1Output + */ + public static GetUserGroupV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetUserGroupV1Output.class); } - } - - /** - * Create an instance of GetUserGroupV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetUserGroupV1Output - * @throws IOException if the JSON string is invalid with respect to GetUserGroupV1Output - */ - public static GetUserGroupV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetUserGroupV1Output.class); - } - - /** - * Convert an instance of GetUserGroupV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetUserGroupV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java index 846902ab..ccdcb8b2 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.User; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns the user. - */ +/** Returns the user. */ @ApiModel(description = "Returns the user.") - public class GetUserV1Output { - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private User user; + public static final String SERIALIZED_NAME_USER = "user"; - public GetUserV1Output() { - } + @SerializedName(SERIALIZED_NAME_USER) + private User user; - public GetUserV1Output user(User user) { - - this.user = user; - return this; - } + public GetUserV1Output() {} - /** - * Get user - * @return user - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetUserV1Output user(User user) { - public User getUser() { - return user; - } + this.user = user; + return this; + } + /** + * Get user + * + * @return user + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public User getUser() { + return user; + } - public void setUser(User user) { - this.user = user; - } + public void setUser(User user) { + this.user = user; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserV1Output getUserV1Output = (GetUserV1Output) o; + return Objects.equals(this.user, getUserV1Output.user); + } + @Override + public int hashCode() { + return Objects.hash(user); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetUserV1Output {\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetUserV1Output getUserV1Output = (GetUserV1Output) o; - return Objects.equals(this.user, getUserV1Output.user); - } - - @Override - public int hashCode() { - return Objects.hash(user); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetUserV1Output {\n"); - sb.append(" user: ").append(toIndentedString(user)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("user"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("user"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("user"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("user"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUserV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetUserV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetUserV1Output is not found in the empty JSON string", GetUserV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetUserV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetUserV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetUserV1Output is not found in the" + + " empty JSON string", + GetUserV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetUserV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetUserV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetUserV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetUserV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetUserV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetUserV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetUserV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetUserV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetUserV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetUserV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetUserV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetUserV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetUserV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetUserV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetUserV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetUserV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetUserV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetUserV1Output + * @throws IOException if the JSON string is invalid with respect to GetUserV1Output + */ + public static GetUserV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetUserV1Output.class); } - } - - /** - * Create an instance of GetUserV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetUserV1Output - * @throws IOException if the JSON string is invalid with respect to GetUserV1Output - */ - public static GetUserV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetUserV1Output.class); - } - - /** - * Convert an instance of GetUserV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetUserV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java index dbf81912..1baedb8f 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetWarehouseV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetWarehouse200Response - */ - +/** GetWarehouse200Response */ public class GetWarehouse200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetWarehouseV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetWarehouse200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetWarehouseV1Output data; - public GetWarehouse200Response data(GetWarehouseV1Output data) { - - this.data = data; - return this; - } + public GetWarehouse200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetWarehouse200Response data(GetWarehouseV1Output data) { - public GetWarehouseV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetWarehouseV1Output getData() { + return data; + } - public void setData(GetWarehouseV1Output data) { - this.data = data; - } + public void setData(GetWarehouseV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWarehouse200Response getWarehouse200Response = (GetWarehouse200Response) o; + return Objects.equals(this.data, getWarehouse200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWarehouse200Response getWarehouse200Response = (GetWarehouse200Response) o; - return Objects.equals(this.data, getWarehouse200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWarehouse200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehouse200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWarehouse200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWarehouse200Response is not found in the empty JSON string", GetWarehouse200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWarehouse200Response is not found" + + " in the empty JSON string", + GetWarehouse200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWarehouse200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWarehouse200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWarehouse200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWarehouse200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWarehouse200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWarehouse200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWarehouse200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWarehouse200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWarehouse200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWarehouse200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWarehouse200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to GetWarehouse200Response + */ + public static GetWarehouse200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWarehouse200Response.class); } - } - - /** - * Create an instance of GetWarehouse200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWarehouse200Response - * @throws IOException if the JSON string is invalid with respect to GetWarehouse200Response - */ - public static GetWarehouse200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWarehouse200Response.class); - } - - /** - * Convert an instance of GetWarehouse200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java index 8ab4fb7c..e62895da 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetWarehouseMetadataV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetWarehouseMetadata200Response - */ - +/** GetWarehouseMetadata200Response */ public class GetWarehouseMetadata200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetWarehouseMetadataV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetWarehouseMetadata200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetWarehouseMetadataV1Output data; - public GetWarehouseMetadata200Response data(GetWarehouseMetadataV1Output data) { - - this.data = data; - return this; - } + public GetWarehouseMetadata200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetWarehouseMetadata200Response data(GetWarehouseMetadataV1Output data) { - public GetWarehouseMetadataV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetWarehouseMetadataV1Output getData() { + return data; + } - public void setData(GetWarehouseMetadataV1Output data) { - this.data = data; - } + public void setData(GetWarehouseMetadataV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWarehouseMetadata200Response getWarehouseMetadata200Response = + (GetWarehouseMetadata200Response) o; + return Objects.equals(this.data, getWarehouseMetadata200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWarehouseMetadata200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWarehouseMetadata200Response getWarehouseMetadata200Response = (GetWarehouseMetadata200Response) o; - return Objects.equals(this.data, getWarehouseMetadata200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWarehouseMetadata200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehouseMetadata200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWarehouseMetadata200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWarehouseMetadata200Response is not found in the empty JSON string", GetWarehouseMetadata200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetWarehouseMetadata200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWarehouseMetadata200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWarehouseMetadata200Response is not" + + " found in the empty JSON string", + GetWarehouseMetadata200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWarehouseMetadata200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWarehouseMetadata200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWarehouseMetadata200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWarehouseMetadata200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWarehouseMetadata200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWarehouseMetadata200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWarehouseMetadata200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWarehouseMetadata200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWarehouseMetadata200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWarehouseMetadata200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWarehouseMetadata200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetWarehouseMetadata200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWarehouseMetadata200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWarehouseMetadata200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWarehouseMetadata200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWarehouseMetadata200Response + * @throws IOException if the JSON string is invalid with respect to + * GetWarehouseMetadata200Response + */ + public static GetWarehouseMetadata200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWarehouseMetadata200Response.class); } - } - - /** - * Create an instance of GetWarehouseMetadata200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWarehouseMetadata200Response - * @throws IOException if the JSON string is invalid with respect to GetWarehouseMetadata200Response - */ - public static GetWarehouseMetadata200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWarehouseMetadata200Response.class); - } - - /** - * Convert an instance of GetWarehouseMetadata200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWarehouseMetadata200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java index 446756fe..9b7810bb 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,204 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.WarehouseMetadata; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a Warehouse catalog item looked up by id. - */ +/** Returns a Warehouse catalog item looked up by id. */ @ApiModel(description = "Returns a Warehouse catalog item looked up by id.") - public class GetWarehouseMetadataV1Output { - public static final String SERIALIZED_NAME_WAREHOUSE_METADATA = "warehouseMetadata"; - @SerializedName(SERIALIZED_NAME_WAREHOUSE_METADATA) - private WarehouseMetadata warehouseMetadata; + public static final String SERIALIZED_NAME_WAREHOUSE_METADATA = "warehouseMetadata"; - public GetWarehouseMetadataV1Output() { - } + @SerializedName(SERIALIZED_NAME_WAREHOUSE_METADATA) + private WarehouseMetadata warehouseMetadata; - public GetWarehouseMetadataV1Output warehouseMetadata(WarehouseMetadata warehouseMetadata) { - - this.warehouseMetadata = warehouseMetadata; - return this; - } + public GetWarehouseMetadataV1Output() {} - /** - * Get warehouseMetadata - * @return warehouseMetadata - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetWarehouseMetadataV1Output warehouseMetadata(WarehouseMetadata warehouseMetadata) { - public WarehouseMetadata getWarehouseMetadata() { - return warehouseMetadata; - } + this.warehouseMetadata = warehouseMetadata; + return this; + } + /** + * Get warehouseMetadata + * + * @return warehouseMetadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public WarehouseMetadata getWarehouseMetadata() { + return warehouseMetadata; + } - public void setWarehouseMetadata(WarehouseMetadata warehouseMetadata) { - this.warehouseMetadata = warehouseMetadata; - } + public void setWarehouseMetadata(WarehouseMetadata warehouseMetadata) { + this.warehouseMetadata = warehouseMetadata; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWarehouseMetadataV1Output getWarehouseMetadataV1Output = + (GetWarehouseMetadataV1Output) o; + return Objects.equals( + this.warehouseMetadata, getWarehouseMetadataV1Output.warehouseMetadata); + } + @Override + public int hashCode() { + return Objects.hash(warehouseMetadata); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWarehouseMetadataV1Output {\n"); + sb.append(" warehouseMetadata: ") + .append(toIndentedString(warehouseMetadata)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWarehouseMetadataV1Output getWarehouseMetadataV1Output = (GetWarehouseMetadataV1Output) o; - return Objects.equals(this.warehouseMetadata, getWarehouseMetadataV1Output.warehouseMetadata); - } - - @Override - public int hashCode() { - return Objects.hash(warehouseMetadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWarehouseMetadataV1Output {\n"); - sb.append(" warehouseMetadata: ").append(toIndentedString(warehouseMetadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("warehouseMetadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("warehouseMetadata"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("warehouseMetadata"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("warehouseMetadata"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehouseMetadataV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWarehouseMetadataV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWarehouseMetadataV1Output is not found in the empty JSON string", GetWarehouseMetadataV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetWarehouseMetadataV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWarehouseMetadataV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWarehouseMetadataV1Output is not" + + " found in the empty JSON string", + GetWarehouseMetadataV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWarehouseMetadataV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWarehouseMetadataV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWarehouseMetadataV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWarehouseMetadataV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetWarehouseMetadataV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetWarehouseMetadataV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWarehouseMetadataV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWarehouseMetadataV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWarehouseMetadataV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWarehouseMetadataV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWarehouseMetadataV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWarehouseMetadataV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWarehouseMetadataV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetWarehouseMetadataV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWarehouseMetadataV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWarehouseMetadataV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWarehouseMetadataV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWarehouseMetadataV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetWarehouseMetadataV1Output + */ + public static GetWarehouseMetadataV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWarehouseMetadataV1Output.class); } - } - - /** - * Create an instance of GetWarehouseMetadataV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWarehouseMetadataV1Output - * @throws IOException if the JSON string is invalid with respect to GetWarehouseMetadataV1Output - */ - public static GetWarehouseMetadataV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWarehouseMetadataV1Output.class); - } - - /** - * Convert an instance of GetWarehouseMetadataV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWarehouseMetadataV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java index 104271f6..7ee39c4f 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Warehouse; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a Warehouse. - */ +/** Returns a Warehouse. */ @ApiModel(description = "Returns a Warehouse.") - public class GetWarehouseV1Output { - public static final String SERIALIZED_NAME_WAREHOUSE = "warehouse"; - @SerializedName(SERIALIZED_NAME_WAREHOUSE) - private Warehouse warehouse; + public static final String SERIALIZED_NAME_WAREHOUSE = "warehouse"; - public GetWarehouseV1Output() { - } + @SerializedName(SERIALIZED_NAME_WAREHOUSE) + private Warehouse warehouse; - public GetWarehouseV1Output warehouse(Warehouse warehouse) { - - this.warehouse = warehouse; - return this; - } + public GetWarehouseV1Output() {} - /** - * Get warehouse - * @return warehouse - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetWarehouseV1Output warehouse(Warehouse warehouse) { - public Warehouse getWarehouse() { - return warehouse; - } + this.warehouse = warehouse; + return this; + } + /** + * Get warehouse + * + * @return warehouse + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Warehouse getWarehouse() { + return warehouse; + } - public void setWarehouse(Warehouse warehouse) { - this.warehouse = warehouse; - } + public void setWarehouse(Warehouse warehouse) { + this.warehouse = warehouse; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWarehouseV1Output getWarehouseV1Output = (GetWarehouseV1Output) o; + return Objects.equals(this.warehouse, getWarehouseV1Output.warehouse); + } + @Override + public int hashCode() { + return Objects.hash(warehouse); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWarehouseV1Output {\n"); + sb.append(" warehouse: ").append(toIndentedString(warehouse)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWarehouseV1Output getWarehouseV1Output = (GetWarehouseV1Output) o; - return Objects.equals(this.warehouse, getWarehouseV1Output.warehouse); - } - - @Override - public int hashCode() { - return Objects.hash(warehouse); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWarehouseV1Output {\n"); - sb.append(" warehouse: ").append(toIndentedString(warehouse)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("warehouse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("warehouse"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("warehouse"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("warehouse"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehouseV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWarehouseV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWarehouseV1Output is not found in the empty JSON string", GetWarehouseV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetWarehouseV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWarehouseV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWarehouseV1Output is not found in" + + " the empty JSON string", + GetWarehouseV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWarehouseV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWarehouseV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWarehouseV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWarehouseV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetWarehouseV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWarehouseV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWarehouseV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWarehouseV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWarehouseV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWarehouseV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetWarehouseV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWarehouseV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWarehouseV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWarehouseV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWarehouseV1Output + * @throws IOException if the JSON string is invalid with respect to GetWarehouseV1Output + */ + public static GetWarehouseV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWarehouseV1Output.class); } - } - - /** - * Create an instance of GetWarehouseV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWarehouseV1Output - * @throws IOException if the JSON string is invalid with respect to GetWarehouseV1Output - */ - public static GetWarehouseV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWarehouseV1Output.class); - } - - /** - * Convert an instance of GetWarehouseV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWarehouseV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java index c1ce1546..a2fc1d68 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,189 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetWarehousesCatalogV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetWarehousesCatalog200Response - */ - +/** GetWarehousesCatalog200Response */ public class GetWarehousesCatalog200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetWarehousesCatalogV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetWarehousesCatalog200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetWarehousesCatalogV1Output data; - public GetWarehousesCatalog200Response data(GetWarehousesCatalogV1Output data) { - - this.data = data; - return this; - } + public GetWarehousesCatalog200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetWarehousesCatalog200Response data(GetWarehousesCatalogV1Output data) { - public GetWarehousesCatalogV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetWarehousesCatalogV1Output getData() { + return data; + } - public void setData(GetWarehousesCatalogV1Output data) { - this.data = data; - } + public void setData(GetWarehousesCatalogV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWarehousesCatalog200Response getWarehousesCatalog200Response = + (GetWarehousesCatalog200Response) o; + return Objects.equals(this.data, getWarehousesCatalog200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWarehousesCatalog200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWarehousesCatalog200Response getWarehousesCatalog200Response = (GetWarehousesCatalog200Response) o; - return Objects.equals(this.data, getWarehousesCatalog200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWarehousesCatalog200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehousesCatalog200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWarehousesCatalog200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWarehousesCatalog200Response is not found in the empty JSON string", GetWarehousesCatalog200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetWarehousesCatalog200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWarehousesCatalog200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWarehousesCatalog200Response is not" + + " found in the empty JSON string", + GetWarehousesCatalog200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWarehousesCatalog200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWarehousesCatalog200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWarehousesCatalog200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWarehousesCatalog200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWarehousesCatalog200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWarehousesCatalog200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWarehousesCatalog200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWarehousesCatalog200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWarehousesCatalog200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWarehousesCatalog200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWarehousesCatalog200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetWarehousesCatalog200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWarehousesCatalog200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWarehousesCatalog200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWarehousesCatalog200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWarehousesCatalog200Response + * @throws IOException if the JSON string is invalid with respect to + * GetWarehousesCatalog200Response + */ + public static GetWarehousesCatalog200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWarehousesCatalog200Response.class); } - } - - /** - * Create an instance of GetWarehousesCatalog200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWarehousesCatalog200Response - * @throws IOException if the JSON string is invalid with respect to GetWarehousesCatalog200Response - */ - public static GetWarehousesCatalog200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWarehousesCatalog200Response.class); - } - - /** - * Convert an instance of GetWarehousesCatalog200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWarehousesCatalog200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java index 4871eca6..1ec751df 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,251 +10,258 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Pagination; -import com.segment.publicapi.models.WarehouseMetadataV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Returns a list of all Warehouse catalog items contained within a given page. - */ -@ApiModel(description = "Returns a list of all Warehouse catalog items contained within a given page.") - +/** Returns a list of all Warehouse catalog items contained within a given page. */ +@ApiModel( + description = + "Returns a list of all Warehouse catalog items contained within a given page.") public class GetWarehousesCatalogV1Output { - public static final String SERIALIZED_NAME_WAREHOUSES_CATALOG = "warehousesCatalog"; - @SerializedName(SERIALIZED_NAME_WAREHOUSES_CATALOG) - private List warehousesCatalog = new ArrayList<>(); + public static final String SERIALIZED_NAME_WAREHOUSES_CATALOG = "warehousesCatalog"; - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + @SerializedName(SERIALIZED_NAME_WAREHOUSES_CATALOG) + private List warehousesCatalog = new ArrayList<>(); - public GetWarehousesCatalogV1Output() { - } + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - public GetWarehousesCatalogV1Output warehousesCatalog(List warehousesCatalog) { - - this.warehousesCatalog = warehousesCatalog; - return this; - } + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; - public GetWarehousesCatalogV1Output addWarehousesCatalogItem(WarehouseMetadataV1 warehousesCatalogItem) { - this.warehousesCatalog.add(warehousesCatalogItem); - return this; - } + public GetWarehousesCatalogV1Output() {} - /** - * All Warehouse catalog items contained within the requested page. - * @return warehousesCatalog - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All Warehouse catalog items contained within the requested page.") - - public List getWarehousesCatalog() { - return warehousesCatalog; - } + public GetWarehousesCatalogV1Output warehousesCatalog( + List warehousesCatalog) { + this.warehousesCatalog = warehousesCatalog; + return this; + } - public void setWarehousesCatalog(List warehousesCatalog) { - this.warehousesCatalog = warehousesCatalog; - } + public GetWarehousesCatalogV1Output addWarehousesCatalogItem( + WarehouseMetadataV1 warehousesCatalogItem) { + this.warehousesCatalog.add(warehousesCatalogItem); + return this; + } + /** + * All Warehouse catalog items contained within the requested page. + * + * @return warehousesCatalog + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "All Warehouse catalog items contained within the requested page.") + public List getWarehousesCatalog() { + return warehousesCatalog; + } - public GetWarehousesCatalogV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } + public void setWarehousesCatalog(List warehousesCatalog) { + this.warehousesCatalog = warehousesCatalog; + } - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetWarehousesCatalogV1Output pagination(Pagination pagination) { - public Pagination getPagination() { - return pagination; - } + this.pagination = pagination; + return this; + } + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWarehousesCatalogV1Output getWarehousesCatalogV1Output = + (GetWarehousesCatalogV1Output) o; + return Objects.equals( + this.warehousesCatalog, getWarehousesCatalogV1Output.warehousesCatalog) + && Objects.equals(this.pagination, getWarehousesCatalogV1Output.pagination); + } + @Override + public int hashCode() { + return Objects.hash(warehousesCatalog, pagination); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWarehousesCatalogV1Output {\n"); + sb.append(" warehousesCatalog: ") + .append(toIndentedString(warehousesCatalog)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWarehousesCatalogV1Output getWarehousesCatalogV1Output = (GetWarehousesCatalogV1Output) o; - return Objects.equals(this.warehousesCatalog, getWarehousesCatalogV1Output.warehousesCatalog) && - Objects.equals(this.pagination, getWarehousesCatalogV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(warehousesCatalog, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWarehousesCatalogV1Output {\n"); - sb.append(" warehousesCatalog: ").append(toIndentedString(warehousesCatalog)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("warehousesCatalog"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("warehousesCatalog"); + openapiRequiredFields.add("pagination"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("warehousesCatalog"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("warehousesCatalog"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehousesCatalogV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWarehousesCatalogV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWarehousesCatalogV1Output is not found in the empty JSON string", GetWarehousesCatalogV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetWarehousesCatalogV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWarehousesCatalogV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWarehousesCatalogV1Output is not" + + " found in the empty JSON string", + GetWarehousesCatalogV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWarehousesCatalogV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWarehousesCatalogV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWarehousesCatalogV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWarehousesCatalogV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetWarehousesCatalogV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetWarehousesCatalogV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("warehousesCatalog").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `warehousesCatalog` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("warehousesCatalog").toString())); } - } - // ensure the json data is an array - if (!jsonObj.get("warehousesCatalog").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `warehousesCatalog` to be an array in the JSON string but got `%s`", jsonObj.get("warehousesCatalog").toString())); - } - JsonArray jsonArraywarehousesCatalog = jsonObj.getAsJsonArray("warehousesCatalog"); - } + JsonArray jsonArraywarehousesCatalog = jsonObj.getAsJsonArray("warehousesCatalog"); + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWarehousesCatalogV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWarehousesCatalogV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWarehousesCatalogV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWarehousesCatalogV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWarehousesCatalogV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWarehousesCatalogV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWarehousesCatalogV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetWarehousesCatalogV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWarehousesCatalogV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWarehousesCatalogV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWarehousesCatalogV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWarehousesCatalogV1Output + * @throws IOException if the JSON string is invalid with respect to + * GetWarehousesCatalogV1Output + */ + public static GetWarehousesCatalogV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWarehousesCatalogV1Output.class); } - } - - /** - * Create an instance of GetWarehousesCatalogV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWarehousesCatalogV1Output - * @throws IOException if the JSON string is invalid with respect to GetWarehousesCatalogV1Output - */ - public static GetWarehousesCatalogV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWarehousesCatalogV1Output.class); - } - - /** - * Convert an instance of GetWarehousesCatalogV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWarehousesCatalogV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java index eeaac250..9c7fa5ac 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,197 +10,184 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.GetWorkspaceV1Output; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * GetWorkspace200Response - */ - +/** GetWorkspace200Response */ public class GetWorkspace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private GetWorkspaceV1Output data; + public static final String SERIALIZED_NAME_DATA = "data"; - public GetWorkspace200Response() { - } + @SerializedName(SERIALIZED_NAME_DATA) + private GetWorkspaceV1Output data; - public GetWorkspace200Response data(GetWorkspaceV1Output data) { - - this.data = data; - return this; - } + public GetWorkspace200Response() {} - /** - * Get data - * @return data - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + public GetWorkspace200Response data(GetWorkspaceV1Output data) { - public GetWorkspaceV1Output getData() { - return data; - } + this.data = data; + return this; + } + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetWorkspaceV1Output getData() { + return data; + } - public void setData(GetWorkspaceV1Output data) { - this.data = data; - } + public void setData(GetWorkspaceV1Output data) { + this.data = data; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWorkspace200Response getWorkspace200Response = (GetWorkspace200Response) o; + return Objects.equals(this.data, getWorkspace200Response.data); + } + @Override + public int hashCode() { + return Objects.hash(data); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWorkspace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWorkspace200Response getWorkspace200Response = (GetWorkspace200Response) o; - return Objects.equals(this.data, getWorkspace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWorkspace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWorkspace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWorkspace200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWorkspace200Response is not found in the empty JSON string", GetWorkspace200Response.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetWorkspace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWorkspace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWorkspace200Response is not found" + + " in the empty JSON string", + GetWorkspace200Response.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWorkspace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWorkspace200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWorkspace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWorkspace200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWorkspace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWorkspace200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWorkspace200Response.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWorkspace200Response value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWorkspace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWorkspace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWorkspace200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetWorkspace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWorkspace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWorkspace200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWorkspace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWorkspace200Response + * @throws IOException if the JSON string is invalid with respect to GetWorkspace200Response + */ + public static GetWorkspace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWorkspace200Response.class); } - } - - /** - * Create an instance of GetWorkspace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWorkspace200Response - * @throws IOException if the JSON string is invalid with respect to GetWorkspace200Response - */ - public static GetWorkspace200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWorkspace200Response.class); - } - - /** - * Convert an instance of GetWorkspace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWorkspace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java index a2298d60..a5ea6bf8 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,206 +10,196 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.Workspace; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Represents the output of loading the Workspace. - */ +/** Represents the output of loading the Workspace. */ @ApiModel(description = "Represents the output of loading the Workspace.") - public class GetWorkspaceV1Output { - public static final String SERIALIZED_NAME_WORKSPACE = "workspace"; - @SerializedName(SERIALIZED_NAME_WORKSPACE) - private Workspace workspace; + public static final String SERIALIZED_NAME_WORKSPACE = "workspace"; - public GetWorkspaceV1Output() { - } + @SerializedName(SERIALIZED_NAME_WORKSPACE) + private Workspace workspace; - public GetWorkspaceV1Output workspace(Workspace workspace) { - - this.workspace = workspace; - return this; - } + public GetWorkspaceV1Output() {} - /** - * Get workspace - * @return workspace - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + public GetWorkspaceV1Output workspace(Workspace workspace) { - public Workspace getWorkspace() { - return workspace; - } + this.workspace = workspace; + return this; + } + /** + * Get workspace + * + * @return workspace + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Workspace getWorkspace() { + return workspace; + } - public void setWorkspace(Workspace workspace) { - this.workspace = workspace; - } + public void setWorkspace(Workspace workspace) { + this.workspace = workspace; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWorkspaceV1Output getWorkspaceV1Output = (GetWorkspaceV1Output) o; + return Objects.equals(this.workspace, getWorkspaceV1Output.workspace); + } + @Override + public int hashCode() { + return Objects.hash(workspace); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWorkspaceV1Output {\n"); + sb.append(" workspace: ").append(toIndentedString(workspace)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GetWorkspaceV1Output getWorkspaceV1Output = (GetWorkspaceV1Output) o; - return Objects.equals(this.workspace, getWorkspaceV1Output.workspace); - } - - @Override - public int hashCode() { - return Objects.hash(workspace); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetWorkspaceV1Output {\n"); - sb.append(" workspace: ").append(toIndentedString(workspace)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workspace"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workspace"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("workspace"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("workspace"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWorkspaceV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetWorkspaceV1Output.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GetWorkspaceV1Output is not found in the empty JSON string", GetWorkspaceV1Output.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetWorkspaceV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetWorkspaceV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetWorkspaceV1Output is not found in" + + " the empty JSON string", + GetWorkspaceV1Output.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetWorkspaceV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetWorkspaceV1Output` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetWorkspaceV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetWorkspaceV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetWorkspaceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetWorkspaceV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetWorkspaceV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetWorkspaceV1Output' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GetWorkspaceV1Output.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GetWorkspaceV1Output value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetWorkspaceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetWorkspaceV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetWorkspaceV1Output' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetWorkspaceV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetWorkspaceV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetWorkspaceV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetWorkspaceV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetWorkspaceV1Output + * @throws IOException if the JSON string is invalid with respect to GetWorkspaceV1Output + */ + public static GetWorkspaceV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetWorkspaceV1Output.class); } - } - - /** - * Create an instance of GetWorkspaceV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetWorkspaceV1Output - * @throws IOException if the JSON string is invalid with respect to GetWorkspaceV1Output - */ - public static GetWorkspaceV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetWorkspaceV1Output.class); - } - - /** - * Convert an instance of GetWorkspaceV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of GetWorkspaceV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Group.java b/src/main/java/com/segment/publicapi/models/Group.java index dd48b5f9..6b888c88 100644 --- a/src/main/java/com/segment/publicapi/models/Group.java +++ b/src/main/java/com/segment/publicapi/models/Group.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,309 +10,325 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Group settings. - */ +/** Group settings. */ @ApiModel(description = "Group settings.") - public class Group { - public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) - private Boolean allowUnplannedTraits; - - public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = "allowTraitsOnViolations"; - @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) - private Boolean allowTraitsOnViolations; - - /** - * The common group event on violations. Config API note: equal to `commonGroupEventOnViolations`. - */ - @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) - public enum CommonEventOnViolationsEnum { - ALLOW("ALLOW"), - - BLOCK("BLOCK"), - - OMIT_TRAITS("OMIT_TRAITS"); - - private String value; - - CommonEventOnViolationsEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) + private Boolean allowUnplannedTraits; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = + "allowTraitsOnViolations"; - public static CommonEventOnViolationsEnum fromValue(String value) { - for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) + private Boolean allowTraitsOnViolations; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CommonEventOnViolationsEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CommonEventOnViolationsEnum.fromValue(value); - } - } - } + /** + * The common group event on violations. Config API note: equal to + * `commonGroupEventOnViolations`. + */ + @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) + public enum CommonEventOnViolationsEnum { + ALLOW("ALLOW"), + + BLOCK("BLOCK"), - public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = "commonEventOnViolations"; - @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) - private CommonEventOnViolationsEnum commonEventOnViolations; + OMIT_TRAITS("OMIT_TRAITS"); - public Group() { - } + private String value; + + CommonEventOnViolationsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } - public Group allowUnplannedTraits(Boolean allowUnplannedTraits) { - - this.allowUnplannedTraits = allowUnplannedTraits; - return this; - } + public static CommonEventOnViolationsEnum fromValue(String value) { + for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * Enable to allow unplanned group traits. Config API note: equal to `allowUnplannedGroupTraits`. - * @return allowUnplannedTraits - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow unplanned group traits. Config API note: equal to `allowUnplannedGroupTraits`.") + public static class Adapter extends TypeAdapter { + @Override + public void write( + final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CommonEventOnViolationsEnum read(final JsonReader jsonReader) + throws IOException { + String value = jsonReader.nextString(); + return CommonEventOnViolationsEnum.fromValue(value); + } + } + } - public Boolean getAllowUnplannedTraits() { - return allowUnplannedTraits; - } + public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = + "commonEventOnViolations"; + @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) + private CommonEventOnViolationsEnum commonEventOnViolations; - public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { - this.allowUnplannedTraits = allowUnplannedTraits; - } + public Group() {} + public Group allowUnplannedTraits(Boolean allowUnplannedTraits) { - public Group allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - - this.allowTraitsOnViolations = allowTraitsOnViolations; - return this; - } + this.allowUnplannedTraits = allowUnplannedTraits; + return this; + } - /** - * Enable to allow group traits on violations. Config API note: equal to `allowGroupTraitsOnViolations`. - * @return allowTraitsOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow group traits on violations. Config API note: equal to `allowGroupTraitsOnViolations`.") + /** + * Enable to allow unplanned group traits. Config API note: equal to + * `allowUnplannedGroupTraits`. + * + * @return allowUnplannedTraits + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow unplanned group traits. Config API note: equal to" + + " `allowUnplannedGroupTraits`.") + public Boolean getAllowUnplannedTraits() { + return allowUnplannedTraits; + } - public Boolean getAllowTraitsOnViolations() { - return allowTraitsOnViolations; - } + public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { + this.allowUnplannedTraits = allowUnplannedTraits; + } + public Group allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { - this.allowTraitsOnViolations = allowTraitsOnViolations; - } + this.allowTraitsOnViolations = allowTraitsOnViolations; + return this; + } + /** + * Enable to allow group traits on violations. Config API note: equal to + * `allowGroupTraitsOnViolations`. + * + * @return allowTraitsOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow group traits on violations. Config API note: equal to" + + " `allowGroupTraitsOnViolations`.") + public Boolean getAllowTraitsOnViolations() { + return allowTraitsOnViolations; + } - public Group commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - - this.commonEventOnViolations = commonEventOnViolations; - return this; - } + public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { + this.allowTraitsOnViolations = allowTraitsOnViolations; + } - /** - * The common group event on violations. Config API note: equal to `commonGroupEventOnViolations`. - * @return commonEventOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The common group event on violations. Config API note: equal to `commonGroupEventOnViolations`.") + public Group commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - public CommonEventOnViolationsEnum getCommonEventOnViolations() { - return commonEventOnViolations; - } + this.commonEventOnViolations = commonEventOnViolations; + return this; + } + /** + * The common group event on violations. Config API note: equal to + * `commonGroupEventOnViolations`. + * + * @return commonEventOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The common group event on violations. Config API note: equal to" + + " `commonGroupEventOnViolations`.") + public CommonEventOnViolationsEnum getCommonEventOnViolations() { + return commonEventOnViolations; + } - public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - this.commonEventOnViolations = commonEventOnViolations; - } + public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { + this.commonEventOnViolations = commonEventOnViolations; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Group group = (Group) o; + return Objects.equals(this.allowUnplannedTraits, group.allowUnplannedTraits) + && Objects.equals(this.allowTraitsOnViolations, group.allowTraitsOnViolations) + && Objects.equals(this.commonEventOnViolations, group.commonEventOnViolations); + } + @Override + public int hashCode() { + return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Group {\n"); + sb.append(" allowUnplannedTraits: ") + .append(toIndentedString(allowUnplannedTraits)) + .append("\n"); + sb.append(" allowTraitsOnViolations: ") + .append(toIndentedString(allowTraitsOnViolations)) + .append("\n"); + sb.append(" commonEventOnViolations: ") + .append(toIndentedString(commonEventOnViolations)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Group group = (Group) o; - return Objects.equals(this.allowUnplannedTraits, group.allowUnplannedTraits) && - Objects.equals(this.allowTraitsOnViolations, group.allowTraitsOnViolations) && - Objects.equals(this.commonEventOnViolations, group.commonEventOnViolations); - } - - @Override - public int hashCode() { - return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Group {\n"); - sb.append(" allowUnplannedTraits: ").append(toIndentedString(allowUnplannedTraits)).append("\n"); - sb.append(" allowTraitsOnViolations: ").append(toIndentedString(allowTraitsOnViolations)).append("\n"); - sb.append(" commonEventOnViolations: ").append(toIndentedString(commonEventOnViolations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("allowUnplannedTraits"); + openapiFields.add("allowTraitsOnViolations"); + openapiFields.add("commonEventOnViolations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowUnplannedTraits"); - openapiFields.add("allowTraitsOnViolations"); - openapiFields.add("commonEventOnViolations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Group - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Group.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Group is not found in the empty JSON string", Group.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Group + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Group.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Group is not found in the empty JSON" + + " string", + Group.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Group.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Group` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Group.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Group`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("commonEventOnViolations") != null + && !jsonObj.get("commonEventOnViolations").isJsonNull()) + && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commonEventOnViolations` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("commonEventOnViolations").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Group.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Group' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Group.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Group value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Group read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if ((jsonObj.get("commonEventOnViolations") != null && !jsonObj.get("commonEventOnViolations").isJsonNull()) && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commonEventOnViolations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commonEventOnViolations").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Group.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Group' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Group.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Group value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Group read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Group given an JSON string - * - * @param jsonString JSON string - * @return An instance of Group - * @throws IOException if the JSON string is invalid with respect to Group - */ - public static Group fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Group.class); - } - - /** - * Convert an instance of Group to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of Group given an JSON string + * + * @param jsonString JSON string + * @return An instance of Group + * @throws IOException if the JSON string is invalid with respect to Group + */ + public static Group fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Group.class); + } + + /** + * Convert an instance of Group to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java index 41637191..0cd0ac6e 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,308 +10,328 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** GroupSourceSettingsV1 */ +public class GroupSourceSettingsV1 { + public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; -/** - * GroupSourceSettingsV1 - */ + @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) + private Boolean allowUnplannedTraits; -public class GroupSourceSettingsV1 { - public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) - private Boolean allowUnplannedTraits; - - public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = "allowTraitsOnViolations"; - @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) - private Boolean allowTraitsOnViolations; - - /** - * The common group event on violations. Config API note: equal to `commonGroupEventOnViolations`. - */ - @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) - public enum CommonEventOnViolationsEnum { - ALLOW("ALLOW"), - - BLOCK("BLOCK"), - - OMIT_TRAITS("OMIT_TRAITS"); - - private String value; - - CommonEventOnViolationsEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = + "allowTraitsOnViolations"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) + private Boolean allowTraitsOnViolations; - @Override - public String toString() { - return String.valueOf(value); - } + /** + * The common group event on violations. Config API note: equal to + * `commonGroupEventOnViolations`. + */ + @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) + public enum CommonEventOnViolationsEnum { + ALLOW("ALLOW"), - public static CommonEventOnViolationsEnum fromValue(String value) { - for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + BLOCK("BLOCK"), - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CommonEventOnViolationsEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CommonEventOnViolationsEnum.fromValue(value); - } - } - } + OMIT_TRAITS("OMIT_TRAITS"); + + private String value; + + CommonEventOnViolationsEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = "commonEventOnViolations"; - @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) - private CommonEventOnViolationsEnum commonEventOnViolations; + public String getValue() { + return value; + } - public GroupSourceSettingsV1() { - } + @Override + public String toString() { + return String.valueOf(value); + } - public GroupSourceSettingsV1 allowUnplannedTraits(Boolean allowUnplannedTraits) { - - this.allowUnplannedTraits = allowUnplannedTraits; - return this; - } + public static CommonEventOnViolationsEnum fromValue(String value) { + for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * Enable to allow unplanned group traits. Config API note: equal to `allowUnplannedGroupTraits`. - * @return allowUnplannedTraits - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow unplanned group traits. Config API note: equal to `allowUnplannedGroupTraits`.") + public static class Adapter extends TypeAdapter { + @Override + public void write( + final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CommonEventOnViolationsEnum read(final JsonReader jsonReader) + throws IOException { + String value = jsonReader.nextString(); + return CommonEventOnViolationsEnum.fromValue(value); + } + } + } - public Boolean getAllowUnplannedTraits() { - return allowUnplannedTraits; - } + public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = + "commonEventOnViolations"; + @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) + private CommonEventOnViolationsEnum commonEventOnViolations; - public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { - this.allowUnplannedTraits = allowUnplannedTraits; - } + public GroupSourceSettingsV1() {} + public GroupSourceSettingsV1 allowUnplannedTraits(Boolean allowUnplannedTraits) { - public GroupSourceSettingsV1 allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - - this.allowTraitsOnViolations = allowTraitsOnViolations; - return this; - } + this.allowUnplannedTraits = allowUnplannedTraits; + return this; + } - /** - * Enable to allow group traits on violations. Config API note: equal to `allowGroupTraitsOnViolations`. - * @return allowTraitsOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow group traits on violations. Config API note: equal to `allowGroupTraitsOnViolations`.") + /** + * Enable to allow unplanned group traits. Config API note: equal to + * `allowUnplannedGroupTraits`. + * + * @return allowUnplannedTraits + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow unplanned group traits. Config API note: equal to" + + " `allowUnplannedGroupTraits`.") + public Boolean getAllowUnplannedTraits() { + return allowUnplannedTraits; + } - public Boolean getAllowTraitsOnViolations() { - return allowTraitsOnViolations; - } + public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { + this.allowUnplannedTraits = allowUnplannedTraits; + } + public GroupSourceSettingsV1 allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { - this.allowTraitsOnViolations = allowTraitsOnViolations; - } + this.allowTraitsOnViolations = allowTraitsOnViolations; + return this; + } + /** + * Enable to allow group traits on violations. Config API note: equal to + * `allowGroupTraitsOnViolations`. + * + * @return allowTraitsOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow group traits on violations. Config API note: equal to" + + " `allowGroupTraitsOnViolations`.") + public Boolean getAllowTraitsOnViolations() { + return allowTraitsOnViolations; + } - public GroupSourceSettingsV1 commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - - this.commonEventOnViolations = commonEventOnViolations; - return this; - } + public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { + this.allowTraitsOnViolations = allowTraitsOnViolations; + } - /** - * The common group event on violations. Config API note: equal to `commonGroupEventOnViolations`. - * @return commonEventOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The common group event on violations. Config API note: equal to `commonGroupEventOnViolations`.") + public GroupSourceSettingsV1 commonEventOnViolations( + CommonEventOnViolationsEnum commonEventOnViolations) { - public CommonEventOnViolationsEnum getCommonEventOnViolations() { - return commonEventOnViolations; - } + this.commonEventOnViolations = commonEventOnViolations; + return this; + } + /** + * The common group event on violations. Config API note: equal to + * `commonGroupEventOnViolations`. + * + * @return commonEventOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The common group event on violations. Config API note: equal to" + + " `commonGroupEventOnViolations`.") + public CommonEventOnViolationsEnum getCommonEventOnViolations() { + return commonEventOnViolations; + } - public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - this.commonEventOnViolations = commonEventOnViolations; - } + public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { + this.commonEventOnViolations = commonEventOnViolations; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupSourceSettingsV1 groupSourceSettingsV1 = (GroupSourceSettingsV1) o; + return Objects.equals(this.allowUnplannedTraits, groupSourceSettingsV1.allowUnplannedTraits) + && Objects.equals( + this.allowTraitsOnViolations, groupSourceSettingsV1.allowTraitsOnViolations) + && Objects.equals( + this.commonEventOnViolations, + groupSourceSettingsV1.commonEventOnViolations); + } + @Override + public int hashCode() { + return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupSourceSettingsV1 {\n"); + sb.append(" allowUnplannedTraits: ") + .append(toIndentedString(allowUnplannedTraits)) + .append("\n"); + sb.append(" allowTraitsOnViolations: ") + .append(toIndentedString(allowTraitsOnViolations)) + .append("\n"); + sb.append(" commonEventOnViolations: ") + .append(toIndentedString(commonEventOnViolations)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - GroupSourceSettingsV1 groupSourceSettingsV1 = (GroupSourceSettingsV1) o; - return Objects.equals(this.allowUnplannedTraits, groupSourceSettingsV1.allowUnplannedTraits) && - Objects.equals(this.allowTraitsOnViolations, groupSourceSettingsV1.allowTraitsOnViolations) && - Objects.equals(this.commonEventOnViolations, groupSourceSettingsV1.commonEventOnViolations); - } - - @Override - public int hashCode() { - return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GroupSourceSettingsV1 {\n"); - sb.append(" allowUnplannedTraits: ").append(toIndentedString(allowUnplannedTraits)).append("\n"); - sb.append(" allowTraitsOnViolations: ").append(toIndentedString(allowTraitsOnViolations)).append("\n"); - sb.append(" commonEventOnViolations: ").append(toIndentedString(commonEventOnViolations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("allowUnplannedTraits"); + openapiFields.add("allowTraitsOnViolations"); + openapiFields.add("commonEventOnViolations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowUnplannedTraits"); - openapiFields.add("allowTraitsOnViolations"); - openapiFields.add("commonEventOnViolations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupSourceSettingsV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GroupSourceSettingsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in GroupSourceSettingsV1 is not found in the empty JSON string", GroupSourceSettingsV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupSourceSettingsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GroupSourceSettingsV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GroupSourceSettingsV1 is not found in" + + " the empty JSON string", + GroupSourceSettingsV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GroupSourceSettingsV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GroupSourceSettingsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GroupSourceSettingsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GroupSourceSettingsV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("commonEventOnViolations") != null + && !jsonObj.get("commonEventOnViolations").isJsonNull()) + && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commonEventOnViolations` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("commonEventOnViolations").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupSourceSettingsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupSourceSettingsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GroupSourceSettingsV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupSourceSettingsV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GroupSourceSettingsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if ((jsonObj.get("commonEventOnViolations") != null && !jsonObj.get("commonEventOnViolations").isJsonNull()) && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commonEventOnViolations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commonEventOnViolations").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GroupSourceSettingsV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GroupSourceSettingsV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GroupSourceSettingsV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GroupSourceSettingsV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GroupSourceSettingsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of GroupSourceSettingsV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupSourceSettingsV1 - * @throws IOException if the JSON string is invalid with respect to GroupSourceSettingsV1 - */ - public static GroupSourceSettingsV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GroupSourceSettingsV1.class); - } - - /** - * Convert an instance of GroupSourceSettingsV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of GroupSourceSettingsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupSourceSettingsV1 + * @throws IOException if the JSON string is invalid with respect to GroupSourceSettingsV1 + */ + public static GroupSourceSettingsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupSourceSettingsV1.class); + } + + /** + * Convert an instance of GroupSourceSettingsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Identify.java b/src/main/java/com/segment/publicapi/models/Identify.java index 99e29546..82f093f7 100644 --- a/src/main/java/com/segment/publicapi/models/Identify.java +++ b/src/main/java/com/segment/publicapi/models/Identify.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,309 +10,325 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Identify settings. - */ +/** Identify settings. */ @ApiModel(description = "Identify settings.") - public class Identify { - public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) - private Boolean allowUnplannedTraits; - - public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = "allowTraitsOnViolations"; - @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) - private Boolean allowTraitsOnViolations; - - /** - * The common identify event on violations. Config API note: equal to `commonIdentifyEventOnViolations`. - */ - @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) - public enum CommonEventOnViolationsEnum { - ALLOW("ALLOW"), - - BLOCK("BLOCK"), - - OMIT_TRAITS("OMIT_TRAITS"); - - private String value; - - CommonEventOnViolationsEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) + private Boolean allowUnplannedTraits; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = + "allowTraitsOnViolations"; - public static CommonEventOnViolationsEnum fromValue(String value) { - for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) + private Boolean allowTraitsOnViolations; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CommonEventOnViolationsEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CommonEventOnViolationsEnum.fromValue(value); - } - } - } + /** + * The common identify event on violations. Config API note: equal to + * `commonIdentifyEventOnViolations`. + */ + @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) + public enum CommonEventOnViolationsEnum { + ALLOW("ALLOW"), + + BLOCK("BLOCK"), - public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = "commonEventOnViolations"; - @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) - private CommonEventOnViolationsEnum commonEventOnViolations; + OMIT_TRAITS("OMIT_TRAITS"); - public Identify() { - } + private String value; + + CommonEventOnViolationsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } - public Identify allowUnplannedTraits(Boolean allowUnplannedTraits) { - - this.allowUnplannedTraits = allowUnplannedTraits; - return this; - } + public static CommonEventOnViolationsEnum fromValue(String value) { + for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * Enable to allow unplanned identify traits. Config API note: equal to `allowUnplannedIdentifyTraits`. - * @return allowUnplannedTraits - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow unplanned identify traits. Config API note: equal to `allowUnplannedIdentifyTraits`.") + public static class Adapter extends TypeAdapter { + @Override + public void write( + final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CommonEventOnViolationsEnum read(final JsonReader jsonReader) + throws IOException { + String value = jsonReader.nextString(); + return CommonEventOnViolationsEnum.fromValue(value); + } + } + } - public Boolean getAllowUnplannedTraits() { - return allowUnplannedTraits; - } + public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = + "commonEventOnViolations"; + @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) + private CommonEventOnViolationsEnum commonEventOnViolations; - public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { - this.allowUnplannedTraits = allowUnplannedTraits; - } + public Identify() {} + public Identify allowUnplannedTraits(Boolean allowUnplannedTraits) { - public Identify allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - - this.allowTraitsOnViolations = allowTraitsOnViolations; - return this; - } + this.allowUnplannedTraits = allowUnplannedTraits; + return this; + } - /** - * Enable to allow identify traits on violations. Config API note: equal to `allowIdentifyTraitsOnViolations`. - * @return allowTraitsOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow identify traits on violations. Config API note: equal to `allowIdentifyTraitsOnViolations`.") + /** + * Enable to allow unplanned identify traits. Config API note: equal to + * `allowUnplannedIdentifyTraits`. + * + * @return allowUnplannedTraits + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow unplanned identify traits. Config API note: equal to" + + " `allowUnplannedIdentifyTraits`.") + public Boolean getAllowUnplannedTraits() { + return allowUnplannedTraits; + } - public Boolean getAllowTraitsOnViolations() { - return allowTraitsOnViolations; - } + public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { + this.allowUnplannedTraits = allowUnplannedTraits; + } + public Identify allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { - this.allowTraitsOnViolations = allowTraitsOnViolations; - } + this.allowTraitsOnViolations = allowTraitsOnViolations; + return this; + } + /** + * Enable to allow identify traits on violations. Config API note: equal to + * `allowIdentifyTraitsOnViolations`. + * + * @return allowTraitsOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow identify traits on violations. Config API note: equal to" + + " `allowIdentifyTraitsOnViolations`.") + public Boolean getAllowTraitsOnViolations() { + return allowTraitsOnViolations; + } - public Identify commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - - this.commonEventOnViolations = commonEventOnViolations; - return this; - } + public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { + this.allowTraitsOnViolations = allowTraitsOnViolations; + } - /** - * The common identify event on violations. Config API note: equal to `commonIdentifyEventOnViolations`. - * @return commonEventOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The common identify event on violations. Config API note: equal to `commonIdentifyEventOnViolations`.") + public Identify commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - public CommonEventOnViolationsEnum getCommonEventOnViolations() { - return commonEventOnViolations; - } + this.commonEventOnViolations = commonEventOnViolations; + return this; + } + /** + * The common identify event on violations. Config API note: equal to + * `commonIdentifyEventOnViolations`. + * + * @return commonEventOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The common identify event on violations. Config API note: equal to" + + " `commonIdentifyEventOnViolations`.") + public CommonEventOnViolationsEnum getCommonEventOnViolations() { + return commonEventOnViolations; + } - public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - this.commonEventOnViolations = commonEventOnViolations; - } + public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { + this.commonEventOnViolations = commonEventOnViolations; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Identify identify = (Identify) o; + return Objects.equals(this.allowUnplannedTraits, identify.allowUnplannedTraits) + && Objects.equals(this.allowTraitsOnViolations, identify.allowTraitsOnViolations) + && Objects.equals(this.commonEventOnViolations, identify.commonEventOnViolations); + } + @Override + public int hashCode() { + return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Identify {\n"); + sb.append(" allowUnplannedTraits: ") + .append(toIndentedString(allowUnplannedTraits)) + .append("\n"); + sb.append(" allowTraitsOnViolations: ") + .append(toIndentedString(allowTraitsOnViolations)) + .append("\n"); + sb.append(" commonEventOnViolations: ") + .append(toIndentedString(commonEventOnViolations)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Identify identify = (Identify) o; - return Objects.equals(this.allowUnplannedTraits, identify.allowUnplannedTraits) && - Objects.equals(this.allowTraitsOnViolations, identify.allowTraitsOnViolations) && - Objects.equals(this.commonEventOnViolations, identify.commonEventOnViolations); - } - - @Override - public int hashCode() { - return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Identify {\n"); - sb.append(" allowUnplannedTraits: ").append(toIndentedString(allowUnplannedTraits)).append("\n"); - sb.append(" allowTraitsOnViolations: ").append(toIndentedString(allowTraitsOnViolations)).append("\n"); - sb.append(" commonEventOnViolations: ").append(toIndentedString(commonEventOnViolations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("allowUnplannedTraits"); + openapiFields.add("allowTraitsOnViolations"); + openapiFields.add("commonEventOnViolations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowUnplannedTraits"); - openapiFields.add("allowTraitsOnViolations"); - openapiFields.add("commonEventOnViolations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Identify - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Identify.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Identify is not found in the empty JSON string", Identify.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Identify + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Identify.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Identify is not found in the empty" + + " JSON string", + Identify.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Identify.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Identify` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Identify.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Identify`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("commonEventOnViolations") != null + && !jsonObj.get("commonEventOnViolations").isJsonNull()) + && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commonEventOnViolations` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("commonEventOnViolations").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Identify.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Identify' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Identify.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Identify value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Identify read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if ((jsonObj.get("commonEventOnViolations") != null && !jsonObj.get("commonEventOnViolations").isJsonNull()) && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commonEventOnViolations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commonEventOnViolations").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Identify.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Identify' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Identify.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Identify value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Identify read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Identify given an JSON string - * - * @param jsonString JSON string - * @return An instance of Identify - * @throws IOException if the JSON string is invalid with respect to Identify - */ - public static Identify fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Identify.class); - } - - /** - * Convert an instance of Identify to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of Identify given an JSON string + * + * @param jsonString JSON string + * @return An instance of Identify + * @throws IOException if the JSON string is invalid with respect to Identify + */ + public static Identify fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Identify.class); + } + + /** + * Convert an instance of Identify to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java index f1db10da..c2b665f3 100644 --- a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,308 +10,331 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; +/** IdentifySourceSettingsV1 */ +public class IdentifySourceSettingsV1 { + public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; -/** - * IdentifySourceSettingsV1 - */ + @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) + private Boolean allowUnplannedTraits; -public class IdentifySourceSettingsV1 { - public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) - private Boolean allowUnplannedTraits; - - public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = "allowTraitsOnViolations"; - @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) - private Boolean allowTraitsOnViolations; - - /** - * The common identify event on violations. Config API note: equal to `commonIdentifyEventOnViolations`. - */ - @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) - public enum CommonEventOnViolationsEnum { - ALLOW("ALLOW"), - - BLOCK("BLOCK"), - - OMIT_TRAITS("OMIT_TRAITS"); - - private String value; - - CommonEventOnViolationsEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = + "allowTraitsOnViolations"; - public String getValue() { - return value; - } + @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) + private Boolean allowTraitsOnViolations; - @Override - public String toString() { - return String.valueOf(value); - } + /** + * The common identify event on violations. Config API note: equal to + * `commonIdentifyEventOnViolations`. + */ + @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) + public enum CommonEventOnViolationsEnum { + ALLOW("ALLOW"), - public static CommonEventOnViolationsEnum fromValue(String value) { - for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + BLOCK("BLOCK"), - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CommonEventOnViolationsEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CommonEventOnViolationsEnum.fromValue(value); - } - } - } + OMIT_TRAITS("OMIT_TRAITS"); + + private String value; + + CommonEventOnViolationsEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = "commonEventOnViolations"; - @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) - private CommonEventOnViolationsEnum commonEventOnViolations; + public String getValue() { + return value; + } - public IdentifySourceSettingsV1() { - } + @Override + public String toString() { + return String.valueOf(value); + } - public IdentifySourceSettingsV1 allowUnplannedTraits(Boolean allowUnplannedTraits) { - - this.allowUnplannedTraits = allowUnplannedTraits; - return this; - } + public static CommonEventOnViolationsEnum fromValue(String value) { + for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * Enable to allow unplanned identify traits. Config API note: equal to `allowUnplannedIdentifyTraits`. - * @return allowUnplannedTraits - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow unplanned identify traits. Config API note: equal to `allowUnplannedIdentifyTraits`.") + public static class Adapter extends TypeAdapter { + @Override + public void write( + final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CommonEventOnViolationsEnum read(final JsonReader jsonReader) + throws IOException { + String value = jsonReader.nextString(); + return CommonEventOnViolationsEnum.fromValue(value); + } + } + } - public Boolean getAllowUnplannedTraits() { - return allowUnplannedTraits; - } + public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = + "commonEventOnViolations"; + @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) + private CommonEventOnViolationsEnum commonEventOnViolations; - public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { - this.allowUnplannedTraits = allowUnplannedTraits; - } + public IdentifySourceSettingsV1() {} + public IdentifySourceSettingsV1 allowUnplannedTraits(Boolean allowUnplannedTraits) { - public IdentifySourceSettingsV1 allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - - this.allowTraitsOnViolations = allowTraitsOnViolations; - return this; - } + this.allowUnplannedTraits = allowUnplannedTraits; + return this; + } - /** - * Enable to allow identify traits on violations. Config API note: equal to `allowIdentifyTraitsOnViolations`. - * @return allowTraitsOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow identify traits on violations. Config API note: equal to `allowIdentifyTraitsOnViolations`.") + /** + * Enable to allow unplanned identify traits. Config API note: equal to + * `allowUnplannedIdentifyTraits`. + * + * @return allowUnplannedTraits + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow unplanned identify traits. Config API note: equal to" + + " `allowUnplannedIdentifyTraits`.") + public Boolean getAllowUnplannedTraits() { + return allowUnplannedTraits; + } - public Boolean getAllowTraitsOnViolations() { - return allowTraitsOnViolations; - } + public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { + this.allowUnplannedTraits = allowUnplannedTraits; + } + public IdentifySourceSettingsV1 allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { - this.allowTraitsOnViolations = allowTraitsOnViolations; - } + this.allowTraitsOnViolations = allowTraitsOnViolations; + return this; + } + /** + * Enable to allow identify traits on violations. Config API note: equal to + * `allowIdentifyTraitsOnViolations`. + * + * @return allowTraitsOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Enable to allow identify traits on violations. Config API note: equal to" + + " `allowIdentifyTraitsOnViolations`.") + public Boolean getAllowTraitsOnViolations() { + return allowTraitsOnViolations; + } - public IdentifySourceSettingsV1 commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - - this.commonEventOnViolations = commonEventOnViolations; - return this; - } + public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { + this.allowTraitsOnViolations = allowTraitsOnViolations; + } - /** - * The common identify event on violations. Config API note: equal to `commonIdentifyEventOnViolations`. - * @return commonEventOnViolations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The common identify event on violations. Config API note: equal to `commonIdentifyEventOnViolations`.") + public IdentifySourceSettingsV1 commonEventOnViolations( + CommonEventOnViolationsEnum commonEventOnViolations) { - public CommonEventOnViolationsEnum getCommonEventOnViolations() { - return commonEventOnViolations; - } + this.commonEventOnViolations = commonEventOnViolations; + return this; + } + /** + * The common identify event on violations. Config API note: equal to + * `commonIdentifyEventOnViolations`. + * + * @return commonEventOnViolations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The common identify event on violations. Config API note: equal to" + + " `commonIdentifyEventOnViolations`.") + public CommonEventOnViolationsEnum getCommonEventOnViolations() { + return commonEventOnViolations; + } - public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - this.commonEventOnViolations = commonEventOnViolations; - } + public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { + this.commonEventOnViolations = commonEventOnViolations; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentifySourceSettingsV1 identifySourceSettingsV1 = (IdentifySourceSettingsV1) o; + return Objects.equals( + this.allowUnplannedTraits, identifySourceSettingsV1.allowUnplannedTraits) + && Objects.equals( + this.allowTraitsOnViolations, + identifySourceSettingsV1.allowTraitsOnViolations) + && Objects.equals( + this.commonEventOnViolations, + identifySourceSettingsV1.commonEventOnViolations); + } + @Override + public int hashCode() { + return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentifySourceSettingsV1 {\n"); + sb.append(" allowUnplannedTraits: ") + .append(toIndentedString(allowUnplannedTraits)) + .append("\n"); + sb.append(" allowTraitsOnViolations: ") + .append(toIndentedString(allowTraitsOnViolations)) + .append("\n"); + sb.append(" commonEventOnViolations: ") + .append(toIndentedString(commonEventOnViolations)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - IdentifySourceSettingsV1 identifySourceSettingsV1 = (IdentifySourceSettingsV1) o; - return Objects.equals(this.allowUnplannedTraits, identifySourceSettingsV1.allowUnplannedTraits) && - Objects.equals(this.allowTraitsOnViolations, identifySourceSettingsV1.allowTraitsOnViolations) && - Objects.equals(this.commonEventOnViolations, identifySourceSettingsV1.commonEventOnViolations); - } - - @Override - public int hashCode() { - return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IdentifySourceSettingsV1 {\n"); - sb.append(" allowUnplannedTraits: ").append(toIndentedString(allowUnplannedTraits)).append("\n"); - sb.append(" allowTraitsOnViolations: ").append(toIndentedString(allowTraitsOnViolations)).append("\n"); - sb.append(" commonEventOnViolations: ").append(toIndentedString(commonEventOnViolations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("allowUnplannedTraits"); + openapiFields.add("allowTraitsOnViolations"); + openapiFields.add("commonEventOnViolations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowUnplannedTraits"); - openapiFields.add("allowTraitsOnViolations"); - openapiFields.add("commonEventOnViolations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to IdentifySourceSettingsV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!IdentifySourceSettingsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IdentifySourceSettingsV1 is not found in the empty JSON string", IdentifySourceSettingsV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IdentifySourceSettingsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IdentifySourceSettingsV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IdentifySourceSettingsV1 is not found" + + " in the empty JSON string", + IdentifySourceSettingsV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!IdentifySourceSettingsV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdentifySourceSettingsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IdentifySourceSettingsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IdentifySourceSettingsV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("commonEventOnViolations") != null + && !jsonObj.get("commonEventOnViolations").isJsonNull()) + && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `commonEventOnViolations` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("commonEventOnViolations").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IdentifySourceSettingsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentifySourceSettingsV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IdentifySourceSettingsV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IdentifySourceSettingsV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IdentifySourceSettingsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if ((jsonObj.get("commonEventOnViolations") != null && !jsonObj.get("commonEventOnViolations").isJsonNull()) && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `commonEventOnViolations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commonEventOnViolations").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IdentifySourceSettingsV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IdentifySourceSettingsV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IdentifySourceSettingsV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IdentifySourceSettingsV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IdentifySourceSettingsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of IdentifySourceSettingsV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of IdentifySourceSettingsV1 - * @throws IOException if the JSON string is invalid with respect to IdentifySourceSettingsV1 - */ - public static IdentifySourceSettingsV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IdentifySourceSettingsV1.class); - } - - /** - * Convert an instance of IdentifySourceSettingsV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of IdentifySourceSettingsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentifySourceSettingsV1 + * @throws IOException if the JSON string is invalid with respect to IdentifySourceSettingsV1 + */ + public static IdentifySourceSettingsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentifySourceSettingsV1.class); + } + + /** + * Convert an instance of IdentifySourceSettingsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Input.java b/src/main/java/com/segment/publicapi/models/Input.java index 2d4678a6..76b971c9 100644 --- a/src/main/java/com/segment/publicapi/models/Input.java +++ b/src/main/java/com/segment/publicapi/models/Input.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,294 +10,306 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; -import com.segment.publicapi.JSON; - -/** - * A set of valid Destination input params required for updating. - */ +/** A set of valid Destination input params required for updating. */ @ApiModel(description = "A set of valid Destination input params required for updating.") - public class Input { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - @SerializedName(SERIALIZED_NAME_TRIGGER) - private String trigger; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - public Input() { - } + @SerializedName(SERIALIZED_NAME_TRIGGER) + private String trigger; - public Input name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_ENABLED = "enabled"; - /** - * The user-defined name for the subscription. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The user-defined name for the subscription.") + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; - public void setName(String name) { - this.name = name; - } + public Input() {} + public Input name(String name) { - public Input trigger(String trigger) { - - this.trigger = trigger; - return this; - } + this.name = name; + return this; + } - /** - * The fql statement. - * @return trigger - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fql statement.") + /** + * The user-defined name for the subscription. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The user-defined name for the subscription.") + public String getName() { + return name; + } - public String getTrigger() { - return trigger; - } + public void setName(String name) { + this.name = name; + } + public Input trigger(String trigger) { - public void setTrigger(String trigger) { - this.trigger = trigger; - } + this.trigger = trigger; + return this; + } + /** + * The fql statement. + * + * @return trigger + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The fql statement.") + public String getTrigger() { + return trigger; + } - public Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } + public void setTrigger(String trigger) { + this.trigger = trigger; + } - /** - * Is the subscription enabled. - * @return enabled - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Is the subscription enabled.") + public Input enabled(Boolean enabled) { - public Boolean getEnabled() { - return enabled; - } + this.enabled = enabled; + return this; + } + /** + * Is the subscription enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Is the subscription enabled.") + public Boolean getEnabled() { + return enabled; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public Input settings(Map settings) { - public Input settings(Map settings) { - - this.settings = settings; - return this; - } + this.settings = settings; + return this; + } - /** - * The fields used for configuring this action. - * @return settings - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fields used for configuring this action.") + /** + * The fields used for configuring this action. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The fields used for configuring this action.") + public Map getSettings() { + return settings; + } - public Map getSettings() { - return settings; - } + public void setSettings(Map settings) { + this.settings = settings; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Input input = (Input) o; + return Objects.equals(this.name, input.name) + && Objects.equals(this.trigger, input.trigger) + && Objects.equals(this.enabled, input.enabled) + && Objects.equals(this.settings, input.settings); + } - public void setSettings(Map settings) { - this.settings = settings; - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash(name, trigger, enabled, settings); + } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Input input = (Input) o; - return Objects.equals(this.name, input.name) && - Objects.equals(this.trigger, input.trigger) && - Objects.equals(this.enabled, input.enabled) && - Objects.equals(this.settings, input.settings); - } - - @Override - public int hashCode() { - return Objects.hash(name, trigger, enabled, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("trigger"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("trigger"); - openapiFields.add("enabled"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Input.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Input is not found in the empty JSON string", Input.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Input is not found in the empty JSON" + + " string", + Input.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Input` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Input`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("trigger") != null && !jsonObj.get("trigger").isJsonNull()) + && !jsonObj.get("trigger").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trigger` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("trigger").toString())); } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("trigger") != null && !jsonObj.get("trigger").isJsonNull()) && !jsonObj.get("trigger").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `trigger` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trigger").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Input.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of Input - * @throws IOException if the JSON string is invalid with respect to Input - */ - public static Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Input.class); - } - - /** - * Convert an instance of Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Input' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Input value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of Input + * @throws IOException if the JSON string is invalid with respect to Input + */ + public static Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Input.class); + } + + /** + * Convert an instance of Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java index 48500e04..9ff65ea1 100644 --- a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java +++ b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,381 +10,409 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.openapitools.jackson.nullable.JsonNullable; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; - -import com.segment.publicapi.JSON; +import org.openapitools.jackson.nullable.JsonNullable; /** - * Describes an Integration option field required to set up a Segment Integration such as Sources, Destinations, or warehouses. + * Describes an Integration option field required to set up a Segment Integration such as Sources, + * Destinations, or warehouses. */ -@ApiModel(description = "Describes an Integration option field required to set up a Segment Integration such as Sources, Destinations, or warehouses.") - +@ApiModel( + description = + "Describes an Integration option field required to set up a Segment Integration" + + " such as Sources, Destinations, or warehouses.") public class IntegrationOptionBeta { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_REQUIRED = "required"; - @SerializedName(SERIALIZED_NAME_REQUIRED) - private Boolean required; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + public static final String SERIALIZED_NAME_NAME = "name"; - public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; - @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) - private Object defaultValue = null; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private String label; + public static final String SERIALIZED_NAME_TYPE = "type"; - public IntegrationOptionBeta() { - } + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; - public IntegrationOptionBeta name(String name) { - - this.name = name; - return this; - } + public static final String SERIALIZED_NAME_REQUIRED = "required"; - /** - * The name identifying this option in the context of a Segment Integration. - * @return name - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name identifying this option in the context of a Segment Integration.") + @SerializedName(SERIALIZED_NAME_REQUIRED) + private Boolean required; - public String getName() { - return name; - } + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - public void setName(String name) { - this.name = name; - } + public static final String SERIALIZED_NAME_DEFAULT_VALUE = "defaultValue"; + @SerializedName(SERIALIZED_NAME_DEFAULT_VALUE) + private Object defaultValue = null; - public IntegrationOptionBeta type(String type) { - - this.type = type; - return this; - } + public static final String SERIALIZED_NAME_LABEL = "label"; - /** - * Defines the type for this option in the schema. Types are most commonly strings, but may also represent other primitive types, such as booleans, and numbers, as well as complex types, such as objects and arrays. - * @return type - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Defines the type for this option in the schema. Types are most commonly strings, but may also represent other primitive types, such as booleans, and numbers, as well as complex types, such as objects and arrays.") + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; - public String getType() { - return type; - } + public IntegrationOptionBeta() {} + public IntegrationOptionBeta name(String name) { - public void setType(String type) { - this.type = type; - } - + this.name = name; + return this; + } - public IntegrationOptionBeta required(Boolean required) { - - this.required = required; - return this; - } + /** + * The name identifying this option in the context of a Segment Integration. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The name identifying this option in the context of a Segment Integration.") + public String getName() { + return name; + } - /** - * Whether this is a required option when setting up the Integration. - * @return required - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this is a required option when setting up the Integration.") + public void setName(String name) { + this.name = name; + } - public Boolean getRequired() { - return required; - } + public IntegrationOptionBeta type(String type) { + this.type = type; + return this; + } - public void setRequired(Boolean required) { - this.required = required; - } + /** + * Defines the type for this option in the schema. Types are most commonly strings, but may also + * represent other primitive types, such as booleans, and numbers, as well as complex types, + * such as objects and arrays. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Defines the type for this option in the schema. Types are most commonly" + + " strings, but may also represent other primitive types, such as" + + " booleans, and numbers, as well as complex types, such as objects and" + + " arrays.") + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } - public IntegrationOptionBeta description(String description) { - - this.description = description; - return this; - } + public IntegrationOptionBeta required(Boolean required) { - /** - * An optional short text description of the field. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional short text description of the field.") + this.required = required; + return this; + } - public String getDescription() { - return description; - } + /** + * Whether this is a required option when setting up the Integration. + * + * @return required + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Whether this is a required option when setting up the Integration.") + public Boolean getRequired() { + return required; + } + public void setRequired(Boolean required) { + this.required = required; + } - public void setDescription(String description) { - this.description = description; - } + public IntegrationOptionBeta description(String description) { + this.description = description; + return this; + } - public IntegrationOptionBeta defaultValue(Object defaultValue) { - - this.defaultValue = defaultValue; - return this; - } + /** + * An optional short text description of the field. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional short text description of the field.") + public String getDescription() { + return description; + } - /** - * An optional default value for the field. - * @return defaultValue - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional default value for the field.") + public void setDescription(String description) { + this.description = description; + } - public Object getDefaultValue() { - return defaultValue; - } + public IntegrationOptionBeta defaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + return this; + } - public void setDefaultValue(Object defaultValue) { - this.defaultValue = defaultValue; - } + /** + * An optional default value for the field. + * + * @return defaultValue + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional default value for the field.") + public Object getDefaultValue() { + return defaultValue; + } + public void setDefaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + } - public IntegrationOptionBeta label(String label) { - - this.label = label; - return this; - } + public IntegrationOptionBeta label(String label) { - /** - * An optional label for this field. - * @return label - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional label for this field.") + this.label = label; + return this; + } - public String getLabel() { - return label; - } + /** + * An optional label for this field. + * + * @return label + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional label for this field.") + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } - public void setLabel(String label) { - this.label = label; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IntegrationOptionBeta integrationOptionBeta = (IntegrationOptionBeta) o; + return Objects.equals(this.name, integrationOptionBeta.name) + && Objects.equals(this.type, integrationOptionBeta.type) + && Objects.equals(this.required, integrationOptionBeta.required) + && Objects.equals(this.description, integrationOptionBeta.description) + && Objects.equals(this.defaultValue, integrationOptionBeta.defaultValue) + && Objects.equals(this.label, integrationOptionBeta.label); + } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override + public int hashCode() { + return Objects.hash(name, type, required, description, defaultValue, label); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - if (o == null || getClass() != o.getClass()) { - return false; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IntegrationOptionBeta {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append("}"); + return sb.toString(); } - IntegrationOptionBeta integrationOptionBeta = (IntegrationOptionBeta) o; - return Objects.equals(this.name, integrationOptionBeta.name) && - Objects.equals(this.type, integrationOptionBeta.type) && - Objects.equals(this.required, integrationOptionBeta.required) && - Objects.equals(this.description, integrationOptionBeta.description) && - Objects.equals(this.defaultValue, integrationOptionBeta.defaultValue) && - Objects.equals(this.label, integrationOptionBeta.label); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, type, required, description, defaultValue, label); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IntegrationOptionBeta {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("type"); + openapiFields.add("required"); + openapiFields.add("description"); + openapiFields.add("defaultValue"); + openapiFields.add("label"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("required"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("type"); - openapiFields.add("required"); - openapiFields.add("description"); - openapiFields.add("defaultValue"); - openapiFields.add("label"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("required"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to IntegrationOptionBeta - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!IntegrationOptionBeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IntegrationOptionBeta is not found in the empty JSON string", IntegrationOptionBeta.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IntegrationOptionBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IntegrationOptionBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in IntegrationOptionBeta is not found in" + + " the empty JSON string", + IntegrationOptionBeta.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!IntegrationOptionBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IntegrationOptionBeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IntegrationOptionBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `IntegrationOptionBeta` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IntegrationOptionBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IntegrationOptionBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("label") != null && !jsonObj.get("label").isJsonNull()) + && !jsonObj.get("label").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `label` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("label").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IntegrationOptionBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IntegrationOptionBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(IntegrationOptionBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, IntegrationOptionBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IntegrationOptionBeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - if ((jsonObj.get("label") != null && !jsonObj.get("label").isJsonNull()) && !jsonObj.get("label").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("label").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IntegrationOptionBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IntegrationOptionBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IntegrationOptionBeta.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IntegrationOptionBeta value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IntegrationOptionBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); } - } - - /** - * Create an instance of IntegrationOptionBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of IntegrationOptionBeta - * @throws IOException if the JSON string is invalid with respect to IntegrationOptionBeta - */ - public static IntegrationOptionBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IntegrationOptionBeta.class); - } - - /** - * Convert an instance of IntegrationOptionBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Create an instance of IntegrationOptionBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of IntegrationOptionBeta + * @throws IOException if the JSON string is invalid with respect to IntegrationOptionBeta + */ + public static IntegrationOptionBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IntegrationOptionBeta.class); + } + + /** + * Convert an instance of IntegrationOptionBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java index 20598e16..c6dfa004 100644 --- a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,306 +10,306 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.AllowedLabelBeta; -import com.segment.publicapi.models.ResourceV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Defines a permission to apply to the user in an invite. - */ +/** Defines a permission to apply to the user in an invite. */ @ApiModel(description = "Defines a permission to apply to the user in an invite.") - public class InvitePermissionV1 { - public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; - @SerializedName(SERIALIZED_NAME_ROLE_ID) - private String roleId; - - public static final String SERIALIZED_NAME_RESOURCES = "resources"; - @SerializedName(SERIALIZED_NAME_RESOURCES) - private List resources = null; + public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = null; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + private String roleId; - public InvitePermissionV1() { - } + public static final String SERIALIZED_NAME_RESOURCES = "resources"; - public InvitePermissionV1 roleId(String roleId) { - - this.roleId = roleId; - return this; - } + @SerializedName(SERIALIZED_NAME_RESOURCES) + private List resources = null; - /** - * The id of the role. - * @return roleId - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the role.") + public static final String SERIALIZED_NAME_LABELS = "labels"; - public String getRoleId() { - return roleId; - } + @SerializedName(SERIALIZED_NAME_LABELS) + private List labels = null; + public InvitePermissionV1() {} - public void setRoleId(String roleId) { - this.roleId = roleId; - } + public InvitePermissionV1 roleId(String roleId) { + this.roleId = roleId; + return this; + } - public InvitePermissionV1 resources(List resources) { - - this.resources = resources; - return this; - } + /** + * The id of the role. + * + * @return roleId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the role.") + public String getRoleId() { + return roleId; + } - public InvitePermissionV1 addResourcesItem(ResourceV1 resourcesItem) { - if (this.resources == null) { - this.resources = new ArrayList<>(); + public void setRoleId(String roleId) { + this.roleId = roleId; } - this.resources.add(resourcesItem); - return this; - } - /** - * The resources to grant the invited users access to. - * @return resources - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The resources to grant the invited users access to.") + public InvitePermissionV1 resources(List resources) { - public List getResources() { - return resources; - } + this.resources = resources; + return this; + } + public InvitePermissionV1 addResourcesItem(ResourceV1 resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } + this.resources.add(resourcesItem); + return this; + } - public void setResources(List resources) { - this.resources = resources; - } + /** + * The resources to grant the invited users access to. + * + * @return resources + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The resources to grant the invited users access to.") + public List getResources() { + return resources; + } + public void setResources(List resources) { + this.resources = resources; + } - public InvitePermissionV1 labels(List labels) { - - this.labels = labels; - return this; - } + public InvitePermissionV1 labels(List labels) { - public InvitePermissionV1 addLabelsItem(AllowedLabelBeta labelsItem) { - if (this.labels == null) { - this.labels = new ArrayList<>(); + this.labels = labels; + return this; } - this.labels.add(labelsItem); - return this; - } - /** - * The labels that determine which resources to grant users access to. - * @return labels - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The labels that determine which resources to grant users access to.") - - public List getLabels() { - return labels; - } + public InvitePermissionV1 addLabelsItem(AllowedLabelBeta labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } + this.labels.add(labelsItem); + return this; + } + /** + * The labels that determine which resources to grant users access to. + * + * @return labels + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The labels that determine which resources to grant users access to.") + public List getLabels() { + return labels; + } - public void setLabels(List labels) { - this.labels = labels; - } + public void setLabels(List labels) { + this.labels = labels; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitePermissionV1 invitePermissionV1 = (InvitePermissionV1) o; + return Objects.equals(this.roleId, invitePermissionV1.roleId) + && Objects.equals(this.resources, invitePermissionV1.resources) + && Objects.equals(this.labels, invitePermissionV1.labels); + } + @Override + public int hashCode() { + return Objects.hash(roleId, resources, labels); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitePermissionV1 {\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - InvitePermissionV1 invitePermissionV1 = (InvitePermissionV1) o; - return Objects.equals(this.roleId, invitePermissionV1.roleId) && - Objects.equals(this.resources, invitePermissionV1.resources) && - Objects.equals(this.labels, invitePermissionV1.labels); - } - - @Override - public int hashCode() { - return Objects.hash(roleId, resources, labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InvitePermissionV1 {\n"); - sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); - sb.append(" resources: ").append(toIndentedString(resources)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("roleId"); + openapiFields.add("resources"); + openapiFields.add("labels"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("roleId"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("roleId"); - openapiFields.add("resources"); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("roleId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitePermissionV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InvitePermissionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in InvitePermissionV1 is not found in the empty JSON string", InvitePermissionV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvitePermissionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvitePermissionV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InvitePermissionV1 is not found in the" + + " empty JSON string", + InvitePermissionV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InvitePermissionV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvitePermissionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvitePermissionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InvitePermissionV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InvitePermissionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvitePermissionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("roleId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `roleId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("roleId").toString())); + } + if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { + JsonArray jsonArrayresources = jsonObj.getAsJsonArray("resources"); + if (jsonArrayresources != null) { + // ensure the json data is an array + if (!jsonObj.get("resources").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resources` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("resources").toString())); + } + } } - } - if (!jsonObj.get("roleId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `roleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleId").toString())); - } - if (jsonObj.get("resources") != null && !jsonObj.get("resources").isJsonNull()) { - JsonArray jsonArrayresources = jsonObj.getAsJsonArray("resources"); - if (jsonArrayresources != null) { - // ensure the json data is an array - if (!jsonObj.get("resources").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `resources` to be an array in the JSON string but got `%s`", jsonObj.get("resources").toString())); - } + if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + if (jsonArraylabels != null) { + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("labels").toString())); + } + } } - } - if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - if (jsonArraylabels != null) { - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `labels` to be an array in the JSON string but got `%s`", jsonObj.get("labels").toString())); - } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvitePermissionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitePermissionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InvitePermissionV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InvitePermissionV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvitePermissionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); } - } - } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InvitePermissionV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvitePermissionV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InvitePermissionV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InvitePermissionV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InvitePermissionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + /** + * Create an instance of InvitePermissionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitePermissionV1 + * @throws IOException if the JSON string is invalid with respect to InvitePermissionV1 + */ + public static InvitePermissionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitePermissionV1.class); } - } - - /** - * Create an instance of InvitePermissionV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvitePermissionV1 - * @throws IOException if the JSON string is invalid with respect to InvitePermissionV1 - */ - public static InvitePermissionV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvitePermissionV1.class); - } - - /** - * Convert an instance of InvitePermissionV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of InvitePermissionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InviteV1.java b/src/main/java/com/segment/publicapi/models/InviteV1.java index cd2aacee..fd748d0e 100644 --- a/src/main/java/com/segment/publicapi/models/InviteV1.java +++ b/src/main/java/com/segment/publicapi/models/InviteV1.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,258 +10,257 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.models.InvitePermissionV1; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * Defines an invitation to join a Workspace. - */ +/** Defines an invitation to join a Workspace. */ @ApiModel(description = "Defines an invitation to join a Workspace.") - public class InviteV1 { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static final String SERIALIZED_NAME_EMAIL = "email"; - public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; - public InviteV1() { - } + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; - public InviteV1 email(String email) { - - this.email = email; - return this; - } + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private List permissions = null; - /** - * The invited user's email to attach the permissions to. - * @return email - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The invited user's email to attach the permissions to.") + public InviteV1() {} - public String getEmail() { - return email; - } + public InviteV1 email(String email) { + this.email = email; + return this; + } - public void setEmail(String email) { - this.email = email; - } + /** + * The invited user's email to attach the permissions to. + * + * @return email + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The invited user's email to attach the permissions to.") + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } - public InviteV1 permissions(List permissions) { - - this.permissions = permissions; - return this; - } + public InviteV1 permissions(List permissions) { - public InviteV1 addPermissionsItem(InvitePermissionV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); + this.permissions = permissions; + return this; } - this.permissions.add(permissionsItem); - return this; - } - /** - * The permissions to attach to the invited user. - * @return permissions - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to attach to the invited user.") - - public List getPermissions() { - return permissions; - } + public InviteV1 addPermissionsItem(InvitePermissionV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + /** + * The permissions to attach to the invited user. + * + * @return permissions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The permissions to attach to the invited user.") + public List getPermissions() { + return permissions; + } - public void setPermissions(List permissions) { - this.permissions = permissions; - } + public void setPermissions(List permissions) { + this.permissions = permissions; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InviteV1 inviteV1 = (InviteV1) o; + return Objects.equals(this.email, inviteV1.email) + && Objects.equals(this.permissions, inviteV1.permissions); + } + @Override + public int hashCode() { + return Objects.hash(email, permissions); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InviteV1 {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - InviteV1 inviteV1 = (InviteV1) o; - return Objects.equals(this.email, inviteV1.email) && - Objects.equals(this.permissions, inviteV1.permissions); - } - - @Override - public int hashCode() { - return Objects.hash(email, permissions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InviteV1 {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - openapiFields.add("permissions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("email"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InviteV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InviteV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in InviteV1 is not found in the empty JSON string", InviteV1.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InviteV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InviteV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InviteV1 is not found in the empty" + + " JSON string", + InviteV1.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InviteV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InviteV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InviteV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `InviteV1`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InviteV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InviteV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } } - } - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `permissions` to be an array in the JSON string but got `%s`", jsonObj.get("permissions").toString())); - } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `email` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("email").toString())); } - } - } + if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + if (jsonArraypermissions != null) { + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("permissions").toString())); + } + } + } + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InviteV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InviteV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InviteV1.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InviteV1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InviteV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InviteV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InviteV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InviteV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InviteV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InviteV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InviteV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InviteV1 + * @throws IOException if the JSON string is invalid with respect to InviteV1 + */ + public static InviteV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InviteV1.class); } - } - - /** - * Create an instance of InviteV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of InviteV1 - * @throws IOException if the JSON string is invalid with respect to InviteV1 - */ - public static InviteV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InviteV1.class); - } - - /** - * Convert an instance of InviteV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} + /** + * Convert an instance of InviteV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Label.java b/src/main/java/com/segment/publicapi/models/Label.java index a1e90429..68e30717 100644 --- a/src/main/java/com/segment/publicapi/models/Label.java +++ b/src/main/java/com/segment/publicapi/models/Label.java @@ -1,8 +1,8 @@ /* * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,275 +10,276 @@ * Do not edit the class manually. */ - package com.segment.publicapi.models; -import java.util.Objects; -import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; +import com.google.gson.TypeAdapterFactory; import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Set; -import com.segment.publicapi.JSON; - -/** - * The new label to create in the Workspace. - */ +/** The new label to create in the Workspace. */ @ApiModel(description = "The new label to create in the Workspace.") - public class Label { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; + public static final String SERIALIZED_NAME_KEY = "key"; - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; - public Label() { - } + public static final String SERIALIZED_NAME_VALUE = "value"; - public Label key(String key) { - - this.key = key; - return this; - } + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; - /** - * The key that represents the name of this label. - * @return key - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The key that represents the name of this label.") + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - public String getKey() { - return key; - } + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + public Label() {} - public void setKey(String key) { - this.key = key; - } + public Label key(String key) { + this.key = key; + return this; + } - public Label value(String value) { - - this.value = value; - return this; - } - - /** - * The value associated with the key of this label. - * @return value - **/ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value associated with the key of this label.") + /** + * The key that represents the name of this label. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The key that represents the name of this label.") + public String getKey() { + return key; + } - public String getValue() { - return value; - } + public void setKey(String key) { + this.key = key; + } + public Label value(String value) { - public void setValue(String value) { - this.value = value; - } + this.value = value; + return this; + } + /** + * The value associated with the key of this label. + * + * @return value + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The value associated with the key of this label.") + public String getValue() { + return value; + } - public Label description(String description) { - - this.description = description; - return this; - } + public void setValue(String value) { + this.value = value; + } - /** - * An optional description of the purpose of this label. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional description of the purpose of this label.") + public Label description(String description) { - public String getDescription() { - return description; - } + this.description = description; + return this; + } + /** + * An optional description of the purpose of this label. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional description of the purpose of this label.") + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Label label = (Label) o; + return Objects.equals(this.key, label.key) + && Objects.equals(this.value, label.value) + && Objects.equals(this.description, label.description); + } + @Override + public int hashCode() { + return Objects.hash(key, value, description); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Label {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - Label label = (Label) o; - return Objects.equals(this.key, label.key) && - Objects.equals(this.value, label.value) && - Objects.equals(this.description, label.description); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Label {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("value"); - openapiFields.add("description"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Label - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Label.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Label is not found in the empty JSON string", Label.openapiRequiredFields.toString())); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Label + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Label.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Label is not found in the empty JSON" + + " string", + Label.openapiRequiredFields.toString())); + } } - } - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Label.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Label` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Label.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Label`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } } - } - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Label.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Label.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `value` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("value").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Label.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Label' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter

Public Echo endpoint. * * @throws ApiException if the Api call fails */ @@ -49,18 +44,25 @@ public void echoTest() throws ApiException, IOException { int port = 8000; HttpServer httpServer = HttpServer.create(new InetSocketAddress(port), 0); - httpServer.createContext("/echo", new HttpHandler() { - @Override - public void handle(HttpExchange exchange) throws IOException { - Gson gson = new Gson(); - Echo200Response echo200Response = new Echo200Response().data( - new EchoAlphaOutput().headers(new HashMap<>()).method(EchoAlphaOutput.MethodEnum.GET).message(message)); - byte[] response = gson.toJson(echo200Response).getBytes(); - exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.length); - exchange.getResponseBody().write(response); - exchange.close(); - } - }); + httpServer.createContext( + "/echo", + new HttpHandler() { + @Override + public void handle(HttpExchange exchange) throws IOException { + Gson gson = new Gson(); + Echo200Response echo200Response = + new Echo200Response() + .data( + new EchoV1Output() + .headers(new HashMap<>()) + .method(EchoV1Output.MethodEnum.GET) + .message(message)); + byte[] response = gson.toJson(echo200Response).getBytes(); + exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.length); + exchange.getResponseBody().write(response); + exchange.close(); + } + }); httpServer.start(); try { From 1c3033f697fcb1cbf819e89facd774a33669f330 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Mon, 14 Nov 2022 20:57:48 +0000 Subject: [PATCH 009/474] Automated client deploy (from segmentio/public-api@7f94460) --- api/openapi.yaml | 968 +++++++++++++++++++++++------------------------ 1 file changed, 484 insertions(+), 484 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 28ad3636..98b38e2c 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -22247,6 +22247,305 @@ components: - value title: AllowedLabelBeta type: object + GetDestinationsCatalogV1Input: + description: Contains filter parameters used for loading the Destinations public + catalog. + properties: {} + required: + - pagination + title: GetDestinationsCatalogV1Input + type: object + GetDestinationsCatalogV1Output: + description: Returns a list of all Destination catalog items contained within + a given page. + example: + pagination: null + destinationsCatalog: + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + id: id + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + - website: website + components: + - owner: PARTNER + code: code + type: ANDROID + - owner: PARTNER + code: code + type: ANDROID + supportedFeatures: null + description: description + logos: null + presets: + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + - name: name + actionId: actionId + trigger: trigger + fields: + key: "" + supportedMethods: null + previousNames: + - previousNames + - previousNames + name: name + options: + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + - defaultValue: "" + name: name + description: description + label: label + type: type + required: true + id: id + categories: + - categories + - categories + supportedPlatforms: null + partnerOwned: true + actions: + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + - defaultTrigger: defaultTrigger + hidden: true + name: name + description: description + id: id + fields: + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + - fieldKey: fieldKey + defaultValue: "" + multiple: true + description: description + label: label + type: BOOLEAN + required: true + sortOrder: 0.8008281904610115 + dynamic: true + allowNull: true + id: id + placeholder: placeholder + choices: "" + slug: slug + platform: CLOUD + slug: slug + contacts: + - role: role + isPrimary: true + name: name + email: email + - role: role + isPrimary: true + name: name + email: email + status: DEPRECATED + properties: + destinationsCatalog: + description: All Destination catalog items contained within the requested + page. + items: + $ref: '#/components/schemas/DestinationMetadataV1' + title: destinationsCatalog + type: array + pagination: + $ref: '#/components/schemas/pagination' + required: + - destinationsCatalog + - pagination + title: GetDestinationsCatalogV1Output + type: object + GetDestinationMetadataV1Input: + description: Loads a Destination catalog item by id. + properties: {} + required: + - destinationMetadataId + title: GetDestinationMetadataV1Input + type: object + GetDestinationMetadataV1Output: + description: Returns a Destination catalog item. + example: + destinationMetadata: null + properties: + destinationMetadata: + $ref: '#/components/schemas/destinationMetadata' + required: + - destinationMetadata + title: GetDestinationMetadataV1Output + type: object AuditEventV1: description: Represents an Audit Trail event. example: @@ -23317,171 +23616,29 @@ components: name: name actionId: actionId id: id - trigger: trigger - destinationId: destinationId - enabled: true - properties: - id: - description: The unique identifier for the subscription. - title: id - type: string - name: - description: The name of the subscription. - title: name - type: string - actionId: - description: The unique identifier for the Destination action to trigger. - title: actionId - type: string - actionSlug: - description: The URL-friendly key for the associated Destination action. - title: actionSlug - type: string - destinationId: - description: The associated Destination instance id. - title: destinationId - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The customer settings for action fields. - title: settings - trigger: - description: FQL string that describes what events should trigger a Destination - action. - title: trigger - type: string - required: - - actionId - - actionSlug - - destinationId - - enabled - - id - - name - - settings - - trigger - title: DestinationSubscription - type: object - DestinationSubscriptionFields: - additionalProperties: {} - description: Represents settings used to configure an action subscription. - title: DestinationSubscriptionFields - type: object - ListSubscriptionsFromDestinationAlphaInput: - description: Input for ListDestinationSubscriptionsAlpha. - properties: {} - required: - - destinationId - title: ListSubscriptionsFromDestinationAlphaInput - type: object - ListSubscriptionsFromDestinationAlphaOutput: - description: Output for ListDestinationSubscriptionsAlpha. - example: - subscriptions: - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - pagination: null - properties: - subscriptions: - description: A list of Destination subscriptions. - items: - $ref: '#/components/schemas/DestinationSubscription' - title: subscriptions - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - subscriptions - title: ListSubscriptionsFromDestinationAlphaOutput - type: object - GetSubscriptionFromDestinationAlphaInput: - description: Fetches a Destination subscription. - properties: {} - required: - - destinationId - title: GetSubscriptionFromDestinationAlphaInput - type: object - GetSubscriptionFromDestinationAlphaOutput: - description: Returns a subscription for a given subscription id. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: GetSubscriptionFromDestinationAlphaOutput - type: object - CreateDestinationSubscriptionAlphaInput: - description: The basic input parameters for creating a Destination subscription. - properties: - name: - description: A user-defined name for the subscription. - title: name - type: string - actionId: - description: The associated action id the subscription should trigger. - title: actionId - type: string - trigger: - description: The FQL statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - required: - - actionId - - enabled - - name - - trigger - title: CreateDestinationSubscriptionAlphaInput - type: object - CreateDestinationSubscriptionAlphaOutput: - description: Returns a newly created Destination subscription. - example: - destinationSubscription: null - properties: - destinationSubscription: - $ref: '#/components/schemas/destinationSubscription' - required: - - destinationSubscription - title: CreateDestinationSubscriptionAlphaOutput - type: object - DestinationSubscriptionUpdateInput: - description: The input parameters for updating a Destination subscription. + trigger: trigger + destinationId: destinationId + enabled: true properties: + id: + description: The unique identifier for the subscription. + title: id + type: string name: - description: The user-defined name for the subscription. + description: The name of the subscription. title: name type: string - trigger: - description: The fql statement. - title: trigger + actionId: + description: The unique identifier for the Destination action to trigger. + title: actionId + type: string + actionSlug: + description: The URL-friendly key for the associated Destination action. + title: actionSlug + type: string + destinationId: + description: The associated Destination instance id. + title: destinationId type: string enabled: description: Is the subscription enabled. @@ -23490,351 +23647,194 @@ components: settings: allOf: - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. + description: The customer settings for action fields. title: settings - title: DestinationSubscriptionUpdateInput - type: object - UpdateSubscriptionForDestinationAlphaInput: - description: The basic input parameters for updating a Destination subscription. - properties: - input: - $ref: '#/components/schemas/input' + trigger: + description: FQL string that describes what events should trigger a Destination + action. + title: trigger + type: string required: + - actionId + - actionSlug - destinationId - - input - title: UpdateSubscriptionForDestinationAlphaInput + - enabled + - id + - name + - settings + - trigger + title: DestinationSubscription type: object - UpdateSubscriptionForDestinationAlphaOutput: - description: Returns the updated Destination subscription. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: UpdateSubscriptionForDestinationAlphaOutput + DestinationSubscriptionFields: + additionalProperties: {} + description: Represents settings used to configure an action subscription. + title: DestinationSubscriptionFields type: object - RemoveSubscriptionFromDestinationAlphaInput: - description: Deletes a Destination by id. + ListSubscriptionsFromDestinationAlphaInput: + description: Input for ListDestinationSubscriptionsAlpha. properties: {} required: - destinationId - title: RemoveSubscriptionFromDestinationAlphaInput - type: object - RemoveSubscriptionFromDestinationAlphaOutput: - description: Returns a Destination deletion flag. - example: - status: SUCCESS - properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveSubscriptionFromDestinationAlphaOutput - type: object - GetDestinationsCatalogV1Input: - description: Contains filter parameters used for loading the Destinations public - catalog. - properties: {} - required: - - pagination - title: GetDestinationsCatalogV1Input + title: ListSubscriptionsFromDestinationAlphaInput type: object - GetDestinationsCatalogV1Output: - description: Returns a list of all Destination catalog items contained within - a given page. + ListSubscriptionsFromDestinationAlphaOutput: + description: Output for ListDestinationSubscriptionsAlpha. example: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames + subscriptions: + - actionSlug: actionSlug + settings: "" name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true + actionId: actionId id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames + trigger: trigger + destinationId: destinationId + enabled: true + - actionSlug: actionSlug + settings: "" name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true + actionId: actionId id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED + trigger: trigger + destinationId: destinationId + enabled: true + pagination: null properties: - destinationsCatalog: - description: All Destination catalog items contained within the requested - page. + subscriptions: + description: A list of Destination subscriptions. items: - $ref: '#/components/schemas/DestinationMetadataV1' - title: destinationsCatalog + $ref: '#/components/schemas/DestinationSubscription' + title: subscriptions type: array pagination: $ref: '#/components/schemas/pagination' required: - - destinationsCatalog - - pagination - title: GetDestinationsCatalogV1Output + - subscriptions + title: ListSubscriptionsFromDestinationAlphaOutput type: object - GetDestinationMetadataV1Input: - description: Loads a Destination catalog item by id. + GetSubscriptionFromDestinationAlphaInput: + description: Fetches a Destination subscription. properties: {} required: - - destinationMetadataId - title: GetDestinationMetadataV1Input + - destinationId + title: GetSubscriptionFromDestinationAlphaInput type: object - GetDestinationMetadataV1Output: - description: Returns a Destination catalog item. + GetSubscriptionFromDestinationAlphaOutput: + description: Returns a subscription for a given subscription id. example: - destinationMetadata: null + subscription: null properties: - destinationMetadata: - $ref: '#/components/schemas/destinationMetadata' + subscription: + $ref: '#/components/schemas/subscription' required: - - destinationMetadata - title: GetDestinationMetadataV1Output + - subscription + title: GetSubscriptionFromDestinationAlphaOutput + type: object + CreateDestinationSubscriptionAlphaInput: + description: The basic input parameters for creating a Destination subscription. + properties: + name: + description: A user-defined name for the subscription. + title: name + type: string + actionId: + description: The associated action id the subscription should trigger. + title: actionId + type: string + trigger: + description: The FQL statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + required: + - actionId + - enabled + - name + - trigger + title: CreateDestinationSubscriptionAlphaInput + type: object + CreateDestinationSubscriptionAlphaOutput: + description: Returns a newly created Destination subscription. + example: + destinationSubscription: null + properties: + destinationSubscription: + $ref: '#/components/schemas/destinationSubscription' + required: + - destinationSubscription + title: CreateDestinationSubscriptionAlphaOutput + type: object + DestinationSubscriptionUpdateInput: + description: The input parameters for updating a Destination subscription. + properties: + name: + description: The user-defined name for the subscription. + title: name + type: string + trigger: + description: The fql statement. + title: trigger + type: string + enabled: + description: Is the subscription enabled. + title: enabled + type: boolean + settings: + allOf: + - $ref: '#/components/schemas/DestinationSubscriptionFields' + description: The fields used for configuring this action. + title: settings + title: DestinationSubscriptionUpdateInput + type: object + UpdateSubscriptionForDestinationAlphaInput: + description: The basic input parameters for updating a Destination subscription. + properties: + input: + $ref: '#/components/schemas/input' + required: + - destinationId + - input + title: UpdateSubscriptionForDestinationAlphaInput + type: object + UpdateSubscriptionForDestinationAlphaOutput: + description: Returns the updated Destination subscription. + example: + subscription: null + properties: + subscription: + $ref: '#/components/schemas/subscription' + required: + - subscription + title: UpdateSubscriptionForDestinationAlphaOutput + type: object + RemoveSubscriptionFromDestinationAlphaInput: + description: Deletes a Destination by id. + properties: {} + required: + - destinationId + title: RemoveSubscriptionFromDestinationAlphaInput + type: object + RemoveSubscriptionFromDestinationAlphaOutput: + description: Returns a Destination deletion flag. + example: + status: SUCCESS + properties: + status: + description: The status of the operation. + enum: + - SUCCESS + title: status + type: string + required: + - status + title: RemoveSubscriptionFromDestinationAlphaOutput type: object ListDeliveryMetricsSummaryFromDestinationBetaInput: description: Input to retrieve event delivery metrics summary for a Destination. @@ -32752,6 +32752,11 @@ components: - $ref: '#/components/schemas/PaginationOutput' description: Information about the pagination of this response. title: pagination + destinationMetadata: + allOf: + - $ref: '#/components/schemas/DestinationMetadataV1' + description: The catalog item matched by id. + title: destinationMetadata filter: allOf: - $ref: '#/components/schemas/PreviewDestinationFilterV1' @@ -32810,11 +32815,6 @@ components: - $ref: '#/components/schemas/DestinationSubscriptionUpdateInput' description: A set of valid Destination input params required for updating. title: input - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata deliveryMetricsSummary: allOf: - $ref: '#/components/schemas/DeliveryMetricsSummaryBeta' From 66355f4962ddc853f8efdf1cd170c9804ad6c8a5 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Wed, 16 Nov 2022 02:10:59 +0000 Subject: [PATCH 010/474] Automated client deploy (from segmentio/public-api@dc12921) --- api/openapi.yaml | 33280 ---------------- src/main/java/com/segment/publicapi/JSON.java | 3 + .../models/CreateTransformationBetaInput.java | 75 +- .../PropertyValueTransformationBeta.java | 268 + .../publicapi/models/Transformation.java | 69 +- .../publicapi/models/Transformation1.java | 69 +- .../publicapi/models/Transformation2.java | 69 +- .../publicapi/models/TransformationBeta.java | 69 +- .../models/UpdateTransformationBetaInput.java | 75 +- 9 files changed, 685 insertions(+), 33292 deletions(-) delete mode 100644 api/openapi.yaml create mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java diff --git a/api/openapi.yaml b/api/openapi.yaml deleted file mode 100644 index 98b38e2c..00000000 --- a/api/openapi.yaml +++ /dev/null @@ -1,33280 +0,0 @@ -openapi: 3.0.3 -info: - contact: - email: friends@segment.com - name: Segment - url: https://docs.segmentapis.com - description: "The Segment Public API helps you manage your Segment Workspaces and\ - \ its resources. You can use the API to perform CRUD (create, read, update, delete)\ - \ operations at no extra charge. This includes working with resources such as\ - \ Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations\ - \ and Sources Catalogs.\n\nAll CRUD endpoints in the API follow REST conventions\ - \ and use standard HTTP methods. Different URL endpoints represent different resources\ - \ in a Workspace.\n\nSee the next sections for more information on how to use\ - \ the Segment Public API.\n" - title: Segment Public API - version: 32.0.4 - x-logo: - url: https://brand.segment.com/site-assets/images/brand-guidelines/content/twilio/twilio-segment-logo.png - backgroundColor: '#ebf4ff' - altText: Twilio Segment logo -servers: -- description: Production - url: https://api.segmentapis.com -- description: Staging - url: https://api.segmentapis.build -security: -- token: [] -tags: -- description: Operations related to Warehouses - name: Warehouses -- description: Operations related to Sources - name: Sources -- description: Operations related to IAM Users - name: IAM Users -- description: Operations related to IAM Groups - name: IAM Groups -- description: Operations related to Tracking Plans - name: Tracking Plans -- description: Operations related to Spaces - name: Spaces -- description: Operations related to Deletion and Suppression - name: Deletion and Suppression -- description: Operations related to Destinations - name: Destinations -- description: Operations related to Edge Functions - name: Edge Functions -- description: Operations related to Destination Filters - name: Destination Filters -- description: Operations related to Functions - name: Functions -- description: Operations related to Labels - name: Labels -- description: Operations related to Transformations - name: Transformations -- description: Operations related to Testing - name: Testing -- description: Operations related to Selective Sync - name: Selective Sync -- description: Operations related to API Calls - name: API Calls -- description: Operations related to Monthly Tracked Users - name: Monthly Tracked Users -- description: Operations related to Catalog - name: Catalog -- description: Operations related to Events - name: Events -- description: Operations related to Workspaces - name: Workspaces -- description: Operations related to Audit Trail - name: Audit Trail -- description: Operations related to IAM Roles - name: IAM Roles -paths: - /warehouses/{warehouseId}/connected-sources/{sourceId}: - delete: - deprecated: false - description: Disconnects a Source from a Warehouse. - operationId: removeSourceConnectionFromWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceConnectionFromWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Remove Source Connection from Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - post: - deprecated: false - description: "Connects a Source to a Warehouse.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n " - operationId: addConnectionFromSourceToWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - application/json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/addConnectionFromSourceToWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Add Connection from Source to Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - /sources/{sourceId}/labels: - post: - deprecated: false - description: "Adds an existing label to a Source.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event.\n\ - \ " - operationId: addLabelsToSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - labels: - - key: type - value: web - schema: - $ref: '#/components/schemas/AddLabelsToSourceV1Input' - application/vnd.segment.v1beta+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - labels: - - key: type - value: web - schema: - $ref: '#/components/schemas/AddLabelsToSourceV1Input' - application/vnd.segment.v1alpha+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - labels: - - key: type - value: web - schema: - $ref: '#/components/schemas/AddLabelsToSourceAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - labels: - - key: type - value: web - - key: environment - value: prod - schema: - $ref: '#/components/schemas/addLabelsToSource_200_response' - application/json: - example: - data: - labels: - - key: type - value: web - - key: environment - value: prod - schema: - $ref: '#/components/schemas/addLabelsToSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - labels: - - key: type - value: web - - key: environment - value: prod - schema: - $ref: '#/components/schemas/addLabelsToSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - labels: - - key: type - value: web - schema: - $ref: '#/components/schemas/addLabelsToSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Add Labels to Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - put: - deprecated: false - description: Replaces all labels in a Source. - operationId: replaceLabelsInSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/ReplaceLabelsInSourceV1Input' - application/vnd.segment.v1beta+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/ReplaceLabelsInSourceV1Input' - application/vnd.segment.v1alpha+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/ReplaceLabelsInSourceAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/replaceLabelsInSource_200_response' - application/json: - example: - data: - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/replaceLabelsInSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/replaceLabelsInSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - labels: - - key: environment - value: prod - schema: - $ref: '#/components/schemas/replaceLabelsInSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Labels in Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /users/{userId}/permissions: - post: - deprecated: false - description: "Adds a list of access permissions to a user.\n\nWhen called, this\ - \ endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Policy Created\n* User Policy Updated\n \n\n\nThe rate limit\ - \ for this endpoint is 60 requests per minute, which is lower than the default\ - \ due to access pattern restrictions. Once reached, this endpoint will respond\ - \ with the 429 HTTP status code with headers indicating the limit parameters.\ - \ See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: addPermissionsToUser - parameters: - - explode: false - in: path - name: userId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - userId: sgJDWk3K21k6LE3tLU9nRK - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/AddPermissionsToUserV1Input' - application/vnd.segment.v1beta+json: - example: - userId: sgJDWk3K21k6LE3tLU9nRK - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/AddPermissionsToUserV1Input' - application/vnd.segment.v1alpha+json: - example: - userId: sgJDWk3K21k6LE3tLU9nRK - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/AddPermissionsToUserV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - permissions: - - policyId: 2DrXp6Tx3Lcba6CvSqnwyiX5SDH - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: sgJDWk3K21k6LE3tLU9nRK - subjectType: user - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUser_200_response' - application/json: - example: - data: - permissions: - - policyId: 2DrXp6Tx3Lcba6CvSqnwyiX5SDH - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: sgJDWk3K21k6LE3tLU9nRK - subjectType: user - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUser_200_response' - application/vnd.segment.v1beta+json: - example: - data: - permissions: - - policyId: 2DrXoOPQa1eaYu1fjfmYT2A3n1g - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: sgJDWk3K21k6LE3tLU9nRK - subjectType: user - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUser_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - permissions: - - policyId: 2Qyqtmy96fq1iV81Ax6W9f - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: sgJDWk3K21k6LE3tLU9nRK - subjectType: user - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUser_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Add Permissions to User - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - put: - deprecated: false - description: "Updates the list of access permissions for a user.\n\n\n\nWhen\ - \ called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n \n\n\nThe rate limit for this endpoint is 60 requests per\ - \ minute, which is lower than the default due to access pattern restrictions.\ - \ Once reached, this endpoint will respond with the 429 HTTP status code with\ - \ headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: replacePermissionsForUser - parameters: - - explode: false - in: path - name: userId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - userId: sgJDWk3K21k6LE3tLU9nRK - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/ReplacePermissionsForUserV1Input' - application/vnd.segment.v1beta+json: - example: - userId: sgJDWk3K21k6LE3tLU9nRK - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/ReplacePermissionsForUserV1Input' - application/vnd.segment.v1alpha+json: - example: - userId: sgJDWk3K21k6LE3tLU9nRK - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/ReplacePermissionsForUserV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUser_200_response' - application/json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUser_200_response' - application/vnd.segment.v1beta+json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUser_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUser_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Permissions for User - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /groups/{userGroupId}/permissions: - post: - deprecated: false - description: "Adds a list of access permissions to a user group.\n\nWhen called,\ - \ this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Policy Created\n* User Group Policy Updated\n \n\n\nThe\ - \ rate limit for this endpoint is 60 requests per minute, which is lower than\ - \ the default due to access pattern restrictions. Once reached, this endpoint\ - \ will respond with the 429 HTTP status code with headers indicating the limit\ - \ parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: addPermissionsToUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/AddPermissionsToUserGroupV1Input' - application/vnd.segment.v1beta+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/AddPermissionsToUserGroupV1Input' - application/vnd.segment.v1alpha+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/AddPermissionsToUserGroupV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - permissions: - - policyId: 2DrXqK6YSJGtQs9PJHcMSneAWIZ - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: bBABwqbaDf2QdwTbW8bNEm - subjectType: group - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - application/json: - example: - data: - permissions: - - policyId: 2DrXqK6YSJGtQs9PJHcMSneAWIZ - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: bBABwqbaDf2QdwTbW8bNEm - subjectType: group - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - permissions: - - policyId: 2DrXpCP88iCLEsmGa9SSrei1C6o - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: bBABwqbaDf2QdwTbW8bNEm - subjectType: group - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - permissions: - - policyId: 2DrXoTM7Kxb1rCTZhRko40oN8e0 - roleName: Workspace Owner - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - subjectId: bBABwqbaDf2QdwTbW8bNEm - subjectType: group - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/addPermissionsToUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Add Permissions to User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - put: - deprecated: false - description: "Updates the list of access permissions for a user group.\n\n\n\ - \nWhen called, this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n \n\n\nThe rate limit for this endpoint is 60 requests per\ - \ minute, which is lower than the default due to access pattern restrictions.\ - \ Once reached, this endpoint will respond with the 429 HTTP status code with\ - \ headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: replacePermissionsForUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/ReplacePermissionsForUserGroupV1Input' - application/vnd.segment.v1beta+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/ReplacePermissionsForUserGroupV1Input' - application/vnd.segment.v1alpha+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/ReplacePermissionsForUserGroupV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - application/json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/replacePermissionsForUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Permissions for User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /tracking-plans/{trackingPlanId}/sources: - delete: - deprecated: false - description: "Disconnects a Source from a Tracking Plan.\n\n\n\nWhen called,\ - \ this endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n**Note**: In order to successfully call this endpoint, the specified\ - \ Workspace needs to have the Protocols feature enabled. Please reach out\ - \ to your customer success manager for more information." - operationId: removeSourceFromTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: "The id of the Source associated with the Tracking Plan.\n\n\ - Config API note: analogous to `sourceName`.\n\nThis parameter exists in\ - \ v1." - explode: false - in: query - name: sourceId - required: true - schema: - description: "The id of the Source associated with the Tracking Plan.\n\n\ - Config API note: analogous to `sourceName`." - title: sourceId - type: string - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSourceFromTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Remove Source from Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - get: - deprecated: false - description: "Lists Sources connected to a Tracking Plan.\n\n**Note**: In order\ - \ to successfully call this endpoint, the specified Workspace needs to have\ - \ the Protocols feature enabled. Please reach out to your customer success\ - \ manager for more information.\n\n\nThis endpoint requires the user to have\ - \ at least the following permission(s): \n * Source Read-only\n * Tracking\ - \ Plan Read-only" - operationId: listSourcesFromTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination options. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - application/json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listSourcesFromTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Sources from Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - post: - deprecated: false - description: "Connects a Source to a Tracking Plan.\n\n\n\nWhen called, this\ - \ endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n**Note**: In order to successfully call this endpoint, the specified\ - \ Workspace needs to have the Protocols feature enabled. Please reach out\ - \ to your customer success manager for more information." - operationId: addSourceToTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - sourceId: qQEHquLrjRDN9j1ByrChyn - schema: - $ref: '#/components/schemas/AddSourceToTrackingPlanV1Input' - application/vnd.segment.v1beta+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - sourceId: qQEHquLrjRDN9j1ByrChyn - schema: - $ref: '#/components/schemas/AddSourceToTrackingPlanV1Input' - application/vnd.segment.v1alpha+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - sourceId: qQEHquLrjRDN9j1ByrChyn - schema: - $ref: '#/components/schemas/AddSourceToTrackingPlanV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/addSourceToTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Add Source to Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /groups/{userGroupId}/users: - get: - deprecated: false - description: Returns users belonging to a user group. - operationId: listUsersFromUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination for members of a group. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - users: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - application/json: - example: - data: - users: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - users: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - users: - - id: sgJDWk3K21k6LE3tLU9nRK - email: papi@segment.com - name: "" - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listUsersFromUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Users from User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-accepts: application/json - post: - deprecated: false - description: "Adds a list of users or invites to a user group.\n\nWhen called,\ - \ this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Subjects Added to Group\n* User Added To User Group\n \n\ - \n\nThe rate limit for this endpoint is 60 requests per minute, which is lower\ - \ than the default due to access pattern restrictions. Once reached, this\ - \ endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: addUsersToUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/AddUsersToUserGroupV1Input' - application/vnd.segment.v1beta+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/AddUsersToUserGroupV1Input' - application/vnd.segment.v1alpha+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/AddUsersToUserGroupV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/addUsersToUserGroup_200_response' - application/json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/addUsersToUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/addUsersToUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 2 - schema: - $ref: '#/components/schemas/addUsersToUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Add Users to User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /spaces/{spaceId}/messaging-subscriptions/batch: - post: - deprecated: false - description: Get Messaging Subscriptions for space. - operationId: batchQueryMessagingSubscriptionsForSpace - parameters: - - explode: false - in: path - name: spaceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1alpha+json: - example: - spaceId: 9aQ1Lj62S4bomZKLF4DPqW - subscriptions: - - key: test@email.com - type: EMAIL - - key: pgibbonsexample.com - type: EMAIL - - key: +12162226233 - type: SMS - - key: "11" - type: SMS - schema: - $ref: '#/components/schemas/BatchQueryMessagingSubscriptionsForSpaceAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - successes: - - key: jacob@exmple.com - type: EMAIL - status: SUBSCRIBED - - key: "2162226233" - type: SMS - status: DID_NOT_SUBSCRIBE - failures: - - key: pgibbonsexample.com - type: EMAIL - errors: - - code: INVALID_EMAIL - message: Email is not valid - schema: - $ref: '#/components/schemas/batchQueryMessagingSubscriptionsForSpace_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Batch Query Messaging Subscriptions for Space - tags: - - Spaces - x-domain-hierarchy: - - Engage - - Spaces - x-content-type: application/vnd.segment.v1alpha+json - x-accepts: application/json - /regulations/cloudsources/{sourceId}: - post: - deprecated: false - description: "Creates a Source-scoped regulation.\n\n Config API omitted\ - \ fields:\n- `attributes`,\n- `userAgent`\n " - operationId: createCloudSourceRegulation - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: OBJECT_ID - subjectIds: - - test_object_id - sourceId: qQEHquLrjRDN9j1ByrChyn - collection: some-app-collection - schema: - $ref: '#/components/schemas/CreateCloudSourceRegulationV1Input' - application/vnd.segment.v1beta+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: OBJECT_ID - subjectIds: - - test_object_id - sourceId: qQEHquLrjRDN9j1ByrChyn - collection: some-app-collection - schema: - $ref: '#/components/schemas/CreateCloudSourceRegulationV1Input' - application/vnd.segment.v1alpha+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: OBJECT_ID - subjectIds: - - test_object_id - sourceId: qQEHquLrjRDN9j1ByrChyn - collection: some-app-collection - schema: - $ref: '#/components/schemas/CreateCloudSourceRegulationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - application/json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - application/vnd.segment.v1beta+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createCloudSourceRegulation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Cloud Source Regulation - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /destinations: - get: - deprecated: false - description: Returns a list of Destinations. - operationId: listDestinations - parameters: - - description: |- - Required pagination params for the request. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destinations: - - id: 5GFhvtz8fha42Cm4B9E6L8 - enabled: true - name: "" - settings: - region: us-west - roleAddress: arn::... - secretId: secrettt - stream: bla - metadata: - id: 57da359580412f644ff33fb9 - name: Amazon Kinesis - description: "Amazon Kinesis Streams enables you to build custom\ - \ applications that process or analyze streaming data for\ - \ specialized needs. Amazon Kinesis Streams can continuously\ - \ capture and store terabytes of data per hour from hundreds\ - \ of thousands of sources such as website clickstreams, financial\ - \ transactions, social media feeds, IT logs, and location-tracking\ - \ events." - slug: amazon-kinesis - logos: - default: https://cdn.filepicker.io/api/file/qr7D6jkLQvd1KAJlY8Zp - mark: https://cdn.filepicker.io/api/file/zLZbfcBeSZTfX4CsgBvA - options: - - name: region - type: string - defaultValue: us-west-2 - description: The Kinesis Stream's AWS region key - required: true - label: AWS Kinesis Stream Region - - name: roleAddress - type: string - defaultValue: "" - description: "The address of the AWS role that will be writing\ - \ to Kinesis (ex: arn:aws:iam::874699288871:role/example-role)" - required: true - label: Role Address - - name: secretId - type: string - defaultValue: '#SEGMENT_WORKSPACE_ID' - description: The External ID to your IAM role. This value - is read-only. Reach out to support if you wish to change - it. This value is also a secret and should be treated as - a password. - required: true - label: Secret ID (Read-Only) - - name: stream - type: string - defaultValue: "" - description: The Kinesis Stream Name - required: true - label: AWS Kinesis Stream Name - - name: useMessageId - type: boolean - defaultValue: false - description: "You can enable this option if you want to use\ - \ the Segment generated `messageId` for the **Partition\ - \ Key**. If you have issues with too many `provisionedthroughputexceededexceptions`\ - \ errors, this means that your Segment events are not being\ - \ evenly distributed across your buckets as you do not have\ - \ even user event distribution (*default partition key is\ - \ `userId` or `anonymousId`*). This option should provide\ - \ much more stable and even distribution." - required: false - label: Use Segment Message ID - status: PUBLIC - categories: - - Analytics - - Raw Data - website: https://aws.amazon.com/kinesis/streams/ - components: - - code: https://github.com/segmentio/integrations/tree/master/integrations/amazon-kinesis - type: SERVER - previousNames: - - Amazon Kinesis - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: true - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - pagination: - current: MA== - next: MQ== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listDestinations_200_response' - application/json: - example: - data: - destinations: - - id: 5GFhvtz8fha42Cm4B9E6L8 - enabled: true - name: "" - settings: - region: us-west - roleAddress: arn::... - secretId: secrettt - stream: bla - metadata: - id: 57da359580412f644ff33fb9 - name: Amazon Kinesis - description: "Amazon Kinesis Streams enables you to build custom\ - \ applications that process or analyze streaming data for\ - \ specialized needs. Amazon Kinesis Streams can continuously\ - \ capture and store terabytes of data per hour from hundreds\ - \ of thousands of sources such as website clickstreams, financial\ - \ transactions, social media feeds, IT logs, and location-tracking\ - \ events." - slug: amazon-kinesis - logos: - default: https://cdn.filepicker.io/api/file/qr7D6jkLQvd1KAJlY8Zp - mark: https://cdn.filepicker.io/api/file/zLZbfcBeSZTfX4CsgBvA - options: - - name: region - type: string - defaultValue: us-west-2 - description: The Kinesis Stream's AWS region key - required: true - label: AWS Kinesis Stream Region - - name: roleAddress - type: string - defaultValue: "" - description: "The address of the AWS role that will be writing\ - \ to Kinesis (ex: arn:aws:iam::874699288871:role/example-role)" - required: true - label: Role Address - - name: secretId - type: string - defaultValue: '#SEGMENT_WORKSPACE_ID' - description: The External ID to your IAM role. This value - is read-only. Reach out to support if you wish to change - it. This value is also a secret and should be treated as - a password. - required: true - label: Secret ID (Read-Only) - - name: stream - type: string - defaultValue: "" - description: The Kinesis Stream Name - required: true - label: AWS Kinesis Stream Name - - name: useMessageId - type: boolean - defaultValue: false - description: "You can enable this option if you want to use\ - \ the Segment generated `messageId` for the **Partition\ - \ Key**. If you have issues with too many `provisionedthroughputexceededexceptions`\ - \ errors, this means that your Segment events are not being\ - \ evenly distributed across your buckets as you do not have\ - \ even user event distribution (*default partition key is\ - \ `userId` or `anonymousId`*). This option should provide\ - \ much more stable and even distribution." - required: false - label: Use Segment Message ID - status: PUBLIC - categories: - - Analytics - - Raw Data - website: https://aws.amazon.com/kinesis/streams/ - components: - - code: https://github.com/segmentio/integrations/tree/master/integrations/amazon-kinesis - type: SERVER - previousNames: - - Amazon Kinesis - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: true - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - pagination: - current: MA== - next: MQ== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listDestinations_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destinations: - - id: 5GFhvtz8fha42Cm4B9E6L8 - enabled: true - name: "" - settings: - region: us-west - roleAddress: arn::... - secretId: secrettt - stream: bla - metadata: - id: 57da359580412f644ff33fb9 - name: Amazon Kinesis - description: "Amazon Kinesis Streams enables you to build custom\ - \ applications that process or analyze streaming data for\ - \ specialized needs. Amazon Kinesis Streams can continuously\ - \ capture and store terabytes of data per hour from hundreds\ - \ of thousands of sources such as website clickstreams, financial\ - \ transactions, social media feeds, IT logs, and location-tracking\ - \ events." - slug: amazon-kinesis - logos: - default: https://cdn.filepicker.io/api/file/qr7D6jkLQvd1KAJlY8Zp - mark: https://cdn.filepicker.io/api/file/zLZbfcBeSZTfX4CsgBvA - options: - - name: region - type: string - defaultValue: us-west-2 - description: The Kinesis Stream's AWS region key - required: true - label: AWS Kinesis Stream Region - - name: roleAddress - type: string - defaultValue: "" - description: "The address of the AWS role that will be writing\ - \ to Kinesis (ex: arn:aws:iam::874699288871:role/example-role)" - required: true - label: Role Address - - name: secretId - type: string - defaultValue: '#SEGMENT_WORKSPACE_ID' - description: The External ID to your IAM role. This value - is read-only. Reach out to support if you wish to change - it. This value is also a secret and should be treated as - a password. - required: true - label: Secret ID (Read-Only) - - name: stream - type: string - defaultValue: "" - description: The Kinesis Stream Name - required: true - label: AWS Kinesis Stream Name - - name: useMessageId - type: boolean - defaultValue: false - description: "You can enable this option if you want to use\ - \ the Segment generated `messageId` for the **Partition\ - \ Key**. If you have issues with too many `provisionedthroughputexceededexceptions`\ - \ errors, this means that your Segment events are not being\ - \ evenly distributed across your buckets as you do not have\ - \ even user event distribution (*default partition key is\ - \ `userId` or `anonymousId`*). This option should provide\ - \ much more stable and even distribution." - required: false - label: Use Segment Message ID - status: PUBLIC - categories: - - Analytics - - Raw Data - website: https://aws.amazon.com/kinesis/streams/ - components: - - code: https://github.com/segmentio/integrations/tree/master/integrations/amazon-kinesis - type: SERVER - previousNames: - - Amazon Kinesis - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: true - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - pagination: - current: MA== - next: MQ== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listDestinations_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destinations: - - id: 5GFhvtz8fha42Cm4B9E6L8 - enabled: true - name: "" - settings: - region: us-west - roleAddress: arn::... - secretId: secrettt - stream: bla - metadata: - id: 57da359580412f644ff33fb9 - name: Amazon Kinesis - description: "Amazon Kinesis Streams enables you to build custom\ - \ applications that process or analyze streaming data for\ - \ specialized needs. Amazon Kinesis Streams can continuously\ - \ capture and store terabytes of data per hour from hundreds\ - \ of thousands of sources such as website clickstreams, financial\ - \ transactions, social media feeds, IT logs, and location-tracking\ - \ events." - slug: amazon-kinesis - logos: - default: https://cdn.filepicker.io/api/file/qr7D6jkLQvd1KAJlY8Zp - mark: https://cdn.filepicker.io/api/file/zLZbfcBeSZTfX4CsgBvA - options: - - name: region - type: string - defaultValue: us-west-2 - description: The Kinesis Stream's AWS region key - required: true - label: AWS Kinesis Stream Region - - name: roleAddress - type: string - defaultValue: "" - description: "The address of the AWS role that will be writing\ - \ to Kinesis (ex: arn:aws:iam::874699288871:role/example-role)" - required: true - label: Role Address - - name: secretId - type: string - defaultValue: '#SEGMENT_WORKSPACE_ID' - description: The External ID to your IAM role. This value - is read-only. Reach out to support if you wish to change - it. This value is also a secret and should be treated as - a password. - required: true - label: Secret ID (Read-Only) - - name: stream - type: string - defaultValue: "" - description: The Kinesis Stream Name - required: true - label: AWS Kinesis Stream Name - - name: useMessageId - type: boolean - defaultValue: false - description: "You can enable this option if you want to use\ - \ the Segment generated `messageId` for the **Partition\ - \ Key**. If you have issues with too many `provisionedthroughputexceededexceptions`\ - \ errors, this means that your Segment events are not being\ - \ evenly distributed across your buckets as you do not have\ - \ even user event distribution (*default partition key is\ - \ `userId` or `anonymousId`*). This option should provide\ - \ much more stable and even distribution." - required: false - label: Use Segment Message ID - status: PUBLIC - categories: - - Analytics - - Raw Data - website: https://aws.amazon.com/kinesis/streams/ - components: - - code: https://github.com/segmentio/integrations/tree/master/integrations/amazon-kinesis - type: SERVER - previousNames: - - Amazon Kinesis - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: true - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - pagination: - current: MA== - next: MQ== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listDestinations_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Destinations - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - post: - deprecated: false - description: "Creates a new Destination.\n\n\n\nWhen called, this endpoint may\ - \ generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event.\n\ - \ " - operationId: createDestination - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - metadataId: 547610a5db31d978f14a5c4e - name: my destination v1 - settings: - apiKey: XYZ - retarget: true - schema: - $ref: '#/components/schemas/CreateDestinationV1Input' - application/vnd.segment.v1beta+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - metadataId: 547610a5db31d978f14a5c4e - name: my destination beta - settings: - apiKey: XYZ - retarget: true - schema: - $ref: '#/components/schemas/CreateDestinationV1Input' - application/vnd.segment.v1alpha+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - metadataId: 547610a5db31d978f14a5c4e - name: Example destination - settings: - apiKey: XYZ - retarget: true - schema: - $ref: '#/components/schemas/CreateDestinationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destination: - id: 6307d789e53cc13be4ad0d06 - enabled: true - name: my destination v1 - settings: - apiKey: •••••••••• - retarget: true - metadata: - id: 547610a5db31d978f14a5c4e - name: Blueshift - description: "Blueshift's predictive marketing automates behavioral\ - \ messaging on email, push notifications, display, Facebook\ - \ and more" - slug: blueshift - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/Blueshift-default.svg - mark: https://cdn.filepicker.io/api/file/Fqsz0q3QPujUyMACLPLr - options: - - name: apiKey - type: string - defaultValue: "" - description: Your API key can be found in Account Profile - > API Keys - required: true - label: API Key - - name: retarget - type: boolean - defaultValue: false - description: This will retarget page calls on the client-side - required: true - label: Retarget - status: PUBLIC - categories: - - SMS & Push Notifications - - Advertising - - Email Marketing - website: http://getblueshift.com/ - components: - - code: https://github.com/segment-integrations/analytics.js-integration-blueshift - type: BROWSER - - code: https://github.com/segmentio/integrations/tree/master/integrations/blueshift - type: SERVER - previousNames: - - Blueshift - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/createDestination_200_response' - application/json: - example: - data: - destination: - id: 6307d789e53cc13be4ad0d06 - enabled: true - name: my destination v1 - settings: - apiKey: •••••••••• - retarget: true - metadata: - id: 547610a5db31d978f14a5c4e - name: Blueshift - description: "Blueshift's predictive marketing automates behavioral\ - \ messaging on email, push notifications, display, Facebook\ - \ and more" - slug: blueshift - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/Blueshift-default.svg - mark: https://cdn.filepicker.io/api/file/Fqsz0q3QPujUyMACLPLr - options: - - name: apiKey - type: string - defaultValue: "" - description: Your API key can be found in Account Profile - > API Keys - required: true - label: API Key - - name: retarget - type: boolean - defaultValue: false - description: This will retarget page calls on the client-side - required: true - label: Retarget - status: PUBLIC - categories: - - SMS & Push Notifications - - Advertising - - Email Marketing - website: http://getblueshift.com/ - components: - - code: https://github.com/segment-integrations/analytics.js-integration-blueshift - type: BROWSER - - code: https://github.com/segmentio/integrations/tree/master/integrations/blueshift - type: SERVER - previousNames: - - Blueshift - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/createDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destination: - id: 6307d786e53cc10ae7ad0d04 - enabled: true - name: my destination beta - settings: - apiKey: •••••••••• - retarget: true - metadata: - id: 547610a5db31d978f14a5c4e - name: Blueshift - description: "Blueshift's predictive marketing automates behavioral\ - \ messaging on email, push notifications, display, Facebook\ - \ and more" - slug: blueshift - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/Blueshift-default.svg - mark: https://cdn.filepicker.io/api/file/Fqsz0q3QPujUyMACLPLr - options: - - name: apiKey - type: string - defaultValue: "" - description: Your API key can be found in Account Profile - > API Keys - required: true - label: API Key - - name: retarget - type: boolean - defaultValue: false - description: This will retarget page calls on the client-side - required: true - label: Retarget - status: PUBLIC - categories: - - SMS & Push Notifications - - Advertising - - Email Marketing - website: http://getblueshift.com/ - components: - - code: https://github.com/segment-integrations/analytics.js-integration-blueshift - type: BROWSER - - code: https://github.com/segmentio/integrations/tree/master/integrations/blueshift - type: SERVER - previousNames: - - Blueshift - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/createDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destination: - id: 6307d783e53cc188ebad0d02 - enabled: true - name: Example destination - settings: - apiKey: •••••••••• - retarget: true - metadata: - id: 547610a5db31d978f14a5c4e - name: Blueshift - description: "Blueshift's predictive marketing automates behavioral\ - \ messaging on email, push notifications, display, Facebook\ - \ and more" - slug: blueshift - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/Blueshift-default.svg - mark: https://cdn.filepicker.io/api/file/Fqsz0q3QPujUyMACLPLr - options: - - name: apiKey - type: string - defaultValue: "" - description: Your API key can be found in Account Profile - > API Keys - required: true - label: API Key - - name: retarget - type: boolean - defaultValue: false - description: This will retarget page calls on the client-side - required: true - label: Retarget - status: PUBLIC - categories: - - SMS & Push Notifications - - Advertising - - Email Marketing - website: http://getblueshift.com/ - components: - - code: https://github.com/segment-integrations/analytics.js-integration-blueshift - type: BROWSER - - code: https://github.com/segmentio/integrations/tree/master/integrations/blueshift - type: SERVER - previousNames: - - Blueshift - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: true - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/createDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /destinations/{destinationId}/subscriptions: - get: - deprecated: false - description: Lists subscriptions for a Destination. - operationId: listSubscriptionsFromDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination options. - - This parameter exists in alpha. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - subscriptions: - - id: eoeXaMeAYcB2XvEApJDrQs - name: Test Subscription - actionId: uD9jEQ4DxJZzhzVqppM7UD - actionSlug: Public API Slug - destinationId: fP7qoQw2HTWt9WdMr718gn - trigger: type = "track" - enabled: true - settings: {} - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listSubscriptionsFromDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Subscriptions from Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - post: - deprecated: false - description: Creates a new Destination subscription. - operationId: createDestinationSubscription - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1alpha+json: - example: - destinationId: fP7qoQw2HTWt9WdMr718gn - name: Example Subscription - actionId: jiMz7MfHNeHmUckzRnUGkU - trigger: type = "track" - enabled: false - schema: - $ref: '#/components/schemas/CreateDestinationSubscriptionAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - destinationSubscription: - id: ccyWFBVjSkeVKsyc6YrN8U - name: Example Subscription - actionId: jiMz7MfHNeHmUckzRnUGkU - actionSlug: someActionSlug - destinationId: fP7qoQw2HTWt9WdMr718gn - trigger: type = "track" - enabled: false - settings: {} - schema: - $ref: '#/components/schemas/createDestinationSubscription_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Destination Subscription - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-content-type: application/vnd.segment.v1alpha+json - x-accepts: application/json - /sources/{sourceId}/edge-functions: - post: - deprecated: false - description: "Create EdgeFunctions for your Source, given a valid upload URL\ - \ for an Edge Functions bundle.\n\n**Note**: In order to successfully call\ - \ this endpoint, the specified Workspace needs to have the Edge Functions\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information.\n " - operationId: createEdgeFunctions - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1alpha+json: - example: - sourceId: qQEHquLrjRDN9j1ByrChyn - uploadURL: - schema: - $ref: '#/components/schemas/CreateEdgeFunctionsAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - edgeFunctions: - id: 3b48bd4c-7c2c-4dec-813f-905718290a4c - sourceId: qQEHquLrjRDN9j1ByrChyn - downloadURL: https://cdn.edgefn.segment.build/qQEHquLrjRDN9j1ByrChyn/3b48bd4c-7c2c-4dec-813f-905718290a4c.js - createdBy: sgJDWk3K21k6LE3tLU9nRK - createdAt: 2006-01-02T15:04:05.000Z - version: 1 - schema: - $ref: '#/components/schemas/createEdgeFunctions_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Edge Functions - tags: - - Edge Functions - x-domain-hierarchy: - - Connections - - Edge Functions - x-content-type: application/vnd.segment.v1alpha+json - x-accepts: application/json - /destination/{destinationId}/filters: - get: - deprecated: false - description: Lists filters for a Destination. - operationId: listFiltersFromDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination options. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - filters: - - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listFiltersFromDestination_200_response' - application/json: - example: - data: - filters: - - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listFiltersFromDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - filters: - - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listFiltersFromDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - filters: - - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: event = "Order Completed" - actions: - - type: DROP_PROPERTIES - fields: - properties: - - userId - - secretValue - title: Order Completed - description: This filter probably does nothing - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listFiltersFromDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Filters from Destination - tags: - - Destination Filters - x-domain-hierarchy: - - Connections - - Destination Filters - x-accepts: application/json - post: - deprecated: false - description: "Creates a filter in a Destination.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n " - operationId: createFilterForDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - title: Filter "Identify" events - description: Drop Identify tracking from this destination - if: type = "identify" - actions: - - type: DROP - enabled: true - schema: - $ref: '#/components/schemas/CreateFilterForDestinationV1Input' - application/vnd.segment.v1beta+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - title: Filter "Identify" events - description: Drop Identify tracking from this destination - if: type = "identify" - actions: - - type: DROP - enabled: true - schema: - $ref: '#/components/schemas/CreateFilterForDestinationV1Input' - application/vnd.segment.v1alpha+json: - example: - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - title: Filter "Identify" events - description: Drop Identify tracking from this destination - if: type = "identify" - actions: - - type: DROP - enabled: true - schema: - $ref: '#/components/schemas/CreateFilterForDestinationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - filter: - id: 2DrXiU3g89bTXEKys3dhDAYAlIk - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: type = "identify" - actions: - - type: DROP - title: Filter "Identify" events - description: Drop Identify tracking from this destination - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createFilterForDestination_200_response' - application/json: - example: - data: - filter: - id: 2DrXiU3g89bTXEKys3dhDAYAlIk - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: type = "identify" - actions: - - type: DROP - title: Filter "Identify" events - description: Drop Identify tracking from this destination - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createFilterForDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - filter: - id: 2DrXi853HCPQrDXWdqxfi5tS1GX - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: type = "identify" - actions: - - type: DROP - title: Filter "Identify" events - description: Drop Identify tracking from this destination - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createFilterForDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - filter: - id: 2DrXhZUwilV5MHOwaOTg9NEhGNl - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: type = "identify" - actions: - - type: DROP - title: Filter "Identify" events - description: Drop Identify tracking from this destination - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createFilterForDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Filter for Destination - tags: - - Destination Filters - x-domain-hierarchy: - - Connections - - Destination Filters - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /functions: - get: - deprecated: false - description: "Lists all Functions in a Workspace.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Functions\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: listFunctions - parameters: - - description: |- - Pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - - description: "The Function type.\n\nConfig API note: equal to `type`.\n\n\ - This parameter exists in v1." - explode: false - in: query - name: resourceType - required: true - schema: - description: "The Function type.\n\nConfig API note: equal to `type`." - enum: - - DESTINATION - - SOURCE - title: resourceType - type: string - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - functions: - - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - catalogId: wXzcDGFR3KmjLDrtSawNHf - resourceType: SOURCE - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listFunctions_200_response' - application/json: - example: - data: - functions: - - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - catalogId: wXzcDGFR3KmjLDrtSawNHf - resourceType: SOURCE - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listFunctions_200_response' - application/vnd.segment.v1beta+json: - example: - data: - functions: - - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - catalogId: wXzcDGFR3KmjLDrtSawNHf - resourceType: SOURCE - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listFunctions_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - functions: - - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - catalogId: wXzcDGFR3KmjLDrtSawNHf - resourceType: SOURCE - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listFunctions_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Functions - tags: - - Functions - x-domain-hierarchy: - - Connections - - Functions - x-accepts: application/json - post: - deprecated: false - description: "Creates a Function.\n\n**Note**: In order to successfully call\ - \ this endpoint, the specified Workspace needs to have the Functions feature\ - \ enabled. Please reach out to your customer success manager for more information." - operationId: createFunction - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - settings: - - name: apiKey - label: api key - type: STRING - description: api key - required: false - sensitive: false - - name: mySecret - label: my secret key - type: STRING - description: secret key - required: false - sensitive: true - displayName: PAPI Source Function - resourceType: SOURCE - logoUrl: https://placekitten.com/200/139 - description: My source function - schema: - $ref: '#/components/schemas/CreateFunctionV1Input' - application/vnd.segment.v1beta+json: - example: - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - settings: - - name: apiKey - label: api key - type: STRING - description: api key - required: false - sensitive: false - - name: mySecret - label: my secret key - type: STRING - description: secret key - required: false - sensitive: true - displayName: PAPI Source Function - resourceType: SOURCE - logoUrl: https://placekitten.com/200/139 - description: My source function - schema: - $ref: '#/components/schemas/CreateFunctionV1Input' - application/vnd.segment.v1alpha+json: - example: - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - settings: - - name: apiKey - label: api key - type: STRING - description: api key - required: false - sensitive: false - - name: mySecret - label: my secret key - type: STRING - description: secret key - required: false - sensitive: true - displayName: PAPI Source Function - resourceType: SOURCE - logoUrl: https://placekitten.com/200/139 - description: My source function - schema: - $ref: '#/components/schemas/CreateFunctionV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/createFunction_200_response' - application/json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/createFunction_200_response' - application/vnd.segment.v1beta+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/createFunction_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/createFunction_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Function - tags: - - Functions - x-domain-hierarchy: - - Connections - - Functions - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /functions/{functionId}/deploy: - post: - deprecated: false - description: "Deploys a Function. Only applicable to Source Function instances.\n\ - \n**Note**: In order to successfully call this endpoint, the specified Workspace\ - \ needs to have the Functions feature enabled. Please reach out to your customer\ - \ success manager for more information." - operationId: createFunctionDeployment - parameters: - - explode: false - in: path - name: functionId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - functionDeployment: - status: SUCCESS - schema: - $ref: '#/components/schemas/createFunctionDeployment_200_response' - application/json: - example: - data: - functionDeployment: - status: SUCCESS - schema: - $ref: '#/components/schemas/createFunctionDeployment_200_response' - application/vnd.segment.v1beta+json: - example: - data: - functionDeployment: - status: SUCCESS - schema: - $ref: '#/components/schemas/createFunctionDeployment_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - functionDeployment: - status: SUCCESS - schema: - $ref: '#/components/schemas/createFunctionDeployment_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Function Deployment - tags: - - Functions - x-domain-hierarchy: - - Connections - - Functions - x-accepts: application/json - /invites: - delete: - deprecated: false - description: "Removes a list of invitations to join a Workspace.\n\nWhen called,\ - \ this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Invite Deleted\n* Group Memberships Deleted\n \n\n\nThe\ - \ rate limit for this endpoint is 60 requests per minute, which is lower than\ - \ the default due to access pattern restrictions. Once reached, this endpoint\ - \ will respond with the 429 HTTP status code with headers indicating the limit\ - \ parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: deleteInvites - parameters: - - description: |- - The list of emails to delete invites for. - - This parameter exists in v1. - explode: false - in: query - name: emails - required: true - schema: - description: The list of emails to delete invites for. - items: - type: string - title: emails - type: array - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteInvites_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteInvites_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteInvites_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteInvites_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Invites - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-accepts: application/json - get: - deprecated: false - description: | - Returns a list of invitations to join a Workspace. - - Config API omitted fields: - - `parent` - operationId: listInvites - parameters: - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - pagination: - current: MA== - totalEntries: 1 - invites: - - foo@example.com - schema: - $ref: '#/components/schemas/listInvites_200_response' - application/json: - example: - data: - pagination: - current: MA== - totalEntries: 1 - invites: - - foo@example.com - schema: - $ref: '#/components/schemas/listInvites_200_response' - application/vnd.segment.v1beta+json: - example: - data: - pagination: - current: MA== - totalEntries: 1 - invites: - - foo@example.com - schema: - $ref: '#/components/schemas/listInvites_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - pagination: - current: MA== - totalEntries: 0 - invites: [] - schema: - $ref: '#/components/schemas/listInvites_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Invites - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-accepts: application/json - post: - deprecated: false - description: "Invites a list of users to join a Workspace.\n\nWhen called, this\ - \ endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Non-Segment User Invited to Workspace\n* Policy Created\n* New\ - \ Segment User Invited to Workspace\n\nConfig API omitted fields:\n- `parent`\n\ - \ \n\n\nThe rate limit for this endpoint is 60 requests per minute, which\ - \ is lower than the default due to access pattern restrictions. Once reached,\ - \ this endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: createInvites - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - invites: - - email: foo@example.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/CreateInvitesV1Input' - application/vnd.segment.v1beta+json: - example: - invites: - - email: foo@example.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/CreateInvitesV1Input' - application/vnd.segment.v1alpha+json: - example: - invites: - - email: foo@example.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - schema: - $ref: '#/components/schemas/CreateInvitesV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/createInvites_200_response' - application/json: - example: - data: - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/createInvites_200_response' - application/vnd.segment.v1beta+json: - example: - data: - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/createInvites_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - emails: - - foo@example.com - schema: - $ref: '#/components/schemas/createInvites_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Invites - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /labels: - get: - deprecated: false - description: Returns a list of all available labels. - operationId: listLabels - parameters: [] - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - labels: - - key: environment - value: dev - description: "" - - key: environment - value: prod - description: "" - - key: type - value: web - description: labels source as web - schema: - $ref: '#/components/schemas/listLabels_200_response' - application/json: - example: - data: - labels: - - key: environment - value: dev - description: "" - - key: environment - value: prod - description: "" - - key: type - value: web - description: labels source as web - schema: - $ref: '#/components/schemas/listLabels_200_response' - application/vnd.segment.v1beta+json: - example: - data: - labels: - - key: environment - value: dev - description: "" - - key: environment - value: prod - description: "" - - key: type - value: web - description: labels source as web - schema: - $ref: '#/components/schemas/listLabels_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - labels: - - key: environment - value: dev - description: "" - - key: environment - value: prod - description: "" - schema: - $ref: '#/components/schemas/listLabels_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Labels - tags: - - Labels - x-domain-hierarchy: - - Admin - - Labels - x-accepts: application/json - post: - deprecated: false - description: "Creates a new label.\n\n\n\nWhen called, this endpoint may generate\ - \ the `Label Created` [Audit Trail](/tag/Audit-Trail) event.\n \n\n\n\ - The rate limit for this endpoint is 60 requests per minute, which is lower\ - \ than the default due to access pattern restrictions. Once reached, this\ - \ endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: createLabel - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - label: - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/CreateLabelV1Input' - application/vnd.segment.v1beta+json: - example: - label: - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/CreateLabelV1Input' - application/vnd.segment.v1alpha+json: - example: - label: - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/CreateLabelAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - label: - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/createLabel_200_response' - application/json: - example: - data: - label: - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/createLabel_200_response' - application/vnd.segment.v1beta+json: - example: - data: - label: - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/createLabel_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - labels: - - key: environment - value: dev - description: "" - - key: environment - value: prod - description: "" - - key: environment - value: yolo - description: an environment for courageous devs - schema: - $ref: '#/components/schemas/createLabel_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Label - tags: - - Labels - x-domain-hierarchy: - - Admin - - Labels - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /sources: - get: - deprecated: false - description: Returns a list of Sources. - operationId: listSources - parameters: - - description: |- - Defines the pagination parameters. - - This parameter exists in alpha. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - - id: rh5BDZp6QDHvXFCkibm1pR - slug: web - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - dfL8upyPumumx23SjgwHjs - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listSources_200_response' - application/json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - - id: rh5BDZp6QDHvXFCkibm1pR - slug: web - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - dfL8upyPumumx23SjgwHjs - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listSources_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - - id: rh5BDZp6QDHvXFCkibm1pR - slug: web - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - dfL8upyPumumx23SjgwHjs - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listSources_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - - id: rh5BDZp6QDHvXFCkibm1pR - slug: web - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - dfL8upyPumumx23SjgwHjs - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listSources_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Sources - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-accepts: application/json - post: - deprecated: false - description: "Creates a new Source.\n\n\n\nWhen called, this endpoint may generate\ - \ the `Source Created` [Audit Trail](/tag/Audit-Trail) event.\n " - operationId: createSource - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - slug: my-test-source-mc1fgb - enabled: true - metadataId: IqDTy1TpoU - settings: {} - schema: - $ref: '#/components/schemas/CreateSourceV1Input' - application/vnd.segment.v1beta+json: - example: - slug: my-test-source-0opjqz - enabled: true - metadataId: IqDTy1TpoU - settings: {} - schema: - $ref: '#/components/schemas/CreateSourceV1Input' - application/vnd.segment.v1alpha+json: - example: - slug: my-test-source-r-dsv2 - name: My Source - enabled: true - metadataId: IqDTy1TpoU - settings: {} - schema: - $ref: '#/components/schemas/CreateSourceAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - source: - id: b3nk6CisJ6zQVKb9KjbFjV - slug: my-test-source-mc1fgb - name: my-test-source-mc1fgb - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - IGA8Ur1riMfSQeAbHNKua70oMagjBuu8 - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/createSource_200_response' - application/json: - example: - data: - source: - id: b3nk6CisJ6zQVKb9KjbFjV - slug: my-test-source-mc1fgb - name: my-test-source-mc1fgb - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - IGA8Ur1riMfSQeAbHNKua70oMagjBuu8 - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/createSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - source: - id: rDZmA3w42mgu11iknATJPu - slug: my-test-source-0opjqz - name: my-test-source-0opjqz - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - fUFKUhoKPWKcXDIUfV7zvikbWwLbDYTL - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/createSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - source: - id: 3aJbFPLDssh5dtKjy3Drnh - slug: my-test-source-r-dsv2 - name: My Source - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - wS1qvVNUj2TaBZFR52sT5GS7jxdDSUM8 - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/createSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /regulations/sources/{sourceId}: - get: - deprecated: false - description: Lists all Source-scoped regulations. - operationId: listRegulationsFromSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - The status on which to filter returned regulations. - - This parameter exists in v1. - explode: false - in: query - name: status - required: false - schema: - description: The status on which to filter returned regulations. - enum: - - FAILED - - FINISHED - - INITIALIZED - - INVALID - - NOT_SUPPORTED - - PARTIAL_SUCCESS - - RUNNING - title: status - type: string - style: deepObject - - description: |- - The regulation types on which to filter returned regulations. - - This parameter exists in v1. - explode: false - in: query - name: regulationTypes - required: false - schema: - description: The regulation types on which to filter returned regulations. - items: - enum: - - BULK_DELETE_ONLY - - DELETE_INTERNAL - - DELETE_ONLY - - SUPPRESS_ONLY - - SUPPRESS_WITH_DELETE - - UNSUPPRESS - type: string - title: regulationTypes - type: array - style: deepObject - - description: |- - Pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listRegulationsFromSource_200_response' - application/json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listRegulationsFromSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listRegulationsFromSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listRegulationsFromSource_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Regulations from Source - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-accepts: application/json - post: - deprecated: false - description: "Creates a Source-scoped regulation.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n\nConfig API omitted fields:\n- `attributes`,\n- `userAgent`\n \ - \ " - operationId: createSourceRegulation - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: USER_ID - subjectIds: - - test_user_id_1 - sourceId: qQEHquLrjRDN9j1ByrChyn - schema: - $ref: '#/components/schemas/CreateSourceRegulationV1Input' - application/vnd.segment.v1beta+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: USER_ID - subjectIds: - - test_user_id_1 - sourceId: qQEHquLrjRDN9j1ByrChyn - schema: - $ref: '#/components/schemas/CreateSourceRegulationV1Input' - application/vnd.segment.v1alpha+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: USER_ID - subjectIds: - - test_user_id_1 - sourceId: qQEHquLrjRDN9j1ByrChyn - schema: - $ref: '#/components/schemas/CreateSourceRegulationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createSourceRegulation_200_response' - application/json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createSourceRegulation_200_response' - application/vnd.segment.v1beta+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createSourceRegulation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createSourceRegulation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Source Regulation - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /tracking-plans: - get: - deprecated: false - description: "Returns a list of Tracking Plans.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: listTrackingPlans - parameters: - - description: "Requests Tracking Plans of a certain type. If omitted, lists\ - \ all types.\n\nThis parameter exists in v1." - explode: false - in: query - name: type - required: false - schema: - description: "Requests Tracking Plans of a certain type. If omitted, lists\ - \ all types." - enum: - - LIVE - - PROPERTY_LIBRARY - - RULE_LIBRARY - - TEMPLATE - title: type - type: string - style: deepObject - - description: |- - Pagination options. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - trackingPlans: - - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listTrackingPlans_200_response' - application/json: - example: - data: - trackingPlans: - - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listTrackingPlans_200_response' - application/vnd.segment.v1beta+json: - example: - data: - trackingPlans: - - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listTrackingPlans_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - trackingPlans: - - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listTrackingPlans_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Tracking Plans - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - post: - deprecated: false - description: "Creates a Tracking Plan.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: createTrackingPlan - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - name: New TP - type: LIVE - schema: - $ref: '#/components/schemas/CreateTrackingPlanV1Input' - application/vnd.segment.v1beta+json: - example: - name: New TP - type: LIVE - schema: - $ref: '#/components/schemas/CreateTrackingPlanV1Input' - application/vnd.segment.v1alpha+json: - example: - name: New TP - type: LIVE - schema: - $ref: '#/components/schemas/CreateTrackingPlanV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createTrackingPlan_200_response' - application/json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/createTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /transformations: - get: - deprecated: false - description: "Lists all Transformations in the Workspace.\n\n**Note**: In order\ - \ to successfully call this endpoint, the specified Workspace needs to have\ - \ the Protocols feature enabled. Please reach out to your customer success\ - \ manager for more information." - operationId: listTransformations - parameters: - - description: |- - Pagination options. - - This parameter exists in beta. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1beta+json: - example: - data: - transformations: - - id: 2DrXmjwFYTgYxxJdCmvz8O0Zu7F - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: Name of the new transformation - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'Example Event Alpha' - newEventName: new-event-name - propertyRenames: - - oldName: old-name - newName: new-name - - oldName: another-name-old - newName: another-name-new - - id: c5EmPMhTGmgwoas8YCKXgs - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: Order cancelled event rename in destination - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - destinationMetadataId: 54521fd725e721e32a72eebb - if: event = 'Order Cancelled' - newEventName: order_cancelled - propertyRenames: [] - - id: ks7SJDAn4XvW4VykJSQVz7 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked event rename - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'User Clicked' - newEventName: user_clicked - propertyRenames: [] - - id: pHrD51Ds35Zjfka84yXQE6 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: updated-name - enabled: true - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event - propertyRenames: - - oldName: old-property - newName: new-property - - id: rBoBnPKiAek36M192XJsYQ - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked edit identify event - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: type = 'identify' - propertyRenames: - - oldName: Group - newName: group - pagination: - current: MA== - totalEntries: 5 - schema: - $ref: '#/components/schemas/listTransformations_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - transformations: - - id: c5EmPMhTGmgwoas8YCKXgs - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: Order cancelled event rename in destination - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - destinationMetadataId: 54521fd725e721e32a72eebb - if: event = 'Order Cancelled' - newEventName: order_cancelled - propertyRenames: [] - - id: ks7SJDAn4XvW4VykJSQVz7 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked event rename - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'User Clicked' - newEventName: user_clicked - propertyRenames: [] - - id: pHrD51Ds35Zjfka84yXQE6 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked edit track event - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'User Clicked' - propertyRenames: - - oldName: Category - newName: category - - id: rBoBnPKiAek36M192XJsYQ - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked edit identify event - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: type = 'identify' - propertyRenames: - - oldName: Group - newName: group - pagination: - current: MA== - totalEntries: 4 - schema: - $ref: '#/components/schemas/listTransformations_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Transformations - tags: - - Transformations - x-domain-hierarchy: - - Protocols - - Transformations - x-accepts: application/json - post: - deprecated: false - description: "Creates a new Transformation.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Transformation Created` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n**Note**: In order to successfully call this endpoint, the specified\ - \ Workspace needs to have the Protocols feature enabled. Please reach out\ - \ to your customer success manager for more information." - operationId: createTransformation - parameters: [] - requestBody: - content: - application/vnd.segment.v1beta+json: - example: - name: Name of the new transformation - sourceId: qQEHquLrjRDN9j1ByrChyn - enabled: true - newEventName: new-event-name - propertyRenames: - - oldName: old-name - newName: new-name - - oldName: another-name-old - newName: another-name-new - if: event = 'Example Event Beta' - schema: - $ref: '#/components/schemas/CreateTransformationBetaInput' - application/vnd.segment.v1alpha+json: - example: - name: Name of the new transformation - sourceId: qQEHquLrjRDN9j1ByrChyn - enabled: true - newEventName: new-event-name - propertyRenames: - - oldName: old-name - newName: new-name - - oldName: another-name-old - newName: another-name-new - if: event = 'Example Event Alpha' - schema: - $ref: '#/components/schemas/CreateTransformationBetaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1beta+json: - example: - data: - transformation: - id: 2DrXmmo9lVoky2aObFR0XIh23Px - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: Name of the new transformation - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'Example Event Beta' - newEventName: new-event-name - propertyRenames: - - oldName: old-name - newName: new-name - - oldName: another-name-old - newName: another-name-new - schema: - $ref: '#/components/schemas/createTransformation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - transformation: - id: 2DrXmjwFYTgYxxJdCmvz8O0Zu7F - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: Name of the new transformation - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'Example Event Alpha' - newEventName: new-event-name - propertyRenames: - - oldName: old-name - newName: new-name - - oldName: another-name-old - newName: another-name-new - schema: - $ref: '#/components/schemas/createTransformation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Transformation - tags: - - Transformations - x-domain-hierarchy: - - Protocols - - Transformations - x-content-type: application/vnd.segment.v1beta+json - x-accepts: application/json - /groups: - get: - deprecated: false - description: Returns all user groups. - operationId: listUserGroups - parameters: - - description: |- - Pagination for user groups. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - userGroups: - - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listUserGroups_200_response' - application/json: - example: - data: - userGroups: - - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listUserGroups_200_response' - application/vnd.segment.v1beta+json: - example: - data: - userGroups: - - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listUserGroups_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - userGroups: - - id: bBABwqbaDf2QdwTbW8bNEm - name: Public API Group - memberCount: 1 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listUserGroups_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List User Groups - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-accepts: application/json - post: - deprecated: false - description: "Creates a user group.\n\nWhen called, this endpoint may generate\ - \ one or more of the following [Audit Trail](/tag/Audit-Trail) events:\n*\ - \ User Group Created\n* Policy Created\n \n\n\nThe rate limit for this\ - \ endpoint is 60 requests per minute, which is lower than the default due\ - \ to access pattern restrictions. Once reached, this endpoint will respond\ - \ with the 429 HTTP status code with headers indicating the limit parameters.\ - \ See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: createUserGroup - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - name: New User Group fkHWOE-a_p - schema: - $ref: '#/components/schemas/CreateUserGroupV1Input' - application/vnd.segment.v1beta+json: - example: - name: New User Group R18j9ZA9TR - schema: - $ref: '#/components/schemas/CreateUserGroupV1Input' - application/vnd.segment.v1alpha+json: - example: - name: New User Group 8mo8ghLQxS - schema: - $ref: '#/components/schemas/CreateUserGroupV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - userGroup: - id: 2DrXpkze3NH3ySNB6tUUs1TbJbo - name: New User Group fkHWOE-a_p - memberCount: 0 - schema: - $ref: '#/components/schemas/createUserGroup_200_response' - application/json: - example: - data: - userGroup: - id: 2DrXpkze3NH3ySNB6tUUs1TbJbo - name: New User Group fkHWOE-a_p - memberCount: 0 - schema: - $ref: '#/components/schemas/createUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - userGroup: - id: 2DrXoyNnhFM85FbcRqzACdhP6t7 - name: New User Group R18j9ZA9TR - memberCount: 0 - schema: - $ref: '#/components/schemas/createUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - userGroup: - id: 2DrXo6GpGW9LpRTp1naKkZcV4bP - name: New User Group 8mo8ghLQxS - memberCount: 0 - schema: - $ref: '#/components/schemas/createUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /warehouses/validation: - post: - deprecated: false - description: "Validates input settings against a Warehouse.\n\n\n\nWhen called,\ - \ this endpoint may generate the `Storage Destination Settings Validation`\ - \ [Audit Trail](/tag/Audit-Trail) event.\n " - operationId: createValidationInWarehouse - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - metadataId: 55d3d3aea3c - settings: - hostname: address.us-west-2.redshift.amazonaws.com - port: "5439" - database: db - username: user - password: test - schema: - $ref: '#/components/schemas/CreateValidationInWarehouseV1Input' - application/vnd.segment.v1beta+json: - example: - metadataId: 55d3d3aea3c - settings: - hostname: address.us-west-2.redshift.amazonaws.com - port: "5439" - database: db - username: user - password: test - schema: - $ref: '#/components/schemas/CreateValidationInWarehouseV1Input' - application/vnd.segment.v1alpha+json: - example: - metadataId: 55d3d3aea3c - settings: - hostname: address.us-west-2.redshift.amazonaws.com - port: "5439" - database: db - username: user - password: test - schema: - $ref: '#/components/schemas/CreateValidationInWarehouseV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/createValidationInWarehouse_200_response' - application/json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/createValidationInWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/createValidationInWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: CONNECTED - schema: - $ref: '#/components/schemas/createValidationInWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Validation in Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /warehouses: - get: - deprecated: false - description: Returns a list of Warehouses. - operationId: listWarehouses - parameters: - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listWarehouses_200_response' - application/json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listWarehouses_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listWarehouses_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listWarehouses_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Warehouses - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - post: - deprecated: false - description: "Creates a new Warehouse.\n\n\n\nWhen called, this endpoint may\ - \ generate the `Storage Destination Created` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n " - operationId: createWarehouse - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - metadataId: aea3c55dsz - settings: {} - schema: - $ref: '#/components/schemas/CreateWarehouseV1Input' - application/vnd.segment.v1beta+json: - example: - metadataId: aea3c55dsz - settings: {} - schema: - $ref: '#/components/schemas/CreateWarehouseV1Input' - application/vnd.segment.v1alpha+json: - example: - metadataId: aea3c55dsz - settings: {} - schema: - $ref: '#/components/schemas/CreateWarehouseV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehouse: - id: 6o4HsR4fzmfczk6gQ616B - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - name: Redshift_2 - schema: - $ref: '#/components/schemas/createWarehouse_200_response' - application/json: - example: - data: - warehouse: - id: 6o4HsR4fzmfczk6gQ616B - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - name: Redshift_2 - schema: - $ref: '#/components/schemas/createWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehouse: - id: ekNpN2fHBmJ16nUfsn3B5H - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - name: Redshift_2 - schema: - $ref: '#/components/schemas/createWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehouse: - id: rjZRNacj6LHGbW5pYGePhK - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - name: Redshift_2 - schema: - $ref: '#/components/schemas/createWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /regulations: - get: - deprecated: false - description: Lists all Workspace-scoped regulations. - operationId: listWorkspaceRegulations - parameters: - - description: |- - The status on which to filter the returned regulations. - - This parameter exists in v1. - explode: false - in: query - name: status - required: false - schema: - description: The status on which to filter the returned regulations. - enum: - - FAILED - - FINISHED - - INITIALIZED - - INVALID - - NOT_SUPPORTED - - PARTIAL_SUCCESS - - RUNNING - title: status - type: string - style: deepObject - - description: |- - The regulation types on which to filter returned regulations. - - This parameter exists in v1. - explode: false - in: query - name: regulationTypes - required: false - schema: - description: The regulation types on which to filter returned regulations. - items: - enum: - - BULK_DELETE_ONLY - - DELETE_INTERNAL - - DELETE_ONLY - - SUPPRESS_ONLY - - SUPPRESS_WITH_DELETE - - UNSUPPRESS - type: string - title: regulationTypes - type: array - style: deepObject - - description: |- - Pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - application/json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - application/vnd.segment.v1beta+json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - regulations: - - id: 1qJkfE1tpwvQcklImGksLN629wn - subjectType: OBJECT_ID - subjects: - - test_user_id_1 - status: FINISHED - createdAt: 2022-03-08T00:39:36.546951Z - pagination: - current: MQ== - schema: - $ref: '#/components/schemas/listWorkspaceRegulations_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Workspace Regulations - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-accepts: application/json - post: - deprecated: false - description: "Creates a Workspace-scoped regulation.\n\n\n\nWhen called, this\ - \ endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n\nConfig API omitted fields:\n- `attributes`,\n- `userAgent`\n \ - \ " - operationId: createWorkspaceRegulation - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: USER_ID - subjectIds: - - test_user_id_1 - schema: - $ref: '#/components/schemas/CreateWorkspaceRegulationV1Input' - application/vnd.segment.v1beta+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: USER_ID - subjectIds: - - test_user_id_1 - schema: - $ref: '#/components/schemas/CreateWorkspaceRegulationV1Input' - application/vnd.segment.v1alpha+json: - example: - regulationType: SUPPRESS_ONLY - subjectType: USER_ID - subjectIds: - - test_user_id_1 - schema: - $ref: '#/components/schemas/CreateWorkspaceRegulationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - application/json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - application/vnd.segment.v1beta+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - regulateId: 1qJkfE1tpwvQcklImGksLN629wn - schema: - $ref: '#/components/schemas/createWorkspaceRegulation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Create Workspace Regulation - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /destinations/{destinationId}: - delete: - deprecated: false - description: "Deletes an existing Destination.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event.\n\ - \nConfig API omitted fields:\n- `catalogId`\n " - operationId: deleteDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteDestination_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - get: - deprecated: false - description: | - Returns a Destination by its id. - - Config API omitted fields: - - `catalogId` - operationId: getDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/getDestination_200_response' - application/json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/getDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/getDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: true - name: "" - settings: - mobileTrackingId: "123" - serversideTrackingId: "123" - trackingId: "123" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/getDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - patch: - deprecated: false - description: "Updates an existing Destination.\n\n**Note**: if you attempt to\ - \ update read-only settings for your destination you'll encounter the following\ - \ behavior:\n\n * If only read-only properties are being updated, the endpoint\ - \ will return an HTTP 400 error.\n * If there's a mix of writable and read-only\ - \ properties in the payload, the request will be accepted, the writable properties\ - \ will be updated and the read-only properties ignored.\n\n\n\n\nWhen called,\ - \ this endpoint may generate the `Integration Disabled` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n\nConfig API omitted fields:\n- `updateMask`\n " - operationId: updateDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - destinationId: fP7qoQw2HTWt9WdMr718gn - enabled: false - schema: - $ref: '#/components/schemas/UpdateDestinationV1Input' - application/vnd.segment.v1beta+json: - example: - destinationId: fP7qoQw2HTWt9WdMr718gn - enabled: false - schema: - $ref: '#/components/schemas/UpdateDestinationV1Input' - application/vnd.segment.v1alpha+json: - example: - destinationId: fP7qoQw2HTWt9WdMr718gn - enabled: false - schema: - $ref: '#/components/schemas/UpdateDestinationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateDestination_200_response' - application/json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destination: - id: fP7qoQw2HTWt9WdMr718gn - enabled: false - name: "" - settings: - anonymizeIp: false - classic: false - contentGroupings: {} - dimensions: {} - domain: "" - doubleClick: false - enableServerIdentify: false - enhancedEcommerce: false - enhancedLinkAttribution: false - identifyCategory: "" - identifyEventName: "" - ignoredReferrers: [] - includeSearch: false - metrics: {} - mobileTrackingId: "123" - nameTracker: false - nonInteraction: false - optimize: "" - preferAnonymousId: false - protocolMappings: {} - reportUncaughtExceptions: false - resetCustomDimensionsOnPage: [] - sampleRate: 100 - sendUserId: false - serversideClassic: false - serversideTrackingId: "123" - setAllMappedProps: true - siteSpeedSampleRate: 1 - topLevelContextMapping: false - trackCategorizedPages: true - trackNamedPages: true - trackingId: "123" - typeOverride: false - useGoogleAmpClientId: false - userDeletion: "" - metadata: - id: 54521fd725e721e32a72eebb - name: Google Universal Analytics - description: Google Universal Analytics is the most popular - analytics tool for the web. It’s free and provides a wide - range of features. It’s especially good at measuring traffic - sources and ad campaigns. - slug: google-analytics - logos: - default: https://cdn.filepicker.io/api/file/anFgceQJTGeMxChCgiyU - mark: https://cdn.filepicker.io/api/file/zebLRcY3RtOlynDXTgNk - options: - - name: anonymizeIp - type: boolean - defaultValue: false - description: "For client side libraries. Read more about anonymizing\ - \ IP addresses from the [Google support documentation](https://support.google.com/analytics/answer/2763052?hl=en)." - required: false - label: Anonymize IP Addresses - - name: classic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier ones are Classic. An easy test: if you see\ - \ `_gaq.push` in your code you're using Classic, so enable\ - \ this." - required: false - label: Use Classic Analytics on Your Site - - name: contentGroupings - type: map - defaultValue: {} - description: "Enter a property name on the left. Choose the\ - \ Google Analytics content grouping you want on the right.\ - \ Google Analytics only accepts numbered content groupings\ - \ (e.g. contentGrouping3). When you use `analytics.page(name,\ - \ properties)` with custom properties, we'll use the value\ - \ of the property you designate as the value of the specified\ - \ content grouping." - required: false - label: Content Groupings - - name: dimensions - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom traits or `analytics.track('event',\ - \ properties)` with custom properties, you need to map those\ - \ traits and properties to Google Analytics custom dimensions\ - \ if you want them to be sent to GA. Enter a trait or property\ - \ name on the left. Choose the Google Analytics dimension\ - \ you want on the right. Google Analytics only accepts numbered\ - \ dimensions (e.g. dimension3). We suggest using user-scoped\ - \ dimensions for trait mappings and hit-scoped dimensions\ - \ for properties [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Dimensions - - name: domain - type: string - defaultValue: "" - description: "_Only data sent from visitors on this domain_\ - \ will be recorded. By default Google Analytics automatically\ - \ resolves the domain name, so you should **leave this blank\ - \ unless you know you want otherwise**! This option is useful\ - \ if you need to ignore data from other domains, or explicitly\ - \ set the domain of your Google Analytics cookie. This is\ - \ known as Override Domain Name in [GA Classic](https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite).\ - \ If you are testing locally, you can set the domain to\ - \ `none`. [Read more about this setting in our docs](https://segment.com/docs/connections/destinations/catalog/google-analytics/#cookie-domain-name)." - required: false - label: Cookie Domain Name - - name: doubleClick - type: boolean - defaultValue: false - description: Works with both Universal and Classic tracking - methods. - required: false - label: "Remarketing, Display Ads and Demographic Reports." - - name: enableServerIdentify - type: boolean - defaultValue: false - description: "If you are sending `.identify()` calls from\ - \ your server side libraries or have Segment Cloud Apps\ - \ that send back `.identify()` calls with enriched user\ - \ traits, you can send that data to your GA account via\ - \ custom dimensions and metrics. Unlike the client side\ - \ integration which has the luxury of browsers and the global\ - \ window `ga` tracker, for server side we will check your\ - \ `traits` and your settings for custom dimension/metric\ - \ mappings and send it with an explicit event. " - required: false - label: Enable Server Side Identify - - name: enhancedEcommerce - type: boolean - defaultValue: false - description: "If you want more detailed reports on ecommerce,\ - \ you might want to enable this feature. Read more about\ - \ it [here](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce)." - required: false - label: Enable Enhanced Ecommerce - - name: enhancedLinkAttribution - type: boolean - defaultValue: false - description: "Provides more detailed reports on the links\ - \ clicked on your site. Read more about it in the [Google\ - \ support documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-link-attribution)." - required: false - label: Enable Enhanced Link Attribution - - name: identifyCategory - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify the trait you want to look up for setting\ - \ the event category will be since all custom metrics/dimensions\ - \ for server side `.identify()` calls will be sent via an\ - \ event hit to GA. The default value will be `'All'`. For\ - \ example, if you are sending `traits.category`, you can\ - \ put 'category' in the setting above and we will send the\ - \ value of this trait as the event category." - required: false - label: Server Side Identify Event Category - - name: identifyEventName - type: string - defaultValue: "" - description: "If you have **Enabled Server Side Identify**,\ - \ you can specify what the event action will be since all\ - \ custom metrics/dimensions for server side `.identify()`\ - \ calls will be sent via an event hit to GA. The default\ - \ value will be `'User Enriched'`" - required: false - label: Server Side Identify Event Action - - name: ignoredReferrers - type: strings - defaultValue: [] - description: "Add any domains you want to ignore, separated\ - \ by line breaks. You might use this if you want Google\ - \ Analytics to ignore certain referral domains (e.g. to\ - \ prevent your subdomains from showing up as referrers in\ - \ your analytics). _Note: this only works for Classic profiles.\ - \ Universal profiles can_ [edit their ignored referrers](https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009)\ - \ _directly inside Google Analytics._" - required: false - label: Ignored Referrers - - name: includeSearch - type: boolean - defaultValue: false - description: "The querystring doesn't usually affect the content\ - \ of the page in a significant way (like sorting), so we\ - \ disable this by default." - required: false - label: Include the Querystring in Page Views - - name: metrics - type: map - defaultValue: {} - description: "Because Google Analytics cannot accept arbitrary\ - \ data about users or events, when you use `analytics.identify(userId,\ - \ traits)` with custom numerical traits or `analytics.track('event',\ - \ properties)` with custom numerical properties, you need\ - \ to map those traits and properties to Google Analytics\ - \ custom metrics if you want them to be sent to GA. Enter\ - \ a trait or property name on the left. Choose the Google\ - \ Analytics metric you want on the right. Google Analytics\ - \ only accepts numbered metrics (e.g. metric3). We suggest\ - \ using user-scoped metrics for trait mappings and hit-scoped\ - \ metrics for properties. [Contact us](https://segment.com/contact)\ - \ if you need help!" - required: false - label: Custom Metrics - - name: mobileTrackingId - type: string - defaultValue: "" - description: "Google Analytics tracks mobile apps separately,\ - \ so you'll want to create a separate Google Analytics mobile\ - \ app property. Remember to only add a mobile tracking ID\ - \ if you're tracking from a mobile library. If you're tracking\ - \ from a hybrid app, fill in your website tracking ID instead.\ - \ Leave it blank if you don't have a mobile app property." - required: true - label: Mobile Tracking ID - - name: nameTracker - type: boolean - defaultValue: false - description: "Name the tracker 'segmentGATracker'. Enable\ - \ this if you're working with additional Google Analytics\ - \ trackers and want to ensure that your Segment tracker\ - \ has a distinct name. If this is enabled you must prepend\ - \ this tracker name to any native Google Analytics (except\ - \ for create) that you call, e.g. 'segmentGATracker.require(....)' " - required: false - label: Name Tracker - - name: nonInteraction - type: boolean - defaultValue: false - description: "Adds a _nonInteraction: true_ flag to every\ - \ non-enhanced ecommerce event tracked to Google Analytics.\ - \ If you're seeing unusually low bounce rates this will\ - \ solve that issue." - required: false - label: Add the non-interaction flag to all events - - name: optimize - type: string - defaultValue: "" - description: Integrate with Google Analytics Optimize plugin. - Please enter your Optimize Container ID - required: false - label: Optimize Container ID - - name: preferAnonymousId - type: boolean - defaultValue: false - description: Enable this setting if you want `clientId` to - always be set as a hash of `anonymousId`. If no `anonymousId` - is present we will fallback to set the `clientId` to `userId`. - This setting only applies to server side connections. - required: false - label: Prefer Anonymous ID for Client ID - Server Side Only - - name: protocolMappings - type: map - defaultValue: {} - description: "If you are using the *server side* GA integration,\ - \ you can map your custom traits or properties to known\ - \ [measurement protocol params](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)." - required: false - label: Map Traits or Properties to Measurement Protocol Params - - name: reportUncaughtExceptions - type: boolean - defaultValue: false - description: This lets you study errors and exceptions in - your iOS and Android apps in Google Analytics. - required: false - label: Send Uncaught Exceptions to GA (Mobile) - - name: resetCustomDimensionsOnPage - type: array - defaultValue: [] - description: "If you have an SPA website, and need to reset\ - \ custom dimensions between page calls, add to this setting\ - \ all the properties (already mapped as custom dimensions)\ - \ that need to be reset for each page call." - required: false - label: Reset dimensions on Page calls - - name: sampleRate - type: number - defaultValue: 100 - description: "Specifies what percentage of users should be\ - \ tracked. This defaults to 100 (no users are sampled out)\ - \ but large sites may need to use a lower sample rate to\ - \ stay within Google Analytics processing limits as [seen\ - \ here](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate).\ - \ Currently only available in the browser - mobile coming\ - \ soon." - required: false - label: Sample Rate - - name: sendUserId - type: boolean - defaultValue: false - description: "User-ID enables the analysis of groups of sessions\ - \ across devices, using a unique and persistent ID. This\ - \ only works with Google Analytics Universal. IMPORTANT:\ - \ Sending email or other personally identifiable information\ - \ (PII) violates Google Analytics Terms of Service." - required: false - label: Send User-ID to GA - - name: serversideClassic - type: boolean - defaultValue: false - description: "**Important:** When creating your Google Analytics\ - \ profile, you can choose between **Classic** and **Universal**\ - \ Analytics. After March 2013, new profiles default to Universal,\ - \ while earlier profiles are Classic. An easy test: if you\ - \ see `_gaq.push` in your code you're using Classic, so\ - \ enable this." - required: false - label: Use Classic Analytics for Your Serverside Tracking - - name: serversideTrackingId - type: string - defaultValue: "" - description: "Your Serverside Tracking ID is the UA code for\ - \ the Google Analytics property you want to send server-side\ - \ calls to. Leave it blank if you don't have a server-side\ - \ client library that you want to send data from. Remember\ - \ that data tracked from mobile integrations that are not\ - \ bundled in your app send data to Google Analytics server\ - \ side, since Segment sends data to them via our own servers." - required: true - label: Serverside Tracking ID - - name: setAllMappedProps - type: boolean - defaultValue: true - description: "Google Analytics allows users to either pass\ - \ custom dimensions / metrics as properties of specific\ - \ events or as properties for all events on a given page\ - \ (or the lifetime of the global tracker object). The default\ - \ Segment behavior is the latter. Any metrics / dimensions\ - \ that are mapped to a given property will be set to the\ - \ page and sent as properties of all subsequent events on\ - \ that page. You can disable this functionality with this\ - \ setting. If disabled, Segment will only pass custom dimensions\ - \ / metrics as part of the payload of the event with which\ - \ they are explicitly associated. Please reference the Google\ - \ Analytics [documentation](https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#implementation)\ - \ for more info." - required: false - label: Set Custom Dimensions & Metrics to the Page - - name: siteSpeedSampleRate - type: number - defaultValue: 1 - description: "Defines the sample size for Site Speed data\ - \ collection. If you have a small number of visitors you\ - \ might want to adjust the sampling to a larger rate for\ - \ your [site speed stats](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration?hl=en#_gat.GA_Tracker_._setSiteSpeedSampleRate)." - required: false - label: Site Speed Sample Rate - - name: topLevelContextMapping - type: boolean - defaultValue: false - description: "By default, Segment allows mappings from custom\ - \ traits and properties to Google Analytics custom dimensions\ - \ and metrics. If you enable this setting, Segment will\ - \ also send top-level and `context` object fields mapped\ - \ in the **Custom Dimensions** and **Custom Metrics** settings.\ - \ When evaluating mappings, Segment will prioritize properties\ - \ and traits before top-level and `context` fields. This\ - \ setting only applies to server side connections." - required: false - label: Enable Mappings from Top-Level or Context Fields - - Server Side Only - - name: trackCategorizedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `category` associated with them. E.g.\ - \ `page('Docs', 'Index')` translates to **Viewed Docs Page**." - required: false - label: Track Categorized Pages - - name: trackNamedPages - type: boolean - defaultValue: true - description: "Tracks events to Google Analytics for [`page`\ - \ method](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#page)\ - \ calls that have a `name` associated with them. E.g. `page('Signup')`\ - \ translates to **Viewed Signup Page**." - required: false - label: Track Named Pages - - name: trackingId - type: string - defaultValue: "" - description: "Your website's Tracking ID is in the **Tracking\ - \ Info** tab on the [Admin Page](https://www.google.com/analytics/web/#management/Property)\ - \ of Google Analytics. Leave it blank if you don't have\ - \ a website property." - required: true - label: Website Tracking ID - - name: typeOverride - type: boolean - defaultValue: false - description: "By default, Segment sends \"Product List Viewed\"\ - \ and \"Product List Filtered\" ecommerce events to GA as\ - \ \"pageview\" hit types. Enable this setting to instead\ - \ map these two specced Segment track events to GA as \"\ - event\" hit types." - required: false - label: Send Segment "Product List" Events to GA as "Event" - Hits - - name: useGoogleAmpClientId - type: boolean - defaultValue: false - description: "Google’s AMP Client ID API lets you uniquely\ - \ identify users who engage with your content on AMP and\ - \ non-AMP pages. If you opt-in, Google Analytics will use\ - \ the user's AMP Client ID to determine that multiple site\ - \ events belong to the same user when those users visit\ - \ AMP pages via a [Google viewer](https://support.google.com/websearch/answer/7220196).\ - \ Associating events and users provides features like user\ - \ counts and session-based metrics. *Enabling this feature\ - \ will affect your reporting.* Please carefully reference\ - \ Google's [documentation](https://support.google.com/analytics/answer/7486764?hl=en&ref_topic=7378717)\ - \ for more info before you enable it." - required: false - label: Use Google AMP Client ID - - name: userDeletion - type: string - defaultValue: "" - description: 'Sign in to Google Analytics oAuth to enable - User Deletion. ' - required: false - label: User Deletion - status: PUBLIC - categories: - - Analytics - website: http://google.com/analytics - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-google-analytics - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-google-analytics - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/google-analytics - owner: SEGMENT - type: SERVER - previousNames: - - Google Analytics - - Google Universal Analytics - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - sourceId: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /functions/{functionId}: - delete: - deprecated: false - description: "Deletes a Function.\n\n**Note**: In order to successfully call\ - \ this endpoint, the specified Workspace needs to have the Functions feature\ - \ enabled. Please reach out to your customer success manager for more information." - operationId: deleteFunction - parameters: - - explode: false - in: path - name: functionId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteFunction_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteFunction_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteFunction_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteFunction_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Function - tags: - - Functions - x-domain-hierarchy: - - Connections - - Functions - x-accepts: application/json - get: - deprecated: false - description: "Gets a Function.\n\n**Note**: In order to successfully call this\ - \ endpoint, the specified Workspace needs to have the Functions feature enabled.\ - \ Please reach out to your customer success manager for more information." - operationId: getFunction - parameters: - - explode: false - in: path - name: functionId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/getFunction_200_response' - application/json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/getFunction_200_response' - application/vnd.segment.v1beta+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/getFunction_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/getFunction_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Function - tags: - - Functions - x-domain-hierarchy: - - Connections - - Functions - x-accepts: application/json - patch: - deprecated: false - description: "Updates a Function.\n\n**Note**: In order to successfully call\ - \ this endpoint, the specified Workspace needs to have the Functions feature\ - \ enabled. Please reach out to your customer success manager for more information.\n\ - \nConfig API omitted fields:\n- `updateMask`\n" - operationId: updateFunction - parameters: - - explode: false - in: path - name: functionId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - functionId: sfnc_wXzcDGFR3KmjLDrtSawNHf - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - logoUrl: https://placekitten.com/200/139 - schema: - $ref: '#/components/schemas/UpdateFunctionV1Input' - application/vnd.segment.v1beta+json: - example: - functionId: sfnc_wXzcDGFR3KmjLDrtSawNHf - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - logoUrl: https://placekitten.com/200/139 - schema: - $ref: '#/components/schemas/UpdateFunctionV1Input' - application/vnd.segment.v1alpha+json: - example: - functionId: sfnc_wXzcDGFR3KmjLDrtSawNHf - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - logoUrl: https://placekitten.com/200/139 - schema: - $ref: '#/components/schemas/UpdateFunctionV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/updateFunction_200_response' - application/json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/updateFunction_200_response' - application/vnd.segment.v1beta+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/updateFunction_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - function: - id: sfnc_wXzcDGFR3KmjLDrtSawNHf - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - displayName: PAPI Source Function - description: My source function - logoUrl: https://placekitten.com/200/139 - code: // Learn more about source functions API at https://segment.com/docs/connections/sources/source-functions - createdAt: 2006-01-02T15:04:05.000Z - createdBy: sgJDWk3K21k6LE3tLU9nRK - previewWebhookUrl: "" - settings: - - name: apiKey - label: api key - description: api key - type: STRING - required: false - sensitive: false - - name: mySecret - label: my secret key - description: secret key - type: STRING - required: false - sensitive: true - buildpack: "" - catalogId: wXzcDGFR3KmjLDrtSawNHf - batchMaxCount: 0 - resourceType: SOURCE - schema: - $ref: '#/components/schemas/updateFunction_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Function - tags: - - Functions - x-domain-hierarchy: - - Connections - - Functions - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /labels/{key}/{value}: - delete: - deprecated: false - description: "Deletes a label.\n\n\n\nWhen called, this endpoint may generate\ - \ the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event.\n \n\n\n\ - The rate limit for this endpoint is 60 requests per minute, which is lower\ - \ than the default due to access pattern restrictions. Once reached, this\ - \ endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: deleteLabel - parameters: - - explode: false - in: path - name: key - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: value - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteLabel_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteLabel_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteLabel_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteLabel_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Label - tags: - - Labels - x-domain-hierarchy: - - Admin - - Labels - x-accepts: application/json - /regulations/{regulateId}: - delete: - deprecated: false - description: "Deletes a regulation from the Workspace. The regulation must be\ - \ in the initialized state to be deleted.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event.\n\ - \ " - operationId: deleteRegulation - parameters: - - explode: false - in: path - name: regulateId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteRegulation_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteRegulation_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteRegulation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteRegulation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Regulation - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-accepts: application/json - get: - deprecated: false - description: "Gets a regulation from the Workspace.\n\n Config API omitted\ - \ fields:\n- `parent`\n " - operationId: getRegulation - parameters: - - explode: false - in: path - name: regulateId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - regulation: - id: 1qJkfE1tpwvQcklImGksLN629wn - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - overallStatus: FINISHED - finishedAt: 2022-03-08T00:39:36.546951Z - createdAt: 2022-03-08T00:39:36.546951Z - streamStatus: [] - schema: - $ref: '#/components/schemas/getRegulation_200_response' - application/json: - example: - data: - regulation: - id: 1qJkfE1tpwvQcklImGksLN629wn - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - overallStatus: FINISHED - finishedAt: 2022-03-08T00:39:36.546951Z - createdAt: 2022-03-08T00:39:36.546951Z - streamStatus: [] - schema: - $ref: '#/components/schemas/getRegulation_200_response' - application/vnd.segment.v1beta+json: - example: - data: - regulation: - id: 1qJkfE1tpwvQcklImGksLN629wn - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - overallStatus: FINISHED - finishedAt: 2022-03-08T00:39:36.546951Z - createdAt: 2022-03-08T00:39:36.546951Z - streamStatus: [] - schema: - $ref: '#/components/schemas/getRegulation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - regulation: - id: 1qJkfE1tpwvQcklImGksLN629wn - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - overallStatus: FINISHED - finishedAt: 2022-03-08T00:39:36.546951Z - createdAt: 2022-03-08T00:39:36.546951Z - streamStatus: [] - schema: - $ref: '#/components/schemas/getRegulation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Regulation - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-accepts: application/json - /sources/{sourceId}: - delete: - deprecated: false - description: "Deletes an existing Source.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Source Deleted` [Audit Trail](/tag/Audit-Trail) event.\n\ - \ " - operationId: deleteSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteSource_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-accepts: application/json - get: - deprecated: false - description: Returns a Source by its id. - operationId: getSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - source: - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/getSource_200_response' - application/json: - example: - data: - source: - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/getSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - source: - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/getSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - source: - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/getSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-accepts: application/json - patch: - deprecated: false - description: "Updates an existing Source.\n\nWhen called, this endpoint may\ - \ generate one or more of the following [Audit Trail](/tag/Audit-Trail) events:\n\ - * Source Modified\n* Source Enabled\n* Source Settings Modified\n* Source\ - \ Disabled\n\nConfig API omitted fields:\n- `updateMask`\n" - operationId: updateSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - sourceId: 3uCNQopSsSnXeAHAwYKZqF - name: My updated source - enabled: false - schema: - $ref: '#/components/schemas/UpdateSourceV1Input' - application/vnd.segment.v1beta+json: - example: - sourceId: kgPS3ESM35Ez5UQ7nvfJbC - name: My updated source - enabled: false - schema: - $ref: '#/components/schemas/UpdateSourceV1Input' - application/vnd.segment.v1alpha+json: - example: - sourceId: piTVHEYNrRgBMM1uQGCPbK - name: My updated source - enabled: false - schema: - $ref: '#/components/schemas/UpdateSourceAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - source: - id: 3uCNQopSsSnXeAHAwYKZqF - slug: update-source-slug-a-yoz5 - name: My updated source - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: false - writeKeys: - - 4czIPB0pGAv89HEJZDYUa5XomDi5dj4E - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/updateSource_200_response' - application/json: - example: - data: - source: - id: 3uCNQopSsSnXeAHAwYKZqF - slug: update-source-slug-a-yoz5 - name: My updated source - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: false - writeKeys: - - 4czIPB0pGAv89HEJZDYUa5XomDi5dj4E - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/updateSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - source: - id: kgPS3ESM35Ez5UQ7nvfJbC - slug: update-source-slug-wb_c2h - name: My updated source - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: false - writeKeys: - - HqFwQdNCYOAsLPE8FQEgBo6RwHALu7lj - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/updateSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - source: - id: piTVHEYNrRgBMM1uQGCPbK - slug: update-source-slug-gqd2dx - name: My updated source - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: false - writeKeys: - - VkV0fu40bXSSNJtqnQEzonkzLOWj2llN - metadata: - id: IqDTy1TpoU - slug: javascript - name: Javascript - categories: - - Website - description: "This is our most flexible and powerful tracking\ - \ system, using analytics.js. Track and analyze information\ - \ about your visitors and customers, and every action that\ - \ they take, in any of our 140 integrations, business intelligence\ - \ tools, or directly with SQL tools." - logos: - default: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - alt: https://cdn.filepicker.io/api/file/aRgo4XJQZausZxD4gZQq - mark: https://cdn.filepicker.io/api/file/kBpmEoSSaakidAvoFmzd - options: [] - isCloudEventSource: false - settings: {} - labels: [] - schema: - $ref: '#/components/schemas/updateSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /tracking-plans/{trackingPlanId}: - delete: - deprecated: false - description: "Deletes a Tracking Plan.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: deleteTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - get: - deprecated: false - description: "Returns a Tracking Plan.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: getTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getTrackingPlan_200_response' - application/json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - trackingPlan: - id: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: New TP - resourceSchemaId: rs_1yVwS3zy60dONy9UhCyDqMmVvAE - slug: "" - description: "" - type: LIVE - updatedAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - patch: - deprecated: false - description: "Updates a Tracking Plan.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information.\n\nConfig API omitted fields:\n- `updateMask`\n " - operationId: updateTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: Updated TP - schema: - $ref: '#/components/schemas/UpdateTrackingPlanV1Input' - application/vnd.segment.v1beta+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: Updated TP - schema: - $ref: '#/components/schemas/UpdateTrackingPlanV1Input' - application/vnd.segment.v1alpha+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - name: Updated TP - schema: - $ref: '#/components/schemas/UpdateTrackingPlanV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /transformations/{transformationId}: - delete: - deprecated: false - description: "Deletes a Transformation.\n\n\n\nWhen called, this endpoint may\ - \ generate the `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event.\n\ - **Note**: In order to successfully call this endpoint, the specified Workspace\ - \ needs to have the Protocols feature enabled. Please reach out to your customer\ - \ success manager for more information." - operationId: deleteTransformation - parameters: - - explode: false - in: path - name: transformationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteTransformation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteTransformation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Transformation - tags: - - Transformations - x-domain-hierarchy: - - Protocols - - Transformations - x-accepts: application/json - get: - deprecated: false - description: "Gets a Transformation.\n\n**Note**: In order to successfully call\ - \ this endpoint, the specified Workspace needs to have the Protocols feature\ - \ enabled. Please reach out to your customer success manager for more information." - operationId: getTransformation - parameters: - - explode: false - in: path - name: transformationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1beta+json: - example: - data: - transformation: - id: pHrD51Ds35Zjfka84yXQE6 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: updated-name - enabled: true - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event - propertyRenames: - - oldName: old-property - newName: new-property - schema: - $ref: '#/components/schemas/getTransformation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - transformation: - id: pHrD51Ds35Zjfka84yXQE6 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: User clicked edit track event - enabled: true - sourceId: qQEHquLrjRDN9j1ByrChyn - if: event = 'User Clicked' - propertyRenames: - - oldName: Category - newName: category - schema: - $ref: '#/components/schemas/getTransformation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Transformation - tags: - - Transformations - x-domain-hierarchy: - - Protocols - - Transformations - x-accepts: application/json - patch: - deprecated: false - description: "Updates an existing Transformation.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n**Note**: In order to successfully call this endpoint, the specified\ - \ Workspace needs to have the Protocols feature enabled. Please reach out\ - \ to your customer success manager for more information." - operationId: updateTransformation - parameters: - - explode: false - in: path - name: transformationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1beta+json: - example: - transformationId: pHrD51Ds35Zjfka84yXQE6 - name: updated-name - sourceId: rh5BDZp6QDHvXFCkibm1pR - enabled: true - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event - propertyRenames: - - newName: new-property - oldName: old-property - schema: - $ref: '#/components/schemas/UpdateTransformationBetaInput' - application/vnd.segment.v1alpha+json: - example: - transformationId: pHrD51Ds35Zjfka84yXQE6 - name: updated-name - sourceId: rh5BDZp6QDHvXFCkibm1pR - enabled: true - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event - propertyRenames: - - newName: new-property - oldName: old-property - schema: - $ref: '#/components/schemas/UpdateTransformationBetaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1beta+json: - example: - data: - transformation: - id: pHrD51Ds35Zjfka84yXQE6 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: updated-name - enabled: true - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event - propertyRenames: - - oldName: old-property - newName: new-property - schema: - $ref: '#/components/schemas/updateTransformation_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - transformation: - id: pHrD51Ds35Zjfka84yXQE6 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - name: updated-name - enabled: true - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 547610a5db31d978f14a5c4e - if: event="my-event" - newEventName: my-updated-event - propertyRenames: - - oldName: old-property - newName: new-property - schema: - $ref: '#/components/schemas/updateTransformation_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Transformation - tags: - - Transformations - x-domain-hierarchy: - - Protocols - - Transformations - x-content-type: application/vnd.segment.v1beta+json - x-accepts: application/json - /groups/{userGroupId}: - delete: - deprecated: false - description: "Removes a user group from a Workspace.\n\n\n\nWhen called, this\ - \ endpoint may generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n \n\n\nThe rate limit for this endpoint is 60 requests per\ - \ minute, which is lower than the default due to access pattern restrictions.\ - \ Once reached, this endpoint will respond with the 429 HTTP status code with\ - \ headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: deleteUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUserGroup_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-accepts: application/json - get: - deprecated: false - description: Returns a user group. - operationId: getUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUserGroup_200_response' - application/json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: Public API Group - memberCount: 1 - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-accepts: application/json - patch: - deprecated: false - description: "Updates a user group for a Workspace.\n\n\n\nWhen called, this\ - \ endpoint may generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n \n\n\nThe rate limit for this endpoint is 60 requests per\ - \ minute, which is lower than the default due to access pattern restrictions.\ - \ Once reached, this endpoint will respond with the 429 HTTP status code with\ - \ headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: updateUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - schema: - $ref: '#/components/schemas/UpdateUserGroupV1Input' - application/vnd.segment.v1beta+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - schema: - $ref: '#/components/schemas/UpdateUserGroupV1Input' - application/vnd.segment.v1alpha+json: - example: - userGroupId: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - schema: - $ref: '#/components/schemas/UpdateUserGroupV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - schema: - $ref: '#/components/schemas/updateUserGroup_200_response' - application/json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - schema: - $ref: '#/components/schemas/updateUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 0 - schema: - $ref: '#/components/schemas/updateUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/updateUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /users: - delete: - deprecated: false - description: "Removes one or multiple users.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n \n\n\nThe rate limit for this endpoint is 60 requests per\ - \ minute, which is lower than the default due to access pattern restrictions.\ - \ Once reached, this endpoint will respond with the 429 HTTP status code with\ - \ headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: deleteUsers - parameters: - - description: |- - The ids of the users to remove. - - This parameter exists in v1. - explode: false - in: query - name: userIds - required: true - schema: - description: The ids of the users to remove. - items: - type: string - title: userIds - type: array - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUsers_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUsers_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUsers_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteUsers_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Users - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-accepts: application/json - get: - deprecated: false - description: Returns a list of users with access to the Workspace. - operationId: listUsers - parameters: - - description: |- - Pagination for users. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - users: - - id: i2VTJURQprNfqdwjLFPWYx - name: Sloth - email: sloth@segment.com - - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listUsers_200_response' - application/json: - example: - data: - users: - - id: i2VTJURQprNfqdwjLFPWYx - name: Sloth - email: sloth@segment.com - - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listUsers_200_response' - application/vnd.segment.v1beta+json: - example: - data: - users: - - id: i2VTJURQprNfqdwjLFPWYx - name: Sloth - email: sloth@segment.com - - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listUsers_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - users: - - id: i2VTJURQprNfqdwjLFPWYx - name: Sloth - email: sloth@segment.com - - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listUsers_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Users - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-accepts: application/json - /warehouses/{warehouseId}: - delete: - deprecated: false - description: "Deletes an existing Warehouse.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n " - operationId: deleteWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteWarehouse_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/deleteWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Delete Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - get: - deprecated: false - description: Returns a Warehouse by its id. - operationId: getWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - schema: - $ref: '#/components/schemas/getWarehouse_200_response' - application/json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - schema: - $ref: '#/components/schemas/getWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - schema: - $ref: '#/components/schemas/getWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - schema: - $ref: '#/components/schemas/getWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - patch: - deprecated: false - description: "Updates an existing Warehouse.\n\nWhen called, this endpoint may\ - \ generate one or more of the following [Audit Trail](/tag/Audit-Trail) events:\n\ - * Storage Destination Modified\n* Storage Destination Enabled\n " - operationId: updateWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - name: Redshift Dev - settings: - host: aws.redshift.dev - schema: - $ref: '#/components/schemas/UpdateWarehouseV1Input' - application/vnd.segment.v1beta+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - name: Redshift Dev - settings: - host: aws.redshift.dev - schema: - $ref: '#/components/schemas/UpdateWarehouseV1Input' - application/vnd.segment.v1alpha+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - name: API Example Test Warehouse Update - settings: - host: aws.redshift.dev - schema: - $ref: '#/components/schemas/UpdateWarehouseV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - host: aws.redshift.dev - name: Redshift Dev - schema: - $ref: '#/components/schemas/updateWarehouse_200_response' - application/json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - host: aws.redshift.dev - name: Redshift Dev - schema: - $ref: '#/components/schemas/updateWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - host: aws.redshift.dev - name: Redshift Dev - schema: - $ref: '#/components/schemas/updateWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehouse: - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: - host: aws.redshift.dev - name: API Example Test Warehouse Update - schema: - $ref: '#/components/schemas/updateWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /sources/{sourceId}/edge-functions/disable: - patch: - deprecated: false - description: "Disable Edge Functions for your Source.\n\n**Note**: In order\ - \ to successfully call this endpoint, the specified Workspace needs to have\ - \ the Edge Functions feature enabled. Please reach out to your customer success\ - \ manager for more information.\n " - operationId: disableEdgeFunctions - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - edgeFunctions: - id: 1d1f7465-429b-451c-96e6-f5656f8f4f85 - sourceId: qQEHquLrjRDN9j1ByrChyn - downloadURL: "" - createdBy: sgJDWk3K21k6LE3tLU9nRK - createdAt: 2006-01-02T15:04:05.000Z - version: 2 - schema: - $ref: '#/components/schemas/disableEdgeFunctions_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Disable Edge Functions - tags: - - Edge Functions - x-domain-hierarchy: - - Connections - - Edge Functions - x-accepts: application/json - /echo: - get: - deprecated: false - description: Public Echo endpoint. - operationId: echo - parameters: - - description: |- - Sets the response `message` field. The response contains this field's entry. - - This parameter exists in alpha. - explode: false - in: query - name: message - required: true - schema: - description: Sets the response `message` field. The response contains this - field's entry. - title: message - type: string - style: deepObject - - description: "The desired response delay, in milliseconds.\n\nThis parameter\ - \ exists in alpha." - explode: false - in: query - name: delay - required: false - schema: - description: "The desired response delay, in milliseconds." - title: delay - type: number - style: deepObject - - description: "If `true`, returns an HTTP `4xx` error that contains the string\ - \ in `message`.\n\nThis parameter exists in alpha." - explode: false - in: query - name: triggerError - required: false - schema: - description: "If `true`, returns an HTTP `4xx` error that contains the string\ - \ in `message`." - title: triggerError - type: boolean - style: deepObject - - description: "If `true`, returns an HTTP `4xx` error that contains the value\ - \ of the `message` field in the error message array.\n\nThis has no effect\ - \ if the request sets `triggerError`.\n\nThis parameter exists in alpha." - explode: false - in: query - name: triggerMultipleErrors - required: false - schema: - description: "If `true`, returns an HTTP `4xx` error that contains the value\ - \ of the `message` field in the error message array.\n\nThis has no effect\ - \ if the request sets `triggerError`." - title: triggerMultipleErrors - type: boolean - style: deepObject - - description: "If `true`, triggers a `500` error.\n\nThis has no effect if\ - \ the request sets either `triggerError` or `triggerMultipleErrors`.\n\n\ - This parameter exists in alpha." - explode: false - in: query - name: triggerUnexpectedError - required: false - schema: - description: "If `true`, triggers a `500` error.\n\nThis has no effect if\ - \ the request sets either `triggerError` or `triggerMultipleErrors`." - title: triggerUnexpectedError - type: boolean - style: deepObject - - description: |- - Sets the HTTP status code to return. - - This parameter exists in alpha. - explode: false - in: query - name: statusCode - required: false - schema: - description: Sets the HTTP status code to return. - title: statusCode - type: number - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - method: get - message: "Hello, World!" - headers: - : - schema: - $ref: '#/components/schemas/echo_200_response' - application/json: - example: - data: - method: get - message: "Hello, World!" - headers: - : - schema: - $ref: '#/components/schemas/echo_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - method: get - message: "Hello, World!" - headers: - : - schema: - $ref: '#/components/schemas/echo_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Echo - tags: - - Testing - x-domain-hierarchy: - - General - - Testing - x-accepts: application/json - /sources/{sourceId}/edge-functions/upload-url: - post: - deprecated: false - description: "Generate a temporary upload URL, that can be used to upload an\ - \ Edge Functions bundle.\n\n**Note**: In order to successfully call this endpoint,\ - \ the specified Workspace needs to have the Edge Functions feature enabled.\ - \ Please reach out to your customer success manager for more information.\n\ - \ " - operationId: generateUploadURLForEdgeFunctions - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - uploadURL: - schema: - $ref: '#/components/schemas/generateUploadURLForEdgeFunctions_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Generate Upload URL for Edge Functions - tags: - - Edge Functions - x-domain-hierarchy: - - Connections - - Edge Functions - x-accepts: application/json - /warehouses/{warehouseId}/advanced-sync-schedule: - get: - deprecated: false - description: "Returns the advanced sync schedule for a Warehouse.\n\n\nThe rate\ - \ limit for this endpoint is 2 requests per minute, which is lower than the\ - \ default due to access pattern restrictions. Once reached, this endpoint\ - \ will respond with the 429 HTTP status code with headers indicating the limit\ - \ parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: getAdvancedSyncScheduleFromWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - application/json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - enabled: false - schema: - $ref: '#/components/schemas/getAdvancedSyncScheduleFromWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Advanced Sync Schedule from Warehouse - tags: - - Selective Sync - x-domain-hierarchy: - - Connections - - Selective Sync - x-accepts: application/json - put: - deprecated: false - description: "Updates the advanced sync schedule for a Warehouse, replacing\ - \ the sync schedule with a new schedule.\n\n\nThe rate limit for this endpoint\ - \ is 2 requests per minute, which is lower than the default due to access\ - \ pattern restrictions. Once reached, this endpoint will respond with the\ - \ 429 HTTP status code with headers indicating the limit parameters. See [Rate\ - \ Limiting](/#tag/Rate-Limits) for more information." - operationId: replaceAdvancedSyncScheduleForWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - enabled: true - schedule: - times: - - enabled: true - hourOfDay: 7 - - enabled: false - hourOfDay: 5 - - enabled: true - hourOfDay: 23 - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/ReplaceAdvancedSyncScheduleForWarehouseV1Input' - application/vnd.segment.v1beta+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - enabled: true - schedule: - times: - - enabled: true - hourOfDay: 7 - - enabled: false - hourOfDay: 5 - - enabled: true - hourOfDay: 23 - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/ReplaceAdvancedSyncScheduleForWarehouseV1Input' - application/vnd.segment.v1alpha+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - enabled: true - schedule: - times: - - enabled: true - hourOfDay: 7 - - enabled: false - hourOfDay: 5 - - enabled: true - hourOfDay: 23 - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/ReplaceAdvancedSyncScheduleForWarehouseV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - application/json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - enabled: true - schedule: - times: - - hourOfDay: 5 - enabled: false - - hourOfDay: 7 - enabled: true - - hourOfDay: 23 - enabled: true - timezone: America/Vancouver - schema: - $ref: '#/components/schemas/replaceAdvancedSyncScheduleForWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Advanced Sync Schedule for Warehouse - tags: - - Selective Sync - x-domain-hierarchy: - - Connections - - Selective Sync - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /warehouses/{warehouseId}/connection-state: - get: - deprecated: false - description: "Verifies the state of Warehouse connection settings.\n\n\nThe\ - \ rate limit for this endpoint is 20 requests per minute, which is lower than\ - \ the default due to access pattern restrictions. Once reached, this endpoint\ - \ will respond with the 429 HTTP status code with headers indicating the limit\ - \ parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: getConnectionStateFromWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - connectionState: CONNECTED - schema: - $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - application/json: - example: - data: - connectionState: CONNECTED - schema: - $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - connectionState: CONNECTED - schema: - $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - connectionState: CONNECTED - schema: - $ref: '#/components/schemas/getConnectionStateFromWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Connection State from Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - /usage/api-calls/sources/daily: - get: - deprecated: false - description: Provides daily cumulative per-source API call counts for a usage - period. - operationId: getDailyPerSourceAPICallsUsage - parameters: - - description: |- - The start of the usage month in the ISO-8601 format. - - This parameter exists in v1. - explode: false - in: query - name: period - required: true - schema: - description: The start of the usage month in the ISO-8601 format. - title: period - type: string - style: deepObject - - description: |- - Pagination input for per Source API calls counts. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - dailyPerSourceAPICallsUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - application/json: - example: - data: - dailyPerSourceAPICallsUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - application/vnd.segment.v1beta+json: - example: - data: - dailyPerSourceAPICallsUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - dailyPerSourceAPICallsUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceAPICallsUsage_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Daily Per Source API Calls Usage - tags: - - API Calls - x-domain-hierarchy: - - Usage - - API Calls - x-accepts: application/json - /usage/mtu/sources/daily: - get: - deprecated: false - description: Provides daily cumulative per-source MTU counts for a usage period. - operationId: getDailyPerSourceMTUUsage - parameters: - - description: "The start of the usage month, in the ISO-8601 format.\n\nThis\ - \ parameter exists in v1." - explode: false - in: query - name: period - required: true - schema: - description: "The start of the usage month, in the ISO-8601 format." - title: period - type: string - style: deepObject - - description: |- - Pagination input for per Source MTU counts. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - dailyPerSourceMTUUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - application/json: - example: - data: - dailyPerSourceMTUUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - application/vnd.segment.v1beta+json: - example: - data: - dailyPerSourceMTUUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - dailyPerSourceMTUUsage: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - sourceId: rh5BDZp6QDHvXFCkibm1pR - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyPerSourceMTUUsage_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Daily Per Source MTU Usage - tags: - - Monthly Tracked Users - x-domain-hierarchy: - - Usage - - Monthly Tracked Users - x-accepts: application/json - /usage/api-calls/daily: - get: - deprecated: false - description: Provides daily cumulative API call counts for a usage period. - operationId: getDailyWorkspaceAPICallsUsage - parameters: - - description: |- - The start of the usage month in the ISO-8601 format. - - This parameter exists in v1. - explode: false - in: query - name: period - required: true - schema: - description: The start of the usage month in the ISO-8601 format. - title: period - type: string - style: deepObject - - description: |- - Pagination input for Workspace API call counts. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - dailyWorkspaceAPICallsUsage: - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - application/json: - example: - data: - dailyWorkspaceAPICallsUsage: - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - application/vnd.segment.v1beta+json: - example: - data: - dailyWorkspaceAPICallsUsage: - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - dailyWorkspaceAPICallsUsage: - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - - apiCalls: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceAPICallsUsage_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Daily Workspace API Calls Usage - tags: - - API Calls - x-domain-hierarchy: - - Usage - - API Calls - x-accepts: application/json - /usage/mtu/daily: - get: - deprecated: false - description: Provides daily cumulative MTU counts for a usage period. - operationId: getDailyWorkspaceMTUUsage - parameters: - - description: "The start of the usage month, in the ISO-8601 format.\n\nThis\ - \ parameter exists in v1." - explode: false - in: query - name: period - required: true - schema: - description: "The start of the usage month, in the ISO-8601 format." - title: period - type: string - style: deepObject - - description: |- - Pagination input for Workspace MTU counts. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - dailyWorkspaceMTUUsage: - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - application/json: - example: - data: - dailyWorkspaceMTUUsage: - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - application/vnd.segment.v1beta+json: - example: - data: - dailyWorkspaceMTUUsage: - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - dailyWorkspaceMTUUsage: - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "3" - anonymousIdentified: "7" - identified: "33" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "7" - anonymousIdentified: "13" - identified: "67" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "10" - anonymousIdentified: "20" - identified: "100" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "13" - anonymousIdentified: "27" - identified: "133" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "17" - anonymousIdentified: "33" - identified: "167" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "20" - anonymousIdentified: "40" - identified: "200" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "23" - anonymousIdentified: "47" - identified: "233" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "27" - anonymousIdentified: "53" - identified: "267" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "30" - anonymousIdentified: "60" - identified: "300" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - - periodStart: 1612137600 - periodEnd: 1614556800 - anonymous: "33" - anonymousIdentified: "67" - identified: "333" - neverIdentified: "0" - timestamp: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTA= - totalEntries: 28 - schema: - $ref: '#/components/schemas/getDailyWorkspaceMTUUsage_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Daily Workspace MTU Usage - tags: - - Monthly Tracked Users - x-domain-hierarchy: - - Usage - - Monthly Tracked Users - x-accepts: application/json - /catalog/destinations/{destinationMetadataId}: - get: - deprecated: false - description: Returns a Destination catalog item by its id. - operationId: getDestinationMetadata - parameters: - - explode: false - in: path - name: destinationMetadataId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destinationMetadata: - id: 54521fd525e721e32a72ee91 - name: Amplitude - description: "Amplitude is an event tracking and segmentation\ - \ platform for your web and mobile apps. By analyzing the actions\ - \ your users perform, you can gain a better understanding to\ - \ drive retention, engagement, and conversion." - slug: amplitude - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/amplitude-default.svg - mark: https://cdn.filepicker.io/api/file/Nmj7LgOQR62rdAmlbnLO - options: - - name: apiKey - type: string - defaultValue: "" - description: "You can find your API Key on your Amplitude [Settings\ - \ page](https://amplitude.com/settings)." - required: true - label: API Key - - name: appendFieldsToEventProps - type: text-map - defaultValue: {} - description: "Web Device-mode only. Configure event fields to\ - \ be appended to `event_props` for all track calls. For example,\ - \ entering `context.page.title` on the left and `pageTitle`\ - \ on the right will set the value of `context.page.title`\ - \ at `event_properties.pageTitle`." - required: false - label: Append Fields To Event Properties - - name: batchEvents - type: boolean - defaultValue: false - description: "If true, events are batched together and uploaded\ - \ only when the number of unsent events is greater than or\ - \ equal to `eventUploadThreshold` or after `eventUploadPeriodMillis`\ - \ milliseconds have passed since the first unsent event was\ - \ logged." - required: false - label: Batch Events - - name: deviceIdFromUrlParam - type: boolean - defaultValue: false - description: "If true, the SDK will parse device ID values from\ - \ url parameter `amp_device_id` if available." - required: false - label: Set Device ID From URL Parameter amp_device_id - - name: enableLocationListening - type: boolean - defaultValue: true - description: "Mobile Only. If a user has granted your app location\ - \ permissions, enable this setting so that the SDK will also\ - \ grab the location of the user. Amplitude will never prompt\ - \ the user for location permission, so this must be done by\ - \ your app. " - required: false - label: Enable Location Listening - status: PUBLIC - categories: - - Analytics - website: http://amplitude.com - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-amplitude - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-amplitude - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: SERVER - previousNames: - - Amplitude - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - schema: - $ref: '#/components/schemas/getDestinationMetadata_200_response' - application/json: - example: - data: - destinationMetadata: - id: 54521fd525e721e32a72ee91 - name: Amplitude - description: "Amplitude is an event tracking and segmentation\ - \ platform for your web and mobile apps. By analyzing the actions\ - \ your users perform, you can gain a better understanding to\ - \ drive retention, engagement, and conversion." - slug: amplitude - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/amplitude-default.svg - mark: https://cdn.filepicker.io/api/file/Nmj7LgOQR62rdAmlbnLO - options: - - name: apiKey - type: string - defaultValue: "" - description: "You can find your API Key on your Amplitude [Settings\ - \ page](https://amplitude.com/settings)." - required: true - label: API Key - - name: appendFieldsToEventProps - type: text-map - defaultValue: {} - description: "Web Device-mode only. Configure event fields to\ - \ be appended to `event_props` for all track calls. For example,\ - \ entering `context.page.title` on the left and `pageTitle`\ - \ on the right will set the value of `context.page.title`\ - \ at `event_properties.pageTitle`." - required: false - label: Append Fields To Event Properties - - name: batchEvents - type: boolean - defaultValue: false - description: "If true, events are batched together and uploaded\ - \ only when the number of unsent events is greater than or\ - \ equal to `eventUploadThreshold` or after `eventUploadPeriodMillis`\ - \ milliseconds have passed since the first unsent event was\ - \ logged." - required: false - label: Batch Events - - name: deviceIdFromUrlParam - type: boolean - defaultValue: false - description: "If true, the SDK will parse device ID values from\ - \ url parameter `amp_device_id` if available." - required: false - label: Set Device ID From URL Parameter amp_device_id - - name: enableLocationListening - type: boolean - defaultValue: true - description: "Mobile Only. If a user has granted your app location\ - \ permissions, enable this setting so that the SDK will also\ - \ grab the location of the user. Amplitude will never prompt\ - \ the user for location permission, so this must be done by\ - \ your app. " - required: false - label: Enable Location Listening - status: PUBLIC - categories: - - Analytics - website: http://amplitude.com - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-amplitude - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-amplitude - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: SERVER - previousNames: - - Amplitude - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - schema: - $ref: '#/components/schemas/getDestinationMetadata_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destinationMetadata: - id: 54521fd525e721e32a72ee91 - name: Amplitude - description: "Amplitude is an event tracking and segmentation\ - \ platform for your web and mobile apps. By analyzing the actions\ - \ your users perform, you can gain a better understanding to\ - \ drive retention, engagement, and conversion." - slug: amplitude - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/amplitude-default.svg - mark: https://cdn.filepicker.io/api/file/Nmj7LgOQR62rdAmlbnLO - options: - - name: apiKey - type: string - defaultValue: "" - description: "You can find your API Key on your Amplitude [Settings\ - \ page](https://amplitude.com/settings)." - required: true - label: API Key - - name: appendFieldsToEventProps - type: text-map - defaultValue: {} - description: "Web Device-mode only. Configure event fields to\ - \ be appended to `event_props` for all track calls. For example,\ - \ entering `context.page.title` on the left and `pageTitle`\ - \ on the right will set the value of `context.page.title`\ - \ at `event_properties.pageTitle`." - required: false - label: Append Fields To Event Properties - - name: batchEvents - type: boolean - defaultValue: false - description: "If true, events are batched together and uploaded\ - \ only when the number of unsent events is greater than or\ - \ equal to `eventUploadThreshold` or after `eventUploadPeriodMillis`\ - \ milliseconds have passed since the first unsent event was\ - \ logged." - required: false - label: Batch Events - - name: deviceIdFromUrlParam - type: boolean - defaultValue: false - description: "If true, the SDK will parse device ID values from\ - \ url parameter `amp_device_id` if available." - required: false - label: Set Device ID From URL Parameter amp_device_id - - name: enableLocationListening - type: boolean - defaultValue: true - description: "Mobile Only. If a user has granted your app location\ - \ permissions, enable this setting so that the SDK will also\ - \ grab the location of the user. Amplitude will never prompt\ - \ the user for location permission, so this must be done by\ - \ your app. " - required: false - label: Enable Location Listening - status: PUBLIC - categories: - - Analytics - website: http://amplitude.com - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-amplitude - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-amplitude - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: SERVER - previousNames: - - Amplitude - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - schema: - $ref: '#/components/schemas/getDestinationMetadata_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destinationMetadata: - id: 54521fd525e721e32a72ee91 - name: Amplitude - description: "Amplitude is an event tracking and segmentation\ - \ platform for your web and mobile apps. By analyzing the actions\ - \ your users perform, you can gain a better understanding to\ - \ drive retention, engagement, and conversion." - slug: amplitude - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/amplitude-default.svg - mark: https://cdn.filepicker.io/api/file/Nmj7LgOQR62rdAmlbnLO - options: - - name: apiKey - type: string - defaultValue: "" - description: "You can find your API Key on your Amplitude [Settings\ - \ page](https://amplitude.com/settings)." - required: true - label: API Key - - name: appendFieldsToEventProps - type: text-map - defaultValue: {} - description: "Web Device-mode only. Configure event fields to\ - \ be appended to `event_props` for all track calls. For example,\ - \ entering `context.page.title` on the left and `pageTitle`\ - \ on the right will set the value of `context.page.title`\ - \ at `event_properties.pageTitle`." - required: false - label: Append Fields To Event Properties - - name: batchEvents - type: boolean - defaultValue: false - description: "If true, events are batched together and uploaded\ - \ only when the number of unsent events is greater than or\ - \ equal to `eventUploadThreshold` or after `eventUploadPeriodMillis`\ - \ milliseconds have passed since the first unsent event was\ - \ logged." - required: false - label: Batch Events - - name: deviceIdFromUrlParam - type: boolean - defaultValue: false - description: "If true, the SDK will parse device ID values from\ - \ url parameter `amp_device_id` if available." - required: false - label: Set Device ID From URL Parameter amp_device_id - - name: enableLocationListening - type: boolean - defaultValue: true - description: "Mobile Only. If a user has granted your app location\ - \ permissions, enable this setting so that the SDK will also\ - \ grab the location of the user. Amplitude will never prompt\ - \ the user for location permission, so this must be done by\ - \ your app. " - required: false - label: Enable Location Listening - status: PUBLIC - categories: - - Analytics - website: http://amplitude.com - components: - - code: https://github.com/segmentio/analytics.js-integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: BROWSER - - code: https://github.com/segment-integrations/analytics-ios-integration-amplitude - owner: SEGMENT - type: IOS - - code: https://github.com/segment-integrations/analytics-android-integration-amplitude - owner: SEGMENT - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/amplitude - owner: SEGMENT - type: SERVER - previousNames: - - Amplitude - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: false - supportedPlatforms: - browser: true - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: true - browserUnbundlingPublic: true - actions: [] - presets: [] - schema: - $ref: '#/components/schemas/getDestinationMetadata_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Destination Metadata - tags: - - Catalog - x-domain-hierarchy: - - Connections - - Catalog - x-accepts: application/json - /catalog/destinations: - get: - deprecated: false - description: Returns a list of all available Destinations in the Segment catalog. - operationId: getDestinationsCatalog - parameters: - - description: |- - Required pagination parameters used to filter the Destinations catalog. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destinationsCatalog: - - id: 54521fd525e721e32a72ee8e - name: AdRoll - description: 'AdRoll is a retargeting network that allows you - to show ads to visitors who''ve landed on your site while browsing - the web. ' - slug: adroll - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/adroll-default.svg - mark: https://cdn.filepicker.io/api/file/IKo2fU59RROBsNtj4lHs - options: - - name: _version - type: number - defaultValue: 2 - description: "" - required: false - label: _version - - name: advId - type: string - defaultValue: "" - description: "You can find your Advertiser ID in your AdRoll\ - \ dashboard by clicking the **green or red dot** in the lower-left\ - \ corner. In the Javascript snippet, the Advertiser ID appears\ - \ as `adroll_avd_id = 'XXXXXXX'` on line 2. It should be 22\ - \ characters long and look something like this: `WYJD6WNIAJC2XG6PT7UK4B`." - required: true - label: Advertiser ID - - name: events - type: text-map - defaultValue: {} - description: AdRoll allows you to create a Segment Name and - ID for conversions events. Use this mapping to trigger the - *AdRoll Segment ID* (on the right) when the Event Name (on - the left) is passed in a Track method. - required: false - label: Events - - name: pixId - type: string - defaultValue: "" - description: "You can find your Pixel ID in your AdRoll dashboard\ - \ by clicking the **green or red dot** in the lower-left corner.\ - \ In the Javascript snippet, the Pixel ID appears as `adroll_pix_id\ - \ = 'XXXXXXX'` on line 3. It should be 22 characters long,\ - \ and look something like this: `6UUA5LKILFESVE44XH6SVX`." - required: true - label: Pixel ID - status: PUBLIC - categories: - - Advertising - website: http://adroll.com - components: - - code: https://github.com/segment-integrations/analytics.js-integration-adroll - type: BROWSER - previousNames: - - AdRoll - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: false - server: false - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - - id: 54521fd525e721e32a72ee8f - name: AppsFlyer - description: Mobile app measurement and tracking. - slug: appsflyer - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/appsflyer-default.svg - mark: https://cdn.filepicker.io/api/file/AnJUEBvxRouLLOvIeQuK - options: - - name: androidAppID - type: string - defaultValue: "" - description: Your Android App's ID. Find this in your AppsFlyer's - 'My App' dashboard. It should look something like 'com.appsflyer.myapp'. - This is required for Android projects if you want to send - events using the server side integration. - required: true - label: Android App ID - - name: appleAppID - type: string - defaultValue: "" - description: "Your App's ID, which is accessible from iTunes\ - \ or in AppsFlyer's 'My App' dashboard. This is optional for\ - \ Android projects, and only required for iOS projects." - required: true - label: Apple App ID (iOS) - - name: appsFlyerDevKey - type: string - defaultValue: "" - description: "Your unique developer ID from AppsFlyer, which\ - \ is accessible from your AppsFlyer account." - required: true - label: AppsFlyer Dev Key - - name: canOmitAppsFlyerId - type: boolean - defaultValue: false - description: '*Only applicable for Appsflyer''s Business Tiers - customers using server-side or cloud mode destination.* Please - contact your AppsFlyer representative for more information. - This setting allows to use the advertising ID as appsflyer - ID.' - required: false - label: Can Omit AppsFlyerId - - name: fallbackToIdfv - type: boolean - defaultValue: false - description: "With the update to use analytics-ios v4.x SDK\ - \ if adTrackingEnabled is set to false, the advertisingId\ - \ key will be deleted from the event. If you have the setting\ - \ enabled \"Can Omit AppsFlyerId\", these events will fail\ - \ when sent to AppsFlyer API. To prevent these event failures\ - \ in this scenario enable this send the IDFV instead. When\ - \ the \"Can Omit AppsFlyerId\" setting is enabled if the IDFA\ - \ is zeroed out, we will also send an IDFV when this setting\ - \ is enabled. " - required: false - label: Fallback to send IDFV when advertisingId key not present - (Server-Side Only) - status: PUBLIC - categories: - - Attribution - - Deep Linking - website: http://www.appsflyer.com/ - components: - - code: https://github.com/AppsFlyerSDK/segment-appsflyer-ios - owner: PARTNER - type: IOS - - code: https://github.com/AppsFlyerSDK/AppsFlyer-Segment-Integration - owner: PARTNER - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/appsflyer - owner: SEGMENT - type: SERVER - previousNames: - - AppsFlyer - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: false - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - pagination: - current: MA== - next: Mg== - totalEntries: 378 - schema: - $ref: '#/components/schemas/getDestinationsCatalog_200_response' - application/json: - example: - data: - destinationsCatalog: - - id: 54521fd525e721e32a72ee8e - name: AdRoll - description: 'AdRoll is a retargeting network that allows you - to show ads to visitors who''ve landed on your site while browsing - the web. ' - slug: adroll - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/adroll-default.svg - mark: https://cdn.filepicker.io/api/file/IKo2fU59RROBsNtj4lHs - options: - - name: _version - type: number - defaultValue: 2 - description: "" - required: false - label: _version - - name: advId - type: string - defaultValue: "" - description: "You can find your Advertiser ID in your AdRoll\ - \ dashboard by clicking the **green or red dot** in the lower-left\ - \ corner. In the Javascript snippet, the Advertiser ID appears\ - \ as `adroll_avd_id = 'XXXXXXX'` on line 2. It should be 22\ - \ characters long and look something like this: `WYJD6WNIAJC2XG6PT7UK4B`." - required: true - label: Advertiser ID - - name: events - type: text-map - defaultValue: {} - description: AdRoll allows you to create a Segment Name and - ID for conversions events. Use this mapping to trigger the - *AdRoll Segment ID* (on the right) when the Event Name (on - the left) is passed in a Track method. - required: false - label: Events - - name: pixId - type: string - defaultValue: "" - description: "You can find your Pixel ID in your AdRoll dashboard\ - \ by clicking the **green or red dot** in the lower-left corner.\ - \ In the Javascript snippet, the Pixel ID appears as `adroll_pix_id\ - \ = 'XXXXXXX'` on line 3. It should be 22 characters long,\ - \ and look something like this: `6UUA5LKILFESVE44XH6SVX`." - required: true - label: Pixel ID - status: PUBLIC - categories: - - Advertising - website: http://adroll.com - components: - - code: https://github.com/segment-integrations/analytics.js-integration-adroll - type: BROWSER - previousNames: - - AdRoll - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: false - server: false - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - - id: 54521fd525e721e32a72ee8f - name: AppsFlyer - description: Mobile app measurement and tracking. - slug: appsflyer - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/appsflyer-default.svg - mark: https://cdn.filepicker.io/api/file/AnJUEBvxRouLLOvIeQuK - options: - - name: androidAppID - type: string - defaultValue: "" - description: Your Android App's ID. Find this in your AppsFlyer's - 'My App' dashboard. It should look something like 'com.appsflyer.myapp'. - This is required for Android projects if you want to send - events using the server side integration. - required: true - label: Android App ID - - name: appleAppID - type: string - defaultValue: "" - description: "Your App's ID, which is accessible from iTunes\ - \ or in AppsFlyer's 'My App' dashboard. This is optional for\ - \ Android projects, and only required for iOS projects." - required: true - label: Apple App ID (iOS) - - name: appsFlyerDevKey - type: string - defaultValue: "" - description: "Your unique developer ID from AppsFlyer, which\ - \ is accessible from your AppsFlyer account." - required: true - label: AppsFlyer Dev Key - - name: canOmitAppsFlyerId - type: boolean - defaultValue: false - description: '*Only applicable for Appsflyer''s Business Tiers - customers using server-side or cloud mode destination.* Please - contact your AppsFlyer representative for more information. - This setting allows to use the advertising ID as appsflyer - ID.' - required: false - label: Can Omit AppsFlyerId - - name: fallbackToIdfv - type: boolean - defaultValue: false - description: "With the update to use analytics-ios v4.x SDK\ - \ if adTrackingEnabled is set to false, the advertisingId\ - \ key will be deleted from the event. If you have the setting\ - \ enabled \"Can Omit AppsFlyerId\", these events will fail\ - \ when sent to AppsFlyer API. To prevent these event failures\ - \ in this scenario enable this send the IDFV instead. When\ - \ the \"Can Omit AppsFlyerId\" setting is enabled if the IDFA\ - \ is zeroed out, we will also send an IDFV when this setting\ - \ is enabled. " - required: false - label: Fallback to send IDFV when advertisingId key not present - (Server-Side Only) - status: PUBLIC - categories: - - Attribution - - Deep Linking - website: http://www.appsflyer.com/ - components: - - code: https://github.com/AppsFlyerSDK/segment-appsflyer-ios - owner: PARTNER - type: IOS - - code: https://github.com/AppsFlyerSDK/AppsFlyer-Segment-Integration - owner: PARTNER - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/appsflyer - owner: SEGMENT - type: SERVER - previousNames: - - AppsFlyer - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: false - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - pagination: - current: MA== - next: Mg== - totalEntries: 378 - schema: - $ref: '#/components/schemas/getDestinationsCatalog_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destinationsCatalog: - - id: 54521fd525e721e32a72ee8e - name: AdRoll - description: 'AdRoll is a retargeting network that allows you - to show ads to visitors who''ve landed on your site while browsing - the web. ' - slug: adroll - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/adroll-default.svg - mark: https://cdn.filepicker.io/api/file/IKo2fU59RROBsNtj4lHs - options: - - name: _version - type: number - defaultValue: 2 - description: "" - required: false - label: _version - - name: advId - type: string - defaultValue: "" - description: "You can find your Advertiser ID in your AdRoll\ - \ dashboard by clicking the **green or red dot** in the lower-left\ - \ corner. In the Javascript snippet, the Advertiser ID appears\ - \ as `adroll_avd_id = 'XXXXXXX'` on line 2. It should be 22\ - \ characters long and look something like this: `WYJD6WNIAJC2XG6PT7UK4B`." - required: true - label: Advertiser ID - - name: events - type: text-map - defaultValue: {} - description: AdRoll allows you to create a Segment Name and - ID for conversions events. Use this mapping to trigger the - *AdRoll Segment ID* (on the right) when the Event Name (on - the left) is passed in a Track method. - required: false - label: Events - - name: pixId - type: string - defaultValue: "" - description: "You can find your Pixel ID in your AdRoll dashboard\ - \ by clicking the **green or red dot** in the lower-left corner.\ - \ In the Javascript snippet, the Pixel ID appears as `adroll_pix_id\ - \ = 'XXXXXXX'` on line 3. It should be 22 characters long,\ - \ and look something like this: `6UUA5LKILFESVE44XH6SVX`." - required: true - label: Pixel ID - status: PUBLIC - categories: - - Advertising - website: http://adroll.com - components: - - code: https://github.com/segment-integrations/analytics.js-integration-adroll - type: BROWSER - previousNames: - - AdRoll - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: false - server: false - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - - id: 54521fd525e721e32a72ee8f - name: AppsFlyer - description: Mobile app measurement and tracking. - slug: appsflyer - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/appsflyer-default.svg - mark: https://cdn.filepicker.io/api/file/AnJUEBvxRouLLOvIeQuK - options: - - name: androidAppID - type: string - defaultValue: "" - description: Your Android App's ID. Find this in your AppsFlyer's - 'My App' dashboard. It should look something like 'com.appsflyer.myapp'. - This is required for Android projects if you want to send - events using the server side integration. - required: true - label: Android App ID - - name: appleAppID - type: string - defaultValue: "" - description: "Your App's ID, which is accessible from iTunes\ - \ or in AppsFlyer's 'My App' dashboard. This is optional for\ - \ Android projects, and only required for iOS projects." - required: true - label: Apple App ID (iOS) - - name: appsFlyerDevKey - type: string - defaultValue: "" - description: "Your unique developer ID from AppsFlyer, which\ - \ is accessible from your AppsFlyer account." - required: true - label: AppsFlyer Dev Key - - name: canOmitAppsFlyerId - type: boolean - defaultValue: false - description: '*Only applicable for Appsflyer''s Business Tiers - customers using server-side or cloud mode destination.* Please - contact your AppsFlyer representative for more information. - This setting allows to use the advertising ID as appsflyer - ID.' - required: false - label: Can Omit AppsFlyerId - - name: fallbackToIdfv - type: boolean - defaultValue: false - description: "With the update to use analytics-ios v4.x SDK\ - \ if adTrackingEnabled is set to false, the advertisingId\ - \ key will be deleted from the event. If you have the setting\ - \ enabled \"Can Omit AppsFlyerId\", these events will fail\ - \ when sent to AppsFlyer API. To prevent these event failures\ - \ in this scenario enable this send the IDFV instead. When\ - \ the \"Can Omit AppsFlyerId\" setting is enabled if the IDFA\ - \ is zeroed out, we will also send an IDFV when this setting\ - \ is enabled. " - required: false - label: Fallback to send IDFV when advertisingId key not present - (Server-Side Only) - status: PUBLIC - categories: - - Attribution - - Deep Linking - website: http://www.appsflyer.com/ - components: - - code: https://github.com/AppsFlyerSDK/segment-appsflyer-ios - owner: PARTNER - type: IOS - - code: https://github.com/AppsFlyerSDK/AppsFlyer-Segment-Integration - owner: PARTNER - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/appsflyer - owner: SEGMENT - type: SERVER - previousNames: - - AppsFlyer - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: false - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - pagination: - current: MA== - next: Mg== - totalEntries: 378 - schema: - $ref: '#/components/schemas/getDestinationsCatalog_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destinationsCatalog: - - id: 54521fd525e721e32a72ee8e - name: AdRoll - description: 'AdRoll is a retargeting network that allows you - to show ads to visitors who''ve landed on your site while browsing - the web. ' - slug: adroll - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/adroll-default.svg - mark: https://cdn.filepicker.io/api/file/IKo2fU59RROBsNtj4lHs - options: - - name: _version - type: number - defaultValue: 2 - description: "" - required: false - label: _version - - name: advId - type: string - defaultValue: "" - description: "You can find your Advertiser ID in your AdRoll\ - \ dashboard by clicking the **green or red dot** in the lower-left\ - \ corner. In the Javascript snippet, the Advertiser ID appears\ - \ as `adroll_avd_id = 'XXXXXXX'` on line 2. It should be 22\ - \ characters long and look something like this: `WYJD6WNIAJC2XG6PT7UK4B`." - required: true - label: Advertiser ID - - name: events - type: text-map - defaultValue: {} - description: AdRoll allows you to create a Segment Name and - ID for conversions events. Use this mapping to trigger the - *AdRoll Segment ID* (on the right) when the Event Name (on - the left) is passed in a Track method. - required: false - label: Events - - name: pixId - type: string - defaultValue: "" - description: "You can find your Pixel ID in your AdRoll dashboard\ - \ by clicking the **green or red dot** in the lower-left corner.\ - \ In the Javascript snippet, the Pixel ID appears as `adroll_pix_id\ - \ = 'XXXXXXX'` on line 3. It should be 22 characters long,\ - \ and look something like this: `6UUA5LKILFESVE44XH6SVX`." - required: true - label: Pixel ID - status: PUBLIC - categories: - - Advertising - website: http://adroll.com - components: - - code: https://github.com/segment-integrations/analytics.js-integration-adroll - type: BROWSER - previousNames: - - AdRoll - supportedMethods: - track: true - pageview: true - identify: true - group: false - alias: false - supportedPlatforms: - browser: true - mobile: false - server: false - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - - id: 54521fd525e721e32a72ee8f - name: AppsFlyer - description: Mobile app measurement and tracking. - slug: appsflyer - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/appsflyer-default.svg - mark: https://cdn.filepicker.io/api/file/AnJUEBvxRouLLOvIeQuK - options: - - name: androidAppID - type: string - defaultValue: "" - description: Your Android App's ID. Find this in your AppsFlyer's - 'My App' dashboard. It should look something like 'com.appsflyer.myapp'. - This is required for Android projects if you want to send - events using the server side integration. - required: true - label: Android App ID - - name: appleAppID - type: string - defaultValue: "" - description: "Your App's ID, which is accessible from iTunes\ - \ or in AppsFlyer's 'My App' dashboard. This is optional for\ - \ Android projects, and only required for iOS projects." - required: true - label: Apple App ID (iOS) - - name: appsFlyerDevKey - type: string - defaultValue: "" - description: "Your unique developer ID from AppsFlyer, which\ - \ is accessible from your AppsFlyer account." - required: true - label: AppsFlyer Dev Key - - name: canOmitAppsFlyerId - type: boolean - defaultValue: false - description: '*Only applicable for Appsflyer''s Business Tiers - customers using server-side or cloud mode destination.* Please - contact your AppsFlyer representative for more information. - This setting allows to use the advertising ID as appsflyer - ID.' - required: false - label: Can Omit AppsFlyerId - - name: fallbackToIdfv - type: boolean - defaultValue: false - description: "With the update to use analytics-ios v4.x SDK\ - \ if adTrackingEnabled is set to false, the advertisingId\ - \ key will be deleted from the event. If you have the setting\ - \ enabled \"Can Omit AppsFlyerId\", these events will fail\ - \ when sent to AppsFlyer API. To prevent these event failures\ - \ in this scenario enable this send the IDFV instead. When\ - \ the \"Can Omit AppsFlyerId\" setting is enabled if the IDFA\ - \ is zeroed out, we will also send an IDFV when this setting\ - \ is enabled. " - required: false - label: Fallback to send IDFV when advertisingId key not present - (Server-Side Only) - status: PUBLIC - categories: - - Attribution - - Deep Linking - website: http://www.appsflyer.com/ - components: - - code: https://github.com/AppsFlyerSDK/segment-appsflyer-ios - owner: PARTNER - type: IOS - - code: https://github.com/AppsFlyerSDK/AppsFlyer-Segment-Integration - owner: PARTNER - type: ANDROID - - code: https://github.com/segmentio/integrations/tree/master/integrations/appsflyer - owner: SEGMENT - type: SERVER - previousNames: - - AppsFlyer - supportedMethods: - track: true - pageview: true - identify: true - group: true - alias: true - supportedPlatforms: - browser: false - mobile: true - server: true - supportedFeatures: - cloudModeInstances: "0" - deviceModeInstances: "0" - replay: false - browserUnbundling: false - browserUnbundlingPublic: true - actions: [] - presets: [] - pagination: - current: MA== - next: Mg== - totalEntries: 378 - schema: - $ref: '#/components/schemas/getDestinationsCatalog_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Destinations Catalog - tags: - - Catalog - x-domain-hierarchy: - - Connections - - Catalog - x-accepts: application/json - /events/volume: - get: - deprecated: false - description: "Enumerates the Workspace event volumes over time in minute increments.\n\ - \n\nThe rate limit for this endpoint is 20 requests per minute, which is lower\ - \ than the default due to access pattern restrictions. Once reached, this\ - \ endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: getEventsVolumeFromWorkspace - parameters: - - description: |- - The size of each bucket in the requested window. - - This parameter exists in v1. - explode: false - in: query - name: granularity - required: true - schema: - description: The size of each bucket in the requested window. - enum: - - DAY - - HOUR - - MINUTE - title: granularity - type: string - style: deepObject - - description: "The ISO8601 formatted timestamp that corresponds to the\nbeginning\ - \ of the requested time frame, inclusive.\n\nThis parameter exists in v1." - explode: false - in: query - name: startTime - required: true - schema: - description: "The ISO8601 formatted timestamp that corresponds to the\n\ - beginning of the requested time frame, inclusive." - title: startTime - type: string - style: deepObject - - description: "The ISO8601 formatted timestamp that corresponds to the\nend\ - \ of the requested time frame, noninclusive.\nSegment recommends that you\ - \ lag queries 1 minute behind clock time to reduce\nthe risk for latency\ - \ to impact the counts.\n\nThis parameter exists in v1." - explode: false - in: query - name: endTime - required: true - schema: - description: "The ISO8601 formatted timestamp that corresponds to the\n\ - end of the requested time frame, noninclusive.\nSegment recommends that\ - \ you lag queries 1 minute behind clock time to reduce\nthe risk for latency\ - \ to impact the counts." - title: endTime - type: string - style: deepObject - - description: "A comma-delimited list of strings that represents the dimensions\n\ - to group the result by. The options are:\n`eventName`, `eventType` and `source`.\n\ - \nThis parameter exists in v1." - explode: false - in: query - name: groupBy - required: false - schema: - description: "A comma-delimited list of strings that represents the dimensions\n\ - to group the result by. The options are:\n`eventName`, `eventType` and\ - \ `source`." - items: - type: string - title: groupBy - type: array - style: deepObject - - description: |- - A list of strings which filters the results to the given - SourceIds. - - This parameter exists in v1. - explode: false - in: query - name: sourceId - required: false - schema: - description: |- - A list of strings which filters the results to the given - SourceIds. - items: - type: string - title: sourceId - type: array - style: deepObject - - description: |- - A list of strings which filters the results to the given - EventNames. - - This parameter exists in v1. - explode: false - in: query - name: eventName - required: false - schema: - description: |- - A list of strings which filters the results to the given - EventNames. - items: - type: string - title: eventName - type: array - style: deepObject - - description: |- - A list of strings which filters the results to the given - EventTypes. - - This parameter exists in v1. - explode: false - in: query - name: eventType - required: false - schema: - description: |- - A list of strings which filters the results to the given - EventTypes. - items: - type: string - title: eventType - type: array - style: deepObject - - description: |- - A list of strings which filters the results to the given - AppVersions. - - This parameter exists in v1. - explode: false - in: query - name: appVersion - required: false - schema: - description: |- - A list of strings which filters the results to the given - AppVersions. - items: - type: string - title: appVersion - type: array - style: deepObject - - description: |- - Pagination input for event volume by Workspace. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: false - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - result: - - eventType: track - total: 12533455 - series: - - time: 2021-10-28T00:00:00Z - count: 6221572 - - time: 2021-10-29T00:00:00Z - count: 6311883 - - eventType: identify - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: group - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: page - total: 46080 - series: - - time: 2021-10-28T00:00:00Z - count: 23040 - - time: 2021-10-29T00:00:00Z - count: 23040 - - eventType: screen - total: 46079 - series: - - time: 2021-10-28T00:00:00Z - count: 23039 - - time: 2021-10-29T00:00:00Z - count: 23040 - schema: - $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - application/json: - example: - data: - result: - - eventType: track - total: 12533455 - series: - - time: 2021-10-28T00:00:00Z - count: 6221572 - - time: 2021-10-29T00:00:00Z - count: 6311883 - - eventType: identify - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: group - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: page - total: 46080 - series: - - time: 2021-10-28T00:00:00Z - count: 23040 - - time: 2021-10-29T00:00:00Z - count: 23040 - - eventType: screen - total: 46079 - series: - - time: 2021-10-28T00:00:00Z - count: 23039 - - time: 2021-10-29T00:00:00Z - count: 23040 - schema: - $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - application/vnd.segment.v1beta+json: - example: - data: - result: - - eventType: track - total: 12533455 - series: - - time: 2021-10-28T00:00:00Z - count: 6221572 - - time: 2021-10-29T00:00:00Z - count: 6311883 - - eventType: identify - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: group - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: page - total: 46080 - series: - - time: 2021-10-28T00:00:00Z - count: 23040 - - time: 2021-10-29T00:00:00Z - count: 23040 - - eventType: screen - total: 46079 - series: - - time: 2021-10-28T00:00:00Z - count: 23039 - - time: 2021-10-29T00:00:00Z - count: 23040 - schema: - $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - result: - - eventType: track - total: 12533455 - series: - - time: 2021-10-28T00:00:00Z - count: 6221572 - - time: 2021-10-29T00:00:00Z - count: 6311883 - - eventType: identify - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: group - total: 178936 - series: - - time: 2021-10-28T00:00:00Z - count: 87914 - - time: 2021-10-29T00:00:00Z - count: 91022 - - eventType: page - total: 46080 - series: - - time: 2021-10-28T00:00:00Z - count: 23040 - - time: 2021-10-29T00:00:00Z - count: 23040 - - eventType: screen - total: 46079 - series: - - time: 2021-10-28T00:00:00Z - count: 23039 - - time: 2021-10-29T00:00:00Z - count: 23040 - schema: - $ref: '#/components/schemas/getEventsVolumeFromWorkspace_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Events Volume from Workspace - tags: - - Events - x-domain-hierarchy: - - Monitoring - - Events - x-accepts: application/json - /destination/{destinationId}/filters/{filterId}: - delete: - deprecated: false - description: "Deletes a Destination filter.\n\n\n\nWhen called, this endpoint\ - \ may generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail)\ - \ event.\n " - operationId: removeFilterFromDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: filterId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeFilterFromDestination_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeFilterFromDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeFilterFromDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeFilterFromDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Remove Filter from Destination - tags: - - Destination Filters - x-domain-hierarchy: - - Connections - - Destination Filters - x-accepts: application/json - get: - deprecated: false - description: Gets a Destination filter by id. - operationId: getFilterInDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: filterId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getFilterInDestination_200_response' - application/json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getFilterInDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getFilterInDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: event = "Order Completed" - actions: - - type: DROP_PROPERTIES - fields: - properties: - - userId - - secretValue - title: Order Completed - description: This filter probably does nothing - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/getFilterInDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Filter in Destination - tags: - - Destination Filters - x-domain-hierarchy: - - Connections - - Destination Filters - x-accepts: application/json - patch: - deprecated: false - description: "Updates a filter in a Destination.\n\nWhen called, this endpoint\ - \ may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Destination Filter Enabled\n* Destination Filter Disabled\n \ - \ " - operationId: updateFilterForDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: filterId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - filterId: xx6AySGeFExzdv2Gw2EuhV - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - schema: - $ref: '#/components/schemas/UpdateFilterForDestinationV1Input' - application/vnd.segment.v1beta+json: - example: - filterId: xx6AySGeFExzdv2Gw2EuhV - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - schema: - $ref: '#/components/schemas/UpdateFilterForDestinationV1Input' - application/vnd.segment.v1alpha+json: - example: - filterId: xx6AySGeFExzdv2Gw2EuhV - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - schema: - $ref: '#/components/schemas/UpdateFilterForDestinationV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/updateFilterForDestination_200_response' - application/json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/updateFilterForDestination_200_response' - application/vnd.segment.v1beta+json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/updateFilterForDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - filter: - id: xx6AySGeFExzdv2Gw2EuhV - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationId: fP7qoQw2HTWt9WdMr718gn - if: '!(type = "track")' - actions: - - type: DROP - title: Allow Track - description: Allows track calls through to the destination. - enabled: true - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - schema: - $ref: '#/components/schemas/updateFilterForDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Filter for Destination - tags: - - Destination Filters - x-domain-hierarchy: - - Connections - - Destination Filters - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /sources/{sourceId}/edge-functions/latest: - get: - deprecated: false - description: "Get the latest Edge Functions for your Source.\n\n**Note**: In\ - \ order to successfully call this endpoint, the specified Workspace needs\ - \ to have the Edge Functions feature enabled. Please reach out to your customer\ - \ success manager for more information.\n " - operationId: getLatestFromEdgeFunctions - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - edgeFunctions: - id: 3b48bd4c-7c2c-4dec-813f-905718290a4c - sourceId: qQEHquLrjRDN9j1ByrChyn - downloadURL: https://cdn.edgefn.segment.build/qQEHquLrjRDN9j1ByrChyn/3b48bd4c-7c2c-4dec-813f-905718290a4c.js - createdBy: sgJDWk3K21k6LE3tLU9nRK - createdAt: 2006-01-02T15:04:05.000Z - version: 1 - schema: - $ref: '#/components/schemas/getLatestFromEdgeFunctions_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Latest from Edge Functions - tags: - - Edge Functions - x-domain-hierarchy: - - Connections - - Edge Functions - x-accepts: application/json - /catalog/sources/{sourceMetadataId}: - get: - deprecated: false - description: Returns a Source catalog item by its id. - operationId: getSourceMetadata - parameters: - - explode: false - in: path - name: sourceMetadataId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sourceMetadata: - id: 1bow82lmk - slug: stripe - name: Stripe - categories: - - Payments - description: "Once you have successfully OAuth’d into Stripe,\ - \ we will begin syncing Stripe objects (and their corresponding\ - \ properties) to any databases you have turned on (to turn on\ - \ a database, navigate to the database tab in the navigation\ - \ pane on the left)." - logos: - default: https://cdn.filepicker.io/api/file/jp2UV0RtRU2FZaGxX4qF - alt: https://cdn.filepicker.io/api/file/7BXASJF8ReVG9pfQCX9Z - mark: https://cdn.filepicker.io/api/file/oVSkzKHQ96hIQkbK18ib - options: [] - isCloudEventSource: false - schema: - $ref: '#/components/schemas/getSourceMetadata_200_response' - application/json: - example: - data: - sourceMetadata: - id: 1bow82lmk - slug: stripe - name: Stripe - categories: - - Payments - description: "Once you have successfully OAuth’d into Stripe,\ - \ we will begin syncing Stripe objects (and their corresponding\ - \ properties) to any databases you have turned on (to turn on\ - \ a database, navigate to the database tab in the navigation\ - \ pane on the left)." - logos: - default: https://cdn.filepicker.io/api/file/jp2UV0RtRU2FZaGxX4qF - alt: https://cdn.filepicker.io/api/file/7BXASJF8ReVG9pfQCX9Z - mark: https://cdn.filepicker.io/api/file/oVSkzKHQ96hIQkbK18ib - options: [] - isCloudEventSource: false - schema: - $ref: '#/components/schemas/getSourceMetadata_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sourceMetadata: - id: 1bow82lmk - slug: stripe - name: Stripe - categories: - - Payments - description: "Once you have successfully OAuth’d into Stripe,\ - \ we will begin syncing Stripe objects (and their corresponding\ - \ properties) to any databases you have turned on (to turn on\ - \ a database, navigate to the database tab in the navigation\ - \ pane on the left)." - logos: - default: https://cdn.filepicker.io/api/file/jp2UV0RtRU2FZaGxX4qF - alt: https://cdn.filepicker.io/api/file/7BXASJF8ReVG9pfQCX9Z - mark: https://cdn.filepicker.io/api/file/oVSkzKHQ96hIQkbK18ib - options: [] - isCloudEventSource: false - schema: - $ref: '#/components/schemas/getSourceMetadata_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sourceMetadata: - id: 1bow82lmk - slug: stripe - name: Stripe - categories: - - Payments - description: "Once you have successfully OAuth’d into Stripe,\ - \ we will begin syncing Stripe objects (and their corresponding\ - \ properties) to any databases you have turned on (to turn on\ - \ a database, navigate to the database tab in the navigation\ - \ pane on the left)." - logos: - default: https://cdn.filepicker.io/api/file/jp2UV0RtRU2FZaGxX4qF - alt: https://cdn.filepicker.io/api/file/7BXASJF8ReVG9pfQCX9Z - mark: https://cdn.filepicker.io/api/file/oVSkzKHQ96hIQkbK18ib - options: [] - isCloudEventSource: false - schema: - $ref: '#/components/schemas/getSourceMetadata_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Source Metadata - tags: - - Catalog - x-domain-hierarchy: - - Connections - - Catalog - x-accepts: application/json - /catalog/sources: - get: - deprecated: false - description: Returns a list of all available Sources in the Segment catalog. - operationId: getSourcesCatalog - parameters: - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sourcesCatalog: - - id: 117eYCe9jH - slug: youbora - name: Youbora - categories: - - Analytics - description: "YOUBORA is a business intelligence and video analytics\ - \ solution for the online video industry to maximize revenue\ - \ through understanding user behavior using actionable data.\ - \ The platform delivers high quality and reliable insights based\ - \ on real-time data, in order for your business to ensure the\ - \ delivery of flawless video and a high quality of experiences\ - \ to your users." - logos: - default: https://cdn.filepicker.io/api/file/bzmEOg5CRO2RWAVFeHb5 - mark: https://cdn.filepicker.io/api/file/lIl1q5XSRriNiYAodvnC - options: [] - isCloudEventSource: true - - id: 1QTd6JKw53 - slug: regal-voice - name: Regal Voice - categories: - - Marketing Automation - - Personalization - - SMS & Push Notifications - description: Next-gen phone marketing and sales enablement for - innovative consumer and financial services brands - logos: - default: https://public-segment-devcenter-production.s3.amazonaws.com/a3189276-1b86-4126-a31c-d1a50057b7fe.svg - mark: https://public-segment-devcenter-production.s3.amazonaws.com/e20664bd-2398-440a-a6d6-59cd348b25e2.svg - options: - - name: api-key - required: true - type: string - defaultValue: "" - description: Regal Voice API key - isCloudEventSource: true - pagination: - current: MA== - next: Mg== - totalEntries: 81 - schema: - $ref: '#/components/schemas/getSourcesCatalog_200_response' - application/json: - example: - data: - sourcesCatalog: - - id: 117eYCe9jH - slug: youbora - name: Youbora - categories: - - Analytics - description: "YOUBORA is a business intelligence and video analytics\ - \ solution for the online video industry to maximize revenue\ - \ through understanding user behavior using actionable data.\ - \ The platform delivers high quality and reliable insights based\ - \ on real-time data, in order for your business to ensure the\ - \ delivery of flawless video and a high quality of experiences\ - \ to your users." - logos: - default: https://cdn.filepicker.io/api/file/bzmEOg5CRO2RWAVFeHb5 - mark: https://cdn.filepicker.io/api/file/lIl1q5XSRriNiYAodvnC - options: [] - isCloudEventSource: true - - id: 1QTd6JKw53 - slug: regal-voice - name: Regal Voice - categories: - - Marketing Automation - - Personalization - - SMS & Push Notifications - description: Next-gen phone marketing and sales enablement for - innovative consumer and financial services brands - logos: - default: https://public-segment-devcenter-production.s3.amazonaws.com/a3189276-1b86-4126-a31c-d1a50057b7fe.svg - mark: https://public-segment-devcenter-production.s3.amazonaws.com/e20664bd-2398-440a-a6d6-59cd348b25e2.svg - options: - - name: api-key - required: true - type: string - defaultValue: "" - description: Regal Voice API key - isCloudEventSource: true - pagination: - current: MA== - next: Mg== - totalEntries: 81 - schema: - $ref: '#/components/schemas/getSourcesCatalog_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sourcesCatalog: - - id: 117eYCe9jH - slug: youbora - name: Youbora - categories: - - Analytics - description: "YOUBORA is a business intelligence and video analytics\ - \ solution for the online video industry to maximize revenue\ - \ through understanding user behavior using actionable data.\ - \ The platform delivers high quality and reliable insights based\ - \ on real-time data, in order for your business to ensure the\ - \ delivery of flawless video and a high quality of experiences\ - \ to your users." - logos: - default: https://cdn.filepicker.io/api/file/bzmEOg5CRO2RWAVFeHb5 - mark: https://cdn.filepicker.io/api/file/lIl1q5XSRriNiYAodvnC - options: [] - isCloudEventSource: true - - id: 1QTd6JKw53 - slug: regal-voice - name: Regal Voice - categories: - - Marketing Automation - - Personalization - - SMS & Push Notifications - description: Next-gen phone marketing and sales enablement for - innovative consumer and financial services brands - logos: - default: https://public-segment-devcenter-production.s3.amazonaws.com/a3189276-1b86-4126-a31c-d1a50057b7fe.svg - mark: https://public-segment-devcenter-production.s3.amazonaws.com/e20664bd-2398-440a-a6d6-59cd348b25e2.svg - options: - - name: api-key - required: true - type: string - defaultValue: "" - description: Regal Voice API key - isCloudEventSource: true - pagination: - current: MA== - next: Mg== - totalEntries: 81 - schema: - $ref: '#/components/schemas/getSourcesCatalog_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sourcesCatalog: - - id: 117eYCe9jH - slug: youbora - name: Youbora - categories: - - Analytics - description: "YOUBORA is a business intelligence and video analytics\ - \ solution for the online video industry to maximize revenue\ - \ through understanding user behavior using actionable data.\ - \ The platform delivers high quality and reliable insights based\ - \ on real-time data, in order for your business to ensure the\ - \ delivery of flawless video and a high quality of experiences\ - \ to your users." - logos: - default: https://cdn.filepicker.io/api/file/bzmEOg5CRO2RWAVFeHb5 - mark: https://cdn.filepicker.io/api/file/lIl1q5XSRriNiYAodvnC - options: [] - isCloudEventSource: true - - id: 1QTd6JKw53 - slug: regal-voice - name: Regal Voice - categories: - - Marketing Automation - - Personalization - - SMS & Push Notifications - description: Next-gen phone marketing and sales enablement for - innovative consumer and financial services brands - logos: - default: https://public-segment-devcenter-production.s3.amazonaws.com/a3189276-1b86-4126-a31c-d1a50057b7fe.svg - mark: https://public-segment-devcenter-production.s3.amazonaws.com/e20664bd-2398-440a-a6d6-59cd348b25e2.svg - options: - - name: api-key - required: true - type: string - defaultValue: "" - description: Regal Voice API key - isCloudEventSource: true - pagination: - current: MA== - next: Mg== - totalEntries: 81 - schema: - $ref: '#/components/schemas/getSourcesCatalog_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Sources Catalog - tags: - - Catalog - x-domain-hierarchy: - - Connections - - Catalog - x-accepts: application/json - /spaces/{spaceId}: - get: - deprecated: false - description: Returns the Space by id. - operationId: getSpace - parameters: - - explode: false - in: path - name: spaceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - space: - id: 9aQ1Lj62S4bomZKLF4DPqW - name: Default Space Papi E2E - slug: default-space-papi-e2e - schema: - $ref: '#/components/schemas/getSpace_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Space - tags: - - Spaces - x-domain-hierarchy: - - Engage - - Spaces - x-accepts: application/json - /destinations/{destinationId}/subscriptions/{id}: - delete: - deprecated: false - description: Deletes an existing Destination subscription. - operationId: removeSubscriptionFromDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: id - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeSubscriptionFromDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Remove Subscription from Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - get: - deprecated: false - description: Gets a Destination subscription by id. - operationId: getSubscriptionFromDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: id - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - subscription: - id: bfSKRLi2V3eGQFuAaGuv2m - name: Example Subscription - actionId: jiMz7MfHNeHmUckzRnUGkU - actionSlug: someActionSlug - destinationId: fP7qoQw2HTWt9WdMr718gn - trigger: type = "track" - enabled: false - settings: {} - schema: - $ref: '#/components/schemas/getSubscriptionFromDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Subscription from Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - patch: - deprecated: false - description: Updates an existing Destination subscription. - operationId: updateSubscriptionForDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: id - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1alpha+json: - example: - id: jur9cutEarKFw7fD65TCkq - destinationId: fP7qoQw2HTWt9WdMr718gn - input: - name: Updated name - schema: - $ref: '#/components/schemas/UpdateSubscriptionForDestinationAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - subscription: - id: jur9cutEarKFw7fD65TCkq - name: Updated name - actionId: jiMz7MfHNeHmUckzRnUGkU - actionSlug: someActionSlug - destinationId: fP7qoQw2HTWt9WdMr718gn - trigger: type = "track" - enabled: false - settings: {} - schema: - $ref: '#/components/schemas/updateSubscriptionForDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Subscription for Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-content-type: application/vnd.segment.v1alpha+json - x-accepts: application/json - /users/{userId}: - get: - deprecated: false - description: Returns a user given their id. - operationId: getUser - parameters: - - explode: false - in: path - name: userId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - user: - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUser_200_response' - application/json: - example: - data: - user: - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUser_200_response' - application/vnd.segment.v1beta+json: - example: - data: - user: - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUser_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - user: - id: sgJDWk3K21k6LE3tLU9nRK - name: "" - email: papi@segment.com - permissions: - - roleId: 1WDUuRLxv84rrfCNUwvkrRtkxnS - roleName: Workspace Owner - resources: - - id: 9aQ1Lj62S4bomZKLF4DPqW - type: WORKSPACE - labels: [] - schema: - $ref: '#/components/schemas/getUser_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get User - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-accepts: application/json - /catalog/warehouses/{warehouseMetadataId}: - get: - deprecated: false - description: Returns a Warehouse catalog item by its id. - operationId: getWarehouseMetadata - parameters: - - explode: false - in: path - name: warehouseMetadataId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehouseMetadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - schema: - $ref: '#/components/schemas/getWarehouseMetadata_200_response' - application/json: - example: - data: - warehouseMetadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - schema: - $ref: '#/components/schemas/getWarehouseMetadata_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehouseMetadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - schema: - $ref: '#/components/schemas/getWarehouseMetadata_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehouseMetadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - schema: - $ref: '#/components/schemas/getWarehouseMetadata_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Warehouse Metadata - tags: - - Catalog - x-domain-hierarchy: - - Connections - - Catalog - x-accepts: application/json - /catalog/warehouses: - get: - deprecated: false - description: Returns a list of all available Warehouses in the Segment catalog. - operationId: getWarehousesCatalog - parameters: - - description: |- - Required pagination params used to filter the Warehouses catalog. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehousesCatalog: - - id: VxcZnH5UIM - slug: azuresqldb - name: Azure SQL Database - description: Connector for Azure SQL Database - logos: - default: https://msftplayground.com/wp-content/uploads/2017/04/logoAzureSql.png - mark: "" - alt: "" - options: [] - - id: WcjBCzUGff - slug: azuresqldw - name: Azure SQL Data Warehouse - description: Connector for Azure SQL Data Warehouse - logos: - default: https://cdn.filepicker.io/api/file/VKbuWjNjQPKOnOWijFe4 - mark: https://cdn.filepicker.io/api/file/EUJvt69Q7qMqCvGrVtiu - alt: "" - options: [] - pagination: - current: MA== - next: Mg== - totalEntries: 7 - schema: - $ref: '#/components/schemas/getWarehousesCatalog_200_response' - application/json: - example: - data: - warehousesCatalog: - - id: VxcZnH5UIM - slug: azuresqldb - name: Azure SQL Database - description: Connector for Azure SQL Database - logos: - default: https://msftplayground.com/wp-content/uploads/2017/04/logoAzureSql.png - mark: "" - alt: "" - options: [] - - id: WcjBCzUGff - slug: azuresqldw - name: Azure SQL Data Warehouse - description: Connector for Azure SQL Data Warehouse - logos: - default: https://cdn.filepicker.io/api/file/VKbuWjNjQPKOnOWijFe4 - mark: https://cdn.filepicker.io/api/file/EUJvt69Q7qMqCvGrVtiu - alt: "" - options: [] - pagination: - current: MA== - next: Mg== - totalEntries: 7 - schema: - $ref: '#/components/schemas/getWarehousesCatalog_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehousesCatalog: - - id: VxcZnH5UIM - slug: azuresqldb - name: Azure SQL Database - description: Connector for Azure SQL Database - logos: - default: https://msftplayground.com/wp-content/uploads/2017/04/logoAzureSql.png - mark: "" - alt: "" - options: [] - - id: WcjBCzUGff - slug: azuresqldw - name: Azure SQL Data Warehouse - description: Connector for Azure SQL Data Warehouse - logos: - default: https://cdn.filepicker.io/api/file/VKbuWjNjQPKOnOWijFe4 - mark: https://cdn.filepicker.io/api/file/EUJvt69Q7qMqCvGrVtiu - alt: "" - options: [] - pagination: - current: MA== - next: Mg== - totalEntries: 7 - schema: - $ref: '#/components/schemas/getWarehousesCatalog_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehousesCatalog: - - id: VxcZnH5UIM - slug: azuresqldb - name: Azure SQL Database - description: Connector for Azure SQL Database - logos: - default: https://msftplayground.com/wp-content/uploads/2017/04/logoAzureSql.png - mark: "" - alt: "" - options: [] - - id: WcjBCzUGff - slug: azuresqldw - name: Azure SQL Data Warehouse - description: Connector for Azure SQL Data Warehouse - logos: - default: https://cdn.filepicker.io/api/file/VKbuWjNjQPKOnOWijFe4 - mark: https://cdn.filepicker.io/api/file/EUJvt69Q7qMqCvGrVtiu - alt: "" - options: [] - pagination: - current: MA== - next: Mg== - totalEntries: 7 - schema: - $ref: '#/components/schemas/getWarehousesCatalog_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Warehouses Catalog - tags: - - Catalog - x-domain-hierarchy: - - Connections - - Catalog - x-accepts: application/json - /: - get: - deprecated: false - description: Returns the Workspace associated with the token used to access - this resource. - operationId: getWorkspace - parameters: [] - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - workspace: - id: 9aQ1Lj62S4bomZKLF4DPqW - name: papi e2e - slug: papi-e2e - schema: - $ref: '#/components/schemas/getWorkspace_200_response' - application/json: - example: - data: - workspace: - id: 9aQ1Lj62S4bomZKLF4DPqW - name: papi e2e - slug: papi-e2e - schema: - $ref: '#/components/schemas/getWorkspace_200_response' - application/vnd.segment.v1beta+json: - example: - data: - workspace: - id: 9aQ1Lj62S4bomZKLF4DPqW - name: papi e2e - slug: papi-e2e - schema: - $ref: '#/components/schemas/getWorkspace_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - workspace: - id: 9aQ1Lj62S4bomZKLF4DPqW - name: papi e2e - slug: papi-e2e - schema: - $ref: '#/components/schemas/getWorkspace_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Get Workspace - tags: - - Workspaces - x-domain-hierarchy: - - General - - Workspaces - x-accepts: application/json - /audit-events: - get: - deprecated: false - description: Returns a list of Audit Trail events. - operationId: listAuditEvents - parameters: - - description: |- - Filter response to events that happened after this time. - - This parameter exists in v1. - explode: false - in: query - name: startTime - required: false - schema: - description: Filter response to events that happened after this time. - title: startTime - type: string - style: deepObject - - description: "Filter response to events that happened before this time.\n\ - Defaults to the current time, or the end time from the pagination cursor.\n\ - \nThis parameter exists in v1." - explode: false - in: query - name: endTime - required: false - schema: - description: "Filter response to events that happened before this time.\n\ - Defaults to the current time, or the end time from the pagination cursor." - title: endTime - type: string - style: deepObject - - description: "Filter response to events that affect a specific resource, for\ - \ example, a single Source.\n\nThis parameter exists in v1." - explode: false - in: query - name: resourceId - required: false - schema: - description: "Filter response to events that affect a specific resource,\ - \ for example, a single Source." - title: resourceId - type: string - style: deepObject - - description: "Filter response to events that affect a specific type, for example,\ - \ Sources, Warehouses, and Tracking Plans.\n\nThis parameter exists in v1." - explode: false - in: query - name: resourceType - required: false - schema: - description: "Filter response to events that affect a specific type, for\ - \ example, Sources, Warehouses, and Tracking Plans." - title: resourceType - type: string - style: deepObject - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - events: - - id: events/145876976 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Deleted - actor: public-api-token/TJ7z8cg6 - resourceId: 8AWE8yZRdy - resourceType: function - resourceName: Foo Func 543 - - id: events/145876978 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Modified - actor: public-api-token/TJ7z8cg6 - resourceId: sfnc_tFXvS0Rs6T - resourceType: function - resourceName: displayName - pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 - schema: - $ref: '#/components/schemas/listAuditEvents_200_response' - application/json: - example: - data: - events: - - id: events/145876976 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Deleted - actor: public-api-token/TJ7z8cg6 - resourceId: 8AWE8yZRdy - resourceType: function - resourceName: Foo Func 543 - - id: events/145876978 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Modified - actor: public-api-token/TJ7z8cg6 - resourceId: sfnc_tFXvS0Rs6T - resourceType: function - resourceName: displayName - pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzIuMDE1WiJ9 - schema: - $ref: '#/components/schemas/listAuditEvents_200_response' - application/vnd.segment.v1beta+json: - example: - data: - events: - - id: events/145876976 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Deleted - actor: public-api-token/TJ7z8cg6 - resourceId: 8AWE8yZRdy - resourceType: function - resourceName: Foo Func 543 - - id: events/145876978 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Modified - actor: public-api-token/TJ7z8cg6 - resourceId: sfnc_tFXvS0Rs6T - resourceType: function - resourceName: displayName - pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuNjQxWiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuNjQxWiJ9 - schema: - $ref: '#/components/schemas/listAuditEvents_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - events: - - id: events/145876976 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Deleted - actor: public-api-token/TJ7z8cg6 - resourceId: 8AWE8yZRdy - resourceType: function - resourceName: Foo Func 543 - - id: events/145876978 - timestamp: 2022-03-04T21:29:22Z - type: Source Function Modified - actor: public-api-token/TJ7z8cg6 - resourceId: sfnc_tFXvS0Rs6T - resourceType: function - resourceName: displayName - pagination: - current: eyJwYWdlVG9rZW4iOiJNUT09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuMTM4WiJ9 - next: eyJwYWdlVG9rZW4iOiJNZz09IiwiZW5kVGltZSI6IjIwMjItMDgtMjVUMjA6MTM6MzEuMTM4WiJ9 - schema: - $ref: '#/components/schemas/listAuditEvents_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Audit Events - tags: - - Audit Trail - x-domain-hierarchy: - - Admin - - Audit Trail - x-accepts: application/json - /sources/{sourceId}/connected-destinations: - get: - deprecated: false - description: Returns a list of Destinations connected to a Source. - operationId: listConnectedDestinationsFromSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Required pagination params for the request. - - This parameter exists in alpha. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - destinations: [] - pagination: - current: MQ== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response' - application/json: - example: - data: - destinations: [] - pagination: - current: MQ== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - destinations: [] - pagination: - current: MQ== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - destinations: [] - pagination: - current: MQ== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listConnectedDestinationsFromSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Connected Destinations from Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-accepts: application/json - /warehouses/{warehouseId}/connected-sources: - get: - deprecated: false - description: Returns the list of Sources that are connected to a Warehouse. - operationId: listConnectedSourcesFromWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - application/json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sources: - - id: qQEHquLrjRDN9j1ByrChyn - slug: ios - name: "" - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - writeKeys: - - 3YdEudTwjouyC5WPjpbTik - metadata: - id: UBrsG9RVzw - slug: ios - name: iOS - categories: - - Mobile - description: "" - logos: - default: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - alt: https://cdn.filepicker.io/api/file/qWgSP5cpS7eeW2voq13u - options: [] - isCloudEventSource: false - settings: {} - labels: [] - pagination: - current: MA== - next: MQ== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listConnectedSourcesFromWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Connected Sources from Warehouse - tags: - - Warehouses - x-domain-hierarchy: - - Connections - - Warehouses - x-accepts: application/json - /sources/{sourceId}/connected-warehouses: - get: - deprecated: false - description: Returns a list of Warehouses connected to a Source. - operationId: listConnectedWarehousesFromSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Required pagination params for the request. - - This parameter exists in alpha. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response' - application/json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - warehouses: - - id: kjU72LCJexvrqL7G4TMHHN - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: 55d3d3aea3c - slug: postgres - name: Postgres - description: Open source data warehouse - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/postgres-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - - id: v1e6FCE8P9EvQmCLWpKtJ3 - workspaceId: 9aQ1Lj62S4bomZKLF4DPqW - enabled: true - metadata: - id: aea3c55dsz - slug: redshift - name: Redshift - description: Powered by Amazon Web Services - logos: - default: https://d3hotuclm6if1r.cloudfront.net/logos/redshift-default.svg - mark: "" - alt: "" - options: - - name: port - required: true - type: string - - name: database - required: true - type: string - - name: hostname - required: true - type: string - - name: password - required: true - type: string - - name: username - required: true - type: string - - name: ciphertext - required: true - type: string - settings: {} - pagination: - current: MA== - totalEntries: 2 - schema: - $ref: '#/components/schemas/listConnectedWarehousesFromSource_200_response_1' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Connected Warehouses from Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-accepts: application/json - /destinations/{destinationId}/delivery-metrics: - get: - deprecated: false - description: "Get event delivery metrics summary from a Destination.\n \ - \ \n Based on the granularity, there are restrictions on the time range you\ - \ can query:\n\n\n\n **Minute Granularity**:\n\n - Max time range: 4 hours\n\ - \n - Oldest possible start time: 48 hours in the past\n\n\n\n **Hour Granularity**:\n\ - \n - Max Time range: 1 week\n\n - Oldest possible start time: 10 days in\ - \ the past\n\n\n\n **Day Granularity**:\n\n - Max time range: 60 days\n\n\ - \ - Oldest possible start time: 60 days in the past\n \n " - operationId: listDeliveryMetricsSummaryFromDestination - parameters: - - explode: false - in: path - name: destinationId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: "The id of the Source linked to the Destination.\n\nConfig API\ - \ note: analogous to `parent`.\n\nThis parameter exists in beta." - explode: false - in: query - name: sourceId - required: true - schema: - description: "The id of the Source linked to the Destination.\n\nConfig\ - \ API note: analogous to `parent`." - title: sourceId - type: string - style: deepObject - - description: |- - Filter events that happened after this time. - - Defaults to: - - 1 hour ago if granularity is `MINUTE`. - - 7 days ago if granularity is `HOUR`. - - 30 days ago if granularity is `DAY`. - - This parameter exists in beta. - explode: false - in: query - name: startTime - required: false - schema: - description: |- - Filter events that happened after this time. - - Defaults to: - - 1 hour ago if granularity is `MINUTE`. - - 7 days ago if granularity is `HOUR`. - - 30 days ago if granularity is `DAY`. - title: startTime - type: string - style: deepObject - - description: |- - Filter events that happened before this time. Defaults to now if not set. - - This parameter exists in beta. - explode: false - in: query - name: endTime - required: false - schema: - description: Filter events that happened before this time. Defaults to now - if not set. - title: endTime - type: string - style: deepObject - - description: "The granularity to filter metrics to. Either `MINUTE`, `HOUR`\ - \ or `DAY`.\n\nDefaults to `MINUTE` if not set.\n\nThis parameter exists\ - \ in beta." - explode: false - in: query - name: granularity - required: false - schema: - description: "The granularity to filter metrics to. Either `MINUTE`, `HOUR`\ - \ or `DAY`.\n\nDefaults to `MINUTE` if not set." - enum: - - DAY - - HOUR - - MINUTE - title: granularity - type: string - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1beta+json: - example: - data: - deliveryMetricsSummary: - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 54521fd725e721e32a72eebb - metrics: - - metricName: successes - total: 120 - breakdown: - - metricName: successes_on_first_attempt - value: 60 - - metricName: successes_after_retry - value: 60 - - metricName: expired - total: 0 - - metricName: discarded - total: 0 - - metricName: retried - total: 0 - - metricName: time_to_success - total: 10 - breakdown: - - metricName: time_to_success_average - value: 0 - - metricName: time_to_success_p95 - value: 0 - - metricName: time_to_first_attempt - total: 10 - breakdown: - - metricName: time_to_first_attempt_average - value: 0 - - metricName: time_to_first_attempt_p95 - value: 0 - schema: - $ref: '#/components/schemas/listDeliveryMetricsSummaryFromDestination_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - deliveryMetricsSummary: - sourceId: rh5BDZp6QDHvXFCkibm1pR - destinationMetadataId: 54521fd725e721e32a72eebb - metrics: - - metricName: successes - total: 120 - breakdown: - - metricName: successes_on_first_attempt - value: 60 - - metricName: successes_after_retry - value: 60 - - metricName: expired - total: 0 - - metricName: discarded - total: 0 - - metricName: retried - total: 0 - - metricName: time_to_success - total: 10 - breakdown: - - metricName: time_to_success_average - value: 0 - - metricName: time_to_success_p95 - value: 0 - - metricName: time_to_first_attempt - total: 10 - breakdown: - - metricName: time_to_first_attempt_average - value: 0 - - metricName: time_to_first_attempt_p95 - value: 0 - schema: - $ref: '#/components/schemas/listDeliveryMetricsSummaryFromDestination_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Delivery Metrics Summary from Destination - tags: - - Destinations - x-domain-hierarchy: - - Connections - - Destinations - x-accepts: application/json - /groups/{userGroupId}/invites: - get: - deprecated: false - description: Returns the emails of invitees to a user group. - operationId: listInvitesFromUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination for invites to the group. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - emails: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - application/json: - example: - data: - emails: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - emails: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - emails: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listInvitesFromUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Invites from User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-accepts: application/json - /roles: - get: - deprecated: false - description: Returns a list of Roles available to apply to permissions for users - and/or groups. - operationId: listRoles - parameters: - - description: |- - Pagination for roles. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - roles: - - id: 1WDUuRLxv84rrfCNUwvkrRtkxnS - name: Workspace Owner - description: "Owners have full read and edit access to everything\ - \ in the workspace, including Sources, Destinations, add-on\ - \ products, and settings. Owners have full edit access to all\ - \ Team Permissions." - - id: 1aEWAcU0fArxScocwH9xxLgW7r3 - name: Minimal Workspace Access - description: Access to view the workspace. Cannot view any sub - resources or make changes to the workspace. - pagination: - current: MA== - next: Mg== - schema: - $ref: '#/components/schemas/listRoles_200_response' - application/json: - example: - data: - roles: - - id: 1WDUuRLxv84rrfCNUwvkrRtkxnS - name: Workspace Owner - description: "Owners have full read and edit access to everything\ - \ in the workspace, including Sources, Destinations, add-on\ - \ products, and settings. Owners have full edit access to all\ - \ Team Permissions." - - id: 1aEWAcU0fArxScocwH9xxLgW7r3 - name: Minimal Workspace Access - description: Access to view the workspace. Cannot view any sub - resources or make changes to the workspace. - pagination: - current: MA== - next: Mg== - schema: - $ref: '#/components/schemas/listRoles_200_response' - application/vnd.segment.v1beta+json: - example: - data: - roles: - - id: 1WDUuRLxv84rrfCNUwvkrRtkxnS - name: Workspace Owner - description: "Owners have full read and edit access to everything\ - \ in the workspace, including Sources, Destinations, add-on\ - \ products, and settings. Owners have full edit access to all\ - \ Team Permissions." - - id: 1aEWAcU0fArxScocwH9xxLgW7r3 - name: Minimal Workspace Access - description: Access to view the workspace. Cannot view any sub - resources or make changes to the workspace. - pagination: - current: MA== - next: Mg== - schema: - $ref: '#/components/schemas/listRoles_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - roles: - - id: 1WDUuRLxv84rrfCNUwvkrRtkxnS - name: Workspace Owner - description: "Owners have full read and edit access to everything\ - \ in the workspace, including Sources, Destinations, add-on\ - \ products, and settings. Owners have full edit access to all\ - \ Team Permissions." - - id: 1aEWAcU0fArxScocwH9xxLgW7r3 - name: Minimal Workspace Access - description: Access to view the workspace. Cannot view any sub - resources or make changes to the workspace. - pagination: - current: MA== - next: Mg== - schema: - $ref: '#/components/schemas/listRoles_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Roles - tags: - - IAM Roles - x-domain-hierarchy: - - Admin - - IAM Roles - x-accepts: application/json - /tracking-plans/{trackingPlanId}/rules: - delete: - deprecated: false - description: "Deletes Tracking Plan rules.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: removeRulesFromTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Rules to delete. - - This parameter exists in v1. - explode: false - in: query - name: rules - required: true - schema: - description: Rules to delete. - items: - $ref: '#/components/schemas/RemoveRuleV1' - title: rules - type: array - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeRulesFromTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Remove Rules from Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - get: - deprecated: false - description: "Lists Tracking Plan rules.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information.\n\n\nThe rate limit for this endpoint is 20 requests per minute,\ - \ which is lower than the default due to access pattern restrictions. Once\ - \ reached, this endpoint will respond with the 429 HTTP status code with headers\ - \ indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: listRulesFromTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination options. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - rules: - - key: New Tracking Plan Rule - type: TRACK - version: 1 - jsonSchema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - context: - type: object - traits: - type: object - properties: - type: object - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - deprecatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - application/json: - example: - data: - rules: - - key: New Tracking Plan Rule - type: TRACK - version: 1 - jsonSchema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - context: - type: object - traits: - type: object - properties: - type: object - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - deprecatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - rules: - - key: New Tracking Plan Rule - type: TRACK - version: 1 - jsonSchema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - context: - type: object - traits: - type: object - properties: - type: object - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - deprecatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - rules: - - key: New Tracking Plan Rule - type: TRACK - version: 1 - jsonSchema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - context: - type: object - traits: - type: object - properties: - type: object - createdAt: 2006-01-02T15:04:05.000Z - updatedAt: 2006-01-02T15:04:05.000Z - deprecatedAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - schema: - $ref: '#/components/schemas/listRulesFromTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Rules from Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-accepts: application/json - patch: - deprecated: false - description: "Updates Tracking Plan rules.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: updateRulesInTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - rules: - - key: New Rule - type: TRACK - version: 1 - jsonSchema: {} - schema: - $ref: '#/components/schemas/UpdateRulesInTrackingPlanV1Input' - application/vnd.segment.v1beta+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - rules: - - key: New Rule - type: TRACK - version: 1 - jsonSchema: {} - schema: - $ref: '#/components/schemas/UpdateRulesInTrackingPlanV1Input' - application/vnd.segment.v1alpha+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - rules: - - key: New Rule - type: TRACK - version: 1 - jsonSchema: {} - schema: - $ref: '#/components/schemas/UpdateRulesInTrackingPlanV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/updateRulesInTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Rules in Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - put: - deprecated: false - description: "Replaces Tracking Plan rules.\n\n**Note**: In order to successfully\ - \ call this endpoint, the specified Workspace needs to have the Protocols\ - \ feature enabled. Please reach out to your customer success manager for more\ - \ information." - operationId: replaceRulesInTrackingPlan - parameters: - - explode: false - in: path - name: trackingPlanId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - rules: - - key: New Replaced Rule - type: TRACK - version: 1 - jsonSchema: {} - schema: - $ref: '#/components/schemas/ReplaceRulesInTrackingPlanV1Input' - application/vnd.segment.v1beta+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - rules: - - key: New Replaced Rule - type: TRACK - version: 1 - jsonSchema: {} - schema: - $ref: '#/components/schemas/ReplaceRulesInTrackingPlanV1Input' - application/vnd.segment.v1alpha+json: - example: - trackingPlanId: tp_sprout_rVGCC6WdrNxjCf6JpCHP - rules: - - key: New Replaced Rule - type: TRACK - version: 1 - jsonSchema: {} - schema: - $ref: '#/components/schemas/ReplaceRulesInTrackingPlanV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/replaceRulesInTrackingPlan_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Rules in Tracking Plan - tags: - - Tracking Plans - x-domain-hierarchy: - - Protocols - - Tracking Plans - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /sources/{sourceId}/settings: - get: - deprecated: false - description: "Retrieves the schema configuration settings for a Source. If Protocols\ - \ is not enabled for the Source, the configurations specific to Protocols\ - \ will have default values." - operationId: listSchemaSettingsInSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: true - allowUnplannedEventProperties: true - allowEventOnViolations: false - allowPropertiesOnViolations: true - commonEventOnViolations: ALLOW - group: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - forwardingBlockedEventsTo: "" - forwardingViolationsTo: "" - schema: - $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - application/json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: true - allowUnplannedEventProperties: true - allowEventOnViolations: false - allowPropertiesOnViolations: true - commonEventOnViolations: ALLOW - group: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - forwardingBlockedEventsTo: "" - forwardingViolationsTo: "" - schema: - $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: true - allowUnplannedEventProperties: true - allowEventOnViolations: false - allowPropertiesOnViolations: true - commonEventOnViolations: ALLOW - group: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - forwardingBlockedEventsTo: "" - forwardingViolationsTo: "" - schema: - $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: true - allowUnplannedEventProperties: true - allowEventOnViolations: false - allowPropertiesOnViolations: true - commonEventOnViolations: ALLOW - group: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: ALLOW - forwardingBlockedEventsTo: "" - forwardingViolationsTo: "" - schema: - $ref: '#/components/schemas/listSchemaSettingsInSource_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Schema Settings in Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-accepts: application/json - patch: - deprecated: false - description: "Updates the schema configuration for a Source. If Protocols is\ - \ not enabled for the Source, any updates to Protocols-specific configurations\ - \ will not be applied.\n\n Config API omitted fields:\n- `updateMask`\n\ - \ " - operationId: updateSchemaSettingsInSource - parameters: - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - sourceId: qQEHquLrjRDN9j1ByrChyn - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - track: - allowEventOnViolations: false - allowPropertiesOnViolations: false - allowUnplannedEventProperties: false - allowUnplannedEvents: false - commonEventOnViolations: OMIT_PROPERTIES - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/UpdateSchemaSettingsInSourceV1Input' - application/vnd.segment.v1beta+json: - example: - sourceId: qQEHquLrjRDN9j1ByrChyn - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - track: - allowEventOnViolations: false - allowPropertiesOnViolations: false - allowUnplannedEventProperties: false - allowUnplannedEvents: false - commonEventOnViolations: OMIT_PROPERTIES - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/UpdateSchemaSettingsInSourceV1Input' - application/vnd.segment.v1alpha+json: - example: - sourceId: qQEHquLrjRDN9j1ByrChyn - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - track: - allowEventOnViolations: false - allowPropertiesOnViolations: false - allowUnplannedEventProperties: false - allowUnplannedEvents: false - commonEventOnViolations: OMIT_PROPERTIES - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/UpdateSchemaSettingsInSourceV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: false - allowUnplannedEventProperties: false - allowEventOnViolations: false - allowPropertiesOnViolations: false - commonEventOnViolations: OMIT_PROPERTIES - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - application/json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: false - allowUnplannedEventProperties: false - allowEventOnViolations: false - allowPropertiesOnViolations: false - commonEventOnViolations: OMIT_PROPERTIES - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: false - allowUnplannedEventProperties: false - allowEventOnViolations: false - allowPropertiesOnViolations: false - commonEventOnViolations: OMIT_PROPERTIES - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - sourceId: qQEHquLrjRDN9j1ByrChyn - settings: - track: - allowUnplannedEvents: false - allowUnplannedEventProperties: false - allowEventOnViolations: false - allowPropertiesOnViolations: false - commonEventOnViolations: OMIT_PROPERTIES - group: - allowTraitsOnViolations: false - allowUnplannedTraits: false - commonEventOnViolations: ALLOW - identify: - allowTraitsOnViolations: true - allowUnplannedTraits: true - commonEventOnViolations: BLOCK - forwardingBlockedEventsTo: rh5BDZp6QDHvXFCkibm1pR - forwardingViolationsTo: rh5BDZp6QDHvXFCkibm1pR - schema: - $ref: '#/components/schemas/updateSchemaSettingsInSource_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Schema Settings in Source - tags: - - Sources - x-domain-hierarchy: - - Connections - - Sources - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs: - get: - deprecated: false - description: "Returns the schema for a Warehouse, including Sources, Collections,\ - \ and Properties.\n\n\nThe rate limit for this endpoint is 2 requests per\ - \ minute, which is lower than the default due to access pattern restrictions.\ - \ Once reached, this endpoint will respond with the 429 HTTP status code with\ - \ headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: listSelectiveSyncsFromWarehouseAndSource - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - items: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - collection: tracks - warehouseId: 6WzNjtobBv3GjubD8wUnA6 - source: hV2lO1ZmMd - properties: - amount: - enabled: true - type: integer - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - context_library_name: - enabled: true - type: string - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTAw - totalEntries: 10 - schema: - $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - application/json: - example: - data: - items: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - collection: tracks - warehouseId: 6WzNjtobBv3GjubD8wUnA6 - source: hV2lO1ZmMd - properties: - amount: - enabled: true - type: integer - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - context_library_name: - enabled: true - type: string - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTAw - totalEntries: 10 - schema: - $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - items: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - collection: tracks - warehouseId: 6WzNjtobBv3GjubD8wUnA6 - source: hV2lO1ZmMd - properties: - amount: - enabled: true - type: integer - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - context_library_name: - enabled: true - type: string - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTAw - totalEntries: 10 - schema: - $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - items: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - collection: tracks - warehouseId: 6WzNjtobBv3GjubD8wUnA6 - source: hV2lO1ZmMd - properties: - amount: - enabled: true - type: integer - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - context_library_name: - enabled: true - type: string - lastSeenAt: 2006-01-02T15:04:05.000Z - createdAt: 2006-01-02T15:04:05.000Z - pagination: - current: MA== - next: MTAw - totalEntries: 10 - schema: - $ref: '#/components/schemas/listSelectiveSyncsFromWarehouseAndSource_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Selective Syncs from Warehouse And Source - tags: - - Selective Sync - x-domain-hierarchy: - - Connections - - Selective Sync - x-accepts: application/json - /suppressions: - get: - deprecated: false - description: Lists all suppressions in a given Workspace. - operationId: listSuppressions - parameters: - - description: |- - Pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - suppressed: - - subjectType: userId - subjectIds: - - "1" - pagination: - current: MQ== - next: cmVnLTY1MDgtMDA5ODE= - schema: - $ref: '#/components/schemas/listSuppressions_200_response' - application/json: - example: - data: - suppressed: - - subjectType: userId - subjectIds: - - "1" - pagination: - current: MQ== - next: cmVnLTY1MDgtMDA5ODE= - schema: - $ref: '#/components/schemas/listSuppressions_200_response' - application/vnd.segment.v1beta+json: - example: - data: - suppressed: - - subjectType: userId - subjectIds: - - "1" - pagination: - current: MQ== - next: cmVnLTY1MDgtMDA5ODE= - schema: - $ref: '#/components/schemas/listSuppressions_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - suppressed: - - subjectType: userId - subjectIds: - - "1" - pagination: - current: MQ== - next: cmVnLTY1MDgtMDA5ODE= - schema: - $ref: '#/components/schemas/listSuppressions_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Suppressions - tags: - - Deletion and Suppression - x-domain-hierarchy: - - Connections - - Deletion and Suppression - x-accepts: application/json - /warehouses/{warehouseId}/syncs: - get: - deprecated: false - description: "Returns the overview of syncs for every Source connected to a\ - \ Warehouse.\n\n\nThe rate limit for this endpoint is 2 requests per minute,\ - \ which is lower than the default due to access pattern restrictions. Once\ - \ reached, this endpoint will respond with the 429 HTTP status code with headers\ - \ indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: listSyncsFromWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - application/json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Syncs from Warehouse - tags: - - Selective Sync - x-domain-hierarchy: - - Connections - - Selective Sync - x-accepts: application/json - /warehouses/{warehouseId}/connected-sources/{sourceId}/syncs: - get: - deprecated: false - description: "Returns the overview of syncs for a Source connected to a Warehouse.\n\ - \n\nThe rate limit for this endpoint is 2 requests per minute, which is lower\ - \ than the default due to access pattern restrictions. Once reached, this\ - \ endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: listSyncsFromWarehouseAndSource - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - explode: false - in: path - name: sourceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Defines the pagination parameters. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - application/json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1beta+json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - reports: [] - pagination: - next: null - current: "" - schema: - $ref: '#/components/schemas/listSyncsFromWarehouseAndSource_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List Syncs from Warehouse And Source - tags: - - Selective Sync - x-domain-hierarchy: - - Connections - - Selective Sync - x-accepts: application/json - /users/{userId}/groups: - get: - deprecated: false - description: Returns all groups a user belongs to. - operationId: listUserGroupsFromUser - parameters: - - explode: false - in: path - name: userId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - Pagination for groups. - - This parameter exists in v1. - explode: false - in: query - name: pagination - required: true - schema: - $ref: '#/components/schemas/PaginationInput' - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - groups: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - application/json: - example: - data: - groups: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - application/vnd.segment.v1beta+json: - example: - data: - groups: [] - pagination: - current: MA== - totalEntries: 0 - schema: - $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - groups: - - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - pagination: - current: MA== - totalEntries: 1 - schema: - $ref: '#/components/schemas/listUserGroupsFromUser_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: List User Groups from User - tags: - - IAM Users - x-domain-hierarchy: - - Admin - - IAM Users - x-accepts: application/json - /destination/filters/preview: - post: - deprecated: false - description: Simulates the application of a Destination filter to a provided - JSON payload. - operationId: previewDestinationFilter - parameters: [] - requestBody: - content: - application/vnd.segment.v1+json: - example: - filter: - if: type = "track" AND event = "Order Completed" - actions: - - type: ALLOW_PROPERTIES - fields: - product: - - event - - requestedFrom - payload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - schema: - $ref: '#/components/schemas/PreviewDestinationFilterV1Input' - application/vnd.segment.v1beta+json: - example: - filter: - if: type = "track" AND event = "Order Completed" - actions: - - type: ALLOW_PROPERTIES - fields: - product: - - event - - requestedFrom - payload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - schema: - $ref: '#/components/schemas/PreviewDestinationFilterV1Input' - application/vnd.segment.v1alpha+json: - example: - filter: - if: type = "track" AND event = "Order Completed" - actions: - - type: ALLOW_PROPERTIES - fields: - product: - - event - - requestedFrom - payload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - schema: - $ref: '#/components/schemas/PreviewDestinationFilterV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - inputPayload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - result: - type: track - event: Order Completed - product: - requestedFrom: /products/123/checkout - schema: - $ref: '#/components/schemas/previewDestinationFilter_200_response' - application/json: - example: - data: - inputPayload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - result: - type: track - event: Order Completed - product: - requestedFrom: /products/123/checkout - schema: - $ref: '#/components/schemas/previewDestinationFilter_200_response' - application/vnd.segment.v1beta+json: - example: - data: - inputPayload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - result: - type: track - event: Order Completed - product: - requestedFrom: /products/123/checkout - schema: - $ref: '#/components/schemas/previewDestinationFilter_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - inputPayload: - type: track - event: Order Completed - product: - name: Fake mustache - requestedFrom: /products/123/checkout - referrer: www.example.com - result: - type: track - event: Order Completed - product: - requestedFrom: /products/123/checkout - schema: - $ref: '#/components/schemas/previewDestinationFilter_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Preview Destination Filter - tags: - - Destination Filters - x-domain-hierarchy: - - Connections - - Destination Filters - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /group/{userGroupId}/users: - delete: - deprecated: false - description: "Removes one or multiple users or invites from a user group by\ - \ email.\n\nWhen called, this endpoint may generate one or more of the following\ - \ [Audit Trail](/tag/Audit-Trail) events:\n* Group Memberships Deleted\n*\ - \ User Removed From User Group\n \n\n\nThe rate limit for this endpoint\ - \ is 60 requests per minute, which is lower than the default due to access\ - \ pattern restrictions. Once reached, this endpoint will respond with the\ - \ 429 HTTP status code with headers indicating the limit parameters. See [Rate\ - \ Limiting](/#tag/Rate-Limits) for more information." - operationId: removeUsersFromUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - - description: |- - The list of emails to remove from the user group. - - This parameter exists in v1. - explode: false - in: query - name: emails - required: true - schema: - description: The list of emails to remove from the user group. - items: - type: string - title: emails - type: array - style: deepObject - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - application/json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: SUCCESS - schema: - $ref: '#/components/schemas/removeUsersFromUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Remove Users from User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-accepts: application/json - put: - deprecated: false - description: "Replaces the members of a user group by email.\n\nWhen called,\ - \ this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail)\ - \ events:\n* Subjects Added to Group\n* User Added To User Group\n* Group\ - \ Memberships Deleted\n \n\n\nThe rate limit for this endpoint is 60\ - \ requests per minute, which is lower than the default due to access pattern\ - \ restrictions. Once reached, this endpoint will respond with the 429 HTTP\ - \ status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits)\ - \ for more information." - operationId: replaceUsersInUserGroup - parameters: - - explode: false - in: path - name: userGroupId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - emails: - - foo@example.com - userGroupId: bBABwqbaDf2QdwTbW8bNEm - schema: - $ref: '#/components/schemas/ReplaceUsersInUserGroupV1Input' - application/vnd.segment.v1beta+json: - example: - emails: - - foo@example.com - userGroupId: bBABwqbaDf2QdwTbW8bNEm - schema: - $ref: '#/components/schemas/ReplaceUsersInUserGroupV1Input' - application/vnd.segment.v1alpha+json: - example: - emails: - - foo@example.com - userGroupId: bBABwqbaDf2QdwTbW8bNEm - schema: - $ref: '#/components/schemas/ReplaceUsersInUserGroupV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - application/json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - application/vnd.segment.v1beta+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - userGroup: - id: bBABwqbaDf2QdwTbW8bNEm - name: PAPI Example Group - memberCount: 1 - schema: - $ref: '#/components/schemas/replaceUsersInUserGroup_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Users in User Group - tags: - - IAM Groups - x-domain-hierarchy: - - Admin - - IAM Groups - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json - /spaces/{spaceId}/messaging-subscriptions: - put: - deprecated: false - description: "Replace Messaging Subscriptions in Spaces.\n\n\nThe rate limit\ - \ for this endpoint is 60 requests per minute, which is lower than the default\ - \ due to access pattern restrictions. Once reached, this endpoint will respond\ - \ with the 429 HTTP status code with headers indicating the limit parameters.\ - \ See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: replaceMessagingSubscriptionsInSpaces - parameters: - - explode: false - in: path - name: spaceId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1alpha+json: - example: - spaceId: 9aQ1Lj62S4bomZKLF4DPqW - subscriptions: - - key: test@email.com - type: EMAIL - status: DID_NOT_SUBSCRIBE - - key: pgibbonsexample.com - type: EMAIL - status: UNSUBSCRIBED - - key: +12162226233 - type: SMS - status: DID_NOT_SUBSCRIBE - - key: "11" - type: SMS - status: DID_NOT_SUBSCRIBE - schema: - $ref: '#/components/schemas/ReplaceMessagingSubscriptionsInSpacesAlphaInput' - required: true - responses: - "200": - content: - application/vnd.segment.v1alpha+json: - example: - data: - successes: - - key: jacob@exmple.com - type: EMAIL - status: SUBSCRIBED - - key: "2162226233" - type: PHONE - status: DID_NOT_SUBSCRIBE - failures: - - key: pgibbonsexample.com - type: EMAIL - status: UNSUBSCRIBED - errors: - - code: INVALID_EMAIL - message: Email is not valid - schema: - $ref: '#/components/schemas/replaceMessagingSubscriptionsInSpaces_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Replace Messaging Subscriptions in Spaces - tags: - - Spaces - x-domain-hierarchy: - - Engage - - Spaces - x-content-type: application/vnd.segment.v1alpha+json - x-accepts: application/json - /warehouses/{warehouseId}/selective-sync: - patch: - deprecated: false - description: "Configures the schema for a Warehouse, including Sources, Collections,\ - \ and Properties.\n\n\n\nWhen called, this endpoint may generate the `Storage\ - \ Destination Modified` [Audit Trail](/tag/Audit-Trail) event.\n \n\n\ - \nThe rate limit for this endpoint is 2 requests per minute, which is lower\ - \ than the default due to access pattern restrictions. Once reached, this\ - \ endpoint will respond with the 429 HTTP status code with headers indicating\ - \ the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information." - operationId: updateSelectiveSyncForWarehouse - parameters: - - explode: false - in: path - name: warehouseId - required: true - schema: - maximum: 255 - minimum: 1 - type: string - style: simple - requestBody: - content: - application/vnd.segment.v1+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - syncOverrides: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - enabled: true - collection: checkout_started - property: context_ip - schema: - $ref: '#/components/schemas/UpdateSelectiveSyncForWarehouseV1Input' - application/vnd.segment.v1beta+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - syncOverrides: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - enabled: true - collection: checkout_started - property: context_ip - schema: - $ref: '#/components/schemas/UpdateSelectiveSyncForWarehouseV1Input' - application/vnd.segment.v1alpha+json: - example: - warehouseId: kjU72LCJexvrqL7G4TMHHN - syncOverrides: - - sourceId: rh5BDZp6QDHvXFCkibm1pR - enabled: true - collection: checkout_started - property: context_ip - schema: - $ref: '#/components/schemas/UpdateSelectiveSyncForWarehouseV1Input' - required: true - responses: - "200": - content: - application/vnd.segment.v1+json: - example: - data: - status: UPDATED - warnings: [] - schema: - $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - application/json: - example: - data: - status: UPDATED - warnings: [] - schema: - $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - application/vnd.segment.v1beta+json: - example: - data: - status: UPDATED - warnings: [] - schema: - $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - application/vnd.segment.v1alpha+json: - example: - data: - status: UPDATED - warnings: [] - schema: - $ref: '#/components/schemas/updateSelectiveSyncForWarehouse_200_response' - description: OK - "404": - content: - application/json: - example: - errors: - - type: NotFound - message: Resource not found - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Resource not found - "422": - content: - application/json: - example: - errors: - - type: ValidationFailure - message: Validation failure - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Validation failure - "429": - content: - application/json: - example: - errors: - - type: RateLimited - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/RequestErrorEnvelope' - description: Too many requests - summary: Update Selective Sync for Warehouse - tags: - - Selective Sync - x-domain-hierarchy: - - Connections - - Selective Sync - x-content-type: application/vnd.segment.v1+json - x-accepts: application/json -components: - schemas: - AllowedLabelBeta: - description: Defines a label that you may apply to resources within a Workspace. - example: - description: description - value: value - key: key - properties: - key: - description: The key identifier for this label. - title: key - type: string - value: - description: The value of this label. - title: value - type: string - description: - description: A description of what this label represents. - title: description - type: string - required: - - key - - value - title: AllowedLabelBeta - type: object - GetDestinationsCatalogV1Input: - description: Contains filter parameters used for loading the Destinations public - catalog. - properties: {} - required: - - pagination - title: GetDestinationsCatalogV1Input - type: object - GetDestinationsCatalogV1Output: - description: Returns a list of all Destination catalog items contained within - a given page. - example: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - properties: - destinationsCatalog: - description: All Destination catalog items contained within the requested - page. - items: - $ref: '#/components/schemas/DestinationMetadataV1' - title: destinationsCatalog - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - destinationsCatalog - - pagination - title: GetDestinationsCatalogV1Output - type: object - GetDestinationMetadataV1Input: - description: Loads a Destination catalog item by id. - properties: {} - required: - - destinationMetadataId - title: GetDestinationMetadataV1Input - type: object - GetDestinationMetadataV1Output: - description: Returns a Destination catalog item. - example: - destinationMetadata: null - properties: - destinationMetadata: - $ref: '#/components/schemas/destinationMetadata' - required: - - destinationMetadata - title: GetDestinationMetadataV1Output - type: object - AuditEventV1: - description: Represents an Audit Trail event. - example: - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - id: - description: Unique identifier for this audit trail event. - title: id - type: string - timestamp: - description: The timestamp of this event in ISO-8601 format. - title: timestamp - type: string - type: - description: The type of this event. - title: type - type: string - actor: - description: The user or API token that triggered this event. - title: actor - type: string - resourceId: - description: The identifier of the resource affected by this event. - title: resourceId - type: string - resourceType: - description: The kind of resource affected by this event. - title: resourceType - type: string - resourceName: - description: The name of the resource affected by this event. - title: resourceName - type: string - required: - - actor - - id - - resourceId - - resourceName - - resourceType - - timestamp - - type - title: AuditEventV1 - type: object - ListAuditEventsV1Input: - description: Retrieves all Audit Trail events for the current Workspace. - properties: {} - title: ListAuditEventsV1Input - type: object - ListAuditEventsV1Output: - description: Returns a list of Audit Trail events for the current Workspace. - example: - pagination: null - events: - - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - events: - description: Audit trail events for the current Workspace. - items: - $ref: '#/components/schemas/AuditEventV1' - title: events - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - events - title: ListAuditEventsV1Output - type: object - ListFiltersFromDestinationV1Input: - description: Input for ListDestinationFiltersV1. - properties: {} - required: - - destinationId - title: ListFiltersFromDestinationV1Input - type: object - GetFilterInDestinationV1Input: - description: Input for GetDestinationFilterV1. - properties: {} - title: GetFilterInDestinationV1Input - type: object - RemoveFilterFromDestinationV1Input: - description: Input for DeleteDestinationFilterV1. - properties: {} - title: RemoveFilterFromDestinationV1Input - type: object - DestinationFilterActionV1: - description: Represents a Destination filter action. - example: - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - properties: - type: - description: The kind of Transformation to apply to any matched properties. - enum: - - ALLOW_PROPERTIES - - DROP - - DROP_PROPERTIES - - SAMPLE - title: type - type: string - fields: - additionalProperties: true - description: |- - A dictionary of paths to object keys that this filter applies to. - The literal string '' represents the top level of the object. - title: fields - type: object - percent: - description: |- - A decimal between 0 and 1 used for 'sample' type events and - influences the likelihood of sampling to occur. - title: percent - type: number - path: - description: |- - The JSON path to a property within a payload object from which Segment generates a deterministic - sampling rate. - title: path - type: string - required: - - type - title: DestinationFilterActionV1 - type: object - CreateFilterForDestinationV1Input: - description: Input for CreateDestinationFilterV1. - properties: - sourceId: - description: The id of the Source associated with this filter. - title: sourceId - type: string - if: - description: The filter's condition. - title: if - type: string - actions: - description: Actions for the Destination filter. - items: - $ref: '#/components/schemas/DestinationFilterActionV1' - title: actions - type: array - title: - description: The title of the filter. - title: title - type: string - description: - description: The description of the filter. - title: description - type: string - enabled: - description: "When set to true, the Destination filter is active." - title: enabled - type: boolean - required: - - actions - - enabled - - if - title: CreateFilterForDestinationV1Input - type: object - PreviewDestinationFilterV1: - description: A simplified Destination filter that includes the if and actions - for a DestinationFilterV1. - properties: - if: - description: "A FQL statement which determines if the provided filter's\ - \ actions will apply to the provided JSON payload.\nThe literal string\ - \ \"all\" will result in this filter to all events.\nFor guidance on using\ - \ FQL, see the Segment documentation site." - title: if - type: string - actions: - description: "The filtering action to take on events that match the \"if\"\ - \ statement.\nAction types must be one of: \"drop\", \"allow_properties\"\ - , \"drop_properties\" or \"sample\"." - items: - $ref: '#/components/schemas/DestinationFilterActionV1' - title: actions - type: array - required: - - actions - - if - title: PreviewDestinationFilterV1 - type: object - PreviewDestinationFilterV1Input: - description: "Input of the Destination filter to preview.\nFor guidance on using\ - \ FQL, see the Segment documentation site." - properties: - filter: - $ref: '#/components/schemas/filter' - payload: - additionalProperties: true - description: The JSON payload to apply the filter to. - title: payload - type: object - required: - - filter - - payload - title: PreviewDestinationFilterV1Input - type: object - PreviewDestinationFilterV1Output: - description: |- - Preview output from applying the Destination filter. - Segment modifies or nullifies payloads depending on the provided filter actions. - example: - result: "" - inputPayload: - key: "" - properties: - inputPayload: - additionalProperties: true - description: The pre-filter JSON input. - title: inputPayload - type: object - result: - allOf: - - additionalProperties: {} - type: object - description: The filtered JSON output. - nullable: true - title: result - required: - - inputPayload - - result - title: PreviewDestinationFilterV1Output - type: object - DestinationFilterV1: - description: Represents a Destination filter. - example: - sourceId: sourceId - createdAt: createdAt - description: description - id: id - destinationId: destinationId - title: title - if: if - actions: - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - enabled: true - updatedAt: updatedAt - properties: - id: - description: The unique id of this filter. - title: id - type: string - sourceId: - description: The id of the Source associated with this filter. - title: sourceId - type: string - destinationId: - description: The id of the Destination associated with this filter. - title: destinationId - type: string - if: - description: A condition that defines whether to apply this filter to a - payload. - title: if - type: string - actions: - description: A list of actions this filter performs. - items: - $ref: '#/components/schemas/DestinationFilterActionV1' - title: actions - type: array - title: - description: A title for this filter. - title: title - type: string - description: - description: A description for this filter. - title: description - type: string - enabled: - description: "When set to true, this filter is active." - title: enabled - type: boolean - createdAt: - description: The timestamp of this filter's creation. - title: createdAt - type: string - updatedAt: - description: The timestamp of this filter's last change. - title: updatedAt - type: string - required: - - actions - - createdAt - - destinationId - - enabled - - id - - if - - sourceId - - title - - updatedAt - title: DestinationFilterV1 - type: object - ListFiltersFromDestinationV1Output: - description: Output for ListDestinationFiltersV1. - example: - pagination: null - filters: - - sourceId: sourceId - createdAt: createdAt - description: description - id: id - destinationId: destinationId - title: title - if: if - actions: - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - enabled: true - updatedAt: updatedAt - - sourceId: sourceId - createdAt: createdAt - description: description - id: id - destinationId: destinationId - title: title - if: if - actions: - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - enabled: true - updatedAt: updatedAt - properties: - filters: - description: A list of the filters that belong to the specified Destination - instance. - items: - $ref: '#/components/schemas/DestinationFilterV1' - title: filters - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - filters - - pagination - title: ListFiltersFromDestinationV1Output - type: object - GetFilterInDestinationV1Output: - description: Output for GetDestinationFiltersV1. - example: - filter: null - properties: - filter: - $ref: '#/components/schemas/filter_1' - required: - - filter - title: GetFilterInDestinationV1Output - type: object - CreateFilterForDestinationV1Output: - description: Output for CreateDestinationFiltersV1. - example: - filter: null - properties: - filter: - $ref: '#/components/schemas/filter_2' - required: - - filter - title: CreateFilterForDestinationV1Output - type: object - RemoveFilterFromDestinationV1Output: - description: Output for DeleteDestinationFilterV1. - example: - status: SUCCESS - properties: - status: - description: The status of delete operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveFilterFromDestinationV1Output - type: object - UpdateFilterForDestinationV1Input: - description: Input for UpdateDestinationFilterV1. - properties: - if: - description: The FQL if condition to update. - title: if - type: string - actions: - description: Actions for this Destination filter. - items: - $ref: '#/components/schemas/DestinationFilterActionV1' - title: actions - type: array - title: - description: The title to update. - title: title - type: string - description: - description: The description of this filter. - nullable: true - title: description - type: string - enabled: - description: "When set to true, this Destination filter is active." - title: enabled - type: boolean - title: UpdateFilterForDestinationV1Input - type: object - UpdateFilterForDestinationV1Output: - description: Output for UpdateDestinationFilterV1. - example: - filter: null - properties: - filter: - $ref: '#/components/schemas/filter_3' - required: - - filter - title: UpdateFilterForDestinationV1Output - type: object - DestinationMetadataV1: - description: "Represents a Destination within Segment.\n\nA Destination is a\ - \ target for Segment to forward data to, and represents a tool or storage\ - \ Destination." - example: - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - properties: - id: - description: "The id of the Destination metadata.\n\nConfig API note: analogous\ - \ to `name`." - title: id - type: string - name: - description: "The user-friendly name of the Destination.\n\nConfig API note:\ - \ equal to `displayName`." - title: name - type: string - description: - description: The description of the Destination. - title: description - type: string - slug: - description: The slug used to identify the Destination in the Segment app. - title: slug - type: string - logos: - $ref: '#/components/schemas/logos' - options: - description: Options configured for the Destination. - items: - $ref: '#/components/schemas/IntegrationOptionBeta' - title: options - type: array - status: - description: Support status of the Destination. - enum: - - DEPRECATED - - PRIVATE_BETA - - PRIVATE_BUILDING - - PRIVATE_SUBMITTED - - PUBLIC - - PUBLIC_BETA - - UNAVAILABLE - title: status - type: string - previousNames: - description: A list of names previously used by the Destination. - items: - type: string - title: previousNames - type: array - categories: - description: A list of categories with which the Destination is associated. - items: - type: string - title: categories - type: array - website: - description: A website URL for this Destination. - title: website - type: string - components: - description: A list of components this Destination provides. - items: - $ref: '#/components/schemas/DestinationMetadataComponentV1' - title: components - type: array - supportedFeatures: - $ref: '#/components/schemas/supportedFeatures' - supportedMethods: - $ref: '#/components/schemas/supportedMethods' - supportedPlatforms: - $ref: '#/components/schemas/supportedPlatforms' - actions: - description: Actions available for the Destination. - items: - $ref: '#/components/schemas/DestinationMetadataActionV1' - title: actions - type: array - presets: - description: Predefined Destination subscriptions that can optionally be - applied when connecting a new instance of the Destination. - items: - $ref: '#/components/schemas/DestinationMetadataSubscriptionPresetV1' - title: presets - type: array - contacts: - description: Contact info for Integration Owners. - items: - $ref: '#/components/schemas/Contact' - title: contacts - type: array - partnerOwned: - description: Partner Owned flag. - title: partnerOwned - type: boolean - required: - - actions - - categories - - components - - description - - id - - logos - - name - - options - - presets - - previousNames - - slug - - status - - supportedFeatures - - supportedMethods - - supportedPlatforms - - website - title: DestinationMetadataV1 - type: object - Contact: - description: The contact info for Integration Owners. - example: - role: role - isPrimary: true - name: name - email: email - properties: - name: - description: Name of this contact. - title: name - type: string - email: - description: Email of this contact. - title: email - type: string - role: - description: Role of this contact. - title: role - type: string - isPrimary: - description: Whether this is a primary contact. - title: isPrimary - type: boolean - required: - - email - - isPrimary - - name - - role - title: Contact - type: object - DestinationMetadataComponentV1: - description: Represents a component this Destination provides. - example: - owner: PARTNER - code: code - type: ANDROID - properties: - type: - description: The component type. - enum: - - ANDROID - - BROWSER - - IOS - - SERVER - title: type - type: string - code: - description: Link to the repository hosting the code for this component. - title: code - type: string - owner: - description: The owner of this component. Either 'SEGMENT' or 'PARTNER'. - enum: - - PARTNER - - SEGMENT - title: owner - type: string - required: - - code - - type - title: DestinationMetadataComponentV1 - type: object - DestinationMetadataMethodsV1: - description: Represents methods that a given Destination supports. - properties: - pageview: - description: Identifies if the Destination supports the `pageview` method. - title: pageview - type: boolean - identify: - description: Identifies if the Destination supports the `identify` method. - title: identify - type: boolean - alias: - description: Identifies if the Destination supports the `alias` method. - title: alias - type: boolean - track: - description: Identifies if the Destination supports the `track` method. - title: track - type: boolean - group: - description: Identifies if the Destination supports the `group` method. - title: group - type: boolean - title: DestinationMetadataMethodsV1 - type: object - DestinationMetadataPlatformsV1: - description: Represents platforms that a given Destination supports. - properties: - browser: - description: Whether this Destination supports browser events. - title: browser - type: boolean - server: - description: Whether this Destination supports server events. - title: server - type: boolean - mobile: - description: Whether this Destination supports mobile events. - title: mobile - type: boolean - title: DestinationMetadataPlatformsV1 - type: object - DestinationMetadataFeaturesV1: - description: Represents features that a given Destination supports. - properties: - cloudModeInstances: - description: "This Destination's support level for cloud mode instances.\n\ - The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent." - enum: - - "0" - - "1" - - MULTIPLE - - NONE - - SINGLE - title: cloudModeInstances - type: string - deviceModeInstances: - description: "This Destination's support level for device mode instances.\n\ - Support for multiple device mode instances is currently not planned.\n\ - The values '0' and 'NONE', and '1' and 'SINGLE' are equivalent." - enum: - - "0" - - "1" - - NONE - - SINGLE - title: deviceModeInstances - type: string - replay: - description: Whether this Destination supports replays. - title: replay - type: boolean - browserUnbundling: - description: Whether this Destination supports browser unbundling. - title: browserUnbundling - type: boolean - browserUnbundlingPublic: - description: Whether this Destination supports public browser unbundling. - title: browserUnbundlingPublic - type: boolean - title: DestinationMetadataFeaturesV1 - type: object - DestinationMetadataActionV1: - description: "Represents an Action, a building block of behavior that can be\ - \ performed by the Destination." - example: - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - properties: - id: - description: The primary key of the action. - title: id - type: string - slug: - description: A machine-readable key unique to the action definition. - title: slug - type: string - name: - description: A human-readable name for the action. - title: name - type: string - description: - description: A human-readable description of the action. May include Markdown. - title: description - type: string - platform: - description: The platform on which this action runs. - enum: - - CLOUD - - MOBILE - - WEB - title: platform - type: string - hidden: - description: Whether the action should be hidden. - title: hidden - type: boolean - defaultTrigger: - description: The default value used as the trigger when connecting this - action. - nullable: true - title: defaultTrigger - type: string - fields: - description: The fields expected in order to perform the action. - items: - $ref: '#/components/schemas/DestinationMetadataActionFieldV1' - title: fields - type: array - required: - - defaultTrigger - - description - - fields - - hidden - - id - - name - - platform - - slug - title: DestinationMetadataActionV1 - type: object - DestinationMetadataActionFieldV1: - description: Represents a field used in configuring an action. - example: - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - properties: - id: - description: The primary key of the field. - title: id - type: string - sortOrder: - description: The order this particular field is (used in the UI for displaying - the fields in a specified order). - title: sortOrder - type: number - fieldKey: - description: A unique machine-readable key for the field. Should ideally - match the expected key in the action\'s API request. - title: fieldKey - type: string - label: - description: A human-readable label for this value. - title: label - type: string - type: - description: The data type for this value. - enum: - - BOOLEAN - - DATETIME - - HIDDEN - - INTEGER - - NUMBER - - OBJECT - - PASSWORD - - STRING - - TEXT - title: type - type: string - description: - description: A human-readable description of this value. You can use Markdown. - title: description - type: string - placeholder: - description: An example value displayed but not saved. - title: placeholder - type: string - defaultValue: - description: A default value that is saved the first time an action is created. - title: defaultValue - required: - description: Whether this field is required. - title: required - type: boolean - multiple: - description: Whether a user can provide multiples of this field. - title: multiple - type: boolean - choices: - description: A list of machine-readable value/label pairs to populate a - static dropdown. - title: choices - dynamic: - description: "Whether this field should execute a dynamic request to fetch\ - \ choices to populate a dropdown. When true, `choices` is ignored." - title: dynamic - type: boolean - allowNull: - description: Whether this field allows null values. - title: allowNull - type: boolean - required: - - allowNull - - description - - dynamic - - fieldKey - - id - - label - - multiple - - required - - sortOrder - - type - title: DestinationMetadataActionFieldV1 - type: object - DestinationMetadataSubscriptionPresetV1: - description: Represents a set of defaults for a Destination subscription. - example: - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - properties: - actionId: - description: The unique identifier for the Destination Action to trigger. - title: actionId - type: string - name: - description: The name of the subscription. - title: name - type: string - fields: - additionalProperties: true - description: The default settings for action fields. - title: fields - type: object - trigger: - description: FQL string that describes what events should trigger an action. - See https://segment.com/docs/config-api/fql/ for more information regarding - Segment's Filter Query Language (FQL). - title: trigger - type: string - required: - - actionId - - fields - - name - - trigger - title: DestinationMetadataSubscriptionPresetV1 - type: object - DestinationSubscription: - example: - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - properties: - id: - description: The unique identifier for the subscription. - title: id - type: string - name: - description: The name of the subscription. - title: name - type: string - actionId: - description: The unique identifier for the Destination action to trigger. - title: actionId - type: string - actionSlug: - description: The URL-friendly key for the associated Destination action. - title: actionSlug - type: string - destinationId: - description: The associated Destination instance id. - title: destinationId - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The customer settings for action fields. - title: settings - trigger: - description: FQL string that describes what events should trigger a Destination - action. - title: trigger - type: string - required: - - actionId - - actionSlug - - destinationId - - enabled - - id - - name - - settings - - trigger - title: DestinationSubscription - type: object - DestinationSubscriptionFields: - additionalProperties: {} - description: Represents settings used to configure an action subscription. - title: DestinationSubscriptionFields - type: object - ListSubscriptionsFromDestinationAlphaInput: - description: Input for ListDestinationSubscriptionsAlpha. - properties: {} - required: - - destinationId - title: ListSubscriptionsFromDestinationAlphaInput - type: object - ListSubscriptionsFromDestinationAlphaOutput: - description: Output for ListDestinationSubscriptionsAlpha. - example: - subscriptions: - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - pagination: null - properties: - subscriptions: - description: A list of Destination subscriptions. - items: - $ref: '#/components/schemas/DestinationSubscription' - title: subscriptions - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - subscriptions - title: ListSubscriptionsFromDestinationAlphaOutput - type: object - GetSubscriptionFromDestinationAlphaInput: - description: Fetches a Destination subscription. - properties: {} - required: - - destinationId - title: GetSubscriptionFromDestinationAlphaInput - type: object - GetSubscriptionFromDestinationAlphaOutput: - description: Returns a subscription for a given subscription id. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: GetSubscriptionFromDestinationAlphaOutput - type: object - CreateDestinationSubscriptionAlphaInput: - description: The basic input parameters for creating a Destination subscription. - properties: - name: - description: A user-defined name for the subscription. - title: name - type: string - actionId: - description: The associated action id the subscription should trigger. - title: actionId - type: string - trigger: - description: The FQL statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - required: - - actionId - - enabled - - name - - trigger - title: CreateDestinationSubscriptionAlphaInput - type: object - CreateDestinationSubscriptionAlphaOutput: - description: Returns a newly created Destination subscription. - example: - destinationSubscription: null - properties: - destinationSubscription: - $ref: '#/components/schemas/destinationSubscription' - required: - - destinationSubscription - title: CreateDestinationSubscriptionAlphaOutput - type: object - DestinationSubscriptionUpdateInput: - description: The input parameters for updating a Destination subscription. - properties: - name: - description: The user-defined name for the subscription. - title: name - type: string - trigger: - description: The fql statement. - title: trigger - type: string - enabled: - description: Is the subscription enabled. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionFields' - description: The fields used for configuring this action. - title: settings - title: DestinationSubscriptionUpdateInput - type: object - UpdateSubscriptionForDestinationAlphaInput: - description: The basic input parameters for updating a Destination subscription. - properties: - input: - $ref: '#/components/schemas/input' - required: - - destinationId - - input - title: UpdateSubscriptionForDestinationAlphaInput - type: object - UpdateSubscriptionForDestinationAlphaOutput: - description: Returns the updated Destination subscription. - example: - subscription: null - properties: - subscription: - $ref: '#/components/schemas/subscription' - required: - - subscription - title: UpdateSubscriptionForDestinationAlphaOutput - type: object - RemoveSubscriptionFromDestinationAlphaInput: - description: Deletes a Destination by id. - properties: {} - required: - - destinationId - title: RemoveSubscriptionFromDestinationAlphaInput - type: object - RemoveSubscriptionFromDestinationAlphaOutput: - description: Returns a Destination deletion flag. - example: - status: SUCCESS - properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveSubscriptionFromDestinationAlphaOutput - type: object - ListDeliveryMetricsSummaryFromDestinationBetaInput: - description: Input to retrieve event delivery metrics summary for a Destination. - properties: {} - title: ListDeliveryMetricsSummaryFromDestinationBetaInput - type: object - ListDeliveryMetricsSummaryFromDestinationBetaOutput: - description: Output to retrieve event delivery metrics summary for a Destination. - example: - deliveryMetricsSummary: null - properties: - deliveryMetricsSummary: - $ref: '#/components/schemas/deliveryMetricsSummary' - required: - - deliveryMetricsSummary - title: ListDeliveryMetricsSummaryFromDestinationBetaOutput - type: object - DeliveryMetricsSummaryBeta: - description: Defines the summary of delivery metrics for a Destination. - properties: - sourceId: - description: "The Source id.\n\nConfig API note: analogous to `parent`." - title: sourceId - type: string - destinationMetadataId: - description: The Destination metadata id. - title: destinationMetadataId - type: string - metrics: - description: The summary of event delivery metrics for the requested Destination. - items: - $ref: '#/components/schemas/MetricBeta' - title: metrics - type: array - required: - - destinationMetadataId - - metrics - - sourceId - title: DeliveryMetricsSummaryBeta - type: object - MetricBeta: - description: The event delivery metric. - properties: - metricName: - description: The name of the metric. - title: metricName - type: string - total: - description: Number of occurrences of the metric. - title: total - type: number - breakdown: - description: Breakdown of metrics within a metric. - items: - $ref: '#/components/schemas/BreakdownBeta' - title: breakdown - type: array - required: - - metricName - - total - title: MetricBeta - type: object - BreakdownBeta: - description: The breakdown of a metric. - properties: - metricName: - description: The name of the metric. - title: metricName - type: string - value: - description: Number of occurrences of the metric. - title: value - type: number - required: - - metricName - - value - title: BreakdownBeta - type: object - DestinationV1: - description: "Business tools or apps that you can connect to the data flowing\ - \ through Segment.\n\nThis is equal to the Destination object in Config API,\ - \ with the following fields omitted:\n- catalogId\n- createTime\n- updateTime\n\ - - connectionMode." - example: - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - properties: - id: - description: "The unique identifier of this instance of a Destination.\n\ - \nConfig API note: analogous to `name`." - title: id - type: string - name: - description: "The name of this instance of a Destination.\n\nConfig API\ - \ note: equal to `displayName`." - title: name - type: string - enabled: - description: Whether this instance of a Destination receives data. - title: enabled - type: boolean - metadata: - $ref: '#/components/schemas/metadata' - sourceId: - description: "The id of a Source connected to this instance of a Destination.\n\ - \nConfig API note: analogous to `parent`." - title: sourceId - type: string - settings: - additionalProperties: true - description: "The collection of settings associated with a Destination.\n\ - \nConfig API note: equal to `config`." - title: settings - type: object - required: - - enabled - - id - - metadata - - settings - - sourceId - title: DestinationV1 - type: object - ListDestinationsV1Input: - description: Loads all Destinations connected to the current Workspace. - properties: {} - required: - - pagination - title: ListDestinationsV1Input - type: object - ListDestinationsV1Output: - description: Returns all Destinations connected to the current Workspace. - example: - pagination: null - destinations: - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - properties: - destinations: - description: The list that contains the Destinations connected to the Workspace. - items: - $ref: '#/components/schemas/DestinationV1' - title: destinations - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - destinations - - pagination - title: ListDestinationsV1Output - type: object - GetDestinationV1Input: - description: Looks up a single Destination by its id. - properties: {} - required: - - destinationId - title: GetDestinationV1Input - type: object - GetDestinationV1Output: - description: Returns a single Destination by its id. - example: - destination: null - properties: - destination: - $ref: '#/components/schemas/destination' - required: - - destination - title: GetDestinationV1Output - type: object - DeleteDestinationV1Input: - description: Deletes a single Destination by its id. - properties: {} - required: - - destinationId - title: DeleteDestinationV1Input - type: object - DeleteDestinationV1Output: - description: Returns the status of a Destination deletion. - example: - status: SUCCESS - properties: - status: - description: The status of the Warehouse deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteDestinationV1Output - type: object - UpdateDestinationV1Output: - description: Returns the updated Destination. - example: - destination: null - properties: - destination: - $ref: '#/components/schemas/destination_1' - required: - - destination - title: UpdateDestinationV1Output - type: object - UpdateDestinationV1Input: - description: Updates a single Destination by its id. - properties: - name: - description: "Defines the display name of the Destination.\n\nConfig API\ - \ note: equal to `displayName`." - nullable: true - title: name - type: string - enabled: - description: Whether this Destination should receive data. - title: enabled - type: boolean - settings: - additionalProperties: true - description: "An optional object that contains settings for the Destination\ - \ based on the \"required\" and \"advanced\" settings present\nin the\ - \ Destination metadata.\n\nConfig API note: equal to `config`." - title: settings - type: object - required: - - destinationId - title: UpdateDestinationV1Input - type: object - CreateDestinationV1Output: - description: Creates a new Destination. - example: - destination: null - properties: - destination: - $ref: '#/components/schemas/destination_2' - required: - - destination - title: CreateDestinationV1Output - type: object - CreateDestinationV1Input: - description: Creates a new Destination. - properties: - sourceId: - description: "The id of the Source to connect to this Destination instance.\n\ - \nConfig API note: analogous to `parent`." - title: sourceId - type: string - metadataId: - description: The id of the metadata to link to the new Destination. - title: metadataId - type: string - enabled: - description: Whether this Destination should receive data. - title: enabled - type: boolean - name: - description: "Defines the display name of the Destination.\n\nConfig API\ - \ note: equal to `displayName`." - title: name - type: string - settings: - additionalProperties: true - description: "An object that contains settings for the Destination based\ - \ on the \"required\" and \"advanced\" settings present in the\nDestination\ - \ metadata.\n\nConfig API note: equal to `config`." - title: settings - type: object - required: - - metadataId - - settings - - sourceId - title: CreateDestinationV1Input - type: object - EchoAlphaInput: - description: "EchoAlphaInput and EchoAlphaOutput are needed by unit tests in\ - \ the generated Go code.\n\nIf you change these, make sure `make clients`\ - \ works locally, and generates the Go client correctly.\nEcho request with\ - \ options." - properties: {} - title: EchoAlphaInput - type: object - EchoAlphaOutput: - description: Echo response. - properties: - method: - description: "The HTTP method used for this round-trip.\n\nCurrently, this\ - \ endpoint supports only `get` and `post` methods." - enum: - - get - - post - title: method - type: string - message: - description: The string passed in the `message` input field. - title: message - type: string - headers: - additionalProperties: true - description: The request's HTTP headers. - title: headers - type: object - required: - - headers - - message - - method - title: EchoAlphaOutput - type: object - EchoV1Input: - description: Echo request with options. - properties: {} - title: EchoV1Input - type: object - EchoV1Output: - description: Echo response. - example: - headers: - key: "" - method: get - message: message - properties: - method: - description: "The HTTP method used for this round-trip.\n\nCurrently, this\ - \ endpoint supports only `get` and `post` methods." - enum: - - get - - post - title: method - type: string - message: - description: The string passed in the `message` input field. - title: message - type: string - headers: - additionalProperties: true - description: The request's HTTP headers. - title: headers - type: object - required: - - headers - - message - - method - title: EchoV1Output - type: object - GenerateUploadURLForEdgeFunctionsAlphaInput: - description: Input for GenerateSignedUrl. - properties: {} - required: - - sourceId - title: GenerateUploadURLForEdgeFunctionsAlphaInput - type: object - GenerateUploadURLForEdgeFunctionsAlphaOutput: - description: Output for GenerateSignedUrl. - example: - uploadURL: uploadURL - properties: - uploadURL: - description: A temporary URL that can be used to upload your Edge Functions - bundle. Expires in 15 minutes. - title: uploadURL - type: string - required: - - uploadURL - title: GenerateUploadURLForEdgeFunctionsAlphaOutput - type: object - CreateEdgeFunctionsAlphaInput: - description: Input for CreateEdgeFunctions. - properties: - uploadURL: - description: The id of the Source associated with this Edge Function. - title: uploadURL - type: string - required: - - sourceId - - uploadURL - title: CreateEdgeFunctionsAlphaInput - type: object - CreateEdgeFunctionsAlphaOutput: - description: Output for CreateEdgeFunctions. - example: - edgeFunctions: null - properties: - edgeFunctions: - $ref: '#/components/schemas/edgeFunctions' - required: - - edgeFunctions - title: CreateEdgeFunctionsAlphaOutput - type: object - GetLatestFromEdgeFunctionsAlphaInput: - description: Input for GetLatestFromEdgeFunctions. - properties: {} - required: - - sourceId - title: GetLatestFromEdgeFunctionsAlphaInput - type: object - GetLatestFromEdgeFunctionsAlphaOutput: - description: Output for GetLatestFromEdgeFunctions. - example: - edgeFunctions: null - properties: - edgeFunctions: - $ref: '#/components/schemas/edgeFunctions_1' - required: - - edgeFunctions - title: GetLatestFromEdgeFunctionsAlphaOutput - type: object - DisableEdgeFunctionsAlphaInput: - description: Input for DisableEdgeFunctions. - properties: {} - required: - - sourceId - title: DisableEdgeFunctionsAlphaInput - type: object - DisableEdgeFunctionsAlphaOutput: - description: Output for DisableEdgeFunctions. - example: - edgeFunctions: null - properties: - edgeFunctions: - $ref: '#/components/schemas/edgeFunctions_1' - required: - - edgeFunctions - title: DisableEdgeFunctionsAlphaOutput - type: object - EdgeFunctionsAlpha: - description: Represents an Edge Function bundle. - properties: - id: - description: The Edge Function id. - title: id - type: string - sourceId: - description: The Source id. - title: sourceId - type: string - createdAt: - description: Creation date. - title: createdAt - type: string - createdBy: - description: Creating user's id. - title: createdBy - type: string - downloadURL: - description: The CDN URL that can be used to fetch your latest EdgeFunctions - bundle. - title: downloadURL - type: string - version: - description: Revision number associated with the latest Edge Function. - title: version - type: number - required: - - createdAt - - createdBy - - downloadURL - - id - - sourceId - - version - title: EdgeFunctionsAlpha - type: object - FunctionSettingV1: - properties: - name: - description: The name of this Function. - title: name - type: string - label: - description: The label for this Function. - title: label - type: string - description: - description: A description of this Function. - title: description - type: string - type: - description: The Function type. - enum: - - ARRAY - - BOOLEAN - - STRING - - TEXT_MAP - title: type - type: string - required: - description: Whether this Function is required. - title: required - type: boolean - sensitive: - description: Whether this Function contains sensitive information. - title: sensitive - type: boolean - required: - - description - - label - - name - - required - - sensitive - - type - title: FunctionSettingV1 - type: object - FunctionV1: - description: Represents a Function. - properties: - id: - description: An identifier for this Function. - title: id - type: string - resourceType: - description: "The Function type.\n\nConfig API note: equal to `type`." - enum: - - DESTINATION - - SOURCE - title: resourceType - type: string - createdAt: - description: The time this Function was created. - title: createdAt - type: string - createdBy: - description: The id of the user who created this Function. - title: createdBy - type: string - code: - description: The Function code. - title: code - type: string - deployedAt: - description: The time of this Function's last deployment. - nullable: true - title: deployedAt - type: string - settings: - description: The list of settings for this Function. - items: - $ref: '#/components/schemas/FunctionSettingV1' - title: settings - type: array - displayName: - description: A display name for this Function. - title: displayName - type: string - description: - description: A description for this Function. - title: description - type: string - logoUrl: - description: The URL of the logo for this Function. - title: logoUrl - type: string - previewWebhookUrl: - description: The preview webhook URL for this Function. - title: previewWebhookUrl - type: string - batchMaxCount: - description: The max count of the batch for this Function. - title: batchMaxCount - type: number - catalogId: - description: The catalog id of this Function. - title: catalogId - type: string - isLatestVersion: - description: Whether the deployment of this Function is the latest version. - title: isLatestVersion - type: boolean - title: FunctionV1 - type: object - ListFunctionItemV1: - description: Represents a Function in a list. - example: - createdAt: createdAt - catalogId: catalogId - createdBy: createdBy - displayName: displayName - description: description - id: id - logoUrl: logoUrl - resourceType: DESTINATION - properties: - id: - description: An identifier for this Function. - title: id - type: string - resourceType: - description: "The Function type.\n\nConfig API note: equal to `type`." - enum: - - DESTINATION - - SOURCE - title: resourceType - type: string - createdAt: - description: The time this Function was created. - title: createdAt - type: string - createdBy: - description: The id of the user who created this Function. - title: createdBy - type: string - displayName: - description: A display name for this Function. - title: displayName - type: string - description: - description: A description for this Function. - title: description - type: string - logoUrl: - description: The URL of the logo for this Function. - title: logoUrl - type: string - catalogId: - description: The catalog id of this Function. - title: catalogId - type: string - title: ListFunctionItemV1 - type: object - GetFunctionV1Input: - description: Gets a single Function. - properties: {} - required: - - functionId - title: GetFunctionV1Input - type: object - GetFunctionV1Output: - description: Gets a single Function. - example: - function: null - properties: - function: - $ref: '#/components/schemas/function' - required: - - function - title: GetFunctionV1Output - type: object - ListFunctionsV1Input: - description: Lists all Functions in a Workspace. - properties: {} - required: - - pagination - title: ListFunctionsV1Input - type: object - ListFunctionsV1Output: - description: Lists Functions in a Workspace. - example: - pagination: null - functions: - - createdAt: createdAt - catalogId: catalogId - createdBy: createdBy - displayName: displayName - description: description - id: id - logoUrl: logoUrl - resourceType: DESTINATION - - createdAt: createdAt - catalogId: catalogId - createdBy: createdBy - displayName: displayName - description: description - id: id - logoUrl: logoUrl - resourceType: DESTINATION - properties: - functions: - description: An array of Functions. - items: - $ref: '#/components/schemas/ListFunctionItemV1' - title: functions - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - functions - - pagination - title: ListFunctionsV1Output - type: object - CreateFunctionV1Input: - description: Creates a Function. - properties: - code: - description: The Function code. - title: code - type: string - settings: - description: The list of settings for this Function. - items: - $ref: '#/components/schemas/FunctionSettingV1' - title: settings - type: array - displayName: - description: |- - A display name for this Function. - - Note that Destination Functions append the Workspace to the display name. - title: displayName - type: string - logoUrl: - description: The URL of the logo for this Function. - title: logoUrl - type: string - resourceType: - description: "The Function type.\n\nConfig API note: equal to `type`." - enum: - - DESTINATION - - SOURCE - title: resourceType - type: string - description: - description: A description for this Function. - title: description - type: string - required: - - code - - displayName - - resourceType - title: CreateFunctionV1Input - type: object - CreateFunctionV1Output: - description: Create a Function. - example: - function: null - properties: - function: - $ref: '#/components/schemas/function_1' - required: - - function - title: CreateFunctionV1Output - type: object - DeleteFunctionV1Input: - description: Delete a single Function. - properties: {} - required: - - functionId - title: DeleteFunctionV1Input - type: object - DeleteFunctionV1Output: - description: Delete a single Function. - example: - status: SUCCESS - properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteFunctionV1Output - type: object - UpdateFunctionV1Input: - description: Update a Function. - properties: - code: - description: The Function code. - title: code - type: string - settings: - description: The list of settings for this Function. - items: - $ref: '#/components/schemas/FunctionSettingV1' - title: settings - type: array - displayName: - description: A display name for this Function. - title: displayName - type: string - logoUrl: - description: A logo for this Function. - title: logoUrl - type: string - description: - description: A description for this Function. - title: description - type: string - required: - - functionId - title: UpdateFunctionV1Input - type: object - UpdateFunctionV1Output: - description: Create a Function. - example: - function: null - properties: - function: - $ref: '#/components/schemas/function_2' - required: - - function - title: UpdateFunctionV1Output - type: object - CreateFunctionDeploymentV1Input: - description: Updates the deployment for a Source Function instance. - properties: {} - required: - - functionId - title: CreateFunctionDeploymentV1Input - type: object - CreateFunctionDeploymentV1Output: - description: Updates the deployment for a Source Function instance. - example: - functionDeployment: - status: SUCCESS - properties: - functionDeployment: - $ref: '#/components/schemas/functionDeployment' - required: - - functionDeployment - title: CreateFunctionDeploymentV1Output - type: object - ResourceV1: - description: Represents a permission's resource. - properties: - id: - description: The id of this resource. - title: id - type: string - type: - description: The kind of resource this permission applies to. - enum: - - FUNCTION - - SOURCE - - SPACE - - WAREHOUSE - - WORKSPACE - title: type - type: string - required: - - id - - type - title: ResourceV1 - type: object - InvitePermissionV1: - description: Defines a permission to apply to the user in an invite. - properties: - roleId: - description: The id of the role. - title: roleId - type: string - resources: - description: The resources to grant the invited users access to. - items: - $ref: '#/components/schemas/ResourceV1' - title: resources - type: array - labels: - description: The labels that determine which resources to grant users access - to. - items: - $ref: '#/components/schemas/AllowedLabelBeta' - title: labels - type: array - required: - - roleId - title: InvitePermissionV1 - type: object - InviteV1: - description: Defines an invitation to join a Workspace. - properties: - email: - description: The invited user's email to attach the permissions to. - title: email - type: string - permissions: - description: The permissions to attach to the invited user. - items: - $ref: '#/components/schemas/InvitePermissionV1' - title: permissions - type: array - required: - - email - title: InviteV1 - type: object - CreateInvitesV1Input: - description: Invites a user to a Workspace with specified permissions. - properties: - invites: - description: The list of invites. - items: - $ref: '#/components/schemas/InviteV1' - title: invites - type: array - required: - - invites - title: CreateInvitesV1Input - type: object - CreateInvitesV1Output: - description: Returns the emails of the invited users. - example: - emails: - - emails - - emails - properties: - emails: - description: The list of emails invited to the Workspace. - items: - type: string - title: emails - type: array - required: - - emails - title: CreateInvitesV1Output - type: object - DeleteInvitesV1Input: - description: Removes pre-existing invitations to join a Workspace. - properties: {} - required: - - emails - title: DeleteInvitesV1Input - type: object - DeleteInvitesV1Output: - description: Returns the status of the removal operation. - example: - status: SUCCESS - properties: - status: - description: The status of the invite deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteInvitesV1Output - type: object - ListInvitesV1Input: - description: Retrieves a list of existing invitations to join a Workspace. - properties: {} - required: - - pagination - title: ListInvitesV1Input - type: object - ListInvitesV1Output: - description: Returns the list of invites. - example: - pagination: null - invites: - - invites - - invites - properties: - invites: - description: The list of invites. - items: - type: string - title: invites - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - invites - - pagination - title: ListInvitesV1Output - type: object - PermissionResourceV1: - description: The most basic representation of a resource belonging to a set - of permissions. - example: - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - id: - description: The id of this resource. - title: id - type: string - type: - description: The type for this resource. - enum: - - FUNCTION - - SOURCE - - SPACE - - WAREHOUSE - - WORKSPACE - title: type - type: string - labels: - description: The labels that further refine access to this resource. Labels - are exclusive to Workspace-level permissions. - items: - $ref: '#/components/schemas/AllowedLabelBeta' - title: labels - type: array - required: - - id - - type - title: PermissionResourceV1 - type: object - PermissionV1: - description: "A registered set of permissions for a subject, extending a role\ - \ to a resource." - example: - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - roleName: - description: The name of the role associated with this permission. - title: roleName - type: string - roleId: - description: The id of the role associated with this permission. - title: roleId - type: string - resources: - description: The resources associated with this permission. - items: - $ref: '#/components/schemas/PermissionResourceV1' - title: resources - type: array - labels: - description: The labels to attach to this permission. - items: - $ref: '#/components/schemas/AllowedLabelBeta' - title: labels - type: array - required: - - resources - - roleId - - roleName - title: PermissionV1 - type: object - MinimalUserGroupV1: - description: The least amount of information needed to identify a user group. - example: - name: name - id: id - properties: - id: - description: The id of the user group. - title: id - type: string - name: - description: The name of the user group. - title: name - type: string - required: - - id - - name - title: MinimalUserGroupV1 - type: object - DeleteUsersV1Input: - description: Removes users from a Workspace. - properties: {} - required: - - userIds - title: DeleteUsersV1Input - type: object - DeleteUsersV1Output: - description: Returns the status of the removal operation. - example: - status: SUCCESS - properties: - status: - description: A flag that indicates the status of a successful deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteUsersV1Output - type: object - AccessPermissionV1: - description: A permission governing access to a resource. - example: - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - roleId: - description: The id of the role that applies to this permission. - title: roleId - type: string - roleName: - description: The name of the role that applies to this permission. - title: roleName - type: string - resources: - description: The resources included with this permission. - items: - $ref: '#/components/schemas/PermissionResourceV1' - title: resources - type: array - required: - - resources - - roleId - - roleName - title: AccessPermissionV1 - type: object - PermissionInputV1: - description: "The input for a permission, associated with a resource and/or\ - \ labels." - properties: - roleId: - description: The role id of this permission. - title: roleId - type: string - resources: - description: The resources to link the selected role to. - items: - $ref: '#/components/schemas/PermissionResourceV1' - title: resources - type: array - required: - - resources - - roleId - title: PermissionInputV1 - type: object - AddPermissionsToUserV1Input: - description: Adds a list of permissions to a user. - properties: - permissions: - description: The permissions to add. - items: - $ref: '#/components/schemas/PermissionInputV1' - title: permissions - type: array - title: AddPermissionsToUserV1Input - type: object - AddPermissionsToUserV1Output: - description: "Returns the user's permissions, including the added permissions." - example: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - permissions: - description: The new permissions. - items: - $ref: '#/components/schemas/AccessPermissionV1' - title: permissions - type: array - required: - - permissions - title: AddPermissionsToUserV1Output - type: object - ReplacePermissionsForUserV1Input: - description: Updates the list of permissions for a user. - properties: - permissions: - description: The permissions to add. - items: - $ref: '#/components/schemas/PermissionInputV1' - title: permissions - type: array - title: ReplacePermissionsForUserV1Input - type: object - ReplacePermissionsForUserV1Output: - description: "Returns the user's permissions, including the updated permissions." - example: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - permissions: - description: The updated permissions. - items: - $ref: '#/components/schemas/AccessPermissionV1' - title: permissions - type: array - required: - - permissions - title: ReplacePermissionsForUserV1Output - type: object - ListUsersV1Input: - description: Returns a list of users with access to the Workspace. - properties: {} - required: - - pagination - title: ListUsersV1Input - type: object - ListUsersV1Output: - description: Returns the list of users. - example: - pagination: null - users: - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - name: name - id: id - email: email - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - name: name - id: id - email: email - properties: - users: - description: The list of users. - items: - $ref: '#/components/schemas/UserV1' - title: users - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - users - title: ListUsersV1Output - type: object - GetUserV1Input: - description: Returns a user. - properties: {} - required: - - userId - title: GetUserV1Input - type: object - GetUserV1Output: - description: Returns the user. - example: - user: null - properties: - user: - $ref: '#/components/schemas/user' - required: - - user - title: GetUserV1Output - type: object - UserV1: - description: A user belonging to a Segment Workspace. - example: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - name: name - id: id - email: email - properties: - id: - description: "The unique identifier of this user.\n\nConfig API note: analogous\ - \ to `name`." - title: id - type: string - name: - description: The human-readable name of this user. - title: name - type: string - email: - description: The email address associated with this user. - title: email - type: string - permissions: - description: The permissions associated with this user. - items: - $ref: '#/components/schemas/PermissionV1' - title: permissions - type: array - required: - - email - - id - - name - title: UserV1 - type: object - ListUserGroupsFromUserV1Input: - description: Retrieves all user groups the user belongs to. - properties: {} - title: ListUserGroupsFromUserV1Input - type: object - ListUserGroupsFromUserV1Output: - description: Returns all user groups the user belongs to. - example: - pagination: null - groups: - - name: name - id: id - - name: name - id: id - properties: - groups: - description: The user groups that the user belongs to. - items: - $ref: '#/components/schemas/MinimalUserGroupV1' - title: groups - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - groups - - pagination - title: ListUserGroupsFromUserV1Output - type: object - ListRolesV1Input: - description: Returns a list of roles available to apply to permissions for users - in the Workspace. - properties: {} - required: - - pagination - title: ListRolesV1Input - type: object - RoleV1: - description: Represents a role. - example: - name: name - description: description - id: id - properties: - id: - description: The unique identifier of the role. - title: id - type: string - name: - description: The human-readable name of the role. - title: name - type: string - description: - description: The human-readable description of the role. - title: description - type: string - required: - - description - - id - - name - title: RoleV1 - type: object - ListRolesV1Output: - description: Returns the list of roles. - example: - pagination: null - roles: - - name: name - description: description - id: id - - name: name - description: description - id: id - properties: - roles: - description: The list of roles. - items: - $ref: '#/components/schemas/RoleV1' - title: roles - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - roles - title: ListRolesV1Output - type: object - MinimalUserV1: - description: A user belonging to a Segment Workspace. - example: - name: name - id: id - email: email - properties: - id: - description: "The unique identifier of this user.\n\nConfig API note: analogous\ - \ to `name`." - title: id - type: string - name: - description: The human-readable name of this user. - title: name - type: string - email: - description: The email address associated with this user. - title: email - type: string - required: - - email - - id - - name - title: MinimalUserV1 - type: object - CreateUserGroupV1Input: - description: "Creates a user group, used to bundle permissions for its members,\ - \ within a Workspace." - properties: - name: - description: The name of the user group to create. - title: name - type: string - required: - - name - title: CreateUserGroupV1Input - type: object - UserGroupV1: - description: A set of users with a set of shared permissions. - example: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - memberCount: 0.8008281904610115 - name: name - id: id - properties: - memberCount: - description: The number of members in the user group. - title: memberCount - type: number - permissions: - description: The permissions associated with the user group. - items: - $ref: '#/components/schemas/PermissionV1' - title: permissions - type: array - id: - description: The id of the user group. - title: id - type: string - name: - description: The name of the user group. - title: name - type: string - required: - - id - - memberCount - - name - title: UserGroupV1 - type: object - CreateUserGroupV1Output: - description: Returns the newly created user group. - example: - userGroup: null - properties: - userGroup: - $ref: '#/components/schemas/userGroup' - required: - - userGroup - title: CreateUserGroupV1Output - type: object - AddPermissionsToUserGroupV1Input: - description: Adds a list of permissions to a user group. - properties: - permissions: - description: The permissions to add. - items: - $ref: '#/components/schemas/PermissionInputV1' - title: permissions - type: array - title: AddPermissionsToUserGroupV1Input - type: object - AddPermissionsToUserGroupV1Output: - description: "Returns the group's permissions, including the added permissions." - example: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - permissions: - description: The updated set of permissions assigned to the user group. - items: - $ref: '#/components/schemas/AccessPermissionV1' - title: permissions - type: array - required: - - permissions - title: AddPermissionsToUserGroupV1Output - type: object - AddUsersToUserGroupV1Input: - description: Adds a list of users and invites to a user group. - properties: - emails: - description: The email addresses of the users and invites to add. - items: - type: string - title: emails - type: array - title: AddUsersToUserGroupV1Input - type: object - AddUsersToUserGroupV1Output: - description: Returns the updated user group. - example: - userGroup: null - properties: - userGroup: - $ref: '#/components/schemas/userGroup_1' - required: - - userGroup - title: AddUsersToUserGroupV1Output - type: object - DeleteUserGroupV1Input: - description: Deletes a user group with a given group id from a Workspace. - properties: {} - required: - - userGroupId - title: DeleteUserGroupV1Input - type: object - DeleteUserGroupV1Output: - description: Returns the status of the completed deletion operation. - example: - status: SUCCESS - properties: - status: - description: A flag indicating the status of a successful deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteUserGroupV1Output - type: object - GetUserGroupV1Input: - description: Looks up a user group within a Workspace. - properties: {} - required: - - userGroupId - title: GetUserGroupV1Input - type: object - GetUserGroupV1Output: - description: Returns a user group with the given id. - example: - userGroup: null - properties: - userGroup: - $ref: '#/components/schemas/userGroup_2' - required: - - userGroup - title: GetUserGroupV1Output - type: object - UpdateUserGroupV1Input: - description: Updates a user group with a given id. - properties: - name: - description: The intended value to rename the user group to. - title: name - type: string - title: UpdateUserGroupV1Input - type: object - UpdateUserGroupV1Output: - description: Returns the updated user group. - example: - userGroup: null - properties: - userGroup: - $ref: '#/components/schemas/userGroup_3' - required: - - userGroup - title: UpdateUserGroupV1Output - type: object - ListInvitesFromUserGroupV1Input: - description: Looks up the invitees to a user group within a Workspace. - properties: {} - title: ListInvitesFromUserGroupV1Input - type: object - ListInvitesFromUserGroupV1Output: - description: Returns the emails of invitees to a user group with the given group - id. - example: - emails: - - emails - - emails - pagination: null - properties: - emails: - description: The emails of the invitees to the user group. - items: - type: string - title: emails - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - emails - - pagination - title: ListInvitesFromUserGroupV1Output - type: object - ReplaceUsersInUserGroupV1Input: - description: Replace a user group's list of users and invites with a new one. - properties: - emails: - description: The email addresses of the users and invites to replace. - items: - type: string - title: emails - type: array - title: ReplaceUsersInUserGroupV1Input - type: object - ReplaceUsersInUserGroupV1Output: - description: Returns the updated user group. - example: - userGroup: null - properties: - userGroup: - $ref: '#/components/schemas/userGroup_1' - required: - - userGroup - title: ReplaceUsersInUserGroupV1Output - type: object - ListUserGroupsV1Input: - description: Loads all user groups for a Workspace. - properties: {} - required: - - pagination - title: ListUserGroupsV1Input - type: object - ListUserGroupsV1Output: - description: Returns a list of user groups with the given Workspace id. - example: - userGroups: - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - memberCount: 0.8008281904610115 - name: name - id: id - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - memberCount: 0.8008281904610115 - name: name - id: id - pagination: null - properties: - userGroups: - description: The user group returned from the query. - items: - $ref: '#/components/schemas/UserGroupV1' - title: userGroups - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - userGroups - title: ListUserGroupsV1Output - type: object - RemoveUsersFromUserGroupV1Input: - description: Removes users or invites from a user group. - properties: {} - title: RemoveUsersFromUserGroupV1Input - type: object - RemoveUsersFromUserGroupV1Output: - description: Returns the status of the removal operation. - example: - status: SUCCESS - properties: - status: - description: The status of the user removal from user group operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveUsersFromUserGroupV1Output - type: object - ReplacePermissionsForUserGroupV1Input: - description: Updates the list of permissions for a user group. - properties: - permissions: - description: The permissions to replace with. - items: - $ref: '#/components/schemas/PermissionInputV1' - title: permissions - type: array - title: ReplacePermissionsForUserGroupV1Input - type: object - ReplacePermissionsForUserGroupV1Output: - description: "Returns the user group's permissions, including the updated permissions." - example: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - permissions: - description: The updated permissions. - items: - $ref: '#/components/schemas/AccessPermissionV1' - title: permissions - type: array - required: - - permissions - title: ReplacePermissionsForUserGroupV1Output - type: object - ListUsersFromUserGroupV1Input: - description: Looks up the members of a user group within a Workspace. - properties: {} - title: ListUsersFromUserGroupV1Input - type: object - ListUsersFromUserGroupV1Output: - description: Returns the members of a user group with the given group id. - example: - pagination: null - users: - - name: name - id: id - email: email - - name: name - id: id - email: email - properties: - users: - description: The users of the user group. - items: - $ref: '#/components/schemas/MinimalUserV1' - title: users - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - users - title: ListUsersFromUserGroupV1Output - type: object - IntegrationOptionBeta: - description: "Describes an Integration option field required to set up a Segment\ - \ Integration such as Sources, Destinations, or\nwarehouses." - example: - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - properties: - name: - description: The name identifying this option in the context of a Segment - Integration. - title: name - type: string - type: - description: "Defines the type for this option in the schema. Types are\ - \ most commonly strings, but may also represent other\nprimitive types,\ - \ such as booleans, and numbers, as well as complex types, such as objects\ - \ and arrays." - title: type - type: string - required: - description: Whether this is a required option when setting up the Integration. - title: required - type: boolean - description: - description: An optional short text description of the field. - title: description - type: string - defaultValue: - description: An optional default value for the field. - title: defaultValue - label: - description: An optional label for this field. - title: label - type: string - required: - - name - - required - - type - title: IntegrationOptionBeta - type: object - LabelAlpha: - description: "A label lets Workspace owners assign permissions to users, and\ - \ grant these users access to groups.\n\nA Workspace owner may use labels\ - \ to grant users access to groups of resources.\n\nWhen you add a label to\ - \ a Source or Personas Spaces, any users granted access to that label gain\ - \ access to those\nresources.\n\nAll Workspaces include labels for Dev (development)\ - \ and Prod (production) environments. On top of those, Free and\nTeam plan\ - \ customers may create up to five labels.\n\nCustomers with the Enterprise\ - \ pricing package may create an unlimited number of labels." - properties: - key: - description: The key that represents the name of this label. - title: key - type: string - value: - description: The value associated with the key of this label. - title: value - type: string - description: - description: An optional description of the purpose of this label. - title: description - type: string - required: - - key - - value - title: LabelAlpha - type: object - ListLabelsAlphaInput: - description: Retrieves all available labels for the current Workspace. - title: ListLabelsAlphaInput - type: object - ListLabelsAlphaOutput: - description: Returns all available labels for the current Workspace. - properties: - labels: - description: All labels associated with the current Workspace. - items: - $ref: '#/components/schemas/LabelAlpha' - title: labels - type: array - required: - - labels - title: ListLabelsAlphaOutput - type: object - CreateLabelAlphaInput: - description: Creates a new label in the current Workspace. - properties: - label: - $ref: '#/components/schemas/label' - required: - - label - title: CreateLabelAlphaInput - type: object - CreateLabelAlphaOutput: - description: Result of creating a new label in the current Workspace. - properties: - labels: - description: All labels associated with the current Workspace. - items: - $ref: '#/components/schemas/LabelAlpha' - title: labels - type: array - required: - - labels - title: CreateLabelAlphaOutput - type: object - DeleteLabelAlphaInput: - description: Deletes an existing label in the current Workspace. - properties: {} - required: - - key - title: DeleteLabelAlphaInput - type: object - DeleteLabelAlphaOutput: - description: Returns the status of a label deletion. - properties: - status: - description: The status of the label deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteLabelAlphaOutput - type: object - AddLabelsToSourceAlphaInput: - description: Applies an existing label to an existing Source. - properties: - labels: - description: The labels to associate with a Source. - items: - $ref: '#/components/schemas/LabelAlpha' - title: labels - type: array - required: - - labels - title: AddLabelsToSourceAlphaInput - type: object - AddLabelsToSourceAlphaOutput: - description: Applies an existing label to an existing Source. - properties: - labels: - description: All labels applied to the Source. - items: - $ref: '#/components/schemas/LabelAlpha' - title: labels - type: array - required: - - labels - title: AddLabelsToSourceAlphaOutput - type: object - ReplaceLabelsInSourceAlphaInput: - description: Replaces all labels in a Source with a list of new labels. - properties: - labels: - description: The list of labels to replace in the Source. - items: - $ref: '#/components/schemas/LabelAlpha' - title: labels - type: array - required: - - labels - title: ReplaceLabelsInSourceAlphaInput - type: object - ReplaceLabelsInSourceAlphaOutput: - description: Response from replacing a list of labels in a Source. - properties: - labels: - description: All labels replaced in the Source. - items: - $ref: '#/components/schemas/LabelAlpha' - title: labels - type: array - required: - - labels - title: ReplaceLabelsInSourceAlphaOutput - type: object - LabelV1: - description: "A label lets Workspace owners assign permissions to users, and\ - \ grant these users access to groups.\n\nA Workspace owner may use labels\ - \ to grant users access to groups of resources.\n\nWhen you add a label to\ - \ a Source or Personas Spaces, any users granted access to that label gain\ - \ access to those\nresources.\n\nAll Workspaces include labels for Dev (development)\ - \ and Prod (production) environments. On top of those, Free and\nTeam plan\ - \ customers may create up to five labels.\n\nCustomers with the Enterprise\ - \ pricing package may create an unlimited number of labels." - example: - description: description - value: value - key: key - properties: - key: - description: The key that represents the name of this label. - title: key - type: string - value: - description: The value associated with the key of this label. - title: value - type: string - description: - description: An optional description of the purpose of this label. - title: description - type: string - required: - - key - - value - title: LabelV1 - type: object - ListLabelsV1Input: - description: Retrieves all available labels for the current Workspace. - title: ListLabelsV1Input - type: object - ListLabelsV1Output: - description: Returns all available labels for the current Workspace. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - labels: - description: All labels associated with the current Workspace. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - required: - - labels - title: ListLabelsV1Output - type: object - CreateLabelV1Input: - description: Creates a new label in the current Workspace. - properties: - label: - $ref: '#/components/schemas/label_1' - required: - - label - title: CreateLabelV1Input - type: object - CreateLabelV1Output: - description: Result of creating a new label in the current Workspace. - example: - label: null - properties: - label: - $ref: '#/components/schemas/label_2' - required: - - label - title: CreateLabelV1Output - type: object - DeleteLabelV1Input: - description: Deletes an existing label in the current Workspace. - properties: {} - title: DeleteLabelV1Input - type: object - DeleteLabelV1Output: - description: Returns the status of a label deletion. - example: - status: SUCCESS - properties: - status: - description: The status of the label deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteLabelV1Output - type: object - AddLabelsToSourceV1Input: - description: Applies an existing label to an existing Source. - properties: - labels: - description: The labels to associate with a Source. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - title: AddLabelsToSourceV1Input - type: object - AddLabelsToSourceV1Output: - description: Applies an existing label to an existing Source. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - labels: - description: All labels applied to the Source. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - required: - - labels - title: AddLabelsToSourceV1Output - type: object - ReplaceLabelsInSourceV1Input: - description: Replaces all labels in a Source with a list of new labels. - properties: - labels: - description: The list of labels to replace in the Source. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - title: ReplaceLabelsInSourceV1Input - type: object - ReplaceLabelsInSourceV1Output: - description: Response from replacing a list of labels in a Source. - example: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - labels: - description: All labels replaced in the Source. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - required: - - labels - title: ReplaceLabelsInSourceV1Output - type: object - LogosBeta: - description: Represents a logo. - properties: - default: - description: The default URL for this logo. - title: default - type: string - mark: - description: The logo mark. - nullable: true - title: mark - type: string - alt: - description: The alternative text for this logo. - nullable: true - title: alt - type: string - required: - - default - title: LogosBeta - type: object - EventSourceV1: - description: Source represents a Segment Source. - properties: - id: - description: The id of the Source where the events came from. - title: id - type: string - name: - description: "The name of the Source, if applicable." - title: name - type: string - slug: - description: "The slug of the Source, if applicable." - title: slug - type: string - required: - - id - title: EventSourceV1 - type: object - SourceEventVolumeV1: - description: |- - SourceEventVolume represents a time series of event volume for a Workspace - broken down by the dimensions which the customer specifies (optional - parameters). - example: - total: 0.8008281904610115 - series: - - count: 6.027456183070403 - time: time - - count: 6.027456183070403 - time: time - eventName: eventName - source: null - eventType: eventType - properties: - source: - $ref: '#/components/schemas/source' - eventName: - description: "The name of the event, if applicable." - title: eventName - type: string - eventType: - description: "The event type, if applicable." - title: eventType - type: string - total: - description: The total count for all events in the requested time frame. - title: total - type: number - series: - description: |- - A list of the event counts broken down by the requested - granularity. - items: - $ref: '#/components/schemas/SourceEventVolumeDatapointV1' - title: series - type: array - required: - - series - - source - - total - title: SourceEventVolumeV1 - type: object - SourceEventVolumeDatapointV1: - description: |- - SourceEventVolumeDatapoint represents an individual timestamp/event count - pair corresponding to a window of time designated by the granularity. - example: - count: 6.027456183070403 - time: time - properties: - time: - description: |- - The timestamp that corresponds to the beginning of the window given - by the requested granularity. - title: time - type: string - count: - description: "The number of valid events Segment received in the given window,\n\ - after the events completed the validation process." - title: count - type: number - required: - - count - - time - title: SourceEventVolumeDatapointV1 - type: object - GetEventsVolumeFromWorkspaceV1Input: - description: GetEventsVolumeFromWorkspaceV1Input represents the arguments given - to the API. - properties: {} - title: GetEventsVolumeFromWorkspaceV1Input - type: object - GetEventsVolumeFromWorkspaceV1Output: - description: GetEventsVolumeFromWorkspaceV1Output represents the results given - the input query. - example: - result: - - total: 0.8008281904610115 - series: - - count: 6.027456183070403 - time: time - - count: 6.027456183070403 - time: time - eventName: eventName - source: null - eventType: eventType - - total: 0.8008281904610115 - series: - - count: 6.027456183070403 - time: time - - count: 6.027456183070403 - time: time - eventName: eventName - source: null - eventType: eventType - pagination: null - properties: - result: - description: "The resultant list of series broken down by the\ndimensions\ - \ requested over the time frame requested and ordered by the total count\ - \ of events in all series.\nNote: The limit of entries returned is 5000." - items: - $ref: '#/components/schemas/SourceEventVolumeV1' - title: result - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - result - title: GetEventsVolumeFromWorkspaceV1Output - type: object - DestinationStatusV1: - description: DestinationStatus represents status of each Destination in a stream. - example: - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - properties: - name: - title: name - type: string - id: - title: id - type: string - status: - enum: - - FAILED - - FINISHED - - INITIALIZED - - INVALID - - NOT_SUPPORTED - - PARTIAL_SUCCESS - - RUNNING - title: status - type: string - errString: - title: errString - type: string - finishedAt: - title: finishedAt - type: string - required: - - errString - - finishedAt - - id - - name - - status - title: DestinationStatusV1 - type: object - StreamStatusV1: - description: StreamStatus represents status of each stream including all the - Destinations corresponding to the stream. - example: - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - properties: - id: - title: id - type: string - destinationStatus: - items: - $ref: '#/components/schemas/DestinationStatusV1' - title: destinationStatus - type: array - required: - - destinationStatus - - id - title: StreamStatusV1 - type: object - RegulationListEntryV1: - example: - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - properties: - id: - title: id - type: string - subjectType: - title: subjectType - type: string - subjects: - items: - type: string - title: subjects - type: array - status: - enum: - - FAILED - - FINISHED - - INITIALIZED - - INVALID - - NOT_SUPPORTED - - PARTIAL_SUCCESS - - RUNNING - title: status - type: string - createdAt: - title: createdAt - type: string - finishedAt: - title: finishedAt - type: string - required: - - createdAt - - id - - status - - subjectType - - subjects - title: RegulationListEntryV1 - type: object - DeleteRegulationV1Input: - description: The input to delete a regulate request. - properties: {} - required: - - regulateId - title: DeleteRegulationV1Input - type: object - DeleteRegulationV1Output: - description: The output of the delete regulation call. - example: - status: SUCCESS - properties: - status: - description: The status of the deletion call. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteRegulationV1Output - type: object - CreateWorkspaceRegulationV1Input: - description: The input to create a Workspace regulation. - properties: - regulationType: - description: The regulation type to create. - enum: - - BULK_DELETE_ONLY - - DELETE_INTERNAL - - DELETE_ONLY - - SUPPRESS_ONLY - - SUPPRESS_WITH_DELETE - - UNSUPPRESS - title: regulationType - type: string - subjectType: - description: The subject type. Use `objectId` for Cloud Source regulations. - enum: - - OBJECT_ID - - USER_ID - title: subjectType - type: string - subjectIds: - description: "The user or object ids of the subjects to regulate.\n\nConfig\ - \ API note: equal to `parent` but allows an array." - items: - type: string - title: subjectIds - type: array - required: - - regulationType - - subjectIds - - subjectType - title: CreateWorkspaceRegulationV1Input - type: object - CreateWorkspaceRegulationV1Output: - description: The output of a create Workspace regulation call. - example: - regulateId: regulateId - properties: - regulateId: - description: The id of the created regulation. - title: regulateId - type: string - required: - - regulateId - title: CreateWorkspaceRegulationV1Output - type: object - GetRegulationV1Input: - description: The input to get a regulate request. - properties: {} - required: - - regulateId - title: GetRegulationV1Input - type: object - GetRegulationV1Output: - description: The regulate request returned. - example: - regulation: - createdAt: createdAt - id: id - streamStatus: - - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - overallStatus: FAILED - workspaceId: workspaceId - finishedAt: finishedAt - properties: - regulation: - $ref: '#/components/schemas/regulation' - required: - - regulation - title: GetRegulationV1Output - type: object - ListWorkspaceRegulationsV1Input: - description: Input to list all Workspace-scoped regulations in a given Workspace. - properties: {} - title: ListWorkspaceRegulationsV1Input - type: object - ListWorkspaceRegulationsV1Output: - description: Output of all Workspace-scoped regulations in a given Workspace. - example: - pagination: null - regulations: - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - properties: - regulations: - description: List of Workspace-scoped regulations with statuses. - items: - $ref: '#/components/schemas/RegulationListEntryV1' - title: regulations - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - regulations - title: ListWorkspaceRegulationsV1Output - type: object - CreateSourceRegulationV1Input: - description: The input to create a Source-scoped regulation. - properties: - regulationType: - description: The regulation type to create. - enum: - - BULK_DELETE_ONLY - - DELETE_INTERNAL - - DELETE_ONLY - - SUPPRESS_ONLY - - SUPPRESS_WITH_DELETE - - UNSUPPRESS - title: regulationType - type: string - subjectType: - description: The subject type. - enum: - - USER_ID - title: subjectType - type: string - subjectIds: - description: "The user or object ids of the subjects to regulate.\n\nConfig\ - \ API note: equal to `parent` but allows an array." - items: - type: string - title: subjectIds - type: array - required: - - regulationType - title: CreateSourceRegulationV1Input - type: object - CreateSourceRegulationV1Output: - description: The output of a create Source regulation call. - example: - regulateId: regulateId - properties: - regulateId: - description: The id of the created regulation. - title: regulateId - type: string - required: - - regulateId - title: CreateSourceRegulationV1Output - type: object - CreateCloudSourceRegulationV1Input: - description: The input to create a Cloud Source-scoped regulation. - properties: - regulationType: - description: The regulation type to create. - enum: - - BULK_DELETE_ONLY - - DELETE_INTERNAL - - DELETE_ONLY - - SUPPRESS_ONLY - - SUPPRESS_WITH_DELETE - - UNSUPPRESS - title: regulationType - type: string - subjectType: - description: The subject type. Must be `objectId` for Cloud Sources. - enum: - - OBJECT_ID - title: subjectType - type: string - subjectIds: - description: "The user or object ids of the subjects to regulate.\n\nConfig\ - \ API note: equal to `parent` but allows an array." - items: - type: string - title: subjectIds - type: array - collection: - description: The Cloud Source collection to regulate. - title: collection - type: string - required: - - collection - - regulationType - title: CreateCloudSourceRegulationV1Input - type: object - CreateCloudSourceRegulationV1Output: - description: The output of a create Cloud Source regulation call. - example: - regulateId: regulateId - properties: - regulateId: - description: The id of the created regulation. - title: regulateId - type: string - required: - - regulateId - title: CreateCloudSourceRegulationV1Output - type: object - ListRegulationsFromSourceV1Input: - description: Input to list all Source-scoped regulations. - properties: {} - title: ListRegulationsFromSourceV1Input - type: object - ListRegulationsFromSourceV1Output: - description: Output of all Source-scoped regulations. - example: - regulations: - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - properties: - regulations: - description: List of Workspace-scoped regulations with statuses. - items: - $ref: '#/components/schemas/RegulationListEntryV1' - title: regulations - type: array - required: - - regulations - title: ListRegulationsFromSourceV1Output - type: object - ListSuppressionsV1Input: - description: The input to list suppressions for the Workspace. - properties: {} - required: - - pagination - title: ListSuppressionsV1Input - type: object - ListSuppressionsV1Output: - description: The output of a list suppressed call for a Workspace. - example: - pagination: null - suppressed: - - subjectIds: - - subjectIds - - subjectIds - subjectType: subjectType - - subjectIds: - - subjectIds - - subjectIds - subjectType: subjectType - properties: - suppressed: - description: "An array that lists the suppressions from the Workspace.\n\ - \nConfig API note: equal to `attributes`." - items: - $ref: '#/components/schemas/suppressed_inner' - title: suppressed - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - suppressed - title: ListSuppressionsV1Output - type: object - GetSourcesCatalogV1Input: - description: Filter parameters used for loading the Sources public catalog. - properties: {} - required: - - pagination - title: GetSourcesCatalogV1Input - type: object - GetSourcesCatalogV1Output: - description: Returns a list of all Source catalog items contained within a given - page. - example: - pagination: null - sourcesCatalog: - - isCloudEventSource: true - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - categories: - - categories - - categories - logos: null - slug: slug - - isCloudEventSource: true - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - categories: - - categories - - categories - logos: null - slug: slug - properties: - sourcesCatalog: - description: All Source catalog items contained within the requested page. - items: - $ref: '#/components/schemas/SourceMetadataV1' - title: sourcesCatalog - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - sourcesCatalog - title: GetSourcesCatalogV1Output - type: object - GetSourceMetadataV1Input: - description: Requests a Source catalog item by id. - properties: {} - required: - - sourceMetadataId - title: GetSourceMetadataV1Input - type: object - GetSourceMetadataV1Output: - description: Returns the Source catalog item looked up by id. - example: - sourceMetadata: null - properties: - sourceMetadata: - $ref: '#/components/schemas/sourceMetadata' - required: - - sourceMetadata - title: GetSourceMetadataV1Output - type: object - SourceMetadataV1: - description: "A website, server library, mobile SDK, or cloud application which\ - \ can send data into Segment." - example: - isCloudEventSource: true - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - categories: - - categories - - categories - logos: null - slug: slug - properties: - id: - description: "The id for this Source metadata in the Segment catalog.\n\n\ - Config API note: analogous to `name`." - title: id - type: string - name: - description: "The user-friendly name of this Source.\n\nConfig API note:\ - \ equal to `displayName`." - title: name - type: string - slug: - description: "The slug that identifies this Source in the Segment app.\n\ - \nConfig API note: equal to `name`." - title: slug - type: string - description: - description: The description of this Source. - title: description - type: string - logos: - $ref: '#/components/schemas/logos_1' - options: - description: Options for this Source. - items: - $ref: '#/components/schemas/IntegrationOptionBeta' - title: options - type: array - categories: - description: A list of categories this Source belongs to. - items: - type: string - title: categories - type: array - isCloudEventSource: - description: True if this is a Cloud Event Source. - title: isCloudEventSource - type: boolean - required: - - categories - - description - - id - - isCloudEventSource - - logos - - name - - options - - slug - title: SourceMetadataV1 - type: object - CommonSourceSettingsV1: - properties: - track: - $ref: '#/components/schemas/track' - identify: - $ref: '#/components/schemas/identify' - group: - $ref: '#/components/schemas/group' - forwardingViolationsTo: - description: SourceId to forward violations to. - title: forwardingViolationsTo - type: string - forwardingBlockedEventsTo: - description: SourceId to forward blocked events to. - title: forwardingBlockedEventsTo - type: string - title: CommonSourceSettingsV1 - type: object - TrackSourceSettingsV1: - properties: - allowUnplannedEvents: - description: "Enable to allow unplanned track events.\n\nConfig API note:\ - \ equal to `allowUnplannedTrackEvents`." - title: allowUnplannedEvents - type: boolean - allowUnplannedEventProperties: - description: "Enable to allow unplanned track event properties.\n\nConfig\ - \ API note: equal to `allowUnplannedTrackEventProperties`." - title: allowUnplannedEventProperties - type: boolean - allowEventOnViolations: - description: "Allow track event on violations.\n\nConfig API note: equal\ - \ to `allowTrackEventOnViolations`." - title: allowEventOnViolations - type: boolean - allowPropertiesOnViolations: - description: "Enable to allow track properties on violations.\n\nConfig\ - \ API note: equal to `allowTrackEventPropertiesOnViolations`." - title: allowPropertiesOnViolations - type: boolean - commonEventOnViolations: - description: "The common track event on violations.\n\nConfig API note:\ - \ equal to `commonTrackEventOnViolations`." - enum: - - ALLOW - - BLOCK - - OMIT_PROPERTIES - title: commonEventOnViolations - type: string - title: TrackSourceSettingsV1 - type: object - IdentifySourceSettingsV1: - properties: - allowUnplannedTraits: - description: "Enable to allow unplanned identify traits.\n\nConfig API note:\ - \ equal to `allowUnplannedIdentifyTraits`." - title: allowUnplannedTraits - type: boolean - allowTraitsOnViolations: - description: "Enable to allow identify traits on violations.\n\nConfig API\ - \ note: equal to `allowIdentifyTraitsOnViolations`." - title: allowTraitsOnViolations - type: boolean - commonEventOnViolations: - description: "The common identify event on violations.\n\nConfig API note:\ - \ equal to `commonIdentifyEventOnViolations`." - enum: - - ALLOW - - BLOCK - - OMIT_TRAITS - title: commonEventOnViolations - type: string - title: IdentifySourceSettingsV1 - type: object - GroupSourceSettingsV1: - properties: - allowUnplannedTraits: - description: "Enable to allow unplanned group traits.\n\nConfig API note:\ - \ equal to `allowUnplannedGroupTraits`." - title: allowUnplannedTraits - type: boolean - allowTraitsOnViolations: - description: "Enable to allow group traits on violations.\n\nConfig API\ - \ note: equal to `allowGroupTraitsOnViolations`." - title: allowTraitsOnViolations - type: boolean - commonEventOnViolations: - description: "The common group event on violations.\n\nConfig API note:\ - \ equal to `commonGroupEventOnViolations`." - enum: - - ALLOW - - BLOCK - - OMIT_TRAITS - title: commonEventOnViolations - type: string - title: GroupSourceSettingsV1 - type: object - SourceSettingsOutputV1: - description: The output of Source settings. - properties: - track: - $ref: '#/components/schemas/track' - identify: - $ref: '#/components/schemas/identify' - group: - $ref: '#/components/schemas/group' - forwardingViolationsTo: - description: SourceId to forward violations to. - title: forwardingViolationsTo - type: string - forwardingBlockedEventsTo: - description: SourceId to forward blocked events to. - title: forwardingBlockedEventsTo - type: string - title: SourceSettingsOutputV1 - type: object - ListSchemaSettingsInSourceV1Input: - description: Request the settings of a Source. - properties: {} - required: - - sourceId - title: ListSchemaSettingsInSourceV1Input - type: object - ListSchemaSettingsInSourceV1Output: - description: Returns a list of settings for the Source. - example: - sourceId: sourceId - settings: null - properties: - sourceId: - description: "Source id.\n\nConfig API note: analogous to `parent` and `name`." - title: sourceId - type: string - settings: - $ref: '#/components/schemas/settings' - required: - - settings - - sourceId - title: ListSchemaSettingsInSourceV1Output - type: object - UpdateSchemaSettingsInSourceV1Input: - description: Input to update a Source's settings. - properties: - track: - $ref: '#/components/schemas/track' - identify: - $ref: '#/components/schemas/identify' - group: - $ref: '#/components/schemas/group' - forwardingViolationsTo: - description: Source id to forward violations to. - title: forwardingViolationsTo - type: string - forwardingBlockedEventsTo: - description: Source id to forward blocked events to. - title: forwardingBlockedEventsTo - type: string - required: - - sourceId - title: UpdateSchemaSettingsInSourceV1Input - type: object - UpdateSchemaSettingsInSourceV1Output: - description: Output of the Source with updated settings. - example: - sourceId: sourceId - settings: null - properties: - sourceId: - description: "The id of the updated Source.\n\nConfig API note: analogous\ - \ to `parent` and `name`." - title: sourceId - type: string - settings: - $ref: '#/components/schemas/settings_1' - required: - - settings - - sourceId - title: UpdateSchemaSettingsInSourceV1Output - type: object - SourceAlpha: - description: Defines a data Source for Segment data. - properties: - id: - description: "The id of the Source.\n\nConfig API note: analogous to `name`." - title: id - type: string - slug: - description: "The slug used to identify the Source in the Segment app.\n\ - \nConfig API note: equal to `name`." - title: slug - type: string - name: - description: "The name of the Source.\n\nConfig API note: equal to `displayName`." - title: name - type: string - metadata: - $ref: '#/components/schemas/metadata_1' - workspaceId: - description: "The id of the Workspace that owns the Source.\n\nConfig API\ - \ note: equal to `parent`." - title: workspaceId - type: string - enabled: - description: Enable to receive data from the Source. - title: enabled - type: boolean - writeKeys: - description: |- - The write keys used to send data from the Source. This field is left empty when the current token does not have the - 'source admin' permission. - items: - type: string - title: writeKeys - type: array - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsAlpha' - description: The settings associated with the Source. - title: settings - labels: - description: A list of labels applied to the Source. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - required: - - enabled - - id - - labels - - metadata - - slug - - workspaceId - - writeKeys - title: SourceAlpha - type: object - SourceSettingsAlpha: - additionalProperties: {} - description: |- - A key-value object that contains instance-specific settings for a Source. - - The `options` field in the Source metadata defines the schema of this object. - title: SourceSettingsAlpha - type: object - ListSourcesAlphaInput: - description: Requests a list of Sources that belong to the current Workspace. - properties: {} - required: - - pagination - title: ListSourcesAlphaInput - type: object - ListSourcesAlphaOutput: - description: Returns a list of Sources that belong to the current Workspace. - properties: - sources: - description: A list of Sources that belong to the Workspace. - items: - $ref: '#/components/schemas/SourceAlpha' - title: sources - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - sources - title: ListSourcesAlphaOutput - type: object - GetSourceAlphaInput: - description: Looks up a Source by id. - properties: {} - required: - - sourceId - title: GetSourceAlphaInput - type: object - GetSourceAlphaOutput: - description: Returns a Source. - properties: - source: - $ref: '#/components/schemas/source_1' - required: - - source - title: GetSourceAlphaOutput - type: object - ListConnectedWarehousesFromSourceAlphaInput: - description: Requests a list of Warehouses connected to a Source. - properties: {} - required: - - pagination - title: ListConnectedWarehousesFromSourceAlphaInput - type: object - ListConnectedWarehousesFromSourceAlphaOutput: - description: Returns a list of Warehouses connected to a Source. - properties: - warehouses: - description: A list that contains the Warehouses connected to the Source. - items: - $ref: '#/components/schemas/WarehouseV1' - title: warehouses - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - warehouses - title: ListConnectedWarehousesFromSourceAlphaOutput - type: object - ListConnectedDestinationsFromSourceAlphaInput: - description: Requests a list of Destinations connected to a Source. - properties: {} - required: - - pagination - title: ListConnectedDestinationsFromSourceAlphaInput - type: object - ListConnectedDestinationsFromSourceAlphaOutput: - description: Returns a list of Destinations connected to a Source. - properties: - destinations: - description: A list that contains the Destinations connected to the Source. - items: - $ref: '#/components/schemas/DestinationV1' - title: destinations - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - destinations - - pagination - title: ListConnectedDestinationsFromSourceAlphaOutput - type: object - CreateSourceAlphaInput: - description: Create a new Source based on a set of parameters. - properties: - slug: - description: The slug by which to identify the Source in the Segment app. - title: slug - type: string - enabled: - description: Enable to allow this Source to send data. Defaults to true. - title: enabled - type: boolean - name: - description: An optional human-readable name for this Source. - title: name - type: string - metadataId: - description: |- - The id of the Source metadata from which this instance of the Source derives. - - All Source metadata is available under `/catalog/sources`. - title: metadataId - type: string - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsAlpha' - description: A key-value object that contains instance-specific settings - for the Source. - title: settings - required: - - enabled - - metadataId - - slug - title: CreateSourceAlphaInput - type: object - CreateSourceAlphaOutput: - description: Returns the newly Source. - properties: - source: - $ref: '#/components/schemas/source_2' - required: - - source - title: CreateSourceAlphaOutput - type: object - DeleteSourceAlphaInput: - description: Deletes an existing Source by id. - properties: {} - required: - - sourceId - title: DeleteSourceAlphaInput - type: object - DeleteSourceAlphaOutput: - description: Returns the status of a Source deletion. - properties: - status: - description: The status of the Source deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteSourceAlphaOutput - type: object - UpdateSourceAlphaInput: - description: Updates an existing Source based on a set of parameters. - properties: - name: - description: "An optional human-readable name to associate with the Source.\n\ - \nConfig API note: equal to `displayName`." - title: name - type: string - enabled: - description: Enable to allow the Source to send data. - title: enabled - type: boolean - slug: - description: "The slug that identifies the Source.\n\nConfig API note: equal\ - \ to `name`." - title: slug - type: string - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsAlpha' - description: |- - A key-value object that contains instance-specific settings for the Source. - - Different kinds of Sources require different kinds of input. The settings input for a Source comes from the - `options` object associated with this instance of a Source. - - You can find the full list of required settings by accessing the Sources catalog endpoint under `/catalog/sources`. - title: settings - required: - - sourceId - title: UpdateSourceAlphaInput - type: object - UpdateSourceAlphaOutput: - description: Returns the updated Source. - properties: - source: - $ref: '#/components/schemas/source_3' - required: - - source - title: UpdateSourceAlphaOutput - type: object - SourceV1: - description: Defines a data Source for Segment data. - example: - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - id: - description: "The id of the Source.\n\nConfig API note: analogous to `name`." - title: id - type: string - slug: - description: "The slug used to identify the Source in the Segment app.\n\ - \nConfig API note: equal to `name`." - title: slug - type: string - name: - description: "The name of the Source.\n\nConfig API note: equal to `displayName`." - title: name - type: string - metadata: - $ref: '#/components/schemas/metadata_1' - workspaceId: - description: "The id of the Workspace that owns the Source.\n\nConfig API\ - \ note: equal to `parent`." - title: workspaceId - type: string - enabled: - description: Enable to receive data from the Source. - title: enabled - type: boolean - writeKeys: - description: |- - The write keys used to send data from the Source. This field is left empty when the current token does not have the - 'source admin' permission. - items: - type: string - title: writeKeys - type: array - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsV1' - description: The settings associated with the Source. - title: settings - labels: - description: A list of labels applied to the Source. - items: - $ref: '#/components/schemas/LabelV1' - title: labels - type: array - required: - - enabled - - id - - labels - - metadata - - slug - - workspaceId - - writeKeys - title: SourceV1 - type: object - SourceSettingsV1: - additionalProperties: {} - description: |- - A key-value object that contains instance-specific settings for a Source. - - The `options` field in the Source metadata defines the schema of this object. - title: SourceSettingsV1 - type: object - ListSourcesV1Input: - description: Requests a list of Sources that belong to the current Workspace. - properties: {} - required: - - pagination - title: ListSourcesV1Input - type: object - ListSourcesV1Output: - description: Returns a list of Sources that belong to the current Workspace. - example: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - sources: - description: A list of Sources that belong to the Workspace. - items: - $ref: '#/components/schemas/SourceV1' - title: sources - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - sources - title: ListSourcesV1Output - type: object - GetSourceV1Input: - description: Looks up a Source by id. - properties: {} - required: - - sourceId - title: GetSourceV1Input - type: object - GetSourceV1Output: - description: Returns a Source. - example: - source: null - properties: - source: - $ref: '#/components/schemas/source_4' - required: - - source - title: GetSourceV1Output - type: object - ListConnectedWarehousesFromSourceV1Input: - description: Requests a list of Warehouses connected to a Source. - properties: {} - title: ListConnectedWarehousesFromSourceV1Input - type: object - ListConnectedWarehousesFromSourceV1Output: - description: Returns a list of Warehouses connected to a Source. - example: - pagination: null - warehouses: - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - properties: - warehouses: - description: A list that contains the Warehouses connected to the Source. - items: - $ref: '#/components/schemas/WarehouseV1' - title: warehouses - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - warehouses - title: ListConnectedWarehousesFromSourceV1Output - type: object - ListConnectedDestinationsFromSourceV1Input: - description: Requests a list of Destinations connected to a Source. - properties: {} - title: ListConnectedDestinationsFromSourceV1Input - type: object - ListConnectedDestinationsFromSourceV1Output: - description: Returns a list of Destinations connected to a Source. - example: - pagination: null - destinations: - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - properties: - destinations: - description: A list that contains the Destinations connected to the Source. - items: - $ref: '#/components/schemas/DestinationV1' - title: destinations - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - destinations - - pagination - title: ListConnectedDestinationsFromSourceV1Output - type: object - CreateSourceV1Input: - description: Create a new Source based on a set of parameters. - properties: - slug: - description: The slug by which to identify the Source in the Segment app. - title: slug - type: string - enabled: - description: Enable to allow this Source to send data. Defaults to true. - title: enabled - type: boolean - metadataId: - description: |- - The id of the Source metadata from which this instance of the Source derives. - - All Source metadata is available under `/catalog/sources`. - title: metadataId - type: string - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsV1' - description: A key-value object that contains instance-specific settings - for the Source. - title: settings - required: - - enabled - - metadataId - - slug - title: CreateSourceV1Input - type: object - CreateSourceV1Output: - description: Returns a newly created Source. - example: - source: null - properties: - source: - $ref: '#/components/schemas/source_5' - required: - - source - title: CreateSourceV1Output - type: object - DeleteSourceV1Input: - description: Deletes an existing Source by id. - properties: {} - required: - - sourceId - title: DeleteSourceV1Input - type: object - DeleteSourceV1Output: - description: Returns the status of a Source deletion. - example: - status: SUCCESS - properties: - status: - description: The status of the Source deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteSourceV1Output - type: object - UpdateSourceV1Input: - description: Updates an existing Source based on a set of parameters. - properties: - name: - description: "An optional human-readable name to associate with the Source.\n\ - \nConfig API note: equal to `displayName`." - title: name - type: string - enabled: - description: Enable to allow the Source to send data. - title: enabled - type: boolean - slug: - description: "The slug that identifies the Source.\n\nConfig API note: equal\ - \ to `name`." - title: slug - type: string - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsV1' - description: |- - A key-value object that contains instance-specific settings for the Source. - - Different kinds of Sources require different kinds of input. The settings input for a Source comes from the - `options` object associated with this instance of a Source. - - You can find the full list of required settings by accessing the Sources catalog endpoint under `/catalog/sources`. - title: settings - required: - - sourceId - title: UpdateSourceV1Input - type: object - UpdateSourceV1Output: - description: Returns the updated Source. - example: - source: null - properties: - source: - $ref: '#/components/schemas/source_6' - required: - - source - title: UpdateSourceV1Output - type: object - GetSpaceAlphaInput: - description: Input for the getSpaceById endpoint. - properties: {} - required: - - spaceId - title: GetSpaceAlphaInput - type: object - Space: - properties: - id: - title: id - type: string - slug: - title: slug - type: string - name: - title: name - type: string - required: - - id - - name - - slug - title: Space - type: object - GetSpaceAlphaOutput: - description: Response for the getSpaceById endpoint. - example: - space: null - properties: - space: - $ref: '#/components/schemas/space' - required: - - space - title: GetSpaceAlphaOutput - type: object - MessagesSubscriptionRequest: - properties: - key: - description: Key is the phone number or email. - title: key - type: string - type: - description: Type is communication medium used. Either EMAIL or SMS. - enum: - - EMAIL - - SMS - title: type - type: string - status: - description: "The user subscribed, unsubscribed, or on initial status." - enum: - - DID_NOT_SUBSCRIBE - - SUBSCRIBED - - UNSUBSCRIBED - title: status - type: string - required: - - key - - status - - type - title: MessagesSubscriptionRequest - type: object - ReplaceMessagingSubscriptionsInSpacesAlphaInput: - description: Input for the endpoint. - properties: - subscriptions: - description: An array of subscriptions. - items: - $ref: '#/components/schemas/MessagesSubscriptionRequest' - title: subscriptions - type: array - required: - - spaceId - - subscriptions - title: ReplaceMessagingSubscriptionsInSpacesAlphaInput - type: object - MessageSubscriptionResponseError: - example: - code: code - message: message - properties: - code: - description: Error code. - title: code - type: string - message: - description: Error message. - title: message - type: string - required: - - code - - message - title: MessageSubscriptionResponseError - type: object - MessageSubscriptionResponse: - example: - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - properties: - key: - description: Key is the phone number or email. - title: key - type: string - type: - description: Type is communication medium used. Either EMAIL or SMS. - enum: - - EMAIL - - SMS - title: type - type: string - status: - description: "The user subscribed, unsubscribed, or on initial status." - enum: - - DID_NOT_SUBSCRIBE - - SUBSCRIBED - - UNSUBSCRIBED - title: status - type: string - errors: - description: Error messages. - items: - $ref: '#/components/schemas/MessageSubscriptionResponseError' - title: errors - type: array - required: - - key - - status - - type - title: MessageSubscriptionResponse - type: object - ReplaceMessagingSubscriptionsInSpacesAlphaOutput: - description: Output for the endpoint. - example: - failures: - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - pagination: null - successes: - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - properties: - successes: - description: Array of successful subscription status. - items: - $ref: '#/components/schemas/MessageSubscriptionResponse' - title: successes - type: array - failures: - description: Array of failure subscription status. - items: - $ref: '#/components/schemas/MessageSubscriptionResponse' - title: failures - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - failures - - successes - title: ReplaceMessagingSubscriptionsInSpacesAlphaOutput - type: object - GetMessagingSubscriptionSuccessResponse: - example: - type: EMAIL - key: key - status: DID_NOT_SUBSCRIBE - properties: - key: - description: Key is the phone number or email. - title: key - type: string - type: - description: Type is communication medium used. Either EMAIL or SMS. - enum: - - EMAIL - - SMS - title: type - type: string - status: - description: "The user subscribed, unsubscribed, or on initial status. This\ - \ is absent if the phone number or email is not found." - enum: - - DID_NOT_SUBSCRIBE - - SUBSCRIBED - - UNSUBSCRIBED - title: status - type: string - required: - - key - - type - title: GetMessagingSubscriptionSuccessResponse - type: object - GetMessagingSubscriptionFailureResponse: - example: - type: type - key: key - errors: - - code: code - message: message - - code: code - message: message - properties: - key: - description: Key is the phone number or email. - title: key - type: string - type: - description: This will be the exact type as given in the request. - title: type - type: string - errors: - description: "Per key errors, such as validation errors." - items: - $ref: '#/components/schemas/MessageSubscriptionResponseError' - title: errors - type: array - required: - - errors - - key - - type - title: GetMessagingSubscriptionFailureResponse - type: object - BatchQueryMessagingSubscriptionsForSpaceAlphaOutput: - description: Batch get response. - example: - failures: - - type: type - key: key - errors: - - code: code - message: message - - code: code - message: message - - type: type - key: key - errors: - - code: code - message: message - - code: code - message: message - pagination: null - successes: - - type: EMAIL - key: key - status: DID_NOT_SUBSCRIBE - - type: EMAIL - key: key - status: DID_NOT_SUBSCRIBE - errors: - - code: code - message: message - - code: code - message: message - properties: - successes: - description: Array of successful subscription status. - items: - $ref: '#/components/schemas/GetMessagingSubscriptionSuccessResponse' - title: successes - type: array - failures: - description: Validation errors due to invalid types or email/phone numbers. - items: - $ref: '#/components/schemas/GetMessagingSubscriptionFailureResponse' - title: failures - type: array - errors: - description: General errors when making the request such as invalid payload - or wrong http method errors. - items: - $ref: '#/components/schemas/MessageSubscriptionResponseError' - title: errors - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - errors - - failures - - successes - title: BatchQueryMessagingSubscriptionsForSpaceAlphaOutput - type: object - GetSubscriptionRequest: - properties: - key: - description: Key is the phone number or email. - title: key - type: string - type: - description: Type is communication medium used. Either EMAIL or SMS. - enum: - - EMAIL - - SMS - title: type - type: string - required: - - key - - type - title: GetSubscriptionRequest - type: object - BatchQueryMessagingSubscriptionsForSpaceAlphaInput: - description: Batch get request. - properties: - subscriptions: - description: A list of subscriptions to retrieve subscription status. - items: - $ref: '#/components/schemas/GetSubscriptionRequest' - title: subscriptions - type: array - required: - - spaceId - - subscriptions - title: BatchQueryMessagingSubscriptionsForSpaceAlphaInput - type: object - TrackingPlanV1: - description: Represents a Tracking Plan. - example: - createdAt: createdAt - name: name - description: description - id: id - type: LIVE - slug: slug - updatedAt: updatedAt - properties: - id: - description: "The Tracking Plan's identifier.\n\nConfig API note: analogous\ - \ to `name`." - title: id - type: string - name: - description: "The Tracking Plan's name.\n\nConfig API note: equal to `displayName`." - title: name - type: string - slug: - description: "URL-friendly slug of this Tracking Plan.\n\nConfig API note:\ - \ equal to `name`." - title: slug - type: string - description: - description: The Tracking Plan's description. - title: description - type: string - type: - description: The Tracking Plan's type. - enum: - - LIVE - - PROPERTY_LIBRARY - - RULE_LIBRARY - - TEMPLATE - title: type - type: string - updatedAt: - description: "The timestamp of the last change to the Tracking Plan.\n\n\ - Config API note: equal to `updateTime`." - title: updatedAt - type: string - createdAt: - description: "The timestamp of this Tracking Plan's creation.\n\nConfig\ - \ API note: equal to `createTime`." - title: createdAt - type: string - required: - - id - - type - title: TrackingPlanV1 - type: object - RuleV1: - description: Represents a rule from a Tracking Plan. - example: - createdAt: createdAt - jsonSchema: "" - deprecatedAt: deprecatedAt - type: COMMON - version: 0.8008281904610115 - key: key - updatedAt: updatedAt - properties: - type: - description: The type for this Tracking Plan rule. - enum: - - COMMON - - GROUP - - IDENTIFY - - PAGE - - SCREEN - - TRACK - title: type - type: string - key: - description: Key to this rule (free-form string like 'Button clicked'). - title: key - type: string - jsonSchema: - description: JSON Schema of this rule. - title: jsonSchema - version: - description: Version of this rule. - title: version - type: number - createdAt: - description: The timestamp of this rule's creation. - title: createdAt - type: string - updatedAt: - description: The timestamp of this rule's last change. - title: updatedAt - type: string - deprecatedAt: - description: The timestamp of this rule's deprecation. - title: deprecatedAt - type: string - required: - - jsonSchema - - type - - version - title: RuleV1 - type: object - UpsertRuleV1: - properties: - newKey: - description: This rule's new intended key. - title: newKey - type: string - type: - description: The type for this Tracking Plan rule. - enum: - - COMMON - - GROUP - - IDENTIFY - - PAGE - - SCREEN - - TRACK - title: type - type: string - key: - description: Key to this rule (free-form string like 'Button clicked'). - title: key - type: string - jsonSchema: - description: JSON Schema of this rule. - title: jsonSchema - version: - description: Version of this rule. - title: version - type: number - createdAt: - description: The timestamp of this rule's creation. - title: createdAt - type: string - updatedAt: - description: The timestamp of this rule's last change. - title: updatedAt - type: string - deprecatedAt: - description: The timestamp of this rule's deprecation. - title: deprecatedAt - type: string - required: - - jsonSchema - - type - - version - title: UpsertRuleV1 - type: object - RemoveRuleV1: - description: Represents the parameters needed to identify a rule on the backend-side. - properties: - type: - enum: - - COMMON - - GROUP - - IDENTIFY - - PAGE - - SCREEN - - TRACK - title: type - type: string - key: - title: key - type: string - version: - title: version - type: number - required: - - type - - version - title: RemoveRuleV1 - type: object - ListTrackingPlansV1Input: - description: Lists the Tracking Plans associated with the current Workspace. - properties: {} - title: ListTrackingPlansV1Input - type: object - GetTrackingPlanV1Input: - description: Gets a single Tracking Plan. - properties: {} - required: - - trackingPlanId - title: GetTrackingPlanV1Input - type: object - ListTrackingPlansV1Output: - description: Lists the Tracking Plans associated with the current Workspace. - example: - pagination: null - trackingPlans: - - createdAt: createdAt - name: name - description: description - id: id - type: LIVE - slug: slug - updatedAt: updatedAt - - createdAt: createdAt - name: name - description: description - id: id - type: LIVE - slug: slug - updatedAt: updatedAt - properties: - trackingPlans: - description: A paginated list of Tracking Plans. - items: - $ref: '#/components/schemas/TrackingPlanV1' - title: trackingPlans - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - trackingPlans - title: ListTrackingPlansV1Output - type: object - GetTrackingPlanV1Output: - description: Gets a single Tracking Plan. - example: - trackingPlan: null - properties: - trackingPlan: - $ref: '#/components/schemas/trackingPlan' - required: - - trackingPlan - title: GetTrackingPlanV1Output - type: object - DeleteTrackingPlanV1Input: - description: Deletes a Tracking Plan. - properties: {} - required: - - trackingPlanId - title: DeleteTrackingPlanV1Input - type: object - DeleteTrackingPlanV1Output: - description: Result of a DeleteTrackingPlan call. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteTrackingPlanV1Output - type: object - CreateTrackingPlanV1Input: - description: Creates a Tracking Plan in the Workspace. - properties: - name: - description: "The Tracking Plan's name.\n\nConfig API note: equal to `displayName`." - title: name - type: string - description: - description: The Tracking Plan's description. - title: description - type: string - type: - description: The Tracking Plan's type. - enum: - - LIVE - - PROPERTY_LIBRARY - - RULE_LIBRARY - - TEMPLATE - title: type - type: string - required: - - name - - type - title: CreateTrackingPlanV1Input - type: object - CreateTrackingPlanV1Output: - description: Result of a CreateTrackingPlan call. - example: - trackingPlan: null - properties: - trackingPlan: - $ref: '#/components/schemas/trackingPlan_1' - required: - - trackingPlan - title: CreateTrackingPlanV1Output - type: object - UpdateTrackingPlanV1Input: - description: Updates the Workspace's Tracking Plan. - properties: - name: - description: "The Tracking Plan's name.\n\nConfig API note: equal to `displayName`." - title: name - type: string - description: - description: The Tracking Plan's description. - title: description - type: string - required: - - trackingPlanId - title: UpdateTrackingPlanV1Input - type: object - UpdateTrackingPlanV1Output: - description: Result of an UpdateTrackingPlan call. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: UpdateTrackingPlanV1Output - type: object - ListRulesFromTrackingPlanV1Input: - description: Lists a Tracking Plan's rules. - properties: {} - title: ListRulesFromTrackingPlanV1Input - type: object - ListRulesFromTrackingPlanV1Output: - description: Lists a Tracking Plan's rules. - example: - pagination: null - rules: - - createdAt: createdAt - jsonSchema: "" - deprecatedAt: deprecatedAt - type: COMMON - version: 0.8008281904610115 - key: key - updatedAt: updatedAt - - createdAt: createdAt - jsonSchema: "" - deprecatedAt: deprecatedAt - type: COMMON - version: 0.8008281904610115 - key: key - updatedAt: updatedAt - properties: - rules: - description: Rules associated with the given Tracking Plan. - items: - $ref: '#/components/schemas/RuleV1' - title: rules - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - rules - title: ListRulesFromTrackingPlanV1Output - type: object - UpdateRulesInTrackingPlanV1Input: - description: Updates Tracking Plan rules. Non-existent rules are added. - properties: - rules: - description: Rules to update or insert. - items: - $ref: '#/components/schemas/UpsertRuleV1' - title: rules - type: array - title: UpdateRulesInTrackingPlanV1Input - type: object - RemoveRulesFromTrackingPlanV1Input: - description: Remove specified rules from a Tracking Plan. - properties: {} - title: RemoveRulesFromTrackingPlanV1Input - type: object - ReplaceRulesInTrackingPlanV1Input: - description: Replaces Tracking Plan rules. - properties: - rules: - description: Rules to replace. - items: - $ref: '#/components/schemas/RuleV1' - title: rules - type: array - title: ReplaceRulesInTrackingPlanV1Input - type: object - ReplaceRulesInTrackingPlanV1Output: - description: Replaces Tracking Plan rules. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: ReplaceRulesInTrackingPlanV1Output - type: object - RemoveRulesFromTrackingPlanV1Output: - description: Remove specified rules from a Tracking Plan. - example: - status: SUCCESS - properties: - status: - description: The status of the operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveRulesFromTrackingPlanV1Output - type: object - UpdateRulesInTrackingPlanV1Output: - description: Updates Tracking Plan rules. Non-existent rules are added. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: UpdateRulesInTrackingPlanV1Output - type: object - ListSourcesFromTrackingPlanV1Input: - description: Lists all Sources associated with a Tracking Plan. - properties: {} - title: ListSourcesFromTrackingPlanV1Input - type: object - ListSourcesFromTrackingPlanV1Output: - description: Lists all Sources associated with a Tracking Plan. - example: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - sources: - description: A paginated list of Sources associated with the Tracking Plan. - items: - $ref: '#/components/schemas/SourceV1' - title: sources - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - sources - title: ListSourcesFromTrackingPlanV1Output - type: object - AddSourceToTrackingPlanV1Input: - description: Connects a Source to a Tracking Plan. - properties: - sourceId: - description: "The id of the Source associated with the Tracking Plan.\n\n\ - Config API note: analogous to `sourceName`." - title: sourceId - type: string - title: AddSourceToTrackingPlanV1Input - type: object - AddSourceToTrackingPlanV1Output: - description: Connects a Source to a Tracking Plan. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: AddSourceToTrackingPlanV1Output - type: object - RemoveSourceFromTrackingPlanV1Input: - description: Disconnects a Source from a Tracking Plan. - properties: {} - title: RemoveSourceFromTrackingPlanV1Input - type: object - RemoveSourceFromTrackingPlanV1Output: - description: Disconnects a Source from a Tracking Plan. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveSourceFromTrackingPlanV1Output - type: object - TransformationBeta: - description: Represents a Transformation. - example: - sourceId: sourceId - newEventName: newEventName - name: name - destinationMetadataId: destinationMetadataId - id: id - if: if - enabled: true - propertyRenames: - - newName: newName - oldName: oldName - - newName: newName - oldName: oldName - properties: - id: - description: The id of the Transformation. - title: id - type: string - name: - description: The name of the Transformation. - title: name - type: string - sourceId: - description: The Source associated with the Transformation. - title: sourceId - type: string - destinationMetadataId: - description: The optional Destination metadata associated with the Transformation. - title: destinationMetadataId - type: string - enabled: - description: If the Transformation is enabled. - title: enabled - type: boolean - if: - description: "If statement ([FQL](https://segment.com/docs/config-api/fql/))\ - \ to match events.\n\nFor standard event matchers, use the following:\n\ - \ Track -\\> \"event='\\'\"\n Identify -\\> \"type='identify'\"\ - \n Group -\\> \"type='group'\"" - title: if - type: string - newEventName: - description: Optional new event name for renaming events. Works only for - 'track' event type. - title: newEventName - type: string - propertyRenames: - description: Optional array for renaming properties collected by your events. - items: - $ref: '#/components/schemas/PropertyRenameBeta' - title: propertyRenames - type: array - required: - - enabled - - id - - if - - name - - sourceId - title: TransformationBeta - type: object - PropertyRenameBeta: - example: - newName: newName - oldName: oldName - properties: - oldName: - description: The old name of the property. - title: oldName - type: string - newName: - description: The new name to rename the property. - title: newName - type: string - required: - - newName - - oldName - title: PropertyRenameBeta - type: object - GetTransformationBetaOutput: - description: The output of Transformation retrieval. - example: - transformation: null - properties: - transformation: - $ref: '#/components/schemas/transformation' - required: - - transformation - title: GetTransformationBetaOutput - type: object - GetTransformationBetaInput: - description: The input of Transformation retrieval. - properties: {} - required: - - transformationId - title: GetTransformationBetaInput - type: object - ListTransformationsBetaInput: - description: Lists the Transformations associated with the current Workspace. - properties: {} - required: - - pagination - title: ListTransformationsBetaInput - type: object - ListTransformationsBetaOutput: - description: Lists the Transformations associated with the current Workspace. - example: - pagination: null - transformations: - - sourceId: sourceId - newEventName: newEventName - name: name - destinationMetadataId: destinationMetadataId - id: id - if: if - enabled: true - propertyRenames: - - newName: newName - oldName: oldName - - newName: newName - oldName: oldName - - sourceId: sourceId - newEventName: newEventName - name: name - destinationMetadataId: destinationMetadataId - id: id - if: if - enabled: true - propertyRenames: - - newName: newName - oldName: oldName - - newName: newName - oldName: oldName - properties: - transformations: - description: A paginated list of Transformations. - items: - $ref: '#/components/schemas/TransformationBeta' - title: transformations - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - transformations - title: ListTransformationsBetaOutput - type: object - DeleteTransformationBetaInput: - description: The input of delete Transformation. - properties: {} - required: - - transformationId - title: DeleteTransformationBetaInput - type: object - DeleteTransformationBetaOutput: - description: The output of delete Transformation. - example: - status: SUCCESS - properties: - status: - description: The operation status. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteTransformationBetaOutput - type: object - UpdateTransformationBetaInput: - description: The input to update a Transformation. - properties: - name: - description: The name of the Transformation. - title: name - type: string - sourceId: - description: The optional Source to be associated with the Transformation. - title: sourceId - type: string - destinationMetadataId: - description: The optional Destination metadata to be associated with the - Transformation. - title: destinationMetadataId - type: string - enabled: - description: If the Transformation should be enabled. - title: enabled - type: boolean - if: - description: "If statement ([FQL](https://segment.com/docs/config-api/fql/))\ - \ to match events.\n\nFor standard event matchers, use the following:\n\ - \ Track -\\> \"event='\\'\"\n Identify -\\> \"type='identify'\"\ - \n Group -\\> \"type='group'\"" - title: if - type: string - newEventName: - description: Optional new event name for renaming events. Works only for - 'track' event type. - title: newEventName - type: string - propertyRenames: - description: Optional array for renaming properties collected by your events. - items: - $ref: '#/components/schemas/PropertyRenameBeta' - title: propertyRenames - type: array - required: - - transformationId - title: UpdateTransformationBetaInput - type: object - UpdateTransformationBetaOutput: - description: The output of an updated Transformation. - example: - transformation: null - properties: - transformation: - $ref: '#/components/schemas/transformation_1' - required: - - transformation - title: UpdateTransformationBetaOutput - type: object - CreateTransformationBetaInput: - description: The input to create a Transformation. - properties: - name: - description: The name of the Transformation. - title: name - type: string - sourceId: - description: The Source to be associated with the Transformation. - title: sourceId - type: string - destinationMetadataId: - description: The optional Destination metadata id to be associated with - the Transformation. - title: destinationMetadataId - type: string - enabled: - description: If the Transformation should be enabled. - title: enabled - type: boolean - if: - description: "If statement ([FQL](https://segment.com/docs/config-api/fql/))\ - \ to match events.\n\nFor standard event matchers, use the following:\n\ - \ Track -\\> \"event='\\'\"\n Identify -\\> \"type='identify'\"\ - \n Group -\\> \"type='group'\"" - title: if - type: string - newEventName: - description: Optional new event name for renaming events. Works only for - 'track' event type. - title: newEventName - type: string - propertyRenames: - description: Optional array for renaming properties collected by your events. - items: - $ref: '#/components/schemas/PropertyRenameBeta' - title: propertyRenames - type: array - required: - - enabled - - if - - name - - sourceId - title: CreateTransformationBetaInput - type: object - CreateTransformationBetaOutput: - description: The output of a created Transformation. - example: - transformation: null - properties: - transformation: - $ref: '#/components/schemas/transformation_2' - required: - - transformation - title: CreateTransformationBetaOutput - type: object - MtuSnapshotV1: - description: A snapshot of MTU metrics within the given usage period. - example: - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - properties: - periodStart: - description: "The start of the usage period, in unix time (seconds since\ - \ epoch)." - title: periodStart - type: number - periodEnd: - description: "The end of the usage period, in unix time (seconds since epoch)." - title: periodEnd - type: number - anonymous: - description: A bigint of the number of anonymous users in this snapshot. - title: anonymous - type: string - anonymousIdentified: - description: A bigint of the number of anonymous identified users in this - snapshot. - title: anonymousIdentified - type: string - identified: - description: A bigint of the number of identified users in this snapshot. - title: identified - type: string - neverIdentified: - description: A bigint of the number of never identified users in this snapshot. - title: neverIdentified - type: string - timestamp: - description: "The timestamp of this snapshot within the billing cycle, in\ - \ the ISO-8601 format." - title: timestamp - type: string - required: - - anonymous - - anonymousIdentified - - identified - - neverIdentified - - periodEnd - - periodStart - - timestamp - title: MtuSnapshotV1 - type: object - UsersPerSourceSnapshotV1: - description: A snapshot of MTU metrics for a given Source within the given usage - period. - example: - sourceId: sourceId - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - properties: - sourceId: - description: The Source id. - title: sourceId - type: string - periodStart: - description: "The start of the usage period, in unix time (seconds since\ - \ epoch)." - title: periodStart - type: number - periodEnd: - description: "The end of the usage period, in unix time (seconds since epoch)." - title: periodEnd - type: number - anonymous: - description: A bigint of the number of anonymous users in this snapshot. - title: anonymous - type: string - anonymousIdentified: - description: A bigint of the number of anonymous identified users in this - snapshot. - title: anonymousIdentified - type: string - identified: - description: A bigint of the number of identified users in this snapshot. - title: identified - type: string - neverIdentified: - description: A bigint of the number of never identified users in this snapshot. - title: neverIdentified - type: string - timestamp: - description: "The timestamp of this snapshot within the billing cycle, in\ - \ the ISO-8601 format." - title: timestamp - type: string - required: - - anonymous - - anonymousIdentified - - identified - - neverIdentified - - periodEnd - - periodStart - - sourceId - - timestamp - title: UsersPerSourceSnapshotV1 - type: object - APICallSnapshotV1: - description: A snapshot of the number of API calls for a given Workspace. - example: - apiCalls: apiCalls - timestamp: timestamp - properties: - apiCalls: - description: A bigint of the number of API calls in this snapshot. - title: apiCalls - type: string - timestamp: - description: Timestamp of this snapshot within the billing cycle in the - ISO-8601 format. - title: timestamp - type: string - required: - - apiCalls - - timestamp - title: APICallSnapshotV1 - type: object - SourceAPICallSnapshotV1: - description: A snapshot of the number of API calls for a given Source in a Workspace. - example: - sourceId: sourceId - apiCalls: apiCalls - timestamp: timestamp - properties: - sourceId: - description: The Source id. - title: sourceId - type: string - apiCalls: - description: A bigint of the number of API calls in this snapshot. - title: apiCalls - type: string - timestamp: - description: Timestamp of this snapshot within the billing cycle in the - ISO-8601 format. - title: timestamp - type: string - required: - - apiCalls - - sourceId - - timestamp - title: SourceAPICallSnapshotV1 - type: object - GetDailyWorkspaceMTUUsageV1Input: - description: Input to retrieve aggregated daily Workspace MTU in a billing period. - properties: {} - required: - - pagination - title: GetDailyWorkspaceMTUUsageV1Input - type: object - GetDailyWorkspaceMTUUsageV1Output: - description: Returns a list of daily aggregations of Workspace MTU counts. - example: - pagination: null - dailyWorkspaceMTUUsage: - - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - properties: - dailyWorkspaceMTUUsage: - description: The list of daily Workspace MTU count aggregates. - items: - $ref: '#/components/schemas/MtuSnapshotV1' - title: dailyWorkspaceMTUUsage - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - dailyWorkspaceMTUUsage - - pagination - title: GetDailyWorkspaceMTUUsageV1Output - type: object - GetDailyPerSourceMTUUsageV1Input: - description: Input to retrieve aggregated daily Source level MTU in a billing - period. - properties: {} - required: - - pagination - title: GetDailyPerSourceMTUUsageV1Input - type: object - GetDailyPerSourceMTUUsageV1Output: - description: Returns a list of daily aggregations of Source level MTU counts. - example: - pagination: null - dailyPerSourceMTUUsage: - - sourceId: sourceId - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - - sourceId: sourceId - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - properties: - dailyPerSourceMTUUsage: - description: The list of daily per Source MTU count aggregates. - items: - $ref: '#/components/schemas/UsersPerSourceSnapshotV1' - title: dailyPerSourceMTUUsage - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - dailyPerSourceMTUUsage - - pagination - title: GetDailyPerSourceMTUUsageV1Output - type: object - GetDailyWorkspaceAPICallsUsageV1Input: - description: Input to retrieve aggregated daily Workspace API calls in a billing - period. - properties: {} - required: - - pagination - title: GetDailyWorkspaceAPICallsUsageV1Input - type: object - GetDailyWorkspaceAPICallsUsageV1Output: - description: Returns a list of daily aggregations of Workspace MTU counts. - example: - dailyWorkspaceAPICallsUsage: - - apiCalls: apiCalls - timestamp: timestamp - - apiCalls: apiCalls - timestamp: timestamp - pagination: null - properties: - dailyWorkspaceAPICallsUsage: - description: The list of daily Workspace API calls count aggregates. - items: - $ref: '#/components/schemas/APICallSnapshotV1' - title: dailyWorkspaceAPICallsUsage - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - dailyWorkspaceAPICallsUsage - - pagination - title: GetDailyWorkspaceAPICallsUsageV1Output - type: object - GetDailyPerSourceAPICallsUsageV1Input: - description: Input to retrieve aggregated daily Source level API calls in a - billing period. - properties: {} - required: - - pagination - title: GetDailyPerSourceAPICallsUsageV1Input - type: object - GetDailyPerSourceAPICallsUsageV1Output: - description: Returns a list of daily aggregations of Source level API calls - counts. - example: - pagination: null - dailyPerSourceAPICallsUsage: - - sourceId: sourceId - apiCalls: apiCalls - timestamp: timestamp - - sourceId: sourceId - apiCalls: apiCalls - timestamp: timestamp - properties: - dailyPerSourceAPICallsUsage: - description: The list of daily per Source API calls count aggregates. - items: - $ref: '#/components/schemas/SourceAPICallSnapshotV1' - title: dailyPerSourceAPICallsUsage - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - dailyPerSourceAPICallsUsage - - pagination - title: GetDailyPerSourceAPICallsUsageV1Output - type: object - GetWarehousesCatalogV1Input: - description: Filter parameters used for loading the Warehouses public catalog. - properties: {} - required: - - pagination - title: GetWarehousesCatalogV1Input - type: object - GetWarehousesCatalogV1Output: - description: Returns a list of all Warehouse catalog items contained within - a given page. - example: - pagination: null - warehousesCatalog: - - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - logos: null - slug: slug - - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - logos: null - slug: slug - properties: - warehousesCatalog: - description: All Warehouse catalog items contained within the requested - page. - items: - $ref: '#/components/schemas/WarehouseMetadataV1' - title: warehousesCatalog - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - warehousesCatalog - title: GetWarehousesCatalogV1Output - type: object - GetWarehouseMetadataV1Input: - description: Returns a Warehouse catalog item by id. - properties: {} - required: - - warehouseMetadataId - title: GetWarehouseMetadataV1Input - type: object - GetWarehouseMetadataV1Output: - description: Returns a Warehouse catalog item looked up by id. - example: - warehouseMetadata: null - properties: - warehouseMetadata: - $ref: '#/components/schemas/warehouseMetadata' - required: - - warehouseMetadata - title: GetWarehouseMetadataV1Output - type: object - WarehouseMetadataV1: - description: The metadata for an instance of Segment’s data Warehouse product. - example: - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - logos: null - slug: slug - properties: - id: - description: The id of this object. - title: id - type: string - name: - description: The name of this object. - title: name - type: string - slug: - description: "A human-readable, unique identifier for object." - title: slug - type: string - description: - description: "A description, in English, of this object." - title: description - type: string - logos: - $ref: '#/components/schemas/logos_2' - options: - description: The Integration options for this object. - items: - $ref: '#/components/schemas/IntegrationOptionBeta' - title: options - type: array - required: - - description - - id - - logos - - name - - options - - slug - title: WarehouseMetadataV1 - type: object - WarehouseSettingsV1: - additionalProperties: {} - description: A key-value object that contains instance-specific Warehouse settings. - title: WarehouseSettingsV1 - type: object - WarehouseV1: - description: Defines a data Warehouse used as a Destination for Segment data. - example: - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - properties: - id: - description: The id of the Warehouse. - title: id - type: string - metadata: - $ref: '#/components/schemas/metadata_2' - workspaceId: - description: The id of the Workspace that owns this Warehouse. - title: workspaceId - type: string - enabled: - description: "When set to true, this Warehouse receives data." - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/WarehouseSettingsV1' - description: "The settings associated with this Warehouse.\n\nCommon settings\ - \ are connection-related configuration used to connect to it, for example\ - \ host, username, and port." - title: settings - required: - - enabled - - id - - metadata - - settings - - workspaceId - title: WarehouseV1 - type: object - SyncNoticeV1: - description: Represents a notice within a sync for a Source and Warehouse pair. - example: - createdAt: createdAt - level: level - message: message - properties: - level: - description: The severity of the notice. - title: level - type: string - message: - description: The human-readable message that describes the notice. - title: message - type: string - createdAt: - description: The timestamp of this sync notice's creation. - title: createdAt - type: string - required: - - createdAt - - level - - message - title: SyncNoticeV1 - type: object - SyncV1: - description: |- - Represents a sync between a Source and Warehouse. - - A sync occurs when data from a Source is loaded into a Warehouse. - example: - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - properties: - sourceId: - description: The id of the Source loaded in the sync. - title: sourceId - type: string - start: - description: The start time of the sync. - title: start - type: string - end: - description: The time the sync completed. Returns null if unfinished. - nullable: true - title: end - type: string - status: - description: The status of the sync. - title: status - type: string - duration: - description: The duration of the sync in seconds. Returns the partial duration - if the sync has not finished yet. - title: duration - type: number - humanDuration: - description: The human-readable counterpart of `duration`. - title: humanDuration - type: string - count: - description: The number of rows synced into the Warehouse. - title: count - type: number - notices: - description: Notices that contain the events that occurred during the sync. - items: - $ref: '#/components/schemas/SyncNoticeV1' - title: notices - type: array - required: - - count - - duration - - end - - humanDuration - - notices - - sourceId - - start - - status - title: SyncV1 - type: object - WarehouseSyncOverrideV1: - description: Represents the override for a Source/collection/property? path - to apply to a Warehouse. - properties: - sourceId: - description: The id of the Source this schema item applies to. - title: sourceId - type: string - collection: - description: The collection the schema item override applies to. - title: collection - type: string - enabled: - description: Enable to apply the override. - title: enabled - type: boolean - property: - description: A property within the collection to which the override applies. - title: property - type: string - required: - - enabled - - sourceId - title: WarehouseSyncOverrideV1 - type: object - WarehouseSelectiveSyncItemV1: - description: Represents an entry in the Warehouse Selective Sync schema for - a Warehouse and Source pair. - example: - sourceId: sourceId - warehouseId: warehouseId - collection: collection - properties: - key: "" - properties: - sourceId: - description: The Source id attached to this Warehouse. - title: sourceId - type: string - collection: - description: The collection within the Source. - title: collection - type: string - warehouseId: - description: The id of the Warehouse this sync belongs to. - title: warehouseId - type: string - properties: - additionalProperties: true - description: A map that contains the properties within the collection to - which the Warehouse should sync. - title: properties - type: object - required: - - collection - - properties - - sourceId - - warehouseId - title: WarehouseSelectiveSyncItemV1 - type: object - WarehouseAdvancedSyncV1: - description: Determines the time of day at which a Warehouse should sync. - properties: - hourOfDay: - description: "The hour of day for which to enable/disable a sync, between\ - \ 0 and 23." - title: hourOfDay - type: number - enabled: - description: Enable to the sync at the specified hour. - title: enabled - type: boolean - required: - - enabled - - hourOfDay - title: WarehouseAdvancedSyncV1 - type: object - AdvancedWarehouseSyncScheduleV1Input: - description: Defines the advanced sync schedule for a Warehouse. - properties: - times: - description: A list that contains the times when syncs should occur. - items: - $ref: '#/components/schemas/WarehouseAdvancedSyncV1' - title: times - type: array - timezone: - description: A TZ-database timezone for this sync schedule. - title: timezone - type: string - required: - - times - - timezone - title: AdvancedWarehouseSyncScheduleV1Input - type: object - AdvancedWarehouseSyncScheduleV1Output: - description: Defines the advanced sync schedule for a Warehouse. - properties: - times: - description: A list that contains the times when syncs should occur. - items: - $ref: '#/components/schemas/WarehouseAdvancedSyncV1' - title: times - type: array - timezone: - description: A TZ-database timezone for this sync schedule. - title: timezone - type: string - title: AdvancedWarehouseSyncScheduleV1Output - type: object - ListWarehousesV1Input: - description: Gets a list of Warehouses belonging to a Workspace. - properties: {} - required: - - pagination - title: ListWarehousesV1Input - type: object - ListWarehousesV1Output: - description: Returns a list of Warehouses that belong to a Workspace. - example: - pagination: null - warehouses: - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - properties: - warehouses: - description: A list of Warehouses that belong to the Workspace. - items: - $ref: '#/components/schemas/WarehouseV1' - title: warehouses - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - warehouses - title: ListWarehousesV1Output - type: object - GetWarehouseV1Input: - description: Looks up a Warehouse by id. - properties: {} - required: - - warehouseId - title: GetWarehouseV1Input - type: object - GetWarehouseV1Output: - description: Returns a Warehouse. - example: - warehouse: null - properties: - warehouse: - $ref: '#/components/schemas/warehouse' - required: - - warehouse - title: GetWarehouseV1Output - type: object - ListConnectedSourcesFromWarehouseV1Input: - description: Looks up the list of Sources connected to a Warehouse. - properties: {} - title: ListConnectedSourcesFromWarehouseV1Input - type: object - ListConnectedSourcesFromWarehouseV1Output: - description: Returns a list of Sources connected to a Warehouse. - example: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - sources: - description: A list that contains the Sources connected to the requested - Warehouse. - items: - $ref: '#/components/schemas/SourceV1' - title: sources - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - sources - title: ListConnectedSourcesFromWarehouseV1Output - type: object - ListSyncsFromWarehouseV1Input: - description: Requests the overview of syncs for every Source connected to this - Warehouse. - properties: {} - title: ListSyncsFromWarehouseV1Input - type: object - ListSyncsFromWarehouseV1Output: - description: Returns an overview page that contains the last syncs for a Warehouse. - example: - reports: - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - pagination: null - properties: - reports: - description: A list that contains the latest syncs for the specified Warehouse. - items: - $ref: '#/components/schemas/SyncV1' - title: reports - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - reports - title: ListSyncsFromWarehouseV1Output - type: object - ListSyncsFromWarehouseAndSourceV1Input: - description: Loads the most recent sync information for a Warehouse-source pair. - properties: {} - title: ListSyncsFromWarehouseAndSourceV1Input - type: object - ListSyncsFromWarehouseAndSourceV1Output: - description: "Returns a list that contains the most recent syncs for a Warehouse-source\ - \ pair, filtered and constrained by a given\nset of pagination parameters." - example: - reports: - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - pagination: null - properties: - reports: - description: A list that contains the latest syncs for the specified Warehouse-source - pair. - items: - $ref: '#/components/schemas/SyncV1' - title: reports - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - pagination - - reports - title: ListSyncsFromWarehouseAndSourceV1Output - type: object - AddConnectionFromSourceToWarehouseV1Input: - description: "Connects a Source to a Warehouse.\n\nPosting to this idempotent\ - \ endpoint creates a connection between the Source and Warehouse, and begins\ - \ syncing data\nfrom the Source's collections into the chosen Warehouse Destination." - properties: {} - title: AddConnectionFromSourceToWarehouseV1Input - type: object - AddConnectionFromSourceToWarehouseV1Output: - description: Response indicating whether the connection was successful. - example: - status: CONNECTED - properties: - status: - description: The status of the connection between the Source and Warehouse. - enum: - - CONNECTED - - NOT_CONNECTED - title: status - type: string - required: - - status - title: AddConnectionFromSourceToWarehouseV1Output - type: object - RemoveSourceConnectionFromWarehouseV1Input: - description: "Disconnects a Source from a Warehouse.\n\nPosting to this idempotent\ - \ endpoint removes a connection between the Source and Warehouse, and blocks\ - \ all syncing\nfrom the Source's collections into the chosen Warehouse Destination." - properties: {} - title: RemoveSourceConnectionFromWarehouseV1Input - type: object - RemoveSourceConnectionFromWarehouseV1Output: - description: Response indicating whether the disconnection was successful. - example: - status: SUCCESS - properties: - status: - description: The status of the request to disconnect the Source and Warehouse. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: RemoveSourceConnectionFromWarehouseV1Output - type: object - ListSelectiveSyncsFromWarehouseAndSourceV1Input: - description: Get the Selective Sync configuration associated with a Warehouse. - properties: {} - title: ListSelectiveSyncsFromWarehouseAndSourceV1Input - type: object - ListSelectiveSyncsFromWarehouseAndSourceV1Output: - description: Results containing the Selective Sync configuration for a Warehouse. - example: - pagination: null - items: - - sourceId: sourceId - warehouseId: warehouseId - collection: collection - properties: - key: "" - - sourceId: sourceId - warehouseId: warehouseId - collection: collection - properties: - key: "" - properties: - items: - description: "Represents a list of Source, collection, and properties synced\ - \ to the Warehouse." - items: - $ref: '#/components/schemas/WarehouseSelectiveSyncItemV1' - title: items - type: array - pagination: - $ref: '#/components/schemas/pagination' - required: - - items - - pagination - title: ListSelectiveSyncsFromWarehouseAndSourceV1Output - type: object - UpdateSelectiveSyncForWarehouseV1Input: - description: Updates the schema for a Warehouse/sources pair. - properties: - syncOverrides: - description: A list of sync schema overrides to apply to this Warehouse. - items: - $ref: '#/components/schemas/WarehouseSyncOverrideV1' - title: syncOverrides - type: array - title: UpdateSelectiveSyncForWarehouseV1Input - type: object - UpdateSelectiveSyncForWarehouseV1Output: - description: Results from updating the schema for a Warehouse/source pair. - example: - warnings: - - warnings - - warnings - status: UNCHANGED - properties: - status: - description: Status of the update operation. - enum: - - UNCHANGED - - UPDATED - title: status - type: string - warnings: - description: Warnings returned by the operation. - items: - type: string - title: warnings - type: array - required: - - status - - warnings - title: UpdateSelectiveSyncForWarehouseV1Output - type: object - GetAdvancedSyncScheduleFromWarehouseV1Input: - description: Gets the advanced sync schedule for a Warehouse. - properties: {} - required: - - warehouseId - title: GetAdvancedSyncScheduleFromWarehouseV1Input - type: object - GetAdvancedSyncScheduleFromWarehouseV1Output: - description: Returns the advanced sync schedule for a Warehouse. - example: - schedule: null - enabled: true - properties: - enabled: - description: Indicates if an advanced sync schedule is enabled for this - Warehouse. - title: enabled - type: boolean - schedule: - $ref: '#/components/schemas/schedule' - required: - - enabled - title: GetAdvancedSyncScheduleFromWarehouseV1Output - type: object - ReplaceAdvancedSyncScheduleForWarehouseV1Input: - description: Replaces the advanced sync schedule for a Warehouse. - properties: - enabled: - description: Enable to turn on an advanced sync schedule for the Warehouse. - title: enabled - type: boolean - schedule: - $ref: '#/components/schemas/schedule_1' - title: ReplaceAdvancedSyncScheduleForWarehouseV1Input - type: object - ReplaceAdvancedSyncScheduleForWarehouseV1Output: - description: Returns the advanced sync schedule for a Warehouse. - example: - schedule: null - enabled: true - properties: - enabled: - description: Indicates if an advanced sync schedule is enabled for the Warehouse. - title: enabled - type: boolean - schedule: - $ref: '#/components/schemas/schedule_2' - required: - - enabled - title: ReplaceAdvancedSyncScheduleForWarehouseV1Output - type: object - CreateWarehouseV1Input: - description: Create a new Warehouse based on a set of parameters. - properties: - metadataId: - description: The Warehouse metadata to use. - title: metadataId - type: string - name: - description: An optional human-readable name for this Warehouse. - title: name - type: string - enabled: - description: Enable to allow this Warehouse to receive data. Defaults to - true. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/WarehouseSettingsV1' - description: |- - A key-value object that contains instance-specific settings for a Warehouse. - - Different kinds of Warehouses require different settings. The required and optional settings - for a Warehouse are described in the `options` object of the associated Warehouse metadata. - - You can find the full list of Warehouse metadata and related settings information in the - `/catalog/warehouses` endpoint. - title: settings - required: - - metadataId - - settings - title: CreateWarehouseV1Input - type: object - CreateWarehouseV1Output: - description: Returns the newly created Warehouse. - example: - warehouse: null - properties: - warehouse: - $ref: '#/components/schemas/warehouse_1' - required: - - warehouse - title: CreateWarehouseV1Output - type: object - UpdateWarehouseV1Input: - description: Updates an existing Warehouse based on a set of parameters. - properties: - name: - description: An optional human-readable name to associate with this Warehouse. - nullable: true - title: name - type: string - enabled: - description: Enable to allow this Warehouse to receive data. - title: enabled - type: boolean - settings: - allOf: - - $ref: '#/components/schemas/WarehouseSettingsV1' - description: |- - A key-value object that contains instance-specific settings for a Warehouse. - - Different kinds of Warehouses require different settings. The required and optional settings - for a Warehouse are described in the `options` object of the associated Warehouse metadata. - - You can find the full list of Warehouse metadata and related settings information in the - `/catalog/warehouses` endpoint. - title: settings - title: UpdateWarehouseV1Input - type: object - UpdateWarehouseV1Output: - description: Returns the updated Warehouse. - example: - warehouse: null - properties: - warehouse: - $ref: '#/components/schemas/warehouse_2' - required: - - warehouse - title: UpdateWarehouseV1Output - type: object - DeleteWarehouseV1Input: - description: Deletes an existing Warehouse by id. - properties: {} - required: - - warehouseId - title: DeleteWarehouseV1Input - type: object - DeleteWarehouseV1Output: - description: Returns the status of a Warehouse deletion. - example: - status: SUCCESS - properties: - status: - description: The status of the Warehouse deletion operation. - enum: - - SUCCESS - title: status - type: string - required: - - status - title: DeleteWarehouseV1Output - type: object - GetConnectionStateFromWarehouseV1Input: - description: "Verifies the connection state of a Warehouse.\n\nUse this to check\ - \ if a Warehouse is reachable, given its stored connection settings." - properties: {} - required: - - warehouseId - title: GetConnectionStateFromWarehouseV1Input - type: object - GetConnectionStateFromWarehouseV1Output: - description: Returns the status of a Warehouse connection settings after an - attempt to connect to it. - example: - connectionState: CONNECTED - properties: - connectionState: - description: Represents the status for the current connection settings. - enum: - - CONNECTED - - FAILED - title: connectionState - type: string - required: - - connectionState - title: GetConnectionStateFromWarehouseV1Output - type: object - CreateValidationInWarehouseV1Output: - description: Returns the status of a Warehouse connection settings after an - attempt to connect to it. - example: - status: CONNECTED - properties: - status: - description: Represents the status for the current connection settings. - enum: - - CONNECTED - - FAILED - title: status - type: string - required: - - status - title: CreateValidationInWarehouseV1Output - type: object - CreateValidationInWarehouseV1Input: - description: Verifies a set of Warehouse credentials by attempting to connect - to it. - properties: - metadataId: - description: The id of the Warehouse metadata type. - title: metadataId - type: string - settings: - allOf: - - $ref: '#/components/schemas/WarehouseSettingsV1' - description: The settings to check. - title: settings - required: - - metadataId - - settings - title: CreateValidationInWarehouseV1Input - type: object - WorkspaceV1: - description: An organized group of Sources and Destinations managed by a team. - properties: - id: - description: The unique identifier. - title: id - type: string - slug: - description: The URL-friendly slug. - title: slug - type: string - name: - description: The human-readable name. - title: name - type: string - required: - - id - - name - - slug - title: WorkspaceV1 - type: object - GetWorkspaceV1Input: - description: Loads the Workspace associated with the token. - title: GetWorkspaceV1Input - type: object - GetWorkspaceV1Output: - description: Represents the output of loading the Workspace. - example: - workspace: null - properties: - workspace: - $ref: '#/components/schemas/workspace' - required: - - workspace - title: GetWorkspaceV1Output - type: object - RequestError: - description: Represents any error that could have occurred while performing - a request. - properties: - type: - description: "The type for this error (validation, server, unknown, etc)." - title: type - type: string - message: - description: An error message attached to this error. - title: message - type: string - field: - description: The name of an input field from the request that triggered - this error. - title: field - type: string - data: - description: Any extra data associated with this error. - title: data - status: - description: Http status code. - title: status - type: number - required: - - type - title: RequestError - type: object - PaginationInput: - description: "Pagination parameters.\n\nEvery resource that returns a list of\ - \ items in its `Output` object may contain a `PaginationInput` in its `Input`\n\ - object. Required, though some of its fields are optional." - properties: - cursor: - description: "The page to request.\n\nAcceptable values to use here are\ - \ in PaginationOutput objects, in the `current`, `next`, and `previous`\ - \ keys.\n\nConsumers of the API must treat this value as opaque." - title: cursor - type: string - count: - description: "The number of items to retrieve in a page, between 1 and 200." - title: count - type: number - required: - - count - title: PaginationInput - type: object - PaginationOutput: - description: "Pagination metadata for a list response.\n\nResponses return this\ - \ object alongside a list of resources, which provides the necessary metadata\ - \ for manipulating a\npaginated collection. In operations that return lists,\ - \ it's always present, though some of its fields might not be." - properties: - current: - description: |- - The current cursor within a collection. - - Consumers of the API must treat this value as opaque. - title: current - type: string - next: - description: |- - A pointer to the next page. - - This does not return when you retrieve the last page. - - Consumers of the API must treat this value as opaque. - nullable: true - title: next - type: string - previous: - description: |- - A pointer to the previous page. - - This does not return when you retrieve the first page. - - Consumers of the API must treat this value as opaque. - nullable: true - title: previous - type: string - totalEntries: - description: "The total number of entries available in the collection.\n\ - \nIf calculating it impacts performance, the response may omit this field." - title: totalEntries - type: number - required: - - current - title: PaginationOutput - type: object - RequestErrorEnvelope: - description: Envelope type for RequestErrors. - properties: - errors: - items: - $ref: '#/components/schemas/RequestError' - type: array - required: - - errors - title: RequestErrorEnvelope - type: object - addConnectionFromSourceToWarehouse_200_response: - example: - data: - status: CONNECTED - properties: - data: - $ref: '#/components/schemas/AddConnectionFromSourceToWarehouseV1Output' - removeSourceConnectionFromWarehouse_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/RemoveSourceConnectionFromWarehouseV1Output' - replaceLabelsInSource_200_response: - example: - data: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ReplaceLabelsInSourceV1Output' - replaceLabelsInSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/ReplaceLabelsInSourceAlphaOutput' - addLabelsToSource_200_response: - example: - data: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/AddLabelsToSourceV1Output' - addLabelsToSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/AddLabelsToSourceAlphaOutput' - replacePermissionsForUser_200_response: - example: - data: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ReplacePermissionsForUserV1Output' - addPermissionsToUser_200_response: - example: - data: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/AddPermissionsToUserV1Output' - replacePermissionsForUserGroup_200_response: - example: - data: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ReplacePermissionsForUserGroupV1Output' - addPermissionsToUserGroup_200_response: - example: - data: - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/AddPermissionsToUserGroupV1Output' - listSourcesFromTrackingPlan_200_response: - example: - data: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ListSourcesFromTrackingPlanV1Output' - addSourceToTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/AddSourceToTrackingPlanV1Output' - removeSourceFromTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/RemoveSourceFromTrackingPlanV1Output' - listUsersFromUserGroup_200_response: - example: - data: - pagination: null - users: - - name: name - id: id - email: email - - name: name - id: id - email: email - properties: - data: - $ref: '#/components/schemas/ListUsersFromUserGroupV1Output' - addUsersToUserGroup_200_response: - example: - data: - userGroup: null - properties: - data: - $ref: '#/components/schemas/AddUsersToUserGroupV1Output' - batchQueryMessagingSubscriptionsForSpace_200_response: - example: - data: - failures: - - type: type - key: key - errors: - - code: code - message: message - - code: code - message: message - - type: type - key: key - errors: - - code: code - message: message - - code: code - message: message - pagination: null - successes: - - type: EMAIL - key: key - status: DID_NOT_SUBSCRIBE - - type: EMAIL - key: key - status: DID_NOT_SUBSCRIBE - errors: - - code: code - message: message - - code: code - message: message - properties: - data: - $ref: '#/components/schemas/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput' - createCloudSourceRegulation_200_response: - example: - data: - regulateId: regulateId - properties: - data: - $ref: '#/components/schemas/CreateCloudSourceRegulationV1Output' - listDestinations_200_response: - example: - data: - pagination: null - destinations: - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - properties: - data: - $ref: '#/components/schemas/ListDestinationsV1Output' - createDestination_200_response: - example: - data: - destination: null - properties: - data: - $ref: '#/components/schemas/CreateDestinationV1Output' - listSubscriptionsFromDestination_200_response: - example: - data: - subscriptions: - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - - actionSlug: actionSlug - settings: "" - name: name - actionId: actionId - id: id - trigger: trigger - destinationId: destinationId - enabled: true - pagination: null - properties: - data: - $ref: '#/components/schemas/ListSubscriptionsFromDestinationAlphaOutput' - createDestinationSubscription_200_response: - example: - data: - destinationSubscription: null - properties: - data: - $ref: '#/components/schemas/CreateDestinationSubscriptionAlphaOutput' - createEdgeFunctions_200_response: - example: - data: - edgeFunctions: null - properties: - data: - $ref: '#/components/schemas/CreateEdgeFunctionsAlphaOutput' - listFiltersFromDestination_200_response: - example: - data: - pagination: null - filters: - - sourceId: sourceId - createdAt: createdAt - description: description - id: id - destinationId: destinationId - title: title - if: if - actions: - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - enabled: true - updatedAt: updatedAt - - sourceId: sourceId - createdAt: createdAt - description: description - id: id - destinationId: destinationId - title: title - if: if - actions: - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - - path: path - type: ALLOW_PROPERTIES - fields: - key: "" - percent: 0.8008281904610115 - enabled: true - updatedAt: updatedAt - properties: - data: - $ref: '#/components/schemas/ListFiltersFromDestinationV1Output' - createFilterForDestination_200_response: - example: - data: - filter: null - properties: - data: - $ref: '#/components/schemas/CreateFilterForDestinationV1Output' - listFunctions_200_response: - example: - data: - pagination: null - functions: - - createdAt: createdAt - catalogId: catalogId - createdBy: createdBy - displayName: displayName - description: description - id: id - logoUrl: logoUrl - resourceType: DESTINATION - - createdAt: createdAt - catalogId: catalogId - createdBy: createdBy - displayName: displayName - description: description - id: id - logoUrl: logoUrl - resourceType: DESTINATION - properties: - data: - $ref: '#/components/schemas/ListFunctionsV1Output' - createFunction_200_response: - example: - data: - function: null - properties: - data: - $ref: '#/components/schemas/CreateFunctionV1Output' - createFunctionDeployment_200_response: - example: - data: - functionDeployment: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/CreateFunctionDeploymentV1Output' - listInvites_200_response: - example: - data: - pagination: null - invites: - - invites - - invites - properties: - data: - $ref: '#/components/schemas/ListInvitesV1Output' - createInvites_200_response: - example: - data: - emails: - - emails - - emails - properties: - data: - $ref: '#/components/schemas/CreateInvitesV1Output' - deleteInvites_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteInvitesV1Output' - listLabels_200_response: - example: - data: - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ListLabelsV1Output' - listLabels_200_response_1: - properties: - data: - $ref: '#/components/schemas/ListLabelsAlphaOutput' - createLabel_200_response: - example: - data: - label: null - properties: - data: - $ref: '#/components/schemas/CreateLabelV1Output' - createLabel_200_response_1: - properties: - data: - $ref: '#/components/schemas/CreateLabelAlphaOutput' - listSources_200_response: - example: - data: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ListSourcesV1Output' - listSources_200_response_1: - properties: - data: - $ref: '#/components/schemas/ListSourcesAlphaOutput' - createSource_200_response: - example: - data: - source: null - properties: - data: - $ref: '#/components/schemas/CreateSourceV1Output' - createSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/CreateSourceAlphaOutput' - listRegulationsFromSource_200_response: - example: - data: - regulations: - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - properties: - data: - $ref: '#/components/schemas/ListRegulationsFromSourceV1Output' - createSourceRegulation_200_response: - example: - data: - regulateId: regulateId - properties: - data: - $ref: '#/components/schemas/CreateSourceRegulationV1Output' - listTrackingPlans_200_response: - example: - data: - pagination: null - trackingPlans: - - createdAt: createdAt - name: name - description: description - id: id - type: LIVE - slug: slug - updatedAt: updatedAt - - createdAt: createdAt - name: name - description: description - id: id - type: LIVE - slug: slug - updatedAt: updatedAt - properties: - data: - $ref: '#/components/schemas/ListTrackingPlansV1Output' - createTrackingPlan_200_response: - example: - data: - trackingPlan: null - properties: - data: - $ref: '#/components/schemas/CreateTrackingPlanV1Output' - listTransformations_200_response: - example: - data: - pagination: null - transformations: - - sourceId: sourceId - newEventName: newEventName - name: name - destinationMetadataId: destinationMetadataId - id: id - if: if - enabled: true - propertyRenames: - - newName: newName - oldName: oldName - - newName: newName - oldName: oldName - - sourceId: sourceId - newEventName: newEventName - name: name - destinationMetadataId: destinationMetadataId - id: id - if: if - enabled: true - propertyRenames: - - newName: newName - oldName: oldName - - newName: newName - oldName: oldName - properties: - data: - $ref: '#/components/schemas/ListTransformationsBetaOutput' - createTransformation_200_response: - example: - data: - transformation: null - properties: - data: - $ref: '#/components/schemas/CreateTransformationBetaOutput' - listUserGroups_200_response: - example: - data: - userGroups: - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - memberCount: 0.8008281904610115 - name: name - id: id - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - memberCount: 0.8008281904610115 - name: name - id: id - pagination: null - properties: - data: - $ref: '#/components/schemas/ListUserGroupsV1Output' - createUserGroup_200_response: - example: - data: - userGroup: null - properties: - data: - $ref: '#/components/schemas/CreateUserGroupV1Output' - createValidationInWarehouse_200_response: - example: - data: - status: CONNECTED - properties: - data: - $ref: '#/components/schemas/CreateValidationInWarehouseV1Output' - listWarehouses_200_response: - example: - data: - pagination: null - warehouses: - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - properties: - data: - $ref: '#/components/schemas/ListWarehousesV1Output' - createWarehouse_200_response: - example: - data: - warehouse: null - properties: - data: - $ref: '#/components/schemas/CreateWarehouseV1Output' - listWorkspaceRegulations_200_response: - example: - data: - pagination: null - regulations: - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - - createdAt: createdAt - subjects: - - subjects - - subjects - id: id - subjectType: subjectType - status: FAILED - finishedAt: finishedAt - properties: - data: - $ref: '#/components/schemas/ListWorkspaceRegulationsV1Output' - createWorkspaceRegulation_200_response: - example: - data: - regulateId: regulateId - properties: - data: - $ref: '#/components/schemas/CreateWorkspaceRegulationV1Output' - getDestination_200_response: - example: - data: - destination: null - properties: - data: - $ref: '#/components/schemas/GetDestinationV1Output' - deleteDestination_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteDestinationV1Output' - updateDestination_200_response: - example: - data: - destination: null - properties: - data: - $ref: '#/components/schemas/UpdateDestinationV1Output' - getFunction_200_response: - example: - data: - function: null - properties: - data: - $ref: '#/components/schemas/GetFunctionV1Output' - deleteFunction_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteFunctionV1Output' - updateFunction_200_response: - example: - data: - function: null - properties: - data: - $ref: '#/components/schemas/UpdateFunctionV1Output' - deleteLabel_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteLabelV1Output' - deleteLabel_200_response_1: - properties: - data: - $ref: '#/components/schemas/DeleteLabelAlphaOutput' - getRegulation_200_response: - example: - data: - regulation: - createdAt: createdAt - id: id - streamStatus: - - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - overallStatus: FAILED - workspaceId: workspaceId - finishedAt: finishedAt - properties: - data: - $ref: '#/components/schemas/GetRegulationV1Output' - deleteRegulation_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteRegulationV1Output' - getSource_200_response: - example: - data: - source: null - properties: - data: - $ref: '#/components/schemas/GetSourceV1Output' - getSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/GetSourceAlphaOutput' - deleteSource_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteSourceV1Output' - deleteSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/DeleteSourceAlphaOutput' - updateSource_200_response: - example: - data: - source: null - properties: - data: - $ref: '#/components/schemas/UpdateSourceV1Output' - updateSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/UpdateSourceAlphaOutput' - getTrackingPlan_200_response: - example: - data: - trackingPlan: null - properties: - data: - $ref: '#/components/schemas/GetTrackingPlanV1Output' - deleteTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteTrackingPlanV1Output' - updateTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/UpdateTrackingPlanV1Output' - getTransformation_200_response: - example: - data: - transformation: null - properties: - data: - $ref: '#/components/schemas/GetTransformationBetaOutput' - deleteTransformation_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteTransformationBetaOutput' - updateTransformation_200_response: - example: - data: - transformation: null - properties: - data: - $ref: '#/components/schemas/UpdateTransformationBetaOutput' - getUserGroup_200_response: - example: - data: - userGroup: null - properties: - data: - $ref: '#/components/schemas/GetUserGroupV1Output' - deleteUserGroup_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteUserGroupV1Output' - updateUserGroup_200_response: - example: - data: - userGroup: null - properties: - data: - $ref: '#/components/schemas/UpdateUserGroupV1Output' - listUsers_200_response: - example: - data: - pagination: null - users: - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - name: name - id: id - email: email - - permissions: - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - roleId: roleId - roleName: roleName - resources: - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - id: id - type: FUNCTION - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - name: name - id: id - email: email - properties: - data: - $ref: '#/components/schemas/ListUsersV1Output' - deleteUsers_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteUsersV1Output' - getWarehouse_200_response: - example: - data: - warehouse: null - properties: - data: - $ref: '#/components/schemas/GetWarehouseV1Output' - deleteWarehouse_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/DeleteWarehouseV1Output' - updateWarehouse_200_response: - example: - data: - warehouse: null - properties: - data: - $ref: '#/components/schemas/UpdateWarehouseV1Output' - disableEdgeFunctions_200_response: - example: - data: - edgeFunctions: null - properties: - data: - $ref: '#/components/schemas/DisableEdgeFunctionsAlphaOutput' - echo_200_response: - example: - data: - headers: - key: "" - method: get - message: message - properties: - data: - $ref: '#/components/schemas/EchoV1Output' - echo_200_response_1: - properties: - data: - $ref: '#/components/schemas/EchoAlphaOutput' - generateUploadURLForEdgeFunctions_200_response: - example: - data: - uploadURL: uploadURL - properties: - data: - $ref: '#/components/schemas/GenerateUploadURLForEdgeFunctionsAlphaOutput' - getAdvancedSyncScheduleFromWarehouse_200_response: - example: - data: - schedule: null - enabled: true - properties: - data: - $ref: '#/components/schemas/GetAdvancedSyncScheduleFromWarehouseV1Output' - replaceAdvancedSyncScheduleForWarehouse_200_response: - example: - data: - schedule: null - enabled: true - properties: - data: - $ref: '#/components/schemas/ReplaceAdvancedSyncScheduleForWarehouseV1Output' - getConnectionStateFromWarehouse_200_response: - example: - data: - connectionState: CONNECTED - properties: - data: - $ref: '#/components/schemas/GetConnectionStateFromWarehouseV1Output' - getDailyPerSourceAPICallsUsage_200_response: - example: - data: - pagination: null - dailyPerSourceAPICallsUsage: - - sourceId: sourceId - apiCalls: apiCalls - timestamp: timestamp - - sourceId: sourceId - apiCalls: apiCalls - timestamp: timestamp - properties: - data: - $ref: '#/components/schemas/GetDailyPerSourceAPICallsUsageV1Output' - getDailyPerSourceMTUUsage_200_response: - example: - data: - pagination: null - dailyPerSourceMTUUsage: - - sourceId: sourceId - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - - sourceId: sourceId - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - properties: - data: - $ref: '#/components/schemas/GetDailyPerSourceMTUUsageV1Output' - getDailyWorkspaceAPICallsUsage_200_response: - example: - data: - dailyWorkspaceAPICallsUsage: - - apiCalls: apiCalls - timestamp: timestamp - - apiCalls: apiCalls - timestamp: timestamp - pagination: null - properties: - data: - $ref: '#/components/schemas/GetDailyWorkspaceAPICallsUsageV1Output' - getDailyWorkspaceMTUUsage_200_response: - example: - data: - pagination: null - dailyWorkspaceMTUUsage: - - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - - neverIdentified: neverIdentified - identified: identified - anonymousIdentified: anonymousIdentified - anonymous: anonymous - periodStart: 0.8008281904610115 - periodEnd: 6.027456183070403 - timestamp: timestamp - properties: - data: - $ref: '#/components/schemas/GetDailyWorkspaceMTUUsageV1Output' - getDestinationMetadata_200_response: - example: - data: - destinationMetadata: null - properties: - data: - $ref: '#/components/schemas/GetDestinationMetadataV1Output' - getDestinationsCatalog_200_response: - example: - data: - pagination: null - destinationsCatalog: - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - - website: website - components: - - owner: PARTNER - code: code - type: ANDROID - - owner: PARTNER - code: code - type: ANDROID - supportedFeatures: null - description: description - logos: null - presets: - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - - name: name - actionId: actionId - trigger: trigger - fields: - key: "" - supportedMethods: null - previousNames: - - previousNames - - previousNames - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - id: id - categories: - - categories - - categories - supportedPlatforms: null - partnerOwned: true - actions: - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - - defaultTrigger: defaultTrigger - hidden: true - name: name - description: description - id: id - fields: - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - - fieldKey: fieldKey - defaultValue: "" - multiple: true - description: description - label: label - type: BOOLEAN - required: true - sortOrder: 0.8008281904610115 - dynamic: true - allowNull: true - id: id - placeholder: placeholder - choices: "" - slug: slug - platform: CLOUD - slug: slug - contacts: - - role: role - isPrimary: true - name: name - email: email - - role: role - isPrimary: true - name: name - email: email - status: DEPRECATED - properties: - data: - $ref: '#/components/schemas/GetDestinationsCatalogV1Output' - getEventsVolumeFromWorkspace_200_response: - example: - data: - result: - - total: 0.8008281904610115 - series: - - count: 6.027456183070403 - time: time - - count: 6.027456183070403 - time: time - eventName: eventName - source: null - eventType: eventType - - total: 0.8008281904610115 - series: - - count: 6.027456183070403 - time: time - - count: 6.027456183070403 - time: time - eventName: eventName - source: null - eventType: eventType - pagination: null - properties: - data: - $ref: '#/components/schemas/GetEventsVolumeFromWorkspaceV1Output' - getFilterInDestination_200_response: - example: - data: - filter: null - properties: - data: - $ref: '#/components/schemas/GetFilterInDestinationV1Output' - removeFilterFromDestination_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/RemoveFilterFromDestinationV1Output' - updateFilterForDestination_200_response: - example: - data: - filter: null - properties: - data: - $ref: '#/components/schemas/UpdateFilterForDestinationV1Output' - getLatestFromEdgeFunctions_200_response: - example: - data: - edgeFunctions: null - properties: - data: - $ref: '#/components/schemas/GetLatestFromEdgeFunctionsAlphaOutput' - getSourceMetadata_200_response: - example: - data: - sourceMetadata: null - properties: - data: - $ref: '#/components/schemas/GetSourceMetadataV1Output' - getSourcesCatalog_200_response: - example: - data: - pagination: null - sourcesCatalog: - - isCloudEventSource: true - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - categories: - - categories - - categories - logos: null - slug: slug - - isCloudEventSource: true - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - categories: - - categories - - categories - logos: null - slug: slug - properties: - data: - $ref: '#/components/schemas/GetSourcesCatalogV1Output' - getSpace_200_response: - example: - data: - space: null - properties: - data: - $ref: '#/components/schemas/GetSpaceAlphaOutput' - getSubscriptionFromDestination_200_response: - example: - data: - subscription: null - properties: - data: - $ref: '#/components/schemas/GetSubscriptionFromDestinationAlphaOutput' - removeSubscriptionFromDestination_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/RemoveSubscriptionFromDestinationAlphaOutput' - updateSubscriptionForDestination_200_response: - example: - data: - subscription: null - properties: - data: - $ref: '#/components/schemas/UpdateSubscriptionForDestinationAlphaOutput' - getUser_200_response: - example: - data: - user: null - properties: - data: - $ref: '#/components/schemas/GetUserV1Output' - getWarehouseMetadata_200_response: - example: - data: - warehouseMetadata: null - properties: - data: - $ref: '#/components/schemas/GetWarehouseMetadataV1Output' - getWarehousesCatalog_200_response: - example: - data: - pagination: null - warehousesCatalog: - - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - logos: null - slug: slug - - name: name - options: - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - - defaultValue: "" - name: name - description: description - label: label - type: type - required: true - description: description - id: id - logos: null - slug: slug - properties: - data: - $ref: '#/components/schemas/GetWarehousesCatalogV1Output' - getWorkspace_200_response: - example: - data: - workspace: null - properties: - data: - $ref: '#/components/schemas/GetWorkspaceV1Output' - listAuditEvents_200_response: - example: - data: - pagination: null - events: - - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - - actor: actor - resourceId: resourceId - resourceName: resourceName - id: id - type: type - timestamp: timestamp - resourceType: resourceType - properties: - data: - $ref: '#/components/schemas/ListAuditEventsV1Output' - listConnectedDestinationsFromSource_200_response: - example: - data: - pagination: null - destinations: - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - - sourceId: sourceId - settings: - key: "" - metadata: null - name: name - id: id - enabled: true - properties: - data: - $ref: '#/components/schemas/ListConnectedDestinationsFromSourceV1Output' - listConnectedDestinationsFromSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/ListConnectedDestinationsFromSourceAlphaOutput' - listConnectedSourcesFromWarehouse_200_response: - example: - data: - pagination: null - sources: - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - - settings: "" - metadata: null - name: name - id: id - writeKeys: - - writeKeys - - writeKeys - slug: slug - enabled: true - workspaceId: workspaceId - labels: - - description: description - value: value - key: key - - description: description - value: value - key: key - properties: - data: - $ref: '#/components/schemas/ListConnectedSourcesFromWarehouseV1Output' - listConnectedWarehousesFromSource_200_response: - example: - data: - pagination: null - warehouses: - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - - settings: "" - metadata: null - id: id - enabled: true - workspaceId: workspaceId - properties: - data: - $ref: '#/components/schemas/ListConnectedWarehousesFromSourceV1Output' - listConnectedWarehousesFromSource_200_response_1: - properties: - data: - $ref: '#/components/schemas/ListConnectedWarehousesFromSourceAlphaOutput' - listDeliveryMetricsSummaryFromDestination_200_response: - example: - data: - deliveryMetricsSummary: null - properties: - data: - $ref: '#/components/schemas/ListDeliveryMetricsSummaryFromDestinationBetaOutput' - listInvitesFromUserGroup_200_response: - example: - data: - emails: - - emails - - emails - pagination: null - properties: - data: - $ref: '#/components/schemas/ListInvitesFromUserGroupV1Output' - listRoles_200_response: - example: - data: - pagination: null - roles: - - name: name - description: description - id: id - - name: name - description: description - id: id - properties: - data: - $ref: '#/components/schemas/ListRolesV1Output' - listRulesFromTrackingPlan_200_response: - example: - data: - pagination: null - rules: - - createdAt: createdAt - jsonSchema: "" - deprecatedAt: deprecatedAt - type: COMMON - version: 0.8008281904610115 - key: key - updatedAt: updatedAt - - createdAt: createdAt - jsonSchema: "" - deprecatedAt: deprecatedAt - type: COMMON - version: 0.8008281904610115 - key: key - updatedAt: updatedAt - properties: - data: - $ref: '#/components/schemas/ListRulesFromTrackingPlanV1Output' - replaceRulesInTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/ReplaceRulesInTrackingPlanV1Output' - removeRulesFromTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/RemoveRulesFromTrackingPlanV1Output' - updateRulesInTrackingPlan_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/UpdateRulesInTrackingPlanV1Output' - listSchemaSettingsInSource_200_response: - example: - data: - sourceId: sourceId - settings: null - properties: - data: - $ref: '#/components/schemas/ListSchemaSettingsInSourceV1Output' - updateSchemaSettingsInSource_200_response: - example: - data: - sourceId: sourceId - settings: null - properties: - data: - $ref: '#/components/schemas/UpdateSchemaSettingsInSourceV1Output' - listSelectiveSyncsFromWarehouseAndSource_200_response: - example: - data: - pagination: null - items: - - sourceId: sourceId - warehouseId: warehouseId - collection: collection - properties: - key: "" - - sourceId: sourceId - warehouseId: warehouseId - collection: collection - properties: - key: "" - properties: - data: - $ref: '#/components/schemas/ListSelectiveSyncsFromWarehouseAndSourceV1Output' - listSuppressions_200_response: - example: - data: - pagination: null - suppressed: - - subjectIds: - - subjectIds - - subjectIds - subjectType: subjectType - - subjectIds: - - subjectIds - - subjectIds - subjectType: subjectType - properties: - data: - $ref: '#/components/schemas/ListSuppressionsV1Output' - listSyncsFromWarehouse_200_response: - example: - data: - reports: - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - pagination: null - properties: - data: - $ref: '#/components/schemas/ListSyncsFromWarehouseV1Output' - listSyncsFromWarehouseAndSource_200_response: - example: - data: - reports: - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - - sourceId: sourceId - duration: 0.8008281904610115 - notices: - - createdAt: createdAt - level: level - message: message - - createdAt: createdAt - level: level - message: message - humanDuration: humanDuration - start: start - count: 6.027456183070403 - end: end - status: status - pagination: null - properties: - data: - $ref: '#/components/schemas/ListSyncsFromWarehouseAndSourceV1Output' - listUserGroupsFromUser_200_response: - example: - data: - pagination: null - groups: - - name: name - id: id - - name: name - id: id - properties: - data: - $ref: '#/components/schemas/ListUserGroupsFromUserV1Output' - previewDestinationFilter_200_response: - example: - data: - result: "" - inputPayload: - key: "" - properties: - data: - $ref: '#/components/schemas/PreviewDestinationFilterV1Output' - replaceUsersInUserGroup_200_response: - example: - data: - userGroup: null - properties: - data: - $ref: '#/components/schemas/ReplaceUsersInUserGroupV1Output' - removeUsersFromUserGroup_200_response: - example: - data: - status: SUCCESS - properties: - data: - $ref: '#/components/schemas/RemoveUsersFromUserGroupV1Output' - replaceMessagingSubscriptionsInSpaces_200_response: - example: - data: - failures: - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - pagination: null - successes: - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - - type: EMAIL - key: key - errors: - - code: code - message: message - - code: code - message: message - status: DID_NOT_SUBSCRIBE - properties: - data: - $ref: '#/components/schemas/ReplaceMessagingSubscriptionsInSpacesAlphaOutput' - updateSelectiveSyncForWarehouse_200_response: - example: - data: - warnings: - - warnings - - warnings - status: UNCHANGED - properties: - data: - $ref: '#/components/schemas/UpdateSelectiveSyncForWarehouseV1Output' - pagination: - allOf: - - $ref: '#/components/schemas/PaginationOutput' - description: Information about the pagination of this response. - title: pagination - destinationMetadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: The catalog item matched by id. - title: destinationMetadata - filter: - allOf: - - $ref: '#/components/schemas/PreviewDestinationFilterV1' - description: The filter to preview. - title: filter - filter_1: - allOf: - - $ref: '#/components/schemas/DestinationFilterV1' - description: The requested Destination filter. - title: filter - filter_2: - allOf: - - $ref: '#/components/schemas/DestinationFilterV1' - description: The newly created Destination filter. - title: filter - filter_3: - allOf: - - $ref: '#/components/schemas/DestinationFilterV1' - description: The updated Destination filter. - title: filter - logos: - allOf: - - $ref: '#/components/schemas/LogosBeta' - description: The Destination's logos. - title: logos - supportedFeatures: - allOf: - - $ref: '#/components/schemas/DestinationMetadataFeaturesV1' - description: "Features that this Destination supports.\n\nConfig API note: holds\ - \ `browserUnbundling` fields." - title: supportedFeatures - supportedMethods: - allOf: - - $ref: '#/components/schemas/DestinationMetadataMethodsV1' - description: "Methods that this Destination supports.\n\nConfig API note: equal\ - \ to `methods`." - title: supportedMethods - supportedPlatforms: - allOf: - - $ref: '#/components/schemas/DestinationMetadataPlatformsV1' - description: "Platforms from which the Destination receives events.\n\nConfig\ - \ API note: equal to `platforms`." - title: supportedPlatforms - subscription: - allOf: - - $ref: '#/components/schemas/DestinationSubscription' - description: The Destination subscription. - title: subscription - destinationSubscription: - allOf: - - $ref: '#/components/schemas/DestinationSubscription' - description: The Destination subscription. - title: destinationSubscription - input: - allOf: - - $ref: '#/components/schemas/DestinationSubscriptionUpdateInput' - description: A set of valid Destination input params required for updating. - title: input - deliveryMetricsSummary: - allOf: - - $ref: '#/components/schemas/DeliveryMetricsSummaryBeta' - description: The delivery metrics summary returned. - title: deliveryMetricsSummary - metadata: - allOf: - - $ref: '#/components/schemas/DestinationMetadataV1' - description: "The metadata of the Destination of which this Destination is an\ - \ instance of. For example, Google Analytics or Amplitude." - title: metadata - destination: - allOf: - - $ref: '#/components/schemas/DestinationV1' - description: The Destination looked up. - title: destination - destination_1: - allOf: - - $ref: '#/components/schemas/DestinationV1' - description: The updated Destination. - title: destination - destination_2: - allOf: - - $ref: '#/components/schemas/DestinationV1' - description: The created Destination. - title: destination - edgeFunctions: - allOf: - - $ref: '#/components/schemas/EdgeFunctionsAlpha' - description: The created Edge Function. - title: edgeFunctions - edgeFunctions_1: - allOf: - - $ref: '#/components/schemas/EdgeFunctionsAlpha' - description: The latest version of Edge Function bundle. - title: edgeFunctions - function: - allOf: - - $ref: '#/components/schemas/FunctionV1' - description: A Function object. - nullable: true - title: function - function_1: - allOf: - - $ref: '#/components/schemas/FunctionV1' - description: A Function object. - title: function - function_2: - allOf: - - $ref: '#/components/schemas/FunctionV1' - description: The updated Function object. - title: function - functionDeployment: - description: The status of the operation. - example: - status: SUCCESS - properties: - status: - enum: - - SUCCESS - title: status - type: string - required: - - status - title: functionDeployment - type: object - user: - allOf: - - $ref: '#/components/schemas/UserV1' - description: The user object. - title: user - userGroup: - allOf: - - $ref: '#/components/schemas/UserGroupV1' - description: The newly created user group. - title: userGroup - userGroup_1: - allOf: - - $ref: '#/components/schemas/UserGroupV1' - description: The updated the user group. - title: userGroup - userGroup_2: - allOf: - - $ref: '#/components/schemas/UserGroupV1' - description: The user group returned from the query. - title: userGroup - userGroup_3: - allOf: - - $ref: '#/components/schemas/UserGroupV1' - description: The updated user group. - title: userGroup - label: - allOf: - - $ref: '#/components/schemas/LabelAlpha' - description: The new label to create in the Workspace. - title: label - label_1: - allOf: - - $ref: '#/components/schemas/LabelV1' - description: The new label to create in the Workspace. - title: label - label_2: - allOf: - - $ref: '#/components/schemas/LabelV1' - description: The newly created label. - title: label - source: - allOf: - - $ref: '#/components/schemas/EventSourceV1' - description: The Source where the events originated. - title: source - regulation: - description: The regulate request. - example: - createdAt: createdAt - id: id - streamStatus: - - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - id: id - destinationStatus: - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - - errString: errString - name: name - id: id - status: FAILED - finishedAt: finishedAt - overallStatus: FAILED - workspaceId: workspaceId - finishedAt: finishedAt - properties: - id: - description: The id of the regulate request. - title: id - type: string - workspaceId: - description: The id of the Workspace that the regulate request belongs to. - title: workspaceId - type: string - overallStatus: - description: The current status of the regulate request. - enum: - - FAILED - - FINISHED - - INITIALIZED - - INVALID - - NOT_SUPPORTED - - PARTIAL_SUCCESS - - RUNNING - title: overallStatus - type: string - finishedAt: - description: The timestamp of when the request finished. - title: finishedAt - type: string - createdAt: - description: The timestamp of the creation of the request. - title: createdAt - type: string - streamStatus: - description: The status of each stream including all the Destinations that - correspond to the stream. - items: - $ref: '#/components/schemas/StreamStatusV1' - title: streamStatus - type: array - required: - - createdAt - - finishedAt - - id - - overallStatus - - streamStatus - - workspaceId - title: regulation - type: object - suppressed_inner: - example: - subjectIds: - - subjectIds - - subjectIds - subjectType: subjectType - properties: - subjectType: - title: subjectType - type: string - subjectIds: - items: - type: string - title: subjectIds - type: array - required: - - subjectIds - - subjectType - type: object - sourceMetadata: - allOf: - - $ref: '#/components/schemas/SourceMetadataV1' - description: The catalog item matched by id. - title: sourceMetadata - logos_1: - allOf: - - $ref: '#/components/schemas/LogosBeta' - description: The logos for this Source. - title: logos - track: - allOf: - - $ref: '#/components/schemas/TrackSourceSettingsV1' - description: Track settings. - title: track - identify: - allOf: - - $ref: '#/components/schemas/IdentifySourceSettingsV1' - description: Identify settings. - title: identify - group: - allOf: - - $ref: '#/components/schemas/GroupSourceSettingsV1' - description: Group settings. - title: group - settings: - allOf: - - $ref: '#/components/schemas/SourceSettingsOutputV1' - description: The Source settings. - title: settings - settings_1: - allOf: - - $ref: '#/components/schemas/SourceSettingsOutputV1' - description: The output of Source settings. - title: settings - metadata_1: - allOf: - - $ref: '#/components/schemas/SourceMetadataV1' - description: "The metadata for the Source.\n\nConfig API note: includes `catalogName`\ - \ and `catalogId`." - title: metadata - source_1: - allOf: - - $ref: '#/components/schemas/SourceAlpha' - description: The returned Source object. - title: source - source_2: - allOf: - - $ref: '#/components/schemas/SourceAlpha' - description: The newly created Source. - title: source - source_3: - allOf: - - $ref: '#/components/schemas/SourceAlpha' - description: The updated Source. - title: source - source_4: - allOf: - - $ref: '#/components/schemas/SourceV1' - description: The returned Source object. - title: source - source_5: - allOf: - - $ref: '#/components/schemas/SourceV1' - description: The newly created Source. - title: source - source_6: - allOf: - - $ref: '#/components/schemas/SourceV1' - description: The updated Source. - title: source - space: - allOf: - - $ref: '#/components/schemas/Space' - description: Space matching the given id. - nullable: true - title: space - trackingPlan: - allOf: - - $ref: '#/components/schemas/TrackingPlanV1' - description: The requested Tracking Plan. - title: trackingPlan - trackingPlan_1: - allOf: - - $ref: '#/components/schemas/TrackingPlanV1' - description: The created Tracking Plan. - title: trackingPlan - transformation: - allOf: - - $ref: '#/components/schemas/TransformationBeta' - description: The retrieved Transformation. - title: transformation - transformation_1: - allOf: - - $ref: '#/components/schemas/TransformationBeta' - description: The updated Transformation. - title: transformation - transformation_2: - allOf: - - $ref: '#/components/schemas/TransformationBeta' - description: The created Transformation. - title: transformation - warehouseMetadata: - allOf: - - $ref: '#/components/schemas/WarehouseMetadataV1' - description: The Warehouse catalog item. - title: warehouseMetadata - logos_2: - allOf: - - $ref: '#/components/schemas/LogosBeta' - description: Logo information for this object. - title: logos - metadata_2: - allOf: - - $ref: '#/components/schemas/WarehouseMetadataV1' - description: The metadata for the Warehouse. - title: metadata - warehouse: - allOf: - - $ref: '#/components/schemas/WarehouseV1' - description: The returned Warehouse object. - title: warehouse - schedule: - allOf: - - $ref: '#/components/schemas/AdvancedWarehouseSyncScheduleV1Output' - description: "The schedule that contains the schedule overrides for the specified\ - \ Warehouse, if enabled." - title: schedule - schedule_1: - allOf: - - $ref: '#/components/schemas/AdvancedWarehouseSyncScheduleV1Input' - description: The full sync schedule for the Warehouse. - title: schedule - schedule_2: - allOf: - - $ref: '#/components/schemas/AdvancedWarehouseSyncScheduleV1Output' - description: "The schedule that contains the overrides for the Warehouse, if\ - \ enabled." - title: schedule - warehouse_1: - allOf: - - $ref: '#/components/schemas/WarehouseV1' - description: The newly created Warehouse. - title: warehouse - warehouse_2: - allOf: - - $ref: '#/components/schemas/WarehouseV1' - description: The updated Warehouse. - title: warehouse - workspace: - allOf: - - $ref: '#/components/schemas/WorkspaceV1' - description: The Workspace. - title: workspace - securitySchemes: - token: - scheme: bearer - type: http -x-domain-hierarchy: -- name: Connections - subDomains: - - name: Warehouses - subDomains: [] - - name: Sources - subDomains: [] - - name: Deletion and Suppression - subDomains: [] - - name: Destinations - subDomains: [] - - name: Edge Functions - subDomains: [] - - name: Destination Filters - subDomains: [] - - name: Functions - subDomains: [] - - name: Selective Sync - subDomains: [] - - name: Catalog - subDomains: [] -- name: Admin - subDomains: - - name: IAM Users - subDomains: [] - - name: IAM Groups - subDomains: [] - - name: Labels - subDomains: [] - - name: Audit Trail - subDomains: [] - - name: IAM Roles - subDomains: [] -- name: Protocols - subDomains: - - name: Tracking Plans - subDomains: [] - - name: Transformations - subDomains: [] -- name: Engage - subDomains: - - name: Spaces - subDomains: [] -- name: General - subDomains: - - name: Testing - subDomains: [] - - name: Workspaces - subDomains: [] -- name: Usage - subDomains: - - name: API Calls - subDomains: [] - - name: Monthly Tracked Users - subDomains: [] -- name: Monitoring - subDomains: - - name: Events - subDomains: [] -x-tagGroups: -- name: Connections - tags: - - Warehouses - - Sources - - Deletion and Suppression - - Destinations - - Edge Functions - - Destination Filters - - Functions - - Selective Sync - - Catalog -- name: Admin - tags: - - IAM Users - - IAM Groups - - Labels - - Audit Trail - - IAM Roles -- name: Protocols - tags: - - Tracking Plans - - Transformations -- name: Engage - tags: - - Spaces -- name: General - tags: - - Testing - - Workspaces -- name: Usage - tags: - - API Calls - - Monthly Tracked Users -- name: Monitoring - tags: - - Events - diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index e0135b8d..b2e7690b 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -941,6 +941,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyValueTransformationBeta + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 46742fdd..3948d986 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -72,6 +72,12 @@ public class CreateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public CreateTransformationBetaInput() {} public CreateTransformationBetaInput name(String name) { @@ -248,6 +254,42 @@ public void setPropertyRenames(List propertyRenames) { this.propertyRenames = propertyRenames; } + public CreateTransformationBetaInput propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public CreateTransformationBetaInput addPropertyValueTransformationsItem( + PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -267,13 +309,23 @@ public boolean equals(Object o) { && Objects.equals(this._if, createTransformationBetaInput._if) && Objects.equals(this.newEventName, createTransformationBetaInput.newEventName) && Objects.equals( - this.propertyRenames, createTransformationBetaInput.propertyRenames); + this.propertyRenames, createTransformationBetaInput.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + createTransformationBetaInput.propertyValueTransformations); } @Override public int hashCode() { return Objects.hash( - name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); } @Override @@ -289,6 +341,9 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -317,6 +372,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -418,6 +474,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java new file mode 100644 index 00000000..ac088992 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.4 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyValueTransformationBeta */ +public class PropertyValueTransformationBeta { + public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) + private List propertyPaths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) + private String propertyValue; + + public PropertyValueTransformationBeta() {} + + public PropertyValueTransformationBeta propertyPaths(List propertyPaths) { + + this.propertyPaths = propertyPaths; + return this; + } + + public PropertyValueTransformationBeta addPropertyPathsItem(String propertyPathsItem) { + this.propertyPaths.add(propertyPathsItem); + return this; + } + + /** + * The property paths. The maximum number of paths is 10. + * + * @return propertyPaths + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The property paths. The maximum number of paths is 10.") + public List getPropertyPaths() { + return propertyPaths; + } + + public void setPropertyPaths(List propertyPaths) { + this.propertyPaths = propertyPaths; + } + + public PropertyValueTransformationBeta propertyValue(String propertyValue) { + + this.propertyValue = propertyValue; + return this; + } + + /** + * The new value of the property paths. + * + * @return propertyValue + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new value of the property paths.") + public String getPropertyValue() { + return propertyValue; + } + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyValueTransformationBeta propertyValueTransformationBeta = + (PropertyValueTransformationBeta) o; + return Objects.equals(this.propertyPaths, propertyValueTransformationBeta.propertyPaths) + && Objects.equals( + this.propertyValue, propertyValueTransformationBeta.propertyValue); + } + + @Override + public int hashCode() { + return Objects.hash(propertyPaths, propertyValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyValueTransformationBeta {\n"); + sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); + sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("propertyPaths"); + openapiFields.add("propertyValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("propertyPaths"); + openapiRequiredFields.add("propertyValue"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * PropertyValueTransformationBeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyValueTransformationBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyValueTransformationBeta is not" + + " found in the empty JSON string", + PropertyValueTransformationBeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyValueTransformationBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyValueTransformationBeta` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyValueTransformationBeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("propertyPaths") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("propertyPaths").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyPaths` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyPaths").toString())); + } + if (!jsonObj.get("propertyValue").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValue` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("propertyValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyValueTransformationBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyValueTransformationBeta' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(PropertyValueTransformationBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyValueTransformationBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyValueTransformationBeta read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyValueTransformationBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyValueTransformationBeta + * @throws IOException if the JSON string is invalid with respect to + * PropertyValueTransformationBeta + */ + public static PropertyValueTransformationBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyValueTransformationBeta.class); + } + + /** + * Convert an instance of PropertyValueTransformationBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index 4fde9480..83c6f1ef 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -77,6 +77,12 @@ public class Transformation { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation() {} public Transformation id(String id) { @@ -269,6 +275,42 @@ public void setPropertyRenames(List propertyRenames) { this.propertyRenames = propertyRenames; } + public Transformation propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation addPropertyValueTransformationsItem( + PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -285,7 +327,10 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, transformation.enabled) && Objects.equals(this._if, transformation._if) && Objects.equals(this.newEventName, transformation.newEventName) - && Objects.equals(this.propertyRenames, transformation.propertyRenames); + && Objects.equals(this.propertyRenames, transformation.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation.propertyValueTransformations); } @Override @@ -298,7 +343,8 @@ public int hashCode() { enabled, _if, newEventName, - propertyRenames); + propertyRenames, + propertyValueTransformations); } @Override @@ -315,6 +361,9 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -344,6 +393,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -452,6 +502,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index 0e939bd6..7ef47dcd 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -77,6 +77,12 @@ public class Transformation1 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation1() {} public Transformation1 id(String id) { @@ -269,6 +275,42 @@ public void setPropertyRenames(List propertyRenames) { this.propertyRenames = propertyRenames; } + public Transformation1 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation1 addPropertyValueTransformationsItem( + PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -285,7 +327,10 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, transformation1.enabled) && Objects.equals(this._if, transformation1._if) && Objects.equals(this.newEventName, transformation1.newEventName) - && Objects.equals(this.propertyRenames, transformation1.propertyRenames); + && Objects.equals(this.propertyRenames, transformation1.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation1.propertyValueTransformations); } @Override @@ -298,7 +343,8 @@ public int hashCode() { enabled, _if, newEventName, - propertyRenames); + propertyRenames, + propertyValueTransformations); } @Override @@ -315,6 +361,9 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -344,6 +393,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -452,6 +502,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index 2ecde671..d992a6bf 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -77,6 +77,12 @@ public class Transformation2 { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public Transformation2() {} public Transformation2 id(String id) { @@ -269,6 +275,42 @@ public void setPropertyRenames(List propertyRenames) { this.propertyRenames = propertyRenames; } + public Transformation2 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation2 addPropertyValueTransformationsItem( + PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -285,7 +327,10 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, transformation2.enabled) && Objects.equals(this._if, transformation2._if) && Objects.equals(this.newEventName, transformation2.newEventName) - && Objects.equals(this.propertyRenames, transformation2.propertyRenames); + && Objects.equals(this.propertyRenames, transformation2.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation2.propertyValueTransformations); } @Override @@ -298,7 +343,8 @@ public int hashCode() { enabled, _if, newEventName, - propertyRenames); + propertyRenames, + propertyValueTransformations); } @Override @@ -315,6 +361,9 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -344,6 +393,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -452,6 +502,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index ddd003ae..b8d26be3 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -77,6 +77,12 @@ public class TransformationBeta { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public TransformationBeta() {} public TransformationBeta id(String id) { @@ -269,6 +275,42 @@ public void setPropertyRenames(List propertyRenames) { this.propertyRenames = propertyRenames; } + public TransformationBeta propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public TransformationBeta addPropertyValueTransformationsItem( + PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -286,7 +328,10 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, transformationBeta.enabled) && Objects.equals(this._if, transformationBeta._if) && Objects.equals(this.newEventName, transformationBeta.newEventName) - && Objects.equals(this.propertyRenames, transformationBeta.propertyRenames); + && Objects.equals(this.propertyRenames, transformationBeta.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformationBeta.propertyValueTransformations); } @Override @@ -299,7 +344,8 @@ public int hashCode() { enabled, _if, newEventName, - propertyRenames); + propertyRenames, + propertyValueTransformations); } @Override @@ -316,6 +362,9 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -345,6 +394,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -453,6 +503,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 50e428d0..09c5f3d6 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -72,6 +72,12 @@ public class UpdateTransformationBetaInput { @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) private List propertyRenames = null; + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + public UpdateTransformationBetaInput() {} public UpdateTransformationBetaInput name(String name) { @@ -243,6 +249,42 @@ public void setPropertyRenames(List propertyRenames) { this.propertyRenames = propertyRenames; } + public UpdateTransformationBetaInput propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public UpdateTransformationBetaInput addPropertyValueTransformationsItem( + PropertyValueTransformationBeta propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -262,13 +304,23 @@ public boolean equals(Object o) { && Objects.equals(this._if, updateTransformationBetaInput._if) && Objects.equals(this.newEventName, updateTransformationBetaInput.newEventName) && Objects.equals( - this.propertyRenames, updateTransformationBetaInput.propertyRenames); + this.propertyRenames, updateTransformationBetaInput.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + updateTransformationBetaInput.propertyValueTransformations); } @Override public int hashCode() { return Objects.hash( - name, sourceId, destinationMetadataId, enabled, _if, newEventName, propertyRenames); + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); } @Override @@ -284,6 +336,9 @@ public String toString() { sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -312,6 +367,7 @@ private String toIndentedString(Object o) { openapiFields.add("if"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -402,6 +458,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 2aebfe09ac45a1e2b2f993f0c43cdfe59c7f901d Mon Sep 17 00:00:00 2001 From: public-api ci Date: Wed, 16 Nov 2022 02:24:47 +0000 Subject: [PATCH 011/474] Automated client deploy (from segmentio/public-api@7f1e76f) --- .../publicapi/models/CreateCloudSourceRegulationV1Input.java | 2 -- .../segment/publicapi/models/CreateSourceRegulationV1Input.java | 2 -- .../publicapi/models/CreateWorkspaceRegulationV1Input.java | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 17bb737d..537c2759 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -40,8 +40,6 @@ public class CreateCloudSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 2345d64b..1aa81dfd 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -40,8 +40,6 @@ public class CreateSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index b841249b..e5be8fef 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -40,8 +40,6 @@ public class CreateWorkspaceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), From 1f3d30b9ada16839b46a6d64ef3d988d5c155704 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Thu, 17 Nov 2022 20:13:58 +0000 Subject: [PATCH 012/474] Automated client deploy (from segmentio/public-api@7f4a99e) --- README.md | 8 +- pom.xml | 2 +- .../com/segment/publicapi/ApiCallback.java | 2 +- .../java/com/segment/publicapi/ApiClient.java | 4 +- .../com/segment/publicapi/ApiException.java | 2 +- .../com/segment/publicapi/ApiResponse.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- .../publicapi/GzipRequestInterceptor.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 47 +- src/main/java/com/segment/publicapi/Pair.java | 2 +- .../publicapi/ProgressRequestBody.java | 2 +- .../publicapi/ProgressResponseBody.java | 2 +- .../com/segment/publicapi/StringUtil.java | 2 +- .../segment/publicapi/api/ApiCallsApi.java | 2 +- .../segment/publicapi/api/AuditTrailApi.java | 2 +- .../com/segment/publicapi/api/CatalogApi.java | 2 +- .../api/DeletionAndSuppressionApi.java | 2 +- .../publicapi/api/DestinationFiltersApi.java | 2 +- .../publicapi/api/DestinationsApi.java | 2 +- .../publicapi/api/EdgeFunctionsApi.java | 2 +- .../com/segment/publicapi/api/EventsApi.java | 2 +- .../segment/publicapi/api/FunctionsApi.java | 2 +- .../segment/publicapi/api/IamGroupsApi.java | 2 +- .../segment/publicapi/api/IamRolesApi.java | 2 +- .../segment/publicapi/api/IamUsersApi.java | 2 +- .../com/segment/publicapi/api/LabelsApi.java | 2 +- .../publicapi/api/MonthlyTrackedUsersApi.java | 2 +- .../publicapi/api/SelectiveSyncApi.java | 2 +- .../com/segment/publicapi/api/SourcesApi.java | 2 +- .../com/segment/publicapi/api/SpacesApi.java | 2 +- .../com/segment/publicapi/api/TestingApi.java | 2 +- .../publicapi/api/TrackingPlansApi.java | 2 +- .../publicapi/api/TransformationsApi.java | 118 ++-- .../segment/publicapi/api/WarehousesApi.java | 2 +- .../segment/publicapi/api/WorkspacesApi.java | 2 +- .../segment/publicapi/auth/ApiKeyAuth.java | 2 +- .../publicapi/auth/Authentication.java | 2 +- .../segment/publicapi/auth/HttpBasicAuth.java | 2 +- .../publicapi/auth/HttpBearerAuth.java | 2 +- .../publicapi/models/APICallSnapshotV1.java | 2 +- .../models/AbstractOpenApiSchema.java | 2 +- .../publicapi/models/AccessPermissionV1.java | 2 +- ...ctionFromSourceToWarehouse200Response.java | 2 +- ...nnectionFromSourceToWarehouseV1Output.java | 2 +- .../models/AddLabelsToSource200Response.java | 2 +- .../models/AddLabelsToSource200Response1.java | 2 +- .../models/AddLabelsToSourceAlphaInput.java | 2 +- .../models/AddLabelsToSourceAlphaOutput.java | 2 +- .../models/AddLabelsToSourceV1Input.java | 2 +- .../models/AddLabelsToSourceV1Output.java | 2 +- .../AddPermissionsToUser200Response.java | 2 +- .../AddPermissionsToUserGroup200Response.java | 2 +- .../AddPermissionsToUserGroupV1Input.java | 2 +- .../AddPermissionsToUserGroupV1Output.java | 2 +- .../models/AddPermissionsToUserV1Input.java | 2 +- .../models/AddPermissionsToUserV1Output.java | 2 +- .../AddSourceToTrackingPlan200Response.java | 2 +- .../AddSourceToTrackingPlanV1Input.java | 2 +- .../AddSourceToTrackingPlanV1Output.java | 2 +- .../AddUsersToUserGroup200Response.java | 2 +- .../models/AddUsersToUserGroupV1Input.java | 2 +- .../models/AddUsersToUserGroupV1Output.java | 2 +- .../AdvancedWarehouseSyncScheduleV1Input.java | 2 +- ...AdvancedWarehouseSyncScheduleV1Output.java | 2 +- .../publicapi/models/AllowedLabelBeta.java | 2 +- .../publicapi/models/AuditEventV1.java | 2 +- ...agingSubscriptionsForSpace200Response.java | 2 +- ...sagingSubscriptionsForSpaceAlphaInput.java | 2 +- ...agingSubscriptionsForSpaceAlphaOutput.java | 2 +- .../publicapi/models/BreakdownBeta.java | 2 +- .../models/CommonSourceSettingsV1.java | 2 +- .../com/segment/publicapi/models/Contact.java | 2 +- ...reateCloudSourceRegulation200Response.java | 2 +- .../CreateCloudSourceRegulationV1Input.java | 2 +- .../CreateCloudSourceRegulationV1Output.java | 2 +- .../models/CreateDestination200Response.java | 2 +- ...ateDestinationSubscription200Response.java | 2 +- ...eateDestinationSubscriptionAlphaInput.java | 2 +- ...ateDestinationSubscriptionAlphaOutput.java | 2 +- .../models/CreateDestinationV1Input.java | 2 +- .../models/CreateDestinationV1Output.java | 2 +- .../CreateEdgeFunctions200Response.java | 2 +- .../models/CreateEdgeFunctionsAlphaInput.java | 2 +- .../CreateEdgeFunctionsAlphaOutput.java | 2 +- ...CreateFilterForDestination200Response.java | 2 +- .../CreateFilterForDestinationV1Input.java | 2 +- .../CreateFilterForDestinationV1Output.java | 2 +- .../models/CreateFunction200Response.java | 2 +- .../CreateFunctionDeployment200Response.java | 2 +- .../CreateFunctionDeploymentV1Output.java | 2 +- .../models/CreateFunctionV1Input.java | 2 +- .../models/CreateFunctionV1Output.java | 2 +- .../models/CreateInvites200Response.java | 2 +- .../models/CreateInvitesV1Input.java | 2 +- .../models/CreateInvitesV1Output.java | 2 +- .../models/CreateLabel200Response.java | 2 +- .../models/CreateLabel200Response1.java | 2 +- .../models/CreateLabelAlphaInput.java | 2 +- .../models/CreateLabelAlphaOutput.java | 2 +- .../publicapi/models/CreateLabelV1Input.java | 2 +- .../publicapi/models/CreateLabelV1Output.java | 2 +- .../models/CreateSource200Response.java | 2 +- .../models/CreateSource200Response1.java | 2 +- .../models/CreateSourceAlphaInput.java | 2 +- .../models/CreateSourceAlphaOutput.java | 2 +- .../CreateSourceRegulation200Response.java | 2 +- .../models/CreateSourceRegulationV1Input.java | 2 +- .../CreateSourceRegulationV1Output.java | 2 +- .../publicapi/models/CreateSourceV1Input.java | 2 +- .../models/CreateSourceV1Output.java | 2 +- .../models/CreateTrackingPlan200Response.java | 2 +- .../models/CreateTrackingPlanV1Input.java | 2 +- .../models/CreateTrackingPlanV1Output.java | 2 +- .../CreateTransformation200Response.java | 10 +- .../models/CreateTransformationBetaInput.java | 2 +- .../CreateTransformationBetaOutput.java | 2 +- .../models/CreateTransformationV1Input.java | 541 +++++++++++++++++ .../models/CreateTransformationV1Output.java | 210 +++++++ .../models/CreateUserGroup200Response.java | 2 +- .../models/CreateUserGroupV1Input.java | 2 +- .../models/CreateUserGroupV1Output.java | 2 +- ...reateValidationInWarehouse200Response.java | 2 +- .../CreateValidationInWarehouseV1Input.java | 2 +- .../CreateValidationInWarehouseV1Output.java | 2 +- .../models/CreateWarehouse200Response.java | 2 +- .../models/CreateWarehouseV1Input.java | 2 +- .../models/CreateWarehouseV1Output.java | 2 +- .../CreateWorkspaceRegulation200Response.java | 2 +- .../CreateWorkspaceRegulationV1Input.java | 2 +- .../CreateWorkspaceRegulationV1Output.java | 2 +- .../models/DeleteDestination200Response.java | 2 +- .../models/DeleteDestinationV1Output.java | 2 +- .../models/DeleteFunction200Response.java | 2 +- .../models/DeleteFunctionV1Output.java | 2 +- .../models/DeleteInvites200Response.java | 2 +- .../models/DeleteInvitesV1Output.java | 2 +- .../models/DeleteLabel200Response.java | 2 +- .../models/DeleteLabel200Response1.java | 2 +- .../models/DeleteLabelAlphaOutput.java | 2 +- .../publicapi/models/DeleteLabelV1Output.java | 2 +- .../models/DeleteRegulation200Response.java | 2 +- .../models/DeleteRegulationV1Output.java | 2 +- .../models/DeleteSource200Response.java | 2 +- .../models/DeleteSource200Response1.java | 2 +- .../models/DeleteSourceAlphaOutput.java | 2 +- .../models/DeleteSourceV1Output.java | 2 +- .../models/DeleteTrackingPlan200Response.java | 2 +- .../models/DeleteTrackingPlanV1Output.java | 2 +- .../DeleteTransformation200Response.java | 10 +- .../models/DeleteTransformationBetaInput.java | 219 +++++++ .../DeleteTransformationBetaOutput.java | 2 +- .../models/DeleteTransformationV1Output.java | 262 ++++++++ .../models/DeleteUserGroup200Response.java | 2 +- .../models/DeleteUserGroupV1Output.java | 2 +- .../models/DeleteUsers200Response.java | 2 +- .../publicapi/models/DeleteUsersV1Output.java | 2 +- .../models/DeleteWarehouse200Response.java | 2 +- .../models/DeleteWarehouseV1Output.java | 2 +- .../models/DeliveryMetricsSummary.java | 2 +- .../models/DeliveryMetricsSummaryBeta.java | 2 +- .../segment/publicapi/models/Destination.java | 2 +- .../publicapi/models/Destination1.java | 2 +- .../publicapi/models/Destination2.java | 2 +- .../models/DestinationFilterActionV1.java | 2 +- .../publicapi/models/DestinationFilterV1.java | 2 +- .../publicapi/models/DestinationMetadata.java | 2 +- .../DestinationMetadataActionFieldV1.java | 2 +- .../models/DestinationMetadataActionV1.java | 2 +- .../DestinationMetadataComponentV1.java | 2 +- .../models/DestinationMetadataFeaturesV1.java | 2 +- .../models/DestinationMetadataMethodsV1.java | 2 +- .../DestinationMetadataPlatformsV1.java | 2 +- ...stinationMetadataSubscriptionPresetV1.java | 2 +- .../models/DestinationMetadataV1.java | 2 +- .../publicapi/models/DestinationStatusV1.java | 2 +- .../models/DestinationSubscription.java | 2 +- .../DestinationSubscriptionUpdateInput.java | 2 +- .../publicapi/models/DestinationV1.java | 2 +- .../DisableEdgeFunctions200Response.java | 2 +- .../DisableEdgeFunctionsAlphaOutput.java | 2 +- .../publicapi/models/Echo200Response.java | 2 +- .../publicapi/models/Echo200Response1.java | 2 +- .../publicapi/models/EchoAlphaOutput.java | 2 +- .../publicapi/models/EchoV1Output.java | 2 +- .../publicapi/models/EdgeFunctions.java | 2 +- .../publicapi/models/EdgeFunctions1.java | 2 +- .../publicapi/models/EdgeFunctionsAlpha.java | 2 +- .../publicapi/models/EventSourceV1.java | 2 +- .../com/segment/publicapi/models/Filter.java | 2 +- .../com/segment/publicapi/models/Filter1.java | 2 +- .../com/segment/publicapi/models/Filter2.java | 2 +- .../com/segment/publicapi/models/Filter3.java | 2 +- .../segment/publicapi/models/Function.java | 2 +- .../segment/publicapi/models/Function1.java | 2 +- .../segment/publicapi/models/Function2.java | 2 +- .../publicapi/models/FunctionDeployment.java | 2 +- .../publicapi/models/FunctionSettingV1.java | 2 +- .../segment/publicapi/models/FunctionV1.java | 2 +- ...eUploadURLForEdgeFunctions200Response.java | 2 +- ...eUploadURLForEdgeFunctionsAlphaOutput.java | 2 +- ...dSyncScheduleFromWarehouse200Response.java | 2 +- ...ncedSyncScheduleFromWarehouseV1Output.java | 2 +- ...nnectionStateFromWarehouse200Response.java | 2 +- ...tConnectionStateFromWarehouseV1Output.java | 2 +- ...ailyPerSourceAPICallsUsage200Response.java | 2 +- ...etDailyPerSourceAPICallsUsageV1Output.java | 2 +- .../GetDailyPerSourceMTUUsage200Response.java | 2 +- .../GetDailyPerSourceMTUUsageV1Output.java | 2 +- ...ailyWorkspaceAPICallsUsage200Response.java | 2 +- ...etDailyWorkspaceAPICallsUsageV1Output.java | 2 +- .../GetDailyWorkspaceMTUUsage200Response.java | 2 +- .../GetDailyWorkspaceMTUUsageV1Output.java | 2 +- .../models/GetDestination200Response.java | 2 +- .../GetDestinationMetadata200Response.java | 2 +- .../GetDestinationMetadataV1Output.java | 2 +- .../models/GetDestinationV1Output.java | 2 +- .../GetDestinationsCatalog200Response.java | 2 +- .../GetDestinationsCatalogV1Output.java | 2 +- ...tEventsVolumeFromWorkspace200Response.java | 2 +- .../GetEventsVolumeFromWorkspaceV1Output.java | 2 +- .../GetFilterInDestination200Response.java | 2 +- .../GetFilterInDestinationV1Output.java | 2 +- .../models/GetFunction200Response.java | 2 +- .../publicapi/models/GetFunctionV1Output.java | 2 +- ...GetLatestFromEdgeFunctions200Response.java | 2 +- ...GetLatestFromEdgeFunctionsAlphaOutput.java | 2 +- ...tMessagingSubscriptionFailureResponse.java | 2 +- ...tMessagingSubscriptionSuccessResponse.java | 2 +- .../models/GetRegulation200Response.java | 2 +- .../models/GetRegulationV1Output.java | 2 +- .../models/GetSource200Response.java | 2 +- .../models/GetSource200Response1.java | 2 +- .../models/GetSourceAlphaOutput.java | 2 +- .../models/GetSourceMetadata200Response.java | 2 +- .../models/GetSourceMetadataV1Output.java | 2 +- .../publicapi/models/GetSourceV1Output.java | 2 +- .../models/GetSourcesCatalog200Response.java | 2 +- .../models/GetSourcesCatalogV1Output.java | 2 +- .../publicapi/models/GetSpace200Response.java | 2 +- .../publicapi/models/GetSpaceAlphaOutput.java | 2 +- ...ubscriptionFromDestination200Response.java | 2 +- ...ubscriptionFromDestinationAlphaOutput.java | 2 +- .../models/GetSubscriptionRequest.java | 2 +- .../models/GetTrackingPlan200Response.java | 2 +- .../models/GetTrackingPlanV1Output.java | 2 +- .../models/GetTransformation200Response.java | 10 +- .../models/GetTransformationBetaInput.java | 213 +++++++ .../models/GetTransformationBetaOutput.java | 2 +- .../models/GetTransformationV1Output.java | 206 +++++++ .../publicapi/models/GetUser200Response.java | 2 +- .../models/GetUserGroup200Response.java | 2 +- .../models/GetUserGroupV1Output.java | 2 +- .../publicapi/models/GetUserV1Output.java | 2 +- .../models/GetWarehouse200Response.java | 2 +- .../GetWarehouseMetadata200Response.java | 2 +- .../models/GetWarehouseMetadataV1Output.java | 2 +- .../models/GetWarehouseV1Output.java | 2 +- .../GetWarehousesCatalog200Response.java | 2 +- .../models/GetWarehousesCatalogV1Output.java | 2 +- .../models/GetWorkspace200Response.java | 2 +- .../models/GetWorkspaceV1Output.java | 2 +- .../com/segment/publicapi/models/Group.java | 2 +- .../models/GroupSourceSettingsV1.java | 2 +- .../segment/publicapi/models/Identify.java | 2 +- .../models/IdentifySourceSettingsV1.java | 2 +- .../com/segment/publicapi/models/Input.java | 2 +- .../models/IntegrationOptionBeta.java | 2 +- .../publicapi/models/InvitePermissionV1.java | 2 +- .../segment/publicapi/models/InviteV1.java | 2 +- .../com/segment/publicapi/models/Label.java | 2 +- .../com/segment/publicapi/models/Label1.java | 2 +- .../com/segment/publicapi/models/Label2.java | 2 +- .../segment/publicapi/models/LabelAlpha.java | 2 +- .../com/segment/publicapi/models/LabelV1.java | 2 +- .../models/ListAuditEvents200Response.java | 2 +- .../models/ListAuditEventsV1Output.java | 2 +- ...ctedDestinationsFromSource200Response.java | 2 +- ...tedDestinationsFromSource200Response1.java | 2 +- ...ctedDestinationsFromSourceAlphaOutput.java | 2 +- ...nnectedDestinationsFromSourceV1Output.java | 2 +- ...nectedSourcesFromWarehouse200Response.java | 2 +- ...ConnectedSourcesFromWarehouseV1Output.java | 2 +- ...nectedWarehousesFromSource200Response.java | 2 +- ...ectedWarehousesFromSource200Response1.java | 2 +- ...nectedWarehousesFromSourceAlphaOutput.java | 2 +- ...ConnectedWarehousesFromSourceV1Output.java | 2 +- ...ricsSummaryFromDestination200Response.java | 2 +- ...tricsSummaryFromDestinationBetaOutput.java | 2 +- .../models/ListDestinations200Response.java | 2 +- .../models/ListDestinationsV1Output.java | 2 +- ...ListFiltersFromDestination200Response.java | 2 +- .../ListFiltersFromDestinationV1Output.java | 2 +- .../publicapi/models/ListFunctionItemV1.java | 2 +- .../models/ListFunctions200Response.java | 2 +- .../models/ListFunctionsV1Output.java | 2 +- .../models/ListInvites200Response.java | 2 +- .../ListInvitesFromUserGroup200Response.java | 2 +- .../ListInvitesFromUserGroupV1Output.java | 2 +- .../publicapi/models/ListInvitesV1Output.java | 2 +- .../models/ListLabels200Response.java | 2 +- .../models/ListLabels200Response1.java | 2 +- .../models/ListLabelsAlphaOutput.java | 2 +- .../publicapi/models/ListLabelsV1Output.java | 2 +- .../ListRegulationsFromSource200Response.java | 2 +- .../ListRegulationsFromSourceV1Output.java | 2 +- .../models/ListRoles200Response.java | 2 +- .../publicapi/models/ListRolesV1Output.java | 2 +- .../ListRulesFromTrackingPlan200Response.java | 2 +- .../ListRulesFromTrackingPlanV1Output.java | 2 +- ...ListSchemaSettingsInSource200Response.java | 2 +- .../ListSchemaSettingsInSourceV1Output.java | 2 +- ...yncsFromWarehouseAndSource200Response.java | 2 +- ...veSyncsFromWarehouseAndSourceV1Output.java | 2 +- .../models/ListSources200Response.java | 2 +- .../models/ListSources200Response1.java | 2 +- .../models/ListSourcesAlphaOutput.java | 2 +- ...istSourcesFromTrackingPlan200Response.java | 2 +- .../ListSourcesFromTrackingPlanV1Output.java | 2 +- .../publicapi/models/ListSourcesV1Output.java | 2 +- ...bscriptionsFromDestination200Response.java | 2 +- ...bscriptionsFromDestinationAlphaOutput.java | 2 +- .../models/ListSuppressions200Response.java | 2 +- .../models/ListSuppressionsV1Output.java | 2 +- .../ListSyncsFromWarehouse200Response.java | 2 +- ...yncsFromWarehouseAndSource200Response.java | 2 +- ...stSyncsFromWarehouseAndSourceV1Output.java | 2 +- .../ListSyncsFromWarehouseV1Output.java | 2 +- .../models/ListTrackingPlans200Response.java | 2 +- .../models/ListTrackingPlansV1Output.java | 2 +- .../ListTransformations200Response.java | 10 +- .../models/ListTransformationsBetaInput.java | 210 +++++++ .../models/ListTransformationsBetaOutput.java | 2 +- .../models/ListTransformationsV1Output.java | 255 ++++++++ .../models/ListUserGroups200Response.java | 2 +- .../ListUserGroupsFromUser200Response.java | 2 +- .../ListUserGroupsFromUserV1Output.java | 2 +- .../models/ListUserGroupsV1Output.java | 2 +- .../models/ListUsers200Response.java | 2 +- .../ListUsersFromUserGroup200Response.java | 2 +- .../ListUsersFromUserGroupV1Output.java | 2 +- .../publicapi/models/ListUsersV1Output.java | 2 +- .../models/ListWarehouses200Response.java | 2 +- .../models/ListWarehousesV1Output.java | 2 +- .../ListWorkspaceRegulations200Response.java | 2 +- .../ListWorkspaceRegulationsV1Output.java | 2 +- .../com/segment/publicapi/models/Logos.java | 2 +- .../com/segment/publicapi/models/Logos1.java | 2 +- .../com/segment/publicapi/models/Logos2.java | 2 +- .../segment/publicapi/models/LogosBeta.java | 2 +- .../models/MessageSubscriptionResponse.java | 2 +- .../MessageSubscriptionResponseError.java | 2 +- .../models/MessagesSubscriptionRequest.java | 2 +- .../segment/publicapi/models/Metadata.java | 2 +- .../segment/publicapi/models/Metadata1.java | 2 +- .../segment/publicapi/models/Metadata2.java | 2 +- .../segment/publicapi/models/MetricBeta.java | 2 +- .../publicapi/models/MinimalUserGroupV1.java | 2 +- .../publicapi/models/MinimalUserV1.java | 2 +- .../publicapi/models/MtuSnapshotV1.java | 2 +- .../segment/publicapi/models/Pagination.java | 2 +- .../segment/publicapi/models/Pagination1.java | 250 ++++++++ .../publicapi/models/PaginationInput.java | 2 +- .../publicapi/models/PaginationOutput.java | 2 +- .../publicapi/models/PermissionInputV1.java | 2 +- .../models/PermissionResourceV1.java | 2 +- .../publicapi/models/PermissionV1.java | 2 +- .../PreviewDestinationFilter200Response.java | 2 +- .../models/PreviewDestinationFilterV1.java | 2 +- .../PreviewDestinationFilterV1Input.java | 2 +- .../PreviewDestinationFilterV1Output.java | 2 +- .../publicapi/models/PropertyRenameBeta.java | 2 +- .../publicapi/models/PropertyRenameV1.java | 247 ++++++++ .../PropertyValueTransformationBeta.java | 2 +- .../models/PropertyValueTransformationV1.java | 267 ++++++++ .../segment/publicapi/models/Regulation.java | 2 +- .../models/RegulationListEntryV1.java | 2 +- ...emoveFilterFromDestination200Response.java | 2 +- .../RemoveFilterFromDestinationV1Output.java | 2 +- .../publicapi/models/RemoveRuleV1.java | 2 +- ...emoveRulesFromTrackingPlan200Response.java | 2 +- .../RemoveRulesFromTrackingPlanV1Output.java | 2 +- ...rceConnectionFromWarehouse200Response.java | 2 +- ...SourceConnectionFromWarehouseV1Output.java | 2 +- ...moveSourceFromTrackingPlan200Response.java | 2 +- .../RemoveSourceFromTrackingPlanV1Output.java | 2 +- ...ubscriptionFromDestination200Response.java | 2 +- ...ubscriptionFromDestinationAlphaOutput.java | 2 +- .../RemoveUsersFromUserGroup200Response.java | 2 +- .../RemoveUsersFromUserGroupV1Output.java | 2 +- ...edSyncScheduleForWarehouse200Response.java | 2 +- ...vancedSyncScheduleForWarehouseV1Input.java | 2 +- ...ancedSyncScheduleForWarehouseV1Output.java | 2 +- .../ReplaceLabelsInSource200Response.java | 2 +- .../ReplaceLabelsInSource200Response1.java | 2 +- .../ReplaceLabelsInSourceAlphaInput.java | 2 +- .../ReplaceLabelsInSourceAlphaOutput.java | 2 +- .../models/ReplaceLabelsInSourceV1Input.java | 2 +- .../models/ReplaceLabelsInSourceV1Output.java | 2 +- ...agingSubscriptionsInSpaces200Response.java | 2 +- ...sagingSubscriptionsInSpacesAlphaInput.java | 2 +- ...agingSubscriptionsInSpacesAlphaOutput.java | 2 +- .../ReplacePermissionsForUser200Response.java | 2 +- ...acePermissionsForUserGroup200Response.java | 2 +- ...ReplacePermissionsForUserGroupV1Input.java | 2 +- ...eplacePermissionsForUserGroupV1Output.java | 2 +- .../ReplacePermissionsForUserV1Input.java | 2 +- .../ReplacePermissionsForUserV1Output.java | 2 +- ...ReplaceRulesInTrackingPlan200Response.java | 2 +- .../ReplaceRulesInTrackingPlanV1Input.java | 2 +- .../ReplaceRulesInTrackingPlanV1Output.java | 2 +- .../ReplaceUsersInUserGroup200Response.java | 2 +- .../ReplaceUsersInUserGroupV1Input.java | 2 +- .../ReplaceUsersInUserGroupV1Output.java | 2 +- .../publicapi/models/RequestError.java | 2 +- .../models/RequestErrorEnvelope.java | 2 +- .../segment/publicapi/models/ResourceV1.java | 2 +- .../com/segment/publicapi/models/RoleV1.java | 2 +- .../com/segment/publicapi/models/RuleV1.java | 2 +- .../segment/publicapi/models/Schedule.java | 2 +- .../segment/publicapi/models/Schedule1.java | 2 +- .../segment/publicapi/models/Schedule2.java | 2 +- .../segment/publicapi/models/Settings.java | 2 +- .../segment/publicapi/models/Settings1.java | 2 +- .../com/segment/publicapi/models/Source.java | 2 +- .../com/segment/publicapi/models/Source1.java | 2 +- .../com/segment/publicapi/models/Source2.java | 2 +- .../com/segment/publicapi/models/Source3.java | 2 +- .../com/segment/publicapi/models/Source4.java | 2 +- .../com/segment/publicapi/models/Source5.java | 2 +- .../com/segment/publicapi/models/Source6.java | 2 +- .../models/SourceAPICallSnapshotV1.java | 2 +- .../segment/publicapi/models/SourceAlpha.java | 2 +- .../models/SourceEventVolumeDatapointV1.java | 2 +- .../publicapi/models/SourceEventVolumeV1.java | 2 +- .../publicapi/models/SourceMetadata.java | 2 +- .../publicapi/models/SourceMetadataV1.java | 2 +- .../models/SourceSettingsOutputV1.java | 2 +- .../segment/publicapi/models/SourceV1.java | 2 +- .../com/segment/publicapi/models/Space.java | 2 +- .../publicapi/models/StreamStatusV1.java | 2 +- .../publicapi/models/Subscription.java | 2 +- .../publicapi/models/SupportedFeatures.java | 2 +- .../publicapi/models/SupportedMethods.java | 2 +- .../publicapi/models/SupportedPlatforms.java | 2 +- .../publicapi/models/SuppressedInner.java | 2 +- .../publicapi/models/SyncNoticeV1.java | 2 +- .../com/segment/publicapi/models/SyncV1.java | 2 +- .../com/segment/publicapi/models/Track.java | 2 +- .../models/TrackSourceSettingsV1.java | 2 +- .../publicapi/models/TrackingPlan.java | 2 +- .../publicapi/models/TrackingPlan1.java | 2 +- .../publicapi/models/TrackingPlanV1.java | 2 +- .../publicapi/models/Transformation.java | 2 +- .../publicapi/models/Transformation1.java | 2 +- .../publicapi/models/Transformation2.java | 2 +- .../publicapi/models/Transformation3.java | 571 +++++++++++++++++ .../publicapi/models/Transformation4.java | 571 +++++++++++++++++ .../publicapi/models/Transformation5.java | 571 +++++++++++++++++ .../publicapi/models/TransformationBeta.java | 2 +- .../publicapi/models/TransformationV1.java | 572 ++++++++++++++++++ .../models/UpdateDestination200Response.java | 2 +- .../models/UpdateDestinationV1Input.java | 2 +- .../models/UpdateDestinationV1Output.java | 2 +- ...UpdateFilterForDestination200Response.java | 2 +- .../UpdateFilterForDestinationV1Input.java | 2 +- .../UpdateFilterForDestinationV1Output.java | 2 +- .../models/UpdateFunction200Response.java | 2 +- .../models/UpdateFunctionV1Input.java | 2 +- .../models/UpdateFunctionV1Output.java | 2 +- .../UpdateRulesInTrackingPlan200Response.java | 2 +- .../UpdateRulesInTrackingPlanV1Input.java | 2 +- .../UpdateRulesInTrackingPlanV1Output.java | 2 +- ...dateSchemaSettingsInSource200Response.java | 2 +- .../UpdateSchemaSettingsInSourceV1Input.java | 2 +- .../UpdateSchemaSettingsInSourceV1Output.java | 2 +- ...eSelectiveSyncForWarehouse200Response.java | 2 +- ...pdateSelectiveSyncForWarehouseV1Input.java | 2 +- ...dateSelectiveSyncForWarehouseV1Output.java | 2 +- .../models/UpdateSource200Response.java | 2 +- .../models/UpdateSource200Response1.java | 2 +- .../models/UpdateSourceAlphaInput.java | 2 +- .../models/UpdateSourceAlphaOutput.java | 2 +- .../publicapi/models/UpdateSourceV1Input.java | 2 +- .../models/UpdateSourceV1Output.java | 2 +- ...SubscriptionForDestination200Response.java | 2 +- ...eSubscriptionForDestinationAlphaInput.java | 2 +- ...SubscriptionForDestinationAlphaOutput.java | 2 +- .../models/UpdateTrackingPlan200Response.java | 2 +- .../models/UpdateTrackingPlanV1Input.java | 2 +- .../models/UpdateTrackingPlanV1Output.java | 2 +- .../UpdateTransformation200Response.java | 10 +- .../models/UpdateTransformationBetaInput.java | 52 +- .../UpdateTransformationBetaOutput.java | 2 +- .../models/UpdateTransformationV1Input.java | 525 ++++++++++++++++ .../models/UpdateTransformationV1Output.java | 210 +++++++ .../models/UpdateUserGroup200Response.java | 2 +- .../models/UpdateUserGroupV1Input.java | 2 +- .../models/UpdateUserGroupV1Output.java | 2 +- .../models/UpdateWarehouse200Response.java | 2 +- .../models/UpdateWarehouseV1Input.java | 2 +- .../models/UpdateWarehouseV1Output.java | 2 +- .../publicapi/models/UpsertRuleV1.java | 2 +- .../com/segment/publicapi/models/User.java | 2 +- .../segment/publicapi/models/UserGroup.java | 2 +- .../segment/publicapi/models/UserGroup1.java | 2 +- .../segment/publicapi/models/UserGroup2.java | 2 +- .../segment/publicapi/models/UserGroup3.java | 2 +- .../segment/publicapi/models/UserGroupV1.java | 2 +- .../com/segment/publicapi/models/UserV1.java | 2 +- .../models/UsersPerSourceSnapshotV1.java | 2 +- .../segment/publicapi/models/Warehouse.java | 2 +- .../segment/publicapi/models/Warehouse1.java | 2 +- .../segment/publicapi/models/Warehouse2.java | 2 +- .../models/WarehouseAdvancedSyncV1.java | 2 +- .../publicapi/models/WarehouseMetadata.java | 2 +- .../publicapi/models/WarehouseMetadataV1.java | 2 +- .../models/WarehouseSelectiveSyncItemV1.java | 2 +- .../models/WarehouseSyncOverrideV1.java | 2 +- .../segment/publicapi/models/WarehouseV1.java | 2 +- .../segment/publicapi/models/Workspace.java | 2 +- .../segment/publicapi/models/WorkspaceV1.java | 2 +- 521 files changed, 6583 insertions(+), 584 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/Pagination1.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertyRenameV1.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation3.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation4.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation5.java create mode 100644 src/main/java/com/segment/publicapi/models/TransformationV1.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java diff --git a/README.md b/README.md index 08be087c..50e7fa1d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 32.0.4 +- API version: 32.0.8 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -35,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 32.0.4 + 32.0.8 compile ``` @@ -51,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:32.0.4" + implementation "com.segment.publicapi:segment-publicapi:32.0.8" } ``` @@ -65,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-32.0.4.jar` +* `target/segment-publicapi-32.0.8.jar` * `target/lib/*.jar` ## Getting Started diff --git a/pom.xml b/pom.xml index 0bafff52..4fbc005f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 32.0.4 + 32.0.8 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiCallback.java b/src/main/java/com/segment/publicapi/ApiCallback.java index 12817a96..46267b71 100644 --- a/src/main/java/com/segment/publicapi/ApiCallback.java +++ b/src/main/java/com/segment/publicapi/ApiCallback.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 076b5ccb..2cfe9ace 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -125,7 +125,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/32.0.4/java"); + setUserAgent("OpenAPI-Generator/32.0.8/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/ApiException.java b/src/main/java/com/segment/publicapi/ApiException.java index c0590044..ad206019 100644 --- a/src/main/java/com/segment/publicapi/ApiException.java +++ b/src/main/java/com/segment/publicapi/ApiException.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiResponse.java b/src/main/java/com/segment/publicapi/ApiResponse.java index 95a241ca..036e33df 100644 --- a/src/main/java/com/segment/publicapi/ApiResponse.java +++ b/src/main/java/com/segment/publicapi/ApiResponse.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f3510d54..315da371 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java index 89734910..4dba29c3 100644 --- a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java +++ b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index b2e7690b..dab0a469 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -302,6 +302,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateUserGroup200Response .CustomTypeAdapterFactory()); @@ -387,9 +393,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformation200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteUserGroup200Response .CustomTypeAdapterFactory()); @@ -632,9 +644,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformation200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -849,9 +867,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformations200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformationsBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUserGroups200Response .CustomTypeAdapterFactory()); @@ -917,6 +941,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Pagination1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -941,9 +967,14 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyValueTransformationV1 + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1144,8 +1175,16 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation5.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); @@ -1240,6 +1279,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateUserGroup200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/Pair.java b/src/main/java/com/segment/publicapi/Pair.java index 554b2d48..a6e629c4 100644 --- a/src/main/java/com/segment/publicapi/Pair.java +++ b/src/main/java/com/segment/publicapi/Pair.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressRequestBody.java b/src/main/java/com/segment/publicapi/ProgressRequestBody.java index 2062a60c..f318c69f 100644 --- a/src/main/java/com/segment/publicapi/ProgressRequestBody.java +++ b/src/main/java/com/segment/publicapi/ProgressRequestBody.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressResponseBody.java b/src/main/java/com/segment/publicapi/ProgressResponseBody.java index 84e4814b..275a1bf5 100644 --- a/src/main/java/com/segment/publicapi/ProgressResponseBody.java +++ b/src/main/java/com/segment/publicapi/ProgressResponseBody.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/StringUtil.java b/src/main/java/com/segment/publicapi/StringUtil.java index f533c942..0c53701d 100644 --- a/src/main/java/com/segment/publicapi/StringUtil.java +++ b/src/main/java/com/segment/publicapi/StringUtil.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java index 7baa42a7..c58fa566 100644 --- a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java +++ b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index fd4bdf76..40d378d0 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/CatalogApi.java b/src/main/java/com/segment/publicapi/api/CatalogApi.java index bb64a28f..b951cbce 100644 --- a/src/main/java/com/segment/publicapi/api/CatalogApi.java +++ b/src/main/java/com/segment/publicapi/api/CatalogApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index a9119a95..f8b4213c 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index c13b08e6..1b99f8cd 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 317de9ff..aeac1c21 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index 330e2267..02e4eaf4 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index 2603a05c..3beec6b4 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 296f31d3..b2f84922 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index 1d91f5f7..d77e2862 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamRolesApi.java b/src/main/java/com/segment/publicapi/api/IamRolesApi.java index f7ebf845..5cd56fad 100644 --- a/src/main/java/com/segment/publicapi/api/IamRolesApi.java +++ b/src/main/java/com/segment/publicapi/api/IamRolesApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 344fe567..9ae9343b 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index 65054ab9..ab3ffe91 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java index 551177e8..c89388a0 100644 --- a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 6c478d04..aa03d08d 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index ef46d677..6c22ebf9 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 9aa5c813..1e823b70 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TestingApi.java b/src/main/java/com/segment/publicapi/api/TestingApi.java index f88ba694..d8d96445 100644 --- a/src/main/java/com/segment/publicapi/api/TestingApi.java +++ b/src/main/java/com/segment/publicapi/api/TestingApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index 4f781ceb..e9fc9db4 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index 85e4a26e..de09c9e7 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,13 +21,13 @@ import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateTransformation200Response; -import com.segment.publicapi.models.CreateTransformationBetaInput; +import com.segment.publicapi.models.CreateTransformationV1Input; import com.segment.publicapi.models.DeleteTransformation200Response; import com.segment.publicapi.models.GetTransformation200Response; import com.segment.publicapi.models.ListTransformations200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateTransformation200Response; -import com.segment.publicapi.models.UpdateTransformationBetaInput; +import com.segment.publicapi.models.UpdateTransformationV1Input; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -74,7 +74,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTransformation * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -88,8 +88,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * */ public okhttp3.Call createTransformationCall( - CreateTransformationBetaInput createTransformationBetaInput, - final ApiCallback _callback) + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -104,7 +103,7 @@ public okhttp3.Call createTransformationCall( basePath = null; } - Object localVarPostBody = createTransformationBetaInput; + Object localVarPostBody = createTransformationV1Input; // create path and map variables String localVarPath = "/transformations"; @@ -116,9 +115,10 @@ public okhttp3.Call createTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -126,7 +126,9 @@ public okhttp3.Call createTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -151,19 +153,18 @@ public okhttp3.Call createTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call createTransformationValidateBeforeCall( - CreateTransformationBetaInput createTransformationBetaInput, - final ApiCallback _callback) + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTransformationBetaInput' is set - if (createTransformationBetaInput == null) { + // verify the required parameter 'createTransformationV1Input' is set + if (createTransformationV1Input == null) { throw new ApiException( - "Missing the required parameter 'createTransformationBetaInput' when calling" + "Missing the required parameter 'createTransformationV1Input' when calling" + " createTransformation(Async)"); } okhttp3.Call localVarCall = - createTransformationCall(createTransformationBetaInput, _callback); + createTransformationCall(createTransformationV1Input, _callback); return localVarCall; } @@ -173,7 +174,7 @@ private okhttp3.Call createTransformationValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @return CreateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -187,9 +188,9 @@ private okhttp3.Call createTransformationValidateBeforeCall( * */ public CreateTransformation200Response createTransformation( - CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + CreateTransformationV1Input createTransformationV1Input) throws ApiException { ApiResponse localVarResp = - createTransformationWithHttpInfo(createTransformationBetaInput); + createTransformationWithHttpInfo(createTransformationV1Input); return localVarResp.getData(); } @@ -199,7 +200,7 @@ public CreateTransformation200Response createTransformation( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @return ApiResponse<CreateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -213,9 +214,9 @@ public CreateTransformation200Response createTransformation( * */ public ApiResponse createTransformationWithHttpInfo( - CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + CreateTransformationV1Input createTransformationV1Input) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationBetaInput, null); + createTransformationValidateBeforeCall(createTransformationV1Input, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -227,7 +228,7 @@ public ApiResponse createTransformationWithHttp * to have the Protocols feature enabled. Please reach out to your customer success manager for * more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -242,12 +243,12 @@ public ApiResponse createTransformationWithHttp * */ public okhttp3.Call createTransformationAsync( - CreateTransformationBetaInput createTransformationBetaInput, + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); + createTransformationValidateBeforeCall(createTransformationV1Input, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -299,9 +300,10 @@ public okhttp3.Call deleteTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -476,9 +478,10 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -605,7 +608,7 @@ public okhttp3.Call getTransformationAsync( /** * Build call for listTransformations * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -649,9 +652,10 @@ public okhttp3.Call listTransformationsCall( } final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -701,7 +705,7 @@ private okhttp3.Call listTransformationsValidateBeforeCall( * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListTransformations200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -726,7 +730,7 @@ public ListTransformations200Response listTransformations(PaginationInput pagina * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListTransformations200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -752,7 +756,7 @@ public ApiResponse listTransformationsWithHttpIn * Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -779,7 +783,7 @@ public okhttp3.Call listTransformationsAsync( * Build call for updateTransformation * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -794,7 +798,7 @@ public okhttp3.Call listTransformationsAsync( */ public okhttp3.Call updateTransformationCall( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -810,7 +814,7 @@ public okhttp3.Call updateTransformationCall( basePath = null; } - Object localVarPostBody = updateTransformationBetaInput; + Object localVarPostBody = updateTransformationV1Input; // create path and map variables String localVarPath = @@ -826,9 +830,10 @@ public okhttp3.Call updateTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -836,7 +841,9 @@ public okhttp3.Call updateTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -862,7 +869,7 @@ public okhttp3.Call updateTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateTransformationValidateBeforeCall( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { @@ -873,16 +880,15 @@ private okhttp3.Call updateTransformationValidateBeforeCall( + " updateTransformation(Async)"); } - // verify the required parameter 'updateTransformationBetaInput' is set - if (updateTransformationBetaInput == null) { + // verify the required parameter 'updateTransformationV1Input' is set + if (updateTransformationV1Input == null) { throw new ApiException( - "Missing the required parameter 'updateTransformationBetaInput' when calling" + "Missing the required parameter 'updateTransformationV1Input' when calling" + " updateTransformation(Async)"); } okhttp3.Call localVarCall = - updateTransformationCall( - transformationId, updateTransformationBetaInput, _callback); + updateTransformationCall(transformationId, updateTransformationV1Input, _callback); return localVarCall; } @@ -894,7 +900,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @return UpdateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -908,10 +914,10 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * */ public UpdateTransformation200Response updateTransformation( - String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + String transformationId, UpdateTransformationV1Input updateTransformationV1Input) throws ApiException { ApiResponse localVarResp = - updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); + updateTransformationWithHttpInfo(transformationId, updateTransformationV1Input); return localVarResp.getData(); } @@ -923,7 +929,7 @@ public UpdateTransformation200Response updateTransformation( * information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @return ApiResponse<UpdateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -937,11 +943,11 @@ public UpdateTransformation200Response updateTransformation( * */ public ApiResponse updateTransformationWithHttpInfo( - String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + String transformationId, UpdateTransformationV1Input updateTransformationV1Input) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationBetaInput, null); + transformationId, updateTransformationV1Input, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -954,7 +960,7 @@ public ApiResponse updateTransformationWithHttp * more information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -970,13 +976,13 @@ public ApiResponse updateTransformationWithHttp */ public okhttp3.Call updateTransformationAsync( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationBetaInput, _callback); + transformationId, updateTransformationV1Input, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index 18c61db3..4a82b76b 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index b898a98f..649d58e0 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java index 035d232e..7537cfa3 100644 --- a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java +++ b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/Authentication.java b/src/main/java/com/segment/publicapi/auth/Authentication.java index c314af4f..09e215b0 100644 --- a/src/main/java/com/segment/publicapi/auth/Authentication.java +++ b/src/main/java/com/segment/publicapi/auth/Authentication.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java index dd20d918..d198f045 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java index bea680bd..01d79ea1 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java index ff712688..493c2817 100644 --- a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java index 7a6f9656..54d026e8 100644 --- a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java +++ b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java index 3b78aca0..28af788f 100644 --- a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java index c578bc4e..ae141f90 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java index bcccaf5d..3faa32c9 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java index 6350d7bf..4ce12cf2 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java index 2f509fd7..2602e6e6 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java index 6eeaa66d..ff859fc2 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java index 56866e6c..3e7830a8 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index ababcf0c..0750fc01 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java index 4f5a39ee..2eef33b6 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java index 7db3a09b..76b4f1b8 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java index e28d02bf..ea9a26a5 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index d8e4c71c..8447f9ac 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java index f1e77ba0..606a74a2 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index 29e51270..8abd2cac 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java index 5beb00f4..5a8f072a 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java index 0374116b..136d0183 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index ad0a5fc0..731c452b 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java index e339cfa8..0ffe5437 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java index 60b26d7d..0d010c43 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index 183ff889..08207f43 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java index b3361af9..30515fb3 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java index f8251644..a96b2d51 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java index 4a7cc1ea..11f78fae 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java index 6b214ea3..c810af7b 100644 --- a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java +++ b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AuditEventV1.java b/src/main/java/com/segment/publicapi/models/AuditEventV1.java index 5eb4ba7b..50c5dd12 100644 --- a/src/main/java/com/segment/publicapi/models/AuditEventV1.java +++ b/src/main/java/com/segment/publicapi/models/AuditEventV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java index 23138a97..ae583d1e 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java index 953c4217..6505cbc8 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java index 7913e1ce..be6595f1 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java index a0858f78..cef44138 100644 --- a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java +++ b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java index 629f773d..3cce8beb 100644 --- a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index 649c3664..7694d8fd 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java index cadf8f61..00ebc886 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 537c2759..4ecd81a0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java index 15ee4f6c..32860ef4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java index 61c2c2b4..309a9bad 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java index d996b509..0e3fc1f7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index 6fbf273a..9f15ca71 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java index 9981793c..48002bb8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java index 7d2163ab..90cfb96a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java index 23f751b2..dc564787 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java index 86d552c8..67ae15f7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java index 89a9adaf..3e3120f6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java index 1ed058da..17b5785d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java index 75c95647..1c5bd564 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index b3b85ac1..5a56e9c5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java index 1101d177..fa1dc778 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java index 6ef412c2..1eccf785 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java index 9934d7a3..5a143846 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java index 3c80d404..b5829244 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 49f961a5..cca4fded 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java index 5c3c6767..a6c7251c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java index 6760324e..f7a8c0aa 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java index 5f1c280d..74cdf548 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java index c173fb9d..66896053 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java index d71b8d08..f2b10d3c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java index e64d84f8..a03eb13e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java index 1139acbe..c3c2d81c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java index 6de301bd..eeb7c157 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index 77b39b39..ec5b46a9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index 3213637c..9936941c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java index e3814147..ead46a27 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java index 78461580..07b5847f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java index 822b86d2..1f59d28b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java index 673dd8f9..75c00816 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java index 6f36f4d4..95b3a621 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 1aa81dfd..2ebe8af8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java index e56ee96e..4cadd2c0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index 3f993547..92717093 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java index db520440..c010f3ac 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java index 9f64dd07..45a1e003 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index c0dbe528..e682264a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java index cece15d2..0928d59f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 408667f6..46198f27 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,11 +35,11 @@ public class CreateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private CreateTransformationBetaOutput data; + private CreateTransformationV1Output data; public CreateTransformation200Response() {} - public CreateTransformation200Response data(CreateTransformationBetaOutput data) { + public CreateTransformation200Response data(CreateTransformationV1Output data) { this.data = data; return this; @@ -52,11 +52,11 @@ public CreateTransformation200Response data(CreateTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public CreateTransformationBetaOutput getData() { + public CreateTransformationV1Output getData() { return data; } - public void setData(CreateTransformationBetaOutput data) { + public void setData(CreateTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 3948d986..82539a77 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java index 3b935df5..24aae506 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java new file mode 100644 index 00000000..406b3a17 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -0,0 +1,541 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input to create a Transformation. */ +@ApiModel(description = "The input to create a Transformation.") +public class CreateTransformationV1Input { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public CreateTransformationV1Input() {} + + public CreateTransformationV1Input name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateTransformationV1Input sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public CreateTransformationV1Input destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata id to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The optional Destination metadata id to be associated with the" + + " Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public CreateTransformationV1Input enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateTransformationV1Input _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public CreateTransformationV1Input newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public CreateTransformationV1Input propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public CreateTransformationV1Input addPropertyRenamesItem( + PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public CreateTransformationV1Input propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public CreateTransformationV1Input addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationV1Input createTransformationV1Input = (CreateTransformationV1Input) o; + return Objects.equals(this.name, createTransformationV1Input.name) + && Objects.equals(this.sourceId, createTransformationV1Input.sourceId) + && Objects.equals( + this.destinationMetadataId, + createTransformationV1Input.destinationMetadataId) + && Objects.equals(this.enabled, createTransformationV1Input.enabled) + && Objects.equals(this._if, createTransformationV1Input._if) + && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) + && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + createTransformationV1Input.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateTransformationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationV1Input is not" + + " found in the empty JSON string", + CreateTransformationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationV1Input + * @throws IOException if the JSON string is invalid with respect to CreateTransformationV1Input + */ + public static CreateTransformationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationV1Input.class); + } + + /** + * Convert an instance of CreateTransformationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java new file mode 100644 index 00000000..146979a1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of a created Transformation. */ +@ApiModel(description = "The output of a created Transformation.") +public class CreateTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation5 transformation; + + public CreateTransformationV1Output() {} + + public CreateTransformationV1Output transformation(Transformation5 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation5 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation5 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationV1Output createTransformationV1Output = + (CreateTransformationV1Output) o; + return Objects.equals(this.transformation, createTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationV1Output is not" + + " found in the empty JSON string", + CreateTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateTransformationV1Output + */ + public static CreateTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationV1Output.class); + } + + /** + * Convert an instance of CreateTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java index 8be574e1..29d6a774 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java index bf769efc..adc5aaf5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java index e750b2e2..b957d1bf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java index 73110d39..aff00f69 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java index 7b7f3402..96e05900 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java index 95ba9a3e..bc132672 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java index c4f557b1..0804b661 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index e8ec13c8..bc32a210 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java index 30777dac..72fa0dc3 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java index 458f9990..bb6fd9cb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index e5be8fef..100d0fe4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java index 39c2bf7f..616a3384 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java index 62576565..e3ff14ae 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java index cc72f524..c786a248 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java index f4764bb7..a4d9fd1d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java index 235daeb4..16bbfed6 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java index 1d215577..936feda0 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java index 24ae6f08..95a7bcaa 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java index 2fe7c3ee..ac9338f0 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java index 2f2eff55..b8fc6385 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java index d249a822..e8bc75e8 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java index c68c0e08..55a7e34f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java index da2d4e2e..abdac043 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java index b033fc03..b514b161 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java index 5e1a34dd..69c3ee25 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java index e45d3c7e..2518c16f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java index 1d96829d..e5323b46 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java index f05522d2..d5a66a87 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java index 4636fad0..fb99cb03 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java index 689bd19d..754beac7 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index f589305d..d2c9d773 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,11 +35,11 @@ public class DeleteTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTransformationBetaOutput data; + private DeleteTransformationV1Output data; public DeleteTransformation200Response() {} - public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { + public DeleteTransformation200Response data(DeleteTransformationV1Output data) { this.data = data; return this; @@ -52,11 +52,11 @@ public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public DeleteTransformationBetaOutput getData() { + public DeleteTransformationV1Output getData() { return data; } - public void setData(DeleteTransformationBetaOutput data) { + public void setData(DeleteTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java new file mode 100644 index 00000000..ef90af3c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java @@ -0,0 +1,219 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input of delete Transformation. */ +@ApiModel(description = "The input of delete Transformation.") +public class DeleteTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + + public DeleteTransformationBetaInput() {} + + public DeleteTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * The Transformation id. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Transformation id.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationBetaInput deleteTransformationBetaInput = + (DeleteTransformationBetaInput) o; + return Objects.equals( + this.transformationId, deleteTransformationBetaInput.transformationId); + } + + @Override + public int hashCode() { + return Objects.hash(transformationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformationId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationBetaInput is not" + + " found in the empty JSON string", + DeleteTransformationBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationBetaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationBetaInput + */ + public static DeleteTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaInput.class); + } + + /** + * Convert an instance of DeleteTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java index 7e945d45..4dab9767 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java new file mode 100644 index 00000000..eeff815d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java @@ -0,0 +1,262 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of delete Transformation. */ +@ApiModel(description = "The output of delete Transformation.") +public class DeleteTransformationV1Output { + /** The operation status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteTransformationV1Output() {} + + public DeleteTransformationV1Output status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The operation status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The operation status.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationV1Output deleteTransformationV1Output = + (DeleteTransformationV1Output) o; + return Objects.equals(this.status, deleteTransformationV1Output.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationV1Output is not" + + " found in the empty JSON string", + DeleteTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationV1Output + */ + public static DeleteTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationV1Output.class); + } + + /** + * Convert an instance of DeleteTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java index 96d43d9e..d474f6b8 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java index 5c4ebfbb..5ba7820e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java index 5fe2f85c..50513dac 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java index a9f74677..bbe78889 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java index 95c7c25f..79b18760 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java index 12046fd1..2bb48a72 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java index 9b9a1b5e..8d4886ce 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java index 322a5a9f..e4d2b223 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java index fd2cba60..b026345e 100644 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ b/src/main/java/com/segment/publicapi/models/Destination.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination1.java b/src/main/java/com/segment/publicapi/models/Destination1.java index 61a64d3c..72063d23 100644 --- a/src/main/java/com/segment/publicapi/models/Destination1.java +++ b/src/main/java/com/segment/publicapi/models/Destination1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination2.java b/src/main/java/com/segment/publicapi/models/Destination2.java index dca4749c..39a4fd5d 100644 --- a/src/main/java/com/segment/publicapi/models/Destination2.java +++ b/src/main/java/com/segment/publicapi/models/Destination2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java index 476611b3..3b2816a7 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java index 1309d666..f7b31fa3 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java index f84d64ae..1a8636f2 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index 315cb2f2..af5214f4 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java index cf87abc3..1a189356 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java index 665a5c94..f45d0d83 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java index 5ea8e9b8..59ff7c3f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java index 43bd017e..d30797bf 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index bb95447f..0bddcdd0 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java index 6291c65d..9ee7bd73 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 23f73803..33271b2f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index 8c2247bd..b6213866 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index c365875f..f85359a8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 8b37ae24..505f3c5b 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationV1.java b/src/main/java/com/segment/publicapi/models/DestinationV1.java index 29775c10..3fb169bb 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java index af52e869..a1b813ab 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java index 18d83c41..2da0ce18 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response.java b/src/main/java/com/segment/publicapi/models/Echo200Response.java index a6f12160..536aba88 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response1.java b/src/main/java/com/segment/publicapi/models/Echo200Response1.java index eb00f98b..7ac6516f 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response1.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java index 923673f4..b4770e5e 100644 --- a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoV1Output.java b/src/main/java/com/segment/publicapi/models/EchoV1Output.java index 1772428d..5acf7e7a 100644 --- a/src/main/java/com/segment/publicapi/models/EchoV1Output.java +++ b/src/main/java/com/segment/publicapi/models/EchoV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java index 67c54a71..6d2feb81 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java index 3a0b7c3f..2d4a2815 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java index 5b0a52dd..bc6d5d7b 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EventSourceV1.java b/src/main/java/com/segment/publicapi/models/EventSourceV1.java index 8285c002..dca50bcc 100644 --- a/src/main/java/com/segment/publicapi/models/EventSourceV1.java +++ b/src/main/java/com/segment/publicapi/models/EventSourceV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index 48a45b5d..623c9628 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter1.java b/src/main/java/com/segment/publicapi/models/Filter1.java index e6e192ee..94b14228 100644 --- a/src/main/java/com/segment/publicapi/models/Filter1.java +++ b/src/main/java/com/segment/publicapi/models/Filter1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter2.java b/src/main/java/com/segment/publicapi/models/Filter2.java index 9816aabd..cf8fbfad 100644 --- a/src/main/java/com/segment/publicapi/models/Filter2.java +++ b/src/main/java/com/segment/publicapi/models/Filter2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter3.java b/src/main/java/com/segment/publicapi/models/Filter3.java index 0cab7a1e..1c5d38c7 100644 --- a/src/main/java/com/segment/publicapi/models/Filter3.java +++ b/src/main/java/com/segment/publicapi/models/Filter3.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index 90744e66..0b5f84e4 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java index c1ba336d..006a3c48 100644 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ b/src/main/java/com/segment/publicapi/models/Function1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java index 02352bca..355d2bb0 100644 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ b/src/main/java/com/segment/publicapi/models/Function2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java index e49f77b0..25f7a83a 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java +++ b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index 04239fea..18b37516 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index 0c8d3040..14a729b9 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java index 52206370..be0306d5 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java index 244d2137..c95e6ed6 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java index b34cdc68..9454b92b 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java index 2c81cdf1..56996056 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java index f869f742..1c2bd8d3 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java index 9ba59b4d..a9914e54 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java index 8c68b0af..d7d1130c 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java index 2f892244..04446abe 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java index b2df4897..257f012e 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java index 97416945..1a05794b 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java index 527113c0..db059e40 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java index fd0382d7..817fa5ec 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java index 6d20b0a7..0cfc92ee 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java index cc181bce..cf721914 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java index 11e1c5d1..162d326d 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java index a73a66ba..0dfb1906 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java index 740dbd1d..c108a908 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java index c33e5aeb..85643de3 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java index 729c746f..6d8bd30c 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java index 3699e373..ba60e2ed 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java index cf4ab1a8..cb3ea436 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 8fdebbb8..b78d7c2b 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java index 40be0ad8..eb4cc521 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java index 5408adb4..445acd48 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java index 705108ed..a4ce6f90 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 8f033da8..5f108e32 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java index ccf11178..f65171bb 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java index c85bd26c..f2fbac99 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java index a2a0a7f5..c05971e6 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index b99eb3bc..d87d8347 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java index 0dd11ed8..cc258d1a 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java index 510f4e65..2b207a70 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response.java b/src/main/java/com/segment/publicapi/models/GetSource200Response.java index 093d3670..c9bda6ae 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java index ebae583f..53b68835 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java index 74654c79..b699f91b 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java index eccf971c..23bab5dc 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java index 1f632a6e..af39039f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index 28e1e965..fd23ef6f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java index 87960d57..267da7a3 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java index 089be53c..9f03fd94 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java index 016ee221..e7b0522d 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java index 83d9e895..a46f1cd5 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java index 2b346779..eb4cb02f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java index e978c45f..5aadde23 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 9c0f579c..22a7770f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java index ab9bbecc..a9fd1ece 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java index 7cc02cb0..df4d13b8 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index fca531e7..deda6b06 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,11 +35,11 @@ public class GetTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetTransformationBetaOutput data; + private GetTransformationV1Output data; public GetTransformation200Response() {} - public GetTransformation200Response data(GetTransformationBetaOutput data) { + public GetTransformation200Response data(GetTransformationV1Output data) { this.data = data; return this; @@ -52,11 +52,11 @@ public GetTransformation200Response data(GetTransformationBetaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public GetTransformationBetaOutput getData() { + public GetTransformationV1Output getData() { return data; } - public void setData(GetTransformationBetaOutput data) { + public void setData(GetTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java new file mode 100644 index 00000000..8aca9fc4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java @@ -0,0 +1,213 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input of Transformation retrieval. */ +@ApiModel(description = "The input of Transformation retrieval.") +public class GetTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + + public GetTransformationBetaInput() {} + + public GetTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * The Transformation id. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Transformation id.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationBetaInput getTransformationBetaInput = (GetTransformationBetaInput) o; + return Objects.equals(this.transformationId, getTransformationBetaInput.transformationId); + } + + @Override + public int hashCode() { + return Objects.hash(transformationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformationId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationBetaInput is not" + + " found in the empty JSON string", + GetTransformationBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationBetaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaInput + */ + public static GetTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationBetaInput.class); + } + + /** + * Convert an instance of GetTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java index 1c867754..2d910db0 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java new file mode 100644 index 00000000..0a5bd6e8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of Transformation retrieval. */ +@ApiModel(description = "The output of Transformation retrieval.") +public class GetTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation3 transformation; + + public GetTransformationV1Output() {} + + public GetTransformationV1Output transformation(Transformation3 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation3 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation3 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationV1Output getTransformationV1Output = (GetTransformationV1Output) o; + return Objects.equals(this.transformation, getTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationV1Output is not found" + + " in the empty JSON string", + GetTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to GetTransformationV1Output + */ + public static GetTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationV1Output.class); + } + + /** + * Convert an instance of GetTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetUser200Response.java b/src/main/java/com/segment/publicapi/models/GetUser200Response.java index 71df8830..7b95e17f 100644 --- a/src/main/java/com/segment/publicapi/models/GetUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUser200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java index 89208576..0a251734 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java index 22ecbd17..74c7a832 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java index ccdcb8b2..02befe03 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java index 1baedb8f..70c4c223 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java index e62895da..3daa0d1f 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java index 9b7810bb..4b3d4ba3 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java index 7ee39c4f..9f6628e3 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java index a2fc1d68..dc1f5f93 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java index 1ec751df..08420ef4 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java index 9c7fa5ac..7d34359e 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java index a5ea6bf8..549fe0de 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Group.java b/src/main/java/com/segment/publicapi/models/Group.java index 6b888c88..0893f22c 100644 --- a/src/main/java/com/segment/publicapi/models/Group.java +++ b/src/main/java/com/segment/publicapi/models/Group.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java index 0cd0ac6e..516bb459 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Identify.java b/src/main/java/com/segment/publicapi/models/Identify.java index 82f093f7..e2e45945 100644 --- a/src/main/java/com/segment/publicapi/models/Identify.java +++ b/src/main/java/com/segment/publicapi/models/Identify.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java index c2b665f3..b074dad6 100644 --- a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Input.java b/src/main/java/com/segment/publicapi/models/Input.java index 76b971c9..fd85822f 100644 --- a/src/main/java/com/segment/publicapi/models/Input.java +++ b/src/main/java/com/segment/publicapi/models/Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java index 9ff65ea1..cde60006 100644 --- a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java +++ b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java index c6dfa004..394f2e37 100644 --- a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InviteV1.java b/src/main/java/com/segment/publicapi/models/InviteV1.java index fd748d0e..a8718132 100644 --- a/src/main/java/com/segment/publicapi/models/InviteV1.java +++ b/src/main/java/com/segment/publicapi/models/InviteV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label.java b/src/main/java/com/segment/publicapi/models/Label.java index 68e30717..1f454b6b 100644 --- a/src/main/java/com/segment/publicapi/models/Label.java +++ b/src/main/java/com/segment/publicapi/models/Label.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label1.java b/src/main/java/com/segment/publicapi/models/Label1.java index 82f1a254..02f093f3 100644 --- a/src/main/java/com/segment/publicapi/models/Label1.java +++ b/src/main/java/com/segment/publicapi/models/Label1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label2.java b/src/main/java/com/segment/publicapi/models/Label2.java index 0d9ed2ff..f89c3b64 100644 --- a/src/main/java/com/segment/publicapi/models/Label2.java +++ b/src/main/java/com/segment/publicapi/models/Label2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelAlpha.java b/src/main/java/com/segment/publicapi/models/LabelAlpha.java index 3df466a2..fbbbda2e 100644 --- a/src/main/java/com/segment/publicapi/models/LabelAlpha.java +++ b/src/main/java/com/segment/publicapi/models/LabelAlpha.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelV1.java b/src/main/java/com/segment/publicapi/models/LabelV1.java index 7b509730..5221b8c2 100644 --- a/src/main/java/com/segment/publicapi/models/LabelV1.java +++ b/src/main/java/com/segment/publicapi/models/LabelV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java index 6bfb7921..44d1d288 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java index 6f2c935e..55d510ec 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java index b8cb7ee8..b7fe768d 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java index fd53e4b9..6578f93b 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java index 8d3dc81d..d89ef1ab 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java index a17ff9ed..7b833e70 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java index 131e74da..d62b6fd3 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java index b3f73ffe..ef9e949d 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java index 88d862f1..ff3cc535 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java index 1c7655cb..f3dae7b2 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java index e42153bb..ed4deb09 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java index 9984ebd8..1caec0fb 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java index 630d3751..e87a0d34 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java index 6ab4630e..9c4e406e 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java index 9d7f0680..d6de1745 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java index 71bb2da0..42a8541a 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java index 58e6fdd8..456802ef 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java index 3f5f8e3e..d0fbcb54 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index dfba276b..5bcf4f7b 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java index 7489c2a6..ed1b6a02 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java index 955d4afe..86f3e0d1 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java index ce0bca4e..2ef61038 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java index aae0ae68..5be4a55b 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java index ae654f79..743bd997 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java index 6d144c1e..76cb12ec 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java index 01a82068..470dfae4 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java index 46300910..fc0ad059 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java index 08c07ecd..e493e8a3 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java index d7c11d74..7ca3023a 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java index 85882dfb..6eb2227c 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java index 3dd31b22..c15e34e9 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java index d968c251..12444121 100644 --- a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java index a0af4fb3..b94c0009 100644 --- a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java index d741d83b..c57a8dd9 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java index c76ac938..1224f80e 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java index 7e9679a8..5d501ef9 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java index 4776daef..fba707f6 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java index 8f33a90f..e7ac5fb1 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java index a501c2ed..759cecc1 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response.java b/src/main/java/com/segment/publicapi/models/ListSources200Response.java index aa5f1786..edb11c47 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java index fec2465b..dfc2fa36 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java index 90cba01a..e727735a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java index e1e9768a..acf6c75a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java index 7cf332b1..c1d2a4b8 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java index 70694013..c98c6532 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java index 1e5577c2..0ca06e79 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java index 987ed800..fd15e745 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java index bcf88cdf..00107646 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java index b39d1eab..fcb35146 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java index 2a95ca18..e64fdce6 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java index e9323326..73cfe2e9 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java index 11749179..34cfbf67 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java index 7a9506e0..f575cfdb 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java index 8c3a6b83..aebbfe7b 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java index 95ca8105..7689ac75 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index 84d1efb7..96b6c1d1 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,11 +35,11 @@ public class ListTransformations200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListTransformationsBetaOutput data; + private ListTransformationsV1Output data; public ListTransformations200Response() {} - public ListTransformations200Response data(ListTransformationsBetaOutput data) { + public ListTransformations200Response data(ListTransformationsV1Output data) { this.data = data; return this; @@ -52,11 +52,11 @@ public ListTransformations200Response data(ListTransformationsBetaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ListTransformationsBetaOutput getData() { + public ListTransformationsV1Output getData() { return data; } - public void setData(ListTransformationsBetaOutput data) { + public void setData(ListTransformationsV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java new file mode 100644 index 00000000..ed3d8af0 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists the Transformations associated with the current Workspace. */ +@ApiModel(description = "Lists the Transformations associated with the current Workspace.") +public class ListTransformationsBetaInput { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination1 pagination; + + public ListTransformationsBetaInput() {} + + public ListTransformationsBetaInput pagination(Pagination1 pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination1 getPagination() { + return pagination; + } + + public void setPagination(Pagination1 pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTransformationsBetaInput listTransformationsBetaInput = + (ListTransformationsBetaInput) o; + return Objects.equals(this.pagination, listTransformationsBetaInput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTransformationsBetaInput {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListTransformationsBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListTransformationsBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListTransformationsBetaInput is not" + + " found in the empty JSON string", + ListTransformationsBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListTransformationsBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListTransformationsBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTransformationsBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTransformationsBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTransformationsBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListTransformationsBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTransformationsBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTransformationsBetaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListTransformationsBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTransformationsBetaInput + * @throws IOException if the JSON string is invalid with respect to + * ListTransformationsBetaInput + */ + public static ListTransformationsBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTransformationsBetaInput.class); + } + + /** + * Convert an instance of ListTransformationsBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java index c5fd25ec..c4407ea9 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java new file mode 100644 index 00000000..efb9e974 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java @@ -0,0 +1,255 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists the Transformations associated with the current Workspace. */ +@ApiModel(description = "Lists the Transformations associated with the current Workspace.") +public class ListTransformationsV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATIONS = "transformations"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATIONS) + private List transformations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListTransformationsV1Output() {} + + public ListTransformationsV1Output transformations(List transformations) { + + this.transformations = transformations; + return this; + } + + public ListTransformationsV1Output addTransformationsItem( + TransformationV1 transformationsItem) { + this.transformations.add(transformationsItem); + return this; + } + + /** + * A paginated list of Transformations. + * + * @return transformations + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A paginated list of Transformations.") + public List getTransformations() { + return transformations; + } + + public void setTransformations(List transformations) { + this.transformations = transformations; + } + + public ListTransformationsV1Output pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTransformationsV1Output listTransformationsV1Output = (ListTransformationsV1Output) o; + return Objects.equals(this.transformations, listTransformationsV1Output.transformations) + && Objects.equals(this.pagination, listTransformationsV1Output.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(transformations, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTransformationsV1Output {\n"); + sb.append(" transformations: ").append(toIndentedString(transformations)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformations"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformations"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListTransformationsV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListTransformationsV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListTransformationsV1Output is not" + + " found in the empty JSON string", + ListTransformationsV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListTransformationsV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListTransformationsV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTransformationsV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("transformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("transformations").toString())); + } + + JsonArray jsonArraytransformations = jsonObj.getAsJsonArray("transformations"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTransformationsV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTransformationsV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListTransformationsV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTransformationsV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTransformationsV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListTransformationsV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTransformationsV1Output + * @throws IOException if the JSON string is invalid with respect to ListTransformationsV1Output + */ + public static ListTransformationsV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTransformationsV1Output.class); + } + + /** + * Convert an instance of ListTransformationsV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java index fa89dd2f..95debab8 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java index 48b41f34..7c65670a 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java index ad32546e..dc95c2cd 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java index d4e3784e..040ba58f 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java index e46ba650..de02b396 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java index 2910f2dc..87e4e374 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java index 89719a06..557ab0c8 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java index 312c4e48..fd33b869 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java index e86a6e5c..314551ce 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java index 836aa581..08a26cd8 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java index d0ac7ba4..a960024c 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java index 86e78eaa..257361bd 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos.java b/src/main/java/com/segment/publicapi/models/Logos.java index d174f434..0d8ef99b 100644 --- a/src/main/java/com/segment/publicapi/models/Logos.java +++ b/src/main/java/com/segment/publicapi/models/Logos.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos1.java b/src/main/java/com/segment/publicapi/models/Logos1.java index 57199ee6..5ccd2450 100644 --- a/src/main/java/com/segment/publicapi/models/Logos1.java +++ b/src/main/java/com/segment/publicapi/models/Logos1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos2.java b/src/main/java/com/segment/publicapi/models/Logos2.java index 6c285023..ef026e8a 100644 --- a/src/main/java/com/segment/publicapi/models/Logos2.java +++ b/src/main/java/com/segment/publicapi/models/Logos2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LogosBeta.java b/src/main/java/com/segment/publicapi/models/LogosBeta.java index 1b396acf..3d6b8e18 100644 --- a/src/main/java/com/segment/publicapi/models/LogosBeta.java +++ b/src/main/java/com/segment/publicapi/models/LogosBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 4e696e94..2bdd10f2 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java index 90f5fe50..b4350b5d 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index ce9dcd3f..86dbeb4b 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata.java b/src/main/java/com/segment/publicapi/models/Metadata.java index 241a95d4..a5cb4fec 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata.java +++ b/src/main/java/com/segment/publicapi/models/Metadata.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata1.java b/src/main/java/com/segment/publicapi/models/Metadata1.java index 8e700d48..ef6a58bf 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata1.java +++ b/src/main/java/com/segment/publicapi/models/Metadata1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata2.java b/src/main/java/com/segment/publicapi/models/Metadata2.java index c3ef11e6..c51f457f 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata2.java +++ b/src/main/java/com/segment/publicapi/models/Metadata2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MetricBeta.java b/src/main/java/com/segment/publicapi/models/MetricBeta.java index f4a5ca3a..a0b44175 100644 --- a/src/main/java/com/segment/publicapi/models/MetricBeta.java +++ b/src/main/java/com/segment/publicapi/models/MetricBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java index aa5f43bc..03dc71fb 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java index f8f29c0a..fa7bb722 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java index 7113ddaf..6553b9cc 100644 --- a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination.java b/src/main/java/com/segment/publicapi/models/Pagination.java index 69abe9c6..a56fa9d3 100644 --- a/src/main/java/com/segment/publicapi/models/Pagination.java +++ b/src/main/java/com/segment/publicapi/models/Pagination.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination1.java b/src/main/java/com/segment/publicapi/models/Pagination1.java new file mode 100644 index 00000000..abf60d0b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Pagination1.java @@ -0,0 +1,250 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Pagination options. */ +@ApiModel(description = "Pagination options.") +public class Pagination1 { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public Pagination1() {} + + public Pagination1 cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The page to request. Acceptable values to use here are in PaginationOutput" + + " objects, in the `current`, `next`, and `previous` keys. Consumers of" + + " the API must treat this value as opaque.") + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public Pagination1 count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The number of items to retrieve in a page, between 1 and 200.") + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pagination1 pagination1 = (Pagination1) o; + return Objects.equals(this.cursor, pagination1.cursor) + && Objects.equals(this.count, pagination1.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pagination1 {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pagination1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Pagination1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Pagination1 is not found in the empty" + + " JSON string", + Pagination1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pagination1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Pagination1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pagination1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pagination1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pagination1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Pagination1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Pagination1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pagination1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Pagination1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pagination1 + * @throws IOException if the JSON string is invalid with respect to Pagination1 + */ + public static Pagination1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pagination1.class); + } + + /** + * Convert an instance of Pagination1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PaginationInput.java b/src/main/java/com/segment/publicapi/models/PaginationInput.java index d059edba..dfc2e912 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationInput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PaginationOutput.java b/src/main/java/com/segment/publicapi/models/PaginationOutput.java index 4684b10b..5f3740d2 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationOutput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java index 15582f10..486d9e3e 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java index 1f5a55e9..24fd5de5 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionV1.java b/src/main/java/com/segment/publicapi/models/PermissionV1.java index 224afaf2..c78098f0 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java index 184e4d43..b62b0f1c 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java index d25446f4..6b5c34ec 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java index 7d8436f4..ba393a8d 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java index 924ac4b7..d7224f00 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java index e80d5605..4c74c06f 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java new file mode 100644 index 00000000..5cd64b58 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java @@ -0,0 +1,247 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyRenameV1 */ +public class PropertyRenameV1 { + public static final String SERIALIZED_NAME_OLD_NAME = "oldName"; + + @SerializedName(SERIALIZED_NAME_OLD_NAME) + private String oldName; + + public static final String SERIALIZED_NAME_NEW_NAME = "newName"; + + @SerializedName(SERIALIZED_NAME_NEW_NAME) + private String newName; + + public PropertyRenameV1() {} + + public PropertyRenameV1 oldName(String oldName) { + + this.oldName = oldName; + return this; + } + + /** + * The old name of the property. + * + * @return oldName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The old name of the property.") + public String getOldName() { + return oldName; + } + + public void setOldName(String oldName) { + this.oldName = oldName; + } + + public PropertyRenameV1 newName(String newName) { + + this.newName = newName; + return this; + } + + /** + * The new name to rename the property. + * + * @return newName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new name to rename the property.") + public String getNewName() { + return newName; + } + + public void setNewName(String newName) { + this.newName = newName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyRenameV1 propertyRenameV1 = (PropertyRenameV1) o; + return Objects.equals(this.oldName, propertyRenameV1.oldName) + && Objects.equals(this.newName, propertyRenameV1.newName); + } + + @Override + public int hashCode() { + return Objects.hash(oldName, newName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyRenameV1 {\n"); + sb.append(" oldName: ").append(toIndentedString(oldName)).append("\n"); + sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("oldName"); + openapiFields.add("newName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("oldName"); + openapiRequiredFields.add("newName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PropertyRenameV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyRenameV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyRenameV1 is not found in the" + + " empty JSON string", + PropertyRenameV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyRenameV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyRenameV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyRenameV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("oldName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `oldName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("oldName").toString())); + } + if (!jsonObj.get("newName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("newName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyRenameV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyRenameV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PropertyRenameV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyRenameV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyRenameV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyRenameV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyRenameV1 + * @throws IOException if the JSON string is invalid with respect to PropertyRenameV1 + */ + public static PropertyRenameV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyRenameV1.class); + } + + /** + * Convert an instance of PropertyRenameV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java index ac088992..774537d1 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java new file mode 100644 index 00000000..a36882f6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java @@ -0,0 +1,267 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyValueTransformationV1 */ +public class PropertyValueTransformationV1 { + public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) + private List propertyPaths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) + private String propertyValue; + + public PropertyValueTransformationV1() {} + + public PropertyValueTransformationV1 propertyPaths(List propertyPaths) { + + this.propertyPaths = propertyPaths; + return this; + } + + public PropertyValueTransformationV1 addPropertyPathsItem(String propertyPathsItem) { + this.propertyPaths.add(propertyPathsItem); + return this; + } + + /** + * The property paths. The maximum number of paths is 10. + * + * @return propertyPaths + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The property paths. The maximum number of paths is 10.") + public List getPropertyPaths() { + return propertyPaths; + } + + public void setPropertyPaths(List propertyPaths) { + this.propertyPaths = propertyPaths; + } + + public PropertyValueTransformationV1 propertyValue(String propertyValue) { + + this.propertyValue = propertyValue; + return this; + } + + /** + * The new value of the property paths. + * + * @return propertyValue + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new value of the property paths.") + public String getPropertyValue() { + return propertyValue; + } + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyValueTransformationV1 propertyValueTransformationV1 = + (PropertyValueTransformationV1) o; + return Objects.equals(this.propertyPaths, propertyValueTransformationV1.propertyPaths) + && Objects.equals(this.propertyValue, propertyValueTransformationV1.propertyValue); + } + + @Override + public int hashCode() { + return Objects.hash(propertyPaths, propertyValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyValueTransformationV1 {\n"); + sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); + sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("propertyPaths"); + openapiFields.add("propertyValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("propertyPaths"); + openapiRequiredFields.add("propertyValue"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * PropertyValueTransformationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyValueTransformationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyValueTransformationV1 is not" + + " found in the empty JSON string", + PropertyValueTransformationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyValueTransformationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyValueTransformationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyValueTransformationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("propertyPaths") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("propertyPaths").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyPaths` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyPaths").toString())); + } + if (!jsonObj.get("propertyValue").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValue` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("propertyValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyValueTransformationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyValueTransformationV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(PropertyValueTransformationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyValueTransformationV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyValueTransformationV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyValueTransformationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyValueTransformationV1 + * @throws IOException if the JSON string is invalid with respect to + * PropertyValueTransformationV1 + */ + public static PropertyValueTransformationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyValueTransformationV1.class); + } + + /** + * Convert an instance of PropertyValueTransformationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index f9d6caa2..00f6bd09 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index 38289fc3..59806fa8 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java index c22cddb5..4ee7547d 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java index b3a4f318..1ec6f866 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java index 0f931ed6..ffe5109f 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java index eab764f8..ff99b6c4 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java index 2f2e8cb1..c75d4eda 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java index 3e8c4b5c..d9c55f80 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java index 20c7b1b8..682045dc 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java index c6ca4f71..faf6dc76 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java index 87ae79f0..fa49ac97 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java index 4641c805..cabfefec 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java index e72b604e..24405d2d 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java index a07510e4..e35ea058 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java index 6fa44d64..471ca6c8 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java index 9a569836..52e78383 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java index ffda4eca..fedaf8e7 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java index 3bdd7971..ce9057c3 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java index 3a9dbafd..34b596ca 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java index 0f6bd5f5..ef4344bb 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java index 7dc6fa1b..2444bb7a 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java index d72291fd..495cc5b6 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java index 5aeb7d4b..8c8dbeb7 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java index ec6c7c97..172fca8e 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java index 51264026..a0c58eba 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java index 58a5c5a8..80e7ec9f 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java index 9379d607..ac81cb97 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java index 75eeeaae..fe2fd8f8 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java index f0547808..24394df9 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java index 199a0d66..cdb983a7 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java index c2192160..2092bb63 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java index be947993..08bfc8a1 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java index 51b17f27..f4d83159 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java index 9e12c65d..30874c08 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java index 9e225d14..7ebc7495 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java index 7b93e94c..0641b46b 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java index 838c1f8d..9955bd13 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java index 2b16e2a6..69ecdebf 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java index f1546d1d..00180ee7 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestError.java b/src/main/java/com/segment/publicapi/models/RequestError.java index fc20d87b..0dc67630 100644 --- a/src/main/java/com/segment/publicapi/models/RequestError.java +++ b/src/main/java/com/segment/publicapi/models/RequestError.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java index 94319be1..bd4ea73d 100644 --- a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java +++ b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ResourceV1.java b/src/main/java/com/segment/publicapi/models/ResourceV1.java index 57370dca..49e1ae5e 100644 --- a/src/main/java/com/segment/publicapi/models/ResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/ResourceV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RoleV1.java b/src/main/java/com/segment/publicapi/models/RoleV1.java index 3b7b374b..159964db 100644 --- a/src/main/java/com/segment/publicapi/models/RoleV1.java +++ b/src/main/java/com/segment/publicapi/models/RoleV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index b772b8ce..568ee640 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule.java b/src/main/java/com/segment/publicapi/models/Schedule.java index 0c2e2fe0..5bc265db 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule.java +++ b/src/main/java/com/segment/publicapi/models/Schedule.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule1.java b/src/main/java/com/segment/publicapi/models/Schedule1.java index a25ee1b4..3711ae76 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule1.java +++ b/src/main/java/com/segment/publicapi/models/Schedule1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule2.java b/src/main/java/com/segment/publicapi/models/Schedule2.java index b54be464..f9713346 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule2.java +++ b/src/main/java/com/segment/publicapi/models/Schedule2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings.java b/src/main/java/com/segment/publicapi/models/Settings.java index 03ead8fd..8ceeb89d 100644 --- a/src/main/java/com/segment/publicapi/models/Settings.java +++ b/src/main/java/com/segment/publicapi/models/Settings.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings1.java b/src/main/java/com/segment/publicapi/models/Settings1.java index d842d4c0..732b8493 100644 --- a/src/main/java/com/segment/publicapi/models/Settings1.java +++ b/src/main/java/com/segment/publicapi/models/Settings1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source.java b/src/main/java/com/segment/publicapi/models/Source.java index 4a02c417..11289a1d 100644 --- a/src/main/java/com/segment/publicapi/models/Source.java +++ b/src/main/java/com/segment/publicapi/models/Source.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source1.java b/src/main/java/com/segment/publicapi/models/Source1.java index 0321a2a7..ec5cf77a 100644 --- a/src/main/java/com/segment/publicapi/models/Source1.java +++ b/src/main/java/com/segment/publicapi/models/Source1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source2.java b/src/main/java/com/segment/publicapi/models/Source2.java index 0aae9f5a..457fbf33 100644 --- a/src/main/java/com/segment/publicapi/models/Source2.java +++ b/src/main/java/com/segment/publicapi/models/Source2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source3.java b/src/main/java/com/segment/publicapi/models/Source3.java index 05017d6f..dc620798 100644 --- a/src/main/java/com/segment/publicapi/models/Source3.java +++ b/src/main/java/com/segment/publicapi/models/Source3.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source4.java b/src/main/java/com/segment/publicapi/models/Source4.java index b1dfd53c..bbbd5815 100644 --- a/src/main/java/com/segment/publicapi/models/Source4.java +++ b/src/main/java/com/segment/publicapi/models/Source4.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source5.java b/src/main/java/com/segment/publicapi/models/Source5.java index 4cf522d2..48327f26 100644 --- a/src/main/java/com/segment/publicapi/models/Source5.java +++ b/src/main/java/com/segment/publicapi/models/Source5.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source6.java b/src/main/java/com/segment/publicapi/models/Source6.java index d9c2b851..b79f4b68 100644 --- a/src/main/java/com/segment/publicapi/models/Source6.java +++ b/src/main/java/com/segment/publicapi/models/Source6.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java index 8a3e9488..df2b3f3b 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAlpha.java b/src/main/java/com/segment/publicapi/models/SourceAlpha.java index 3ba90967..f0220886 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAlpha.java +++ b/src/main/java/com/segment/publicapi/models/SourceAlpha.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java index 1f97b7c3..fd3a5e3b 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index e51e4f6f..6104efd6 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadata.java b/src/main/java/com/segment/publicapi/models/SourceMetadata.java index 9778477c..d5607e03 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadata.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadata.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java index 827345b7..0a251bf4 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java index bb18a609..b788c663 100644 --- a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceV1.java b/src/main/java/com/segment/publicapi/models/SourceV1.java index 66a4a8ae..fb7acdc5 100644 --- a/src/main/java/com/segment/publicapi/models/SourceV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 2a8f3697..2cfa897d 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java index 8f42fee8..305a18d2 100644 --- a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Subscription.java b/src/main/java/com/segment/publicapi/models/Subscription.java index 223e8fb8..6e78ea2c 100644 --- a/src/main/java/com/segment/publicapi/models/Subscription.java +++ b/src/main/java/com/segment/publicapi/models/Subscription.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java index ab32d651..ac30bc59 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java +++ b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedMethods.java b/src/main/java/com/segment/publicapi/models/SupportedMethods.java index 2b31c478..170bc298 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedMethods.java +++ b/src/main/java/com/segment/publicapi/models/SupportedMethods.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java index 87cf8881..e23bfe1a 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java +++ b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SuppressedInner.java b/src/main/java/com/segment/publicapi/models/SuppressedInner.java index 204dbe4d..862dfbc3 100644 --- a/src/main/java/com/segment/publicapi/models/SuppressedInner.java +++ b/src/main/java/com/segment/publicapi/models/SuppressedInner.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java index 7f480c09..411ab127 100644 --- a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncV1.java b/src/main/java/com/segment/publicapi/models/SyncV1.java index b5da4fa5..8cabb9b2 100644 --- a/src/main/java/com/segment/publicapi/models/SyncV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Track.java b/src/main/java/com/segment/publicapi/models/Track.java index 50cd5208..f6a6c414 100644 --- a/src/main/java/com/segment/publicapi/models/Track.java +++ b/src/main/java/com/segment/publicapi/models/Track.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java index 60e212a2..9f9a8eaf 100644 --- a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index a8544ca0..ed495608 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 2ff89148..4a341b44 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index 3b56f019..849ab7f0 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index 83c6f1ef..302fe842 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index 7ef47dcd..6da8cc1d 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index d992a6bf..9d30e860 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java new file mode 100644 index 00000000..decff4b1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation3.java @@ -0,0 +1,571 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The retrieved Transformation. */ +@ApiModel(description = "The retrieved Transformation.") +public class Transformation3 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation3() {} + + public Transformation3 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation3 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation3 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation3 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation3 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation3 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation3 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation3 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation3 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation3 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation3 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation3 transformation3 = (Transformation3) o; + return Objects.equals(this.id, transformation3.id) + && Objects.equals(this.name, transformation3.name) + && Objects.equals(this.sourceId, transformation3.sourceId) + && Objects.equals(this.destinationMetadataId, transformation3.destinationMetadataId) + && Objects.equals(this.enabled, transformation3.enabled) + && Objects.equals(this._if, transformation3._if) + && Objects.equals(this.newEventName, transformation3.newEventName) + && Objects.equals(this.propertyRenames, transformation3.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation3.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation3 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation3 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation3.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation3 is not found in the" + + " empty JSON string", + Transformation3.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation3.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation3` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation3.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation3.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation3 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation3 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation3 + * @throws IOException if the JSON string is invalid with respect to Transformation3 + */ + public static Transformation3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation3.class); + } + + /** + * Convert an instance of Transformation3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java new file mode 100644 index 00000000..2ef26454 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation4.java @@ -0,0 +1,571 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated Transformation. */ +@ApiModel(description = "The updated Transformation.") +public class Transformation4 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation4() {} + + public Transformation4 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation4 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation4 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation4 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation4 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation4 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation4 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation4 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation4 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation4 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation4 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation4 transformation4 = (Transformation4) o; + return Objects.equals(this.id, transformation4.id) + && Objects.equals(this.name, transformation4.name) + && Objects.equals(this.sourceId, transformation4.sourceId) + && Objects.equals(this.destinationMetadataId, transformation4.destinationMetadataId) + && Objects.equals(this.enabled, transformation4.enabled) + && Objects.equals(this._if, transformation4._if) + && Objects.equals(this.newEventName, transformation4.newEventName) + && Objects.equals(this.propertyRenames, transformation4.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation4.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation4 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation4 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation4.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation4 is not found in the" + + " empty JSON string", + Transformation4.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation4.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation4` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation4.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation4 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation4 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation4 + * @throws IOException if the JSON string is invalid with respect to Transformation4 + */ + public static Transformation4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation4.class); + } + + /** + * Convert an instance of Transformation4 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java new file mode 100644 index 00000000..db253056 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation5.java @@ -0,0 +1,571 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created Transformation. */ +@ApiModel(description = "The created Transformation.") +public class Transformation5 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation5() {} + + public Transformation5 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation5 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation5 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation5 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation5 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation5 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation5 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation5 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation5 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation5 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation5 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation5 transformation5 = (Transformation5) o; + return Objects.equals(this.id, transformation5.id) + && Objects.equals(this.name, transformation5.name) + && Objects.equals(this.sourceId, transformation5.sourceId) + && Objects.equals(this.destinationMetadataId, transformation5.destinationMetadataId) + && Objects.equals(this.enabled, transformation5.enabled) + && Objects.equals(this._if, transformation5._if) + && Objects.equals(this.newEventName, transformation5.newEventName) + && Objects.equals(this.propertyRenames, transformation5.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation5.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation5 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation5 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation5.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation5 is not found in the" + + " empty JSON string", + Transformation5.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation5.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation5` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation5.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation5.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation5' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation5.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation5 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation5 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation5 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation5 + * @throws IOException if the JSON string is invalid with respect to Transformation5 + */ + public static Transformation5 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation5.class); + } + + /** + * Convert an instance of Transformation5 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index b8d26be3..b703ad93 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java new file mode 100644 index 00000000..6a01f40a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -0,0 +1,572 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Represents a Transformation. */ +@ApiModel(description = "Represents a Transformation.") +public class TransformationV1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public TransformationV1() {} + + public TransformationV1 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TransformationV1 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TransformationV1 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public TransformationV1 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public TransformationV1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public TransformationV1 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public TransformationV1 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public TransformationV1 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public TransformationV1 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public TransformationV1 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public TransformationV1 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransformationV1 transformationV1 = (TransformationV1) o; + return Objects.equals(this.id, transformationV1.id) + && Objects.equals(this.name, transformationV1.name) + && Objects.equals(this.sourceId, transformationV1.sourceId) + && Objects.equals( + this.destinationMetadataId, transformationV1.destinationMetadataId) + && Objects.equals(this.enabled, transformationV1.enabled) + && Objects.equals(this._if, transformationV1._if) + && Objects.equals(this.newEventName, transformationV1.newEventName) + && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformationV1.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransformationV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransformationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransformationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TransformationV1 is not found in the" + + " empty JSON string", + TransformationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransformationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TransformationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransformationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransformationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransformationV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TransformationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TransformationV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransformationV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TransformationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransformationV1 + * @throws IOException if the JSON string is invalid with respect to TransformationV1 + */ + public static TransformationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransformationV1.class); + } + + /** + * Convert an instance of TransformationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java index 368b9a47..01e55e7d 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java index f7688976..6a12e4b6 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java index ae97feea..823fa7b2 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java index 0d89c349..ab14559c 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java index 8179f07b..a56daccc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java index 2340db10..748c57a5 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java index 5845d159..126642c3 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java index e1821f5b..abeca7fd 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java index 6ad1a3f5..c9098728 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java index 03b28a6b..4a500bbc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java index d1c0b670..3324cf86 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java index 70458ffd..25acb78b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java index 2c61e6c3..b0a012d5 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java index 8cb73ab4..02de7ce6 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java index 64942e05..871495a9 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java index 8b656a26..c4ccd372 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java index bf022e66..7df707ea 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java index f201a953..7e8b5512 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java index a57b64dc..d85e3abd 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java index 469a8712..f106162a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java index b4875f63..fbdd2a94 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java index ec912606..283ecdfa 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java index 9f2ba5eb..536aa695 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java index d4d29aed..b675f54b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java index 4dcb9805..f70e7a4a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java index 2f8301cb..64f6231b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java index 4ebff428..60320cfe 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java index 10aa7f5f..02f23ea4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java index f57d62d4..5886cfe9 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java index 5da1b391..41557f6d 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index 9cd0b3ac..f1f5a18b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,11 +35,11 @@ public class UpdateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private UpdateTransformationBetaOutput data; + private UpdateTransformationV1Output data; public UpdateTransformation200Response() {} - public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) { + public UpdateTransformation200Response data(UpdateTransformationV1Output data) { this.data = data; return this; @@ -52,11 +52,11 @@ public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public UpdateTransformationBetaOutput getData() { + public UpdateTransformationV1Output getData() { return data; } - public void setData(UpdateTransformationBetaOutput data) { + public void setData(UpdateTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 09c5f3d6..5bf8bba5 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,6 +37,11 @@ /** The input to update a Transformation. */ @ApiModel(description = "The input to update a Transformation.") public class UpdateTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -80,6 +85,27 @@ public class UpdateTransformationBetaInput { public UpdateTransformationBetaInput() {} + public UpdateTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * ID of the Transformation to update. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "ID of the Transformation to update.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + public UpdateTransformationBetaInput name(String name) { this.name = name; @@ -295,7 +321,8 @@ public boolean equals(Object o) { } UpdateTransformationBetaInput updateTransformationBetaInput = (UpdateTransformationBetaInput) o; - return Objects.equals(this.name, updateTransformationBetaInput.name) + return Objects.equals(this.transformationId, updateTransformationBetaInput.transformationId) + && Objects.equals(this.name, updateTransformationBetaInput.name) && Objects.equals(this.sourceId, updateTransformationBetaInput.sourceId) && Objects.equals( this.destinationMetadataId, @@ -313,6 +340,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + transformationId, name, sourceId, destinationMetadataId, @@ -327,6 +355,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" destinationMetadataId: ") @@ -360,6 +389,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("transformationId"); openapiFields.add("name"); openapiFields.add("sourceId"); openapiFields.add("destinationMetadataId"); @@ -371,6 +401,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); } /** @@ -403,6 +434,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java index 51f685c7..e4a96bb0 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java new file mode 100644 index 00000000..9c0d20b3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -0,0 +1,525 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input to update a Transformation. */ +@ApiModel(description = "The input to update a Transformation.") +public class UpdateTransformationV1Input { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public UpdateTransformationV1Input() {} + + public UpdateTransformationV1Input name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateTransformationV1Input sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The optional Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The optional Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public UpdateTransformationV1Input destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata to be associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public UpdateTransformationV1Input enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateTransformationV1Input _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public UpdateTransformationV1Input newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public UpdateTransformationV1Input propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public UpdateTransformationV1Input addPropertyRenamesItem( + PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public UpdateTransformationV1Input propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public UpdateTransformationV1Input addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTransformationV1Input updateTransformationV1Input = (UpdateTransformationV1Input) o; + return Objects.equals(this.name, updateTransformationV1Input.name) + && Objects.equals(this.sourceId, updateTransformationV1Input.sourceId) + && Objects.equals( + this.destinationMetadataId, + updateTransformationV1Input.destinationMetadataId) + && Objects.equals(this.enabled, updateTransformationV1Input.enabled) + && Objects.equals(this._if, updateTransformationV1Input._if) + && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) + && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + updateTransformationV1Input.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTransformationV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateTransformationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateTransformationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateTransformationV1Input is not" + + " found in the empty JSON string", + UpdateTransformationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateTransformationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTransformationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) + && !jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTransformationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateTransformationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTransformationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTransformationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTransformationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTransformationV1Input + * @throws IOException if the JSON string is invalid with respect to UpdateTransformationV1Input + */ + public static UpdateTransformationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Input.class); + } + + /** + * Convert an instance of UpdateTransformationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java new file mode 100644 index 00000000..78ba56e0 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * The version of the OpenAPI document: 32.0.8 + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of an updated Transformation. */ +@ApiModel(description = "The output of an updated Transformation.") +public class UpdateTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation4 transformation; + + public UpdateTransformationV1Output() {} + + public UpdateTransformationV1Output transformation(Transformation4 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation4 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation4 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTransformationV1Output updateTransformationV1Output = + (UpdateTransformationV1Output) o; + return Objects.equals(this.transformation, updateTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateTransformationV1Output is not" + + " found in the empty JSON string", + UpdateTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * UpdateTransformationV1Output + */ + public static UpdateTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Output.class); + } + + /** + * Convert an instance of UpdateTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java index aebd5b9d..01be1ab4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java index 5200073b..faf6af58 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java index b46a9a6f..de775fd9 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java index 940ebc1d..c66fda12 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java index e8f78aa8..d7399b64 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java index 07bd3d14..56f7ed0a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index 7d710a48..ae02494e 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/User.java b/src/main/java/com/segment/publicapi/models/User.java index 5c82c9f2..6dc39a9b 100644 --- a/src/main/java/com/segment/publicapi/models/User.java +++ b/src/main/java/com/segment/publicapi/models/User.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup.java b/src/main/java/com/segment/publicapi/models/UserGroup.java index 0796071b..82def187 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup1.java b/src/main/java/com/segment/publicapi/models/UserGroup1.java index cbf4b817..5f9a9539 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup2.java b/src/main/java/com/segment/publicapi/models/UserGroup2.java index 0ad3f8c2..ec55b9eb 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup2.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup3.java b/src/main/java/com/segment/publicapi/models/UserGroup3.java index 6b53f171..8c16e0d1 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup3.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup3.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroupV1.java b/src/main/java/com/segment/publicapi/models/UserGroupV1.java index d4af4c78..503eb7d8 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroupV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserV1.java b/src/main/java/com/segment/publicapi/models/UserV1.java index e40d2baf..b682ef7d 100644 --- a/src/main/java/com/segment/publicapi/models/UserV1.java +++ b/src/main/java/com/segment/publicapi/models/UserV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java index c30a12eb..a919db9f 100644 --- a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse.java b/src/main/java/com/segment/publicapi/models/Warehouse.java index 3a63705c..c6c994ac 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse1.java b/src/main/java/com/segment/publicapi/models/Warehouse1.java index 8dc818c0..c6bcfa79 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse1.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse2.java b/src/main/java/com/segment/publicapi/models/Warehouse2.java index 78741ed3..357d3533 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse2.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse2.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java index d386b6ce..3f1702f1 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java index 33fb22bd..623e4349 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java index cc714ab2..a1051cd7 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java index 45714ade..da294829 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java index 3f62dec9..f0cb95a8 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseV1.java b/src/main/java/com/segment/publicapi/models/WarehouseV1.java index d2d09fa5..0d24d400 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Workspace.java b/src/main/java/com/segment/publicapi/models/Workspace.java index 5ad8d2ee..2398311e 100644 --- a/src/main/java/com/segment/publicapi/models/Workspace.java +++ b/src/main/java/com/segment/publicapi/models/Workspace.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java index b7afa7e9..4a8c01ac 100644 --- a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java +++ b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java @@ -2,7 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 + * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). From 5169045a95b517c7146172de595930448ed72500 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Thu, 17 Nov 2022 22:27:23 +0000 Subject: [PATCH 013/474] Automated client deploy (from segmentio/public-api@edaa2a7) --- .github/workflows/maven.yml | 25 +++++++++++++++++++ README.md | 8 +++--- pom.xml | 10 ++++++-- .../com/segment/publicapi/ApiCallback.java | 1 - .../java/com/segment/publicapi/ApiClient.java | 3 +-- .../com/segment/publicapi/ApiException.java | 1 - .../com/segment/publicapi/ApiResponse.java | 1 - .../com/segment/publicapi/Configuration.java | 1 - .../publicapi/GzipRequestInterceptor.java | 1 - src/main/java/com/segment/publicapi/JSON.java | 1 - src/main/java/com/segment/publicapi/Pair.java | 1 - .../publicapi/ProgressRequestBody.java | 1 - .../publicapi/ProgressResponseBody.java | 1 - .../com/segment/publicapi/StringUtil.java | 1 - .../segment/publicapi/api/ApiCallsApi.java | 1 - .../segment/publicapi/api/AuditTrailApi.java | 1 - .../com/segment/publicapi/api/CatalogApi.java | 1 - .../api/DeletionAndSuppressionApi.java | 1 - .../publicapi/api/DestinationFiltersApi.java | 1 - .../publicapi/api/DestinationsApi.java | 1 - .../publicapi/api/EdgeFunctionsApi.java | 1 - .../com/segment/publicapi/api/EventsApi.java | 1 - .../segment/publicapi/api/FunctionsApi.java | 1 - .../segment/publicapi/api/IamGroupsApi.java | 1 - .../segment/publicapi/api/IamRolesApi.java | 1 - .../segment/publicapi/api/IamUsersApi.java | 1 - .../com/segment/publicapi/api/LabelsApi.java | 1 - .../publicapi/api/MonthlyTrackedUsersApi.java | 1 - .../publicapi/api/SelectiveSyncApi.java | 1 - .../com/segment/publicapi/api/SourcesApi.java | 1 - .../com/segment/publicapi/api/SpacesApi.java | 1 - .../com/segment/publicapi/api/TestingApi.java | 1 - .../publicapi/api/TrackingPlansApi.java | 1 - .../publicapi/api/TransformationsApi.java | 1 - .../segment/publicapi/api/WarehousesApi.java | 1 - .../segment/publicapi/api/WorkspacesApi.java | 1 - .../segment/publicapi/auth/ApiKeyAuth.java | 1 - .../publicapi/auth/Authentication.java | 1 - .../segment/publicapi/auth/HttpBasicAuth.java | 1 - .../publicapi/auth/HttpBearerAuth.java | 1 - .../publicapi/models/APICallSnapshotV1.java | 1 - .../models/AbstractOpenApiSchema.java | 1 - .../publicapi/models/AccessPermissionV1.java | 1 - ...ctionFromSourceToWarehouse200Response.java | 1 - ...nnectionFromSourceToWarehouseV1Output.java | 1 - .../models/AddLabelsToSource200Response.java | 1 - .../models/AddLabelsToSource200Response1.java | 1 - .../models/AddLabelsToSourceAlphaInput.java | 1 - .../models/AddLabelsToSourceAlphaOutput.java | 1 - .../models/AddLabelsToSourceV1Input.java | 1 - .../models/AddLabelsToSourceV1Output.java | 1 - .../AddPermissionsToUser200Response.java | 1 - .../AddPermissionsToUserGroup200Response.java | 1 - .../AddPermissionsToUserGroupV1Input.java | 1 - .../AddPermissionsToUserGroupV1Output.java | 1 - .../models/AddPermissionsToUserV1Input.java | 1 - .../models/AddPermissionsToUserV1Output.java | 1 - .../AddSourceToTrackingPlan200Response.java | 1 - .../AddSourceToTrackingPlanV1Input.java | 1 - .../AddSourceToTrackingPlanV1Output.java | 1 - .../AddUsersToUserGroup200Response.java | 1 - .../models/AddUsersToUserGroupV1Input.java | 1 - .../models/AddUsersToUserGroupV1Output.java | 1 - .../AdvancedWarehouseSyncScheduleV1Input.java | 1 - ...AdvancedWarehouseSyncScheduleV1Output.java | 1 - .../publicapi/models/AllowedLabelBeta.java | 1 - .../publicapi/models/AuditEventV1.java | 1 - ...agingSubscriptionsForSpace200Response.java | 1 - ...sagingSubscriptionsForSpaceAlphaInput.java | 1 - ...agingSubscriptionsForSpaceAlphaOutput.java | 1 - .../publicapi/models/BreakdownBeta.java | 1 - .../models/CommonSourceSettingsV1.java | 1 - .../com/segment/publicapi/models/Contact.java | 1 - ...reateCloudSourceRegulation200Response.java | 1 - .../CreateCloudSourceRegulationV1Input.java | 1 - .../CreateCloudSourceRegulationV1Output.java | 1 - .../models/CreateDestination200Response.java | 1 - ...ateDestinationSubscription200Response.java | 1 - ...eateDestinationSubscriptionAlphaInput.java | 1 - ...ateDestinationSubscriptionAlphaOutput.java | 1 - .../models/CreateDestinationV1Input.java | 1 - .../models/CreateDestinationV1Output.java | 1 - .../CreateEdgeFunctions200Response.java | 1 - .../models/CreateEdgeFunctionsAlphaInput.java | 1 - .../CreateEdgeFunctionsAlphaOutput.java | 1 - ...CreateFilterForDestination200Response.java | 1 - .../CreateFilterForDestinationV1Input.java | 1 - .../CreateFilterForDestinationV1Output.java | 1 - .../models/CreateFunction200Response.java | 1 - .../CreateFunctionDeployment200Response.java | 1 - .../CreateFunctionDeploymentV1Output.java | 1 - .../models/CreateFunctionV1Input.java | 1 - .../models/CreateFunctionV1Output.java | 1 - .../models/CreateInvites200Response.java | 1 - .../models/CreateInvitesV1Input.java | 1 - .../models/CreateInvitesV1Output.java | 1 - .../models/CreateLabel200Response.java | 1 - .../models/CreateLabel200Response1.java | 1 - .../models/CreateLabelAlphaInput.java | 1 - .../models/CreateLabelAlphaOutput.java | 1 - .../publicapi/models/CreateLabelV1Input.java | 1 - .../publicapi/models/CreateLabelV1Output.java | 1 - .../models/CreateSource200Response.java | 1 - .../models/CreateSource200Response1.java | 1 - .../models/CreateSourceAlphaInput.java | 1 - .../models/CreateSourceAlphaOutput.java | 1 - .../CreateSourceRegulation200Response.java | 1 - .../models/CreateSourceRegulationV1Input.java | 1 - .../CreateSourceRegulationV1Output.java | 1 - .../publicapi/models/CreateSourceV1Input.java | 1 - .../models/CreateSourceV1Output.java | 1 - .../models/CreateTrackingPlan200Response.java | 1 - .../models/CreateTrackingPlanV1Input.java | 1 - .../models/CreateTrackingPlanV1Output.java | 1 - .../CreateTransformation200Response.java | 1 - .../models/CreateTransformationBetaInput.java | 1 - .../CreateTransformationBetaOutput.java | 1 - .../models/CreateTransformationV1Input.java | 1 - .../models/CreateTransformationV1Output.java | 1 - .../models/CreateUserGroup200Response.java | 1 - .../models/CreateUserGroupV1Input.java | 1 - .../models/CreateUserGroupV1Output.java | 1 - ...reateValidationInWarehouse200Response.java | 1 - .../CreateValidationInWarehouseV1Input.java | 1 - .../CreateValidationInWarehouseV1Output.java | 1 - .../models/CreateWarehouse200Response.java | 1 - .../models/CreateWarehouseV1Input.java | 1 - .../models/CreateWarehouseV1Output.java | 1 - .../CreateWorkspaceRegulation200Response.java | 1 - .../CreateWorkspaceRegulationV1Input.java | 1 - .../CreateWorkspaceRegulationV1Output.java | 1 - .../models/DeleteDestination200Response.java | 1 - .../models/DeleteDestinationV1Output.java | 1 - .../models/DeleteFunction200Response.java | 1 - .../models/DeleteFunctionV1Output.java | 1 - .../models/DeleteInvites200Response.java | 1 - .../models/DeleteInvitesV1Output.java | 1 - .../models/DeleteLabel200Response.java | 1 - .../models/DeleteLabel200Response1.java | 1 - .../models/DeleteLabelAlphaOutput.java | 1 - .../publicapi/models/DeleteLabelV1Output.java | 1 - .../models/DeleteRegulation200Response.java | 1 - .../models/DeleteRegulationV1Output.java | 1 - .../models/DeleteSource200Response.java | 1 - .../models/DeleteSource200Response1.java | 1 - .../models/DeleteSourceAlphaOutput.java | 1 - .../models/DeleteSourceV1Output.java | 1 - .../models/DeleteTrackingPlan200Response.java | 1 - .../models/DeleteTrackingPlanV1Output.java | 1 - .../DeleteTransformation200Response.java | 1 - .../models/DeleteTransformationBetaInput.java | 1 - .../DeleteTransformationBetaOutput.java | 1 - .../models/DeleteTransformationV1Output.java | 1 - .../models/DeleteUserGroup200Response.java | 1 - .../models/DeleteUserGroupV1Output.java | 1 - .../models/DeleteUsers200Response.java | 1 - .../publicapi/models/DeleteUsersV1Output.java | 1 - .../models/DeleteWarehouse200Response.java | 1 - .../models/DeleteWarehouseV1Output.java | 1 - .../models/DeliveryMetricsSummary.java | 1 - .../models/DeliveryMetricsSummaryBeta.java | 1 - .../segment/publicapi/models/Destination.java | 1 - .../publicapi/models/Destination1.java | 1 - .../publicapi/models/Destination2.java | 1 - .../models/DestinationFilterActionV1.java | 1 - .../publicapi/models/DestinationFilterV1.java | 1 - .../publicapi/models/DestinationMetadata.java | 1 - .../DestinationMetadataActionFieldV1.java | 1 - .../models/DestinationMetadataActionV1.java | 1 - .../DestinationMetadataComponentV1.java | 1 - .../models/DestinationMetadataFeaturesV1.java | 1 - .../models/DestinationMetadataMethodsV1.java | 1 - .../DestinationMetadataPlatformsV1.java | 1 - ...stinationMetadataSubscriptionPresetV1.java | 1 - .../models/DestinationMetadataV1.java | 1 - .../publicapi/models/DestinationStatusV1.java | 1 - .../models/DestinationSubscription.java | 1 - .../DestinationSubscriptionUpdateInput.java | 1 - .../publicapi/models/DestinationV1.java | 1 - .../DisableEdgeFunctions200Response.java | 1 - .../DisableEdgeFunctionsAlphaOutput.java | 1 - .../publicapi/models/Echo200Response.java | 1 - .../publicapi/models/Echo200Response1.java | 1 - .../publicapi/models/EchoAlphaOutput.java | 1 - .../publicapi/models/EchoV1Output.java | 1 - .../publicapi/models/EdgeFunctions.java | 1 - .../publicapi/models/EdgeFunctions1.java | 1 - .../publicapi/models/EdgeFunctionsAlpha.java | 1 - .../publicapi/models/EventSourceV1.java | 1 - .../com/segment/publicapi/models/Filter.java | 1 - .../com/segment/publicapi/models/Filter1.java | 1 - .../com/segment/publicapi/models/Filter2.java | 1 - .../com/segment/publicapi/models/Filter3.java | 1 - .../segment/publicapi/models/Function.java | 1 - .../segment/publicapi/models/Function1.java | 1 - .../segment/publicapi/models/Function2.java | 1 - .../publicapi/models/FunctionDeployment.java | 1 - .../publicapi/models/FunctionSettingV1.java | 1 - .../segment/publicapi/models/FunctionV1.java | 1 - ...eUploadURLForEdgeFunctions200Response.java | 1 - ...eUploadURLForEdgeFunctionsAlphaOutput.java | 1 - ...dSyncScheduleFromWarehouse200Response.java | 1 - ...ncedSyncScheduleFromWarehouseV1Output.java | 1 - ...nnectionStateFromWarehouse200Response.java | 1 - ...tConnectionStateFromWarehouseV1Output.java | 1 - ...ailyPerSourceAPICallsUsage200Response.java | 1 - ...etDailyPerSourceAPICallsUsageV1Output.java | 1 - .../GetDailyPerSourceMTUUsage200Response.java | 1 - .../GetDailyPerSourceMTUUsageV1Output.java | 1 - ...ailyWorkspaceAPICallsUsage200Response.java | 1 - ...etDailyWorkspaceAPICallsUsageV1Output.java | 1 - .../GetDailyWorkspaceMTUUsage200Response.java | 1 - .../GetDailyWorkspaceMTUUsageV1Output.java | 1 - .../models/GetDestination200Response.java | 1 - .../GetDestinationMetadata200Response.java | 1 - .../GetDestinationMetadataV1Output.java | 1 - .../models/GetDestinationV1Output.java | 1 - .../GetDestinationsCatalog200Response.java | 1 - .../GetDestinationsCatalogV1Output.java | 1 - ...tEventsVolumeFromWorkspace200Response.java | 1 - .../GetEventsVolumeFromWorkspaceV1Output.java | 1 - .../GetFilterInDestination200Response.java | 1 - .../GetFilterInDestinationV1Output.java | 1 - .../models/GetFunction200Response.java | 1 - .../publicapi/models/GetFunctionV1Output.java | 1 - ...GetLatestFromEdgeFunctions200Response.java | 1 - ...GetLatestFromEdgeFunctionsAlphaOutput.java | 1 - ...tMessagingSubscriptionFailureResponse.java | 1 - ...tMessagingSubscriptionSuccessResponse.java | 1 - .../models/GetRegulation200Response.java | 1 - .../models/GetRegulationV1Output.java | 1 - .../models/GetSource200Response.java | 1 - .../models/GetSource200Response1.java | 1 - .../models/GetSourceAlphaOutput.java | 1 - .../models/GetSourceMetadata200Response.java | 1 - .../models/GetSourceMetadataV1Output.java | 1 - .../publicapi/models/GetSourceV1Output.java | 1 - .../models/GetSourcesCatalog200Response.java | 1 - .../models/GetSourcesCatalogV1Output.java | 1 - .../publicapi/models/GetSpace200Response.java | 1 - .../publicapi/models/GetSpaceAlphaOutput.java | 1 - ...ubscriptionFromDestination200Response.java | 1 - ...ubscriptionFromDestinationAlphaOutput.java | 1 - .../models/GetSubscriptionRequest.java | 1 - .../models/GetTrackingPlan200Response.java | 1 - .../models/GetTrackingPlanV1Output.java | 1 - .../models/GetTransformation200Response.java | 1 - .../models/GetTransformationBetaInput.java | 1 - .../models/GetTransformationBetaOutput.java | 1 - .../models/GetTransformationV1Output.java | 1 - .../publicapi/models/GetUser200Response.java | 1 - .../models/GetUserGroup200Response.java | 1 - .../models/GetUserGroupV1Output.java | 1 - .../publicapi/models/GetUserV1Output.java | 1 - .../models/GetWarehouse200Response.java | 1 - .../GetWarehouseMetadata200Response.java | 1 - .../models/GetWarehouseMetadataV1Output.java | 1 - .../models/GetWarehouseV1Output.java | 1 - .../GetWarehousesCatalog200Response.java | 1 - .../models/GetWarehousesCatalogV1Output.java | 1 - .../models/GetWorkspace200Response.java | 1 - .../models/GetWorkspaceV1Output.java | 1 - .../com/segment/publicapi/models/Group.java | 1 - .../models/GroupSourceSettingsV1.java | 1 - .../segment/publicapi/models/Identify.java | 1 - .../models/IdentifySourceSettingsV1.java | 1 - .../com/segment/publicapi/models/Input.java | 1 - .../models/IntegrationOptionBeta.java | 1 - .../publicapi/models/InvitePermissionV1.java | 1 - .../segment/publicapi/models/InviteV1.java | 1 - .../com/segment/publicapi/models/Label.java | 1 - .../com/segment/publicapi/models/Label1.java | 1 - .../com/segment/publicapi/models/Label2.java | 1 - .../segment/publicapi/models/LabelAlpha.java | 1 - .../com/segment/publicapi/models/LabelV1.java | 1 - .../models/ListAuditEvents200Response.java | 1 - .../models/ListAuditEventsV1Output.java | 1 - ...ctedDestinationsFromSource200Response.java | 1 - ...tedDestinationsFromSource200Response1.java | 1 - ...ctedDestinationsFromSourceAlphaOutput.java | 1 - ...nnectedDestinationsFromSourceV1Output.java | 1 - ...nectedSourcesFromWarehouse200Response.java | 1 - ...ConnectedSourcesFromWarehouseV1Output.java | 1 - ...nectedWarehousesFromSource200Response.java | 1 - ...ectedWarehousesFromSource200Response1.java | 1 - ...nectedWarehousesFromSourceAlphaOutput.java | 1 - ...ConnectedWarehousesFromSourceV1Output.java | 1 - ...ricsSummaryFromDestination200Response.java | 1 - ...tricsSummaryFromDestinationBetaOutput.java | 1 - .../models/ListDestinations200Response.java | 1 - .../models/ListDestinationsV1Output.java | 1 - ...ListFiltersFromDestination200Response.java | 1 - .../ListFiltersFromDestinationV1Output.java | 1 - .../publicapi/models/ListFunctionItemV1.java | 1 - .../models/ListFunctions200Response.java | 1 - .../models/ListFunctionsV1Output.java | 1 - .../models/ListInvites200Response.java | 1 - .../ListInvitesFromUserGroup200Response.java | 1 - .../ListInvitesFromUserGroupV1Output.java | 1 - .../publicapi/models/ListInvitesV1Output.java | 1 - .../models/ListLabels200Response.java | 1 - .../models/ListLabels200Response1.java | 1 - .../models/ListLabelsAlphaOutput.java | 1 - .../publicapi/models/ListLabelsV1Output.java | 1 - .../ListRegulationsFromSource200Response.java | 1 - .../ListRegulationsFromSourceV1Output.java | 1 - .../models/ListRoles200Response.java | 1 - .../publicapi/models/ListRolesV1Output.java | 1 - .../ListRulesFromTrackingPlan200Response.java | 1 - .../ListRulesFromTrackingPlanV1Output.java | 1 - ...ListSchemaSettingsInSource200Response.java | 1 - .../ListSchemaSettingsInSourceV1Output.java | 1 - ...yncsFromWarehouseAndSource200Response.java | 1 - ...veSyncsFromWarehouseAndSourceV1Output.java | 1 - .../models/ListSources200Response.java | 1 - .../models/ListSources200Response1.java | 1 - .../models/ListSourcesAlphaOutput.java | 1 - ...istSourcesFromTrackingPlan200Response.java | 1 - .../ListSourcesFromTrackingPlanV1Output.java | 1 - .../publicapi/models/ListSourcesV1Output.java | 1 - ...bscriptionsFromDestination200Response.java | 1 - ...bscriptionsFromDestinationAlphaOutput.java | 1 - .../models/ListSuppressions200Response.java | 1 - .../models/ListSuppressionsV1Output.java | 1 - .../ListSyncsFromWarehouse200Response.java | 1 - ...yncsFromWarehouseAndSource200Response.java | 1 - ...stSyncsFromWarehouseAndSourceV1Output.java | 1 - .../ListSyncsFromWarehouseV1Output.java | 1 - .../models/ListTrackingPlans200Response.java | 1 - .../models/ListTrackingPlansV1Output.java | 1 - .../ListTransformations200Response.java | 1 - .../models/ListTransformationsBetaInput.java | 1 - .../models/ListTransformationsBetaOutput.java | 1 - .../models/ListTransformationsV1Output.java | 1 - .../models/ListUserGroups200Response.java | 1 - .../ListUserGroupsFromUser200Response.java | 1 - .../ListUserGroupsFromUserV1Output.java | 1 - .../models/ListUserGroupsV1Output.java | 1 - .../models/ListUsers200Response.java | 1 - .../ListUsersFromUserGroup200Response.java | 1 - .../ListUsersFromUserGroupV1Output.java | 1 - .../publicapi/models/ListUsersV1Output.java | 1 - .../models/ListWarehouses200Response.java | 1 - .../models/ListWarehousesV1Output.java | 1 - .../ListWorkspaceRegulations200Response.java | 1 - .../ListWorkspaceRegulationsV1Output.java | 1 - .../com/segment/publicapi/models/Logos.java | 1 - .../com/segment/publicapi/models/Logos1.java | 1 - .../com/segment/publicapi/models/Logos2.java | 1 - .../segment/publicapi/models/LogosBeta.java | 1 - .../models/MessageSubscriptionResponse.java | 1 - .../MessageSubscriptionResponseError.java | 1 - .../models/MessagesSubscriptionRequest.java | 1 - .../segment/publicapi/models/Metadata.java | 1 - .../segment/publicapi/models/Metadata1.java | 1 - .../segment/publicapi/models/Metadata2.java | 1 - .../segment/publicapi/models/MetricBeta.java | 1 - .../publicapi/models/MinimalUserGroupV1.java | 1 - .../publicapi/models/MinimalUserV1.java | 1 - .../publicapi/models/MtuSnapshotV1.java | 1 - .../segment/publicapi/models/Pagination.java | 1 - .../segment/publicapi/models/Pagination1.java | 1 - .../publicapi/models/PaginationInput.java | 1 - .../publicapi/models/PaginationOutput.java | 1 - .../publicapi/models/PermissionInputV1.java | 1 - .../models/PermissionResourceV1.java | 1 - .../publicapi/models/PermissionV1.java | 1 - .../PreviewDestinationFilter200Response.java | 1 - .../models/PreviewDestinationFilterV1.java | 1 - .../PreviewDestinationFilterV1Input.java | 1 - .../PreviewDestinationFilterV1Output.java | 1 - .../publicapi/models/PropertyRenameBeta.java | 1 - .../publicapi/models/PropertyRenameV1.java | 1 - .../PropertyValueTransformationBeta.java | 1 - .../models/PropertyValueTransformationV1.java | 1 - .../segment/publicapi/models/Regulation.java | 1 - .../models/RegulationListEntryV1.java | 1 - ...emoveFilterFromDestination200Response.java | 1 - .../RemoveFilterFromDestinationV1Output.java | 1 - .../publicapi/models/RemoveRuleV1.java | 1 - ...emoveRulesFromTrackingPlan200Response.java | 1 - .../RemoveRulesFromTrackingPlanV1Output.java | 1 - ...rceConnectionFromWarehouse200Response.java | 1 - ...SourceConnectionFromWarehouseV1Output.java | 1 - ...moveSourceFromTrackingPlan200Response.java | 1 - .../RemoveSourceFromTrackingPlanV1Output.java | 1 - ...ubscriptionFromDestination200Response.java | 1 - ...ubscriptionFromDestinationAlphaOutput.java | 1 - .../RemoveUsersFromUserGroup200Response.java | 1 - .../RemoveUsersFromUserGroupV1Output.java | 1 - ...edSyncScheduleForWarehouse200Response.java | 1 - ...vancedSyncScheduleForWarehouseV1Input.java | 1 - ...ancedSyncScheduleForWarehouseV1Output.java | 1 - .../ReplaceLabelsInSource200Response.java | 1 - .../ReplaceLabelsInSource200Response1.java | 1 - .../ReplaceLabelsInSourceAlphaInput.java | 1 - .../ReplaceLabelsInSourceAlphaOutput.java | 1 - .../models/ReplaceLabelsInSourceV1Input.java | 1 - .../models/ReplaceLabelsInSourceV1Output.java | 1 - ...agingSubscriptionsInSpaces200Response.java | 1 - ...sagingSubscriptionsInSpacesAlphaInput.java | 1 - ...agingSubscriptionsInSpacesAlphaOutput.java | 1 - .../ReplacePermissionsForUser200Response.java | 1 - ...acePermissionsForUserGroup200Response.java | 1 - ...ReplacePermissionsForUserGroupV1Input.java | 1 - ...eplacePermissionsForUserGroupV1Output.java | 1 - .../ReplacePermissionsForUserV1Input.java | 1 - .../ReplacePermissionsForUserV1Output.java | 1 - ...ReplaceRulesInTrackingPlan200Response.java | 1 - .../ReplaceRulesInTrackingPlanV1Input.java | 1 - .../ReplaceRulesInTrackingPlanV1Output.java | 1 - .../ReplaceUsersInUserGroup200Response.java | 1 - .../ReplaceUsersInUserGroupV1Input.java | 1 - .../ReplaceUsersInUserGroupV1Output.java | 1 - .../publicapi/models/RequestError.java | 1 - .../models/RequestErrorEnvelope.java | 1 - .../segment/publicapi/models/ResourceV1.java | 1 - .../com/segment/publicapi/models/RoleV1.java | 1 - .../com/segment/publicapi/models/RuleV1.java | 1 - .../segment/publicapi/models/Schedule.java | 1 - .../segment/publicapi/models/Schedule1.java | 1 - .../segment/publicapi/models/Schedule2.java | 1 - .../segment/publicapi/models/Settings.java | 1 - .../segment/publicapi/models/Settings1.java | 1 - .../com/segment/publicapi/models/Source.java | 1 - .../com/segment/publicapi/models/Source1.java | 1 - .../com/segment/publicapi/models/Source2.java | 1 - .../com/segment/publicapi/models/Source3.java | 1 - .../com/segment/publicapi/models/Source4.java | 1 - .../com/segment/publicapi/models/Source5.java | 1 - .../com/segment/publicapi/models/Source6.java | 1 - .../models/SourceAPICallSnapshotV1.java | 1 - .../segment/publicapi/models/SourceAlpha.java | 1 - .../models/SourceEventVolumeDatapointV1.java | 1 - .../publicapi/models/SourceEventVolumeV1.java | 1 - .../publicapi/models/SourceMetadata.java | 1 - .../publicapi/models/SourceMetadataV1.java | 1 - .../models/SourceSettingsOutputV1.java | 1 - .../segment/publicapi/models/SourceV1.java | 1 - .../com/segment/publicapi/models/Space.java | 1 - .../publicapi/models/StreamStatusV1.java | 1 - .../publicapi/models/Subscription.java | 1 - .../publicapi/models/SupportedFeatures.java | 1 - .../publicapi/models/SupportedMethods.java | 1 - .../publicapi/models/SupportedPlatforms.java | 1 - .../publicapi/models/SuppressedInner.java | 1 - .../publicapi/models/SyncNoticeV1.java | 1 - .../com/segment/publicapi/models/SyncV1.java | 1 - .../com/segment/publicapi/models/Track.java | 1 - .../models/TrackSourceSettingsV1.java | 1 - .../publicapi/models/TrackingPlan.java | 1 - .../publicapi/models/TrackingPlan1.java | 1 - .../publicapi/models/TrackingPlanV1.java | 1 - .../publicapi/models/Transformation.java | 1 - .../publicapi/models/Transformation1.java | 1 - .../publicapi/models/Transformation2.java | 1 - .../publicapi/models/Transformation3.java | 1 - .../publicapi/models/Transformation4.java | 1 - .../publicapi/models/Transformation5.java | 1 - .../publicapi/models/TransformationBeta.java | 1 - .../publicapi/models/TransformationV1.java | 1 - .../models/UpdateDestination200Response.java | 1 - .../models/UpdateDestinationV1Input.java | 1 - .../models/UpdateDestinationV1Output.java | 1 - ...UpdateFilterForDestination200Response.java | 1 - .../UpdateFilterForDestinationV1Input.java | 1 - .../UpdateFilterForDestinationV1Output.java | 1 - .../models/UpdateFunction200Response.java | 1 - .../models/UpdateFunctionV1Input.java | 1 - .../models/UpdateFunctionV1Output.java | 1 - .../UpdateRulesInTrackingPlan200Response.java | 1 - .../UpdateRulesInTrackingPlanV1Input.java | 1 - .../UpdateRulesInTrackingPlanV1Output.java | 1 - ...dateSchemaSettingsInSource200Response.java | 1 - .../UpdateSchemaSettingsInSourceV1Input.java | 1 - .../UpdateSchemaSettingsInSourceV1Output.java | 1 - ...eSelectiveSyncForWarehouse200Response.java | 1 - ...pdateSelectiveSyncForWarehouseV1Input.java | 1 - ...dateSelectiveSyncForWarehouseV1Output.java | 1 - .../models/UpdateSource200Response.java | 1 - .../models/UpdateSource200Response1.java | 1 - .../models/UpdateSourceAlphaInput.java | 1 - .../models/UpdateSourceAlphaOutput.java | 1 - .../publicapi/models/UpdateSourceV1Input.java | 1 - .../models/UpdateSourceV1Output.java | 1 - ...SubscriptionForDestination200Response.java | 1 - ...eSubscriptionForDestinationAlphaInput.java | 1 - ...SubscriptionForDestinationAlphaOutput.java | 1 - .../models/UpdateTrackingPlan200Response.java | 1 - .../models/UpdateTrackingPlanV1Input.java | 1 - .../models/UpdateTrackingPlanV1Output.java | 1 - .../UpdateTransformation200Response.java | 1 - .../models/UpdateTransformationBetaInput.java | 1 - .../UpdateTransformationBetaOutput.java | 1 - .../models/UpdateTransformationV1Input.java | 1 - .../models/UpdateTransformationV1Output.java | 1 - .../models/UpdateUserGroup200Response.java | 1 - .../models/UpdateUserGroupV1Input.java | 1 - .../models/UpdateUserGroupV1Output.java | 1 - .../models/UpdateWarehouse200Response.java | 1 - .../models/UpdateWarehouseV1Input.java | 1 - .../models/UpdateWarehouseV1Output.java | 1 - .../publicapi/models/UpsertRuleV1.java | 1 - .../com/segment/publicapi/models/User.java | 1 - .../segment/publicapi/models/UserGroup.java | 1 - .../segment/publicapi/models/UserGroup1.java | 1 - .../segment/publicapi/models/UserGroup2.java | 1 - .../segment/publicapi/models/UserGroup3.java | 1 - .../segment/publicapi/models/UserGroupV1.java | 1 - .../com/segment/publicapi/models/UserV1.java | 1 - .../models/UsersPerSourceSnapshotV1.java | 1 - .../segment/publicapi/models/Warehouse.java | 1 - .../segment/publicapi/models/Warehouse1.java | 1 - .../segment/publicapi/models/Warehouse2.java | 1 - .../models/WarehouseAdvancedSyncV1.java | 1 - .../publicapi/models/WarehouseMetadata.java | 1 - .../publicapi/models/WarehouseMetadataV1.java | 1 - .../models/WarehouseSelectiveSyncItemV1.java | 1 - .../models/WarehouseSyncOverrideV1.java | 1 - .../segment/publicapi/models/WarehouseV1.java | 1 - .../segment/publicapi/models/Workspace.java | 1 - .../segment/publicapi/models/WorkspaceV1.java | 1 - .../segment/publicapi/api/EchoApiTest.java | 1 - 523 files changed, 38 insertions(+), 527 deletions(-) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..9e0b518c --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,25 @@ +name: Publish package to the Maven Central Repository +on: + push: + branches: [master] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + - name: Publish package + run: mvn --batch-mode clean deploy + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/README.md b/README.md index 50e7fa1d..f196eeac 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 32.0.8 +- API version: 33.0.1 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -35,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 32.0.8 + 33.0.1 compile ``` @@ -51,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:32.0.8" + implementation "com.segment.publicapi:segment-publicapi:33.0.1" } ``` @@ -65,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-32.0.8.jar` +* `target/segment-publicapi-33.0.1.jar` * `target/lib/*.jar` ## Getting Started diff --git a/pom.xml b/pom.xml index 4fbc005f..33258863 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 32.0.8 + 33.0.1 https://segment.com/docs/api/public-api/ Segment Public API @@ -251,7 +251,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts @@ -259,6 +259,12 @@ sign + + + --pinentry-mode + loopback + + diff --git a/src/main/java/com/segment/publicapi/ApiCallback.java b/src/main/java/com/segment/publicapi/ApiCallback.java index 46267b71..db3c5648 100644 --- a/src/main/java/com/segment/publicapi/ApiCallback.java +++ b/src/main/java/com/segment/publicapi/ApiCallback.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 2cfe9ace..5a5425d6 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -125,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/32.0.8/java"); + setUserAgent("OpenAPI-Generator/33.0.1/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/ApiException.java b/src/main/java/com/segment/publicapi/ApiException.java index ad206019..3957eb2d 100644 --- a/src/main/java/com/segment/publicapi/ApiException.java +++ b/src/main/java/com/segment/publicapi/ApiException.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiResponse.java b/src/main/java/com/segment/publicapi/ApiResponse.java index 036e33df..00009055 100644 --- a/src/main/java/com/segment/publicapi/ApiResponse.java +++ b/src/main/java/com/segment/publicapi/ApiResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 315da371..ccfab24f 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java index 4dba29c3..299cc535 100644 --- a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java +++ b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index dab0a469..5c5a4363 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/Pair.java b/src/main/java/com/segment/publicapi/Pair.java index a6e629c4..22993e8a 100644 --- a/src/main/java/com/segment/publicapi/Pair.java +++ b/src/main/java/com/segment/publicapi/Pair.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressRequestBody.java b/src/main/java/com/segment/publicapi/ProgressRequestBody.java index f318c69f..23559aa2 100644 --- a/src/main/java/com/segment/publicapi/ProgressRequestBody.java +++ b/src/main/java/com/segment/publicapi/ProgressRequestBody.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressResponseBody.java b/src/main/java/com/segment/publicapi/ProgressResponseBody.java index 275a1bf5..046276c6 100644 --- a/src/main/java/com/segment/publicapi/ProgressResponseBody.java +++ b/src/main/java/com/segment/publicapi/ProgressResponseBody.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/StringUtil.java b/src/main/java/com/segment/publicapi/StringUtil.java index 0c53701d..5bbb1bf5 100644 --- a/src/main/java/com/segment/publicapi/StringUtil.java +++ b/src/main/java/com/segment/publicapi/StringUtil.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java index c58fa566..07b2e8a4 100644 --- a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java +++ b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index 40d378d0..eee8b577 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/CatalogApi.java b/src/main/java/com/segment/publicapi/api/CatalogApi.java index b951cbce..3420f385 100644 --- a/src/main/java/com/segment/publicapi/api/CatalogApi.java +++ b/src/main/java/com/segment/publicapi/api/CatalogApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index f8b4213c..cde51e20 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index 1b99f8cd..1f450fcd 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index aeac1c21..2297595b 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index 02e4eaf4..8ab3a094 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index 3beec6b4..7e7dccd4 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index b2f84922..446bcd40 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index d77e2862..76d10223 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamRolesApi.java b/src/main/java/com/segment/publicapi/api/IamRolesApi.java index 5cd56fad..49aeda33 100644 --- a/src/main/java/com/segment/publicapi/api/IamRolesApi.java +++ b/src/main/java/com/segment/publicapi/api/IamRolesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 9ae9343b..64d7fecb 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index ab3ffe91..497cb9ca 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java index c89388a0..882dbfea 100644 --- a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index aa03d08d..3c2de758 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index 6c22ebf9..240ddb5c 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 1e823b70..150f573a 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TestingApi.java b/src/main/java/com/segment/publicapi/api/TestingApi.java index d8d96445..cf623c60 100644 --- a/src/main/java/com/segment/publicapi/api/TestingApi.java +++ b/src/main/java/com/segment/publicapi/api/TestingApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index e9fc9db4..93b89e46 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index de09c9e7..a9d289fc 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index 4a82b76b..fd3e3a0a 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index 649d58e0..88cc0252 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java index 7537cfa3..6372e883 100644 --- a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java +++ b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/Authentication.java b/src/main/java/com/segment/publicapi/auth/Authentication.java index 09e215b0..34b1e2a0 100644 --- a/src/main/java/com/segment/publicapi/auth/Authentication.java +++ b/src/main/java/com/segment/publicapi/auth/Authentication.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java index d198f045..5937daea 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java index 01d79ea1..8283d8d5 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java index 493c2817..71c11dfb 100644 --- a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java index 54d026e8..3fd41e26 100644 --- a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java +++ b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java index 28af788f..c69bf1da 100644 --- a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java index ae141f90..4aa990b8 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java index 3faa32c9..2ad0ea0c 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java index 4ce12cf2..16a66188 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java index 2602e6e6..2df1ce49 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java index ff859fc2..3a8d626a 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java index 3e7830a8..c23c2328 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index 0750fc01..c9797897 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java index 2eef33b6..43d77c84 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java index 76b4f1b8..3bc9125b 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java index ea9a26a5..5cf1b40d 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index 8447f9ac..65c45470 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java index 606a74a2..c0d998d3 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index 8abd2cac..f05fdea4 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java index 5a8f072a..d56acb1a 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java index 136d0183..218be362 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index 731c452b..a7d972b4 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java index 0ffe5437..a124522d 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java index 0d010c43..0d0a8aa4 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index 08207f43..b5ac724d 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java index 30515fb3..22ac54e6 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java index a96b2d51..40854f1b 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java index 11f78fae..447d6bd0 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java index c810af7b..54a2513e 100644 --- a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java +++ b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AuditEventV1.java b/src/main/java/com/segment/publicapi/models/AuditEventV1.java index 50c5dd12..b18b34c2 100644 --- a/src/main/java/com/segment/publicapi/models/AuditEventV1.java +++ b/src/main/java/com/segment/publicapi/models/AuditEventV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java index ae583d1e..41432dec 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java index 6505cbc8..a2bf8420 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java index be6595f1..88a61351 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java index cef44138..0cfb4fb4 100644 --- a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java +++ b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java index 3cce8beb..82e71b3d 100644 --- a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index 7694d8fd..3842f54b 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java index 00ebc886..715fc67d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 4ecd81a0..3953116d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java index 32860ef4..b6c44c50 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java index 309a9bad..daa6ee08 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java index 0e3fc1f7..8c13d1ad 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index 9f15ca71..4c106b62 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java index 48002bb8..a1aebc9c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java index 90cfb96a..97115eb2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java index dc564787..c91dc3ae 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java index 67ae15f7..34705ffe 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java index 3e3120f6..973ce203 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java index 17b5785d..10e0cd9f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java index 1c5bd564..13ee2c71 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index 5a56e9c5..9bf68b50 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java index fa1dc778..ed49daa7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java index 1eccf785..dc517738 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java index 5a143846..74089c12 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java index b5829244..09c5e0ad 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index cca4fded..9bc33f12 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java index a6c7251c..8499d551 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java index f7a8c0aa..35dec0b5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java index 74cdf548..a73beefd 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java index 66896053..72d1571d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java index f2b10d3c..938c3747 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java index a03eb13e..f1774f85 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java index c3c2d81c..80d4882c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java index eeb7c157..6a49977b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index ec5b46a9..4929d123 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index 9936941c..ef6b38b7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java index ead46a27..d9a27ae2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java index 07b5847f..8af37cbb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java index 1f59d28b..079c3b67 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java index 75c00816..5615bb4b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java index 95b3a621..53577e8b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 2ebe8af8..83460e0d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java index 4cadd2c0..ddc99706 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index 92717093..f97aa16a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java index c010f3ac..289c41e8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java index 45a1e003..32b68deb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index e682264a..199d6774 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java index 0928d59f..ed4840d6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 46198f27..09fbf5fa 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 82539a77..998e2f7b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java index 24aae506..f0a448c0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index 406b3a17..9cd2178c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java index 146979a1..a604790d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java index 29d6a774..bf6b8915 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java index adc5aaf5..4ab3946d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java index b957d1bf..49cc207c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java index aff00f69..3e90d7de 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java index 96e05900..d33b85a9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java index bc132672..25d6304f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java index 0804b661..42f07a8a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index bc32a210..114151a0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java index 72fa0dc3..fde81683 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java index bb6fd9cb..5796f9c4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index 100d0fe4..64bf8ae4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java index 616a3384..c3029deb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java index e3ff14ae..dae26210 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java index c786a248..beed4187 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java index a4d9fd1d..8b391862 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java index 16bbfed6..1699c4c3 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java index 936feda0..7fd77240 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java index 95a7bcaa..b7cea68f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java index ac9338f0..d7ee648c 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java index b8fc6385..b15bcbd3 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java index e8bc75e8..b3fd978d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java index 55a7e34f..9dd7d052 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java index abdac043..d4d8d54c 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java index b514b161..132a2b46 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java index 69c3ee25..b4d0408d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java index 2518c16f..aaa42bf6 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java index e5323b46..f1fe0e84 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java index d5a66a87..48ef8de7 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java index fb99cb03..8ef1d630 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java index 754beac7..acf621c8 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index d2c9d773..cbd4a7ab 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java index ef90af3c..ca8b1fef 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java index 4dab9767..68b39cfe 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java index eeff815d..083b4b8b 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java index d474f6b8..f785970f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java index 5ba7820e..32270d94 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java index 50513dac..7c765184 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java index bbe78889..8c742d42 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java index 79b18760..000932c5 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java index 2bb48a72..73f7ddf4 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java index 8d4886ce..6a8b6a28 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java index e4d2b223..b1189d62 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java index b026345e..05b4e882 100644 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ b/src/main/java/com/segment/publicapi/models/Destination.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination1.java b/src/main/java/com/segment/publicapi/models/Destination1.java index 72063d23..13fa3a1d 100644 --- a/src/main/java/com/segment/publicapi/models/Destination1.java +++ b/src/main/java/com/segment/publicapi/models/Destination1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination2.java b/src/main/java/com/segment/publicapi/models/Destination2.java index 39a4fd5d..d38d901c 100644 --- a/src/main/java/com/segment/publicapi/models/Destination2.java +++ b/src/main/java/com/segment/publicapi/models/Destination2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java index 3b2816a7..9b9555da 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java index f7b31fa3..f27aaff2 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java index 1a8636f2..ffce6c4c 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index af5214f4..ff882290 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java index 1a189356..140737ad 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java index f45d0d83..3ee7b033 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java index 59ff7c3f..d7e0e31b 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java index d30797bf..d9db7c1f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index 0bddcdd0..ae0311d7 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java index 9ee7bd73..0ecd0dc4 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 33271b2f..c873b90e 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index b6213866..c62376c8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index f85359a8..278abe79 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 505f3c5b..79c4df32 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationV1.java b/src/main/java/com/segment/publicapi/models/DestinationV1.java index 3fb169bb..5c9cbadc 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java index a1b813ab..35941304 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java index 2da0ce18..47feb531 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response.java b/src/main/java/com/segment/publicapi/models/Echo200Response.java index 536aba88..9ede64cf 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response1.java b/src/main/java/com/segment/publicapi/models/Echo200Response1.java index 7ac6516f..f52588e1 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response1.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java index b4770e5e..41a57d7b 100644 --- a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoV1Output.java b/src/main/java/com/segment/publicapi/models/EchoV1Output.java index 5acf7e7a..5f1aa64a 100644 --- a/src/main/java/com/segment/publicapi/models/EchoV1Output.java +++ b/src/main/java/com/segment/publicapi/models/EchoV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java index 6d2feb81..338033ac 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java index 2d4a2815..9816c2c9 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java index bc6d5d7b..38106812 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EventSourceV1.java b/src/main/java/com/segment/publicapi/models/EventSourceV1.java index dca50bcc..a09f5ee3 100644 --- a/src/main/java/com/segment/publicapi/models/EventSourceV1.java +++ b/src/main/java/com/segment/publicapi/models/EventSourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index 623c9628..7bdd81cf 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter1.java b/src/main/java/com/segment/publicapi/models/Filter1.java index 94b14228..d5668ad5 100644 --- a/src/main/java/com/segment/publicapi/models/Filter1.java +++ b/src/main/java/com/segment/publicapi/models/Filter1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter2.java b/src/main/java/com/segment/publicapi/models/Filter2.java index cf8fbfad..1fd399cc 100644 --- a/src/main/java/com/segment/publicapi/models/Filter2.java +++ b/src/main/java/com/segment/publicapi/models/Filter2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter3.java b/src/main/java/com/segment/publicapi/models/Filter3.java index 1c5d38c7..79d03d6d 100644 --- a/src/main/java/com/segment/publicapi/models/Filter3.java +++ b/src/main/java/com/segment/publicapi/models/Filter3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index 0b5f84e4..f20febe4 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java index 006a3c48..8059f0f2 100644 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ b/src/main/java/com/segment/publicapi/models/Function1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java index 355d2bb0..7bba1c6a 100644 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ b/src/main/java/com/segment/publicapi/models/Function2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java index 25f7a83a..332de392 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java +++ b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index 18b37516..68bd50c8 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index 14a729b9..c6717cbd 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java index be0306d5..2895f2e6 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java index c95e6ed6..d95c3415 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java index 9454b92b..06b67556 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java index 56996056..3b5ae269 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java index 1c2bd8d3..de27e86d 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java index a9914e54..375eb53b 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java index d7d1130c..8b95688c 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java index 04446abe..bfe0632a 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java index 257f012e..7a2d4c51 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java index 1a05794b..6165cdb1 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java index db059e40..2a03891a 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java index 817fa5ec..0a330153 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java index 0cfc92ee..17ca7e58 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java index cf721914..134e3b03 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java index 162d326d..3c7a9f62 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java index 0dfb1906..3e367243 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java index c108a908..05203813 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java index 85643de3..310066ce 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java index 6d8bd30c..c434bd56 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java index ba60e2ed..788d04fc 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java index cb3ea436..5aa6c994 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index b78d7c2b..1add9558 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java index eb4cc521..87bfa0da 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java index 445acd48..026b969b 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java index a4ce6f90..544dac87 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 5f108e32..77863757 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java index f65171bb..d4af1202 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java index f2fbac99..214cfe31 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java index c05971e6..56bd4447 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index d87d8347..67f7241e 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java index cc258d1a..fdeed139 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java index 2b207a70..273b74bf 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response.java b/src/main/java/com/segment/publicapi/models/GetSource200Response.java index c9bda6ae..60e095a6 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java index 53b68835..2f7373d1 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java index b699f91b..6dd120ea 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java index 23bab5dc..2b8118fe 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java index af39039f..9476806e 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index fd23ef6f..5755a188 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java index 267da7a3..545b763c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java index 9f03fd94..f79c0853 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java index e7b0522d..48da4cb4 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java index a46f1cd5..1fb9ef76 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java index eb4cb02f..5acade54 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java index 5aadde23..5f90146a 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 22a7770f..bf7c207f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java index a9fd1ece..63a56dac 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java index df4d13b8..ef7b3edc 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index deda6b06..937d1985 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java index 8aca9fc4..adc11270 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java index 2d910db0..3942ce53 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java index 0a5bd6e8..2990e109 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUser200Response.java b/src/main/java/com/segment/publicapi/models/GetUser200Response.java index 7b95e17f..aa7889e1 100644 --- a/src/main/java/com/segment/publicapi/models/GetUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java index 0a251734..a415949b 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java index 74c7a832..10bc83f3 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java index 02befe03..87b89574 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java index 70c4c223..24163ca3 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java index 3daa0d1f..d745308a 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java index 4b3d4ba3..1303fd6a 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java index 9f6628e3..fa31bb42 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java index dc1f5f93..2a54a775 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java index 08420ef4..43a289b7 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java index 7d34359e..e00436bf 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java index 549fe0de..e93b81cb 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Group.java b/src/main/java/com/segment/publicapi/models/Group.java index 0893f22c..6093019f 100644 --- a/src/main/java/com/segment/publicapi/models/Group.java +++ b/src/main/java/com/segment/publicapi/models/Group.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java index 516bb459..bf7ff2e9 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Identify.java b/src/main/java/com/segment/publicapi/models/Identify.java index e2e45945..38f4e9f3 100644 --- a/src/main/java/com/segment/publicapi/models/Identify.java +++ b/src/main/java/com/segment/publicapi/models/Identify.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java index b074dad6..6de6972c 100644 --- a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Input.java b/src/main/java/com/segment/publicapi/models/Input.java index fd85822f..74f70753 100644 --- a/src/main/java/com/segment/publicapi/models/Input.java +++ b/src/main/java/com/segment/publicapi/models/Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java index cde60006..d3408ee1 100644 --- a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java +++ b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java index 394f2e37..47eb64e6 100644 --- a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InviteV1.java b/src/main/java/com/segment/publicapi/models/InviteV1.java index a8718132..8d7493f8 100644 --- a/src/main/java/com/segment/publicapi/models/InviteV1.java +++ b/src/main/java/com/segment/publicapi/models/InviteV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label.java b/src/main/java/com/segment/publicapi/models/Label.java index 1f454b6b..a583029f 100644 --- a/src/main/java/com/segment/publicapi/models/Label.java +++ b/src/main/java/com/segment/publicapi/models/Label.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label1.java b/src/main/java/com/segment/publicapi/models/Label1.java index 02f093f3..abf663f5 100644 --- a/src/main/java/com/segment/publicapi/models/Label1.java +++ b/src/main/java/com/segment/publicapi/models/Label1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label2.java b/src/main/java/com/segment/publicapi/models/Label2.java index f89c3b64..07e41ab1 100644 --- a/src/main/java/com/segment/publicapi/models/Label2.java +++ b/src/main/java/com/segment/publicapi/models/Label2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelAlpha.java b/src/main/java/com/segment/publicapi/models/LabelAlpha.java index fbbbda2e..350d897f 100644 --- a/src/main/java/com/segment/publicapi/models/LabelAlpha.java +++ b/src/main/java/com/segment/publicapi/models/LabelAlpha.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelV1.java b/src/main/java/com/segment/publicapi/models/LabelV1.java index 5221b8c2..5aff4794 100644 --- a/src/main/java/com/segment/publicapi/models/LabelV1.java +++ b/src/main/java/com/segment/publicapi/models/LabelV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java index 44d1d288..ae475f75 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java index 55d510ec..a7764fc9 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java index b7fe768d..7f24f24a 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java index 6578f93b..dd5a0504 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java index d89ef1ab..a8af96af 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java index 7b833e70..8caa5077 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java index d62b6fd3..eff3c02e 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java index ef9e949d..f6d74db8 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java index ff3cc535..93dea71f 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java index f3dae7b2..57877075 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java index ed4deb09..42f169a9 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java index 1caec0fb..b1fb9c63 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java index e87a0d34..e2c0e27a 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java index 9c4e406e..c4796861 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java index d6de1745..1c014cdf 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java index 42a8541a..c71e96f1 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java index 456802ef..b152ccc2 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java index d0fbcb54..c727dda4 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index 5bcf4f7b..66c69339 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java index ed1b6a02..48e4a570 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java index 86f3e0d1..f1f0518e 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java index 2ef61038..599d65fc 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java index 5be4a55b..71783c64 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java index 743bd997..07aa2962 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java index 76cb12ec..a03f887d 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java index 470dfae4..99dfda3f 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java index fc0ad059..7d22595a 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java index e493e8a3..b4199bbb 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java index 7ca3023a..5ac80336 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java index 6eb2227c..93520e73 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java index c15e34e9..cf819e64 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java index 12444121..3f860460 100644 --- a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java index b94c0009..4579d420 100644 --- a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java index c57a8dd9..f291ee10 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java index 1224f80e..9da42cd1 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java index 5d501ef9..367d636a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java index fba707f6..fd9cd1b0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java index e7ac5fb1..0bfd630c 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java index 759cecc1..93f0219a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response.java b/src/main/java/com/segment/publicapi/models/ListSources200Response.java index edb11c47..f2a267e4 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java index dfc2fa36..e2d5a21d 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java index e727735a..f22a8014 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java index acf6c75a..aa2b2c5b 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java index c1d2a4b8..1a285227 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java index c98c6532..72b9c7ab 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java index 0ca06e79..63db0f25 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java index fd15e745..069785d0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java index 00107646..e80f4a22 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java index fcb35146..9137d79c 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java index e64fdce6..3d69c4d0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java index 73cfe2e9..694b3d25 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java index 34cfbf67..ffd9a6a3 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java index f575cfdb..8c37a8c9 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java index aebbfe7b..99ac64e7 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java index 7689ac75..2eb89d55 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index 96b6c1d1..b9565031 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java index ed3d8af0..ed21b87e 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java index c4407ea9..f2484ee6 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java index efb9e974..30346e88 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java index 95debab8..c8400059 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java index 7c65670a..cee52465 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java index dc95c2cd..2302ec88 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java index 040ba58f..8e8bbe4b 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java index de02b396..bd720378 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java index 87e4e374..75ae4910 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java index 557ab0c8..b9b368b5 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java index fd33b869..a6476b40 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java index 314551ce..778b9cb4 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java index 08a26cd8..03bfddf9 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java index a960024c..d6d84dc1 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java index 257361bd..b03af950 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos.java b/src/main/java/com/segment/publicapi/models/Logos.java index 0d8ef99b..3d828bd4 100644 --- a/src/main/java/com/segment/publicapi/models/Logos.java +++ b/src/main/java/com/segment/publicapi/models/Logos.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos1.java b/src/main/java/com/segment/publicapi/models/Logos1.java index 5ccd2450..6baa4f95 100644 --- a/src/main/java/com/segment/publicapi/models/Logos1.java +++ b/src/main/java/com/segment/publicapi/models/Logos1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos2.java b/src/main/java/com/segment/publicapi/models/Logos2.java index ef026e8a..7210fe0c 100644 --- a/src/main/java/com/segment/publicapi/models/Logos2.java +++ b/src/main/java/com/segment/publicapi/models/Logos2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LogosBeta.java b/src/main/java/com/segment/publicapi/models/LogosBeta.java index 3d6b8e18..88b2d956 100644 --- a/src/main/java/com/segment/publicapi/models/LogosBeta.java +++ b/src/main/java/com/segment/publicapi/models/LogosBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 2bdd10f2..7c2f24cb 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java index b4350b5d..a3d3c62a 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index 86dbeb4b..5621edf6 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata.java b/src/main/java/com/segment/publicapi/models/Metadata.java index a5cb4fec..29b47444 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata.java +++ b/src/main/java/com/segment/publicapi/models/Metadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata1.java b/src/main/java/com/segment/publicapi/models/Metadata1.java index ef6a58bf..8a845b8c 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata1.java +++ b/src/main/java/com/segment/publicapi/models/Metadata1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata2.java b/src/main/java/com/segment/publicapi/models/Metadata2.java index c51f457f..50dae21a 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata2.java +++ b/src/main/java/com/segment/publicapi/models/Metadata2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MetricBeta.java b/src/main/java/com/segment/publicapi/models/MetricBeta.java index a0b44175..fe1d59b9 100644 --- a/src/main/java/com/segment/publicapi/models/MetricBeta.java +++ b/src/main/java/com/segment/publicapi/models/MetricBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java index 03dc71fb..1743ce1d 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java index fa7bb722..39bbca39 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java index 6553b9cc..0319072d 100644 --- a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination.java b/src/main/java/com/segment/publicapi/models/Pagination.java index a56fa9d3..3bb74f45 100644 --- a/src/main/java/com/segment/publicapi/models/Pagination.java +++ b/src/main/java/com/segment/publicapi/models/Pagination.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination1.java b/src/main/java/com/segment/publicapi/models/Pagination1.java index abf60d0b..41b5f7e7 100644 --- a/src/main/java/com/segment/publicapi/models/Pagination1.java +++ b/src/main/java/com/segment/publicapi/models/Pagination1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PaginationInput.java b/src/main/java/com/segment/publicapi/models/PaginationInput.java index dfc2e912..3f360c00 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationInput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PaginationOutput.java b/src/main/java/com/segment/publicapi/models/PaginationOutput.java index 5f3740d2..a2fa1d48 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationOutput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java index 486d9e3e..2d102a6a 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java index 24fd5de5..ce9e3466 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionV1.java b/src/main/java/com/segment/publicapi/models/PermissionV1.java index c78098f0..75c32c53 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java index b62b0f1c..e88ae6d2 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java index 6b5c34ec..76fbc839 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java index ba393a8d..9b199ccc 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java index d7224f00..2c6ae969 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java index 4c74c06f..f58c40fd 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java index 5cd64b58..9983bfb9 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java index 774537d1..a1b9fc38 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java index a36882f6..d524ddaf 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index 00f6bd09..b1059c08 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index 59806fa8..f27f82f7 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java index 4ee7547d..4ccac399 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java index 1ec6f866..c3b7e1fa 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java index ffe5109f..13ce5fba 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java index ff99b6c4..311123ee 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java index c75d4eda..5cc496c4 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java index d9c55f80..9146b3ac 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java index 682045dc..11804320 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java index faf6dc76..c057b351 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java index fa49ac97..35b39e1e 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java index cabfefec..5abce5d5 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java index 24405d2d..7edc0eba 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java index e35ea058..243b22e5 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java index 471ca6c8..1e26fa1a 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java index 52e78383..c8384989 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java index fedaf8e7..fa8adf0a 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java index ce9057c3..19361662 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java index 34b596ca..9cdcd1f3 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java index ef4344bb..063c6c9f 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java index 2444bb7a..142134a9 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java index 495cc5b6..52ae3820 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java index 8c8dbeb7..03a24f1b 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java index 172fca8e..1bc6f110 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java index a0c58eba..aaea91eb 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java index 80e7ec9f..b9eacb17 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java index ac81cb97..38034ed2 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java index fe2fd8f8..c34c98ba 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java index 24394df9..d2452642 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java index cdb983a7..3dcc3aec 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java index 2092bb63..ebb8b777 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java index 08bfc8a1..eeb793a9 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java index f4d83159..f711d9cb 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java index 30874c08..e74a51a8 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java index 7ebc7495..489c11aa 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java index 0641b46b..274180c6 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java index 9955bd13..f38f016c 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java index 69ecdebf..90687b57 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java index 00180ee7..fe0d9028 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestError.java b/src/main/java/com/segment/publicapi/models/RequestError.java index 0dc67630..46fca89f 100644 --- a/src/main/java/com/segment/publicapi/models/RequestError.java +++ b/src/main/java/com/segment/publicapi/models/RequestError.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java index bd4ea73d..d11bdbed 100644 --- a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java +++ b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ResourceV1.java b/src/main/java/com/segment/publicapi/models/ResourceV1.java index 49e1ae5e..24fab55e 100644 --- a/src/main/java/com/segment/publicapi/models/ResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/ResourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RoleV1.java b/src/main/java/com/segment/publicapi/models/RoleV1.java index 159964db..14f4dbbe 100644 --- a/src/main/java/com/segment/publicapi/models/RoleV1.java +++ b/src/main/java/com/segment/publicapi/models/RoleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index 568ee640..78adf379 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule.java b/src/main/java/com/segment/publicapi/models/Schedule.java index 5bc265db..533a6a8d 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule.java +++ b/src/main/java/com/segment/publicapi/models/Schedule.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule1.java b/src/main/java/com/segment/publicapi/models/Schedule1.java index 3711ae76..22f09349 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule1.java +++ b/src/main/java/com/segment/publicapi/models/Schedule1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule2.java b/src/main/java/com/segment/publicapi/models/Schedule2.java index f9713346..4ea89297 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule2.java +++ b/src/main/java/com/segment/publicapi/models/Schedule2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings.java b/src/main/java/com/segment/publicapi/models/Settings.java index 8ceeb89d..036bc07d 100644 --- a/src/main/java/com/segment/publicapi/models/Settings.java +++ b/src/main/java/com/segment/publicapi/models/Settings.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings1.java b/src/main/java/com/segment/publicapi/models/Settings1.java index 732b8493..c96720c4 100644 --- a/src/main/java/com/segment/publicapi/models/Settings1.java +++ b/src/main/java/com/segment/publicapi/models/Settings1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source.java b/src/main/java/com/segment/publicapi/models/Source.java index 11289a1d..1faf715b 100644 --- a/src/main/java/com/segment/publicapi/models/Source.java +++ b/src/main/java/com/segment/publicapi/models/Source.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source1.java b/src/main/java/com/segment/publicapi/models/Source1.java index ec5cf77a..d8014cf0 100644 --- a/src/main/java/com/segment/publicapi/models/Source1.java +++ b/src/main/java/com/segment/publicapi/models/Source1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source2.java b/src/main/java/com/segment/publicapi/models/Source2.java index 457fbf33..f227ff90 100644 --- a/src/main/java/com/segment/publicapi/models/Source2.java +++ b/src/main/java/com/segment/publicapi/models/Source2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source3.java b/src/main/java/com/segment/publicapi/models/Source3.java index dc620798..d6aafe2c 100644 --- a/src/main/java/com/segment/publicapi/models/Source3.java +++ b/src/main/java/com/segment/publicapi/models/Source3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source4.java b/src/main/java/com/segment/publicapi/models/Source4.java index bbbd5815..c75dc398 100644 --- a/src/main/java/com/segment/publicapi/models/Source4.java +++ b/src/main/java/com/segment/publicapi/models/Source4.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source5.java b/src/main/java/com/segment/publicapi/models/Source5.java index 48327f26..073acaf6 100644 --- a/src/main/java/com/segment/publicapi/models/Source5.java +++ b/src/main/java/com/segment/publicapi/models/Source5.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source6.java b/src/main/java/com/segment/publicapi/models/Source6.java index b79f4b68..fc023adb 100644 --- a/src/main/java/com/segment/publicapi/models/Source6.java +++ b/src/main/java/com/segment/publicapi/models/Source6.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java index df2b3f3b..368c608b 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAlpha.java b/src/main/java/com/segment/publicapi/models/SourceAlpha.java index f0220886..91cf1eaf 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAlpha.java +++ b/src/main/java/com/segment/publicapi/models/SourceAlpha.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java index fd3a5e3b..de136952 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index 6104efd6..cbb9d642 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadata.java b/src/main/java/com/segment/publicapi/models/SourceMetadata.java index d5607e03..feb9dd2e 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadata.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java index 0a251bf4..09efca60 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java index b788c663..c40b0299 100644 --- a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceV1.java b/src/main/java/com/segment/publicapi/models/SourceV1.java index fb7acdc5..b6a7f6c7 100644 --- a/src/main/java/com/segment/publicapi/models/SourceV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 2cfa897d..0a827f88 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java index 305a18d2..7ba98961 100644 --- a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Subscription.java b/src/main/java/com/segment/publicapi/models/Subscription.java index 6e78ea2c..e91e48ac 100644 --- a/src/main/java/com/segment/publicapi/models/Subscription.java +++ b/src/main/java/com/segment/publicapi/models/Subscription.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java index ac30bc59..00686422 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java +++ b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedMethods.java b/src/main/java/com/segment/publicapi/models/SupportedMethods.java index 170bc298..3a4c65ea 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedMethods.java +++ b/src/main/java/com/segment/publicapi/models/SupportedMethods.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java index e23bfe1a..3399054e 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java +++ b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SuppressedInner.java b/src/main/java/com/segment/publicapi/models/SuppressedInner.java index 862dfbc3..b1db0761 100644 --- a/src/main/java/com/segment/publicapi/models/SuppressedInner.java +++ b/src/main/java/com/segment/publicapi/models/SuppressedInner.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java index 411ab127..dc34954e 100644 --- a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncV1.java b/src/main/java/com/segment/publicapi/models/SyncV1.java index 8cabb9b2..81e76f54 100644 --- a/src/main/java/com/segment/publicapi/models/SyncV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Track.java b/src/main/java/com/segment/publicapi/models/Track.java index f6a6c414..146f0d34 100644 --- a/src/main/java/com/segment/publicapi/models/Track.java +++ b/src/main/java/com/segment/publicapi/models/Track.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java index 9f9a8eaf..6c2d3338 100644 --- a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index ed495608..524daf30 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 4a341b44..44d6ac94 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index 849ab7f0..b6b79632 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index 302fe842..450d8051 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index 6da8cc1d..cc9c89d1 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index 9d30e860..f52c60ac 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java index decff4b1..d96809eb 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation3.java +++ b/src/main/java/com/segment/publicapi/models/Transformation3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java index 2ef26454..ec91dbe6 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation4.java +++ b/src/main/java/com/segment/publicapi/models/Transformation4.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java index db253056..adac93ee 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation5.java +++ b/src/main/java/com/segment/publicapi/models/Transformation5.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index b703ad93..91b097ee 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java index 6a01f40a..abe887da 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java index 01e55e7d..002d6112 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java index 6a12e4b6..3a76ef8b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java index 823fa7b2..fdeb53f9 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java index ab14559c..57cc9730 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java index a56daccc..8ac5d061 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java index 748c57a5..66ae1377 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java index 126642c3..8c89bf2f 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java index abeca7fd..86e57802 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java index c9098728..2d9c3494 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java index 4a500bbc..b49f70a3 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java index 3324cf86..901d912a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java index 25acb78b..ca16795a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java index b0a012d5..37e6c393 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java index 02de7ce6..e825ac3b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java index 871495a9..3d5eddc4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java index c4ccd372..a8eb1e43 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java index 7df707ea..378802f4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java index 7e8b5512..e7ca8d46 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java index d85e3abd..12516d49 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java index f106162a..02489ff1 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java index fbdd2a94..232e2266 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java index 283ecdfa..1c2ad0ed 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java index 536aa695..0157ea95 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java index b675f54b..ab415977 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java index f70e7a4a..57204b9c 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java index 64f6231b..bff96e27 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java index 60320cfe..372bd5b8 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java index 02f23ea4..299e0708 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java index 5886cfe9..f9b5fe17 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java index 41557f6d..5c6fb92b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index f1f5a18b..d92501c0 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 5bf8bba5..6ec8c308 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java index e4a96bb0..b7d1c980 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java index 9c0d20b3..716d22b5 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java index 78ba56e0..a1e5193a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java index 01be1ab4..7bb950bc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java index faf6af58..375d8a90 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java index de775fd9..5536846a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java index c66fda12..4b943acc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java index d7399b64..8a7f58d8 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java index 56f7ed0a..1c99a54c 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index ae02494e..a1bcdf85 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/User.java b/src/main/java/com/segment/publicapi/models/User.java index 6dc39a9b..44e1f58b 100644 --- a/src/main/java/com/segment/publicapi/models/User.java +++ b/src/main/java/com/segment/publicapi/models/User.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup.java b/src/main/java/com/segment/publicapi/models/UserGroup.java index 82def187..27b5391a 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup1.java b/src/main/java/com/segment/publicapi/models/UserGroup1.java index 5f9a9539..d4f2f1b0 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup2.java b/src/main/java/com/segment/publicapi/models/UserGroup2.java index ec55b9eb..b4a856b9 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup2.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup3.java b/src/main/java/com/segment/publicapi/models/UserGroup3.java index 8c16e0d1..fe9f9ff8 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup3.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroupV1.java b/src/main/java/com/segment/publicapi/models/UserGroupV1.java index 503eb7d8..d274c508 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroupV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserV1.java b/src/main/java/com/segment/publicapi/models/UserV1.java index b682ef7d..20f0edfb 100644 --- a/src/main/java/com/segment/publicapi/models/UserV1.java +++ b/src/main/java/com/segment/publicapi/models/UserV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java index a919db9f..433f4c62 100644 --- a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse.java b/src/main/java/com/segment/publicapi/models/Warehouse.java index c6c994ac..33defef5 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse1.java b/src/main/java/com/segment/publicapi/models/Warehouse1.java index c6bcfa79..beedc382 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse1.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse2.java b/src/main/java/com/segment/publicapi/models/Warehouse2.java index 357d3533..86c1c3fb 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse2.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java index 3f1702f1..066c9b01 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java index 623e4349..b0c28d87 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java index a1051cd7..435b25ce 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java index da294829..75558eb1 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java index f0cb95a8..188ac6c6 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseV1.java b/src/main/java/com/segment/publicapi/models/WarehouseV1.java index 0d24d400..e3de3705 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Workspace.java b/src/main/java/com/segment/publicapi/models/Workspace.java index 2398311e..be250d00 100644 --- a/src/main/java/com/segment/publicapi/models/Workspace.java +++ b/src/main/java/com/segment/publicapi/models/Workspace.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java index 4a8c01ac..95770e63 100644 --- a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java +++ b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.8 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/test/java/com/segment/publicapi/api/EchoApiTest.java b/src/test/java/com/segment/publicapi/api/EchoApiTest.java index 07cd1e9a..1d0e328c 100644 --- a/src/test/java/com/segment/publicapi/api/EchoApiTest.java +++ b/src/test/java/com/segment/publicapi/api/EchoApiTest.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). From 50a3cd91dc4fb67fa49b0e1842c8df02ee6d3e6b Mon Sep 17 00:00:00 2001 From: public-api ci Date: Thu, 17 Nov 2022 23:36:26 +0000 Subject: [PATCH 014/474] Automated client deploy (from segmentio/public-api@bce9188) --- README.md | 8 +- pom.xml | 10 +- .../com/segment/publicapi/ApiCallback.java | 1 + .../java/com/segment/publicapi/ApiClient.java | 3 +- .../com/segment/publicapi/ApiException.java | 1 + .../com/segment/publicapi/ApiResponse.java | 1 + .../com/segment/publicapi/Configuration.java | 1 + .../publicapi/GzipRequestInterceptor.java | 1 + src/main/java/com/segment/publicapi/JSON.java | 46 +- src/main/java/com/segment/publicapi/Pair.java | 1 + .../publicapi/ProgressRequestBody.java | 1 + .../publicapi/ProgressResponseBody.java | 1 + .../com/segment/publicapi/StringUtil.java | 1 + .../segment/publicapi/api/ApiCallsApi.java | 1 + .../segment/publicapi/api/AuditTrailApi.java | 1 + .../com/segment/publicapi/api/CatalogApi.java | 1 + .../api/DeletionAndSuppressionApi.java | 1 + .../publicapi/api/DestinationFiltersApi.java | 1 + .../publicapi/api/DestinationsApi.java | 1 + .../publicapi/api/EdgeFunctionsApi.java | 1 + .../com/segment/publicapi/api/EventsApi.java | 1 + .../segment/publicapi/api/FunctionsApi.java | 1 + .../segment/publicapi/api/IamGroupsApi.java | 1 + .../segment/publicapi/api/IamRolesApi.java | 1 + .../segment/publicapi/api/IamUsersApi.java | 1 + .../com/segment/publicapi/api/LabelsApi.java | 1 + .../publicapi/api/MonthlyTrackedUsersApi.java | 1 + .../publicapi/api/SelectiveSyncApi.java | 1 + .../com/segment/publicapi/api/SourcesApi.java | 1 + .../com/segment/publicapi/api/SpacesApi.java | 1 + .../com/segment/publicapi/api/TestingApi.java | 1 + .../publicapi/api/TrackingPlansApi.java | 1 + .../publicapi/api/TransformationsApi.java | 117 ++-- .../segment/publicapi/api/WarehousesApi.java | 1 + .../segment/publicapi/api/WorkspacesApi.java | 1 + .../segment/publicapi/auth/ApiKeyAuth.java | 1 + .../publicapi/auth/Authentication.java | 1 + .../segment/publicapi/auth/HttpBasicAuth.java | 1 + .../publicapi/auth/HttpBearerAuth.java | 1 + .../publicapi/models/APICallSnapshotV1.java | 1 + .../models/AbstractOpenApiSchema.java | 1 + .../publicapi/models/AccessPermissionV1.java | 1 + ...ctionFromSourceToWarehouse200Response.java | 1 + ...nnectionFromSourceToWarehouseV1Output.java | 1 + .../models/AddLabelsToSource200Response.java | 1 + .../models/AddLabelsToSource200Response1.java | 1 + .../models/AddLabelsToSourceAlphaInput.java | 1 + .../models/AddLabelsToSourceAlphaOutput.java | 1 + .../models/AddLabelsToSourceV1Input.java | 1 + .../models/AddLabelsToSourceV1Output.java | 1 + .../AddPermissionsToUser200Response.java | 1 + .../AddPermissionsToUserGroup200Response.java | 1 + .../AddPermissionsToUserGroupV1Input.java | 1 + .../AddPermissionsToUserGroupV1Output.java | 1 + .../models/AddPermissionsToUserV1Input.java | 1 + .../models/AddPermissionsToUserV1Output.java | 1 + .../AddSourceToTrackingPlan200Response.java | 1 + .../AddSourceToTrackingPlanV1Input.java | 1 + .../AddSourceToTrackingPlanV1Output.java | 1 + .../AddUsersToUserGroup200Response.java | 1 + .../models/AddUsersToUserGroupV1Input.java | 1 + .../models/AddUsersToUserGroupV1Output.java | 1 + .../AdvancedWarehouseSyncScheduleV1Input.java | 1 + ...AdvancedWarehouseSyncScheduleV1Output.java | 1 + .../publicapi/models/AllowedLabelBeta.java | 1 + .../publicapi/models/AuditEventV1.java | 1 + ...agingSubscriptionsForSpace200Response.java | 1 + ...sagingSubscriptionsForSpaceAlphaInput.java | 1 + ...agingSubscriptionsForSpaceAlphaOutput.java | 1 + .../publicapi/models/BreakdownBeta.java | 1 + .../models/CommonSourceSettingsV1.java | 1 + .../com/segment/publicapi/models/Contact.java | 1 + ...reateCloudSourceRegulation200Response.java | 1 + .../CreateCloudSourceRegulationV1Input.java | 3 + .../CreateCloudSourceRegulationV1Output.java | 1 + .../models/CreateDestination200Response.java | 1 + ...ateDestinationSubscription200Response.java | 1 + ...eateDestinationSubscriptionAlphaInput.java | 1 + ...ateDestinationSubscriptionAlphaOutput.java | 1 + .../models/CreateDestinationV1Input.java | 1 + .../models/CreateDestinationV1Output.java | 1 + .../CreateEdgeFunctions200Response.java | 1 + .../models/CreateEdgeFunctionsAlphaInput.java | 1 + .../CreateEdgeFunctionsAlphaOutput.java | 1 + ...CreateFilterForDestination200Response.java | 1 + .../CreateFilterForDestinationV1Input.java | 1 + .../CreateFilterForDestinationV1Output.java | 1 + .../models/CreateFunction200Response.java | 1 + .../CreateFunctionDeployment200Response.java | 1 + .../CreateFunctionDeploymentV1Output.java | 1 + .../models/CreateFunctionV1Input.java | 1 + .../models/CreateFunctionV1Output.java | 1 + .../models/CreateInvites200Response.java | 1 + .../models/CreateInvitesV1Input.java | 1 + .../models/CreateInvitesV1Output.java | 1 + .../models/CreateLabel200Response.java | 1 + .../models/CreateLabel200Response1.java | 1 + .../models/CreateLabelAlphaInput.java | 1 + .../models/CreateLabelAlphaOutput.java | 1 + .../publicapi/models/CreateLabelV1Input.java | 1 + .../publicapi/models/CreateLabelV1Output.java | 1 + .../models/CreateSource200Response.java | 1 + .../models/CreateSource200Response1.java | 1 + .../models/CreateSourceAlphaInput.java | 1 + .../models/CreateSourceAlphaOutput.java | 1 + .../CreateSourceRegulation200Response.java | 1 + .../models/CreateSourceRegulationV1Input.java | 3 + .../CreateSourceRegulationV1Output.java | 1 + .../publicapi/models/CreateSourceV1Input.java | 1 + .../models/CreateSourceV1Output.java | 1 + .../models/CreateTrackingPlan200Response.java | 1 + .../models/CreateTrackingPlanV1Input.java | 1 + .../models/CreateTrackingPlanV1Output.java | 1 + .../CreateTransformation200Response.java | 9 +- .../models/CreateTransformationBetaInput.java | 1 + .../CreateTransformationBetaOutput.java | 1 + .../models/CreateTransformationV1Input.java | 540 ----------------- .../models/CreateTransformationV1Output.java | 209 ------- .../models/CreateUserGroup200Response.java | 1 + .../models/CreateUserGroupV1Input.java | 1 + .../models/CreateUserGroupV1Output.java | 1 + ...reateValidationInWarehouse200Response.java | 1 + .../CreateValidationInWarehouseV1Input.java | 1 + .../CreateValidationInWarehouseV1Output.java | 1 + .../models/CreateWarehouse200Response.java | 1 + .../models/CreateWarehouseV1Input.java | 1 + .../models/CreateWarehouseV1Output.java | 1 + .../CreateWorkspaceRegulation200Response.java | 1 + .../CreateWorkspaceRegulationV1Input.java | 3 + .../CreateWorkspaceRegulationV1Output.java | 1 + .../models/DeleteDestination200Response.java | 1 + .../models/DeleteDestinationV1Output.java | 1 + .../models/DeleteFunction200Response.java | 1 + .../models/DeleteFunctionV1Output.java | 1 + .../models/DeleteInvites200Response.java | 1 + .../models/DeleteInvitesV1Output.java | 1 + .../models/DeleteLabel200Response.java | 1 + .../models/DeleteLabel200Response1.java | 1 + .../models/DeleteLabelAlphaOutput.java | 1 + .../publicapi/models/DeleteLabelV1Output.java | 1 + .../models/DeleteRegulation200Response.java | 1 + .../models/DeleteRegulationV1Output.java | 1 + .../models/DeleteSource200Response.java | 1 + .../models/DeleteSource200Response1.java | 1 + .../models/DeleteSourceAlphaOutput.java | 1 + .../models/DeleteSourceV1Output.java | 1 + .../models/DeleteTrackingPlan200Response.java | 1 + .../models/DeleteTrackingPlanV1Output.java | 1 + .../DeleteTransformation200Response.java | 9 +- .../models/DeleteTransformationBetaInput.java | 218 ------- .../DeleteTransformationBetaOutput.java | 1 + .../models/DeleteTransformationV1Output.java | 261 -------- .../models/DeleteUserGroup200Response.java | 1 + .../models/DeleteUserGroupV1Output.java | 1 + .../models/DeleteUsers200Response.java | 1 + .../publicapi/models/DeleteUsersV1Output.java | 1 + .../models/DeleteWarehouse200Response.java | 1 + .../models/DeleteWarehouseV1Output.java | 1 + .../models/DeliveryMetricsSummary.java | 1 + .../models/DeliveryMetricsSummaryBeta.java | 1 + .../segment/publicapi/models/Destination.java | 1 + .../publicapi/models/Destination1.java | 1 + .../publicapi/models/Destination2.java | 1 + .../models/DestinationFilterActionV1.java | 1 + .../publicapi/models/DestinationFilterV1.java | 1 + .../publicapi/models/DestinationMetadata.java | 1 + .../DestinationMetadataActionFieldV1.java | 1 + .../models/DestinationMetadataActionV1.java | 1 + .../DestinationMetadataComponentV1.java | 1 + .../models/DestinationMetadataFeaturesV1.java | 1 + .../models/DestinationMetadataMethodsV1.java | 1 + .../DestinationMetadataPlatformsV1.java | 1 + ...stinationMetadataSubscriptionPresetV1.java | 1 + .../models/DestinationMetadataV1.java | 1 + .../publicapi/models/DestinationStatusV1.java | 1 + .../models/DestinationSubscription.java | 1 + .../DestinationSubscriptionUpdateInput.java | 1 + .../publicapi/models/DestinationV1.java | 1 + .../DisableEdgeFunctions200Response.java | 1 + .../DisableEdgeFunctionsAlphaOutput.java | 1 + .../publicapi/models/Echo200Response.java | 1 + .../publicapi/models/Echo200Response1.java | 1 + .../publicapi/models/EchoAlphaOutput.java | 1 + .../publicapi/models/EchoV1Output.java | 1 + .../publicapi/models/EdgeFunctions.java | 1 + .../publicapi/models/EdgeFunctions1.java | 1 + .../publicapi/models/EdgeFunctionsAlpha.java | 1 + .../publicapi/models/EventSourceV1.java | 1 + .../com/segment/publicapi/models/Filter.java | 1 + .../com/segment/publicapi/models/Filter1.java | 1 + .../com/segment/publicapi/models/Filter2.java | 1 + .../com/segment/publicapi/models/Filter3.java | 1 + .../segment/publicapi/models/Function.java | 1 + .../segment/publicapi/models/Function1.java | 1 + .../segment/publicapi/models/Function2.java | 1 + .../publicapi/models/FunctionDeployment.java | 1 + .../publicapi/models/FunctionSettingV1.java | 1 + .../segment/publicapi/models/FunctionV1.java | 1 + ...eUploadURLForEdgeFunctions200Response.java | 1 + ...eUploadURLForEdgeFunctionsAlphaOutput.java | 1 + ...dSyncScheduleFromWarehouse200Response.java | 1 + ...ncedSyncScheduleFromWarehouseV1Output.java | 1 + ...nnectionStateFromWarehouse200Response.java | 1 + ...tConnectionStateFromWarehouseV1Output.java | 1 + ...ailyPerSourceAPICallsUsage200Response.java | 1 + ...etDailyPerSourceAPICallsUsageV1Output.java | 1 + .../GetDailyPerSourceMTUUsage200Response.java | 1 + .../GetDailyPerSourceMTUUsageV1Output.java | 1 + ...ailyWorkspaceAPICallsUsage200Response.java | 1 + ...etDailyWorkspaceAPICallsUsageV1Output.java | 1 + .../GetDailyWorkspaceMTUUsage200Response.java | 1 + .../GetDailyWorkspaceMTUUsageV1Output.java | 1 + .../models/GetDestination200Response.java | 1 + .../GetDestinationMetadata200Response.java | 1 + .../GetDestinationMetadataV1Output.java | 1 + .../models/GetDestinationV1Output.java | 1 + .../GetDestinationsCatalog200Response.java | 1 + .../GetDestinationsCatalogV1Output.java | 1 + ...tEventsVolumeFromWorkspace200Response.java | 1 + .../GetEventsVolumeFromWorkspaceV1Output.java | 1 + .../GetFilterInDestination200Response.java | 1 + .../GetFilterInDestinationV1Output.java | 1 + .../models/GetFunction200Response.java | 1 + .../publicapi/models/GetFunctionV1Output.java | 1 + ...GetLatestFromEdgeFunctions200Response.java | 1 + ...GetLatestFromEdgeFunctionsAlphaOutput.java | 1 + ...tMessagingSubscriptionFailureResponse.java | 1 + ...tMessagingSubscriptionSuccessResponse.java | 1 + .../models/GetRegulation200Response.java | 1 + .../models/GetRegulationV1Output.java | 1 + .../models/GetSource200Response.java | 1 + .../models/GetSource200Response1.java | 1 + .../models/GetSourceAlphaOutput.java | 1 + .../models/GetSourceMetadata200Response.java | 1 + .../models/GetSourceMetadataV1Output.java | 1 + .../publicapi/models/GetSourceV1Output.java | 1 + .../models/GetSourcesCatalog200Response.java | 1 + .../models/GetSourcesCatalogV1Output.java | 1 + .../publicapi/models/GetSpace200Response.java | 1 + .../publicapi/models/GetSpaceAlphaOutput.java | 1 + ...ubscriptionFromDestination200Response.java | 1 + ...ubscriptionFromDestinationAlphaOutput.java | 1 + .../models/GetSubscriptionRequest.java | 1 + .../models/GetTrackingPlan200Response.java | 1 + .../models/GetTrackingPlanV1Output.java | 1 + .../models/GetTransformation200Response.java | 9 +- .../models/GetTransformationBetaInput.java | 212 ------- .../models/GetTransformationBetaOutput.java | 1 + .../models/GetTransformationV1Output.java | 205 ------- .../publicapi/models/GetUser200Response.java | 1 + .../models/GetUserGroup200Response.java | 1 + .../models/GetUserGroupV1Output.java | 1 + .../publicapi/models/GetUserV1Output.java | 1 + .../models/GetWarehouse200Response.java | 1 + .../GetWarehouseMetadata200Response.java | 1 + .../models/GetWarehouseMetadataV1Output.java | 1 + .../models/GetWarehouseV1Output.java | 1 + .../GetWarehousesCatalog200Response.java | 1 + .../models/GetWarehousesCatalogV1Output.java | 1 + .../models/GetWorkspace200Response.java | 1 + .../models/GetWorkspaceV1Output.java | 1 + .../com/segment/publicapi/models/Group.java | 1 + .../models/GroupSourceSettingsV1.java | 1 + .../segment/publicapi/models/Identify.java | 1 + .../models/IdentifySourceSettingsV1.java | 1 + .../com/segment/publicapi/models/Input.java | 1 + .../models/IntegrationOptionBeta.java | 1 + .../publicapi/models/InvitePermissionV1.java | 1 + .../segment/publicapi/models/InviteV1.java | 1 + .../com/segment/publicapi/models/Label.java | 1 + .../com/segment/publicapi/models/Label1.java | 1 + .../com/segment/publicapi/models/Label2.java | 1 + .../segment/publicapi/models/LabelAlpha.java | 1 + .../com/segment/publicapi/models/LabelV1.java | 1 + .../models/ListAuditEvents200Response.java | 1 + .../models/ListAuditEventsV1Output.java | 1 + ...ctedDestinationsFromSource200Response.java | 1 + ...tedDestinationsFromSource200Response1.java | 1 + ...ctedDestinationsFromSourceAlphaOutput.java | 1 + ...nnectedDestinationsFromSourceV1Output.java | 1 + ...nectedSourcesFromWarehouse200Response.java | 1 + ...ConnectedSourcesFromWarehouseV1Output.java | 1 + ...nectedWarehousesFromSource200Response.java | 1 + ...ectedWarehousesFromSource200Response1.java | 1 + ...nectedWarehousesFromSourceAlphaOutput.java | 1 + ...ConnectedWarehousesFromSourceV1Output.java | 1 + ...ricsSummaryFromDestination200Response.java | 1 + ...tricsSummaryFromDestinationBetaOutput.java | 1 + .../models/ListDestinations200Response.java | 1 + .../models/ListDestinationsV1Output.java | 1 + ...ListFiltersFromDestination200Response.java | 1 + .../ListFiltersFromDestinationV1Output.java | 1 + .../publicapi/models/ListFunctionItemV1.java | 1 + .../models/ListFunctions200Response.java | 1 + .../models/ListFunctionsV1Output.java | 1 + .../models/ListInvites200Response.java | 1 + .../ListInvitesFromUserGroup200Response.java | 1 + .../ListInvitesFromUserGroupV1Output.java | 1 + .../publicapi/models/ListInvitesV1Output.java | 1 + .../models/ListLabels200Response.java | 1 + .../models/ListLabels200Response1.java | 1 + .../models/ListLabelsAlphaOutput.java | 1 + .../publicapi/models/ListLabelsV1Output.java | 1 + .../ListRegulationsFromSource200Response.java | 1 + .../ListRegulationsFromSourceV1Output.java | 1 + .../models/ListRoles200Response.java | 1 + .../publicapi/models/ListRolesV1Output.java | 1 + .../ListRulesFromTrackingPlan200Response.java | 1 + .../ListRulesFromTrackingPlanV1Output.java | 1 + ...ListSchemaSettingsInSource200Response.java | 1 + .../ListSchemaSettingsInSourceV1Output.java | 1 + ...yncsFromWarehouseAndSource200Response.java | 1 + ...veSyncsFromWarehouseAndSourceV1Output.java | 1 + .../models/ListSources200Response.java | 1 + .../models/ListSources200Response1.java | 1 + .../models/ListSourcesAlphaOutput.java | 1 + ...istSourcesFromTrackingPlan200Response.java | 1 + .../ListSourcesFromTrackingPlanV1Output.java | 1 + .../publicapi/models/ListSourcesV1Output.java | 1 + ...bscriptionsFromDestination200Response.java | 1 + ...bscriptionsFromDestinationAlphaOutput.java | 1 + .../models/ListSuppressions200Response.java | 1 + .../models/ListSuppressionsV1Output.java | 1 + .../ListSyncsFromWarehouse200Response.java | 1 + ...yncsFromWarehouseAndSource200Response.java | 1 + ...stSyncsFromWarehouseAndSourceV1Output.java | 1 + .../ListSyncsFromWarehouseV1Output.java | 1 + .../models/ListTrackingPlans200Response.java | 1 + .../models/ListTrackingPlansV1Output.java | 1 + .../ListTransformations200Response.java | 9 +- .../models/ListTransformationsBetaInput.java | 209 ------- .../models/ListTransformationsBetaOutput.java | 1 + .../models/ListTransformationsV1Output.java | 254 -------- .../models/ListUserGroups200Response.java | 1 + .../ListUserGroupsFromUser200Response.java | 1 + .../ListUserGroupsFromUserV1Output.java | 1 + .../models/ListUserGroupsV1Output.java | 1 + .../models/ListUsers200Response.java | 1 + .../ListUsersFromUserGroup200Response.java | 1 + .../ListUsersFromUserGroupV1Output.java | 1 + .../publicapi/models/ListUsersV1Output.java | 1 + .../models/ListWarehouses200Response.java | 1 + .../models/ListWarehousesV1Output.java | 1 + .../ListWorkspaceRegulations200Response.java | 1 + .../ListWorkspaceRegulationsV1Output.java | 1 + .../com/segment/publicapi/models/Logos.java | 1 + .../com/segment/publicapi/models/Logos1.java | 1 + .../com/segment/publicapi/models/Logos2.java | 1 + .../segment/publicapi/models/LogosBeta.java | 1 + .../models/MessageSubscriptionResponse.java | 1 + .../MessageSubscriptionResponseError.java | 1 + .../models/MessagesSubscriptionRequest.java | 1 + .../segment/publicapi/models/Metadata.java | 1 + .../segment/publicapi/models/Metadata1.java | 1 + .../segment/publicapi/models/Metadata2.java | 1 + .../segment/publicapi/models/MetricBeta.java | 1 + .../publicapi/models/MinimalUserGroupV1.java | 1 + .../publicapi/models/MinimalUserV1.java | 1 + .../publicapi/models/MtuSnapshotV1.java | 1 + .../segment/publicapi/models/Pagination.java | 1 + .../segment/publicapi/models/Pagination1.java | 249 -------- .../publicapi/models/PaginationInput.java | 1 + .../publicapi/models/PaginationOutput.java | 1 + .../publicapi/models/PermissionInputV1.java | 1 + .../models/PermissionResourceV1.java | 1 + .../publicapi/models/PermissionV1.java | 1 + .../PreviewDestinationFilter200Response.java | 1 + .../models/PreviewDestinationFilterV1.java | 1 + .../PreviewDestinationFilterV1Input.java | 1 + .../PreviewDestinationFilterV1Output.java | 1 + .../publicapi/models/PropertyRenameBeta.java | 1 + .../publicapi/models/PropertyRenameV1.java | 246 -------- .../PropertyValueTransformationBeta.java | 1 + .../models/PropertyValueTransformationV1.java | 266 -------- .../segment/publicapi/models/Regulation.java | 1 + .../models/RegulationListEntryV1.java | 1 + ...emoveFilterFromDestination200Response.java | 1 + .../RemoveFilterFromDestinationV1Output.java | 1 + .../publicapi/models/RemoveRuleV1.java | 1 + ...emoveRulesFromTrackingPlan200Response.java | 1 + .../RemoveRulesFromTrackingPlanV1Output.java | 1 + ...rceConnectionFromWarehouse200Response.java | 1 + ...SourceConnectionFromWarehouseV1Output.java | 1 + ...moveSourceFromTrackingPlan200Response.java | 1 + .../RemoveSourceFromTrackingPlanV1Output.java | 1 + ...ubscriptionFromDestination200Response.java | 1 + ...ubscriptionFromDestinationAlphaOutput.java | 1 + .../RemoveUsersFromUserGroup200Response.java | 1 + .../RemoveUsersFromUserGroupV1Output.java | 1 + ...edSyncScheduleForWarehouse200Response.java | 1 + ...vancedSyncScheduleForWarehouseV1Input.java | 1 + ...ancedSyncScheduleForWarehouseV1Output.java | 1 + .../ReplaceLabelsInSource200Response.java | 1 + .../ReplaceLabelsInSource200Response1.java | 1 + .../ReplaceLabelsInSourceAlphaInput.java | 1 + .../ReplaceLabelsInSourceAlphaOutput.java | 1 + .../models/ReplaceLabelsInSourceV1Input.java | 1 + .../models/ReplaceLabelsInSourceV1Output.java | 1 + ...agingSubscriptionsInSpaces200Response.java | 1 + ...sagingSubscriptionsInSpacesAlphaInput.java | 1 + ...agingSubscriptionsInSpacesAlphaOutput.java | 1 + .../ReplacePermissionsForUser200Response.java | 1 + ...acePermissionsForUserGroup200Response.java | 1 + ...ReplacePermissionsForUserGroupV1Input.java | 1 + ...eplacePermissionsForUserGroupV1Output.java | 1 + .../ReplacePermissionsForUserV1Input.java | 1 + .../ReplacePermissionsForUserV1Output.java | 1 + ...ReplaceRulesInTrackingPlan200Response.java | 1 + .../ReplaceRulesInTrackingPlanV1Input.java | 1 + .../ReplaceRulesInTrackingPlanV1Output.java | 1 + .../ReplaceUsersInUserGroup200Response.java | 1 + .../ReplaceUsersInUserGroupV1Input.java | 1 + .../ReplaceUsersInUserGroupV1Output.java | 1 + .../publicapi/models/RequestError.java | 1 + .../models/RequestErrorEnvelope.java | 1 + .../segment/publicapi/models/ResourceV1.java | 1 + .../com/segment/publicapi/models/RoleV1.java | 1 + .../com/segment/publicapi/models/RuleV1.java | 1 + .../segment/publicapi/models/Schedule.java | 1 + .../segment/publicapi/models/Schedule1.java | 1 + .../segment/publicapi/models/Schedule2.java | 1 + .../segment/publicapi/models/Settings.java | 1 + .../segment/publicapi/models/Settings1.java | 1 + .../com/segment/publicapi/models/Source.java | 1 + .../com/segment/publicapi/models/Source1.java | 1 + .../com/segment/publicapi/models/Source2.java | 1 + .../com/segment/publicapi/models/Source3.java | 1 + .../com/segment/publicapi/models/Source4.java | 1 + .../com/segment/publicapi/models/Source5.java | 1 + .../com/segment/publicapi/models/Source6.java | 1 + .../models/SourceAPICallSnapshotV1.java | 1 + .../segment/publicapi/models/SourceAlpha.java | 1 + .../models/SourceEventVolumeDatapointV1.java | 1 + .../publicapi/models/SourceEventVolumeV1.java | 1 + .../publicapi/models/SourceMetadata.java | 1 + .../publicapi/models/SourceMetadataV1.java | 1 + .../models/SourceSettingsOutputV1.java | 1 + .../segment/publicapi/models/SourceV1.java | 1 + .../com/segment/publicapi/models/Space.java | 1 + .../publicapi/models/StreamStatusV1.java | 1 + .../publicapi/models/Subscription.java | 1 + .../publicapi/models/SupportedFeatures.java | 1 + .../publicapi/models/SupportedMethods.java | 1 + .../publicapi/models/SupportedPlatforms.java | 1 + .../publicapi/models/SuppressedInner.java | 1 + .../publicapi/models/SyncNoticeV1.java | 1 + .../com/segment/publicapi/models/SyncV1.java | 1 + .../com/segment/publicapi/models/Track.java | 1 + .../models/TrackSourceSettingsV1.java | 1 + .../publicapi/models/TrackingPlan.java | 1 + .../publicapi/models/TrackingPlan1.java | 1 + .../publicapi/models/TrackingPlanV1.java | 1 + .../publicapi/models/Transformation.java | 1 + .../publicapi/models/Transformation1.java | 1 + .../publicapi/models/Transformation2.java | 1 + .../publicapi/models/Transformation3.java | 570 ----------------- .../publicapi/models/Transformation4.java | 570 ----------------- .../publicapi/models/Transformation5.java | 570 ----------------- .../publicapi/models/TransformationBeta.java | 1 + .../publicapi/models/TransformationV1.java | 571 ------------------ .../models/UpdateDestination200Response.java | 1 + .../models/UpdateDestinationV1Input.java | 1 + .../models/UpdateDestinationV1Output.java | 1 + ...UpdateFilterForDestination200Response.java | 1 + .../UpdateFilterForDestinationV1Input.java | 1 + .../UpdateFilterForDestinationV1Output.java | 1 + .../models/UpdateFunction200Response.java | 1 + .../models/UpdateFunctionV1Input.java | 1 + .../models/UpdateFunctionV1Output.java | 1 + .../UpdateRulesInTrackingPlan200Response.java | 1 + .../UpdateRulesInTrackingPlanV1Input.java | 1 + .../UpdateRulesInTrackingPlanV1Output.java | 1 + ...dateSchemaSettingsInSource200Response.java | 1 + .../UpdateSchemaSettingsInSourceV1Input.java | 1 + .../UpdateSchemaSettingsInSourceV1Output.java | 1 + ...eSelectiveSyncForWarehouse200Response.java | 1 + ...pdateSelectiveSyncForWarehouseV1Input.java | 1 + ...dateSelectiveSyncForWarehouseV1Output.java | 1 + .../models/UpdateSource200Response.java | 1 + .../models/UpdateSource200Response1.java | 1 + .../models/UpdateSourceAlphaInput.java | 1 + .../models/UpdateSourceAlphaOutput.java | 1 + .../publicapi/models/UpdateSourceV1Input.java | 1 + .../models/UpdateSourceV1Output.java | 1 + ...SubscriptionForDestination200Response.java | 1 + ...eSubscriptionForDestinationAlphaInput.java | 1 + ...SubscriptionForDestinationAlphaOutput.java | 1 + .../models/UpdateTrackingPlan200Response.java | 1 + .../models/UpdateTrackingPlanV1Input.java | 1 + .../models/UpdateTrackingPlanV1Output.java | 1 + .../UpdateTransformation200Response.java | 9 +- .../models/UpdateTransformationBetaInput.java | 51 +- .../UpdateTransformationBetaOutput.java | 1 + .../models/UpdateTransformationV1Input.java | 524 ---------------- .../models/UpdateTransformationV1Output.java | 209 ------- .../models/UpdateUserGroup200Response.java | 1 + .../models/UpdateUserGroupV1Input.java | 1 + .../models/UpdateUserGroupV1Output.java | 1 + .../models/UpdateWarehouse200Response.java | 1 + .../models/UpdateWarehouseV1Input.java | 1 + .../models/UpdateWarehouseV1Output.java | 1 + .../publicapi/models/UpsertRuleV1.java | 1 + .../com/segment/publicapi/models/User.java | 1 + .../segment/publicapi/models/UserGroup.java | 1 + .../segment/publicapi/models/UserGroup1.java | 1 + .../segment/publicapi/models/UserGroup2.java | 1 + .../segment/publicapi/models/UserGroup3.java | 1 + .../segment/publicapi/models/UserGroupV1.java | 1 + .../com/segment/publicapi/models/UserV1.java | 1 + .../models/UsersPerSourceSnapshotV1.java | 1 + .../segment/publicapi/models/Warehouse.java | 1 + .../segment/publicapi/models/Warehouse1.java | 1 + .../segment/publicapi/models/Warehouse2.java | 1 + .../models/WarehouseAdvancedSyncV1.java | 1 + .../publicapi/models/WarehouseMetadata.java | 1 + .../publicapi/models/WarehouseMetadataV1.java | 1 + .../models/WarehouseSelectiveSyncItemV1.java | 1 + .../models/WarehouseSyncOverrideV1.java | 1 + .../segment/publicapi/models/WarehouseV1.java | 1 + .../segment/publicapi/models/Workspace.java | 1 + .../segment/publicapi/models/WorkspaceV1.java | 1 + .../segment/publicapi/api/EchoApiTest.java | 1 + 522 files changed, 592 insertions(+), 6071 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/Pagination1.java delete mode 100644 src/main/java/com/segment/publicapi/models/PropertyRenameV1.java delete mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation3.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation4.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation5.java delete mode 100644 src/main/java/com/segment/publicapi/models/TransformationV1.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java diff --git a/README.md b/README.md index f196eeac..08be087c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 33.0.1 +- API version: 32.0.4 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -35,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 33.0.1 + 32.0.4 compile ``` @@ -51,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:33.0.1" + implementation "com.segment.publicapi:segment-publicapi:32.0.4" } ``` @@ -65,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-33.0.1.jar` +* `target/segment-publicapi-32.0.4.jar` * `target/lib/*.jar` ## Getting Started diff --git a/pom.xml b/pom.xml index 33258863..0bafff52 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 33.0.1 + 32.0.4 https://segment.com/docs/api/public-api/ Segment Public API @@ -251,7 +251,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + 1.5 sign-artifacts @@ -259,12 +259,6 @@ sign - - - --pinentry-mode - loopback - - diff --git a/src/main/java/com/segment/publicapi/ApiCallback.java b/src/main/java/com/segment/publicapi/ApiCallback.java index db3c5648..12817a96 100644 --- a/src/main/java/com/segment/publicapi/ApiCallback.java +++ b/src/main/java/com/segment/publicapi/ApiCallback.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 5a5425d6..076b5ccb 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -124,7 +125,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/33.0.1/java"); + setUserAgent("OpenAPI-Generator/32.0.4/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/ApiException.java b/src/main/java/com/segment/publicapi/ApiException.java index 3957eb2d..c0590044 100644 --- a/src/main/java/com/segment/publicapi/ApiException.java +++ b/src/main/java/com/segment/publicapi/ApiException.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiResponse.java b/src/main/java/com/segment/publicapi/ApiResponse.java index 00009055..95a241ca 100644 --- a/src/main/java/com/segment/publicapi/ApiResponse.java +++ b/src/main/java/com/segment/publicapi/ApiResponse.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ccfab24f..f3510d54 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java index 299cc535..89734910 100644 --- a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java +++ b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 5c5a4363..b2e7690b 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -301,12 +302,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateTransformationV1Input - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateUserGroup200Response .CustomTypeAdapterFactory()); @@ -392,15 +387,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformation200Response .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeleteTransformationBetaInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeleteTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteUserGroup200Response .CustomTypeAdapterFactory()); @@ -643,15 +632,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformation200Response .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetTransformationBetaInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -866,15 +849,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformations200Response .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListTransformationsBetaInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformationsBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListTransformationsV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUserGroups200Response .CustomTypeAdapterFactory()); @@ -940,8 +917,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Pagination1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -966,14 +941,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PropertyValueTransformationV1 - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1174,16 +1144,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation4.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation5.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); @@ -1278,12 +1240,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateTransformationV1Input - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateUserGroup200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/Pair.java b/src/main/java/com/segment/publicapi/Pair.java index 22993e8a..554b2d48 100644 --- a/src/main/java/com/segment/publicapi/Pair.java +++ b/src/main/java/com/segment/publicapi/Pair.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressRequestBody.java b/src/main/java/com/segment/publicapi/ProgressRequestBody.java index 23559aa2..2062a60c 100644 --- a/src/main/java/com/segment/publicapi/ProgressRequestBody.java +++ b/src/main/java/com/segment/publicapi/ProgressRequestBody.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressResponseBody.java b/src/main/java/com/segment/publicapi/ProgressResponseBody.java index 046276c6..84e4814b 100644 --- a/src/main/java/com/segment/publicapi/ProgressResponseBody.java +++ b/src/main/java/com/segment/publicapi/ProgressResponseBody.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/StringUtil.java b/src/main/java/com/segment/publicapi/StringUtil.java index 5bbb1bf5..f533c942 100644 --- a/src/main/java/com/segment/publicapi/StringUtil.java +++ b/src/main/java/com/segment/publicapi/StringUtil.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java index 07b2e8a4..7baa42a7 100644 --- a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java +++ b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index eee8b577..fd4bdf76 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/CatalogApi.java b/src/main/java/com/segment/publicapi/api/CatalogApi.java index 3420f385..bb64a28f 100644 --- a/src/main/java/com/segment/publicapi/api/CatalogApi.java +++ b/src/main/java/com/segment/publicapi/api/CatalogApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index cde51e20..a9119a95 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index 1f450fcd..c13b08e6 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 2297595b..317de9ff 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index 8ab3a094..330e2267 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index 7e7dccd4..2603a05c 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 446bcd40..296f31d3 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index 76d10223..1d91f5f7 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamRolesApi.java b/src/main/java/com/segment/publicapi/api/IamRolesApi.java index 49aeda33..f7ebf845 100644 --- a/src/main/java/com/segment/publicapi/api/IamRolesApi.java +++ b/src/main/java/com/segment/publicapi/api/IamRolesApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 64d7fecb..344fe567 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index 497cb9ca..65054ab9 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java index 882dbfea..551177e8 100644 --- a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 3c2de758..6c478d04 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index 240ddb5c..ef46d677 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 150f573a..9aa5c813 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TestingApi.java b/src/main/java/com/segment/publicapi/api/TestingApi.java index cf623c60..f88ba694 100644 --- a/src/main/java/com/segment/publicapi/api/TestingApi.java +++ b/src/main/java/com/segment/publicapi/api/TestingApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index 93b89e46..4f781ceb 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index a9d289fc..85e4a26e 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,13 +21,13 @@ import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateTransformation200Response; -import com.segment.publicapi.models.CreateTransformationV1Input; +import com.segment.publicapi.models.CreateTransformationBetaInput; import com.segment.publicapi.models.DeleteTransformation200Response; import com.segment.publicapi.models.GetTransformation200Response; import com.segment.publicapi.models.ListTransformations200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateTransformation200Response; -import com.segment.publicapi.models.UpdateTransformationV1Input; +import com.segment.publicapi.models.UpdateTransformationBetaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -73,7 +74,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTransformation * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -87,7 +88,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * */ public okhttp3.Call createTransformationCall( - CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -102,7 +104,7 @@ public okhttp3.Call createTransformationCall( basePath = null; } - Object localVarPostBody = createTransformationV1Input; + Object localVarPostBody = createTransformationBetaInput; // create path and map variables String localVarPath = "/transformations"; @@ -114,10 +116,9 @@ public okhttp3.Call createTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -125,9 +126,7 @@ public okhttp3.Call createTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1+json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -152,18 +151,19 @@ public okhttp3.Call createTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call createTransformationValidateBeforeCall( - CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTransformationV1Input' is set - if (createTransformationV1Input == null) { + // verify the required parameter 'createTransformationBetaInput' is set + if (createTransformationBetaInput == null) { throw new ApiException( - "Missing the required parameter 'createTransformationV1Input' when calling" + "Missing the required parameter 'createTransformationBetaInput' when calling" + " createTransformation(Async)"); } okhttp3.Call localVarCall = - createTransformationCall(createTransformationV1Input, _callback); + createTransformationCall(createTransformationBetaInput, _callback); return localVarCall; } @@ -173,7 +173,7 @@ private okhttp3.Call createTransformationValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @return CreateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -187,9 +187,9 @@ private okhttp3.Call createTransformationValidateBeforeCall( * */ public CreateTransformation200Response createTransformation( - CreateTransformationV1Input createTransformationV1Input) throws ApiException { + CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { ApiResponse localVarResp = - createTransformationWithHttpInfo(createTransformationV1Input); + createTransformationWithHttpInfo(createTransformationBetaInput); return localVarResp.getData(); } @@ -199,7 +199,7 @@ public CreateTransformation200Response createTransformation( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @return ApiResponse<CreateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -213,9 +213,9 @@ public CreateTransformation200Response createTransformation( * */ public ApiResponse createTransformationWithHttpInfo( - CreateTransformationV1Input createTransformationV1Input) throws ApiException { + CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationV1Input, null); + createTransformationValidateBeforeCall(createTransformationBetaInput, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -227,7 +227,7 @@ public ApiResponse createTransformationWithHttp * to have the Protocols feature enabled. Please reach out to your customer success manager for * more information. * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -242,12 +242,12 @@ public ApiResponse createTransformationWithHttp * */ public okhttp3.Call createTransformationAsync( - CreateTransformationV1Input createTransformationV1Input, + CreateTransformationBetaInput createTransformationBetaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationV1Input, _callback); + createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -299,10 +299,9 @@ public okhttp3.Call deleteTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -477,10 +476,9 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -607,7 +605,7 @@ public okhttp3.Call getTransformationAsync( /** * Build call for listTransformations * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -651,10 +649,9 @@ public okhttp3.Call listTransformationsCall( } final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -704,7 +701,7 @@ private okhttp3.Call listTransformationsValidateBeforeCall( * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @return ListTransformations200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -729,7 +726,7 @@ public ListTransformations200Response listTransformations(PaginationInput pagina * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @return ApiResponse<ListTransformations200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -755,7 +752,7 @@ public ApiResponse listTransformationsWithHttpIn * Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -782,7 +779,7 @@ public okhttp3.Call listTransformationsAsync( * Build call for updateTransformation * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -797,7 +794,7 @@ public okhttp3.Call listTransformationsAsync( */ public okhttp3.Call updateTransformationCall( String transformationId, - UpdateTransformationV1Input updateTransformationV1Input, + UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -813,7 +810,7 @@ public okhttp3.Call updateTransformationCall( basePath = null; } - Object localVarPostBody = updateTransformationV1Input; + Object localVarPostBody = updateTransformationBetaInput; // create path and map variables String localVarPath = @@ -829,10 +826,9 @@ public okhttp3.Call updateTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -840,9 +836,7 @@ public okhttp3.Call updateTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1+json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -868,7 +862,7 @@ public okhttp3.Call updateTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateTransformationValidateBeforeCall( String transformationId, - UpdateTransformationV1Input updateTransformationV1Input, + UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { @@ -879,15 +873,16 @@ private okhttp3.Call updateTransformationValidateBeforeCall( + " updateTransformation(Async)"); } - // verify the required parameter 'updateTransformationV1Input' is set - if (updateTransformationV1Input == null) { + // verify the required parameter 'updateTransformationBetaInput' is set + if (updateTransformationBetaInput == null) { throw new ApiException( - "Missing the required parameter 'updateTransformationV1Input' when calling" + "Missing the required parameter 'updateTransformationBetaInput' when calling" + " updateTransformation(Async)"); } okhttp3.Call localVarCall = - updateTransformationCall(transformationId, updateTransformationV1Input, _callback); + updateTransformationCall( + transformationId, updateTransformationBetaInput, _callback); return localVarCall; } @@ -899,7 +894,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * information. * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @return UpdateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -913,10 +908,10 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * */ public UpdateTransformation200Response updateTransformation( - String transformationId, UpdateTransformationV1Input updateTransformationV1Input) + String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) throws ApiException { ApiResponse localVarResp = - updateTransformationWithHttpInfo(transformationId, updateTransformationV1Input); + updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); return localVarResp.getData(); } @@ -928,7 +923,7 @@ public UpdateTransformation200Response updateTransformation( * information. * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @return ApiResponse<UpdateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -942,11 +937,11 @@ public UpdateTransformation200Response updateTransformation( * */ public ApiResponse updateTransformationWithHttpInfo( - String transformationId, UpdateTransformationV1Input updateTransformationV1Input) + String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationV1Input, null); + transformationId, updateTransformationBetaInput, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -959,7 +954,7 @@ public ApiResponse updateTransformationWithHttp * more information. * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -975,13 +970,13 @@ public ApiResponse updateTransformationWithHttp */ public okhttp3.Call updateTransformationAsync( String transformationId, - UpdateTransformationV1Input updateTransformationV1Input, + UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationV1Input, _callback); + transformationId, updateTransformationBetaInput, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index fd3e3a0a..18c61db3 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index 88cc0252..b898a98f 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java index 6372e883..035d232e 100644 --- a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java +++ b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/Authentication.java b/src/main/java/com/segment/publicapi/auth/Authentication.java index 34b1e2a0..c314af4f 100644 --- a/src/main/java/com/segment/publicapi/auth/Authentication.java +++ b/src/main/java/com/segment/publicapi/auth/Authentication.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java index 5937daea..dd20d918 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java index 8283d8d5..bea680bd 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java index 71c11dfb..ff712688 100644 --- a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java index 3fd41e26..7a6f9656 100644 --- a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java +++ b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java index c69bf1da..3b78aca0 100644 --- a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java index 4aa990b8..c578bc4e 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java index 2ad0ea0c..bcccaf5d 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java index 16a66188..6350d7bf 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java index 2df1ce49..2f509fd7 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java index 3a8d626a..6eeaa66d 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java index c23c2328..56866e6c 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index c9797897..ababcf0c 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java index 43d77c84..4f5a39ee 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java index 3bc9125b..7db3a09b 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java index 5cf1b40d..e28d02bf 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index 65c45470..d8e4c71c 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java index c0d998d3..f1e77ba0 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index f05fdea4..29e51270 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java index d56acb1a..5beb00f4 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java index 218be362..0374116b 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index a7d972b4..ad0a5fc0 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java index a124522d..e339cfa8 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java index 0d0a8aa4..60b26d7d 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index b5ac724d..183ff889 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java index 22ac54e6..b3361af9 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java index 40854f1b..f8251644 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java index 447d6bd0..4a7cc1ea 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java index 54a2513e..6b214ea3 100644 --- a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java +++ b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AuditEventV1.java b/src/main/java/com/segment/publicapi/models/AuditEventV1.java index b18b34c2..5eb4ba7b 100644 --- a/src/main/java/com/segment/publicapi/models/AuditEventV1.java +++ b/src/main/java/com/segment/publicapi/models/AuditEventV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java index 41432dec..23138a97 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java index a2bf8420..953c4217 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java index 88a61351..7913e1ce 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java index 0cfb4fb4..a0858f78 100644 --- a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java +++ b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java index 82e71b3d..629f773d 100644 --- a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index 3842f54b..649c3664 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java index 715fc67d..cadf8f61 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 3953116d..17bb737d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -39,6 +40,8 @@ public class CreateCloudSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { + BULK_DELETE_ONLY("BULK_DELETE_ONLY"), + DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java index b6c44c50..15ee4f6c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java index daa6ee08..61c2c2b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java index 8c13d1ad..d996b509 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index 4c106b62..6fbf273a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java index a1aebc9c..9981793c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java index 97115eb2..7d2163ab 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java index c91dc3ae..23f751b2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java index 34705ffe..86d552c8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java index 973ce203..89a9adaf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java index 10e0cd9f..1ed058da 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java index 13ee2c71..75c95647 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index 9bf68b50..b3b85ac1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java index ed49daa7..1101d177 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java index dc517738..6ef412c2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java index 74089c12..9934d7a3 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java index 09c5e0ad..3c80d404 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 9bc33f12..49f961a5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java index 8499d551..5c3c6767 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java index 35dec0b5..6760324e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java index a73beefd..5f1c280d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java index 72d1571d..c173fb9d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java index 938c3747..d71b8d08 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java index f1774f85..e64d84f8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java index 80d4882c..1139acbe 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java index 6a49977b..6de301bd 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index 4929d123..77b39b39 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index ef6b38b7..3213637c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java index d9a27ae2..e3814147 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java index 8af37cbb..78461580 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java index 079c3b67..822b86d2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java index 5615bb4b..673dd8f9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java index 53577e8b..6f36f4d4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 83460e0d..2345d64b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -39,6 +40,8 @@ public class CreateSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { + BULK_DELETE_ONLY("BULK_DELETE_ONLY"), + DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java index ddc99706..e56ee96e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index f97aa16a..3f993547 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java index 289c41e8..db520440 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java index 32b68deb..9f64dd07 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index 199d6774..c0dbe528 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java index ed4840d6..cece15d2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 09fbf5fa..408667f6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,11 +35,11 @@ public class CreateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private CreateTransformationV1Output data; + private CreateTransformationBetaOutput data; public CreateTransformation200Response() {} - public CreateTransformation200Response data(CreateTransformationV1Output data) { + public CreateTransformation200Response data(CreateTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +52,11 @@ public CreateTransformation200Response data(CreateTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public CreateTransformationV1Output getData() { + public CreateTransformationBetaOutput getData() { return data; } - public void setData(CreateTransformationV1Output data) { + public void setData(CreateTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 998e2f7b..3948d986 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java index f0a448c0..3b935df5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java deleted file mode 100644 index 9cd2178c..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input to create a Transformation. */ -@ApiModel(description = "The input to create a Transformation.") -public class CreateTransformationV1Input { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public CreateTransformationV1Input() {} - - public CreateTransformationV1Input name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CreateTransformationV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source to be associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source to be associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public CreateTransformationV1Input destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata id to be associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The optional Destination metadata id to be associated with the" - + " Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public CreateTransformationV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation should be enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public CreateTransformationV1Input _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public CreateTransformationV1Input newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public CreateTransformationV1Input propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public CreateTransformationV1Input addPropertyRenamesItem( - PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public CreateTransformationV1Input propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public CreateTransformationV1Input addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateTransformationV1Input createTransformationV1Input = (CreateTransformationV1Input) o; - return Objects.equals(this.name, createTransformationV1Input.name) - && Objects.equals(this.sourceId, createTransformationV1Input.sourceId) - && Objects.equals( - this.destinationMetadataId, - createTransformationV1Input.destinationMetadataId) - && Objects.equals(this.enabled, createTransformationV1Input.enabled) - && Objects.equals(this._if, createTransformationV1Input._if) - && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) - && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - createTransformationV1Input.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformationV1Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTransformationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateTransformationV1Input is not" - + " found in the empty JSON string", - CreateTransformationV1Input.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateTransformationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTransformationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformationV1Input' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationV1Input.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformationV1Input value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateTransformationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateTransformationV1Input - */ - public static CreateTransformationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformationV1Input.class); - } - - /** - * Convert an instance of CreateTransformationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java deleted file mode 100644 index a604790d..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of a created Transformation. */ -@ApiModel(description = "The output of a created Transformation.") -public class CreateTransformationV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation5 transformation; - - public CreateTransformationV1Output() {} - - public CreateTransformationV1Output transformation(Transformation5 transformation) { - - this.transformation = transformation; - return this; - } - - /** - * Get transformation - * - * @return transformation - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation5 getTransformation() { - return transformation; - } - - public void setTransformation(Transformation5 transformation) { - this.transformation = transformation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateTransformationV1Output createTransformationV1Output = - (CreateTransformationV1Output) o; - return Objects.equals(this.transformation, createTransformationV1Output.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformationV1Output {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * CreateTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateTransformationV1Output is not" - + " found in the empty JSON string", - CreateTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to - * CreateTransformationV1Output - */ - public static CreateTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformationV1Output.class); - } - - /** - * Convert an instance of CreateTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java index bf6b8915..8be574e1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java index 4ab3946d..bf769efc 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java index 49cc207c..e750b2e2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java index 3e90d7de..73110d39 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java index d33b85a9..7b7f3402 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java index 25d6304f..95ba9a3e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java index 42f07a8a..c4f557b1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index 114151a0..e8ec13c8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java index fde81683..30777dac 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java index 5796f9c4..458f9990 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index 64bf8ae4..b841249b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -39,6 +40,8 @@ public class CreateWorkspaceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { + BULK_DELETE_ONLY("BULK_DELETE_ONLY"), + DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java index c3029deb..39c2bf7f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java index dae26210..62576565 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java index beed4187..cc72f524 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java index 8b391862..f4764bb7 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java index 1699c4c3..235daeb4 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java index 7fd77240..1d215577 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java index b7cea68f..24ae6f08 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java index d7ee648c..2fe7c3ee 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java index b15bcbd3..2f2eff55 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java index b3fd978d..d249a822 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java index 9dd7d052..c68c0e08 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java index d4d8d54c..da2d4e2e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java index 132a2b46..b033fc03 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java index b4d0408d..5e1a34dd 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java index aaa42bf6..e45d3c7e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java index f1fe0e84..1d96829d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java index 48ef8de7..f05522d2 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java index 8ef1d630..4636fad0 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java index acf621c8..689bd19d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index cbd4a7ab..f589305d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,11 +35,11 @@ public class DeleteTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTransformationV1Output data; + private DeleteTransformationBetaOutput data; public DeleteTransformation200Response() {} - public DeleteTransformation200Response data(DeleteTransformationV1Output data) { + public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +52,11 @@ public DeleteTransformation200Response data(DeleteTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public DeleteTransformationV1Output getData() { + public DeleteTransformationBetaOutput getData() { return data; } - public void setData(DeleteTransformationV1Output data) { + public void setData(DeleteTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java deleted file mode 100644 index ca8b1fef..00000000 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input of delete Transformation. */ -@ApiModel(description = "The input of delete Transformation.") -public class DeleteTransformationBetaInput { - public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) - private String transformationId; - - public DeleteTransformationBetaInput() {} - - public DeleteTransformationBetaInput transformationId(String transformationId) { - - this.transformationId = transformationId; - return this; - } - - /** - * The Transformation id. - * - * @return transformationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Transformation id.") - public String getTransformationId() { - return transformationId; - } - - public void setTransformationId(String transformationId) { - this.transformationId = transformationId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteTransformationBetaInput deleteTransformationBetaInput = - (DeleteTransformationBetaInput) o; - return Objects.equals( - this.transformationId, deleteTransformationBetaInput.transformationId); - } - - @Override - public int hashCode() { - return Objects.hash(transformationId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTransformationBetaInput {\n"); - sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformationId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformationId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * DeleteTransformationBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DeleteTransformationBetaInput is not" - + " found in the empty JSON string", - DeleteTransformationBetaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTransformationBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("transformationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformationId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transformationId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTransformationBetaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeleteTransformationBetaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTransformationBetaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTransformationBetaInput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteTransformationBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTransformationBetaInput - * @throws IOException if the JSON string is invalid with respect to - * DeleteTransformationBetaInput - */ - public static DeleteTransformationBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaInput.class); - } - - /** - * Convert an instance of DeleteTransformationBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java index 68b39cfe..7e945d45 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java deleted file mode 100644 index 083b4b8b..00000000 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of delete Transformation. */ -@ApiModel(description = "The output of delete Transformation.") -public class DeleteTransformationV1Output { - /** The operation status. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public DeleteTransformationV1Output() {} - - public DeleteTransformationV1Output status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The operation status. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteTransformationV1Output deleteTransformationV1Output = - (DeleteTransformationV1Output) o; - return Objects.equals(this.status, deleteTransformationV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTransformationV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * DeleteTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DeleteTransformationV1Output is not" - + " found in the empty JSON string", - DeleteTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeleteTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to - * DeleteTransformationV1Output - */ - public static DeleteTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTransformationV1Output.class); - } - - /** - * Convert an instance of DeleteTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java index f785970f..96d43d9e 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java index 32270d94..5c4ebfbb 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java index 7c765184..5fe2f85c 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java index 8c742d42..a9f74677 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java index 000932c5..95c7c25f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java index 73f7ddf4..12046fd1 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java index 6a8b6a28..9b9a1b5e 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java index b1189d62..322a5a9f 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java index 05b4e882..fd2cba60 100644 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ b/src/main/java/com/segment/publicapi/models/Destination.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination1.java b/src/main/java/com/segment/publicapi/models/Destination1.java index 13fa3a1d..61a64d3c 100644 --- a/src/main/java/com/segment/publicapi/models/Destination1.java +++ b/src/main/java/com/segment/publicapi/models/Destination1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination2.java b/src/main/java/com/segment/publicapi/models/Destination2.java index d38d901c..dca4749c 100644 --- a/src/main/java/com/segment/publicapi/models/Destination2.java +++ b/src/main/java/com/segment/publicapi/models/Destination2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java index 9b9555da..476611b3 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java index f27aaff2..1309d666 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java index ffce6c4c..f84d64ae 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index ff882290..315cb2f2 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java index 140737ad..cf87abc3 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java index 3ee7b033..665a5c94 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java index d7e0e31b..5ea8e9b8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java index d9db7c1f..43bd017e 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index ae0311d7..bb95447f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java index 0ecd0dc4..6291c65d 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index c873b90e..23f73803 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index c62376c8..8c2247bd 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 278abe79..c365875f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 79c4df32..8b37ae24 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationV1.java b/src/main/java/com/segment/publicapi/models/DestinationV1.java index 5c9cbadc..29775c10 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java index 35941304..af52e869 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java index 47feb531..18d83c41 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response.java b/src/main/java/com/segment/publicapi/models/Echo200Response.java index 9ede64cf..a6f12160 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response1.java b/src/main/java/com/segment/publicapi/models/Echo200Response1.java index f52588e1..eb00f98b 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response1.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java index 41a57d7b..923673f4 100644 --- a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoV1Output.java b/src/main/java/com/segment/publicapi/models/EchoV1Output.java index 5f1aa64a..1772428d 100644 --- a/src/main/java/com/segment/publicapi/models/EchoV1Output.java +++ b/src/main/java/com/segment/publicapi/models/EchoV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java index 338033ac..67c54a71 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java index 9816c2c9..3a0b7c3f 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java index 38106812..5b0a52dd 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EventSourceV1.java b/src/main/java/com/segment/publicapi/models/EventSourceV1.java index a09f5ee3..8285c002 100644 --- a/src/main/java/com/segment/publicapi/models/EventSourceV1.java +++ b/src/main/java/com/segment/publicapi/models/EventSourceV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index 7bdd81cf..48a45b5d 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter1.java b/src/main/java/com/segment/publicapi/models/Filter1.java index d5668ad5..e6e192ee 100644 --- a/src/main/java/com/segment/publicapi/models/Filter1.java +++ b/src/main/java/com/segment/publicapi/models/Filter1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter2.java b/src/main/java/com/segment/publicapi/models/Filter2.java index 1fd399cc..9816aabd 100644 --- a/src/main/java/com/segment/publicapi/models/Filter2.java +++ b/src/main/java/com/segment/publicapi/models/Filter2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter3.java b/src/main/java/com/segment/publicapi/models/Filter3.java index 79d03d6d..0cab7a1e 100644 --- a/src/main/java/com/segment/publicapi/models/Filter3.java +++ b/src/main/java/com/segment/publicapi/models/Filter3.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index f20febe4..90744e66 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java index 8059f0f2..c1ba336d 100644 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ b/src/main/java/com/segment/publicapi/models/Function1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java index 7bba1c6a..02352bca 100644 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ b/src/main/java/com/segment/publicapi/models/Function2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java index 332de392..e49f77b0 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java +++ b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index 68bd50c8..04239fea 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index c6717cbd..0c8d3040 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java index 2895f2e6..52206370 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java index d95c3415..244d2137 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java index 06b67556..b34cdc68 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java index 3b5ae269..2c81cdf1 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java index de27e86d..f869f742 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java index 375eb53b..9ba59b4d 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java index 8b95688c..8c68b0af 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java index bfe0632a..2f892244 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java index 7a2d4c51..b2df4897 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java index 6165cdb1..97416945 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java index 2a03891a..527113c0 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java index 0a330153..fd0382d7 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java index 17ca7e58..6d20b0a7 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java index 134e3b03..cc181bce 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java index 3c7a9f62..11e1c5d1 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java index 3e367243..a73a66ba 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java index 05203813..740dbd1d 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java index 310066ce..c33e5aeb 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java index c434bd56..729c746f 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java index 788d04fc..3699e373 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java index 5aa6c994..cf4ab1a8 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 1add9558..8fdebbb8 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java index 87bfa0da..40be0ad8 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java index 026b969b..5408adb4 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java index 544dac87..705108ed 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 77863757..8f033da8 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java index d4af1202..ccf11178 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java index 214cfe31..c85bd26c 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java index 56bd4447..a2a0a7f5 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index 67f7241e..b99eb3bc 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java index fdeed139..0dd11ed8 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java index 273b74bf..510f4e65 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response.java b/src/main/java/com/segment/publicapi/models/GetSource200Response.java index 60e095a6..093d3670 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java index 2f7373d1..ebae583f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java index 6dd120ea..74654c79 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java index 2b8118fe..eccf971c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java index 9476806e..1f632a6e 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index 5755a188..28e1e965 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java index 545b763c..87960d57 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java index f79c0853..089be53c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java index 48da4cb4..016ee221 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java index 1fb9ef76..83d9e895 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java index 5acade54..2b346779 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java index 5f90146a..e978c45f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index bf7c207f..9c0f579c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java index 63a56dac..ab9bbecc 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java index ef7b3edc..7cc02cb0 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index 937d1985..fca531e7 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,11 +35,11 @@ public class GetTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetTransformationV1Output data; + private GetTransformationBetaOutput data; public GetTransformation200Response() {} - public GetTransformation200Response data(GetTransformationV1Output data) { + public GetTransformation200Response data(GetTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +52,11 @@ public GetTransformation200Response data(GetTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public GetTransformationV1Output getData() { + public GetTransformationBetaOutput getData() { return data; } - public void setData(GetTransformationV1Output data) { + public void setData(GetTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java deleted file mode 100644 index adc11270..00000000 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input of Transformation retrieval. */ -@ApiModel(description = "The input of Transformation retrieval.") -public class GetTransformationBetaInput { - public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) - private String transformationId; - - public GetTransformationBetaInput() {} - - public GetTransformationBetaInput transformationId(String transformationId) { - - this.transformationId = transformationId; - return this; - } - - /** - * The Transformation id. - * - * @return transformationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Transformation id.") - public String getTransformationId() { - return transformationId; - } - - public void setTransformationId(String transformationId) { - this.transformationId = transformationId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTransformationBetaInput getTransformationBetaInput = (GetTransformationBetaInput) o; - return Objects.equals(this.transformationId, getTransformationBetaInput.transformationId); - } - - @Override - public int hashCode() { - return Objects.hash(transformationId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTransformationBetaInput {\n"); - sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformationId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformationId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTransformationBetaInput is not" - + " found in the empty JSON string", - GetTransformationBetaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTransformationBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("transformationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformationId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transformationId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTransformationBetaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTransformationBetaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTransformationBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTransformationBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTransformationBetaInput - * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaInput - */ - public static GetTransformationBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTransformationBetaInput.class); - } - - /** - * Convert an instance of GetTransformationBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java index 3942ce53..1c867754 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java deleted file mode 100644 index 2990e109..00000000 --- a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of Transformation retrieval. */ -@ApiModel(description = "The output of Transformation retrieval.") -public class GetTransformationV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation3 transformation; - - public GetTransformationV1Output() {} - - public GetTransformationV1Output transformation(Transformation3 transformation) { - - this.transformation = transformation; - return this; - } - - /** - * Get transformation - * - * @return transformation - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation3 getTransformation() { - return transformation; - } - - public void setTransformation(Transformation3 transformation) { - this.transformation = transformation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTransformationV1Output getTransformationV1Output = (GetTransformationV1Output) o; - return Objects.equals(this.transformation, getTransformationV1Output.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTransformationV1Output {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTransformationV1Output is not found" - + " in the empty JSON string", - GetTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to GetTransformationV1Output - */ - public static GetTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTransformationV1Output.class); - } - - /** - * Convert an instance of GetTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetUser200Response.java b/src/main/java/com/segment/publicapi/models/GetUser200Response.java index aa7889e1..71df8830 100644 --- a/src/main/java/com/segment/publicapi/models/GetUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUser200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java index a415949b..89208576 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java index 10bc83f3..22ecbd17 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java index 87b89574..ccdcb8b2 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java index 24163ca3..1baedb8f 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java index d745308a..e62895da 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java index 1303fd6a..9b7810bb 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java index fa31bb42..7ee39c4f 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java index 2a54a775..a2fc1d68 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java index 43a289b7..1ec751df 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java index e00436bf..9c7fa5ac 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java index e93b81cb..a5ea6bf8 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Group.java b/src/main/java/com/segment/publicapi/models/Group.java index 6093019f..6b888c88 100644 --- a/src/main/java/com/segment/publicapi/models/Group.java +++ b/src/main/java/com/segment/publicapi/models/Group.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java index bf7ff2e9..0cd0ac6e 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Identify.java b/src/main/java/com/segment/publicapi/models/Identify.java index 38f4e9f3..82f093f7 100644 --- a/src/main/java/com/segment/publicapi/models/Identify.java +++ b/src/main/java/com/segment/publicapi/models/Identify.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java index 6de6972c..c2b665f3 100644 --- a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Input.java b/src/main/java/com/segment/publicapi/models/Input.java index 74f70753..76b971c9 100644 --- a/src/main/java/com/segment/publicapi/models/Input.java +++ b/src/main/java/com/segment/publicapi/models/Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java index d3408ee1..9ff65ea1 100644 --- a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java +++ b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java index 47eb64e6..c6dfa004 100644 --- a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InviteV1.java b/src/main/java/com/segment/publicapi/models/InviteV1.java index 8d7493f8..fd748d0e 100644 --- a/src/main/java/com/segment/publicapi/models/InviteV1.java +++ b/src/main/java/com/segment/publicapi/models/InviteV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label.java b/src/main/java/com/segment/publicapi/models/Label.java index a583029f..68e30717 100644 --- a/src/main/java/com/segment/publicapi/models/Label.java +++ b/src/main/java/com/segment/publicapi/models/Label.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label1.java b/src/main/java/com/segment/publicapi/models/Label1.java index abf663f5..82f1a254 100644 --- a/src/main/java/com/segment/publicapi/models/Label1.java +++ b/src/main/java/com/segment/publicapi/models/Label1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label2.java b/src/main/java/com/segment/publicapi/models/Label2.java index 07e41ab1..0d9ed2ff 100644 --- a/src/main/java/com/segment/publicapi/models/Label2.java +++ b/src/main/java/com/segment/publicapi/models/Label2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelAlpha.java b/src/main/java/com/segment/publicapi/models/LabelAlpha.java index 350d897f..3df466a2 100644 --- a/src/main/java/com/segment/publicapi/models/LabelAlpha.java +++ b/src/main/java/com/segment/publicapi/models/LabelAlpha.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelV1.java b/src/main/java/com/segment/publicapi/models/LabelV1.java index 5aff4794..7b509730 100644 --- a/src/main/java/com/segment/publicapi/models/LabelV1.java +++ b/src/main/java/com/segment/publicapi/models/LabelV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java index ae475f75..6bfb7921 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java index a7764fc9..6f2c935e 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java index 7f24f24a..b8cb7ee8 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java index dd5a0504..fd53e4b9 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java index a8af96af..8d3dc81d 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java index 8caa5077..a17ff9ed 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java index eff3c02e..131e74da 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java index f6d74db8..b3f73ffe 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java index 93dea71f..88d862f1 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java index 57877075..1c7655cb 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java index 42f169a9..e42153bb 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java index b1fb9c63..9984ebd8 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java index e2c0e27a..630d3751 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java index c4796861..6ab4630e 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java index 1c014cdf..9d7f0680 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java index c71e96f1..71bb2da0 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java index b152ccc2..58e6fdd8 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java index c727dda4..3f5f8e3e 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index 66c69339..dfba276b 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java index 48e4a570..7489c2a6 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java index f1f0518e..955d4afe 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java index 599d65fc..ce0bca4e 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java index 71783c64..aae0ae68 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java index 07aa2962..ae654f79 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java index a03f887d..6d144c1e 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java index 99dfda3f..01a82068 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java index 7d22595a..46300910 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java index b4199bbb..08c07ecd 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java index 5ac80336..d7c11d74 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java index 93520e73..85882dfb 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java index cf819e64..3dd31b22 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java index 3f860460..d968c251 100644 --- a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java index 4579d420..a0af4fb3 100644 --- a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java index f291ee10..d741d83b 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java index 9da42cd1..c76ac938 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java index 367d636a..7e9679a8 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java index fd9cd1b0..4776daef 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java index 0bfd630c..8f33a90f 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java index 93f0219a..a501c2ed 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response.java b/src/main/java/com/segment/publicapi/models/ListSources200Response.java index f2a267e4..aa5f1786 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java index e2d5a21d..fec2465b 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java index f22a8014..90cba01a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java index aa2b2c5b..e1e9768a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java index 1a285227..7cf332b1 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java index 72b9c7ab..70694013 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java index 63db0f25..1e5577c2 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java index 069785d0..987ed800 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java index e80f4a22..bcf88cdf 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java index 9137d79c..b39d1eab 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java index 3d69c4d0..2a95ca18 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java index 694b3d25..e9323326 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java index ffd9a6a3..11749179 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java index 8c37a8c9..7a9506e0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java index 99ac64e7..8c3a6b83 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java index 2eb89d55..95ca8105 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index b9565031..84d1efb7 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,11 +35,11 @@ public class ListTransformations200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListTransformationsV1Output data; + private ListTransformationsBetaOutput data; public ListTransformations200Response() {} - public ListTransformations200Response data(ListTransformationsV1Output data) { + public ListTransformations200Response data(ListTransformationsBetaOutput data) { this.data = data; return this; @@ -51,11 +52,11 @@ public ListTransformations200Response data(ListTransformationsV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ListTransformationsV1Output getData() { + public ListTransformationsBetaOutput getData() { return data; } - public void setData(ListTransformationsV1Output data) { + public void setData(ListTransformationsBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java deleted file mode 100644 index ed21b87e..00000000 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Lists the Transformations associated with the current Workspace. */ -@ApiModel(description = "Lists the Transformations associated with the current Workspace.") -public class ListTransformationsBetaInput { - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination1 pagination; - - public ListTransformationsBetaInput() {} - - public ListTransformationsBetaInput pagination(Pagination1 pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination1 getPagination() { - return pagination; - } - - public void setPagination(Pagination1 pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListTransformationsBetaInput listTransformationsBetaInput = - (ListTransformationsBetaInput) o; - return Objects.equals(this.pagination, listTransformationsBetaInput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListTransformationsBetaInput {\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListTransformationsBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListTransformationsBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListTransformationsBetaInput is not" - + " found in the empty JSON string", - ListTransformationsBetaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListTransformationsBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListTransformationsBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListTransformationsBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListTransformationsBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListTransformationsBetaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListTransformationsBetaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListTransformationsBetaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListTransformationsBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListTransformationsBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListTransformationsBetaInput - * @throws IOException if the JSON string is invalid with respect to - * ListTransformationsBetaInput - */ - public static ListTransformationsBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListTransformationsBetaInput.class); - } - - /** - * Convert an instance of ListTransformationsBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java index f2484ee6..c5fd25ec 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java deleted file mode 100644 index 30346e88..00000000 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Lists the Transformations associated with the current Workspace. */ -@ApiModel(description = "Lists the Transformations associated with the current Workspace.") -public class ListTransformationsV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATIONS = "transformations"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATIONS) - private List transformations = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; - - public ListTransformationsV1Output() {} - - public ListTransformationsV1Output transformations(List transformations) { - - this.transformations = transformations; - return this; - } - - public ListTransformationsV1Output addTransformationsItem( - TransformationV1 transformationsItem) { - this.transformations.add(transformationsItem); - return this; - } - - /** - * A paginated list of Transformations. - * - * @return transformations - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A paginated list of Transformations.") - public List getTransformations() { - return transformations; - } - - public void setTransformations(List transformations) { - this.transformations = transformations; - } - - public ListTransformationsV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListTransformationsV1Output listTransformationsV1Output = (ListTransformationsV1Output) o; - return Objects.equals(this.transformations, listTransformationsV1Output.transformations) - && Objects.equals(this.pagination, listTransformationsV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(transformations, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListTransformationsV1Output {\n"); - sb.append(" transformations: ").append(toIndentedString(transformations)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformations"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformations"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ListTransformationsV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListTransformationsV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListTransformationsV1Output is not" - + " found in the empty JSON string", - ListTransformationsV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListTransformationsV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListTransformationsV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListTransformationsV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("transformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformations` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("transformations").toString())); - } - - JsonArray jsonArraytransformations = jsonObj.getAsJsonArray("transformations"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListTransformationsV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListTransformationsV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListTransformationsV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListTransformationsV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListTransformationsV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListTransformationsV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListTransformationsV1Output - * @throws IOException if the JSON string is invalid with respect to ListTransformationsV1Output - */ - public static ListTransformationsV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListTransformationsV1Output.class); - } - - /** - * Convert an instance of ListTransformationsV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java index c8400059..fa89dd2f 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java index cee52465..48b41f34 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java index 2302ec88..ad32546e 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java index 8e8bbe4b..d4e3784e 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java index bd720378..e46ba650 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java index 75ae4910..2910f2dc 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java index b9b368b5..89719a06 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java index a6476b40..312c4e48 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java index 778b9cb4..e86a6e5c 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java index 03bfddf9..836aa581 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java index d6d84dc1..d0ac7ba4 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java index b03af950..86e78eaa 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos.java b/src/main/java/com/segment/publicapi/models/Logos.java index 3d828bd4..d174f434 100644 --- a/src/main/java/com/segment/publicapi/models/Logos.java +++ b/src/main/java/com/segment/publicapi/models/Logos.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos1.java b/src/main/java/com/segment/publicapi/models/Logos1.java index 6baa4f95..57199ee6 100644 --- a/src/main/java/com/segment/publicapi/models/Logos1.java +++ b/src/main/java/com/segment/publicapi/models/Logos1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos2.java b/src/main/java/com/segment/publicapi/models/Logos2.java index 7210fe0c..6c285023 100644 --- a/src/main/java/com/segment/publicapi/models/Logos2.java +++ b/src/main/java/com/segment/publicapi/models/Logos2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LogosBeta.java b/src/main/java/com/segment/publicapi/models/LogosBeta.java index 88b2d956..1b396acf 100644 --- a/src/main/java/com/segment/publicapi/models/LogosBeta.java +++ b/src/main/java/com/segment/publicapi/models/LogosBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 7c2f24cb..4e696e94 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java index a3d3c62a..90f5fe50 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index 5621edf6..ce9dcd3f 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata.java b/src/main/java/com/segment/publicapi/models/Metadata.java index 29b47444..241a95d4 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata.java +++ b/src/main/java/com/segment/publicapi/models/Metadata.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata1.java b/src/main/java/com/segment/publicapi/models/Metadata1.java index 8a845b8c..8e700d48 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata1.java +++ b/src/main/java/com/segment/publicapi/models/Metadata1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata2.java b/src/main/java/com/segment/publicapi/models/Metadata2.java index 50dae21a..c3ef11e6 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata2.java +++ b/src/main/java/com/segment/publicapi/models/Metadata2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MetricBeta.java b/src/main/java/com/segment/publicapi/models/MetricBeta.java index fe1d59b9..f4a5ca3a 100644 --- a/src/main/java/com/segment/publicapi/models/MetricBeta.java +++ b/src/main/java/com/segment/publicapi/models/MetricBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java index 1743ce1d..aa5f43bc 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java index 39bbca39..f8f29c0a 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java index 0319072d..7113ddaf 100644 --- a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination.java b/src/main/java/com/segment/publicapi/models/Pagination.java index 3bb74f45..69abe9c6 100644 --- a/src/main/java/com/segment/publicapi/models/Pagination.java +++ b/src/main/java/com/segment/publicapi/models/Pagination.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination1.java b/src/main/java/com/segment/publicapi/models/Pagination1.java deleted file mode 100644 index 41b5f7e7..00000000 --- a/src/main/java/com/segment/publicapi/models/Pagination1.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Pagination options. */ -@ApiModel(description = "Pagination options.") -public class Pagination1 { - public static final String SERIALIZED_NAME_CURSOR = "cursor"; - - @SerializedName(SERIALIZED_NAME_CURSOR) - private String cursor; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - public Pagination1() {} - - public Pagination1 cursor(String cursor) { - - this.cursor = cursor; - return this; - } - - /** - * The page to request. Acceptable values to use here are in PaginationOutput objects, in the - * `current`, `next`, and `previous` keys. Consumers of the API - * must treat this value as opaque. - * - * @return cursor - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The page to request. Acceptable values to use here are in PaginationOutput" - + " objects, in the `current`, `next`, and `previous` keys. Consumers of" - + " the API must treat this value as opaque.") - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - public Pagination1 count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The number of items to retrieve in a page, between 1 and 200. - * - * @return count - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The number of items to retrieve in a page, between 1 and 200.") - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pagination1 pagination1 = (Pagination1) o; - return Objects.equals(this.cursor, pagination1.cursor) - && Objects.equals(this.count, pagination1.count); - } - - @Override - public int hashCode() { - return Objects.hash(cursor, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pagination1 {\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cursor"); - openapiFields.add("count"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Pagination1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Pagination1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Pagination1 is not found in the empty" - + " JSON string", - Pagination1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Pagination1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Pagination1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Pagination1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) - && !jsonObj.get("cursor").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cursor` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("cursor").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Pagination1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Pagination1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Pagination1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Pagination1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Pagination1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Pagination1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Pagination1 - * @throws IOException if the JSON string is invalid with respect to Pagination1 - */ - public static Pagination1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Pagination1.class); - } - - /** - * Convert an instance of Pagination1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/PaginationInput.java b/src/main/java/com/segment/publicapi/models/PaginationInput.java index 3f360c00..d059edba 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationInput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PaginationOutput.java b/src/main/java/com/segment/publicapi/models/PaginationOutput.java index a2fa1d48..4684b10b 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationOutput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java index 2d102a6a..15582f10 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java index ce9e3466..1f5a55e9 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionV1.java b/src/main/java/com/segment/publicapi/models/PermissionV1.java index 75c32c53..224afaf2 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java index e88ae6d2..184e4d43 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java index 76fbc839..d25446f4 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java index 9b199ccc..7d8436f4 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java index 2c6ae969..924ac4b7 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java index f58c40fd..e80d5605 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java deleted file mode 100644 index 9983bfb9..00000000 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** PropertyRenameV1 */ -public class PropertyRenameV1 { - public static final String SERIALIZED_NAME_OLD_NAME = "oldName"; - - @SerializedName(SERIALIZED_NAME_OLD_NAME) - private String oldName; - - public static final String SERIALIZED_NAME_NEW_NAME = "newName"; - - @SerializedName(SERIALIZED_NAME_NEW_NAME) - private String newName; - - public PropertyRenameV1() {} - - public PropertyRenameV1 oldName(String oldName) { - - this.oldName = oldName; - return this; - } - - /** - * The old name of the property. - * - * @return oldName - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The old name of the property.") - public String getOldName() { - return oldName; - } - - public void setOldName(String oldName) { - this.oldName = oldName; - } - - public PropertyRenameV1 newName(String newName) { - - this.newName = newName; - return this; - } - - /** - * The new name to rename the property. - * - * @return newName - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new name to rename the property.") - public String getNewName() { - return newName; - } - - public void setNewName(String newName) { - this.newName = newName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PropertyRenameV1 propertyRenameV1 = (PropertyRenameV1) o; - return Objects.equals(this.oldName, propertyRenameV1.oldName) - && Objects.equals(this.newName, propertyRenameV1.newName); - } - - @Override - public int hashCode() { - return Objects.hash(oldName, newName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PropertyRenameV1 {\n"); - sb.append(" oldName: ").append(toIndentedString(oldName)).append("\n"); - sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("oldName"); - openapiFields.add("newName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("oldName"); - openapiRequiredFields.add("newName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PropertyRenameV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PropertyRenameV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in PropertyRenameV1 is not found in the" - + " empty JSON string", - PropertyRenameV1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!PropertyRenameV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PropertyRenameV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PropertyRenameV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("oldName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `oldName` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("oldName").toString())); - } - if (!jsonObj.get("newName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newName` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("newName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PropertyRenameV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PropertyRenameV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PropertyRenameV1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PropertyRenameV1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PropertyRenameV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of PropertyRenameV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertyRenameV1 - * @throws IOException if the JSON string is invalid with respect to PropertyRenameV1 - */ - public static PropertyRenameV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PropertyRenameV1.class); - } - - /** - * Convert an instance of PropertyRenameV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java index a1b9fc38..ac088992 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java deleted file mode 100644 index d524ddaf..00000000 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** PropertyValueTransformationV1 */ -public class PropertyValueTransformationV1 { - public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) - private List propertyPaths = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) - private String propertyValue; - - public PropertyValueTransformationV1() {} - - public PropertyValueTransformationV1 propertyPaths(List propertyPaths) { - - this.propertyPaths = propertyPaths; - return this; - } - - public PropertyValueTransformationV1 addPropertyPathsItem(String propertyPathsItem) { - this.propertyPaths.add(propertyPathsItem); - return this; - } - - /** - * The property paths. The maximum number of paths is 10. - * - * @return propertyPaths - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The property paths. The maximum number of paths is 10.") - public List getPropertyPaths() { - return propertyPaths; - } - - public void setPropertyPaths(List propertyPaths) { - this.propertyPaths = propertyPaths; - } - - public PropertyValueTransformationV1 propertyValue(String propertyValue) { - - this.propertyValue = propertyValue; - return this; - } - - /** - * The new value of the property paths. - * - * @return propertyValue - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new value of the property paths.") - public String getPropertyValue() { - return propertyValue; - } - - public void setPropertyValue(String propertyValue) { - this.propertyValue = propertyValue; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PropertyValueTransformationV1 propertyValueTransformationV1 = - (PropertyValueTransformationV1) o; - return Objects.equals(this.propertyPaths, propertyValueTransformationV1.propertyPaths) - && Objects.equals(this.propertyValue, propertyValueTransformationV1.propertyValue); - } - - @Override - public int hashCode() { - return Objects.hash(propertyPaths, propertyValue); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PropertyValueTransformationV1 {\n"); - sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); - sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("propertyPaths"); - openapiFields.add("propertyValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("propertyPaths"); - openapiRequiredFields.add("propertyValue"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * PropertyValueTransformationV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PropertyValueTransformationV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in PropertyValueTransformationV1 is not" - + " found in the empty JSON string", - PropertyValueTransformationV1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!PropertyValueTransformationV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PropertyValueTransformationV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PropertyValueTransformationV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the required json array is present - if (jsonObj.get("propertyPaths") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("propertyPaths").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyPaths` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("propertyPaths").toString())); - } - if (!jsonObj.get("propertyValue").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValue` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("propertyValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PropertyValueTransformationV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PropertyValueTransformationV1' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(PropertyValueTransformationV1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PropertyValueTransformationV1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PropertyValueTransformationV1 read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of PropertyValueTransformationV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertyValueTransformationV1 - * @throws IOException if the JSON string is invalid with respect to - * PropertyValueTransformationV1 - */ - public static PropertyValueTransformationV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PropertyValueTransformationV1.class); - } - - /** - * Convert an instance of PropertyValueTransformationV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index b1059c08..f9d6caa2 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index f27f82f7..38289fc3 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java index 4ccac399..c22cddb5 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java index c3b7e1fa..b3a4f318 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java index 13ce5fba..0f931ed6 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java index 311123ee..eab764f8 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java index 5cc496c4..2f2e8cb1 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java index 9146b3ac..3e8c4b5c 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java index 11804320..20c7b1b8 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java index c057b351..c6ca4f71 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java index 35b39e1e..87ae79f0 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java index 5abce5d5..4641c805 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java index 7edc0eba..e72b604e 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java index 243b22e5..a07510e4 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java index 1e26fa1a..6fa44d64 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java index c8384989..9a569836 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java index fa8adf0a..ffda4eca 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java index 19361662..3bdd7971 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java index 9cdcd1f3..3a9dbafd 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java index 063c6c9f..0f6bd5f5 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java index 142134a9..7dc6fa1b 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java index 52ae3820..d72291fd 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java index 03a24f1b..5aeb7d4b 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java index 1bc6f110..ec6c7c97 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java index aaea91eb..51264026 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java index b9eacb17..58a5c5a8 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java index 38034ed2..9379d607 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java index c34c98ba..75eeeaae 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java index d2452642..f0547808 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java index 3dcc3aec..199a0d66 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java index ebb8b777..c2192160 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java index eeb793a9..be947993 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java index f711d9cb..51b17f27 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java index e74a51a8..9e12c65d 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java index 489c11aa..9e225d14 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java index 274180c6..7b93e94c 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java index f38f016c..838c1f8d 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java index 90687b57..2b16e2a6 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java index fe0d9028..f1546d1d 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestError.java b/src/main/java/com/segment/publicapi/models/RequestError.java index 46fca89f..fc20d87b 100644 --- a/src/main/java/com/segment/publicapi/models/RequestError.java +++ b/src/main/java/com/segment/publicapi/models/RequestError.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java index d11bdbed..94319be1 100644 --- a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java +++ b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ResourceV1.java b/src/main/java/com/segment/publicapi/models/ResourceV1.java index 24fab55e..57370dca 100644 --- a/src/main/java/com/segment/publicapi/models/ResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/ResourceV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RoleV1.java b/src/main/java/com/segment/publicapi/models/RoleV1.java index 14f4dbbe..3b7b374b 100644 --- a/src/main/java/com/segment/publicapi/models/RoleV1.java +++ b/src/main/java/com/segment/publicapi/models/RoleV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index 78adf379..b772b8ce 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule.java b/src/main/java/com/segment/publicapi/models/Schedule.java index 533a6a8d..0c2e2fe0 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule.java +++ b/src/main/java/com/segment/publicapi/models/Schedule.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule1.java b/src/main/java/com/segment/publicapi/models/Schedule1.java index 22f09349..a25ee1b4 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule1.java +++ b/src/main/java/com/segment/publicapi/models/Schedule1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule2.java b/src/main/java/com/segment/publicapi/models/Schedule2.java index 4ea89297..b54be464 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule2.java +++ b/src/main/java/com/segment/publicapi/models/Schedule2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings.java b/src/main/java/com/segment/publicapi/models/Settings.java index 036bc07d..03ead8fd 100644 --- a/src/main/java/com/segment/publicapi/models/Settings.java +++ b/src/main/java/com/segment/publicapi/models/Settings.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings1.java b/src/main/java/com/segment/publicapi/models/Settings1.java index c96720c4..d842d4c0 100644 --- a/src/main/java/com/segment/publicapi/models/Settings1.java +++ b/src/main/java/com/segment/publicapi/models/Settings1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source.java b/src/main/java/com/segment/publicapi/models/Source.java index 1faf715b..4a02c417 100644 --- a/src/main/java/com/segment/publicapi/models/Source.java +++ b/src/main/java/com/segment/publicapi/models/Source.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source1.java b/src/main/java/com/segment/publicapi/models/Source1.java index d8014cf0..0321a2a7 100644 --- a/src/main/java/com/segment/publicapi/models/Source1.java +++ b/src/main/java/com/segment/publicapi/models/Source1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source2.java b/src/main/java/com/segment/publicapi/models/Source2.java index f227ff90..0aae9f5a 100644 --- a/src/main/java/com/segment/publicapi/models/Source2.java +++ b/src/main/java/com/segment/publicapi/models/Source2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source3.java b/src/main/java/com/segment/publicapi/models/Source3.java index d6aafe2c..05017d6f 100644 --- a/src/main/java/com/segment/publicapi/models/Source3.java +++ b/src/main/java/com/segment/publicapi/models/Source3.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source4.java b/src/main/java/com/segment/publicapi/models/Source4.java index c75dc398..b1dfd53c 100644 --- a/src/main/java/com/segment/publicapi/models/Source4.java +++ b/src/main/java/com/segment/publicapi/models/Source4.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source5.java b/src/main/java/com/segment/publicapi/models/Source5.java index 073acaf6..4cf522d2 100644 --- a/src/main/java/com/segment/publicapi/models/Source5.java +++ b/src/main/java/com/segment/publicapi/models/Source5.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source6.java b/src/main/java/com/segment/publicapi/models/Source6.java index fc023adb..d9c2b851 100644 --- a/src/main/java/com/segment/publicapi/models/Source6.java +++ b/src/main/java/com/segment/publicapi/models/Source6.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java index 368c608b..8a3e9488 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAlpha.java b/src/main/java/com/segment/publicapi/models/SourceAlpha.java index 91cf1eaf..3ba90967 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAlpha.java +++ b/src/main/java/com/segment/publicapi/models/SourceAlpha.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java index de136952..1f97b7c3 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index cbb9d642..e51e4f6f 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadata.java b/src/main/java/com/segment/publicapi/models/SourceMetadata.java index feb9dd2e..9778477c 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadata.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadata.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java index 09efca60..827345b7 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java index c40b0299..bb18a609 100644 --- a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceV1.java b/src/main/java/com/segment/publicapi/models/SourceV1.java index b6a7f6c7..66a4a8ae 100644 --- a/src/main/java/com/segment/publicapi/models/SourceV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 0a827f88..2a8f3697 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java index 7ba98961..8f42fee8 100644 --- a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Subscription.java b/src/main/java/com/segment/publicapi/models/Subscription.java index e91e48ac..223e8fb8 100644 --- a/src/main/java/com/segment/publicapi/models/Subscription.java +++ b/src/main/java/com/segment/publicapi/models/Subscription.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java index 00686422..ab32d651 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java +++ b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedMethods.java b/src/main/java/com/segment/publicapi/models/SupportedMethods.java index 3a4c65ea..2b31c478 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedMethods.java +++ b/src/main/java/com/segment/publicapi/models/SupportedMethods.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java index 3399054e..87cf8881 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java +++ b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SuppressedInner.java b/src/main/java/com/segment/publicapi/models/SuppressedInner.java index b1db0761..204dbe4d 100644 --- a/src/main/java/com/segment/publicapi/models/SuppressedInner.java +++ b/src/main/java/com/segment/publicapi/models/SuppressedInner.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java index dc34954e..7f480c09 100644 --- a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncV1.java b/src/main/java/com/segment/publicapi/models/SyncV1.java index 81e76f54..b5da4fa5 100644 --- a/src/main/java/com/segment/publicapi/models/SyncV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Track.java b/src/main/java/com/segment/publicapi/models/Track.java index 146f0d34..50cd5208 100644 --- a/src/main/java/com/segment/publicapi/models/Track.java +++ b/src/main/java/com/segment/publicapi/models/Track.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java index 6c2d3338..60e212a2 100644 --- a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index 524daf30..a8544ca0 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 44d6ac94..2ff89148 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index b6b79632..3b56f019 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index 450d8051..83c6f1ef 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index cc9c89d1..7ef47dcd 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index f52c60ac..d992a6bf 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java deleted file mode 100644 index d96809eb..00000000 --- a/src/main/java/com/segment/publicapi/models/Transformation3.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The retrieved Transformation. */ -@ApiModel(description = "The retrieved Transformation.") -public class Transformation3 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public Transformation3() {} - - public Transformation3 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Transformation3 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Transformation3 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Transformation3 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public Transformation3 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Transformation3 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Transformation3 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public Transformation3 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public Transformation3 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public Transformation3 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation3 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transformation3 transformation3 = (Transformation3) o; - return Objects.equals(this.id, transformation3.id) - && Objects.equals(this.name, transformation3.name) - && Objects.equals(this.sourceId, transformation3.sourceId) - && Objects.equals(this.destinationMetadataId, transformation3.destinationMetadataId) - && Objects.equals(this.enabled, transformation3.enabled) - && Objects.equals(this._if, transformation3._if) - && Objects.equals(this.newEventName, transformation3.newEventName) - && Objects.equals(this.propertyRenames, transformation3.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformation3.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transformation3 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Transformation3 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Transformation3.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transformation3 is not found in the" - + " empty JSON string", - Transformation3.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Transformation3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transformation3` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transformation3.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transformation3.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transformation3' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transformation3.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transformation3 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transformation3 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transformation3 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transformation3 - * @throws IOException if the JSON string is invalid with respect to Transformation3 - */ - public static Transformation3 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transformation3.class); - } - - /** - * Convert an instance of Transformation3 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java deleted file mode 100644 index ec91dbe6..00000000 --- a/src/main/java/com/segment/publicapi/models/Transformation4.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The updated Transformation. */ -@ApiModel(description = "The updated Transformation.") -public class Transformation4 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public Transformation4() {} - - public Transformation4 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Transformation4 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Transformation4 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Transformation4 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public Transformation4 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Transformation4 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Transformation4 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public Transformation4 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public Transformation4 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public Transformation4 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation4 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transformation4 transformation4 = (Transformation4) o; - return Objects.equals(this.id, transformation4.id) - && Objects.equals(this.name, transformation4.name) - && Objects.equals(this.sourceId, transformation4.sourceId) - && Objects.equals(this.destinationMetadataId, transformation4.destinationMetadataId) - && Objects.equals(this.enabled, transformation4.enabled) - && Objects.equals(this._if, transformation4._if) - && Objects.equals(this.newEventName, transformation4.newEventName) - && Objects.equals(this.propertyRenames, transformation4.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformation4.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transformation4 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Transformation4 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Transformation4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transformation4 is not found in the" - + " empty JSON string", - Transformation4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Transformation4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transformation4` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transformation4.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transformation4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transformation4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transformation4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transformation4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transformation4 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transformation4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transformation4 - * @throws IOException if the JSON string is invalid with respect to Transformation4 - */ - public static Transformation4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transformation4.class); - } - - /** - * Convert an instance of Transformation4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java deleted file mode 100644 index adac93ee..00000000 --- a/src/main/java/com/segment/publicapi/models/Transformation5.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The created Transformation. */ -@ApiModel(description = "The created Transformation.") -public class Transformation5 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public Transformation5() {} - - public Transformation5 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Transformation5 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Transformation5 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Transformation5 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public Transformation5 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Transformation5 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Transformation5 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public Transformation5 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public Transformation5 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public Transformation5 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation5 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transformation5 transformation5 = (Transformation5) o; - return Objects.equals(this.id, transformation5.id) - && Objects.equals(this.name, transformation5.name) - && Objects.equals(this.sourceId, transformation5.sourceId) - && Objects.equals(this.destinationMetadataId, transformation5.destinationMetadataId) - && Objects.equals(this.enabled, transformation5.enabled) - && Objects.equals(this._if, transformation5._if) - && Objects.equals(this.newEventName, transformation5.newEventName) - && Objects.equals(this.propertyRenames, transformation5.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformation5.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transformation5 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Transformation5 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Transformation5.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transformation5 is not found in the" - + " empty JSON string", - Transformation5.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Transformation5.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transformation5` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transformation5.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transformation5.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transformation5' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transformation5.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transformation5 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transformation5 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transformation5 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transformation5 - * @throws IOException if the JSON string is invalid with respect to Transformation5 - */ - public static Transformation5 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transformation5.class); - } - - /** - * Convert an instance of Transformation5 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index 91b097ee..b8d26be3 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java deleted file mode 100644 index abe887da..00000000 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Represents a Transformation. */ -@ApiModel(description = "Represents a Transformation.") -public class TransformationV1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public TransformationV1() {} - - public TransformationV1 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public TransformationV1 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public TransformationV1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public TransformationV1 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public TransformationV1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TransformationV1 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public TransformationV1 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public TransformationV1 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public TransformationV1 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public TransformationV1 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public TransformationV1 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TransformationV1 transformationV1 = (TransformationV1) o; - return Objects.equals(this.id, transformationV1.id) - && Objects.equals(this.name, transformationV1.name) - && Objects.equals(this.sourceId, transformationV1.sourceId) - && Objects.equals( - this.destinationMetadataId, transformationV1.destinationMetadataId) - && Objects.equals(this.enabled, transformationV1.enabled) - && Objects.equals(this._if, transformationV1._if) - && Objects.equals(this.newEventName, transformationV1.newEventName) - && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformationV1.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TransformationV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TransformationV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!TransformationV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in TransformationV1 is not found in the" - + " empty JSON string", - TransformationV1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!TransformationV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TransformationV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TransformationV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransformationV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TransformationV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(TransformationV1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TransformationV1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TransformationV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TransformationV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of TransformationV1 - * @throws IOException if the JSON string is invalid with respect to TransformationV1 - */ - public static TransformationV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TransformationV1.class); - } - - /** - * Convert an instance of TransformationV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java index 002d6112..368b9a47 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java index 3a76ef8b..f7688976 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java index fdeb53f9..ae97feea 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java index 57cc9730..0d89c349 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java index 8ac5d061..8179f07b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java index 66ae1377..2340db10 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java index 8c89bf2f..5845d159 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java index 86e57802..e1821f5b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java index 2d9c3494..6ad1a3f5 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java index b49f70a3..03b28a6b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java index 901d912a..d1c0b670 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java index ca16795a..70458ffd 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java index 37e6c393..2c61e6c3 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java index e825ac3b..8cb73ab4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java index 3d5eddc4..64942e05 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java index a8eb1e43..8b656a26 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java index 378802f4..bf022e66 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java index e7ca8d46..f201a953 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java index 12516d49..a57b64dc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java index 02489ff1..469a8712 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java index 232e2266..b4875f63 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java index 1c2ad0ed..ec912606 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java index 0157ea95..9f2ba5eb 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java index ab415977..d4d29aed 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java index 57204b9c..4dcb9805 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java index bff96e27..2f8301cb 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java index 372bd5b8..4ebff428 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java index 299e0708..10aa7f5f 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java index f9b5fe17..f57d62d4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java index 5c6fb92b..5da1b391 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index d92501c0..9cd0b3ac 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,11 +35,11 @@ public class UpdateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private UpdateTransformationV1Output data; + private UpdateTransformationBetaOutput data; public UpdateTransformation200Response() {} - public UpdateTransformation200Response data(UpdateTransformationV1Output data) { + public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +52,11 @@ public UpdateTransformation200Response data(UpdateTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public UpdateTransformationV1Output getData() { + public UpdateTransformationBetaOutput getData() { return data; } - public void setData(UpdateTransformationV1Output data) { + public void setData(UpdateTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 6ec8c308..09c5f3d6 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -36,11 +37,6 @@ /** The input to update a Transformation. */ @ApiModel(description = "The input to update a Transformation.") public class UpdateTransformationBetaInput { - public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) - private String transformationId; - public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -84,27 +80,6 @@ public class UpdateTransformationBetaInput { public UpdateTransformationBetaInput() {} - public UpdateTransformationBetaInput transformationId(String transformationId) { - - this.transformationId = transformationId; - return this; - } - - /** - * ID of the Transformation to update. - * - * @return transformationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "ID of the Transformation to update.") - public String getTransformationId() { - return transformationId; - } - - public void setTransformationId(String transformationId) { - this.transformationId = transformationId; - } - public UpdateTransformationBetaInput name(String name) { this.name = name; @@ -320,8 +295,7 @@ public boolean equals(Object o) { } UpdateTransformationBetaInput updateTransformationBetaInput = (UpdateTransformationBetaInput) o; - return Objects.equals(this.transformationId, updateTransformationBetaInput.transformationId) - && Objects.equals(this.name, updateTransformationBetaInput.name) + return Objects.equals(this.name, updateTransformationBetaInput.name) && Objects.equals(this.sourceId, updateTransformationBetaInput.sourceId) && Objects.equals( this.destinationMetadataId, @@ -339,7 +313,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - transformationId, name, sourceId, destinationMetadataId, @@ -354,7 +327,6 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateTransformationBetaInput {\n"); - sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" destinationMetadataId: ") @@ -388,7 +360,6 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("transformationId"); openapiFields.add("name"); openapiFields.add("sourceId"); openapiFields.add("destinationMetadataId"); @@ -400,7 +371,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformationId"); } /** @@ -433,23 +403,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("transformationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformationId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transformationId").toString())); - } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java index b7d1c980..51f685c7 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java deleted file mode 100644 index 716d22b5..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input to update a Transformation. */ -@ApiModel(description = "The input to update a Transformation.") -public class UpdateTransformationV1Input { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public UpdateTransformationV1Input() {} - - public UpdateTransformationV1Input name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public UpdateTransformationV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The optional Source to be associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The optional Source to be associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public UpdateTransformationV1Input destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata to be associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata to be associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public UpdateTransformationV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation should be enabled. - * - * @return enabled - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "If the Transformation should be enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public UpdateTransformationV1Input _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public UpdateTransformationV1Input newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public UpdateTransformationV1Input propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public UpdateTransformationV1Input addPropertyRenamesItem( - PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public UpdateTransformationV1Input propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public UpdateTransformationV1Input addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateTransformationV1Input updateTransformationV1Input = (UpdateTransformationV1Input) o; - return Objects.equals(this.name, updateTransformationV1Input.name) - && Objects.equals(this.sourceId, updateTransformationV1Input.sourceId) - && Objects.equals( - this.destinationMetadataId, - updateTransformationV1Input.destinationMetadataId) - && Objects.equals(this.enabled, updateTransformationV1Input.enabled) - && Objects.equals(this._if, updateTransformationV1Input._if) - && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) - && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - updateTransformationV1Input.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateTransformationV1Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UpdateTransformationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateTransformationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateTransformationV1Input is not" - + " found in the empty JSON string", - UpdateTransformationV1Input.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateTransformationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateTransformationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) - && !jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) - && !jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateTransformationV1Input' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateTransformationV1Input.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateTransformationV1Input value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateTransformationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateTransformationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateTransformationV1Input - * @throws IOException if the JSON string is invalid with respect to UpdateTransformationV1Input - */ - public static UpdateTransformationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Input.class); - } - - /** - * Convert an instance of UpdateTransformationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java deleted file mode 100644 index a1e5193a..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of an updated Transformation. */ -@ApiModel(description = "The output of an updated Transformation.") -public class UpdateTransformationV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation4 transformation; - - public UpdateTransformationV1Output() {} - - public UpdateTransformationV1Output transformation(Transformation4 transformation) { - - this.transformation = transformation; - return this; - } - - /** - * Get transformation - * - * @return transformation - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation4 getTransformation() { - return transformation; - } - - public void setTransformation(Transformation4 transformation) { - this.transformation = transformation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateTransformationV1Output updateTransformationV1Output = - (UpdateTransformationV1Output) o; - return Objects.equals(this.transformation, updateTransformationV1Output.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateTransformationV1Output {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateTransformationV1Output is not" - + " found in the empty JSON string", - UpdateTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to - * UpdateTransformationV1Output - */ - public static UpdateTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Output.class); - } - - /** - * Convert an instance of UpdateTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java index 7bb950bc..aebd5b9d 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java index 375d8a90..5200073b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java index 5536846a..b46a9a6f 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java index 4b943acc..940ebc1d 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java index 8a7f58d8..e8f78aa8 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java index 1c99a54c..07bd3d14 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index a1bcdf85..7d710a48 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/User.java b/src/main/java/com/segment/publicapi/models/User.java index 44e1f58b..5c82c9f2 100644 --- a/src/main/java/com/segment/publicapi/models/User.java +++ b/src/main/java/com/segment/publicapi/models/User.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup.java b/src/main/java/com/segment/publicapi/models/UserGroup.java index 27b5391a..0796071b 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup1.java b/src/main/java/com/segment/publicapi/models/UserGroup1.java index d4f2f1b0..cbf4b817 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup2.java b/src/main/java/com/segment/publicapi/models/UserGroup2.java index b4a856b9..0ad3f8c2 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup2.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup3.java b/src/main/java/com/segment/publicapi/models/UserGroup3.java index fe9f9ff8..6b53f171 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup3.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup3.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroupV1.java b/src/main/java/com/segment/publicapi/models/UserGroupV1.java index d274c508..d4af4c78 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroupV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserV1.java b/src/main/java/com/segment/publicapi/models/UserV1.java index 20f0edfb..e40d2baf 100644 --- a/src/main/java/com/segment/publicapi/models/UserV1.java +++ b/src/main/java/com/segment/publicapi/models/UserV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java index 433f4c62..c30a12eb 100644 --- a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse.java b/src/main/java/com/segment/publicapi/models/Warehouse.java index 33defef5..3a63705c 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse1.java b/src/main/java/com/segment/publicapi/models/Warehouse1.java index beedc382..8dc818c0 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse1.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse2.java b/src/main/java/com/segment/publicapi/models/Warehouse2.java index 86c1c3fb..78741ed3 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse2.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse2.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java index 066c9b01..d386b6ce 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java index b0c28d87..33fb22bd 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java index 435b25ce..cc714ab2 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java index 75558eb1..45714ade 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java index 188ac6c6..3f62dec9 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseV1.java b/src/main/java/com/segment/publicapi/models/WarehouseV1.java index e3de3705..d2d09fa5 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Workspace.java b/src/main/java/com/segment/publicapi/models/Workspace.java index be250d00..5ad8d2ee 100644 --- a/src/main/java/com/segment/publicapi/models/Workspace.java +++ b/src/main/java/com/segment/publicapi/models/Workspace.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java index 95770e63..b7afa7e9 100644 --- a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java +++ b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/test/java/com/segment/publicapi/api/EchoApiTest.java b/src/test/java/com/segment/publicapi/api/EchoApiTest.java index 1d0e328c..07cd1e9a 100644 --- a/src/test/java/com/segment/publicapi/api/EchoApiTest.java +++ b/src/test/java/com/segment/publicapi/api/EchoApiTest.java @@ -2,6 +2,7 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * + * The version of the OpenAPI document: 32.0.2 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). From 7d687840983215afe782ddadab9782e9b1af7961 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Mon, 21 Nov 2022 17:07:58 +0000 Subject: [PATCH 015/474] Automated client deploy (from segmentio/public-api@914196a) --- .github/workflows/maven.yml | 7 +++++++ README.md | 8 ++++---- pom.xml | 10 ++++++++-- src/main/java/com/segment/publicapi/ApiCallback.java | 1 - src/main/java/com/segment/publicapi/ApiClient.java | 3 +-- src/main/java/com/segment/publicapi/ApiException.java | 1 - src/main/java/com/segment/publicapi/ApiResponse.java | 1 - src/main/java/com/segment/publicapi/Configuration.java | 1 - .../com/segment/publicapi/GzipRequestInterceptor.java | 1 - src/main/java/com/segment/publicapi/JSON.java | 1 - src/main/java/com/segment/publicapi/Pair.java | 1 - .../com/segment/publicapi/ProgressRequestBody.java | 1 - .../com/segment/publicapi/ProgressResponseBody.java | 1 - src/main/java/com/segment/publicapi/StringUtil.java | 1 - .../java/com/segment/publicapi/api/ApiCallsApi.java | 1 - .../java/com/segment/publicapi/api/AuditTrailApi.java | 1 - .../java/com/segment/publicapi/api/CatalogApi.java | 1 - .../publicapi/api/DeletionAndSuppressionApi.java | 1 - .../segment/publicapi/api/DestinationFiltersApi.java | 1 - .../com/segment/publicapi/api/DestinationsApi.java | 1 - .../com/segment/publicapi/api/EdgeFunctionsApi.java | 1 - src/main/java/com/segment/publicapi/api/EventsApi.java | 1 - .../java/com/segment/publicapi/api/FunctionsApi.java | 1 - .../java/com/segment/publicapi/api/IamGroupsApi.java | 1 - .../java/com/segment/publicapi/api/IamRolesApi.java | 1 - .../java/com/segment/publicapi/api/IamUsersApi.java | 1 - src/main/java/com/segment/publicapi/api/LabelsApi.java | 1 - .../segment/publicapi/api/MonthlyTrackedUsersApi.java | 1 - .../com/segment/publicapi/api/SelectiveSyncApi.java | 1 - .../java/com/segment/publicapi/api/SourcesApi.java | 1 - src/main/java/com/segment/publicapi/api/SpacesApi.java | 1 - .../java/com/segment/publicapi/api/TestingApi.java | 1 - .../com/segment/publicapi/api/TrackingPlansApi.java | 1 - .../com/segment/publicapi/api/TransformationsApi.java | 1 - .../java/com/segment/publicapi/api/WarehousesApi.java | 1 - .../java/com/segment/publicapi/api/WorkspacesApi.java | 1 - .../java/com/segment/publicapi/auth/ApiKeyAuth.java | 1 - .../com/segment/publicapi/auth/Authentication.java | 1 - .../java/com/segment/publicapi/auth/HttpBasicAuth.java | 1 - .../com/segment/publicapi/auth/HttpBearerAuth.java | 1 - .../segment/publicapi/models/APICallSnapshotV1.java | 1 - .../publicapi/models/AbstractOpenApiSchema.java | 1 - .../segment/publicapi/models/AccessPermissionV1.java | 1 - .../AddConnectionFromSourceToWarehouse200Response.java | 1 - .../AddConnectionFromSourceToWarehouseV1Output.java | 1 - .../publicapi/models/AddLabelsToSource200Response.java | 1 - .../models/AddLabelsToSource200Response1.java | 1 - .../publicapi/models/AddLabelsToSourceAlphaInput.java | 1 - .../publicapi/models/AddLabelsToSourceAlphaOutput.java | 1 - .../publicapi/models/AddLabelsToSourceV1Input.java | 1 - .../publicapi/models/AddLabelsToSourceV1Output.java | 1 - .../models/AddPermissionsToUser200Response.java | 1 - .../models/AddPermissionsToUserGroup200Response.java | 1 - .../models/AddPermissionsToUserGroupV1Input.java | 1 - .../models/AddPermissionsToUserGroupV1Output.java | 1 - .../publicapi/models/AddPermissionsToUserV1Input.java | 1 - .../publicapi/models/AddPermissionsToUserV1Output.java | 1 - .../models/AddSourceToTrackingPlan200Response.java | 1 - .../models/AddSourceToTrackingPlanV1Input.java | 1 - .../models/AddSourceToTrackingPlanV1Output.java | 1 - .../models/AddUsersToUserGroup200Response.java | 1 - .../publicapi/models/AddUsersToUserGroupV1Input.java | 1 - .../publicapi/models/AddUsersToUserGroupV1Output.java | 1 - .../models/AdvancedWarehouseSyncScheduleV1Input.java | 1 - .../models/AdvancedWarehouseSyncScheduleV1Output.java | 1 - .../com/segment/publicapi/models/AllowedLabelBeta.java | 1 - .../com/segment/publicapi/models/AuditEventV1.java | 1 - ...QueryMessagingSubscriptionsForSpace200Response.java | 1 - ...hQueryMessagingSubscriptionsForSpaceAlphaInput.java | 1 - ...QueryMessagingSubscriptionsForSpaceAlphaOutput.java | 1 - .../com/segment/publicapi/models/BreakdownBeta.java | 1 - .../publicapi/models/CommonSourceSettingsV1.java | 1 - .../java/com/segment/publicapi/models/Contact.java | 1 - .../models/CreateCloudSourceRegulation200Response.java | 1 - .../models/CreateCloudSourceRegulationV1Input.java | 3 --- .../models/CreateCloudSourceRegulationV1Output.java | 1 - .../publicapi/models/CreateDestination200Response.java | 1 - .../CreateDestinationSubscription200Response.java | 1 - .../CreateDestinationSubscriptionAlphaInput.java | 1 - .../CreateDestinationSubscriptionAlphaOutput.java | 1 - .../publicapi/models/CreateDestinationV1Input.java | 1 - .../publicapi/models/CreateDestinationV1Output.java | 1 - .../models/CreateEdgeFunctions200Response.java | 1 - .../models/CreateEdgeFunctionsAlphaInput.java | 1 - .../models/CreateEdgeFunctionsAlphaOutput.java | 1 - .../models/CreateFilterForDestination200Response.java | 1 - .../models/CreateFilterForDestinationV1Input.java | 1 - .../models/CreateFilterForDestinationV1Output.java | 1 - .../publicapi/models/CreateFunction200Response.java | 1 - .../models/CreateFunctionDeployment200Response.java | 1 - .../models/CreateFunctionDeploymentV1Output.java | 1 - .../publicapi/models/CreateFunctionV1Input.java | 1 - .../publicapi/models/CreateFunctionV1Output.java | 1 - .../publicapi/models/CreateInvites200Response.java | 1 - .../segment/publicapi/models/CreateInvitesV1Input.java | 1 - .../publicapi/models/CreateInvitesV1Output.java | 1 - .../publicapi/models/CreateLabel200Response.java | 1 - .../publicapi/models/CreateLabel200Response1.java | 1 - .../publicapi/models/CreateLabelAlphaInput.java | 1 - .../publicapi/models/CreateLabelAlphaOutput.java | 1 - .../segment/publicapi/models/CreateLabelV1Input.java | 1 - .../segment/publicapi/models/CreateLabelV1Output.java | 1 - .../publicapi/models/CreateSource200Response.java | 1 - .../publicapi/models/CreateSource200Response1.java | 1 - .../publicapi/models/CreateSourceAlphaInput.java | 1 - .../publicapi/models/CreateSourceAlphaOutput.java | 1 - .../models/CreateSourceRegulation200Response.java | 1 - .../models/CreateSourceRegulationV1Input.java | 3 --- .../models/CreateSourceRegulationV1Output.java | 1 - .../segment/publicapi/models/CreateSourceV1Input.java | 1 - .../segment/publicapi/models/CreateSourceV1Output.java | 1 - .../models/CreateTrackingPlan200Response.java | 1 - .../publicapi/models/CreateTrackingPlanV1Input.java | 1 - .../publicapi/models/CreateTrackingPlanV1Output.java | 1 - .../models/CreateTransformation200Response.java | 1 - .../models/CreateTransformationBetaInput.java | 1 - .../models/CreateTransformationBetaOutput.java | 1 - .../publicapi/models/CreateUserGroup200Response.java | 1 - .../publicapi/models/CreateUserGroupV1Input.java | 1 - .../publicapi/models/CreateUserGroupV1Output.java | 1 - .../models/CreateValidationInWarehouse200Response.java | 1 - .../models/CreateValidationInWarehouseV1Input.java | 1 - .../models/CreateValidationInWarehouseV1Output.java | 1 - .../publicapi/models/CreateWarehouse200Response.java | 1 - .../publicapi/models/CreateWarehouseV1Input.java | 1 - .../publicapi/models/CreateWarehouseV1Output.java | 1 - .../models/CreateWorkspaceRegulation200Response.java | 1 - .../models/CreateWorkspaceRegulationV1Input.java | 3 --- .../models/CreateWorkspaceRegulationV1Output.java | 1 - .../publicapi/models/DeleteDestination200Response.java | 1 - .../publicapi/models/DeleteDestinationV1Output.java | 1 - .../publicapi/models/DeleteFunction200Response.java | 1 - .../publicapi/models/DeleteFunctionV1Output.java | 1 - .../publicapi/models/DeleteInvites200Response.java | 1 - .../publicapi/models/DeleteInvitesV1Output.java | 1 - .../publicapi/models/DeleteLabel200Response.java | 1 - .../publicapi/models/DeleteLabel200Response1.java | 1 - .../publicapi/models/DeleteLabelAlphaOutput.java | 1 - .../segment/publicapi/models/DeleteLabelV1Output.java | 1 - .../publicapi/models/DeleteRegulation200Response.java | 1 - .../publicapi/models/DeleteRegulationV1Output.java | 1 - .../publicapi/models/DeleteSource200Response.java | 1 - .../publicapi/models/DeleteSource200Response1.java | 1 - .../publicapi/models/DeleteSourceAlphaOutput.java | 1 - .../segment/publicapi/models/DeleteSourceV1Output.java | 1 - .../models/DeleteTrackingPlan200Response.java | 1 - .../publicapi/models/DeleteTrackingPlanV1Output.java | 1 - .../models/DeleteTransformation200Response.java | 1 - .../models/DeleteTransformationBetaOutput.java | 1 - .../publicapi/models/DeleteUserGroup200Response.java | 1 - .../publicapi/models/DeleteUserGroupV1Output.java | 1 - .../publicapi/models/DeleteUsers200Response.java | 1 - .../segment/publicapi/models/DeleteUsersV1Output.java | 1 - .../publicapi/models/DeleteWarehouse200Response.java | 1 - .../publicapi/models/DeleteWarehouseV1Output.java | 1 - .../publicapi/models/DeliveryMetricsSummary.java | 1 - .../publicapi/models/DeliveryMetricsSummaryBeta.java | 1 - .../java/com/segment/publicapi/models/Destination.java | 1 - .../com/segment/publicapi/models/Destination1.java | 1 - .../com/segment/publicapi/models/Destination2.java | 1 - .../publicapi/models/DestinationFilterActionV1.java | 1 - .../segment/publicapi/models/DestinationFilterV1.java | 1 - .../segment/publicapi/models/DestinationMetadata.java | 1 - .../models/DestinationMetadataActionFieldV1.java | 1 - .../publicapi/models/DestinationMetadataActionV1.java | 1 - .../models/DestinationMetadataComponentV1.java | 1 - .../models/DestinationMetadataFeaturesV1.java | 1 - .../publicapi/models/DestinationMetadataMethodsV1.java | 1 - .../models/DestinationMetadataPlatformsV1.java | 1 - .../DestinationMetadataSubscriptionPresetV1.java | 1 - .../publicapi/models/DestinationMetadataV1.java | 1 - .../segment/publicapi/models/DestinationStatusV1.java | 1 - .../publicapi/models/DestinationSubscription.java | 1 - .../models/DestinationSubscriptionUpdateInput.java | 1 - .../com/segment/publicapi/models/DestinationV1.java | 1 - .../models/DisableEdgeFunctions200Response.java | 1 - .../models/DisableEdgeFunctionsAlphaOutput.java | 1 - .../com/segment/publicapi/models/Echo200Response.java | 1 - .../com/segment/publicapi/models/Echo200Response1.java | 1 - .../com/segment/publicapi/models/EchoAlphaOutput.java | 1 - .../com/segment/publicapi/models/EchoV1Output.java | 1 - .../com/segment/publicapi/models/EdgeFunctions.java | 1 - .../com/segment/publicapi/models/EdgeFunctions1.java | 1 - .../segment/publicapi/models/EdgeFunctionsAlpha.java | 1 - .../com/segment/publicapi/models/EventSourceV1.java | 1 - src/main/java/com/segment/publicapi/models/Filter.java | 1 - .../java/com/segment/publicapi/models/Filter1.java | 1 - .../java/com/segment/publicapi/models/Filter2.java | 1 - .../java/com/segment/publicapi/models/Filter3.java | 1 - .../java/com/segment/publicapi/models/Function.java | 1 - .../java/com/segment/publicapi/models/Function1.java | 1 - .../java/com/segment/publicapi/models/Function2.java | 1 - .../segment/publicapi/models/FunctionDeployment.java | 1 - .../segment/publicapi/models/FunctionSettingV1.java | 1 - .../java/com/segment/publicapi/models/FunctionV1.java | 1 - .../GenerateUploadURLForEdgeFunctions200Response.java | 1 - .../GenerateUploadURLForEdgeFunctionsAlphaOutput.java | 1 - ...etAdvancedSyncScheduleFromWarehouse200Response.java | 1 - .../GetAdvancedSyncScheduleFromWarehouseV1Output.java | 1 - .../GetConnectionStateFromWarehouse200Response.java | 1 - .../GetConnectionStateFromWarehouseV1Output.java | 1 - .../GetDailyPerSourceAPICallsUsage200Response.java | 1 - .../models/GetDailyPerSourceAPICallsUsageV1Output.java | 1 - .../models/GetDailyPerSourceMTUUsage200Response.java | 1 - .../models/GetDailyPerSourceMTUUsageV1Output.java | 1 - .../GetDailyWorkspaceAPICallsUsage200Response.java | 1 - .../models/GetDailyWorkspaceAPICallsUsageV1Output.java | 1 - .../models/GetDailyWorkspaceMTUUsage200Response.java | 1 - .../models/GetDailyWorkspaceMTUUsageV1Output.java | 1 - .../publicapi/models/GetDestination200Response.java | 1 - .../models/GetDestinationMetadata200Response.java | 1 - .../models/GetDestinationMetadataV1Output.java | 1 - .../publicapi/models/GetDestinationV1Output.java | 1 - .../models/GetDestinationsCatalog200Response.java | 1 - .../models/GetDestinationsCatalogV1Output.java | 1 - .../GetEventsVolumeFromWorkspace200Response.java | 1 - .../models/GetEventsVolumeFromWorkspaceV1Output.java | 1 - .../models/GetFilterInDestination200Response.java | 1 - .../models/GetFilterInDestinationV1Output.java | 1 - .../publicapi/models/GetFunction200Response.java | 1 - .../segment/publicapi/models/GetFunctionV1Output.java | 1 - .../models/GetLatestFromEdgeFunctions200Response.java | 1 - .../models/GetLatestFromEdgeFunctionsAlphaOutput.java | 1 - .../GetMessagingSubscriptionFailureResponse.java | 1 - .../GetMessagingSubscriptionSuccessResponse.java | 1 - .../publicapi/models/GetRegulation200Response.java | 1 - .../publicapi/models/GetRegulationV1Output.java | 1 - .../segment/publicapi/models/GetSource200Response.java | 1 - .../publicapi/models/GetSource200Response1.java | 1 - .../segment/publicapi/models/GetSourceAlphaOutput.java | 1 - .../publicapi/models/GetSourceMetadata200Response.java | 1 - .../publicapi/models/GetSourceMetadataV1Output.java | 1 - .../segment/publicapi/models/GetSourceV1Output.java | 1 - .../publicapi/models/GetSourcesCatalog200Response.java | 1 - .../publicapi/models/GetSourcesCatalogV1Output.java | 1 - .../segment/publicapi/models/GetSpace200Response.java | 1 - .../segment/publicapi/models/GetSpaceAlphaOutput.java | 1 - .../GetSubscriptionFromDestination200Response.java | 1 - .../GetSubscriptionFromDestinationAlphaOutput.java | 1 - .../publicapi/models/GetSubscriptionRequest.java | 1 - .../publicapi/models/GetTrackingPlan200Response.java | 1 - .../publicapi/models/GetTrackingPlanV1Output.java | 1 - .../publicapi/models/GetTransformation200Response.java | 1 - .../publicapi/models/GetTransformationBetaOutput.java | 1 - .../segment/publicapi/models/GetUser200Response.java | 1 - .../publicapi/models/GetUserGroup200Response.java | 1 - .../segment/publicapi/models/GetUserGroupV1Output.java | 1 - .../com/segment/publicapi/models/GetUserV1Output.java | 1 - .../publicapi/models/GetWarehouse200Response.java | 1 - .../models/GetWarehouseMetadata200Response.java | 1 - .../publicapi/models/GetWarehouseMetadataV1Output.java | 1 - .../segment/publicapi/models/GetWarehouseV1Output.java | 1 - .../models/GetWarehousesCatalog200Response.java | 1 - .../publicapi/models/GetWarehousesCatalogV1Output.java | 1 - .../publicapi/models/GetWorkspace200Response.java | 1 - .../segment/publicapi/models/GetWorkspaceV1Output.java | 1 - src/main/java/com/segment/publicapi/models/Group.java | 1 - .../publicapi/models/GroupSourceSettingsV1.java | 1 - .../java/com/segment/publicapi/models/Identify.java | 1 - .../publicapi/models/IdentifySourceSettingsV1.java | 1 - src/main/java/com/segment/publicapi/models/Input.java | 1 - .../publicapi/models/IntegrationOptionBeta.java | 1 - .../segment/publicapi/models/InvitePermissionV1.java | 1 - .../java/com/segment/publicapi/models/InviteV1.java | 1 - src/main/java/com/segment/publicapi/models/Label.java | 1 - src/main/java/com/segment/publicapi/models/Label1.java | 1 - src/main/java/com/segment/publicapi/models/Label2.java | 1 - .../java/com/segment/publicapi/models/LabelAlpha.java | 1 - .../java/com/segment/publicapi/models/LabelV1.java | 1 - .../publicapi/models/ListAuditEvents200Response.java | 1 - .../publicapi/models/ListAuditEventsV1Output.java | 1 - ...ListConnectedDestinationsFromSource200Response.java | 1 - ...istConnectedDestinationsFromSource200Response1.java | 1 - ...ListConnectedDestinationsFromSourceAlphaOutput.java | 1 - .../ListConnectedDestinationsFromSourceV1Output.java | 1 - .../ListConnectedSourcesFromWarehouse200Response.java | 1 - .../ListConnectedSourcesFromWarehouseV1Output.java | 1 - .../ListConnectedWarehousesFromSource200Response.java | 1 - .../ListConnectedWarehousesFromSource200Response1.java | 1 - .../ListConnectedWarehousesFromSourceAlphaOutput.java | 1 - .../ListConnectedWarehousesFromSourceV1Output.java | 1 - ...liveryMetricsSummaryFromDestination200Response.java | 1 - ...eliveryMetricsSummaryFromDestinationBetaOutput.java | 1 - .../publicapi/models/ListDestinations200Response.java | 1 - .../publicapi/models/ListDestinationsV1Output.java | 1 - .../models/ListFiltersFromDestination200Response.java | 1 - .../models/ListFiltersFromDestinationV1Output.java | 1 - .../segment/publicapi/models/ListFunctionItemV1.java | 1 - .../publicapi/models/ListFunctions200Response.java | 1 - .../publicapi/models/ListFunctionsV1Output.java | 1 - .../publicapi/models/ListInvites200Response.java | 1 - .../models/ListInvitesFromUserGroup200Response.java | 1 - .../models/ListInvitesFromUserGroupV1Output.java | 1 - .../segment/publicapi/models/ListInvitesV1Output.java | 1 - .../publicapi/models/ListLabels200Response.java | 1 - .../publicapi/models/ListLabels200Response1.java | 1 - .../publicapi/models/ListLabelsAlphaOutput.java | 1 - .../segment/publicapi/models/ListLabelsV1Output.java | 1 - .../models/ListRegulationsFromSource200Response.java | 1 - .../models/ListRegulationsFromSourceV1Output.java | 1 - .../segment/publicapi/models/ListRoles200Response.java | 1 - .../segment/publicapi/models/ListRolesV1Output.java | 1 - .../models/ListRulesFromTrackingPlan200Response.java | 1 - .../models/ListRulesFromTrackingPlanV1Output.java | 1 - .../models/ListSchemaSettingsInSource200Response.java | 1 - .../models/ListSchemaSettingsInSourceV1Output.java | 1 - ...electiveSyncsFromWarehouseAndSource200Response.java | 1 - ...stSelectiveSyncsFromWarehouseAndSourceV1Output.java | 1 - .../publicapi/models/ListSources200Response.java | 1 - .../publicapi/models/ListSources200Response1.java | 1 - .../publicapi/models/ListSourcesAlphaOutput.java | 1 - .../models/ListSourcesFromTrackingPlan200Response.java | 1 - .../models/ListSourcesFromTrackingPlanV1Output.java | 1 - .../segment/publicapi/models/ListSourcesV1Output.java | 1 - .../ListSubscriptionsFromDestination200Response.java | 1 - .../ListSubscriptionsFromDestinationAlphaOutput.java | 1 - .../publicapi/models/ListSuppressions200Response.java | 1 - .../publicapi/models/ListSuppressionsV1Output.java | 1 - .../models/ListSyncsFromWarehouse200Response.java | 1 - .../ListSyncsFromWarehouseAndSource200Response.java | 1 - .../ListSyncsFromWarehouseAndSourceV1Output.java | 1 - .../models/ListSyncsFromWarehouseV1Output.java | 1 - .../publicapi/models/ListTrackingPlans200Response.java | 1 - .../publicapi/models/ListTrackingPlansV1Output.java | 1 - .../models/ListTransformations200Response.java | 1 - .../models/ListTransformationsBetaOutput.java | 1 - .../publicapi/models/ListUserGroups200Response.java | 1 - .../models/ListUserGroupsFromUser200Response.java | 1 - .../models/ListUserGroupsFromUserV1Output.java | 1 - .../publicapi/models/ListUserGroupsV1Output.java | 1 - .../segment/publicapi/models/ListUsers200Response.java | 1 - .../models/ListUsersFromUserGroup200Response.java | 1 - .../models/ListUsersFromUserGroupV1Output.java | 1 - .../segment/publicapi/models/ListUsersV1Output.java | 1 - .../publicapi/models/ListWarehouses200Response.java | 1 - .../publicapi/models/ListWarehousesV1Output.java | 1 - .../models/ListWorkspaceRegulations200Response.java | 1 - .../models/ListWorkspaceRegulationsV1Output.java | 1 - src/main/java/com/segment/publicapi/models/Logos.java | 1 - src/main/java/com/segment/publicapi/models/Logos1.java | 1 - src/main/java/com/segment/publicapi/models/Logos2.java | 1 - .../java/com/segment/publicapi/models/LogosBeta.java | 1 - .../publicapi/models/MessageSubscriptionResponse.java | 1 - .../models/MessageSubscriptionResponseError.java | 1 - .../publicapi/models/MessagesSubscriptionRequest.java | 1 - .../java/com/segment/publicapi/models/Metadata.java | 1 - .../java/com/segment/publicapi/models/Metadata1.java | 1 - .../java/com/segment/publicapi/models/Metadata2.java | 1 - .../java/com/segment/publicapi/models/MetricBeta.java | 1 - .../segment/publicapi/models/MinimalUserGroupV1.java | 1 - .../com/segment/publicapi/models/MinimalUserV1.java | 1 - .../com/segment/publicapi/models/MtuSnapshotV1.java | 1 - .../java/com/segment/publicapi/models/Pagination.java | 1 - .../com/segment/publicapi/models/PaginationInput.java | 1 - .../com/segment/publicapi/models/PaginationOutput.java | 1 - .../segment/publicapi/models/PermissionInputV1.java | 1 - .../segment/publicapi/models/PermissionResourceV1.java | 1 - .../com/segment/publicapi/models/PermissionV1.java | 1 - .../models/PreviewDestinationFilter200Response.java | 1 - .../publicapi/models/PreviewDestinationFilterV1.java | 1 - .../models/PreviewDestinationFilterV1Input.java | 1 - .../models/PreviewDestinationFilterV1Output.java | 9 ++++----- .../segment/publicapi/models/PropertyRenameBeta.java | 1 - .../models/PropertyValueTransformationBeta.java | 1 - .../java/com/segment/publicapi/models/Regulation.java | 1 - .../publicapi/models/RegulationListEntryV1.java | 1 - .../models/RemoveFilterFromDestination200Response.java | 1 - .../models/RemoveFilterFromDestinationV1Output.java | 1 - .../com/segment/publicapi/models/RemoveRuleV1.java | 1 - .../models/RemoveRulesFromTrackingPlan200Response.java | 1 - .../models/RemoveRulesFromTrackingPlanV1Output.java | 1 - ...RemoveSourceConnectionFromWarehouse200Response.java | 1 - .../RemoveSourceConnectionFromWarehouseV1Output.java | 1 - .../RemoveSourceFromTrackingPlan200Response.java | 1 - .../models/RemoveSourceFromTrackingPlanV1Output.java | 1 - .../RemoveSubscriptionFromDestination200Response.java | 1 - .../RemoveSubscriptionFromDestinationAlphaOutput.java | 1 - .../models/RemoveUsersFromUserGroup200Response.java | 1 - .../models/RemoveUsersFromUserGroupV1Output.java | 1 - ...aceAdvancedSyncScheduleForWarehouse200Response.java | 1 - ...ReplaceAdvancedSyncScheduleForWarehouseV1Input.java | 1 - ...eplaceAdvancedSyncScheduleForWarehouseV1Output.java | 1 - .../models/ReplaceLabelsInSource200Response.java | 1 - .../models/ReplaceLabelsInSource200Response1.java | 1 - .../models/ReplaceLabelsInSourceAlphaInput.java | 1 - .../models/ReplaceLabelsInSourceAlphaOutput.java | 1 - .../publicapi/models/ReplaceLabelsInSourceV1Input.java | 1 - .../models/ReplaceLabelsInSourceV1Output.java | 1 - ...placeMessagingSubscriptionsInSpaces200Response.java | 1 - ...eplaceMessagingSubscriptionsInSpacesAlphaInput.java | 1 - ...placeMessagingSubscriptionsInSpacesAlphaOutput.java | 1 - .../models/ReplacePermissionsForUser200Response.java | 1 - .../ReplacePermissionsForUserGroup200Response.java | 1 - .../models/ReplacePermissionsForUserGroupV1Input.java | 1 - .../models/ReplacePermissionsForUserGroupV1Output.java | 1 - .../models/ReplacePermissionsForUserV1Input.java | 1 - .../models/ReplacePermissionsForUserV1Output.java | 1 - .../models/ReplaceRulesInTrackingPlan200Response.java | 1 - .../models/ReplaceRulesInTrackingPlanV1Input.java | 1 - .../models/ReplaceRulesInTrackingPlanV1Output.java | 1 - .../models/ReplaceUsersInUserGroup200Response.java | 1 - .../models/ReplaceUsersInUserGroupV1Input.java | 1 - .../models/ReplaceUsersInUserGroupV1Output.java | 1 - .../com/segment/publicapi/models/RequestError.java | 1 - .../segment/publicapi/models/RequestErrorEnvelope.java | 1 - .../java/com/segment/publicapi/models/ResourceV1.java | 1 - src/main/java/com/segment/publicapi/models/RoleV1.java | 1 - src/main/java/com/segment/publicapi/models/RuleV1.java | 1 - .../java/com/segment/publicapi/models/Schedule.java | 1 - .../java/com/segment/publicapi/models/Schedule1.java | 1 - .../java/com/segment/publicapi/models/Schedule2.java | 1 - .../java/com/segment/publicapi/models/Settings.java | 1 - .../java/com/segment/publicapi/models/Settings1.java | 1 - src/main/java/com/segment/publicapi/models/Source.java | 1 - .../java/com/segment/publicapi/models/Source1.java | 1 - .../java/com/segment/publicapi/models/Source2.java | 1 - .../java/com/segment/publicapi/models/Source3.java | 1 - .../java/com/segment/publicapi/models/Source4.java | 1 - .../java/com/segment/publicapi/models/Source5.java | 1 - .../java/com/segment/publicapi/models/Source6.java | 1 - .../publicapi/models/SourceAPICallSnapshotV1.java | 1 - .../java/com/segment/publicapi/models/SourceAlpha.java | 1 - .../publicapi/models/SourceEventVolumeDatapointV1.java | 1 - .../segment/publicapi/models/SourceEventVolumeV1.java | 1 - .../com/segment/publicapi/models/SourceMetadata.java | 1 - .../com/segment/publicapi/models/SourceMetadataV1.java | 1 - .../publicapi/models/SourceSettingsOutputV1.java | 1 - .../java/com/segment/publicapi/models/SourceV1.java | 1 - src/main/java/com/segment/publicapi/models/Space.java | 1 - .../com/segment/publicapi/models/StreamStatusV1.java | 1 - .../com/segment/publicapi/models/Subscription.java | 1 - .../segment/publicapi/models/SupportedFeatures.java | 1 - .../com/segment/publicapi/models/SupportedMethods.java | 1 - .../segment/publicapi/models/SupportedPlatforms.java | 1 - .../com/segment/publicapi/models/SuppressedInner.java | 1 - .../com/segment/publicapi/models/SyncNoticeV1.java | 1 - src/main/java/com/segment/publicapi/models/SyncV1.java | 1 - src/main/java/com/segment/publicapi/models/Track.java | 1 - .../publicapi/models/TrackSourceSettingsV1.java | 1 - .../com/segment/publicapi/models/TrackingPlan.java | 1 - .../com/segment/publicapi/models/TrackingPlan1.java | 1 - .../com/segment/publicapi/models/TrackingPlanV1.java | 1 - .../com/segment/publicapi/models/Transformation.java | 1 - .../com/segment/publicapi/models/Transformation1.java | 1 - .../com/segment/publicapi/models/Transformation2.java | 1 - .../segment/publicapi/models/TransformationBeta.java | 1 - .../publicapi/models/UpdateDestination200Response.java | 1 - .../publicapi/models/UpdateDestinationV1Input.java | 1 - .../publicapi/models/UpdateDestinationV1Output.java | 1 - .../models/UpdateFilterForDestination200Response.java | 1 - .../models/UpdateFilterForDestinationV1Input.java | 1 - .../models/UpdateFilterForDestinationV1Output.java | 1 - .../publicapi/models/UpdateFunction200Response.java | 1 - .../publicapi/models/UpdateFunctionV1Input.java | 1 - .../publicapi/models/UpdateFunctionV1Output.java | 1 - .../models/UpdateRulesInTrackingPlan200Response.java | 1 - .../models/UpdateRulesInTrackingPlanV1Input.java | 1 - .../models/UpdateRulesInTrackingPlanV1Output.java | 1 - .../UpdateSchemaSettingsInSource200Response.java | 1 - .../models/UpdateSchemaSettingsInSourceV1Input.java | 1 - .../models/UpdateSchemaSettingsInSourceV1Output.java | 1 - .../UpdateSelectiveSyncForWarehouse200Response.java | 1 - .../models/UpdateSelectiveSyncForWarehouseV1Input.java | 1 - .../UpdateSelectiveSyncForWarehouseV1Output.java | 1 - .../publicapi/models/UpdateSource200Response.java | 1 - .../publicapi/models/UpdateSource200Response1.java | 1 - .../publicapi/models/UpdateSourceAlphaInput.java | 1 - .../publicapi/models/UpdateSourceAlphaOutput.java | 1 - .../segment/publicapi/models/UpdateSourceV1Input.java | 1 - .../segment/publicapi/models/UpdateSourceV1Output.java | 1 - .../UpdateSubscriptionForDestination200Response.java | 1 - .../UpdateSubscriptionForDestinationAlphaInput.java | 1 - .../UpdateSubscriptionForDestinationAlphaOutput.java | 1 - .../models/UpdateTrackingPlan200Response.java | 1 - .../publicapi/models/UpdateTrackingPlanV1Input.java | 1 - .../publicapi/models/UpdateTrackingPlanV1Output.java | 1 - .../models/UpdateTransformation200Response.java | 1 - .../models/UpdateTransformationBetaInput.java | 1 - .../models/UpdateTransformationBetaOutput.java | 1 - .../publicapi/models/UpdateUserGroup200Response.java | 1 - .../publicapi/models/UpdateUserGroupV1Input.java | 1 - .../publicapi/models/UpdateUserGroupV1Output.java | 1 - .../publicapi/models/UpdateWarehouse200Response.java | 1 - .../publicapi/models/UpdateWarehouseV1Input.java | 1 - .../publicapi/models/UpdateWarehouseV1Output.java | 1 - .../com/segment/publicapi/models/UpsertRuleV1.java | 1 - src/main/java/com/segment/publicapi/models/User.java | 1 - .../java/com/segment/publicapi/models/UserGroup.java | 1 - .../java/com/segment/publicapi/models/UserGroup1.java | 1 - .../java/com/segment/publicapi/models/UserGroup2.java | 1 - .../java/com/segment/publicapi/models/UserGroup3.java | 1 - .../java/com/segment/publicapi/models/UserGroupV1.java | 1 - src/main/java/com/segment/publicapi/models/UserV1.java | 1 - .../publicapi/models/UsersPerSourceSnapshotV1.java | 1 - .../java/com/segment/publicapi/models/Warehouse.java | 1 - .../java/com/segment/publicapi/models/Warehouse1.java | 1 - .../java/com/segment/publicapi/models/Warehouse2.java | 1 - .../publicapi/models/WarehouseAdvancedSyncV1.java | 1 - .../segment/publicapi/models/WarehouseMetadata.java | 1 - .../segment/publicapi/models/WarehouseMetadataV1.java | 1 - .../publicapi/models/WarehouseSelectiveSyncItemV1.java | 1 - .../publicapi/models/WarehouseSyncOverrideV1.java | 1 - .../java/com/segment/publicapi/models/WarehouseV1.java | 1 - .../java/com/segment/publicapi/models/Workspace.java | 1 - .../java/com/segment/publicapi/models/WorkspaceV1.java | 1 - .../java/com/segment/publicapi/api/EchoApiTest.java | 1 - 506 files changed, 24 insertions(+), 520 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 9e0b518c..0eb818ea 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -7,6 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Get changes in pom.xml + id: changed-pom + uses: tj-actions/changed-files@v34 + with: + files: | + pom.xml - name: Set up Maven Central Repository uses: actions/setup-java@v3 with: @@ -18,6 +24,7 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - name: Publish package + if: steps.changed-pom.outputs.any_changed == 'true' run: mvn --batch-mode clean deploy env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} diff --git a/README.md b/README.md index 08be087c..af55f149 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 32.0.4 +- API version: 33.0.2 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -35,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 32.0.4 + 33.0.2 compile ``` @@ -51,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:32.0.4" + implementation "com.segment.publicapi:segment-publicapi:33.0.2" } ``` @@ -65,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-32.0.4.jar` +* `target/segment-publicapi-33.0.2.jar` * `target/lib/*.jar` ## Getting Started diff --git a/pom.xml b/pom.xml index 0bafff52..79b6c2d2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 32.0.4 + 33.0.2 https://segment.com/docs/api/public-api/ Segment Public API @@ -251,7 +251,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts @@ -259,6 +259,12 @@ sign + + + --pinentry-mode + loopback + + diff --git a/src/main/java/com/segment/publicapi/ApiCallback.java b/src/main/java/com/segment/publicapi/ApiCallback.java index 12817a96..db3c5648 100644 --- a/src/main/java/com/segment/publicapi/ApiCallback.java +++ b/src/main/java/com/segment/publicapi/ApiCallback.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 076b5ccb..7baab8e6 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -125,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/32.0.4/java"); + setUserAgent("OpenAPI-Generator/33.0.2/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/ApiException.java b/src/main/java/com/segment/publicapi/ApiException.java index c0590044..3957eb2d 100644 --- a/src/main/java/com/segment/publicapi/ApiException.java +++ b/src/main/java/com/segment/publicapi/ApiException.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ApiResponse.java b/src/main/java/com/segment/publicapi/ApiResponse.java index 95a241ca..00009055 100644 --- a/src/main/java/com/segment/publicapi/ApiResponse.java +++ b/src/main/java/com/segment/publicapi/ApiResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f3510d54..ccfab24f 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java index 89734910..299cc535 100644 --- a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java +++ b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index b2e7690b..6624035e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/Pair.java b/src/main/java/com/segment/publicapi/Pair.java index 554b2d48..22993e8a 100644 --- a/src/main/java/com/segment/publicapi/Pair.java +++ b/src/main/java/com/segment/publicapi/Pair.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressRequestBody.java b/src/main/java/com/segment/publicapi/ProgressRequestBody.java index 2062a60c..23559aa2 100644 --- a/src/main/java/com/segment/publicapi/ProgressRequestBody.java +++ b/src/main/java/com/segment/publicapi/ProgressRequestBody.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/ProgressResponseBody.java b/src/main/java/com/segment/publicapi/ProgressResponseBody.java index 84e4814b..046276c6 100644 --- a/src/main/java/com/segment/publicapi/ProgressResponseBody.java +++ b/src/main/java/com/segment/publicapi/ProgressResponseBody.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/StringUtil.java b/src/main/java/com/segment/publicapi/StringUtil.java index f533c942..5bbb1bf5 100644 --- a/src/main/java/com/segment/publicapi/StringUtil.java +++ b/src/main/java/com/segment/publicapi/StringUtil.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java index 7baa42a7..07b2e8a4 100644 --- a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java +++ b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index fd4bdf76..eee8b577 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/CatalogApi.java b/src/main/java/com/segment/publicapi/api/CatalogApi.java index bb64a28f..3420f385 100644 --- a/src/main/java/com/segment/publicapi/api/CatalogApi.java +++ b/src/main/java/com/segment/publicapi/api/CatalogApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index a9119a95..cde51e20 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index c13b08e6..1f450fcd 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 317de9ff..2297595b 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index 330e2267..8ab3a094 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index 2603a05c..7e7dccd4 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 296f31d3..446bcd40 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index 1d91f5f7..76d10223 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamRolesApi.java b/src/main/java/com/segment/publicapi/api/IamRolesApi.java index f7ebf845..49aeda33 100644 --- a/src/main/java/com/segment/publicapi/api/IamRolesApi.java +++ b/src/main/java/com/segment/publicapi/api/IamRolesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 344fe567..64d7fecb 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index 65054ab9..497cb9ca 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java index 551177e8..882dbfea 100644 --- a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 6c478d04..3c2de758 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index ef46d677..240ddb5c 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 9aa5c813..150f573a 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TestingApi.java b/src/main/java/com/segment/publicapi/api/TestingApi.java index f88ba694..cf623c60 100644 --- a/src/main/java/com/segment/publicapi/api/TestingApi.java +++ b/src/main/java/com/segment/publicapi/api/TestingApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index 4f781ceb..93b89e46 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index 85e4a26e..0c92832f 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index 18c61db3..fd3e3a0a 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index b898a98f..88cc0252 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java index 035d232e..6372e883 100644 --- a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java +++ b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/Authentication.java b/src/main/java/com/segment/publicapi/auth/Authentication.java index c314af4f..34b1e2a0 100644 --- a/src/main/java/com/segment/publicapi/auth/Authentication.java +++ b/src/main/java/com/segment/publicapi/auth/Authentication.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java index dd20d918..5937daea 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java index bea680bd..8283d8d5 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java index ff712688..71c11dfb 100644 --- a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java index 7a6f9656..3fd41e26 100644 --- a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java +++ b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java index 3b78aca0..c69bf1da 100644 --- a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java index c578bc4e..4aa990b8 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java index bcccaf5d..2ad0ea0c 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java index 6350d7bf..16a66188 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java index 2f509fd7..2df1ce49 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java index 6eeaa66d..3a8d626a 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java index 56866e6c..c23c2328 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index ababcf0c..c9797897 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java index 4f5a39ee..43d77c84 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java index 7db3a09b..3bc9125b 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java index e28d02bf..5cf1b40d 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index d8e4c71c..65c45470 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java index f1e77ba0..c0d998d3 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index 29e51270..f05fdea4 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java index 5beb00f4..d56acb1a 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java index 0374116b..218be362 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index ad0a5fc0..a7d972b4 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java index e339cfa8..a124522d 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java index 60b26d7d..0d0a8aa4 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index 183ff889..b5ac724d 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java index b3361af9..22ac54e6 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java index f8251644..40854f1b 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java index 4a7cc1ea..447d6bd0 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java index 6b214ea3..54a2513e 100644 --- a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java +++ b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/AuditEventV1.java b/src/main/java/com/segment/publicapi/models/AuditEventV1.java index 5eb4ba7b..b18b34c2 100644 --- a/src/main/java/com/segment/publicapi/models/AuditEventV1.java +++ b/src/main/java/com/segment/publicapi/models/AuditEventV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java index 23138a97..41432dec 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java index 953c4217..a2bf8420 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java index 7913e1ce..88a61351 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java index a0858f78..0cfb4fb4 100644 --- a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java +++ b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java index 629f773d..82e71b3d 100644 --- a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index 649c3664..3842f54b 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java index cadf8f61..715fc67d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 17bb737d..3953116d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,8 +39,6 @@ public class CreateCloudSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java index 15ee4f6c..b6c44c50 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java index 61c2c2b4..daa6ee08 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java index d996b509..8c13d1ad 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index 6fbf273a..4c106b62 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java index 9981793c..a1aebc9c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java index 7d2163ab..97115eb2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java index 23f751b2..c91dc3ae 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java index 86d552c8..34705ffe 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java index 89a9adaf..973ce203 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java index 1ed058da..10e0cd9f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java index 75c95647..13ee2c71 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index b3b85ac1..9bf68b50 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java index 1101d177..ed49daa7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java index 6ef412c2..dc517738 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java index 9934d7a3..74089c12 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java index 3c80d404..09c5e0ad 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 49f961a5..9bc33f12 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java index 5c3c6767..8499d551 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java index 6760324e..35dec0b5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java index 5f1c280d..a73beefd 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java index c173fb9d..72d1571d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java index d71b8d08..938c3747 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java index e64d84f8..f1774f85 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java index 1139acbe..80d4882c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java index 6de301bd..6a49977b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index 77b39b39..4929d123 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index 3213637c..ef6b38b7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java index e3814147..d9a27ae2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java index 78461580..8af37cbb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java index 822b86d2..079c3b67 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java index 673dd8f9..5615bb4b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java index 6f36f4d4..53577e8b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 2345d64b..83460e0d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,8 +39,6 @@ public class CreateSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java index e56ee96e..ddc99706 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index 3f993547..f97aa16a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java index db520440..289c41e8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java index 9f64dd07..32b68deb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index c0dbe528..199d6774 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java index cece15d2..ed4840d6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 408667f6..7a69552c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 3948d986..998e2f7b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java index 3b935df5..f0a448c0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java index 8be574e1..bf6b8915 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java index bf769efc..4ab3946d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java index e750b2e2..49cc207c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java index 73110d39..3e90d7de 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java index 7b7f3402..d33b85a9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java index 95ba9a3e..25d6304f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java index c4f557b1..42f07a8a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index e8ec13c8..114151a0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java index 30777dac..fde81683 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java index 458f9990..5796f9c4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index b841249b..64bf8ae4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -40,8 +39,6 @@ public class CreateWorkspaceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - BULK_DELETE_ONLY("BULK_DELETE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java index 39c2bf7f..c3029deb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java index 62576565..dae26210 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java index cc72f524..beed4187 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java index f4764bb7..8b391862 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java index 235daeb4..1699c4c3 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java index 1d215577..7fd77240 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java index 24ae6f08..b7cea68f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java index 2fe7c3ee..d7ee648c 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java index 2f2eff55..b15bcbd3 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java index d249a822..b3fd978d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java index c68c0e08..9dd7d052 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java index da2d4e2e..d4d8d54c 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java index b033fc03..132a2b46 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java index 5e1a34dd..b4d0408d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java index e45d3c7e..aaa42bf6 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java index 1d96829d..f1fe0e84 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java index f05522d2..48ef8de7 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java index 4636fad0..8ef1d630 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java index 689bd19d..acf621c8 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index f589305d..4fba2302 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java index 7e945d45..68b39cfe 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java index 96d43d9e..f785970f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java index 5c4ebfbb..32270d94 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java index 5fe2f85c..7c765184 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java index a9f74677..8c742d42 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java index 95c7c25f..000932c5 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java index 12046fd1..73f7ddf4 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java index 9b9a1b5e..6a8b6a28 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java index 322a5a9f..b1189d62 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java index fd2cba60..05b4e882 100644 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ b/src/main/java/com/segment/publicapi/models/Destination.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination1.java b/src/main/java/com/segment/publicapi/models/Destination1.java index 61a64d3c..13fa3a1d 100644 --- a/src/main/java/com/segment/publicapi/models/Destination1.java +++ b/src/main/java/com/segment/publicapi/models/Destination1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Destination2.java b/src/main/java/com/segment/publicapi/models/Destination2.java index dca4749c..d38d901c 100644 --- a/src/main/java/com/segment/publicapi/models/Destination2.java +++ b/src/main/java/com/segment/publicapi/models/Destination2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java index 476611b3..9b9555da 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java index 1309d666..f27aaff2 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java index f84d64ae..ffce6c4c 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index 315cb2f2..ff882290 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java index cf87abc3..140737ad 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java index 665a5c94..3ee7b033 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java index 5ea8e9b8..d7e0e31b 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java index 43bd017e..d9db7c1f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index bb95447f..ae0311d7 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java index 6291c65d..0ecd0dc4 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 23f73803..c873b90e 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index 8c2247bd..c62376c8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index c365875f..278abe79 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 8b37ae24..79c4df32 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DestinationV1.java b/src/main/java/com/segment/publicapi/models/DestinationV1.java index 29775c10..5c9cbadc 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java index af52e869..35941304 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java index 18d83c41..47feb531 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response.java b/src/main/java/com/segment/publicapi/models/Echo200Response.java index a6f12160..9ede64cf 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response1.java b/src/main/java/com/segment/publicapi/models/Echo200Response1.java index eb00f98b..f52588e1 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response1.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java index 923673f4..41a57d7b 100644 --- a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EchoV1Output.java b/src/main/java/com/segment/publicapi/models/EchoV1Output.java index 1772428d..5f1aa64a 100644 --- a/src/main/java/com/segment/publicapi/models/EchoV1Output.java +++ b/src/main/java/com/segment/publicapi/models/EchoV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java index 67c54a71..338033ac 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java index 3a0b7c3f..9816c2c9 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java index 5b0a52dd..38106812 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/EventSourceV1.java b/src/main/java/com/segment/publicapi/models/EventSourceV1.java index 8285c002..a09f5ee3 100644 --- a/src/main/java/com/segment/publicapi/models/EventSourceV1.java +++ b/src/main/java/com/segment/publicapi/models/EventSourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index 48a45b5d..7bdd81cf 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter1.java b/src/main/java/com/segment/publicapi/models/Filter1.java index e6e192ee..d5668ad5 100644 --- a/src/main/java/com/segment/publicapi/models/Filter1.java +++ b/src/main/java/com/segment/publicapi/models/Filter1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter2.java b/src/main/java/com/segment/publicapi/models/Filter2.java index 9816aabd..1fd399cc 100644 --- a/src/main/java/com/segment/publicapi/models/Filter2.java +++ b/src/main/java/com/segment/publicapi/models/Filter2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Filter3.java b/src/main/java/com/segment/publicapi/models/Filter3.java index 0cab7a1e..79d03d6d 100644 --- a/src/main/java/com/segment/publicapi/models/Filter3.java +++ b/src/main/java/com/segment/publicapi/models/Filter3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index 90744e66..f20febe4 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java index c1ba336d..8059f0f2 100644 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ b/src/main/java/com/segment/publicapi/models/Function1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java index 02352bca..7bba1c6a 100644 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ b/src/main/java/com/segment/publicapi/models/Function2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java index e49f77b0..332de392 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java +++ b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index 04239fea..68bd50c8 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index 0c8d3040..c6717cbd 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java index 52206370..2895f2e6 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java index 244d2137..d95c3415 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java index b34cdc68..06b67556 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java index 2c81cdf1..3b5ae269 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java index f869f742..de27e86d 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java index 9ba59b4d..375eb53b 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java index 8c68b0af..8b95688c 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java index 2f892244..bfe0632a 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java index b2df4897..7a2d4c51 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java index 97416945..6165cdb1 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java index 527113c0..2a03891a 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java index fd0382d7..0a330153 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java index 6d20b0a7..17ca7e58 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java index cc181bce..134e3b03 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java index 11e1c5d1..3c7a9f62 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java index a73a66ba..3e367243 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java index 740dbd1d..05203813 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java index c33e5aeb..310066ce 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java index 729c746f..c434bd56 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java index 3699e373..788d04fc 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java index cf4ab1a8..5aa6c994 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 8fdebbb8..1add9558 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java index 40be0ad8..87bfa0da 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java index 5408adb4..026b969b 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java index 705108ed..544dac87 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 8f033da8..77863757 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java index ccf11178..d4af1202 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java index c85bd26c..214cfe31 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java index a2a0a7f5..56bd4447 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index b99eb3bc..67f7241e 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java index 0dd11ed8..fdeed139 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java index 510f4e65..273b74bf 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response.java b/src/main/java/com/segment/publicapi/models/GetSource200Response.java index 093d3670..60e095a6 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java index ebae583f..2f7373d1 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java index 74654c79..6dd120ea 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java index eccf971c..2b8118fe 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java index 1f632a6e..9476806e 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index 28e1e965..5755a188 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java index 87960d57..545b763c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java index 089be53c..f79c0853 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java index 016ee221..48da4cb4 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java index 83d9e895..1fb9ef76 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java index 2b346779..5acade54 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java index e978c45f..5f90146a 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 9c0f579c..bf7c207f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java index ab9bbecc..63a56dac 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java index 7cc02cb0..ef7b3edc 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index fca531e7..0188ba83 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java index 1c867754..3942ce53 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUser200Response.java b/src/main/java/com/segment/publicapi/models/GetUser200Response.java index 71df8830..aa7889e1 100644 --- a/src/main/java/com/segment/publicapi/models/GetUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java index 89208576..a415949b 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java index 22ecbd17..10bc83f3 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java index ccdcb8b2..87b89574 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java index 1baedb8f..24163ca3 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java index e62895da..d745308a 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java index 9b7810bb..1303fd6a 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java index 7ee39c4f..fa31bb42 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java index a2fc1d68..2a54a775 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java index 1ec751df..43a289b7 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java index 9c7fa5ac..e00436bf 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java index a5ea6bf8..e93b81cb 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Group.java b/src/main/java/com/segment/publicapi/models/Group.java index 6b888c88..6093019f 100644 --- a/src/main/java/com/segment/publicapi/models/Group.java +++ b/src/main/java/com/segment/publicapi/models/Group.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java index 0cd0ac6e..bf7ff2e9 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Identify.java b/src/main/java/com/segment/publicapi/models/Identify.java index 82f093f7..38f4e9f3 100644 --- a/src/main/java/com/segment/publicapi/models/Identify.java +++ b/src/main/java/com/segment/publicapi/models/Identify.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java index c2b665f3..6de6972c 100644 --- a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Input.java b/src/main/java/com/segment/publicapi/models/Input.java index 76b971c9..74f70753 100644 --- a/src/main/java/com/segment/publicapi/models/Input.java +++ b/src/main/java/com/segment/publicapi/models/Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java index 9ff65ea1..d3408ee1 100644 --- a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java +++ b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java index c6dfa004..47eb64e6 100644 --- a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/InviteV1.java b/src/main/java/com/segment/publicapi/models/InviteV1.java index fd748d0e..8d7493f8 100644 --- a/src/main/java/com/segment/publicapi/models/InviteV1.java +++ b/src/main/java/com/segment/publicapi/models/InviteV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label.java b/src/main/java/com/segment/publicapi/models/Label.java index 68e30717..a583029f 100644 --- a/src/main/java/com/segment/publicapi/models/Label.java +++ b/src/main/java/com/segment/publicapi/models/Label.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label1.java b/src/main/java/com/segment/publicapi/models/Label1.java index 82f1a254..abf663f5 100644 --- a/src/main/java/com/segment/publicapi/models/Label1.java +++ b/src/main/java/com/segment/publicapi/models/Label1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Label2.java b/src/main/java/com/segment/publicapi/models/Label2.java index 0d9ed2ff..07e41ab1 100644 --- a/src/main/java/com/segment/publicapi/models/Label2.java +++ b/src/main/java/com/segment/publicapi/models/Label2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelAlpha.java b/src/main/java/com/segment/publicapi/models/LabelAlpha.java index 3df466a2..350d897f 100644 --- a/src/main/java/com/segment/publicapi/models/LabelAlpha.java +++ b/src/main/java/com/segment/publicapi/models/LabelAlpha.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LabelV1.java b/src/main/java/com/segment/publicapi/models/LabelV1.java index 7b509730..5aff4794 100644 --- a/src/main/java/com/segment/publicapi/models/LabelV1.java +++ b/src/main/java/com/segment/publicapi/models/LabelV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java index 6bfb7921..ae475f75 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEvents200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java index 6f2c935e..a7764fc9 100644 --- a/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListAuditEventsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java index b8cb7ee8..7f24f24a 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java index fd53e4b9..dd5a0504 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java index 8d3dc81d..a8af96af 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java index a17ff9ed..8caa5077 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedDestinationsFromSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java index 131e74da..eff3c02e 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java index b3f73ffe..f6d74db8 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedSourcesFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java index 88d862f1..93dea71f 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java index 1c7655cb..57877075 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java index e42153bb..42f169a9 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java index 9984ebd8..b1fb9c63 100644 --- a/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListConnectedWarehousesFromSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java index 630d3751..e2c0e27a 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java index 6ab4630e..c4796861 100644 --- a/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListDeliveryMetricsSummaryFromDestinationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java index 9d7f0680..1c014cdf 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinations200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java index 71bb2da0..c71e96f1 100644 --- a/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListDestinationsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java index 58e6fdd8..b152ccc2 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java index 3f5f8e3e..c727dda4 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersFromDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index dfba276b..66c69339 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java index 7489c2a6..48e4a570 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java index 955d4afe..f1f0518e 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java index ce0bca4e..599d65fc 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvites200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java index aae0ae68..71783c64 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java index ae654f79..07aa2962 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesFromUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java index 6d144c1e..a03f887d 100644 --- a/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListInvitesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java index 01a82068..99dfda3f 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java index 46300910..7d22595a 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListLabels200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java index 08c07ecd..b4199bbb 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java index d7c11d74..5ac80336 100644 --- a/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListLabelsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java index 85882dfb..93520e73 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java index 3dd31b22..cf819e64 100644 --- a/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRegulationsFromSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java index d968c251..3f860460 100644 --- a/src/main/java/com/segment/publicapi/models/ListRoles200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRoles200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java index a0af4fb3..4579d420 100644 --- a/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRolesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java index d741d83b..f291ee10 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java index c76ac938..9da42cd1 100644 --- a/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListRulesFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java index 7e9679a8..367d636a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java index 4776daef..fd9cd1b0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSchemaSettingsInSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java index 8f33a90f..0bfd630c 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java index a501c2ed..93f0219a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response.java b/src/main/java/com/segment/publicapi/models/ListSources200Response.java index aa5f1786..f2a267e4 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java index fec2465b..e2d5a21d 100644 --- a/src/main/java/com/segment/publicapi/models/ListSources200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ListSources200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java index 90cba01a..f22a8014 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java index e1e9768a..aa2b2c5b 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java index 7cf332b1..1a285227 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java index 70694013..72b9c7ab 100644 --- a/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSourcesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java index 1e5577c2..63db0f25 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java index 987ed800..069785d0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSubscriptionsFromDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java index bcf88cdf..e80f4a22 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressions200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java index b39d1eab..9137d79c 100644 --- a/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSuppressionsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java index 2a95ca18..3d69c4d0 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java index e9323326..694b3d25 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java index 11749179..ffd9a6a3 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseAndSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java index 7a9506e0..8c37a8c9 100644 --- a/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListSyncsFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java index 8c3a6b83..99ac64e7 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlans200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java index 95ca8105..2eb89d55 100644 --- a/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListTrackingPlansV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index 84d1efb7..f489b14e 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java index c5fd25ec..f2484ee6 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java index fa89dd2f..c8400059 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroups200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java index 48b41f34..cee52465 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java index ad32546e..2302ec88 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsFromUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java index d4e3784e..8e8bbe4b 100644 --- a/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUserGroupsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java index e46ba650..bd720378 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsers200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java index 2910f2dc..75ae4910 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java index 89719a06..b9b368b5 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersFromUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java index 312c4e48..a6476b40 100644 --- a/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListUsersV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java index e86a6e5c..778b9cb4 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehouses200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java index 836aa581..03bfddf9 100644 --- a/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWarehousesV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java index d0ac7ba4..d6d84dc1 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulations200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java index 86e78eaa..b03af950 100644 --- a/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ListWorkspaceRegulationsV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos.java b/src/main/java/com/segment/publicapi/models/Logos.java index d174f434..3d828bd4 100644 --- a/src/main/java/com/segment/publicapi/models/Logos.java +++ b/src/main/java/com/segment/publicapi/models/Logos.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos1.java b/src/main/java/com/segment/publicapi/models/Logos1.java index 57199ee6..6baa4f95 100644 --- a/src/main/java/com/segment/publicapi/models/Logos1.java +++ b/src/main/java/com/segment/publicapi/models/Logos1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Logos2.java b/src/main/java/com/segment/publicapi/models/Logos2.java index 6c285023..7210fe0c 100644 --- a/src/main/java/com/segment/publicapi/models/Logos2.java +++ b/src/main/java/com/segment/publicapi/models/Logos2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/LogosBeta.java b/src/main/java/com/segment/publicapi/models/LogosBeta.java index 1b396acf..88b2d956 100644 --- a/src/main/java/com/segment/publicapi/models/LogosBeta.java +++ b/src/main/java/com/segment/publicapi/models/LogosBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 4e696e94..7c2f24cb 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java index 90f5fe50..a3d3c62a 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponseError.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index ce9dcd3f..5621edf6 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata.java b/src/main/java/com/segment/publicapi/models/Metadata.java index 241a95d4..29b47444 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata.java +++ b/src/main/java/com/segment/publicapi/models/Metadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata1.java b/src/main/java/com/segment/publicapi/models/Metadata1.java index 8e700d48..8a845b8c 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata1.java +++ b/src/main/java/com/segment/publicapi/models/Metadata1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Metadata2.java b/src/main/java/com/segment/publicapi/models/Metadata2.java index c3ef11e6..50dae21a 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata2.java +++ b/src/main/java/com/segment/publicapi/models/Metadata2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MetricBeta.java b/src/main/java/com/segment/publicapi/models/MetricBeta.java index f4a5ca3a..fe1d59b9 100644 --- a/src/main/java/com/segment/publicapi/models/MetricBeta.java +++ b/src/main/java/com/segment/publicapi/models/MetricBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java index aa5f43bc..1743ce1d 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserGroupV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java index f8f29c0a..39bbca39 100644 --- a/src/main/java/com/segment/publicapi/models/MinimalUserV1.java +++ b/src/main/java/com/segment/publicapi/models/MinimalUserV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java index 7113ddaf..0319072d 100644 --- a/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/MtuSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Pagination.java b/src/main/java/com/segment/publicapi/models/Pagination.java index 69abe9c6..3bb74f45 100644 --- a/src/main/java/com/segment/publicapi/models/Pagination.java +++ b/src/main/java/com/segment/publicapi/models/Pagination.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PaginationInput.java b/src/main/java/com/segment/publicapi/models/PaginationInput.java index d059edba..3f360c00 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationInput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PaginationOutput.java b/src/main/java/com/segment/publicapi/models/PaginationOutput.java index 4684b10b..a2fa1d48 100644 --- a/src/main/java/com/segment/publicapi/models/PaginationOutput.java +++ b/src/main/java/com/segment/publicapi/models/PaginationOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java index 15582f10..2d102a6a 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionInputV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionInputV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java index 1f5a55e9..ce9e3466 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionResourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PermissionV1.java b/src/main/java/com/segment/publicapi/models/PermissionV1.java index 224afaf2..75c32c53 100644 --- a/src/main/java/com/segment/publicapi/models/PermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/PermissionV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java index 184e4d43..e88ae6d2 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilter200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java index d25446f4..76fbc839 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java index 7d8436f4..9b199ccc 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java index 924ac4b7..0eaea6fc 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java +++ b/src/main/java/com/segment/publicapi/models/PreviewDestinationFilterV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +49,7 @@ public class PreviewDestinationFilterV1Output { public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) - private Map result; + private Object result; public PreviewDestinationFilterV1Output() {} @@ -81,7 +80,7 @@ public void setInputPayload(Map inputPayload) { this.inputPayload = inputPayload; } - public PreviewDestinationFilterV1Output result(Map result) { + public PreviewDestinationFilterV1Output result(Object result) { this.result = result; return this; @@ -94,11 +93,11 @@ public PreviewDestinationFilterV1Output result(Map result) { */ @javax.annotation.Nullable @ApiModelProperty(required = true, value = "The filtered JSON output.") - public Map getResult() { + public Object getResult() { return result; } - public void setResult(Map result) { + public void setResult(Object result) { this.result = result; } diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java index e80d5605..f58c40fd 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java index ac088992..a1b9fc38 100644 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index f9d6caa2..b1059c08 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index 38289fc3..f27f82f7 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java index c22cddb5..4ccac399 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java index b3a4f318..c3b7e1fa 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveFilterFromDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java index 0f931ed6..13ce5fba 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java index eab764f8..311123ee 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java index 2f2e8cb1..5cc496c4 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRulesFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java index 3e8c4b5c..9146b3ac 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java index 20c7b1b8..11804320 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceConnectionFromWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java index c6ca4f71..c057b351 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java index 87ae79f0..35b39e1e 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSourceFromTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java index 4641c805..5abce5d5 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java index e72b604e..7edc0eba 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/RemoveSubscriptionFromDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java index a07510e4..243b22e5 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java index 6fa44d64..1e26fa1a 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/RemoveUsersFromUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java index 9a569836..c8384989 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java index ffda4eca..fa8adf0a 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java index 3bdd7971..19361662 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java index 3a9dbafd..9cdcd1f3 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java index 0f6bd5f5..063c6c9f 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java index 7dc6fa1b..142134a9 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java index d72291fd..52ae3820 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java index 5aeb7d4b..03a24f1b 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java index ec6c7c97..1bc6f110 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java index 51264026..aaea91eb 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpaces200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java index 58a5c5a8..b9eacb17 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java index 9379d607..38034ed2 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceMessagingSubscriptionsInSpacesAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java index 75eeeaae..c34c98ba 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUser200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java index f0547808..d2452642 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java index 199a0d66..3dcc3aec 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java index c2192160..ebb8b777 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java index be947993..eeb793a9 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java index 51b17f27..f711d9cb 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java index 9e12c65d..e74a51a8 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java index 9e225d14..489c11aa 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java index 7b93e94c..274180c6 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java index 838c1f8d..f38f016c 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java index 2b16e2a6..90687b57 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java index f1546d1d..fe0d9028 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestError.java b/src/main/java/com/segment/publicapi/models/RequestError.java index fc20d87b..46fca89f 100644 --- a/src/main/java/com/segment/publicapi/models/RequestError.java +++ b/src/main/java/com/segment/publicapi/models/RequestError.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java index 94319be1..d11bdbed 100644 --- a/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java +++ b/src/main/java/com/segment/publicapi/models/RequestErrorEnvelope.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/ResourceV1.java b/src/main/java/com/segment/publicapi/models/ResourceV1.java index 57370dca..24fab55e 100644 --- a/src/main/java/com/segment/publicapi/models/ResourceV1.java +++ b/src/main/java/com/segment/publicapi/models/ResourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RoleV1.java b/src/main/java/com/segment/publicapi/models/RoleV1.java index 3b7b374b..14f4dbbe 100644 --- a/src/main/java/com/segment/publicapi/models/RoleV1.java +++ b/src/main/java/com/segment/publicapi/models/RoleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index b772b8ce..78adf379 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule.java b/src/main/java/com/segment/publicapi/models/Schedule.java index 0c2e2fe0..533a6a8d 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule.java +++ b/src/main/java/com/segment/publicapi/models/Schedule.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule1.java b/src/main/java/com/segment/publicapi/models/Schedule1.java index a25ee1b4..22f09349 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule1.java +++ b/src/main/java/com/segment/publicapi/models/Schedule1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Schedule2.java b/src/main/java/com/segment/publicapi/models/Schedule2.java index b54be464..4ea89297 100644 --- a/src/main/java/com/segment/publicapi/models/Schedule2.java +++ b/src/main/java/com/segment/publicapi/models/Schedule2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings.java b/src/main/java/com/segment/publicapi/models/Settings.java index 03ead8fd..036bc07d 100644 --- a/src/main/java/com/segment/publicapi/models/Settings.java +++ b/src/main/java/com/segment/publicapi/models/Settings.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Settings1.java b/src/main/java/com/segment/publicapi/models/Settings1.java index d842d4c0..c96720c4 100644 --- a/src/main/java/com/segment/publicapi/models/Settings1.java +++ b/src/main/java/com/segment/publicapi/models/Settings1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source.java b/src/main/java/com/segment/publicapi/models/Source.java index 4a02c417..1faf715b 100644 --- a/src/main/java/com/segment/publicapi/models/Source.java +++ b/src/main/java/com/segment/publicapi/models/Source.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source1.java b/src/main/java/com/segment/publicapi/models/Source1.java index 0321a2a7..d8014cf0 100644 --- a/src/main/java/com/segment/publicapi/models/Source1.java +++ b/src/main/java/com/segment/publicapi/models/Source1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source2.java b/src/main/java/com/segment/publicapi/models/Source2.java index 0aae9f5a..f227ff90 100644 --- a/src/main/java/com/segment/publicapi/models/Source2.java +++ b/src/main/java/com/segment/publicapi/models/Source2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source3.java b/src/main/java/com/segment/publicapi/models/Source3.java index 05017d6f..d6aafe2c 100644 --- a/src/main/java/com/segment/publicapi/models/Source3.java +++ b/src/main/java/com/segment/publicapi/models/Source3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source4.java b/src/main/java/com/segment/publicapi/models/Source4.java index b1dfd53c..c75dc398 100644 --- a/src/main/java/com/segment/publicapi/models/Source4.java +++ b/src/main/java/com/segment/publicapi/models/Source4.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source5.java b/src/main/java/com/segment/publicapi/models/Source5.java index 4cf522d2..073acaf6 100644 --- a/src/main/java/com/segment/publicapi/models/Source5.java +++ b/src/main/java/com/segment/publicapi/models/Source5.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Source6.java b/src/main/java/com/segment/publicapi/models/Source6.java index d9c2b851..fc023adb 100644 --- a/src/main/java/com/segment/publicapi/models/Source6.java +++ b/src/main/java/com/segment/publicapi/models/Source6.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java index 8a3e9488..368c608b 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceAPICallSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceAlpha.java b/src/main/java/com/segment/publicapi/models/SourceAlpha.java index 3ba90967..91cf1eaf 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAlpha.java +++ b/src/main/java/com/segment/publicapi/models/SourceAlpha.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java index 1f97b7c3..de136952 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeDatapointV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index e51e4f6f..cbb9d642 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadata.java b/src/main/java/com/segment/publicapi/models/SourceMetadata.java index 9778477c..feb9dd2e 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadata.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java index 827345b7..09efca60 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java index bb18a609..c40b0299 100644 --- a/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceSettingsOutputV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SourceV1.java b/src/main/java/com/segment/publicapi/models/SourceV1.java index 66a4a8ae..b6a7f6c7 100644 --- a/src/main/java/com/segment/publicapi/models/SourceV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 2a8f3697..0a827f88 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java index 8f42fee8..7ba98961 100644 --- a/src/main/java/com/segment/publicapi/models/StreamStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/StreamStatusV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Subscription.java b/src/main/java/com/segment/publicapi/models/Subscription.java index 223e8fb8..e91e48ac 100644 --- a/src/main/java/com/segment/publicapi/models/Subscription.java +++ b/src/main/java/com/segment/publicapi/models/Subscription.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java index ab32d651..00686422 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedFeatures.java +++ b/src/main/java/com/segment/publicapi/models/SupportedFeatures.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedMethods.java b/src/main/java/com/segment/publicapi/models/SupportedMethods.java index 2b31c478..3a4c65ea 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedMethods.java +++ b/src/main/java/com/segment/publicapi/models/SupportedMethods.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java index 87cf8881..3399054e 100644 --- a/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java +++ b/src/main/java/com/segment/publicapi/models/SupportedPlatforms.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SuppressedInner.java b/src/main/java/com/segment/publicapi/models/SuppressedInner.java index 204dbe4d..b1db0761 100644 --- a/src/main/java/com/segment/publicapi/models/SuppressedInner.java +++ b/src/main/java/com/segment/publicapi/models/SuppressedInner.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java index 7f480c09..dc34954e 100644 --- a/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncNoticeV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/SyncV1.java b/src/main/java/com/segment/publicapi/models/SyncV1.java index b5da4fa5..81e76f54 100644 --- a/src/main/java/com/segment/publicapi/models/SyncV1.java +++ b/src/main/java/com/segment/publicapi/models/SyncV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Track.java b/src/main/java/com/segment/publicapi/models/Track.java index 50cd5208..146f0d34 100644 --- a/src/main/java/com/segment/publicapi/models/Track.java +++ b/src/main/java/com/segment/publicapi/models/Track.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java index 60e212a2..6c2d3338 100644 --- a/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackSourceSettingsV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index a8544ca0..524daf30 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 2ff89148..44d6ac94 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index 3b56f019..b6b79632 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation.java b/src/main/java/com/segment/publicapi/models/Transformation.java index 83c6f1ef..450d8051 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation.java +++ b/src/main/java/com/segment/publicapi/models/Transformation.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation1.java b/src/main/java/com/segment/publicapi/models/Transformation1.java index 7ef47dcd..cc9c89d1 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation1.java +++ b/src/main/java/com/segment/publicapi/models/Transformation1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Transformation2.java b/src/main/java/com/segment/publicapi/models/Transformation2.java index d992a6bf..f52c60ac 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation2.java +++ b/src/main/java/com/segment/publicapi/models/Transformation2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/TransformationBeta.java b/src/main/java/com/segment/publicapi/models/TransformationBeta.java index b8d26be3..91b097ee 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationBeta.java +++ b/src/main/java/com/segment/publicapi/models/TransformationBeta.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java index 368b9a47..002d6112 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java index f7688976..3a76ef8b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java index ae97feea..fdeb53f9 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java index 0d89c349..57cc9730 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java index 8179f07b..8ac5d061 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java index 2340db10..66ae1377 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterForDestinationV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java index 5845d159..8c89bf2f 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunction200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java index e1821f5b..86e57802 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java index 6ad1a3f5..2d9c3494 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFunctionV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java index 03b28a6b..b49f70a3 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java index d1c0b670..901d912a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java index 70458ffd..ca16795a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java index 2c61e6c3..37e6c393 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java index 8cb73ab4..e825ac3b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java index 64942e05..3d5eddc4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSchemaSettingsInSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java index 8b656a26..a8eb1e43 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java index bf022e66..378802f4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java index f201a953..e7ca8d46 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java index a57b64dc..12516d49 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java index 469a8712..02489ff1 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSource200Response1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java index b4875f63..232e2266 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java index ec912606..1c2ad0ed 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java index 9f2ba5eb..0157ea95 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java index d4d29aed..ab415977 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSourceV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java index 4dcb9805..57204b9c 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestination200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java index 2f8301cb..bff96e27 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java index 4ebff428..372bd5b8 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSubscriptionForDestinationAlphaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java index 10aa7f5f..299e0708 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlan200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java index f57d62d4..f9b5fe17 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java index 5da1b391..5c6fb92b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTrackingPlanV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index 9cd0b3ac..622e0b49 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 09c5f3d6..5a90bdea 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java index 51f685c7..b7d1c980 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaOutput.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java index aebd5b9d..7bb950bc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroup200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java index 5200073b..375d8a90 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java index b46a9a6f..5536846a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java index 940ebc1d..4b943acc 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouse200Response.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java index e8f78aa8..8a7f58d8 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java index 07bd3d14..1c99a54c 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Output.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index 7d710a48..a1bcdf85 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/User.java b/src/main/java/com/segment/publicapi/models/User.java index 5c82c9f2..44e1f58b 100644 --- a/src/main/java/com/segment/publicapi/models/User.java +++ b/src/main/java/com/segment/publicapi/models/User.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup.java b/src/main/java/com/segment/publicapi/models/UserGroup.java index 0796071b..27b5391a 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup1.java b/src/main/java/com/segment/publicapi/models/UserGroup1.java index cbf4b817..d4f2f1b0 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup2.java b/src/main/java/com/segment/publicapi/models/UserGroup2.java index 0ad3f8c2..b4a856b9 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup2.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroup3.java b/src/main/java/com/segment/publicapi/models/UserGroup3.java index 6b53f171..fe9f9ff8 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroup3.java +++ b/src/main/java/com/segment/publicapi/models/UserGroup3.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserGroupV1.java b/src/main/java/com/segment/publicapi/models/UserGroupV1.java index d4af4c78..d274c508 100644 --- a/src/main/java/com/segment/publicapi/models/UserGroupV1.java +++ b/src/main/java/com/segment/publicapi/models/UserGroupV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UserV1.java b/src/main/java/com/segment/publicapi/models/UserV1.java index e40d2baf..20f0edfb 100644 --- a/src/main/java/com/segment/publicapi/models/UserV1.java +++ b/src/main/java/com/segment/publicapi/models/UserV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java index c30a12eb..433f4c62 100644 --- a/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/UsersPerSourceSnapshotV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse.java b/src/main/java/com/segment/publicapi/models/Warehouse.java index 3a63705c..33defef5 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse1.java b/src/main/java/com/segment/publicapi/models/Warehouse1.java index 8dc818c0..beedc382 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse1.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Warehouse2.java b/src/main/java/com/segment/publicapi/models/Warehouse2.java index 78741ed3..86c1c3fb 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse2.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse2.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java index d386b6ce..066c9b01 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseAdvancedSyncV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java index 33fb22bd..b0c28d87 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadata.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java index cc714ab2..435b25ce 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseMetadataV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java index 45714ade..75558eb1 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSelectiveSyncItemV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java index 3f62dec9..188ac6c6 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseSyncOverrideV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WarehouseV1.java b/src/main/java/com/segment/publicapi/models/WarehouseV1.java index d2d09fa5..e3de3705 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/Workspace.java b/src/main/java/com/segment/publicapi/models/Workspace.java index 5ad8d2ee..be250d00 100644 --- a/src/main/java/com/segment/publicapi/models/Workspace.java +++ b/src/main/java/com/segment/publicapi/models/Workspace.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java index b7afa7e9..95770e63 100644 --- a/src/main/java/com/segment/publicapi/models/WorkspaceV1.java +++ b/src/main/java/com/segment/publicapi/models/WorkspaceV1.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.4 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/test/java/com/segment/publicapi/api/EchoApiTest.java b/src/test/java/com/segment/publicapi/api/EchoApiTest.java index 07cd1e9a..1d0e328c 100644 --- a/src/test/java/com/segment/publicapi/api/EchoApiTest.java +++ b/src/test/java/com/segment/publicapi/api/EchoApiTest.java @@ -2,7 +2,6 @@ * Segment Public API * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. * - * The version of the OpenAPI document: 32.0.2 * Contact: friends@segment.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). From 7f0bbc3a88cc6f474993ec4e763c0fa7571b1373 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Mon, 21 Nov 2022 19:11:47 +0000 Subject: [PATCH 016/474] Automated client deploy (from segmentio/public-api@ac4db5b) --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 45 ++ .../publicapi/api/TransformationsApi.java | 116 ++-- .../CreateTransformation200Response.java | 8 +- .../models/CreateTransformationV1Input.java | 540 +++++++++++++++++ .../models/CreateTransformationV1Output.java | 209 +++++++ .../DeleteTransformation200Response.java | 8 +- .../models/DeleteTransformationBetaInput.java | 218 +++++++ .../models/DeleteTransformationV1Output.java | 261 ++++++++ .../models/GetTransformation200Response.java | 8 +- .../models/GetTransformationBetaInput.java | 212 +++++++ .../models/GetTransformationV1Output.java | 205 +++++++ .../ListTransformations200Response.java | 8 +- .../models/ListTransformationsBetaInput.java | 209 +++++++ .../models/ListTransformationsV1Output.java | 254 ++++++++ .../segment/publicapi/models/Pagination1.java | 249 ++++++++ .../publicapi/models/PropertyRenameV1.java | 246 ++++++++ .../models/PropertyValueTransformationV1.java | 266 ++++++++ .../publicapi/models/Transformation3.java | 570 +++++++++++++++++ .../publicapi/models/Transformation4.java | 570 +++++++++++++++++ .../publicapi/models/Transformation5.java | 570 +++++++++++++++++ .../publicapi/models/TransformationV1.java | 571 ++++++++++++++++++ .../UpdateTransformation200Response.java | 8 +- .../models/UpdateTransformationBetaInput.java | 50 +- .../models/UpdateTransformationV1Input.java | 524 ++++++++++++++++ .../models/UpdateTransformationV1Output.java | 209 +++++++ 28 files changed, 6064 insertions(+), 82 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/Pagination1.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertyRenameV1.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation3.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation4.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation5.java create mode 100644 src/main/java/com/segment/publicapi/models/TransformationV1.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java diff --git a/README.md b/README.md index af55f149..0901abd6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 33.0.2 +- API version: 33.0.3 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -35,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 33.0.2 + 33.0.3 compile ``` @@ -51,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:33.0.2" + implementation "com.segment.publicapi:segment-publicapi:33.0.3" } ``` @@ -65,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-33.0.2.jar` +* `target/segment-publicapi-33.0.3.jar` * `target/lib/*.jar` ## Getting Started diff --git a/pom.xml b/pom.xml index 79b6c2d2..2fdd0169 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 33.0.2 + 33.0.3 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 7baab8e6..75346543 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/33.0.2/java"); + setUserAgent("OpenAPI-Generator/33.0.3/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 6624035e..5c5a4363 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -301,6 +301,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateUserGroup200Response .CustomTypeAdapterFactory()); @@ -386,9 +392,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformation200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteUserGroup200Response .CustomTypeAdapterFactory()); @@ -631,9 +643,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformation200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -848,9 +866,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformations200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformationsBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUserGroups200Response .CustomTypeAdapterFactory()); @@ -916,6 +940,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Pagination1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -940,9 +966,14 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyValueTransformationV1 + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1143,8 +1174,16 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation5.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); @@ -1239,6 +1278,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateUserGroup200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index 0c92832f..a9d289fc 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -20,13 +20,13 @@ import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateTransformation200Response; -import com.segment.publicapi.models.CreateTransformationBetaInput; +import com.segment.publicapi.models.CreateTransformationV1Input; import com.segment.publicapi.models.DeleteTransformation200Response; import com.segment.publicapi.models.GetTransformation200Response; import com.segment.publicapi.models.ListTransformations200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateTransformation200Response; -import com.segment.publicapi.models.UpdateTransformationBetaInput; +import com.segment.publicapi.models.UpdateTransformationV1Input; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -73,7 +73,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTransformation * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -87,8 +87,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * */ public okhttp3.Call createTransformationCall( - CreateTransformationBetaInput createTransformationBetaInput, - final ApiCallback _callback) + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -103,7 +102,7 @@ public okhttp3.Call createTransformationCall( basePath = null; } - Object localVarPostBody = createTransformationBetaInput; + Object localVarPostBody = createTransformationV1Input; // create path and map variables String localVarPath = "/transformations"; @@ -115,9 +114,10 @@ public okhttp3.Call createTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -125,7 +125,9 @@ public okhttp3.Call createTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -150,19 +152,18 @@ public okhttp3.Call createTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call createTransformationValidateBeforeCall( - CreateTransformationBetaInput createTransformationBetaInput, - final ApiCallback _callback) + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTransformationBetaInput' is set - if (createTransformationBetaInput == null) { + // verify the required parameter 'createTransformationV1Input' is set + if (createTransformationV1Input == null) { throw new ApiException( - "Missing the required parameter 'createTransformationBetaInput' when calling" + "Missing the required parameter 'createTransformationV1Input' when calling" + " createTransformation(Async)"); } okhttp3.Call localVarCall = - createTransformationCall(createTransformationBetaInput, _callback); + createTransformationCall(createTransformationV1Input, _callback); return localVarCall; } @@ -172,7 +173,7 @@ private okhttp3.Call createTransformationValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @return CreateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -186,9 +187,9 @@ private okhttp3.Call createTransformationValidateBeforeCall( * */ public CreateTransformation200Response createTransformation( - CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + CreateTransformationV1Input createTransformationV1Input) throws ApiException { ApiResponse localVarResp = - createTransformationWithHttpInfo(createTransformationBetaInput); + createTransformationWithHttpInfo(createTransformationV1Input); return localVarResp.getData(); } @@ -198,7 +199,7 @@ public CreateTransformation200Response createTransformation( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @return ApiResponse<CreateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -212,9 +213,9 @@ public CreateTransformation200Response createTransformation( * */ public ApiResponse createTransformationWithHttpInfo( - CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + CreateTransformationV1Input createTransformationV1Input) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationBetaInput, null); + createTransformationValidateBeforeCall(createTransformationV1Input, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -226,7 +227,7 @@ public ApiResponse createTransformationWithHttp * to have the Protocols feature enabled. Please reach out to your customer success manager for * more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -241,12 +242,12 @@ public ApiResponse createTransformationWithHttp * */ public okhttp3.Call createTransformationAsync( - CreateTransformationBetaInput createTransformationBetaInput, + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); + createTransformationValidateBeforeCall(createTransformationV1Input, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -298,9 +299,10 @@ public okhttp3.Call deleteTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -475,9 +477,10 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -604,7 +607,7 @@ public okhttp3.Call getTransformationAsync( /** * Build call for listTransformations * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -648,9 +651,10 @@ public okhttp3.Call listTransformationsCall( } final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -700,7 +704,7 @@ private okhttp3.Call listTransformationsValidateBeforeCall( * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListTransformations200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -725,7 +729,7 @@ public ListTransformations200Response listTransformations(PaginationInput pagina * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListTransformations200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -751,7 +755,7 @@ public ApiResponse listTransformationsWithHttpIn * Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -778,7 +782,7 @@ public okhttp3.Call listTransformationsAsync( * Build call for updateTransformation * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -793,7 +797,7 @@ public okhttp3.Call listTransformationsAsync( */ public okhttp3.Call updateTransformationCall( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -809,7 +813,7 @@ public okhttp3.Call updateTransformationCall( basePath = null; } - Object localVarPostBody = updateTransformationBetaInput; + Object localVarPostBody = updateTransformationV1Input; // create path and map variables String localVarPath = @@ -825,9 +829,10 @@ public okhttp3.Call updateTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -835,7 +840,9 @@ public okhttp3.Call updateTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -861,7 +868,7 @@ public okhttp3.Call updateTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateTransformationValidateBeforeCall( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { @@ -872,16 +879,15 @@ private okhttp3.Call updateTransformationValidateBeforeCall( + " updateTransformation(Async)"); } - // verify the required parameter 'updateTransformationBetaInput' is set - if (updateTransformationBetaInput == null) { + // verify the required parameter 'updateTransformationV1Input' is set + if (updateTransformationV1Input == null) { throw new ApiException( - "Missing the required parameter 'updateTransformationBetaInput' when calling" + "Missing the required parameter 'updateTransformationV1Input' when calling" + " updateTransformation(Async)"); } okhttp3.Call localVarCall = - updateTransformationCall( - transformationId, updateTransformationBetaInput, _callback); + updateTransformationCall(transformationId, updateTransformationV1Input, _callback); return localVarCall; } @@ -893,7 +899,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @return UpdateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -907,10 +913,10 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * */ public UpdateTransformation200Response updateTransformation( - String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + String transformationId, UpdateTransformationV1Input updateTransformationV1Input) throws ApiException { ApiResponse localVarResp = - updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); + updateTransformationWithHttpInfo(transformationId, updateTransformationV1Input); return localVarResp.getData(); } @@ -922,7 +928,7 @@ public UpdateTransformation200Response updateTransformation( * information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @return ApiResponse<UpdateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -936,11 +942,11 @@ public UpdateTransformation200Response updateTransformation( * */ public ApiResponse updateTransformationWithHttpInfo( - String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + String transformationId, UpdateTransformationV1Input updateTransformationV1Input) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationBetaInput, null); + transformationId, updateTransformationV1Input, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -953,7 +959,7 @@ public ApiResponse updateTransformationWithHttp * more information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -969,13 +975,13 @@ public ApiResponse updateTransformationWithHttp */ public okhttp3.Call updateTransformationAsync( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationBetaInput, _callback); + transformationId, updateTransformationV1Input, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 7a69552c..09fbf5fa 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -34,11 +34,11 @@ public class CreateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private CreateTransformationBetaOutput data; + private CreateTransformationV1Output data; public CreateTransformation200Response() {} - public CreateTransformation200Response data(CreateTransformationBetaOutput data) { + public CreateTransformation200Response data(CreateTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public CreateTransformation200Response data(CreateTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public CreateTransformationBetaOutput getData() { + public CreateTransformationV1Output getData() { return data; } - public void setData(CreateTransformationBetaOutput data) { + public void setData(CreateTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java new file mode 100644 index 00000000..9cd2178c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -0,0 +1,540 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input to create a Transformation. */ +@ApiModel(description = "The input to create a Transformation.") +public class CreateTransformationV1Input { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public CreateTransformationV1Input() {} + + public CreateTransformationV1Input name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateTransformationV1Input sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public CreateTransformationV1Input destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata id to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The optional Destination metadata id to be associated with the" + + " Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public CreateTransformationV1Input enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateTransformationV1Input _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public CreateTransformationV1Input newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public CreateTransformationV1Input propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public CreateTransformationV1Input addPropertyRenamesItem( + PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public CreateTransformationV1Input propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public CreateTransformationV1Input addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationV1Input createTransformationV1Input = (CreateTransformationV1Input) o; + return Objects.equals(this.name, createTransformationV1Input.name) + && Objects.equals(this.sourceId, createTransformationV1Input.sourceId) + && Objects.equals( + this.destinationMetadataId, + createTransformationV1Input.destinationMetadataId) + && Objects.equals(this.enabled, createTransformationV1Input.enabled) + && Objects.equals(this._if, createTransformationV1Input._if) + && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) + && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + createTransformationV1Input.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateTransformationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationV1Input is not" + + " found in the empty JSON string", + CreateTransformationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationV1Input + * @throws IOException if the JSON string is invalid with respect to CreateTransformationV1Input + */ + public static CreateTransformationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationV1Input.class); + } + + /** + * Convert an instance of CreateTransformationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java new file mode 100644 index 00000000..a604790d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of a created Transformation. */ +@ApiModel(description = "The output of a created Transformation.") +public class CreateTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation5 transformation; + + public CreateTransformationV1Output() {} + + public CreateTransformationV1Output transformation(Transformation5 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation5 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation5 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationV1Output createTransformationV1Output = + (CreateTransformationV1Output) o; + return Objects.equals(this.transformation, createTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationV1Output is not" + + " found in the empty JSON string", + CreateTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateTransformationV1Output + */ + public static CreateTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationV1Output.class); + } + + /** + * Convert an instance of CreateTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index 4fba2302..cbd4a7ab 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -34,11 +34,11 @@ public class DeleteTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTransformationBetaOutput data; + private DeleteTransformationV1Output data; public DeleteTransformation200Response() {} - public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { + public DeleteTransformation200Response data(DeleteTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public DeleteTransformationBetaOutput getData() { + public DeleteTransformationV1Output getData() { return data; } - public void setData(DeleteTransformationBetaOutput data) { + public void setData(DeleteTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java new file mode 100644 index 00000000..ca8b1fef --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java @@ -0,0 +1,218 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input of delete Transformation. */ +@ApiModel(description = "The input of delete Transformation.") +public class DeleteTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + + public DeleteTransformationBetaInput() {} + + public DeleteTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * The Transformation id. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Transformation id.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationBetaInput deleteTransformationBetaInput = + (DeleteTransformationBetaInput) o; + return Objects.equals( + this.transformationId, deleteTransformationBetaInput.transformationId); + } + + @Override + public int hashCode() { + return Objects.hash(transformationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformationId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationBetaInput is not" + + " found in the empty JSON string", + DeleteTransformationBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationBetaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationBetaInput + */ + public static DeleteTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaInput.class); + } + + /** + * Convert an instance of DeleteTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java new file mode 100644 index 00000000..083b4b8b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java @@ -0,0 +1,261 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of delete Transformation. */ +@ApiModel(description = "The output of delete Transformation.") +public class DeleteTransformationV1Output { + /** The operation status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteTransformationV1Output() {} + + public DeleteTransformationV1Output status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The operation status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The operation status.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationV1Output deleteTransformationV1Output = + (DeleteTransformationV1Output) o; + return Objects.equals(this.status, deleteTransformationV1Output.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationV1Output is not" + + " found in the empty JSON string", + DeleteTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationV1Output + */ + public static DeleteTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationV1Output.class); + } + + /** + * Convert an instance of DeleteTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index 0188ba83..937d1985 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -34,11 +34,11 @@ public class GetTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetTransformationBetaOutput data; + private GetTransformationV1Output data; public GetTransformation200Response() {} - public GetTransformation200Response data(GetTransformationBetaOutput data) { + public GetTransformation200Response data(GetTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public GetTransformation200Response data(GetTransformationBetaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public GetTransformationBetaOutput getData() { + public GetTransformationV1Output getData() { return data; } - public void setData(GetTransformationBetaOutput data) { + public void setData(GetTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java new file mode 100644 index 00000000..adc11270 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input of Transformation retrieval. */ +@ApiModel(description = "The input of Transformation retrieval.") +public class GetTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + + public GetTransformationBetaInput() {} + + public GetTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * The Transformation id. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Transformation id.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationBetaInput getTransformationBetaInput = (GetTransformationBetaInput) o; + return Objects.equals(this.transformationId, getTransformationBetaInput.transformationId); + } + + @Override + public int hashCode() { + return Objects.hash(transformationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformationId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationBetaInput is not" + + " found in the empty JSON string", + GetTransformationBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationBetaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaInput + */ + public static GetTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationBetaInput.class); + } + + /** + * Convert an instance of GetTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java new file mode 100644 index 00000000..2990e109 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of Transformation retrieval. */ +@ApiModel(description = "The output of Transformation retrieval.") +public class GetTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation3 transformation; + + public GetTransformationV1Output() {} + + public GetTransformationV1Output transformation(Transformation3 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation3 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation3 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationV1Output getTransformationV1Output = (GetTransformationV1Output) o; + return Objects.equals(this.transformation, getTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationV1Output is not found" + + " in the empty JSON string", + GetTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to GetTransformationV1Output + */ + public static GetTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationV1Output.class); + } + + /** + * Convert an instance of GetTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index f489b14e..b9565031 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -34,11 +34,11 @@ public class ListTransformations200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListTransformationsBetaOutput data; + private ListTransformationsV1Output data; public ListTransformations200Response() {} - public ListTransformations200Response data(ListTransformationsBetaOutput data) { + public ListTransformations200Response data(ListTransformationsV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public ListTransformations200Response data(ListTransformationsBetaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ListTransformationsBetaOutput getData() { + public ListTransformationsV1Output getData() { return data; } - public void setData(ListTransformationsBetaOutput data) { + public void setData(ListTransformationsV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java new file mode 100644 index 00000000..ed21b87e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists the Transformations associated with the current Workspace. */ +@ApiModel(description = "Lists the Transformations associated with the current Workspace.") +public class ListTransformationsBetaInput { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination1 pagination; + + public ListTransformationsBetaInput() {} + + public ListTransformationsBetaInput pagination(Pagination1 pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination1 getPagination() { + return pagination; + } + + public void setPagination(Pagination1 pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTransformationsBetaInput listTransformationsBetaInput = + (ListTransformationsBetaInput) o; + return Objects.equals(this.pagination, listTransformationsBetaInput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTransformationsBetaInput {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListTransformationsBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListTransformationsBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListTransformationsBetaInput is not" + + " found in the empty JSON string", + ListTransformationsBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListTransformationsBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListTransformationsBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTransformationsBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTransformationsBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTransformationsBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListTransformationsBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTransformationsBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTransformationsBetaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListTransformationsBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTransformationsBetaInput + * @throws IOException if the JSON string is invalid with respect to + * ListTransformationsBetaInput + */ + public static ListTransformationsBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTransformationsBetaInput.class); + } + + /** + * Convert an instance of ListTransformationsBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java new file mode 100644 index 00000000..30346e88 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java @@ -0,0 +1,254 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists the Transformations associated with the current Workspace. */ +@ApiModel(description = "Lists the Transformations associated with the current Workspace.") +public class ListTransformationsV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATIONS = "transformations"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATIONS) + private List transformations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListTransformationsV1Output() {} + + public ListTransformationsV1Output transformations(List transformations) { + + this.transformations = transformations; + return this; + } + + public ListTransformationsV1Output addTransformationsItem( + TransformationV1 transformationsItem) { + this.transformations.add(transformationsItem); + return this; + } + + /** + * A paginated list of Transformations. + * + * @return transformations + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A paginated list of Transformations.") + public List getTransformations() { + return transformations; + } + + public void setTransformations(List transformations) { + this.transformations = transformations; + } + + public ListTransformationsV1Output pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTransformationsV1Output listTransformationsV1Output = (ListTransformationsV1Output) o; + return Objects.equals(this.transformations, listTransformationsV1Output.transformations) + && Objects.equals(this.pagination, listTransformationsV1Output.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(transformations, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTransformationsV1Output {\n"); + sb.append(" transformations: ").append(toIndentedString(transformations)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformations"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformations"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListTransformationsV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListTransformationsV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListTransformationsV1Output is not" + + " found in the empty JSON string", + ListTransformationsV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListTransformationsV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListTransformationsV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTransformationsV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("transformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("transformations").toString())); + } + + JsonArray jsonArraytransformations = jsonObj.getAsJsonArray("transformations"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTransformationsV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTransformationsV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListTransformationsV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTransformationsV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTransformationsV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListTransformationsV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTransformationsV1Output + * @throws IOException if the JSON string is invalid with respect to ListTransformationsV1Output + */ + public static ListTransformationsV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTransformationsV1Output.class); + } + + /** + * Convert an instance of ListTransformationsV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Pagination1.java b/src/main/java/com/segment/publicapi/models/Pagination1.java new file mode 100644 index 00000000..41b5f7e7 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Pagination1.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Pagination options. */ +@ApiModel(description = "Pagination options.") +public class Pagination1 { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public Pagination1() {} + + public Pagination1 cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The page to request. Acceptable values to use here are in PaginationOutput" + + " objects, in the `current`, `next`, and `previous` keys. Consumers of" + + " the API must treat this value as opaque.") + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public Pagination1 count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The number of items to retrieve in a page, between 1 and 200.") + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pagination1 pagination1 = (Pagination1) o; + return Objects.equals(this.cursor, pagination1.cursor) + && Objects.equals(this.count, pagination1.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pagination1 {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pagination1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Pagination1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Pagination1 is not found in the empty" + + " JSON string", + Pagination1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pagination1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Pagination1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pagination1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pagination1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pagination1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Pagination1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Pagination1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pagination1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Pagination1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pagination1 + * @throws IOException if the JSON string is invalid with respect to Pagination1 + */ + public static Pagination1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pagination1.class); + } + + /** + * Convert an instance of Pagination1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java new file mode 100644 index 00000000..9983bfb9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java @@ -0,0 +1,246 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyRenameV1 */ +public class PropertyRenameV1 { + public static final String SERIALIZED_NAME_OLD_NAME = "oldName"; + + @SerializedName(SERIALIZED_NAME_OLD_NAME) + private String oldName; + + public static final String SERIALIZED_NAME_NEW_NAME = "newName"; + + @SerializedName(SERIALIZED_NAME_NEW_NAME) + private String newName; + + public PropertyRenameV1() {} + + public PropertyRenameV1 oldName(String oldName) { + + this.oldName = oldName; + return this; + } + + /** + * The old name of the property. + * + * @return oldName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The old name of the property.") + public String getOldName() { + return oldName; + } + + public void setOldName(String oldName) { + this.oldName = oldName; + } + + public PropertyRenameV1 newName(String newName) { + + this.newName = newName; + return this; + } + + /** + * The new name to rename the property. + * + * @return newName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new name to rename the property.") + public String getNewName() { + return newName; + } + + public void setNewName(String newName) { + this.newName = newName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyRenameV1 propertyRenameV1 = (PropertyRenameV1) o; + return Objects.equals(this.oldName, propertyRenameV1.oldName) + && Objects.equals(this.newName, propertyRenameV1.newName); + } + + @Override + public int hashCode() { + return Objects.hash(oldName, newName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyRenameV1 {\n"); + sb.append(" oldName: ").append(toIndentedString(oldName)).append("\n"); + sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("oldName"); + openapiFields.add("newName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("oldName"); + openapiRequiredFields.add("newName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PropertyRenameV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyRenameV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyRenameV1 is not found in the" + + " empty JSON string", + PropertyRenameV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyRenameV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyRenameV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyRenameV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("oldName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `oldName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("oldName").toString())); + } + if (!jsonObj.get("newName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("newName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyRenameV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyRenameV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PropertyRenameV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyRenameV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyRenameV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyRenameV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyRenameV1 + * @throws IOException if the JSON string is invalid with respect to PropertyRenameV1 + */ + public static PropertyRenameV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyRenameV1.class); + } + + /** + * Convert an instance of PropertyRenameV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java new file mode 100644 index 00000000..d524ddaf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java @@ -0,0 +1,266 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyValueTransformationV1 */ +public class PropertyValueTransformationV1 { + public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) + private List propertyPaths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) + private String propertyValue; + + public PropertyValueTransformationV1() {} + + public PropertyValueTransformationV1 propertyPaths(List propertyPaths) { + + this.propertyPaths = propertyPaths; + return this; + } + + public PropertyValueTransformationV1 addPropertyPathsItem(String propertyPathsItem) { + this.propertyPaths.add(propertyPathsItem); + return this; + } + + /** + * The property paths. The maximum number of paths is 10. + * + * @return propertyPaths + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The property paths. The maximum number of paths is 10.") + public List getPropertyPaths() { + return propertyPaths; + } + + public void setPropertyPaths(List propertyPaths) { + this.propertyPaths = propertyPaths; + } + + public PropertyValueTransformationV1 propertyValue(String propertyValue) { + + this.propertyValue = propertyValue; + return this; + } + + /** + * The new value of the property paths. + * + * @return propertyValue + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new value of the property paths.") + public String getPropertyValue() { + return propertyValue; + } + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyValueTransformationV1 propertyValueTransformationV1 = + (PropertyValueTransformationV1) o; + return Objects.equals(this.propertyPaths, propertyValueTransformationV1.propertyPaths) + && Objects.equals(this.propertyValue, propertyValueTransformationV1.propertyValue); + } + + @Override + public int hashCode() { + return Objects.hash(propertyPaths, propertyValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyValueTransformationV1 {\n"); + sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); + sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("propertyPaths"); + openapiFields.add("propertyValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("propertyPaths"); + openapiRequiredFields.add("propertyValue"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * PropertyValueTransformationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyValueTransformationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyValueTransformationV1 is not" + + " found in the empty JSON string", + PropertyValueTransformationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyValueTransformationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyValueTransformationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyValueTransformationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("propertyPaths") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("propertyPaths").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyPaths` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyPaths").toString())); + } + if (!jsonObj.get("propertyValue").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValue` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("propertyValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyValueTransformationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyValueTransformationV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(PropertyValueTransformationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyValueTransformationV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyValueTransformationV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyValueTransformationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyValueTransformationV1 + * @throws IOException if the JSON string is invalid with respect to + * PropertyValueTransformationV1 + */ + public static PropertyValueTransformationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyValueTransformationV1.class); + } + + /** + * Convert an instance of PropertyValueTransformationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java new file mode 100644 index 00000000..d96809eb --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation3.java @@ -0,0 +1,570 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The retrieved Transformation. */ +@ApiModel(description = "The retrieved Transformation.") +public class Transformation3 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation3() {} + + public Transformation3 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation3 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation3 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation3 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation3 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation3 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation3 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation3 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation3 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation3 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation3 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation3 transformation3 = (Transformation3) o; + return Objects.equals(this.id, transformation3.id) + && Objects.equals(this.name, transformation3.name) + && Objects.equals(this.sourceId, transformation3.sourceId) + && Objects.equals(this.destinationMetadataId, transformation3.destinationMetadataId) + && Objects.equals(this.enabled, transformation3.enabled) + && Objects.equals(this._if, transformation3._if) + && Objects.equals(this.newEventName, transformation3.newEventName) + && Objects.equals(this.propertyRenames, transformation3.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation3.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation3 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation3 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation3.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation3 is not found in the" + + " empty JSON string", + Transformation3.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation3.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation3` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation3.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation3.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation3 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation3 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation3 + * @throws IOException if the JSON string is invalid with respect to Transformation3 + */ + public static Transformation3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation3.class); + } + + /** + * Convert an instance of Transformation3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java new file mode 100644 index 00000000..ec91dbe6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation4.java @@ -0,0 +1,570 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated Transformation. */ +@ApiModel(description = "The updated Transformation.") +public class Transformation4 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation4() {} + + public Transformation4 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation4 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation4 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation4 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation4 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation4 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation4 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation4 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation4 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation4 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation4 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation4 transformation4 = (Transformation4) o; + return Objects.equals(this.id, transformation4.id) + && Objects.equals(this.name, transformation4.name) + && Objects.equals(this.sourceId, transformation4.sourceId) + && Objects.equals(this.destinationMetadataId, transformation4.destinationMetadataId) + && Objects.equals(this.enabled, transformation4.enabled) + && Objects.equals(this._if, transformation4._if) + && Objects.equals(this.newEventName, transformation4.newEventName) + && Objects.equals(this.propertyRenames, transformation4.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation4.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation4 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation4 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation4.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation4 is not found in the" + + " empty JSON string", + Transformation4.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation4.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation4` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation4.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation4 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation4 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation4 + * @throws IOException if the JSON string is invalid with respect to Transformation4 + */ + public static Transformation4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation4.class); + } + + /** + * Convert an instance of Transformation4 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java new file mode 100644 index 00000000..adac93ee --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation5.java @@ -0,0 +1,570 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created Transformation. */ +@ApiModel(description = "The created Transformation.") +public class Transformation5 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation5() {} + + public Transformation5 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation5 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation5 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation5 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation5 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation5 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation5 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation5 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation5 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation5 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation5 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation5 transformation5 = (Transformation5) o; + return Objects.equals(this.id, transformation5.id) + && Objects.equals(this.name, transformation5.name) + && Objects.equals(this.sourceId, transformation5.sourceId) + && Objects.equals(this.destinationMetadataId, transformation5.destinationMetadataId) + && Objects.equals(this.enabled, transformation5.enabled) + && Objects.equals(this._if, transformation5._if) + && Objects.equals(this.newEventName, transformation5.newEventName) + && Objects.equals(this.propertyRenames, transformation5.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation5.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation5 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation5 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation5.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation5 is not found in the" + + " empty JSON string", + Transformation5.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation5.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation5` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation5.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation5.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation5' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation5.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation5 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation5 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation5 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation5 + * @throws IOException if the JSON string is invalid with respect to Transformation5 + */ + public static Transformation5 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation5.class); + } + + /** + * Convert an instance of Transformation5 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java new file mode 100644 index 00000000..abe887da --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -0,0 +1,571 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Represents a Transformation. */ +@ApiModel(description = "Represents a Transformation.") +public class TransformationV1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public TransformationV1() {} + + public TransformationV1 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TransformationV1 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TransformationV1 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public TransformationV1 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public TransformationV1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public TransformationV1 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public TransformationV1 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public TransformationV1 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public TransformationV1 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public TransformationV1 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public TransformationV1 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransformationV1 transformationV1 = (TransformationV1) o; + return Objects.equals(this.id, transformationV1.id) + && Objects.equals(this.name, transformationV1.name) + && Objects.equals(this.sourceId, transformationV1.sourceId) + && Objects.equals( + this.destinationMetadataId, transformationV1.destinationMetadataId) + && Objects.equals(this.enabled, transformationV1.enabled) + && Objects.equals(this._if, transformationV1._if) + && Objects.equals(this.newEventName, transformationV1.newEventName) + && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformationV1.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransformationV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransformationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransformationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TransformationV1 is not found in the" + + " empty JSON string", + TransformationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransformationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TransformationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransformationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransformationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransformationV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TransformationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TransformationV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransformationV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TransformationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransformationV1 + * @throws IOException if the JSON string is invalid with respect to TransformationV1 + */ + public static TransformationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransformationV1.class); + } + + /** + * Convert an instance of TransformationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index 622e0b49..d92501c0 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -34,11 +34,11 @@ public class UpdateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private UpdateTransformationBetaOutput data; + private UpdateTransformationV1Output data; public UpdateTransformation200Response() {} - public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) { + public UpdateTransformation200Response data(UpdateTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public UpdateTransformationBetaOutput getData() { + public UpdateTransformationV1Output getData() { return data; } - public void setData(UpdateTransformationBetaOutput data) { + public void setData(UpdateTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 5a90bdea..6ec8c308 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -36,6 +36,11 @@ /** The input to update a Transformation. */ @ApiModel(description = "The input to update a Transformation.") public class UpdateTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -79,6 +84,27 @@ public class UpdateTransformationBetaInput { public UpdateTransformationBetaInput() {} + public UpdateTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * ID of the Transformation to update. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "ID of the Transformation to update.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + public UpdateTransformationBetaInput name(String name) { this.name = name; @@ -294,7 +320,8 @@ public boolean equals(Object o) { } UpdateTransformationBetaInput updateTransformationBetaInput = (UpdateTransformationBetaInput) o; - return Objects.equals(this.name, updateTransformationBetaInput.name) + return Objects.equals(this.transformationId, updateTransformationBetaInput.transformationId) + && Objects.equals(this.name, updateTransformationBetaInput.name) && Objects.equals(this.sourceId, updateTransformationBetaInput.sourceId) && Objects.equals( this.destinationMetadataId, @@ -312,6 +339,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + transformationId, name, sourceId, destinationMetadataId, @@ -326,6 +354,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" destinationMetadataId: ") @@ -359,6 +388,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("transformationId"); openapiFields.add("name"); openapiFields.add("sourceId"); openapiFields.add("destinationMetadataId"); @@ -370,6 +400,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); } /** @@ -402,6 +433,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java new file mode 100644 index 00000000..716d22b5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -0,0 +1,524 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input to update a Transformation. */ +@ApiModel(description = "The input to update a Transformation.") +public class UpdateTransformationV1Input { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public UpdateTransformationV1Input() {} + + public UpdateTransformationV1Input name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateTransformationV1Input sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The optional Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The optional Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public UpdateTransformationV1Input destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata to be associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public UpdateTransformationV1Input enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateTransformationV1Input _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public UpdateTransformationV1Input newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public UpdateTransformationV1Input propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public UpdateTransformationV1Input addPropertyRenamesItem( + PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public UpdateTransformationV1Input propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public UpdateTransformationV1Input addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTransformationV1Input updateTransformationV1Input = (UpdateTransformationV1Input) o; + return Objects.equals(this.name, updateTransformationV1Input.name) + && Objects.equals(this.sourceId, updateTransformationV1Input.sourceId) + && Objects.equals( + this.destinationMetadataId, + updateTransformationV1Input.destinationMetadataId) + && Objects.equals(this.enabled, updateTransformationV1Input.enabled) + && Objects.equals(this._if, updateTransformationV1Input._if) + && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) + && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + updateTransformationV1Input.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTransformationV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateTransformationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateTransformationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateTransformationV1Input is not" + + " found in the empty JSON string", + UpdateTransformationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateTransformationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTransformationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) + && !jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTransformationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateTransformationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTransformationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTransformationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTransformationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTransformationV1Input + * @throws IOException if the JSON string is invalid with respect to UpdateTransformationV1Input + */ + public static UpdateTransformationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Input.class); + } + + /** + * Convert an instance of UpdateTransformationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java new file mode 100644 index 00000000..a1e5193a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of an updated Transformation. */ +@ApiModel(description = "The output of an updated Transformation.") +public class UpdateTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation4 transformation; + + public UpdateTransformationV1Output() {} + + public UpdateTransformationV1Output transformation(Transformation4 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation4 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation4 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTransformationV1Output updateTransformationV1Output = + (UpdateTransformationV1Output) o; + return Objects.equals(this.transformation, updateTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateTransformationV1Output is not" + + " found in the empty JSON string", + UpdateTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * UpdateTransformationV1Output + */ + public static UpdateTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Output.class); + } + + /** + * Convert an instance of UpdateTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 781fd90e1e0ce85a0d2a594af788cd4f611bc752 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Wed, 23 Nov 2022 17:49:19 +0000 Subject: [PATCH 017/474] Automated client deploy (from segmentio/public-api@290ebe3) --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 45 -- .../publicapi/api/TransformationsApi.java | 116 ++-- .../CreateTransformation200Response.java | 8 +- .../models/CreateTransformationV1Input.java | 540 ----------------- .../models/CreateTransformationV1Output.java | 209 ------- .../DeleteTransformation200Response.java | 8 +- .../models/DeleteTransformationBetaInput.java | 218 ------- .../models/DeleteTransformationV1Output.java | 261 -------- .../models/GetTransformation200Response.java | 8 +- .../models/GetTransformationBetaInput.java | 212 ------- .../models/GetTransformationV1Output.java | 205 ------- .../ListTransformations200Response.java | 8 +- .../models/ListTransformationsBetaInput.java | 209 ------- .../models/ListTransformationsV1Output.java | 254 -------- .../segment/publicapi/models/Pagination1.java | 249 -------- .../publicapi/models/PropertyRenameV1.java | 246 -------- .../models/PropertyValueTransformationV1.java | 266 -------- .../publicapi/models/Transformation3.java | 570 ----------------- .../publicapi/models/Transformation4.java | 570 ----------------- .../publicapi/models/Transformation5.java | 570 ----------------- .../publicapi/models/TransformationV1.java | 571 ------------------ .../UpdateTransformation200Response.java | 8 +- .../models/UpdateTransformationBetaInput.java | 50 +- .../models/UpdateTransformationV1Input.java | 524 ---------------- .../models/UpdateTransformationV1Output.java | 209 ------- 28 files changed, 82 insertions(+), 6064 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java delete mode 100644 src/main/java/com/segment/publicapi/models/Pagination1.java delete mode 100644 src/main/java/com/segment/publicapi/models/PropertyRenameV1.java delete mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation3.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation4.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation5.java delete mode 100644 src/main/java/com/segment/publicapi/models/TransformationV1.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java diff --git a/README.md b/README.md index 0901abd6..af55f149 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Segment Public API -- API version: 33.0.3 +- API version: 33.0.2 The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. @@ -35,7 +35,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 33.0.3 + 33.0.2 compile ``` @@ -51,7 +51,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:33.0.3" + implementation "com.segment.publicapi:segment-publicapi:33.0.2" } ``` @@ -65,7 +65,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-33.0.3.jar` +* `target/segment-publicapi-33.0.2.jar` * `target/lib/*.jar` ## Getting Started diff --git a/pom.xml b/pom.xml index 2fdd0169..79b6c2d2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 33.0.3 + 33.0.2 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 75346543..7baab8e6 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/33.0.3/java"); + setUserAgent("OpenAPI-Generator/33.0.2/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 5c5a4363..6624035e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -301,12 +301,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateTransformationV1Input - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateUserGroup200Response .CustomTypeAdapterFactory()); @@ -392,15 +386,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformation200Response .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeleteTransformationBetaInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeleteTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteUserGroup200Response .CustomTypeAdapterFactory()); @@ -643,15 +631,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformation200Response .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetTransformationBetaInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -866,15 +848,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformations200Response .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListTransformationsBetaInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformationsBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListTransformationsV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUserGroups200Response .CustomTypeAdapterFactory()); @@ -940,8 +916,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Pagination1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -966,14 +940,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PropertyValueTransformationV1 - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1174,16 +1143,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation4.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation5.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); @@ -1278,12 +1239,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateTransformationBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateTransformationV1Input - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateTransformationV1Output - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateUserGroup200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index a9d289fc..0c92832f 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -20,13 +20,13 @@ import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateTransformation200Response; -import com.segment.publicapi.models.CreateTransformationV1Input; +import com.segment.publicapi.models.CreateTransformationBetaInput; import com.segment.publicapi.models.DeleteTransformation200Response; import com.segment.publicapi.models.GetTransformation200Response; import com.segment.publicapi.models.ListTransformations200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateTransformation200Response; -import com.segment.publicapi.models.UpdateTransformationV1Input; +import com.segment.publicapi.models.UpdateTransformationBetaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -73,7 +73,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTransformation * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -87,7 +87,8 @@ public void setCustomBaseUrl(String customBaseUrl) { * */ public okhttp3.Call createTransformationCall( - CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -102,7 +103,7 @@ public okhttp3.Call createTransformationCall( basePath = null; } - Object localVarPostBody = createTransformationV1Input; + Object localVarPostBody = createTransformationBetaInput; // create path and map variables String localVarPath = "/transformations"; @@ -114,10 +115,9 @@ public okhttp3.Call createTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -125,9 +125,7 @@ public okhttp3.Call createTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1+json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -152,18 +150,19 @@ public okhttp3.Call createTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call createTransformationValidateBeforeCall( - CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) + CreateTransformationBetaInput createTransformationBetaInput, + final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTransformationV1Input' is set - if (createTransformationV1Input == null) { + // verify the required parameter 'createTransformationBetaInput' is set + if (createTransformationBetaInput == null) { throw new ApiException( - "Missing the required parameter 'createTransformationV1Input' when calling" + "Missing the required parameter 'createTransformationBetaInput' when calling" + " createTransformation(Async)"); } okhttp3.Call localVarCall = - createTransformationCall(createTransformationV1Input, _callback); + createTransformationCall(createTransformationBetaInput, _callback); return localVarCall; } @@ -173,7 +172,7 @@ private okhttp3.Call createTransformationValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @return CreateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -187,9 +186,9 @@ private okhttp3.Call createTransformationValidateBeforeCall( * */ public CreateTransformation200Response createTransformation( - CreateTransformationV1Input createTransformationV1Input) throws ApiException { + CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { ApiResponse localVarResp = - createTransformationWithHttpInfo(createTransformationV1Input); + createTransformationWithHttpInfo(createTransformationBetaInput); return localVarResp.getData(); } @@ -199,7 +198,7 @@ public CreateTransformation200Response createTransformation( * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @return ApiResponse<CreateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -213,9 +212,9 @@ public CreateTransformation200Response createTransformation( * */ public ApiResponse createTransformationWithHttpInfo( - CreateTransformationV1Input createTransformationV1Input) throws ApiException { + CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationV1Input, null); + createTransformationValidateBeforeCall(createTransformationBetaInput, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -227,7 +226,7 @@ public ApiResponse createTransformationWithHttp * to have the Protocols feature enabled. Please reach out to your customer success manager for * more information. * - * @param createTransformationV1Input (required) + * @param createTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -242,12 +241,12 @@ public ApiResponse createTransformationWithHttp * */ public okhttp3.Call createTransformationAsync( - CreateTransformationV1Input createTransformationV1Input, + CreateTransformationBetaInput createTransformationBetaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationV1Input, _callback); + createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -299,10 +298,9 @@ public okhttp3.Call deleteTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -477,10 +475,9 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -607,7 +604,7 @@ public okhttp3.Call getTransformationAsync( /** * Build call for listTransformations * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -651,10 +648,9 @@ public okhttp3.Call listTransformationsCall( } final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -704,7 +700,7 @@ private okhttp3.Call listTransformationsValidateBeforeCall( * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @return ListTransformations200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -729,7 +725,7 @@ public ListTransformations200Response listTransformations(PaginationInput pagina * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @return ApiResponse<ListTransformations200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -755,7 +751,7 @@ public ApiResponse listTransformationsWithHttpIn * Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param pagination Pagination options. This parameter exists in v1. (required) + * @param pagination Pagination options. This parameter exists in beta. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -782,7 +778,7 @@ public okhttp3.Call listTransformationsAsync( * Build call for updateTransformation * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -797,7 +793,7 @@ public okhttp3.Call listTransformationsAsync( */ public okhttp3.Call updateTransformationCall( String transformationId, - UpdateTransformationV1Input updateTransformationV1Input, + UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -813,7 +809,7 @@ public okhttp3.Call updateTransformationCall( basePath = null; } - Object localVarPostBody = updateTransformationV1Input; + Object localVarPostBody = updateTransformationBetaInput; // create path and map variables String localVarPath = @@ -829,10 +825,9 @@ public okhttp3.Call updateTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -840,9 +835,7 @@ public okhttp3.Call updateTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1+json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -868,7 +861,7 @@ public okhttp3.Call updateTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateTransformationValidateBeforeCall( String transformationId, - UpdateTransformationV1Input updateTransformationV1Input, + UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { @@ -879,15 +872,16 @@ private okhttp3.Call updateTransformationValidateBeforeCall( + " updateTransformation(Async)"); } - // verify the required parameter 'updateTransformationV1Input' is set - if (updateTransformationV1Input == null) { + // verify the required parameter 'updateTransformationBetaInput' is set + if (updateTransformationBetaInput == null) { throw new ApiException( - "Missing the required parameter 'updateTransformationV1Input' when calling" + "Missing the required parameter 'updateTransformationBetaInput' when calling" + " updateTransformation(Async)"); } okhttp3.Call localVarCall = - updateTransformationCall(transformationId, updateTransformationV1Input, _callback); + updateTransformationCall( + transformationId, updateTransformationBetaInput, _callback); return localVarCall; } @@ -899,7 +893,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * information. * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @return UpdateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -913,10 +907,10 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * */ public UpdateTransformation200Response updateTransformation( - String transformationId, UpdateTransformationV1Input updateTransformationV1Input) + String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) throws ApiException { ApiResponse localVarResp = - updateTransformationWithHttpInfo(transformationId, updateTransformationV1Input); + updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); return localVarResp.getData(); } @@ -928,7 +922,7 @@ public UpdateTransformation200Response updateTransformation( * information. * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @return ApiResponse<UpdateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -942,11 +936,11 @@ public UpdateTransformation200Response updateTransformation( * */ public ApiResponse updateTransformationWithHttpInfo( - String transformationId, UpdateTransformationV1Input updateTransformationV1Input) + String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationV1Input, null); + transformationId, updateTransformationBetaInput, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -959,7 +953,7 @@ public ApiResponse updateTransformationWithHttp * more information. * * @param transformationId (required) - * @param updateTransformationV1Input (required) + * @param updateTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -975,13 +969,13 @@ public ApiResponse updateTransformationWithHttp */ public okhttp3.Call updateTransformationAsync( String transformationId, - UpdateTransformationV1Input updateTransformationV1Input, + UpdateTransformationBetaInput updateTransformationBetaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationV1Input, _callback); + transformationId, updateTransformationBetaInput, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 09fbf5fa..7a69552c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -34,11 +34,11 @@ public class CreateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private CreateTransformationV1Output data; + private CreateTransformationBetaOutput data; public CreateTransformation200Response() {} - public CreateTransformation200Response data(CreateTransformationV1Output data) { + public CreateTransformation200Response data(CreateTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +51,11 @@ public CreateTransformation200Response data(CreateTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public CreateTransformationV1Output getData() { + public CreateTransformationBetaOutput getData() { return data; } - public void setData(CreateTransformationV1Output data) { + public void setData(CreateTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java deleted file mode 100644 index 9cd2178c..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input to create a Transformation. */ -@ApiModel(description = "The input to create a Transformation.") -public class CreateTransformationV1Input { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public CreateTransformationV1Input() {} - - public CreateTransformationV1Input name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CreateTransformationV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source to be associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source to be associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public CreateTransformationV1Input destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata id to be associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The optional Destination metadata id to be associated with the" - + " Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public CreateTransformationV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation should be enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public CreateTransformationV1Input _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public CreateTransformationV1Input newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public CreateTransformationV1Input propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public CreateTransformationV1Input addPropertyRenamesItem( - PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public CreateTransformationV1Input propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public CreateTransformationV1Input addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateTransformationV1Input createTransformationV1Input = (CreateTransformationV1Input) o; - return Objects.equals(this.name, createTransformationV1Input.name) - && Objects.equals(this.sourceId, createTransformationV1Input.sourceId) - && Objects.equals( - this.destinationMetadataId, - createTransformationV1Input.destinationMetadataId) - && Objects.equals(this.enabled, createTransformationV1Input.enabled) - && Objects.equals(this._if, createTransformationV1Input._if) - && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) - && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - createTransformationV1Input.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformationV1Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTransformationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateTransformationV1Input is not" - + " found in the empty JSON string", - CreateTransformationV1Input.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateTransformationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTransformationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformationV1Input' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationV1Input.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformationV1Input value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateTransformationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformationV1Input - * @throws IOException if the JSON string is invalid with respect to CreateTransformationV1Input - */ - public static CreateTransformationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformationV1Input.class); - } - - /** - * Convert an instance of CreateTransformationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java deleted file mode 100644 index a604790d..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of a created Transformation. */ -@ApiModel(description = "The output of a created Transformation.") -public class CreateTransformationV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation5 transformation; - - public CreateTransformationV1Output() {} - - public CreateTransformationV1Output transformation(Transformation5 transformation) { - - this.transformation = transformation; - return this; - } - - /** - * Get transformation - * - * @return transformation - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation5 getTransformation() { - return transformation; - } - - public void setTransformation(Transformation5 transformation) { - this.transformation = transformation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateTransformationV1Output createTransformationV1Output = - (CreateTransformationV1Output) o; - return Objects.equals(this.transformation, createTransformationV1Output.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateTransformationV1Output {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * CreateTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateTransformationV1Output is not" - + " found in the empty JSON string", - CreateTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to - * CreateTransformationV1Output - */ - public static CreateTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateTransformationV1Output.class); - } - - /** - * Convert an instance of CreateTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index cbd4a7ab..4fba2302 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -34,11 +34,11 @@ public class DeleteTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTransformationV1Output data; + private DeleteTransformationBetaOutput data; public DeleteTransformation200Response() {} - public DeleteTransformation200Response data(DeleteTransformationV1Output data) { + public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +51,11 @@ public DeleteTransformation200Response data(DeleteTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public DeleteTransformationV1Output getData() { + public DeleteTransformationBetaOutput getData() { return data; } - public void setData(DeleteTransformationV1Output data) { + public void setData(DeleteTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java deleted file mode 100644 index ca8b1fef..00000000 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input of delete Transformation. */ -@ApiModel(description = "The input of delete Transformation.") -public class DeleteTransformationBetaInput { - public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) - private String transformationId; - - public DeleteTransformationBetaInput() {} - - public DeleteTransformationBetaInput transformationId(String transformationId) { - - this.transformationId = transformationId; - return this; - } - - /** - * The Transformation id. - * - * @return transformationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Transformation id.") - public String getTransformationId() { - return transformationId; - } - - public void setTransformationId(String transformationId) { - this.transformationId = transformationId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteTransformationBetaInput deleteTransformationBetaInput = - (DeleteTransformationBetaInput) o; - return Objects.equals( - this.transformationId, deleteTransformationBetaInput.transformationId); - } - - @Override - public int hashCode() { - return Objects.hash(transformationId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTransformationBetaInput {\n"); - sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformationId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformationId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * DeleteTransformationBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DeleteTransformationBetaInput is not" - + " found in the empty JSON string", - DeleteTransformationBetaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTransformationBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("transformationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformationId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transformationId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTransformationBetaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeleteTransformationBetaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTransformationBetaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTransformationBetaInput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteTransformationBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTransformationBetaInput - * @throws IOException if the JSON string is invalid with respect to - * DeleteTransformationBetaInput - */ - public static DeleteTransformationBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaInput.class); - } - - /** - * Convert an instance of DeleteTransformationBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java deleted file mode 100644 index 083b4b8b..00000000 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of delete Transformation. */ -@ApiModel(description = "The output of delete Transformation.") -public class DeleteTransformationV1Output { - /** The operation status. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public DeleteTransformationV1Output() {} - - public DeleteTransformationV1Output status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The operation status. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteTransformationV1Output deleteTransformationV1Output = - (DeleteTransformationV1Output) o; - return Objects.equals(this.status, deleteTransformationV1Output.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteTransformationV1Output {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * DeleteTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DeleteTransformationV1Output is not" - + " found in the empty JSON string", - DeleteTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeleteTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeleteTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DeleteTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to - * DeleteTransformationV1Output - */ - public static DeleteTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteTransformationV1Output.class); - } - - /** - * Convert an instance of DeleteTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index 937d1985..0188ba83 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -34,11 +34,11 @@ public class GetTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetTransformationV1Output data; + private GetTransformationBetaOutput data; public GetTransformation200Response() {} - public GetTransformation200Response data(GetTransformationV1Output data) { + public GetTransformation200Response data(GetTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +51,11 @@ public GetTransformation200Response data(GetTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public GetTransformationV1Output getData() { + public GetTransformationBetaOutput getData() { return data; } - public void setData(GetTransformationV1Output data) { + public void setData(GetTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java deleted file mode 100644 index adc11270..00000000 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input of Transformation retrieval. */ -@ApiModel(description = "The input of Transformation retrieval.") -public class GetTransformationBetaInput { - public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) - private String transformationId; - - public GetTransformationBetaInput() {} - - public GetTransformationBetaInput transformationId(String transformationId) { - - this.transformationId = transformationId; - return this; - } - - /** - * The Transformation id. - * - * @return transformationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Transformation id.") - public String getTransformationId() { - return transformationId; - } - - public void setTransformationId(String transformationId) { - this.transformationId = transformationId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTransformationBetaInput getTransformationBetaInput = (GetTransformationBetaInput) o; - return Objects.equals(this.transformationId, getTransformationBetaInput.transformationId); - } - - @Override - public int hashCode() { - return Objects.hash(transformationId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTransformationBetaInput {\n"); - sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformationId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformationId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTransformationBetaInput is not" - + " found in the empty JSON string", - GetTransformationBetaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTransformationBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("transformationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformationId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transformationId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTransformationBetaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTransformationBetaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTransformationBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTransformationBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTransformationBetaInput - * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaInput - */ - public static GetTransformationBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTransformationBetaInput.class); - } - - /** - * Convert an instance of GetTransformationBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java deleted file mode 100644 index 2990e109..00000000 --- a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of Transformation retrieval. */ -@ApiModel(description = "The output of Transformation retrieval.") -public class GetTransformationV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation3 transformation; - - public GetTransformationV1Output() {} - - public GetTransformationV1Output transformation(Transformation3 transformation) { - - this.transformation = transformation; - return this; - } - - /** - * Get transformation - * - * @return transformation - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation3 getTransformation() { - return transformation; - } - - public void setTransformation(Transformation3 transformation) { - this.transformation = transformation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTransformationV1Output getTransformationV1Output = (GetTransformationV1Output) o; - return Objects.equals(this.transformation, getTransformationV1Output.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTransformationV1Output {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetTransformationV1Output is not found" - + " in the empty JSON string", - GetTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to GetTransformationV1Output - */ - public static GetTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetTransformationV1Output.class); - } - - /** - * Convert an instance of GetTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index b9565031..f489b14e 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -34,11 +34,11 @@ public class ListTransformations200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListTransformationsV1Output data; + private ListTransformationsBetaOutput data; public ListTransformations200Response() {} - public ListTransformations200Response data(ListTransformationsV1Output data) { + public ListTransformations200Response data(ListTransformationsBetaOutput data) { this.data = data; return this; @@ -51,11 +51,11 @@ public ListTransformations200Response data(ListTransformationsV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ListTransformationsV1Output getData() { + public ListTransformationsBetaOutput getData() { return data; } - public void setData(ListTransformationsV1Output data) { + public void setData(ListTransformationsBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java deleted file mode 100644 index ed21b87e..00000000 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Lists the Transformations associated with the current Workspace. */ -@ApiModel(description = "Lists the Transformations associated with the current Workspace.") -public class ListTransformationsBetaInput { - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination1 pagination; - - public ListTransformationsBetaInput() {} - - public ListTransformationsBetaInput pagination(Pagination1 pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination1 getPagination() { - return pagination; - } - - public void setPagination(Pagination1 pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListTransformationsBetaInput listTransformationsBetaInput = - (ListTransformationsBetaInput) o; - return Objects.equals(this.pagination, listTransformationsBetaInput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListTransformationsBetaInput {\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListTransformationsBetaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListTransformationsBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListTransformationsBetaInput is not" - + " found in the empty JSON string", - ListTransformationsBetaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListTransformationsBetaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListTransformationsBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListTransformationsBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListTransformationsBetaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListTransformationsBetaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListTransformationsBetaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListTransformationsBetaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListTransformationsBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListTransformationsBetaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListTransformationsBetaInput - * @throws IOException if the JSON string is invalid with respect to - * ListTransformationsBetaInput - */ - public static ListTransformationsBetaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListTransformationsBetaInput.class); - } - - /** - * Convert an instance of ListTransformationsBetaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java deleted file mode 100644 index 30346e88..00000000 --- a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Lists the Transformations associated with the current Workspace. */ -@ApiModel(description = "Lists the Transformations associated with the current Workspace.") -public class ListTransformationsV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATIONS = "transformations"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATIONS) - private List transformations = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; - - public ListTransformationsV1Output() {} - - public ListTransformationsV1Output transformations(List transformations) { - - this.transformations = transformations; - return this; - } - - public ListTransformationsV1Output addTransformationsItem( - TransformationV1 transformationsItem) { - this.transformations.add(transformationsItem); - return this; - } - - /** - * A paginated list of Transformations. - * - * @return transformations - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A paginated list of Transformations.") - public List getTransformations() { - return transformations; - } - - public void setTransformations(List transformations) { - this.transformations = transformations; - } - - public ListTransformationsV1Output pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListTransformationsV1Output listTransformationsV1Output = (ListTransformationsV1Output) o; - return Objects.equals(this.transformations, listTransformationsV1Output.transformations) - && Objects.equals(this.pagination, listTransformationsV1Output.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(transformations, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListTransformationsV1Output {\n"); - sb.append(" transformations: ").append(toIndentedString(transformations)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformations"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformations"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ListTransformationsV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListTransformationsV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListTransformationsV1Output is not" - + " found in the empty JSON string", - ListTransformationsV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListTransformationsV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListTransformationsV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListTransformationsV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("transformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformations` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("transformations").toString())); - } - - JsonArray jsonArraytransformations = jsonObj.getAsJsonArray("transformations"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListTransformationsV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListTransformationsV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListTransformationsV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListTransformationsV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListTransformationsV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListTransformationsV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListTransformationsV1Output - * @throws IOException if the JSON string is invalid with respect to ListTransformationsV1Output - */ - public static ListTransformationsV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListTransformationsV1Output.class); - } - - /** - * Convert an instance of ListTransformationsV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Pagination1.java b/src/main/java/com/segment/publicapi/models/Pagination1.java deleted file mode 100644 index 41b5f7e7..00000000 --- a/src/main/java/com/segment/publicapi/models/Pagination1.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Pagination options. */ -@ApiModel(description = "Pagination options.") -public class Pagination1 { - public static final String SERIALIZED_NAME_CURSOR = "cursor"; - - @SerializedName(SERIALIZED_NAME_CURSOR) - private String cursor; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - public Pagination1() {} - - public Pagination1 cursor(String cursor) { - - this.cursor = cursor; - return this; - } - - /** - * The page to request. Acceptable values to use here are in PaginationOutput objects, in the - * `current`, `next`, and `previous` keys. Consumers of the API - * must treat this value as opaque. - * - * @return cursor - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The page to request. Acceptable values to use here are in PaginationOutput" - + " objects, in the `current`, `next`, and `previous` keys. Consumers of" - + " the API must treat this value as opaque.") - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - public Pagination1 count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The number of items to retrieve in a page, between 1 and 200. - * - * @return count - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The number of items to retrieve in a page, between 1 and 200.") - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pagination1 pagination1 = (Pagination1) o; - return Objects.equals(this.cursor, pagination1.cursor) - && Objects.equals(this.count, pagination1.count); - } - - @Override - public int hashCode() { - return Objects.hash(cursor, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pagination1 {\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cursor"); - openapiFields.add("count"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Pagination1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Pagination1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Pagination1 is not found in the empty" - + " JSON string", - Pagination1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Pagination1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Pagination1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Pagination1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) - && !jsonObj.get("cursor").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cursor` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("cursor").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Pagination1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Pagination1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Pagination1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Pagination1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Pagination1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Pagination1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Pagination1 - * @throws IOException if the JSON string is invalid with respect to Pagination1 - */ - public static Pagination1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Pagination1.class); - } - - /** - * Convert an instance of Pagination1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java deleted file mode 100644 index 9983bfb9..00000000 --- a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** PropertyRenameV1 */ -public class PropertyRenameV1 { - public static final String SERIALIZED_NAME_OLD_NAME = "oldName"; - - @SerializedName(SERIALIZED_NAME_OLD_NAME) - private String oldName; - - public static final String SERIALIZED_NAME_NEW_NAME = "newName"; - - @SerializedName(SERIALIZED_NAME_NEW_NAME) - private String newName; - - public PropertyRenameV1() {} - - public PropertyRenameV1 oldName(String oldName) { - - this.oldName = oldName; - return this; - } - - /** - * The old name of the property. - * - * @return oldName - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The old name of the property.") - public String getOldName() { - return oldName; - } - - public void setOldName(String oldName) { - this.oldName = oldName; - } - - public PropertyRenameV1 newName(String newName) { - - this.newName = newName; - return this; - } - - /** - * The new name to rename the property. - * - * @return newName - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new name to rename the property.") - public String getNewName() { - return newName; - } - - public void setNewName(String newName) { - this.newName = newName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PropertyRenameV1 propertyRenameV1 = (PropertyRenameV1) o; - return Objects.equals(this.oldName, propertyRenameV1.oldName) - && Objects.equals(this.newName, propertyRenameV1.newName); - } - - @Override - public int hashCode() { - return Objects.hash(oldName, newName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PropertyRenameV1 {\n"); - sb.append(" oldName: ").append(toIndentedString(oldName)).append("\n"); - sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("oldName"); - openapiFields.add("newName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("oldName"); - openapiRequiredFields.add("newName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PropertyRenameV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PropertyRenameV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in PropertyRenameV1 is not found in the" - + " empty JSON string", - PropertyRenameV1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!PropertyRenameV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PropertyRenameV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PropertyRenameV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("oldName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `oldName` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("oldName").toString())); - } - if (!jsonObj.get("newName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newName` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("newName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PropertyRenameV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PropertyRenameV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PropertyRenameV1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PropertyRenameV1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PropertyRenameV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of PropertyRenameV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertyRenameV1 - * @throws IOException if the JSON string is invalid with respect to PropertyRenameV1 - */ - public static PropertyRenameV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PropertyRenameV1.class); - } - - /** - * Convert an instance of PropertyRenameV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java deleted file mode 100644 index d524ddaf..00000000 --- a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** PropertyValueTransformationV1 */ -public class PropertyValueTransformationV1 { - public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) - private List propertyPaths = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) - private String propertyValue; - - public PropertyValueTransformationV1() {} - - public PropertyValueTransformationV1 propertyPaths(List propertyPaths) { - - this.propertyPaths = propertyPaths; - return this; - } - - public PropertyValueTransformationV1 addPropertyPathsItem(String propertyPathsItem) { - this.propertyPaths.add(propertyPathsItem); - return this; - } - - /** - * The property paths. The maximum number of paths is 10. - * - * @return propertyPaths - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The property paths. The maximum number of paths is 10.") - public List getPropertyPaths() { - return propertyPaths; - } - - public void setPropertyPaths(List propertyPaths) { - this.propertyPaths = propertyPaths; - } - - public PropertyValueTransformationV1 propertyValue(String propertyValue) { - - this.propertyValue = propertyValue; - return this; - } - - /** - * The new value of the property paths. - * - * @return propertyValue - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new value of the property paths.") - public String getPropertyValue() { - return propertyValue; - } - - public void setPropertyValue(String propertyValue) { - this.propertyValue = propertyValue; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PropertyValueTransformationV1 propertyValueTransformationV1 = - (PropertyValueTransformationV1) o; - return Objects.equals(this.propertyPaths, propertyValueTransformationV1.propertyPaths) - && Objects.equals(this.propertyValue, propertyValueTransformationV1.propertyValue); - } - - @Override - public int hashCode() { - return Objects.hash(propertyPaths, propertyValue); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PropertyValueTransformationV1 {\n"); - sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); - sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("propertyPaths"); - openapiFields.add("propertyValue"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("propertyPaths"); - openapiRequiredFields.add("propertyValue"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * PropertyValueTransformationV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!PropertyValueTransformationV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in PropertyValueTransformationV1 is not" - + " found in the empty JSON string", - PropertyValueTransformationV1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!PropertyValueTransformationV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PropertyValueTransformationV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PropertyValueTransformationV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the required json array is present - if (jsonObj.get("propertyPaths") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("propertyPaths").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyPaths` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("propertyPaths").toString())); - } - if (!jsonObj.get("propertyValue").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValue` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("propertyValue").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PropertyValueTransformationV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PropertyValueTransformationV1' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(PropertyValueTransformationV1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PropertyValueTransformationV1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PropertyValueTransformationV1 read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of PropertyValueTransformationV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertyValueTransformationV1 - * @throws IOException if the JSON string is invalid with respect to - * PropertyValueTransformationV1 - */ - public static PropertyValueTransformationV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PropertyValueTransformationV1.class); - } - - /** - * Convert an instance of PropertyValueTransformationV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java deleted file mode 100644 index d96809eb..00000000 --- a/src/main/java/com/segment/publicapi/models/Transformation3.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The retrieved Transformation. */ -@ApiModel(description = "The retrieved Transformation.") -public class Transformation3 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public Transformation3() {} - - public Transformation3 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Transformation3 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Transformation3 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Transformation3 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public Transformation3 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Transformation3 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Transformation3 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public Transformation3 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public Transformation3 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public Transformation3 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation3 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transformation3 transformation3 = (Transformation3) o; - return Objects.equals(this.id, transformation3.id) - && Objects.equals(this.name, transformation3.name) - && Objects.equals(this.sourceId, transformation3.sourceId) - && Objects.equals(this.destinationMetadataId, transformation3.destinationMetadataId) - && Objects.equals(this.enabled, transformation3.enabled) - && Objects.equals(this._if, transformation3._if) - && Objects.equals(this.newEventName, transformation3.newEventName) - && Objects.equals(this.propertyRenames, transformation3.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformation3.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transformation3 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Transformation3 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Transformation3.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transformation3 is not found in the" - + " empty JSON string", - Transformation3.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Transformation3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transformation3` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transformation3.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transformation3.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transformation3' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transformation3.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transformation3 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transformation3 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transformation3 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transformation3 - * @throws IOException if the JSON string is invalid with respect to Transformation3 - */ - public static Transformation3 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transformation3.class); - } - - /** - * Convert an instance of Transformation3 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java deleted file mode 100644 index ec91dbe6..00000000 --- a/src/main/java/com/segment/publicapi/models/Transformation4.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The updated Transformation. */ -@ApiModel(description = "The updated Transformation.") -public class Transformation4 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public Transformation4() {} - - public Transformation4 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Transformation4 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Transformation4 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Transformation4 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public Transformation4 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Transformation4 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Transformation4 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public Transformation4 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public Transformation4 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public Transformation4 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation4 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transformation4 transformation4 = (Transformation4) o; - return Objects.equals(this.id, transformation4.id) - && Objects.equals(this.name, transformation4.name) - && Objects.equals(this.sourceId, transformation4.sourceId) - && Objects.equals(this.destinationMetadataId, transformation4.destinationMetadataId) - && Objects.equals(this.enabled, transformation4.enabled) - && Objects.equals(this._if, transformation4._if) - && Objects.equals(this.newEventName, transformation4.newEventName) - && Objects.equals(this.propertyRenames, transformation4.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformation4.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transformation4 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Transformation4 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Transformation4.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transformation4 is not found in the" - + " empty JSON string", - Transformation4.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Transformation4.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transformation4` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transformation4.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transformation4.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transformation4' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transformation4.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transformation4 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transformation4 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transformation4 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transformation4 - * @throws IOException if the JSON string is invalid with respect to Transformation4 - */ - public static Transformation4 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transformation4.class); - } - - /** - * Convert an instance of Transformation4 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java deleted file mode 100644 index adac93ee..00000000 --- a/src/main/java/com/segment/publicapi/models/Transformation5.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The created Transformation. */ -@ApiModel(description = "The created Transformation.") -public class Transformation5 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public Transformation5() {} - - public Transformation5 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Transformation5 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Transformation5 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Transformation5 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public Transformation5 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Transformation5 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Transformation5 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public Transformation5 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public Transformation5 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public Transformation5 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public Transformation5 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transformation5 transformation5 = (Transformation5) o; - return Objects.equals(this.id, transformation5.id) - && Objects.equals(this.name, transformation5.name) - && Objects.equals(this.sourceId, transformation5.sourceId) - && Objects.equals(this.destinationMetadataId, transformation5.destinationMetadataId) - && Objects.equals(this.enabled, transformation5.enabled) - && Objects.equals(this._if, transformation5._if) - && Objects.equals(this.newEventName, transformation5.newEventName) - && Objects.equals(this.propertyRenames, transformation5.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformation5.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transformation5 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Transformation5 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Transformation5.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transformation5 is not found in the" - + " empty JSON string", - Transformation5.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Transformation5.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transformation5` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transformation5.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transformation5.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transformation5' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transformation5.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transformation5 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transformation5 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transformation5 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transformation5 - * @throws IOException if the JSON string is invalid with respect to Transformation5 - */ - public static Transformation5 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transformation5.class); - } - - /** - * Convert an instance of Transformation5 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java deleted file mode 100644 index abe887da..00000000 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Represents a Transformation. */ -@ApiModel(description = "Represents a Transformation.") -public class TransformationV1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public TransformationV1() {} - - public TransformationV1 id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Transformation. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Transformation.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public TransformationV1 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public TransformationV1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public TransformationV1 destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public TransformationV1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation is enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TransformationV1 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public TransformationV1 newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public TransformationV1 propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public TransformationV1 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public TransformationV1 propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public TransformationV1 addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TransformationV1 transformationV1 = (TransformationV1) o; - return Objects.equals(this.id, transformationV1.id) - && Objects.equals(this.name, transformationV1.name) - && Objects.equals(this.sourceId, transformationV1.sourceId) - && Objects.equals( - this.destinationMetadataId, transformationV1.destinationMetadataId) - && Objects.equals(this.enabled, transformationV1.enabled) - && Objects.equals(this._if, transformationV1._if) - && Objects.equals(this.newEventName, transformationV1.newEventName) - && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - transformationV1.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TransformationV1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("if"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to TransformationV1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!TransformationV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in TransformationV1 is not found in the" - + " empty JSON string", - TransformationV1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!TransformationV1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TransformationV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TransformationV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransformationV1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TransformationV1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(TransformationV1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TransformationV1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TransformationV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TransformationV1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of TransformationV1 - * @throws IOException if the JSON string is invalid with respect to TransformationV1 - */ - public static TransformationV1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TransformationV1.class); - } - - /** - * Convert an instance of TransformationV1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index d92501c0..622e0b49 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -34,11 +34,11 @@ public class UpdateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private UpdateTransformationV1Output data; + private UpdateTransformationBetaOutput data; public UpdateTransformation200Response() {} - public UpdateTransformation200Response data(UpdateTransformationV1Output data) { + public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) { this.data = data; return this; @@ -51,11 +51,11 @@ public UpdateTransformation200Response data(UpdateTransformationV1Output data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public UpdateTransformationV1Output getData() { + public UpdateTransformationBetaOutput getData() { return data; } - public void setData(UpdateTransformationV1Output data) { + public void setData(UpdateTransformationBetaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 6ec8c308..5a90bdea 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -36,11 +36,6 @@ /** The input to update a Transformation. */ @ApiModel(description = "The input to update a Transformation.") public class UpdateTransformationBetaInput { - public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) - private String transformationId; - public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -84,27 +79,6 @@ public class UpdateTransformationBetaInput { public UpdateTransformationBetaInput() {} - public UpdateTransformationBetaInput transformationId(String transformationId) { - - this.transformationId = transformationId; - return this; - } - - /** - * ID of the Transformation to update. - * - * @return transformationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "ID of the Transformation to update.") - public String getTransformationId() { - return transformationId; - } - - public void setTransformationId(String transformationId) { - this.transformationId = transformationId; - } - public UpdateTransformationBetaInput name(String name) { this.name = name; @@ -320,8 +294,7 @@ public boolean equals(Object o) { } UpdateTransformationBetaInput updateTransformationBetaInput = (UpdateTransformationBetaInput) o; - return Objects.equals(this.transformationId, updateTransformationBetaInput.transformationId) - && Objects.equals(this.name, updateTransformationBetaInput.name) + return Objects.equals(this.name, updateTransformationBetaInput.name) && Objects.equals(this.sourceId, updateTransformationBetaInput.sourceId) && Objects.equals( this.destinationMetadataId, @@ -339,7 +312,6 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - transformationId, name, sourceId, destinationMetadataId, @@ -354,7 +326,6 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateTransformationBetaInput {\n"); - sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" destinationMetadataId: ") @@ -388,7 +359,6 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("transformationId"); openapiFields.add("name"); openapiFields.add("sourceId"); openapiFields.add("destinationMetadataId"); @@ -400,7 +370,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformationId"); } /** @@ -433,23 +402,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("transformationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transformationId` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("transformationId").toString())); - } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java deleted file mode 100644 index 716d22b5..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The input to update a Transformation. */ -@ApiModel(description = "The input to update a Transformation.") -public class UpdateTransformationV1Input { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; - - @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) - private String newEventName; - - public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; - - public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = - "propertyValueTransformations"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; - - public UpdateTransformationV1Input() {} - - public UpdateTransformationV1Input name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the Transformation. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Transformation.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public UpdateTransformationV1Input sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The optional Source to be associated with the Transformation. - * - * @return sourceId - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The optional Source to be associated with the Transformation.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public UpdateTransformationV1Input destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The optional Destination metadata to be associated with the Transformation. - * - * @return destinationMetadataId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "The optional Destination metadata to be associated with the Transformation.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public UpdateTransformationV1Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * If the Transformation should be enabled. - * - * @return enabled - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "If the Transformation should be enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public UpdateTransformationV1Input _if(String _if) { - - this._if = _if; - return this; - } - - /** - * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard - * event matchers, use the following: Track -\\> - * \"event='\\<eventName\\>'\" Identify -\\> - * \"type='identify'\" Group -\\> - * \"type='group'\" - * - * @return _if - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public UpdateTransformationV1Input newEventName(String newEventName) { - - this.newEventName = newEventName; - return this; - } - - /** - * Optional new event name for renaming events. Works only for 'track' event type. - * - * @return newEventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") - public String getNewEventName() { - return newEventName; - } - - public void setNewEventName(String newEventName) { - this.newEventName = newEventName; - } - - public UpdateTransformationV1Input propertyRenames(List propertyRenames) { - - this.propertyRenames = propertyRenames; - return this; - } - - public UpdateTransformationV1Input addPropertyRenamesItem( - PropertyRenameV1 propertyRenamesItem) { - if (this.propertyRenames == null) { - this.propertyRenames = new ArrayList<>(); - } - this.propertyRenames.add(propertyRenamesItem); - return this; - } - - /** - * Optional array for renaming properties collected by your events. - * - * @return propertyRenames - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") - public List getPropertyRenames() { - return propertyRenames; - } - - public void setPropertyRenames(List propertyRenames) { - this.propertyRenames = propertyRenames; - } - - public UpdateTransformationV1Input propertyValueTransformations( - List propertyValueTransformations) { - - this.propertyValueTransformations = propertyValueTransformations; - return this; - } - - public UpdateTransformationV1Input addPropertyValueTransformationsItem( - PropertyValueTransformationV1 propertyValueTransformationsItem) { - if (this.propertyValueTransformations == null) { - this.propertyValueTransformations = new ArrayList<>(); - } - this.propertyValueTransformations.add(propertyValueTransformationsItem); - return this; - } - - /** - * Optional array for transforming properties and values collected by your events. Limited to 10 - * properties. - * - * @return propertyValueTransformations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") - public List getPropertyValueTransformations() { - return propertyValueTransformations; - } - - public void setPropertyValueTransformations( - List propertyValueTransformations) { - this.propertyValueTransformations = propertyValueTransformations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateTransformationV1Input updateTransformationV1Input = (UpdateTransformationV1Input) o; - return Objects.equals(this.name, updateTransformationV1Input.name) - && Objects.equals(this.sourceId, updateTransformationV1Input.sourceId) - && Objects.equals( - this.destinationMetadataId, - updateTransformationV1Input.destinationMetadataId) - && Objects.equals(this.enabled, updateTransformationV1Input.enabled) - && Objects.equals(this._if, updateTransformationV1Input._if) - && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) - && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) - && Objects.equals( - this.propertyValueTransformations, - updateTransformationV1Input.propertyValueTransformations); - } - - @Override - public int hashCode() { - return Objects.hash( - name, - sourceId, - destinationMetadataId, - enabled, - _if, - newEventName, - propertyRenames, - propertyValueTransformations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateTransformationV1Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); - sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); - sb.append(" propertyValueTransformations: ") - .append(toIndentedString(propertyValueTransformations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("enabled"); - openapiFields.add("if"); - openapiFields.add("newEventName"); - openapiFields.add("propertyRenames"); - openapiFields.add("propertyValueTransformations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UpdateTransformationV1Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateTransformationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateTransformationV1Input is not" - + " found in the empty JSON string", - UpdateTransformationV1Input.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateTransformationV1Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateTransformationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) - && !jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if ((jsonObj.get("destinationMetadataId") != null - && !jsonObj.get("destinationMetadataId").isJsonNull()) - && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) - && !jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) - && !jsonObj.get("newEventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `newEventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("newEventName").toString())); - } - if (jsonObj.get("propertyRenames") != null - && !jsonObj.get("propertyRenames").isJsonNull()) { - JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); - if (jsonArraypropertyRenames != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyRenames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyRenames` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("propertyRenames").toString())); - } - } - } - if (jsonObj.get("propertyValueTransformations") != null - && !jsonObj.get("propertyValueTransformations").isJsonNull()) { - JsonArray jsonArraypropertyValueTransformations = - jsonObj.getAsJsonArray("propertyValueTransformations"); - if (jsonArraypropertyValueTransformations != null) { - // ensure the json data is an array - if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `propertyValueTransformations` to be an" - + " array in the JSON string but got `%s`", - jsonObj.get("propertyValueTransformations").toString())); - } - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateTransformationV1Input' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateTransformationV1Input.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateTransformationV1Input value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateTransformationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateTransformationV1Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateTransformationV1Input - * @throws IOException if the JSON string is invalid with respect to UpdateTransformationV1Input - */ - public static UpdateTransformationV1Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Input.class); - } - - /** - * Convert an instance of UpdateTransformationV1Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java deleted file mode 100644 index a1e5193a..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The output of an updated Transformation. */ -@ApiModel(description = "The output of an updated Transformation.") -public class UpdateTransformationV1Output { - public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; - - @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation4 transformation; - - public UpdateTransformationV1Output() {} - - public UpdateTransformationV1Output transformation(Transformation4 transformation) { - - this.transformation = transformation; - return this; - } - - /** - * Get transformation - * - * @return transformation - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation4 getTransformation() { - return transformation; - } - - public void setTransformation(Transformation4 transformation) { - this.transformation = transformation; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateTransformationV1Output updateTransformationV1Output = - (UpdateTransformationV1Output) o; - return Objects.equals(this.transformation, updateTransformationV1Output.transformation); - } - - @Override - public int hashCode() { - return Objects.hash(transformation); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateTransformationV1Output {\n"); - sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("transformation"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("transformation"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateTransformationV1Output - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateTransformationV1Output is not" - + " found in the empty JSON string", - UpdateTransformationV1Output.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateTransformationV1Output.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateTransformationV1Output' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateTransformationV1Output.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateTransformationV1Output value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateTransformationV1Output given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateTransformationV1Output - * @throws IOException if the JSON string is invalid with respect to - * UpdateTransformationV1Output - */ - public static UpdateTransformationV1Output fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Output.class); - } - - /** - * Convert an instance of UpdateTransformationV1Output to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From eb13f0428bb33b2eba57468e51b3c1c4a6365075 Mon Sep 17 00:00:00 2001 From: public-api ci Date: Mon, 28 Nov 2022 22:10:24 +0000 Subject: [PATCH 018/474] Automated client deploy (from segmentio/public-api@00fbe0a) --- README.md | 33 ++---- .../api/DeletionAndSuppressionApi.java | 34 +++--- .../publicapi/api/DestinationFiltersApi.java | 30 ++--- .../publicapi/api/DestinationsApi.java | 28 ++--- .../segment/publicapi/api/IamGroupsApi.java | 108 +++++++++--------- .../segment/publicapi/api/IamUsersApi.java | 76 ++++++------ .../com/segment/publicapi/api/LabelsApi.java | 52 +++++---- .../publicapi/api/SelectiveSyncApi.java | 12 +- .../com/segment/publicapi/api/SourcesApi.java | 25 ++-- .../publicapi/api/TrackingPlansApi.java | 36 +++--- .../publicapi/api/TransformationsApi.java | 50 ++++---- .../segment/publicapi/api/WarehousesApi.java | 43 +++---- 12 files changed, 265 insertions(+), 262 deletions(-) diff --git a/README.md b/README.md index af55f149..2cf736c4 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,14 @@ -# Java API client for Segment Public API +# Segment Public API Java SDK ## Overview -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. +The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. The full documentation is available at [https://docs.segmentapis.com](https://docs.segmentapis.com). -Segment Public API -- API version: 33.0.2 +All endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. -The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. - -All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. - -See the next sections for more information on how to use the Segment Public API. - - - For more information, please visit [https://docs.segmentapis.com](https://docs.segmentapis.com) - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* +See the next sections for more information on how to use the Segment Public API Java SDK. +Latest API and SDK version: 33.0.2 ## Requirements @@ -68,13 +59,12 @@ Then manually install the following JARs: * `target/segment-publicapi-33.0.2.jar` * `target/lib/*.jar` -## Getting Started +You are now ready to start making calls to Public API! -Please follow the [installation](#installation) instruction and execute the following Java code: +## Example ```java -// Import classes: import com.segment.publicapi.ApiClient; import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; @@ -91,12 +81,12 @@ public class Example { // Configure HTTP bearer authorization: token HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); + token.setBearerToken(""); ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in v1. PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. - + // Make an API call without Pagination try { WorkspacesApi apiInstance = new WorkspacesApi(defaultClient); @@ -136,7 +126,6 @@ public class Example { It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. -## Author - -friends@segment.com +## Contributing +The contents of this repository are automatically generated, so we can't take contributions from external developers. If you have any issues with this SDK, please raise an issue or reach out to friends@segment.com instead of opening a pull request. Pull requests will not be reviewed. diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index cde51e20..9de184b2 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -394,8 +394,9 @@ private okhttp3.Call createSourceRegulationValidateBeforeCall( /** * Create Source Regulation Creates a Source-scoped regulation. When called, this endpoint may - * generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. - * Config API omitted fields: - `attributes`, - `userAgent` + * generate the `Source Regulation Created` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - + * `userAgent` * * @param sourceId (required) * @param createSourceRegulationV1Input (required) @@ -421,8 +422,9 @@ public CreateSourceRegulation200Response createSourceRegulation( /** * Create Source Regulation Creates a Source-scoped regulation. When called, this endpoint may - * generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. - * Config API omitted fields: - `attributes`, - `userAgent` + * generate the `Source Regulation Created` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - + * `userAgent` * * @param sourceId (required) * @param createSourceRegulationV1Input (required) @@ -450,8 +452,8 @@ public ApiResponse createSourceRegulationWith /** * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. When called, - * this endpoint may generate the `Source Regulation Created` [Audit - * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - + * this endpoint may generate the `Source Regulation Created` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * * @param sourceId (required) @@ -583,8 +585,9 @@ private okhttp3.Call createWorkspaceRegulationValidateBeforeCall( /** * Create Workspace Regulation Creates a Workspace-scoped regulation. When called, this endpoint - * may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) - * event. Config API omitted fields: - `attributes`, - `userAgent` + * may generate the `Workspace Regulation Created` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - + * `userAgent` * * @param createWorkspaceRegulationV1Input (required) * @return CreateWorkspaceRegulation200Response @@ -608,8 +611,9 @@ public CreateWorkspaceRegulation200Response createWorkspaceRegulation( /** * Create Workspace Regulation Creates a Workspace-scoped regulation. When called, this endpoint - * may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) - * event. Config API omitted fields: - `attributes`, - `userAgent` + * may generate the `Workspace Regulation Created` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - + * `userAgent` * * @param createWorkspaceRegulationV1Input (required) * @return ApiResponse<CreateWorkspaceRegulation200Response> @@ -635,8 +639,8 @@ public ApiResponse createWorkspaceRegulati /** * Create Workspace Regulation (asynchronously) Creates a Workspace-scoped regulation. When - * called, this endpoint may generate the `Workspace Regulation Created` [Audit - * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - + * called, this endpoint may generate the `Workspace Regulation Created` event in the + * [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * * @param createWorkspaceRegulationV1Input (required) @@ -764,7 +768,7 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. When called, this endpoint may generate the `Regulation - * Deleted` [Audit Trail](/tag/Audit-Trail) event. + * Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return DeleteRegulation200Response @@ -788,7 +792,7 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. When called, this endpoint may generate the `Regulation - * Deleted` [Audit Trail](/tag/Audit-Trail) event. + * Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -813,7 +817,7 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation * must be in the initialized state to be deleted. When called, this endpoint may generate the - * `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index 1f450fcd..a8002fea 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -188,8 +188,8 @@ private okhttp3.Call createFilterForDestinationValidateBeforeCall( /** * Create Filter for Destination Creates a filter in a Destination. When called, this endpoint - * may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) - * event. + * may generate the `Destination Filter Created` event in the [audit + * trail](/tag/Audit-Trail). * * @param destinationId (required) * @param createFilterForDestinationV1Input (required) @@ -217,8 +217,8 @@ public CreateFilterForDestination200Response createFilterForDestination( /** * Create Filter for Destination Creates a filter in a Destination. When called, this endpoint - * may generate the `Destination Filter Created` [Audit Trail](/tag/Audit-Trail) - * event. + * may generate the `Destination Filter Created` event in the [audit + * trail](/tag/Audit-Trail). * * @param destinationId (required) * @param createFilterForDestinationV1Input (required) @@ -249,8 +249,8 @@ public CreateFilterForDestination200Response createFilterForDestination( /** * Create Filter for Destination (asynchronously) Creates a filter in a Destination. When - * called, this endpoint may generate the `Destination Filter Created` [Audit - * Trail](/tag/Audit-Trail) event. + * called, this endpoint may generate the `Destination Filter Created` event in the + * [audit trail](/tag/Audit-Trail). * * @param destinationId (required) * @param createFilterForDestinationV1Input (required) @@ -949,7 +949,8 @@ private okhttp3.Call removeFilterFromDestinationValidateBeforeCall( /** * Remove Filter from Destination Deletes a Destination filter. When called, this endpoint may - * generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Destination Filter Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param destinationId (required) * @param filterId (required) @@ -974,7 +975,8 @@ public RemoveFilterFromDestination200Response removeFilterFromDestination( /** * Remove Filter from Destination Deletes a Destination filter. When called, this endpoint may - * generate the `Destination Filter Deleted` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Destination Filter Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param destinationId (required) * @param filterId (required) @@ -1002,8 +1004,8 @@ public RemoveFilterFromDestination200Response removeFilterFromDestination( /** * Remove Filter from Destination (asynchronously) Deletes a Destination filter. When called, - * this endpoint may generate the `Destination Filter Deleted` [Audit - * Trail](/tag/Audit-Trail) event. + * this endpoint may generate the `Destination Filter Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param destinationId (required) * @param filterId (required) @@ -1162,7 +1164,7 @@ private okhttp3.Call updateFilterForDestinationValidateBeforeCall( /** * Update Filter for Destination Updates a filter in a Destination. When called, this endpoint - * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Destination Filter Enabled * Destination Filter Disabled * * @param destinationId (required) @@ -1193,7 +1195,7 @@ public UpdateFilterForDestination200Response updateFilterForDestination( /** * Update Filter for Destination Updates a filter in a Destination. When called, this endpoint - * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Destination Filter Enabled * Destination Filter Disabled * * @param destinationId (required) @@ -1227,8 +1229,8 @@ public UpdateFilterForDestination200Response updateFilterForDestination( /** * Update Filter for Destination (asynchronously) Updates a filter in a Destination. When - * called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled + * called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled * * @param destinationId (required) * @param filterId (required) diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 2297595b..b30394bf 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -176,7 +176,7 @@ private okhttp3.Call createDestinationValidateBeforeCall( /** * Create Destination Creates a new Destination. When called, this endpoint may generate the - * `Integration Created` [Audit Trail](/tag/Audit-Trail) event. + * `Integration Created` event in the [audit trail](/tag/Audit-Trail). * * @param createDestinationV1Input (required) * @return CreateDestination200Response @@ -200,7 +200,7 @@ public CreateDestination200Response createDestination( /** * Create Destination Creates a new Destination. When called, this endpoint may generate the - * `Integration Created` [Audit Trail](/tag/Audit-Trail) event. + * `Integration Created` event in the [audit trail](/tag/Audit-Trail). * * @param createDestinationV1Input (required) * @return ApiResponse<CreateDestination200Response> @@ -225,7 +225,7 @@ public ApiResponse createDestinationWithHttpInfo( /** * Create Destination (asynchronously) Creates a new Destination. When called, this endpoint may - * generate the `Integration Created` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Integration Created` event in the [audit trail](/tag/Audit-Trail). * * @param createDestinationV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -545,8 +545,8 @@ private okhttp3.Call deleteDestinationValidateBeforeCall( /** * Delete Destination Deletes an existing Destination. When called, this endpoint may generate - * the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted - * fields: - `catalogId` + * the `Integration Deleted` event in the [audit trail](/tag/Audit-Trail). Config API + * omitted fields: - `catalogId` * * @param destinationId (required) * @return DeleteDestination200Response @@ -570,8 +570,8 @@ public DeleteDestination200Response deleteDestination(String destinationId) /** * Delete Destination Deletes an existing Destination. When called, this endpoint may generate - * the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) event. Config API omitted - * fields: - `catalogId` + * the `Integration Deleted` event in the [audit trail](/tag/Audit-Trail). Config API + * omitted fields: - `catalogId` * * @param destinationId (required) * @return ApiResponse<DeleteDestination200Response> @@ -595,8 +595,8 @@ public ApiResponse deleteDestinationWithHttpInfo( /** * Delete Destination (asynchronously) Deletes an existing Destination. When called, this - * endpoint may generate the `Integration Deleted` [Audit Trail](/tag/Audit-Trail) - * event. Config API omitted fields: - `catalogId` + * endpoint may generate the `Integration Deleted` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `catalogId` * * @param destinationId (required) * @param _callback The callback to be executed when the API call finishes @@ -1926,8 +1926,8 @@ private okhttp3.Call updateDestinationValidateBeforeCall( * only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If * there's a mix of writable and read-only properties in the payload, the request will be * accepted, the writable properties will be updated and the read-only properties ignored. When - * called, this endpoint may generate the `Integration Disabled` [Audit - * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` + * called, this endpoint may generate the `Integration Disabled` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `updateMask` * * @param destinationId (required) * @param updateDestinationV1Input (required) @@ -1957,8 +1957,8 @@ public UpdateDestination200Response updateDestination( * only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If * there's a mix of writable and read-only properties in the payload, the request will be * accepted, the writable properties will be updated and the read-only properties ignored. When - * called, this endpoint may generate the `Integration Disabled` [Audit - * Trail](/tag/Audit-Trail) event. Config API omitted fields: - `updateMask` + * called, this endpoint may generate the `Integration Disabled` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `updateMask` * * @param destinationId (required) * @param updateDestinationV1Input (required) @@ -1990,7 +1990,7 @@ public ApiResponse updateDestinationWithHttpInfo( * 400 error. * If there's a mix of writable and read-only properties in the payload, the * request will be accepted, the writable properties will be updated and the read-only * properties ignored. When called, this endpoint may generate the `Integration - * Disabled` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - + * Disabled` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - * `updateMask` * * @param destinationId (required) diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index 76d10223..8a4eefa2 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -197,7 +197,7 @@ private okhttp3.Call addPermissionsToUserGroupValidateBeforeCall( /** * Add Permissions to User Group Adds a list of access permissions to a user group. When called, - * this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) + * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) * events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the @@ -228,7 +228,7 @@ public AddPermissionsToUserGroup200Response addPermissionsToUserGroup( /** * Add Permissions to User Group Adds a list of access permissions to a user group. When called, - * this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) + * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) * events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the @@ -261,8 +261,8 @@ public ApiResponse addPermissionsToUserGro /** * Add Permissions to User Group (asynchronously) Adds a list of access permissions to a user - * group. When called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit + * group. When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit * for this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more @@ -412,7 +412,7 @@ private okhttp3.Call addUsersToUserGroupValidateBeforeCall( /** * Add Users to User Group Adds a list of users or invites to a user group. When called, this - * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the @@ -442,7 +442,7 @@ public AddUsersToUserGroup200Response addUsersToUserGroup( /** * Add Users to User Group Adds a list of users or invites to a user group. When called, this - * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the @@ -474,8 +474,8 @@ public ApiResponse addUsersToUserGroupWithHttpIn /** * Add Users to User Group (asynchronously) Adds a list of users or invites to a user group. - * When called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The + * When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The * rate limit for this endpoint is 60 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate @@ -607,7 +607,7 @@ private okhttp3.Call createUserGroupValidateBeforeCall( /** * Create User Group Creates a user group. When called, this endpoint may generate one or more - * of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy + * of the following [audit trail](/tag/Audit-Trail) events: * User Group Created * Policy * Created The rate limit for this endpoint is 60 requests per minute, which is lower than the * default due to access pattern restrictions. Once reached, this endpoint will respond with the * 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -635,7 +635,7 @@ public CreateUserGroup200Response createUserGroup(CreateUserGroupV1Input createU /** * Create User Group Creates a user group. When called, this endpoint may generate one or more - * of the following [Audit Trail](/tag/Audit-Trail) events: * User Group Created * Policy + * of the following [audit trail](/tag/Audit-Trail) events: * User Group Created * Policy * Created The rate limit for this endpoint is 60 requests per minute, which is lower than the * default due to access pattern restrictions. Once reached, this endpoint will respond with the * 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -663,7 +663,7 @@ public ApiResponse createUserGroupWithHttpInfo( /** * Create User Group (asynchronously) Creates a user group. When called, this endpoint may - * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * User Group + * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * User Group * Created * Policy Created The rate limit for this endpoint is 60 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -791,9 +791,9 @@ private okhttp3.Call deleteUserGroupValidateBeforeCall( /** * Delete User Group Removes a user group from a Workspace. When called, this endpoint may - * generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate - * limit for this endpoint is 60 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * generate the `User Group Deleted` event in the [audit trail](/tag/Audit-Trail). The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -818,9 +818,9 @@ public DeleteUserGroup200Response deleteUserGroup(String userGroupId) throws Api /** * Delete User Group Removes a user group from a Workspace. When called, this endpoint may - * generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate - * limit for this endpoint is 60 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * generate the `User Group Deleted` event in the [audit trail](/tag/Audit-Trail). The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -846,11 +846,11 @@ public ApiResponse deleteUserGroupWithHttpInfo(Strin /** * Delete User Group (asynchronously) Removes a user group from a Workspace. When called, this - * endpoint may generate the `User Group Deleted` [Audit Trail](/tag/Audit-Trail) - * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * endpoint may generate the `User Group Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userGroupId (required) * @param _callback The callback to be executed when the API call finishes @@ -1701,8 +1701,8 @@ private okhttp3.Call removeUsersFromUserGroupValidateBeforeCall( /** * Remove Users from User Group Removes one or multiple users or invites from a user group by - * email. When called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group + * email. When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group * The rate limit for this endpoint is 60 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate @@ -1732,8 +1732,8 @@ public RemoveUsersFromUserGroup200Response removeUsersFromUserGroup( /** * Remove Users from User Group Removes one or multiple users or invites from a user group by - * email. When called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group + * email. When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group * The rate limit for this endpoint is 60 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate @@ -1765,7 +1765,7 @@ public ApiResponse removeUsersFromUserGroup /** * Remove Users from User Group (asynchronously) Removes one or multiple users or invites from a * user group by email. When called, this endpoint may generate one or more of the following - * [Audit Trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User + * [audit trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User * Group The rate limit for this endpoint is 60 requests per minute, which is lower than the * default due to access pattern restrictions. Once reached, this endpoint will respond with the * 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -1915,11 +1915,11 @@ private okhttp3.Call replacePermissionsForUserGroupValidateBeforeCall( /** * Replace Permissions for User Group Updates the list of access permissions for a user group. - * When called, this endpoint may generate the `Policy Deleted` [Audit - * Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * When called, this endpoint may generate the `Policy Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userGroupId (required) * @param replacePermissionsForUserGroupV1Input (required) @@ -1947,11 +1947,11 @@ public ReplacePermissionsForUserGroup200Response replacePermissionsForUserGroup( /** * Replace Permissions for User Group Updates the list of access permissions for a user group. - * When called, this endpoint may generate the `Policy Deleted` [Audit - * Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * When called, this endpoint may generate the `Policy Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userGroupId (required) * @param replacePermissionsForUserGroupV1Input (required) @@ -1983,8 +1983,8 @@ public ReplacePermissionsForUserGroup200Response replacePermissionsForUserGroup( /** * Replace Permissions for User Group (asynchronously) Updates the list of access permissions * for a user group. When called, this endpoint may generate the `Policy Deleted` - * [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per - * minute, which is lower than the default due to access pattern restrictions. Once reached, + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * @@ -2132,7 +2132,7 @@ private okhttp3.Call replaceUsersInUserGroupValidateBeforeCall( /** * Replace Users in User Group Replaces the members of a user group by email. When called, this - * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit * for this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code @@ -2163,7 +2163,7 @@ public ReplaceUsersInUserGroup200Response replaceUsersInUserGroup( /** * Replace Users in User Group Replaces the members of a user group by email. When called, this - * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit * for this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code @@ -2196,8 +2196,8 @@ public ApiResponse replaceUsersInUserGroupWi /** * Replace Users in User Group (asynchronously) Replaces the members of a user group by email. - * When called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group + * When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group * Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -2346,9 +2346,9 @@ private okhttp3.Call updateUserGroupValidateBeforeCall( /** * Update User Group Updates a user group for a Workspace. When called, this endpoint may - * generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate - * limit for this endpoint is 60 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * generate the `User Group Updated` event in the [audit trail](/tag/Audit-Trail). The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -2375,9 +2375,9 @@ public UpdateUserGroup200Response updateUserGroup( /** * Update User Group Updates a user group for a Workspace. When called, this endpoint may - * generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) event. The rate - * limit for this endpoint is 60 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * generate the `User Group Updated` event in the [audit trail](/tag/Audit-Trail). The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -2405,11 +2405,11 @@ public ApiResponse updateUserGroupWithHttpInfo( /** * Update User Group (asynchronously) Updates a user group for a Workspace. When called, this - * endpoint may generate the `User Group Updated` [Audit Trail](/tag/Audit-Trail) - * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * endpoint may generate the `User Group Updated` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userGroupId (required) * @param updateUserGroupV1Input (required) diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 64d7fecb..3f4dbe23 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -190,7 +190,7 @@ private okhttp3.Call addPermissionsToUserValidateBeforeCall( /** * Add Permissions to User Adds a list of access permissions to a user. When called, this - * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -220,7 +220,7 @@ public AddPermissionsToUser200Response addPermissionsToUser( /** * Add Permissions to User Adds a list of access permissions to a user. When called, this - * endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -251,8 +251,8 @@ public ApiResponse addPermissionsToUserWithHttp /** * Add Permissions to User (asynchronously) Adds a list of access permissions to a user. When - * called, this endpoint may generate one or more of the following [Audit - * Trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for + * called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for * this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more @@ -384,7 +384,7 @@ private okhttp3.Call createInvitesValidateBeforeCall( /** * Create Invites Invites a list of users to join a Workspace. When called, this endpoint may - * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment + * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Non-Segment * User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API * omitted fields: - `parent` The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, @@ -413,7 +413,7 @@ public CreateInvites200Response createInvites(CreateInvitesV1Input createInvites /** * Create Invites Invites a list of users to join a Workspace. When called, this endpoint may - * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Non-Segment + * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Non-Segment * User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API * omitted fields: - `parent` The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, @@ -442,7 +442,7 @@ public ApiResponse createInvitesWithHttpInfo( /** * Create Invites (asynchronously) Invites a list of users to join a Workspace. When called, - * this endpoint may generate one or more of the following [Audit Trail](/tag/Audit-Trail) + * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) * events: * Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited * to Workspace Config API omitted fields: - `parent` The rate limit for this endpoint * is 60 requests per minute, which is lower than the default due to access pattern @@ -573,7 +573,7 @@ private okhttp3.Call deleteInvitesValidateBeforeCall( /** * Delete Invites Removes a list of invitations to join a Workspace. When called, this endpoint - * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Invite * Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -600,7 +600,7 @@ public DeleteInvites200Response deleteInvites(List emails) throws ApiExc /** * Delete Invites Removes a list of invitations to join a Workspace. When called, this endpoint - * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Invite + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Invite * Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -629,8 +629,8 @@ public ApiResponse deleteInvitesWithHttpInfo(List userIds) throws ApiExcept /** * Delete Users Removes one or multiple users. When called, this endpoint may generate the - * `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit - * for this endpoint is 60 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * `Group Memberships Deleted` event in the [audit trail](/tag/Audit-Trail). The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param userIds The ids of the users to remove. This parameter exists in v1. (required) * @return ApiResponse<DeleteUsers200Response> @@ -811,11 +811,11 @@ public ApiResponse deleteUsersWithHttpInfo(List /** * Delete Users (asynchronously) Removes one or multiple users. When called, this endpoint may - * generate the `Group Memberships Deleted` [Audit Trail](/tag/Audit-Trail) event. The - * rate limit for this endpoint is 60 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * generate the `Group Memberships Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userIds The ids of the users to remove. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes @@ -1636,11 +1636,11 @@ private okhttp3.Call replacePermissionsForUserValidateBeforeCall( /** * Replace Permissions for User Updates the list of access permissions for a user. When called, - * this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) - * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * this endpoint may generate the `Policy Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userId (required) * @param replacePermissionsForUserV1Input (required) @@ -1666,11 +1666,11 @@ public ReplacePermissionsForUser200Response replacePermissionsForUser( /** * Replace Permissions for User Updates the list of access permissions for a user. When called, - * this endpoint may generate the `Policy Deleted` [Audit Trail](/tag/Audit-Trail) - * event. The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * this endpoint may generate the `Policy Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param userId (required) * @param replacePermissionsForUserV1Input (required) @@ -1699,8 +1699,8 @@ public ApiResponse replacePermissionsForUs /** * Replace Permissions for User (asynchronously) Updates the list of access permissions for a - * user. When called, this endpoint may generate the `Policy Deleted` [Audit - * Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, + * user. When called, this endpoint may generate the `Policy Deleted` event in the + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, * which is lower than the default due to access pattern restrictions. Once reached, this * endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index 497cb9ca..2ca43ac6 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -164,10 +164,11 @@ private okhttp3.Call createLabelValidateBeforeCall( /** * Create Label Creates a new label. When called, this endpoint may generate the `Label - * Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param createLabelV1Input (required) * @return CreateLabel200Response @@ -191,10 +192,11 @@ public CreateLabel200Response createLabel(CreateLabelV1Input createLabelV1Input) /** * Create Label Creates a new label. When called, this endpoint may generate the `Label - * Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param createLabelV1Input (required) * @return ApiResponse<CreateLabel200Response> @@ -218,10 +220,10 @@ public ApiResponse createLabelWithHttpInfo( /** * Create Label (asynchronously) Creates a new label. When called, this endpoint may generate - * the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this - * endpoint is 60 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * the `Label Created` event in the [audit trail](/tag/Audit-Trail). The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param createLabelV1Input (required) @@ -354,10 +356,11 @@ private okhttp3.Call deleteLabelValidateBeforeCall( /** * Delete Label Deletes a label. When called, this endpoint may generate the `Label - * Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param key (required) * @param value (required) @@ -380,10 +383,11 @@ public DeleteLabel200Response deleteLabel(String key, String value) throws ApiEx /** * Delete Label Deletes a label. When called, this endpoint may generate the `Label - * Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param key (required) * @param value (required) @@ -408,10 +412,10 @@ public ApiResponse deleteLabelWithHttpInfo(String key, S /** * Delete Label (asynchronously) Deletes a label. When called, this endpoint may generate the - * `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this - * endpoint is 60 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * `Label Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for + * this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param key (required) diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 3c2de758..c1d41745 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -1257,8 +1257,8 @@ private okhttp3.Call updateSelectiveSyncForWarehouseValidateBeforeCall( /** * Update Selective Sync for Warehouse Configures the schema for a Warehouse, including Sources, * Collections, and Properties. When called, this endpoint may generate the `Storage - * Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this - * endpoint is 2 requests per minute, which is lower than the default due to access pattern + * Destination Modified` event in the [audit trail](/tag/Audit-Trail). The rate limit for + * this endpoint is 2 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -1290,8 +1290,8 @@ public UpdateSelectiveSyncForWarehouse200Response updateSelectiveSyncForWarehous /** * Update Selective Sync for Warehouse Configures the schema for a Warehouse, including Sources, * Collections, and Properties. When called, this endpoint may generate the `Storage - * Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this - * endpoint is 2 requests per minute, which is lower than the default due to access pattern + * Destination Modified` event in the [audit trail](/tag/Audit-Trail). The rate limit for + * this endpoint is 2 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -1326,8 +1326,8 @@ public UpdateSelectiveSyncForWarehouse200Response updateSelectiveSyncForWarehous /** * Update Selective Sync for Warehouse (asynchronously) Configures the schema for a Warehouse, * including Sources, Collections, and Properties. When called, this endpoint may generate the - * `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate - * limit for this endpoint is 2 requests per minute, which is lower than the default due to + * `Storage Destination Modified` event in the [audit trail](/tag/Audit-Trail). The + * rate limit for this endpoint is 2 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index 240ddb5c..2c95b01a 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -194,7 +194,7 @@ private okhttp3.Call addLabelsToSourceValidateBeforeCall( /** * Add Labels to Source Adds an existing label to a Source. When called, this endpoint may - * generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) * @param addLabelsToSourceV1Input (required) @@ -220,7 +220,7 @@ public AddLabelsToSource200Response addLabelsToSource( /** * Add Labels to Source Adds an existing label to a Source. When called, this endpoint may - * generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) * @param addLabelsToSourceV1Input (required) @@ -247,7 +247,8 @@ public ApiResponse addLabelsToSourceWithHttpInfo( /** * Add Labels to Source (asynchronously) Adds an existing label to a Source. When called, this - * endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. + * endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). * * @param sourceId (required) * @param addLabelsToSourceV1Input (required) @@ -374,7 +375,7 @@ private okhttp3.Call createSourceValidateBeforeCall( /** * Create Source Creates a new Source. When called, this endpoint may generate the `Source - * Created` [Audit Trail](/tag/Audit-Trail) event. + * Created` event in the [audit trail](/tag/Audit-Trail). * * @param createSourceV1Input (required) * @return CreateSource200Response @@ -398,7 +399,7 @@ public CreateSource200Response createSource(CreateSourceV1Input createSourceV1In /** * Create Source Creates a new Source. When called, this endpoint may generate the `Source - * Created` [Audit Trail](/tag/Audit-Trail) event. + * Created` event in the [audit trail](/tag/Audit-Trail). * * @param createSourceV1Input (required) * @return ApiResponse<CreateSource200Response> @@ -422,7 +423,7 @@ public ApiResponse createSourceWithHttpInfo( /** * Create Source (asynchronously) Creates a new Source. When called, this endpoint may generate - * the `Source Created` [Audit Trail](/tag/Audit-Trail) event. + * the `Source Created` event in the [audit trail](/tag/Audit-Trail). * * @param createSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -544,7 +545,7 @@ private okhttp3.Call deleteSourceValidateBeforeCall( /** * Delete Source Deletes an existing Source. When called, this endpoint may generate the - * `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. + * `Source Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) * @return DeleteSource200Response @@ -566,7 +567,7 @@ public DeleteSource200Response deleteSource(String sourceId) throws ApiException /** * Delete Source Deletes an existing Source. When called, this endpoint may generate the - * `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. + * `Source Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) * @return ApiResponse<DeleteSource200Response> @@ -590,7 +591,7 @@ public ApiResponse deleteSourceWithHttpInfo(String sour /** * Delete Source (asynchronously) Deletes an existing Source. When called, this endpoint may - * generate the `Source Deleted` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Source Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes @@ -2033,7 +2034,7 @@ private okhttp3.Call updateSourceValidateBeforeCall( /** * Update Source Updates an existing Source. When called, this endpoint may generate one or more - * of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * + * of the following [audit trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * * Source Settings Modified * Source Disabled Config API omitted fields: - * `updateMask` * @@ -2060,7 +2061,7 @@ public UpdateSource200Response updateSource( /** * Update Source Updates an existing Source. When called, this endpoint may generate one or more - * of the following [Audit Trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * + * of the following [audit trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * * Source Settings Modified * Source Disabled Config API omitted fields: - * `updateMask` * @@ -2088,7 +2089,7 @@ public ApiResponse updateSourceWithHttpInfo( /** * Update Source (asynchronously) Updates an existing Source. When called, this endpoint may - * generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Source + * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Source * Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted * fields: - `updateMask` * diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index 93b89e46..476afd10 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -197,9 +197,9 @@ private okhttp3.Call addSourceToTrackingPlanValidateBeforeCall( /** * Add Source to Tracking Plan Connects a Source to a Tracking Plan. When called, this endpoint - * may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Protocols feature enabled. Please reach out to your customer success manager for more + * may generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more * information. * * @param trackingPlanId (required) @@ -226,9 +226,9 @@ public AddSourceToTrackingPlan200Response addSourceToTrackingPlan( /** * Add Source to Tracking Plan Connects a Source to a Tracking Plan. When called, this endpoint - * may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. **Note**: - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Protocols feature enabled. Please reach out to your customer success manager for more + * may generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more * information. * * @param trackingPlanId (required) @@ -257,8 +257,8 @@ public ApiResponse addSourceToTrackingPlanWi /** * Add Source to Tracking Plan (asynchronously) Connects a Source to a Tracking Plan. When - * called, this endpoint may generate the `Source Modified` [Audit - * Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the + * called, this endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the * specified Workspace needs to have the Protocols feature enabled. Please reach out to your * customer success manager for more information. * @@ -1728,10 +1728,10 @@ private okhttp3.Call removeSourceFromTrackingPlanValidateBeforeCall( /** * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. When called, this - * endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param trackingPlanId (required) * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: @@ -1757,10 +1757,10 @@ public RemoveSourceFromTrackingPlan200Response removeSourceFromTrackingPlan( /** * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. When called, this - * endpoint may generate the `Source Modified` [Audit Trail](/tag/Audit-Trail) event. - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param trackingPlanId (required) * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: @@ -1789,8 +1789,8 @@ public RemoveSourceFromTrackingPlan200Response removeSourceFromTrackingPlan( /** * Remove Source from Tracking Plan (asynchronously) Disconnects a Source from a Tracking Plan. - * When called, this endpoint may generate the `Source Modified` [Audit - * Trail](/tag/Audit-Trail) event. **Note**: In order to successfully call this endpoint, the + * When called, this endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the * specified Workspace needs to have the Protocols feature enabled. Please reach out to your * customer success manager for more information. * diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index 0c92832f..5bcdb7a1 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -168,9 +168,10 @@ private okhttp3.Call createTransformationValidateBeforeCall( /** * Create Transformation Creates a new Transformation. When called, this endpoint may generate - * the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. + * the `Transformation Created` event in the [audit trail](/tag/Audit-Trail). + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. * * @param createTransformationBetaInput (required) * @return CreateTransformation200Response @@ -194,9 +195,10 @@ public CreateTransformation200Response createTransformation( /** * Create Transformation Creates a new Transformation. When called, this endpoint may generate - * the `Transformation Created` [Audit Trail](/tag/Audit-Trail) event. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. + * the `Transformation Created` event in the [audit trail](/tag/Audit-Trail). + * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have + * the Protocols feature enabled. Please reach out to your customer success manager for more + * information. * * @param createTransformationBetaInput (required) * @return ApiResponse<CreateTransformation200Response> @@ -221,10 +223,10 @@ public ApiResponse createTransformationWithHttp /** * Create Transformation (asynchronously) Creates a new Transformation. When called, this - * endpoint may generate the `Transformation Created` [Audit Trail](/tag/Audit-Trail) - * event. **Note**: In order to successfully call this endpoint, the specified Workspace needs - * to have the Protocols feature enabled. Please reach out to your customer success manager for - * more information. + * endpoint may generate the `Transformation Created` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param createTransformationBetaInput (required) * @param _callback The callback to be executed when the API call finishes @@ -347,8 +349,8 @@ private okhttp3.Call deleteTransformationValidateBeforeCall( /** * Delete Transformation Deletes a Transformation. When called, this endpoint may generate the - * `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order - * to successfully call this endpoint, the specified Workspace needs to have the Protocols + * `Transformation Deleted` event in the [audit trail](/tag/Audit-Trail). **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * * @param transformationId (required) @@ -373,8 +375,8 @@ public DeleteTransformation200Response deleteTransformation(String transformatio /** * Delete Transformation Deletes a Transformation. When called, this endpoint may generate the - * `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. **Note**: In order - * to successfully call this endpoint, the specified Workspace needs to have the Protocols + * `Transformation Deleted` event in the [audit trail](/tag/Audit-Trail). **Note**: In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * * @param transformationId (required) @@ -399,10 +401,10 @@ public ApiResponse deleteTransformationWithHttp /** * Delete Transformation (asynchronously) Deletes a Transformation. When called, this endpoint - * may generate the `Transformation Deleted` [Audit Trail](/tag/Audit-Trail) event. - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * may generate the `Transformation Deleted` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param transformationId (required) * @param _callback The callback to be executed when the API call finishes @@ -887,7 +889,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( /** * Update Transformation Updates an existing Transformation. When called, this endpoint may - * generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Transformation Updated` event in the [audit trail](/tag/Audit-Trail). * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have * the Protocols feature enabled. Please reach out to your customer success manager for more * information. @@ -916,7 +918,7 @@ public UpdateTransformation200Response updateTransformation( /** * Update Transformation Updates an existing Transformation. When called, this endpoint may - * generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Transformation Updated` event in the [audit trail](/tag/Audit-Trail). * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have * the Protocols feature enabled. Please reach out to your customer success manager for more * information. @@ -947,10 +949,10 @@ public ApiResponse updateTransformationWithHttp /** * Update Transformation (asynchronously) Updates an existing Transformation. When called, this - * endpoint may generate the `Transformation Updated` [Audit Trail](/tag/Audit-Trail) - * event. **Note**: In order to successfully call this endpoint, the specified Workspace needs - * to have the Protocols feature enabled. Please reach out to your customer success manager for - * more information. + * endpoint may generate the `Transformation Updated` event in the [audit + * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param transformationId (required) * @param updateTransformationBetaInput (required) diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index fd3e3a0a..ad23bc33 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -185,8 +185,8 @@ private okhttp3.Call addConnectionFromSourceToWarehouseValidateBeforeCall( /** * Add Connection from Source to Warehouse Connects a Source to a Warehouse. When called, this - * endpoint may generate the `Storage Destination Modified` [Audit - * Trail](/tag/Audit-Trail) event. + * endpoint may generate the `Storage Destination Modified` event in the [audit + * trail](/tag/Audit-Trail). * * @param warehouseId (required) * @param sourceId (required) @@ -211,8 +211,8 @@ public AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWa /** * Add Connection from Source to Warehouse Connects a Source to a Warehouse. When called, this - * endpoint may generate the `Storage Destination Modified` [Audit - * Trail](/tag/Audit-Trail) event. + * endpoint may generate the `Storage Destination Modified` event in the [audit + * trail](/tag/Audit-Trail). * * @param warehouseId (required) * @param sourceId (required) @@ -240,8 +240,8 @@ public AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWa /** * Add Connection from Source to Warehouse (asynchronously) Connects a Source to a Warehouse. - * When called, this endpoint may generate the `Storage Destination Modified` [Audit - * Trail](/tag/Audit-Trail) event. + * When called, this endpoint may generate the `Storage Destination Modified` event in + * the [audit trail](/tag/Audit-Trail). * * @param warehouseId (required) * @param sourceId (required) @@ -373,8 +373,8 @@ private okhttp3.Call createValidationInWarehouseValidateBeforeCall( /** * Create Validation in Warehouse Validates input settings against a Warehouse. When called, - * this endpoint may generate the `Storage Destination Settings Validation` [Audit - * Trail](/tag/Audit-Trail) event. + * this endpoint may generate the `Storage Destination Settings Validation` event in + * the [audit trail](/tag/Audit-Trail). * * @param createValidationInWarehouseV1Input (required) * @return CreateValidationInWarehouse200Response @@ -399,8 +399,8 @@ public CreateValidationInWarehouse200Response createValidationInWarehouse( /** * Create Validation in Warehouse Validates input settings against a Warehouse. When called, - * this endpoint may generate the `Storage Destination Settings Validation` [Audit - * Trail](/tag/Audit-Trail) event. + * this endpoint may generate the `Storage Destination Settings Validation` event in + * the [audit trail](/tag/Audit-Trail). * * @param createValidationInWarehouseV1Input (required) * @return ApiResponse<CreateValidationInWarehouse200Response> @@ -430,7 +430,7 @@ public CreateValidationInWarehouse200Response createValidationInWarehouse( /** * Create Validation in Warehouse (asynchronously) Validates input settings against a Warehouse. * When called, this endpoint may generate the `Storage Destination Settings - * Validation` [Audit Trail](/tag/Audit-Trail) event. + * Validation` event in the [audit trail](/tag/Audit-Trail). * * @param createValidationInWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -557,7 +557,7 @@ private okhttp3.Call createWarehouseValidateBeforeCall( /** * Create Warehouse Creates a new Warehouse. When called, this endpoint may generate the - * `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. + * `Storage Destination Created` event in the [audit trail](/tag/Audit-Trail). * * @param createWarehouseV1Input (required) * @return CreateWarehouse200Response @@ -581,7 +581,7 @@ public CreateWarehouse200Response createWarehouse(CreateWarehouseV1Input createW /** * Create Warehouse Creates a new Warehouse. When called, this endpoint may generate the - * `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. + * `Storage Destination Created` event in the [audit trail](/tag/Audit-Trail). * * @param createWarehouseV1Input (required) * @return ApiResponse<CreateWarehouse200Response> @@ -605,7 +605,8 @@ public ApiResponse createWarehouseWithHttpInfo( /** * Create Warehouse (asynchronously) Creates a new Warehouse. When called, this endpoint may - * generate the `Storage Destination Created` [Audit Trail](/tag/Audit-Trail) event. + * generate the `Storage Destination Created` event in the [audit + * trail](/tag/Audit-Trail). * * @param createWarehouseV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -729,7 +730,7 @@ private okhttp3.Call deleteWarehouseValidateBeforeCall( /** * Delete Warehouse Deletes an existing Warehouse. When called, this endpoint may generate the - * `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. + * `Storage Destination Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param warehouseId (required) * @return DeleteWarehouse200Response @@ -752,7 +753,7 @@ public DeleteWarehouse200Response deleteWarehouse(String warehouseId) throws Api /** * Delete Warehouse Deletes an existing Warehouse. When called, this endpoint may generate the - * `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) event. + * `Storage Destination Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param warehouseId (required) * @return ApiResponse<DeleteWarehouse200Response> @@ -776,8 +777,8 @@ public ApiResponse deleteWarehouseWithHttpInfo(Strin /** * Delete Warehouse (asynchronously) Deletes an existing Warehouse. When called, this endpoint - * may generate the `Storage Destination Deleted` [Audit Trail](/tag/Audit-Trail) - * event. + * may generate the `Storage Destination Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param warehouseId (required) * @param _callback The callback to be executed when the API call finishes @@ -1820,7 +1821,7 @@ private okhttp3.Call updateWarehouseValidateBeforeCall( /** * Update Warehouse Updates an existing Warehouse. When called, this endpoint may generate one - * or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination + * or more of the following [audit trail](/tag/Audit-Trail) events: * Storage Destination * Modified * Storage Destination Enabled * * @param warehouseId (required) @@ -1846,7 +1847,7 @@ public UpdateWarehouse200Response updateWarehouse( /** * Update Warehouse Updates an existing Warehouse. When called, this endpoint may generate one - * or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage Destination + * or more of the following [audit trail](/tag/Audit-Trail) events: * Storage Destination * Modified * Storage Destination Enabled * * @param warehouseId (required) @@ -1873,7 +1874,7 @@ public ApiResponse updateWarehouseWithHttpInfo( /** * Update Warehouse (asynchronously) Updates an existing Warehouse. When called, this endpoint - * may generate one or more of the following [Audit Trail](/tag/Audit-Trail) events: * Storage + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Storage * Destination Modified * Storage Destination Enabled * * @param warehouseId (required) From 1643766fd0ca481bffdd6b1310260068521af327 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 30 Nov 2022 17:53:37 +0000 Subject: [PATCH 019/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8e03298. From 07d1fc6d74abee587dcdde9a9890fd3fdd8188e3 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 1 Dec 2022 22:44:41 +0000 Subject: [PATCH 020/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0f041b1. From e4e438c19f354ae1082d44a6b986f4726a484370 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 8 Dec 2022 22:47:02 +0000 Subject: [PATCH 021/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8a5fc48. --- README.md | 10 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 45 ++ .../publicapi/api/TransformationsApi.java | 116 ++-- .../CreateTransformation200Response.java | 8 +- .../models/CreateTransformationV1Input.java | 540 +++++++++++++++++ .../models/CreateTransformationV1Output.java | 209 +++++++ .../DeleteTransformation200Response.java | 8 +- .../models/DeleteTransformationBetaInput.java | 218 +++++++ .../models/DeleteTransformationV1Output.java | 261 ++++++++ .../publicapi/models/DestinationMetadata.java | 98 ++- .../models/DestinationMetadataV1.java | 98 ++- .../models/GetTransformation200Response.java | 8 +- .../models/GetTransformationBetaInput.java | 212 +++++++ .../models/GetTransformationV1Output.java | 205 +++++++ .../ListTransformations200Response.java | 8 +- .../models/ListTransformationsBetaInput.java | 209 +++++++ .../models/ListTransformationsV1Output.java | 254 ++++++++ .../segment/publicapi/models/Metadata.java | 98 ++- .../segment/publicapi/models/Pagination1.java | 249 ++++++++ .../publicapi/models/PropertyRenameV1.java | 246 ++++++++ .../models/PropertyValueTransformationV1.java | 266 ++++++++ .../publicapi/models/Transformation3.java | 570 +++++++++++++++++ .../publicapi/models/Transformation4.java | 570 +++++++++++++++++ .../publicapi/models/Transformation5.java | 570 +++++++++++++++++ .../publicapi/models/TransformationV1.java | 571 ++++++++++++++++++ .../UpdateTransformation200Response.java | 8 +- .../models/UpdateTransformationBetaInput.java | 50 +- .../models/UpdateTransformationV1Input.java | 524 ++++++++++++++++ .../models/UpdateTransformationV1Output.java | 209 +++++++ 31 files changed, 6354 insertions(+), 88 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java create mode 100644 src/main/java/com/segment/publicapi/models/Pagination1.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertyRenameV1.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation3.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation4.java create mode 100644 src/main/java/com/segment/publicapi/models/Transformation5.java create mode 100644 src/main/java/com/segment/publicapi/models/TransformationV1.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java diff --git a/README.md b/README.md index 2cf736c4..7ecba2aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Segment Public API Java SDK +> :warning: **Note**: This SDK is currently released as [Public Beta](https://segment.com/legal/first-access-beta-preview/). Its use in critical systems is discouraged, but [feedback is welcome](#contributing). + ## Overview The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. The full documentation is available at [https://docs.segmentapis.com](https://docs.segmentapis.com). @@ -8,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 33.0.2 +Latest API and SDK version: 33.0.4 ## Requirements @@ -26,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 33.0.2 + 33.0.4 compile ``` @@ -42,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:33.0.2" + implementation "com.segment.publicapi:segment-publicapi:33.0.4" } ``` @@ -56,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-33.0.2.jar` +* `target/segment-publicapi-33.0.4.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 79b6c2d2..e319e4b5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 33.0.2 + 33.0.4 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 7baab8e6..1ced96f8 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/33.0.2/java"); + setUserAgent("OpenAPI-Generator/33.0.4/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 6624035e..5c5a4363 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -301,6 +301,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateUserGroup200Response .CustomTypeAdapterFactory()); @@ -386,9 +392,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformation200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteUserGroup200Response .CustomTypeAdapterFactory()); @@ -631,9 +643,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformation200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetUser200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -848,9 +866,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformations200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsBetaInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListTransformationsBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListTransformationsV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUserGroups200Response .CustomTypeAdapterFactory()); @@ -916,6 +940,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Pagination1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -940,9 +966,14 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertyValueTransformationV1 + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1143,8 +1174,16 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation4.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transformation5.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); @@ -1239,6 +1278,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateTransformationBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationV1Input + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateTransformationV1Output + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateUserGroup200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index 5bcdb7a1..faf9ad16 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -20,13 +20,13 @@ import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateTransformation200Response; -import com.segment.publicapi.models.CreateTransformationBetaInput; +import com.segment.publicapi.models.CreateTransformationV1Input; import com.segment.publicapi.models.DeleteTransformation200Response; import com.segment.publicapi.models.GetTransformation200Response; import com.segment.publicapi.models.ListTransformations200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateTransformation200Response; -import com.segment.publicapi.models.UpdateTransformationBetaInput; +import com.segment.publicapi.models.UpdateTransformationV1Input; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -73,7 +73,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for createTransformation * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -87,8 +87,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * */ public okhttp3.Call createTransformationCall( - CreateTransformationBetaInput createTransformationBetaInput, - final ApiCallback _callback) + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -103,7 +102,7 @@ public okhttp3.Call createTransformationCall( basePath = null; } - Object localVarPostBody = createTransformationBetaInput; + Object localVarPostBody = createTransformationV1Input; // create path and map variables String localVarPath = "/transformations"; @@ -115,9 +114,10 @@ public okhttp3.Call createTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -125,7 +125,9 @@ public okhttp3.Call createTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -150,19 +152,18 @@ public okhttp3.Call createTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call createTransformationValidateBeforeCall( - CreateTransformationBetaInput createTransformationBetaInput, - final ApiCallback _callback) + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTransformationBetaInput' is set - if (createTransformationBetaInput == null) { + // verify the required parameter 'createTransformationV1Input' is set + if (createTransformationV1Input == null) { throw new ApiException( - "Missing the required parameter 'createTransformationBetaInput' when calling" + "Missing the required parameter 'createTransformationV1Input' when calling" + " createTransformation(Async)"); } okhttp3.Call localVarCall = - createTransformationCall(createTransformationBetaInput, _callback); + createTransformationCall(createTransformationV1Input, _callback); return localVarCall; } @@ -173,7 +174,7 @@ private okhttp3.Call createTransformationValidateBeforeCall( * the Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @return CreateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -187,9 +188,9 @@ private okhttp3.Call createTransformationValidateBeforeCall( * */ public CreateTransformation200Response createTransformation( - CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + CreateTransformationV1Input createTransformationV1Input) throws ApiException { ApiResponse localVarResp = - createTransformationWithHttpInfo(createTransformationBetaInput); + createTransformationWithHttpInfo(createTransformationV1Input); return localVarResp.getData(); } @@ -200,7 +201,7 @@ public CreateTransformation200Response createTransformation( * the Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @return ApiResponse<CreateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -214,9 +215,9 @@ public CreateTransformation200Response createTransformation( * */ public ApiResponse createTransformationWithHttpInfo( - CreateTransformationBetaInput createTransformationBetaInput) throws ApiException { + CreateTransformationV1Input createTransformationV1Input) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationBetaInput, null); + createTransformationValidateBeforeCall(createTransformationV1Input, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -228,7 +229,7 @@ public ApiResponse createTransformationWithHttp * specified Workspace needs to have the Protocols feature enabled. Please reach out to your * customer success manager for more information. * - * @param createTransformationBetaInput (required) + * @param createTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -243,12 +244,12 @@ public ApiResponse createTransformationWithHttp * */ public okhttp3.Call createTransformationAsync( - CreateTransformationBetaInput createTransformationBetaInput, + CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - createTransformationValidateBeforeCall(createTransformationBetaInput, _callback); + createTransformationValidateBeforeCall(createTransformationV1Input, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -300,9 +301,10 @@ public okhttp3.Call deleteTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -477,9 +479,10 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -606,7 +609,7 @@ public okhttp3.Call getTransformationAsync( /** * Build call for listTransformations * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -650,9 +653,10 @@ public okhttp3.Call listTransformationsCall( } final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -702,7 +706,7 @@ private okhttp3.Call listTransformationsValidateBeforeCall( * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListTransformations200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -727,7 +731,7 @@ public ListTransformations200Response listTransformations(PaginationInput pagina * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListTransformations200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -753,7 +757,7 @@ public ApiResponse listTransformationsWithHttpIn * Protocols feature enabled. Please reach out to your customer success manager for more * information. * - * @param pagination Pagination options. This parameter exists in beta. (required) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -780,7 +784,7 @@ public okhttp3.Call listTransformationsAsync( * Build call for updateTransformation * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -795,7 +799,7 @@ public okhttp3.Call listTransformationsAsync( */ public okhttp3.Call updateTransformationCall( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -811,7 +815,7 @@ public okhttp3.Call updateTransformationCall( basePath = null; } - Object localVarPostBody = updateTransformationBetaInput; + Object localVarPostBody = updateTransformationV1Input; // create path and map variables String localVarPath = @@ -827,9 +831,10 @@ public okhttp3.Call updateTransformationCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -837,7 +842,9 @@ public okhttp3.Call updateTransformationCall( } final String[] localVarContentTypes = { - "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1+json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); @@ -863,7 +870,7 @@ public okhttp3.Call updateTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call updateTransformationValidateBeforeCall( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { @@ -874,16 +881,15 @@ private okhttp3.Call updateTransformationValidateBeforeCall( + " updateTransformation(Async)"); } - // verify the required parameter 'updateTransformationBetaInput' is set - if (updateTransformationBetaInput == null) { + // verify the required parameter 'updateTransformationV1Input' is set + if (updateTransformationV1Input == null) { throw new ApiException( - "Missing the required parameter 'updateTransformationBetaInput' when calling" + "Missing the required parameter 'updateTransformationV1Input' when calling" + " updateTransformation(Async)"); } okhttp3.Call localVarCall = - updateTransformationCall( - transformationId, updateTransformationBetaInput, _callback); + updateTransformationCall(transformationId, updateTransformationV1Input, _callback); return localVarCall; } @@ -895,7 +901,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @return UpdateTransformation200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -909,10 +915,10 @@ private okhttp3.Call updateTransformationValidateBeforeCall( * */ public UpdateTransformation200Response updateTransformation( - String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + String transformationId, UpdateTransformationV1Input updateTransformationV1Input) throws ApiException { ApiResponse localVarResp = - updateTransformationWithHttpInfo(transformationId, updateTransformationBetaInput); + updateTransformationWithHttpInfo(transformationId, updateTransformationV1Input); return localVarResp.getData(); } @@ -924,7 +930,7 @@ public UpdateTransformation200Response updateTransformation( * information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @return ApiResponse<UpdateTransformation200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -938,11 +944,11 @@ public UpdateTransformation200Response updateTransformation( * */ public ApiResponse updateTransformationWithHttpInfo( - String transformationId, UpdateTransformationBetaInput updateTransformationBetaInput) + String transformationId, UpdateTransformationV1Input updateTransformationV1Input) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationBetaInput, null); + transformationId, updateTransformationV1Input, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -955,7 +961,7 @@ public ApiResponse updateTransformationWithHttp * customer success manager for more information. * * @param transformationId (required) - * @param updateTransformationBetaInput (required) + * @param updateTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -971,13 +977,13 @@ public ApiResponse updateTransformationWithHttp */ public okhttp3.Call updateTransformationAsync( String transformationId, - UpdateTransformationBetaInput updateTransformationBetaInput, + UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateTransformationValidateBeforeCall( - transformationId, updateTransformationBetaInput, _callback); + transformationId, updateTransformationV1Input, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 7a69552c..09fbf5fa 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -34,11 +34,11 @@ public class CreateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private CreateTransformationBetaOutput data; + private CreateTransformationV1Output data; public CreateTransformation200Response() {} - public CreateTransformation200Response data(CreateTransformationBetaOutput data) { + public CreateTransformation200Response data(CreateTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public CreateTransformation200Response data(CreateTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public CreateTransformationBetaOutput getData() { + public CreateTransformationV1Output getData() { return data; } - public void setData(CreateTransformationBetaOutput data) { + public void setData(CreateTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java new file mode 100644 index 00000000..9cd2178c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -0,0 +1,540 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input to create a Transformation. */ +@ApiModel(description = "The input to create a Transformation.") +public class CreateTransformationV1Input { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public CreateTransformationV1Input() {} + + public CreateTransformationV1Input name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateTransformationV1Input sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public CreateTransformationV1Input destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata id to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The optional Destination metadata id to be associated with the" + + " Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public CreateTransformationV1Input enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateTransformationV1Input _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public CreateTransformationV1Input newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public CreateTransformationV1Input propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public CreateTransformationV1Input addPropertyRenamesItem( + PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public CreateTransformationV1Input propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public CreateTransformationV1Input addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationV1Input createTransformationV1Input = (CreateTransformationV1Input) o; + return Objects.equals(this.name, createTransformationV1Input.name) + && Objects.equals(this.sourceId, createTransformationV1Input.sourceId) + && Objects.equals( + this.destinationMetadataId, + createTransformationV1Input.destinationMetadataId) + && Objects.equals(this.enabled, createTransformationV1Input.enabled) + && Objects.equals(this._if, createTransformationV1Input._if) + && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) + && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + createTransformationV1Input.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateTransformationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationV1Input is not" + + " found in the empty JSON string", + CreateTransformationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateTransformationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationV1Input + * @throws IOException if the JSON string is invalid with respect to CreateTransformationV1Input + */ + public static CreateTransformationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationV1Input.class); + } + + /** + * Convert an instance of CreateTransformationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java new file mode 100644 index 00000000..a604790d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of a created Transformation. */ +@ApiModel(description = "The output of a created Transformation.") +public class CreateTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation5 transformation; + + public CreateTransformationV1Output() {} + + public CreateTransformationV1Output transformation(Transformation5 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation5 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation5 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateTransformationV1Output createTransformationV1Output = + (CreateTransformationV1Output) o; + return Objects.equals(this.transformation, createTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateTransformationV1Output is not" + + " found in the empty JSON string", + CreateTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * CreateTransformationV1Output + */ + public static CreateTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateTransformationV1Output.class); + } + + /** + * Convert an instance of CreateTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index 4fba2302..cbd4a7ab 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -34,11 +34,11 @@ public class DeleteTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private DeleteTransformationBetaOutput data; + private DeleteTransformationV1Output data; public DeleteTransformation200Response() {} - public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) { + public DeleteTransformation200Response data(DeleteTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public DeleteTransformation200Response data(DeleteTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public DeleteTransformationBetaOutput getData() { + public DeleteTransformationV1Output getData() { return data; } - public void setData(DeleteTransformationBetaOutput data) { + public void setData(DeleteTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java new file mode 100644 index 00000000..ca8b1fef --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java @@ -0,0 +1,218 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input of delete Transformation. */ +@ApiModel(description = "The input of delete Transformation.") +public class DeleteTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + + public DeleteTransformationBetaInput() {} + + public DeleteTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * The Transformation id. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Transformation id.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationBetaInput deleteTransformationBetaInput = + (DeleteTransformationBetaInput) o; + return Objects.equals( + this.transformationId, deleteTransformationBetaInput.transformationId); + } + + @Override + public int hashCode() { + return Objects.hash(transformationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformationId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationBetaInput is not" + + " found in the empty JSON string", + DeleteTransformationBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationBetaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationBetaInput + */ + public static DeleteTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationBetaInput.class); + } + + /** + * Convert an instance of DeleteTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java new file mode 100644 index 00000000..083b4b8b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java @@ -0,0 +1,261 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of delete Transformation. */ +@ApiModel(description = "The output of delete Transformation.") +public class DeleteTransformationV1Output { + /** The operation status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteTransformationV1Output() {} + + public DeleteTransformationV1Output status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The operation status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The operation status.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteTransformationV1Output deleteTransformationV1Output = + (DeleteTransformationV1Output) o; + return Objects.equals(this.status, deleteTransformationV1Output.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteTransformationV1Output {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteTransformationV1Output is not" + + " found in the empty JSON string", + DeleteTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * DeleteTransformationV1Output + */ + public static DeleteTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteTransformationV1Output.class); + } + + /** + * Convert an instance of DeleteTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java index ffce6c4c..6c681b63 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java @@ -183,6 +183,16 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) private Boolean partnerOwned; + public static final String SERIALIZED_NAME_SUPPORTED_REGIONS = "supportedRegions"; + + @SerializedName(SERIALIZED_NAME_SUPPORTED_REGIONS) + private List supportedRegions = null; + + public static final String SERIALIZED_NAME_REGION_ENDPOINTS = "regionEndpoints"; + + @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) + private List regionEndpoints = null; + public DestinationMetadata() {} public DestinationMetadata id(String id) { @@ -618,6 +628,64 @@ public void setPartnerOwned(Boolean partnerOwned) { this.partnerOwned = partnerOwned; } + public DestinationMetadata supportedRegions(List supportedRegions) { + + this.supportedRegions = supportedRegions; + return this; + } + + public DestinationMetadata addSupportedRegionsItem(String supportedRegionsItem) { + if (this.supportedRegions == null) { + this.supportedRegions = new ArrayList<>(); + } + this.supportedRegions.add(supportedRegionsItem); + return this; + } + + /** + * A list of supported regions for this Destination. + * + * @return supportedRegions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of supported regions for this Destination.") + public List getSupportedRegions() { + return supportedRegions; + } + + public void setSupportedRegions(List supportedRegions) { + this.supportedRegions = supportedRegions; + } + + public DestinationMetadata regionEndpoints(List regionEndpoints) { + + this.regionEndpoints = regionEndpoints; + return this; + } + + public DestinationMetadata addRegionEndpointsItem(String regionEndpointsItem) { + if (this.regionEndpoints == null) { + this.regionEndpoints = new ArrayList<>(); + } + this.regionEndpoints.add(regionEndpointsItem); + return this; + } + + /** + * The list of regional endpoints for this Destination. + * + * @return regionEndpoints + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of regional endpoints for this Destination.") + public List getRegionEndpoints() { + return regionEndpoints; + } + + public void setRegionEndpoints(List regionEndpoints) { + this.regionEndpoints = regionEndpoints; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -644,7 +712,9 @@ public boolean equals(Object o) { && Objects.equals(this.actions, destinationMetadata.actions) && Objects.equals(this.presets, destinationMetadata.presets) && Objects.equals(this.contacts, destinationMetadata.contacts) - && Objects.equals(this.partnerOwned, destinationMetadata.partnerOwned); + && Objects.equals(this.partnerOwned, destinationMetadata.partnerOwned) + && Objects.equals(this.supportedRegions, destinationMetadata.supportedRegions) + && Objects.equals(this.regionEndpoints, destinationMetadata.regionEndpoints); } @Override @@ -667,7 +737,9 @@ public int hashCode() { actions, presets, contacts, - partnerOwned); + partnerOwned, + supportedRegions, + regionEndpoints); } @Override @@ -696,6 +768,8 @@ public String toString() { sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); + sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); + sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); sb.append("}"); return sb.toString(); } @@ -735,6 +809,8 @@ private String toIndentedString(Object o) { openapiFields.add("presets"); openapiFields.add("contacts"); openapiFields.add("partnerOwned"); + openapiFields.add("supportedRegions"); + openapiFields.add("regionEndpoints"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -914,6 +990,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + // ensure the optional json data is an array if present + if (jsonObj.get("supportedRegions") != null + && !jsonObj.get("supportedRegions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `supportedRegions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("supportedRegions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("regionEndpoints") != null + && !jsonObj.get("regionEndpoints").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regionEndpoints` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("regionEndpoints").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index c873b90e..d46e17ac 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -189,6 +189,16 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) private Boolean partnerOwned; + public static final String SERIALIZED_NAME_SUPPORTED_REGIONS = "supportedRegions"; + + @SerializedName(SERIALIZED_NAME_SUPPORTED_REGIONS) + private List supportedRegions = null; + + public static final String SERIALIZED_NAME_REGION_ENDPOINTS = "regionEndpoints"; + + @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) + private List regionEndpoints = null; + public DestinationMetadataV1() {} public DestinationMetadataV1 id(String id) { @@ -625,6 +635,64 @@ public void setPartnerOwned(Boolean partnerOwned) { this.partnerOwned = partnerOwned; } + public DestinationMetadataV1 supportedRegions(List supportedRegions) { + + this.supportedRegions = supportedRegions; + return this; + } + + public DestinationMetadataV1 addSupportedRegionsItem(String supportedRegionsItem) { + if (this.supportedRegions == null) { + this.supportedRegions = new ArrayList<>(); + } + this.supportedRegions.add(supportedRegionsItem); + return this; + } + + /** + * A list of supported regions for this Destination. + * + * @return supportedRegions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of supported regions for this Destination.") + public List getSupportedRegions() { + return supportedRegions; + } + + public void setSupportedRegions(List supportedRegions) { + this.supportedRegions = supportedRegions; + } + + public DestinationMetadataV1 regionEndpoints(List regionEndpoints) { + + this.regionEndpoints = regionEndpoints; + return this; + } + + public DestinationMetadataV1 addRegionEndpointsItem(String regionEndpointsItem) { + if (this.regionEndpoints == null) { + this.regionEndpoints = new ArrayList<>(); + } + this.regionEndpoints.add(regionEndpointsItem); + return this; + } + + /** + * The list of regional endpoints for this Destination. + * + * @return regionEndpoints + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of regional endpoints for this Destination.") + public List getRegionEndpoints() { + return regionEndpoints; + } + + public void setRegionEndpoints(List regionEndpoints) { + this.regionEndpoints = regionEndpoints; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -651,7 +719,9 @@ public boolean equals(Object o) { && Objects.equals(this.actions, destinationMetadataV1.actions) && Objects.equals(this.presets, destinationMetadataV1.presets) && Objects.equals(this.contacts, destinationMetadataV1.contacts) - && Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned); + && Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned) + && Objects.equals(this.supportedRegions, destinationMetadataV1.supportedRegions) + && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints); } @Override @@ -674,7 +744,9 @@ public int hashCode() { actions, presets, contacts, - partnerOwned); + partnerOwned, + supportedRegions, + regionEndpoints); } @Override @@ -703,6 +775,8 @@ public String toString() { sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); + sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); + sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); sb.append("}"); return sb.toString(); } @@ -742,6 +816,8 @@ private String toIndentedString(Object o) { openapiFields.add("presets"); openapiFields.add("contacts"); openapiFields.add("partnerOwned"); + openapiFields.add("supportedRegions"); + openapiFields.add("regionEndpoints"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -921,6 +997,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + // ensure the optional json data is an array if present + if (jsonObj.get("supportedRegions") != null + && !jsonObj.get("supportedRegions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `supportedRegions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("supportedRegions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("regionEndpoints") != null + && !jsonObj.get("regionEndpoints").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regionEndpoints` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("regionEndpoints").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index 0188ba83..937d1985 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -34,11 +34,11 @@ public class GetTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetTransformationBetaOutput data; + private GetTransformationV1Output data; public GetTransformation200Response() {} - public GetTransformation200Response data(GetTransformationBetaOutput data) { + public GetTransformation200Response data(GetTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public GetTransformation200Response data(GetTransformationBetaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public GetTransformationBetaOutput getData() { + public GetTransformationV1Output getData() { return data; } - public void setData(GetTransformationBetaOutput data) { + public void setData(GetTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java new file mode 100644 index 00000000..adc11270 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input of Transformation retrieval. */ +@ApiModel(description = "The input of Transformation retrieval.") +public class GetTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + + public GetTransformationBetaInput() {} + + public GetTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * The Transformation id. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Transformation id.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationBetaInput getTransformationBetaInput = (GetTransformationBetaInput) o; + return Objects.equals(this.transformationId, getTransformationBetaInput.transformationId); + } + + @Override + public int hashCode() { + return Objects.hash(transformationId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformationId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationBetaInput is not" + + " found in the empty JSON string", + GetTransformationBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationBetaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationBetaInput + * @throws IOException if the JSON string is invalid with respect to GetTransformationBetaInput + */ + public static GetTransformationBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationBetaInput.class); + } + + /** + * Convert an instance of GetTransformationBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java new file mode 100644 index 00000000..2990e109 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of Transformation retrieval. */ +@ApiModel(description = "The output of Transformation retrieval.") +public class GetTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation3 transformation; + + public GetTransformationV1Output() {} + + public GetTransformationV1Output transformation(Transformation3 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation3 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation3 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransformationV1Output getTransformationV1Output = (GetTransformationV1Output) o; + return Objects.equals(this.transformation, getTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetTransformationV1Output is not found" + + " in the empty JSON string", + GetTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to GetTransformationV1Output + */ + public static GetTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransformationV1Output.class); + } + + /** + * Convert an instance of GetTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java index f489b14e..b9565031 100644 --- a/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListTransformations200Response.java @@ -34,11 +34,11 @@ public class ListTransformations200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListTransformationsBetaOutput data; + private ListTransformationsV1Output data; public ListTransformations200Response() {} - public ListTransformations200Response data(ListTransformationsBetaOutput data) { + public ListTransformations200Response data(ListTransformationsV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public ListTransformations200Response data(ListTransformationsBetaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ListTransformationsBetaOutput getData() { + public ListTransformationsV1Output getData() { return data; } - public void setData(ListTransformationsBetaOutput data) { + public void setData(ListTransformationsV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java new file mode 100644 index 00000000..ed21b87e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsBetaInput.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists the Transformations associated with the current Workspace. */ +@ApiModel(description = "Lists the Transformations associated with the current Workspace.") +public class ListTransformationsBetaInput { + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination1 pagination; + + public ListTransformationsBetaInput() {} + + public ListTransformationsBetaInput pagination(Pagination1 pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination1 getPagination() { + return pagination; + } + + public void setPagination(Pagination1 pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTransformationsBetaInput listTransformationsBetaInput = + (ListTransformationsBetaInput) o; + return Objects.equals(this.pagination, listTransformationsBetaInput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTransformationsBetaInput {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListTransformationsBetaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListTransformationsBetaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListTransformationsBetaInput is not" + + " found in the empty JSON string", + ListTransformationsBetaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListTransformationsBetaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListTransformationsBetaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTransformationsBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTransformationsBetaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTransformationsBetaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListTransformationsBetaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTransformationsBetaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTransformationsBetaInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListTransformationsBetaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTransformationsBetaInput + * @throws IOException if the JSON string is invalid with respect to + * ListTransformationsBetaInput + */ + public static ListTransformationsBetaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTransformationsBetaInput.class); + } + + /** + * Convert an instance of ListTransformationsBetaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java new file mode 100644 index 00000000..30346e88 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListTransformationsV1Output.java @@ -0,0 +1,254 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists the Transformations associated with the current Workspace. */ +@ApiModel(description = "Lists the Transformations associated with the current Workspace.") +public class ListTransformationsV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATIONS = "transformations"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATIONS) + private List transformations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListTransformationsV1Output() {} + + public ListTransformationsV1Output transformations(List transformations) { + + this.transformations = transformations; + return this; + } + + public ListTransformationsV1Output addTransformationsItem( + TransformationV1 transformationsItem) { + this.transformations.add(transformationsItem); + return this; + } + + /** + * A paginated list of Transformations. + * + * @return transformations + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A paginated list of Transformations.") + public List getTransformations() { + return transformations; + } + + public void setTransformations(List transformations) { + this.transformations = transformations; + } + + public ListTransformationsV1Output pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListTransformationsV1Output listTransformationsV1Output = (ListTransformationsV1Output) o; + return Objects.equals(this.transformations, listTransformationsV1Output.transformations) + && Objects.equals(this.pagination, listTransformationsV1Output.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(transformations, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListTransformationsV1Output {\n"); + sb.append(" transformations: ").append(toIndentedString(transformations)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformations"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformations"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListTransformationsV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListTransformationsV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListTransformationsV1Output is not" + + " found in the empty JSON string", + ListTransformationsV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListTransformationsV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListTransformationsV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTransformationsV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("transformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("transformations").toString())); + } + + JsonArray jsonArraytransformations = jsonObj.getAsJsonArray("transformations"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListTransformationsV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListTransformationsV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListTransformationsV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListTransformationsV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListTransformationsV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListTransformationsV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListTransformationsV1Output + * @throws IOException if the JSON string is invalid with respect to ListTransformationsV1Output + */ + public static ListTransformationsV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListTransformationsV1Output.class); + } + + /** + * Convert an instance of ListTransformationsV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Metadata.java b/src/main/java/com/segment/publicapi/models/Metadata.java index 29b47444..6bc1961b 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata.java +++ b/src/main/java/com/segment/publicapi/models/Metadata.java @@ -189,6 +189,16 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) private Boolean partnerOwned; + public static final String SERIALIZED_NAME_SUPPORTED_REGIONS = "supportedRegions"; + + @SerializedName(SERIALIZED_NAME_SUPPORTED_REGIONS) + private List supportedRegions = null; + + public static final String SERIALIZED_NAME_REGION_ENDPOINTS = "regionEndpoints"; + + @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) + private List regionEndpoints = null; + public Metadata() {} public Metadata id(String id) { @@ -624,6 +634,64 @@ public void setPartnerOwned(Boolean partnerOwned) { this.partnerOwned = partnerOwned; } + public Metadata supportedRegions(List supportedRegions) { + + this.supportedRegions = supportedRegions; + return this; + } + + public Metadata addSupportedRegionsItem(String supportedRegionsItem) { + if (this.supportedRegions == null) { + this.supportedRegions = new ArrayList<>(); + } + this.supportedRegions.add(supportedRegionsItem); + return this; + } + + /** + * A list of supported regions for this Destination. + * + * @return supportedRegions + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of supported regions for this Destination.") + public List getSupportedRegions() { + return supportedRegions; + } + + public void setSupportedRegions(List supportedRegions) { + this.supportedRegions = supportedRegions; + } + + public Metadata regionEndpoints(List regionEndpoints) { + + this.regionEndpoints = regionEndpoints; + return this; + } + + public Metadata addRegionEndpointsItem(String regionEndpointsItem) { + if (this.regionEndpoints == null) { + this.regionEndpoints = new ArrayList<>(); + } + this.regionEndpoints.add(regionEndpointsItem); + return this; + } + + /** + * The list of regional endpoints for this Destination. + * + * @return regionEndpoints + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The list of regional endpoints for this Destination.") + public List getRegionEndpoints() { + return regionEndpoints; + } + + public void setRegionEndpoints(List regionEndpoints) { + this.regionEndpoints = regionEndpoints; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -650,7 +718,9 @@ public boolean equals(Object o) { && Objects.equals(this.actions, metadata.actions) && Objects.equals(this.presets, metadata.presets) && Objects.equals(this.contacts, metadata.contacts) - && Objects.equals(this.partnerOwned, metadata.partnerOwned); + && Objects.equals(this.partnerOwned, metadata.partnerOwned) + && Objects.equals(this.supportedRegions, metadata.supportedRegions) + && Objects.equals(this.regionEndpoints, metadata.regionEndpoints); } @Override @@ -673,7 +743,9 @@ public int hashCode() { actions, presets, contacts, - partnerOwned); + partnerOwned, + supportedRegions, + regionEndpoints); } @Override @@ -702,6 +774,8 @@ public String toString() { sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); + sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); + sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); sb.append("}"); return sb.toString(); } @@ -741,6 +815,8 @@ private String toIndentedString(Object o) { openapiFields.add("presets"); openapiFields.add("contacts"); openapiFields.add("partnerOwned"); + openapiFields.add("supportedRegions"); + openapiFields.add("regionEndpoints"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -920,6 +996,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + // ensure the optional json data is an array if present + if (jsonObj.get("supportedRegions") != null + && !jsonObj.get("supportedRegions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `supportedRegions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("supportedRegions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("regionEndpoints") != null + && !jsonObj.get("regionEndpoints").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `regionEndpoints` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("regionEndpoints").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Pagination1.java b/src/main/java/com/segment/publicapi/models/Pagination1.java new file mode 100644 index 00000000..41b5f7e7 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Pagination1.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Pagination options. */ +@ApiModel(description = "Pagination options.") +public class Pagination1 { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public Pagination1() {} + + public Pagination1 cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The page to request. Acceptable values to use here are in PaginationOutput" + + " objects, in the `current`, `next`, and `previous` keys. Consumers of" + + " the API must treat this value as opaque.") + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public Pagination1 count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The number of items to retrieve in a page, between 1 and 200.") + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pagination1 pagination1 = (Pagination1) o; + return Objects.equals(this.cursor, pagination1.cursor) + && Objects.equals(this.count, pagination1.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pagination1 {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pagination1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Pagination1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Pagination1 is not found in the empty" + + " JSON string", + Pagination1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pagination1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Pagination1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pagination1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pagination1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pagination1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Pagination1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Pagination1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pagination1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Pagination1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pagination1 + * @throws IOException if the JSON string is invalid with respect to Pagination1 + */ + public static Pagination1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pagination1.class); + } + + /** + * Convert an instance of Pagination1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java new file mode 100644 index 00000000..9983bfb9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyRenameV1.java @@ -0,0 +1,246 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyRenameV1 */ +public class PropertyRenameV1 { + public static final String SERIALIZED_NAME_OLD_NAME = "oldName"; + + @SerializedName(SERIALIZED_NAME_OLD_NAME) + private String oldName; + + public static final String SERIALIZED_NAME_NEW_NAME = "newName"; + + @SerializedName(SERIALIZED_NAME_NEW_NAME) + private String newName; + + public PropertyRenameV1() {} + + public PropertyRenameV1 oldName(String oldName) { + + this.oldName = oldName; + return this; + } + + /** + * The old name of the property. + * + * @return oldName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The old name of the property.") + public String getOldName() { + return oldName; + } + + public void setOldName(String oldName) { + this.oldName = oldName; + } + + public PropertyRenameV1 newName(String newName) { + + this.newName = newName; + return this; + } + + /** + * The new name to rename the property. + * + * @return newName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new name to rename the property.") + public String getNewName() { + return newName; + } + + public void setNewName(String newName) { + this.newName = newName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyRenameV1 propertyRenameV1 = (PropertyRenameV1) o; + return Objects.equals(this.oldName, propertyRenameV1.oldName) + && Objects.equals(this.newName, propertyRenameV1.newName); + } + + @Override + public int hashCode() { + return Objects.hash(oldName, newName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyRenameV1 {\n"); + sb.append(" oldName: ").append(toIndentedString(oldName)).append("\n"); + sb.append(" newName: ").append(toIndentedString(newName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("oldName"); + openapiFields.add("newName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("oldName"); + openapiRequiredFields.add("newName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PropertyRenameV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyRenameV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyRenameV1 is not found in the" + + " empty JSON string", + PropertyRenameV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyRenameV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyRenameV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyRenameV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("oldName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `oldName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("oldName").toString())); + } + if (!jsonObj.get("newName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newName` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("newName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyRenameV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyRenameV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PropertyRenameV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyRenameV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyRenameV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyRenameV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyRenameV1 + * @throws IOException if the JSON string is invalid with respect to PropertyRenameV1 + */ + public static PropertyRenameV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyRenameV1.class); + } + + /** + * Convert an instance of PropertyRenameV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java new file mode 100644 index 00000000..d524ddaf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertyValueTransformationV1.java @@ -0,0 +1,266 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** PropertyValueTransformationV1 */ +public class PropertyValueTransformationV1 { + public static final String SERIALIZED_NAME_PROPERTY_PATHS = "propertyPaths"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_PATHS) + private List propertyPaths = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROPERTY_VALUE = "propertyValue"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE) + private String propertyValue; + + public PropertyValueTransformationV1() {} + + public PropertyValueTransformationV1 propertyPaths(List propertyPaths) { + + this.propertyPaths = propertyPaths; + return this; + } + + public PropertyValueTransformationV1 addPropertyPathsItem(String propertyPathsItem) { + this.propertyPaths.add(propertyPathsItem); + return this; + } + + /** + * The property paths. The maximum number of paths is 10. + * + * @return propertyPaths + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The property paths. The maximum number of paths is 10.") + public List getPropertyPaths() { + return propertyPaths; + } + + public void setPropertyPaths(List propertyPaths) { + this.propertyPaths = propertyPaths; + } + + public PropertyValueTransformationV1 propertyValue(String propertyValue) { + + this.propertyValue = propertyValue; + return this; + } + + /** + * The new value of the property paths. + * + * @return propertyValue + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new value of the property paths.") + public String getPropertyValue() { + return propertyValue; + } + + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertyValueTransformationV1 propertyValueTransformationV1 = + (PropertyValueTransformationV1) o; + return Objects.equals(this.propertyPaths, propertyValueTransformationV1.propertyPaths) + && Objects.equals(this.propertyValue, propertyValueTransformationV1.propertyValue); + } + + @Override + public int hashCode() { + return Objects.hash(propertyPaths, propertyValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertyValueTransformationV1 {\n"); + sb.append(" propertyPaths: ").append(toIndentedString(propertyPaths)).append("\n"); + sb.append(" propertyValue: ").append(toIndentedString(propertyValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("propertyPaths"); + openapiFields.add("propertyValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("propertyPaths"); + openapiRequiredFields.add("propertyValue"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * PropertyValueTransformationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PropertyValueTransformationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertyValueTransformationV1 is not" + + " found in the empty JSON string", + PropertyValueTransformationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PropertyValueTransformationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertyValueTransformationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertyValueTransformationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("propertyPaths") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("propertyPaths").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyPaths` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyPaths").toString())); + } + if (!jsonObj.get("propertyValue").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValue` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("propertyValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertyValueTransformationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertyValueTransformationV1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(PropertyValueTransformationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertyValueTransformationV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertyValueTransformationV1 read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertyValueTransformationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertyValueTransformationV1 + * @throws IOException if the JSON string is invalid with respect to + * PropertyValueTransformationV1 + */ + public static PropertyValueTransformationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertyValueTransformationV1.class); + } + + /** + * Convert an instance of PropertyValueTransformationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java new file mode 100644 index 00000000..d96809eb --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation3.java @@ -0,0 +1,570 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The retrieved Transformation. */ +@ApiModel(description = "The retrieved Transformation.") +public class Transformation3 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation3() {} + + public Transformation3 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation3 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation3 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation3 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation3 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation3 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation3 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation3 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation3 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation3 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation3 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation3 transformation3 = (Transformation3) o; + return Objects.equals(this.id, transformation3.id) + && Objects.equals(this.name, transformation3.name) + && Objects.equals(this.sourceId, transformation3.sourceId) + && Objects.equals(this.destinationMetadataId, transformation3.destinationMetadataId) + && Objects.equals(this.enabled, transformation3.enabled) + && Objects.equals(this._if, transformation3._if) + && Objects.equals(this.newEventName, transformation3.newEventName) + && Objects.equals(this.propertyRenames, transformation3.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation3.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation3 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation3 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation3.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation3 is not found in the" + + " empty JSON string", + Transformation3.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation3.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation3` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation3.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation3.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation3 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation3 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation3 + * @throws IOException if the JSON string is invalid with respect to Transformation3 + */ + public static Transformation3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation3.class); + } + + /** + * Convert an instance of Transformation3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java new file mode 100644 index 00000000..ec91dbe6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation4.java @@ -0,0 +1,570 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated Transformation. */ +@ApiModel(description = "The updated Transformation.") +public class Transformation4 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation4() {} + + public Transformation4 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation4 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation4 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation4 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation4 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation4 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation4 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation4 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation4 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation4 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation4 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation4 transformation4 = (Transformation4) o; + return Objects.equals(this.id, transformation4.id) + && Objects.equals(this.name, transformation4.name) + && Objects.equals(this.sourceId, transformation4.sourceId) + && Objects.equals(this.destinationMetadataId, transformation4.destinationMetadataId) + && Objects.equals(this.enabled, transformation4.enabled) + && Objects.equals(this._if, transformation4._if) + && Objects.equals(this.newEventName, transformation4.newEventName) + && Objects.equals(this.propertyRenames, transformation4.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation4.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation4 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation4 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation4.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation4 is not found in the" + + " empty JSON string", + Transformation4.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation4.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation4` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation4.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation4.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation4 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation4 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation4 + * @throws IOException if the JSON string is invalid with respect to Transformation4 + */ + public static Transformation4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation4.class); + } + + /** + * Convert an instance of Transformation4 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java new file mode 100644 index 00000000..adac93ee --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transformation5.java @@ -0,0 +1,570 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created Transformation. */ +@ApiModel(description = "The created Transformation.") +public class Transformation5 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public Transformation5() {} + + public Transformation5 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Transformation5 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Transformation5 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public Transformation5 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public Transformation5 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Transformation5 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Transformation5 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public Transformation5 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public Transformation5 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public Transformation5 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public Transformation5 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transformation5 transformation5 = (Transformation5) o; + return Objects.equals(this.id, transformation5.id) + && Objects.equals(this.name, transformation5.name) + && Objects.equals(this.sourceId, transformation5.sourceId) + && Objects.equals(this.destinationMetadataId, transformation5.destinationMetadataId) + && Objects.equals(this.enabled, transformation5.enabled) + && Objects.equals(this._if, transformation5._if) + && Objects.equals(this.newEventName, transformation5.newEventName) + && Objects.equals(this.propertyRenames, transformation5.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformation5.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transformation5 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Transformation5 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Transformation5.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transformation5 is not found in the" + + " empty JSON string", + Transformation5.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Transformation5.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transformation5` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transformation5.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transformation5.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transformation5' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transformation5.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transformation5 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transformation5 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transformation5 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transformation5 + * @throws IOException if the JSON string is invalid with respect to Transformation5 + */ + public static Transformation5 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transformation5.class); + } + + /** + * Convert an instance of Transformation5 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java new file mode 100644 index 00000000..abe887da --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -0,0 +1,571 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Represents a Transformation. */ +@ApiModel(description = "Represents a Transformation.") +public class TransformationV1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public TransformationV1() {} + + public TransformationV1 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Transformation. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Transformation.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TransformationV1 name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TransformationV1 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public TransformationV1 destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public TransformationV1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "If the Transformation is enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public TransformationV1 _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public TransformationV1 newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public TransformationV1 propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public TransformationV1 addPropertyRenamesItem(PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public TransformationV1 propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public TransformationV1 addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransformationV1 transformationV1 = (TransformationV1) o; + return Objects.equals(this.id, transformationV1.id) + && Objects.equals(this.name, transformationV1.name) + && Objects.equals(this.sourceId, transformationV1.sourceId) + && Objects.equals( + this.destinationMetadataId, transformationV1.destinationMetadataId) + && Objects.equals(this.enabled, transformationV1.enabled) + && Objects.equals(this._if, transformationV1._if) + && Objects.equals(this.newEventName, transformationV1.newEventName) + && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + transformationV1.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransformationV1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransformationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransformationV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TransformationV1 is not found in the" + + " empty JSON string", + TransformationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransformationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TransformationV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransformationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransformationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransformationV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TransformationV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TransformationV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransformationV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TransformationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransformationV1 + * @throws IOException if the JSON string is invalid with respect to TransformationV1 + */ + public static TransformationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransformationV1.class); + } + + /** + * Convert an instance of TransformationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java index 622e0b49..d92501c0 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformation200Response.java @@ -34,11 +34,11 @@ public class UpdateTransformation200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private UpdateTransformationBetaOutput data; + private UpdateTransformationV1Output data; public UpdateTransformation200Response() {} - public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) { + public UpdateTransformation200Response data(UpdateTransformationV1Output data) { this.data = data; return this; @@ -51,11 +51,11 @@ public UpdateTransformation200Response data(UpdateTransformationBetaOutput data) */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public UpdateTransformationBetaOutput getData() { + public UpdateTransformationV1Output getData() { return data; } - public void setData(UpdateTransformationBetaOutput data) { + public void setData(UpdateTransformationV1Output data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java index 5a90bdea..6ec8c308 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationBetaInput.java @@ -36,6 +36,11 @@ /** The input to update a Transformation. */ @ApiModel(description = "The input to update a Transformation.") public class UpdateTransformationBetaInput { + public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION_ID) + private String transformationId; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -79,6 +84,27 @@ public class UpdateTransformationBetaInput { public UpdateTransformationBetaInput() {} + public UpdateTransformationBetaInput transformationId(String transformationId) { + + this.transformationId = transformationId; + return this; + } + + /** + * ID of the Transformation to update. + * + * @return transformationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "ID of the Transformation to update.") + public String getTransformationId() { + return transformationId; + } + + public void setTransformationId(String transformationId) { + this.transformationId = transformationId; + } + public UpdateTransformationBetaInput name(String name) { this.name = name; @@ -294,7 +320,8 @@ public boolean equals(Object o) { } UpdateTransformationBetaInput updateTransformationBetaInput = (UpdateTransformationBetaInput) o; - return Objects.equals(this.name, updateTransformationBetaInput.name) + return Objects.equals(this.transformationId, updateTransformationBetaInput.transformationId) + && Objects.equals(this.name, updateTransformationBetaInput.name) && Objects.equals(this.sourceId, updateTransformationBetaInput.sourceId) && Objects.equals( this.destinationMetadataId, @@ -312,6 +339,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + transformationId, name, sourceId, destinationMetadataId, @@ -326,6 +354,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateTransformationBetaInput {\n"); + sb.append(" transformationId: ").append(toIndentedString(transformationId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" destinationMetadataId: ") @@ -359,6 +388,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("transformationId"); openapiFields.add("name"); openapiFields.add("sourceId"); openapiFields.add("destinationMetadataId"); @@ -370,6 +400,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformationId"); } /** @@ -402,6 +433,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateTransformationBetaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transformationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transformationId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transformationId").toString())); + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java new file mode 100644 index 00000000..716d22b5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -0,0 +1,524 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The input to update a Transformation. */ +@ApiModel(description = "The input to update a Transformation.") +public class UpdateTransformationV1Input { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) + private String destinationMetadataId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; + + @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) + private String newEventName; + + public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) + private List propertyRenames = null; + + public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = + "propertyValueTransformations"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) + private List propertyValueTransformations = null; + + public UpdateTransformationV1Input() {} + + public UpdateTransformationV1Input name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the Transformation. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Transformation.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateTransformationV1Input sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The optional Source to be associated with the Transformation. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The optional Source to be associated with the Transformation.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public UpdateTransformationV1Input destinationMetadataId(String destinationMetadataId) { + + this.destinationMetadataId = destinationMetadataId; + return this; + } + + /** + * The optional Destination metadata to be associated with the Transformation. + * + * @return destinationMetadataId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The optional Destination metadata to be associated with the Transformation.") + public String getDestinationMetadataId() { + return destinationMetadataId; + } + + public void setDestinationMetadataId(String destinationMetadataId) { + this.destinationMetadataId = destinationMetadataId; + } + + public UpdateTransformationV1Input enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * If the Transformation should be enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "If the Transformation should be enabled.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateTransformationV1Input _if(String _if) { + + this._if = _if; + return this; + } + + /** + * If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match events. For standard + * event matchers, use the following: Track -\\> + * \"event='\\<eventName\\>'\" Identify -\\> + * \"type='identify'\" Group -\\> + * \"type='group'\" + * + * @return _if + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" + + " events. For standard event matchers, use the following: Track -\\>" + + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" + + " -\\> \"type='group'\"") + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public UpdateTransformationV1Input newEventName(String newEventName) { + + this.newEventName = newEventName; + return this; + } + + /** + * Optional new event name for renaming events. Works only for 'track' event type. + * + * @return newEventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional new event name for renaming events. Works only for 'track' event" + + " type.") + public String getNewEventName() { + return newEventName; + } + + public void setNewEventName(String newEventName) { + this.newEventName = newEventName; + } + + public UpdateTransformationV1Input propertyRenames(List propertyRenames) { + + this.propertyRenames = propertyRenames; + return this; + } + + public UpdateTransformationV1Input addPropertyRenamesItem( + PropertyRenameV1 propertyRenamesItem) { + if (this.propertyRenames == null) { + this.propertyRenames = new ArrayList<>(); + } + this.propertyRenames.add(propertyRenamesItem); + return this; + } + + /** + * Optional array for renaming properties collected by your events. + * + * @return propertyRenames + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") + public List getPropertyRenames() { + return propertyRenames; + } + + public void setPropertyRenames(List propertyRenames) { + this.propertyRenames = propertyRenames; + } + + public UpdateTransformationV1Input propertyValueTransformations( + List propertyValueTransformations) { + + this.propertyValueTransformations = propertyValueTransformations; + return this; + } + + public UpdateTransformationV1Input addPropertyValueTransformationsItem( + PropertyValueTransformationV1 propertyValueTransformationsItem) { + if (this.propertyValueTransformations == null) { + this.propertyValueTransformations = new ArrayList<>(); + } + this.propertyValueTransformations.add(propertyValueTransformationsItem); + return this; + } + + /** + * Optional array for transforming properties and values collected by your events. Limited to 10 + * properties. + * + * @return propertyValueTransformations + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for transforming properties and values collected by your" + + " events. Limited to 10 properties.") + public List getPropertyValueTransformations() { + return propertyValueTransformations; + } + + public void setPropertyValueTransformations( + List propertyValueTransformations) { + this.propertyValueTransformations = propertyValueTransformations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTransformationV1Input updateTransformationV1Input = (UpdateTransformationV1Input) o; + return Objects.equals(this.name, updateTransformationV1Input.name) + && Objects.equals(this.sourceId, updateTransformationV1Input.sourceId) + && Objects.equals( + this.destinationMetadataId, + updateTransformationV1Input.destinationMetadataId) + && Objects.equals(this.enabled, updateTransformationV1Input.enabled) + && Objects.equals(this._if, updateTransformationV1Input._if) + && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) + && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) + && Objects.equals( + this.propertyValueTransformations, + updateTransformationV1Input.propertyValueTransformations); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + sourceId, + destinationMetadataId, + enabled, + _if, + newEventName, + propertyRenames, + propertyValueTransformations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTransformationV1Input {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" destinationMetadataId: ") + .append(toIndentedString(destinationMetadataId)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); + sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); + sb.append(" propertyValueTransformations: ") + .append(toIndentedString(propertyValueTransformations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("sourceId"); + openapiFields.add("destinationMetadataId"); + openapiFields.add("enabled"); + openapiFields.add("if"); + openapiFields.add("newEventName"); + openapiFields.add("propertyRenames"); + openapiFields.add("propertyValueTransformations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateTransformationV1Input + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateTransformationV1Input.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateTransformationV1Input is not" + + " found in the empty JSON string", + UpdateTransformationV1Input.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateTransformationV1Input.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTransformationV1Input` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if ((jsonObj.get("destinationMetadataId") != null + && !jsonObj.get("destinationMetadataId").isJsonNull()) + && !jsonObj.get("destinationMetadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationMetadataId` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("destinationMetadataId").toString())); + } + if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) + && !jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + if ((jsonObj.get("newEventName") != null && !jsonObj.get("newEventName").isJsonNull()) + && !jsonObj.get("newEventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newEventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("newEventName").toString())); + } + if (jsonObj.get("propertyRenames") != null + && !jsonObj.get("propertyRenames").isJsonNull()) { + JsonArray jsonArraypropertyRenames = jsonObj.getAsJsonArray("propertyRenames"); + if (jsonArraypropertyRenames != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyRenames").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyRenames` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("propertyRenames").toString())); + } + } + } + if (jsonObj.get("propertyValueTransformations") != null + && !jsonObj.get("propertyValueTransformations").isJsonNull()) { + JsonArray jsonArraypropertyValueTransformations = + jsonObj.getAsJsonArray("propertyValueTransformations"); + if (jsonArraypropertyValueTransformations != null) { + // ensure the json data is an array + if (!jsonObj.get("propertyValueTransformations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyValueTransformations` to be an" + + " array in the JSON string but got `%s`", + jsonObj.get("propertyValueTransformations").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTransformationV1Input.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTransformationV1Input' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateTransformationV1Input.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTransformationV1Input value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTransformationV1Input read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTransformationV1Input given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTransformationV1Input + * @throws IOException if the JSON string is invalid with respect to UpdateTransformationV1Input + */ + public static UpdateTransformationV1Input fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Input.class); + } + + /** + * Convert an instance of UpdateTransformationV1Input to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java new file mode 100644 index 00000000..a1e5193a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Output.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The output of an updated Transformation. */ +@ApiModel(description = "The output of an updated Transformation.") +public class UpdateTransformationV1Output { + public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; + + @SerializedName(SERIALIZED_NAME_TRANSFORMATION) + private Transformation4 transformation; + + public UpdateTransformationV1Output() {} + + public UpdateTransformationV1Output transformation(Transformation4 transformation) { + + this.transformation = transformation; + return this; + } + + /** + * Get transformation + * + * @return transformation + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Transformation4 getTransformation() { + return transformation; + } + + public void setTransformation(Transformation4 transformation) { + this.transformation = transformation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateTransformationV1Output updateTransformationV1Output = + (UpdateTransformationV1Output) o; + return Objects.equals(this.transformation, updateTransformationV1Output.transformation); + } + + @Override + public int hashCode() { + return Objects.hash(transformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateTransformationV1Output {\n"); + sb.append(" transformation: ").append(toIndentedString(transformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transformation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateTransformationV1Output + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateTransformationV1Output.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateTransformationV1Output is not" + + " found in the empty JSON string", + UpdateTransformationV1Output.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateTransformationV1Output.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateTransformationV1Output` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateTransformationV1Output.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateTransformationV1Output.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateTransformationV1Output' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateTransformationV1Output.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateTransformationV1Output value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateTransformationV1Output read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateTransformationV1Output given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateTransformationV1Output + * @throws IOException if the JSON string is invalid with respect to + * UpdateTransformationV1Output + */ + public static UpdateTransformationV1Output fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateTransformationV1Output.class); + } + + /** + * Convert an instance of UpdateTransformationV1Output to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 13931dbf76c883a7cddb249902ceb33ff552819c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 9 Dec 2022 20:40:20 +0000 Subject: [PATCH 022/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@14b11ab. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ecba2aa..f97109e3 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ public class Example { token.setBearerToken(""); ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); - String period = "period_example"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in v1. + String period = "2021-02-01"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in v1. PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. // Make an API call without Pagination From 886747d04d22b21569466a28322327485700bf5d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 9 Dec 2022 20:54:20 +0000 Subject: [PATCH 023/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6ff7460. From e1090236475d449f5b805632228e32be6876cb30 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 9 Dec 2022 21:18:58 +0000 Subject: [PATCH 024/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@93368c1. From 28628183396bcb8bcfd928b05d7820f8b75d1358 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 9 Dec 2022 21:57:37 +0000 Subject: [PATCH 025/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c1a5bcc. From 4e287a8d64ce6b00775c1e6be3a9be331b701710 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 4 Jan 2023 16:57:36 +0000 Subject: [PATCH 026/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9973951. --- README.md | 2 +- .../models/AddLabelsToSourceV1Input.java | 39 ++++++++++-------- .../AddPermissionsToUserGroupV1Input.java | 39 ++++++++++-------- .../models/AddPermissionsToUserV1Input.java | 39 ++++++++++-------- .../AddSourceToTrackingPlanV1Input.java | 17 ++++++-- .../models/AddUsersToUserGroupV1Input.java | 30 ++++++++++---- .../CreateCloudSourceRegulationV1Input.java | 27 +++++++----- .../CreateFilterForDestinationV1Input.java | 16 ++++---- .../models/CreateSourceRegulationV1Input.java | 25 ++++++----- ...vancedSyncScheduleForWarehouseV1Input.java | 18 +++++++- .../models/ReplaceLabelsInSourceV1Input.java | 39 ++++++++++-------- ...ReplacePermissionsForUserGroupV1Input.java | 39 ++++++++++-------- .../ReplacePermissionsForUserV1Input.java | 39 ++++++++++-------- .../ReplaceRulesInTrackingPlanV1Input.java | 39 ++++++++++-------- .../ReplaceUsersInUserGroupV1Input.java | 30 ++++++++++---- .../UpdateRulesInTrackingPlanV1Input.java | 39 ++++++++++-------- ...pdateSelectiveSyncForWarehouseV1Input.java | 41 +++++++++++-------- .../models/UpdateUserGroupV1Input.java | 18 ++++++-- .../models/UpdateWarehouseV1Input.java | 12 ++++++ 19 files changed, 339 insertions(+), 209 deletions(-) diff --git a/README.md b/README.md index f97109e3..51ce7848 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Segment Public API Java SDK -> :warning: **Note**: This SDK is currently released as [Public Beta](https://segment.com/legal/first-access-beta-preview/). Its use in critical systems is discouraged, but [feedback is welcome](#contributing). +:warning: This SDK is currently released as [Public Beta](https://segment.com/legal/first-access-beta-preview/). Its use in critical systems is discouraged, but [feedback is welcome](#contributing). ## Overview diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index c9797897..f703ed61 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -39,7 +39,7 @@ public class AddLabelsToSourceV1Input { public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = null; + private List labels = new ArrayList<>(); public AddLabelsToSourceV1Input() {} @@ -50,9 +50,6 @@ public AddLabelsToSourceV1Input labels(List labels) { } public AddLabelsToSourceV1Input addLabelsItem(LabelV1 labelsItem) { - if (this.labels == null) { - this.labels = new ArrayList<>(); - } this.labels.add(labelsItem); return this; } @@ -62,8 +59,8 @@ public AddLabelsToSourceV1Input addLabelsItem(LabelV1 labelsItem) { * * @return labels */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The labels to associate with a Source.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The labels to associate with a Source.") public List getLabels() { return labels; } @@ -119,6 +116,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("labels"); } /** @@ -150,19 +148,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - if (jsonArraylabels != null) { - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `labels` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("labels").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddLabelsToSourceV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("labels").toString())); + } + + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index 65c45470..fdac5947 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -39,7 +39,7 @@ public class AddPermissionsToUserGroupV1Input { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; + private List permissions = new ArrayList<>(); public AddPermissionsToUserGroupV1Input() {} @@ -50,9 +50,6 @@ public AddPermissionsToUserGroupV1Input permissions(List perm } public AddPermissionsToUserGroupV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } this.permissions.add(permissionsItem); return this; } @@ -62,8 +59,8 @@ public AddPermissionsToUserGroupV1Input addPermissionsItem(PermissionInputV1 per * * @return permissions */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to add.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The permissions to add.") public List getPermissions() { return permissions; } @@ -120,6 +117,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissions"); } /** @@ -152,19 +150,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `permissions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("permissions").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPermissionsToUserGroupV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("permissions").toString())); + } + + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index f05fdea4..63b3cb63 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -39,7 +39,7 @@ public class AddPermissionsToUserV1Input { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; + private List permissions = new ArrayList<>(); public AddPermissionsToUserV1Input() {} @@ -50,9 +50,6 @@ public AddPermissionsToUserV1Input permissions(List permissio } public AddPermissionsToUserV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } this.permissions.add(permissionsItem); return this; } @@ -62,8 +59,8 @@ public AddPermissionsToUserV1Input addPermissionsItem(PermissionInputV1 permissi * * @return permissions */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to add.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The permissions to add.") public List getPermissions() { return permissions; } @@ -119,6 +116,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissions"); } /** @@ -150,19 +148,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `permissions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("permissions").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPermissionsToUserV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("permissions").toString())); + } + + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index a7d972b4..796f4c16 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -52,8 +52,9 @@ public AddSourceToTrackingPlanV1Input sourceId(String sourceId) { * * @return sourceId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull @ApiModelProperty( + required = true, value = "The id of the Source associated with the Tracking Plan. Config API note:" + " analogous to `sourceName`.") @@ -113,6 +114,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); } /** @@ -145,8 +147,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) - && !jsonObj.get("sourceId").isJsonPrimitive()) { + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddSourceToTrackingPlanV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `sourceId` to be a primitive type in the JSON" diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index b5ac724d..44f875d0 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -38,7 +38,7 @@ public class AddUsersToUserGroupV1Input { public static final String SERIALIZED_NAME_EMAILS = "emails"; @SerializedName(SERIALIZED_NAME_EMAILS) - private List emails = null; + private List emails = new ArrayList<>(); public AddUsersToUserGroupV1Input() {} @@ -49,9 +49,6 @@ public AddUsersToUserGroupV1Input emails(List emails) { } public AddUsersToUserGroupV1Input addEmailsItem(String emailsItem) { - if (this.emails == null) { - this.emails = new ArrayList<>(); - } this.emails.add(emailsItem); return this; } @@ -61,8 +58,10 @@ public AddUsersToUserGroupV1Input addEmailsItem(String emailsItem) { * * @return emails */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses of the users and invites to add.") + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The email addresses of the users and invites to add.") public List getEmails() { return emails; } @@ -118,6 +117,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emails"); } /** @@ -149,8 +149,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - // ensure the optional json data is an array if present - if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonArray()) { + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddUsersToUserGroupV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("emails") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("emails").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `emails` to be an array in the JSON string but got" diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 3953116d..6b77eba9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -145,7 +145,7 @@ public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) - private List subjectIds = null; + private List subjectIds = new ArrayList<>(); public static final String SERIALIZED_NAME_COLLECTION = "collection"; @@ -186,8 +186,10 @@ public CreateCloudSourceRegulationV1Input subjectType(SubjectTypeEnum subjectTyp * * @return subjectType */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The subject type. Must be `objectId` for Cloud Sources.") + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The subject type. Must be `objectId` for Cloud Sources.") public SubjectTypeEnum getSubjectType() { return subjectType; } @@ -203,9 +205,6 @@ public CreateCloudSourceRegulationV1Input subjectIds(List subjectIds) { } public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { - if (this.subjectIds == null) { - this.subjectIds = new ArrayList<>(); - } this.subjectIds.add(subjectIdsItem); return this; } @@ -216,8 +215,9 @@ public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsIte * * @return subjectIds */ - @javax.annotation.Nullable + @javax.annotation.Nonnull @ApiModelProperty( + required = true, value = "The user or object ids of the subjects to regulate. Config API note: equal to" + " `parent` but allows an array.") @@ -309,6 +309,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("regulationType"); + openapiRequiredFields.add("subjectType"); + openapiRequiredFields.add("subjectIds"); openapiRequiredFields.add("collection"); } @@ -360,16 +362,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("regulationType").toString())); } - if ((jsonObj.get("subjectType") != null && !jsonObj.get("subjectType").isJsonNull()) - && !jsonObj.get("subjectType").isJsonPrimitive()) { + if (!jsonObj.get("subjectType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `subjectType` to be a primitive type in the JSON" + " string but got `%s`", jsonObj.get("subjectType").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("subjectIds") != null && !jsonObj.get("subjectIds").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("subjectIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("subjectIds").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `subjectIds` to be an array in the JSON string but" diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index 9bf68b50..aed74fe5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -79,8 +79,8 @@ public CreateFilterForDestinationV1Input sourceId(String sourceId) { * * @return sourceId */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Source associated with this filter.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") public String getSourceId() { return sourceId; } @@ -147,8 +147,8 @@ public CreateFilterForDestinationV1Input title(String title) { * * @return title */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The title of the filter.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The title of the filter.") public String getTitle() { return title; } @@ -264,8 +264,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); openapiRequiredFields.add("if"); openapiRequiredFields.add("actions"); + openapiRequiredFields.add("title"); openapiRequiredFields.add("enabled"); } @@ -310,8 +312,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) - && !jsonObj.get("sourceId").isJsonPrimitive()) { + if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `sourceId` to be a primitive type in the JSON" @@ -335,8 +336,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) - && !jsonObj.get("title").isJsonPrimitive()) { + if (!jsonObj.get("title").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `title` to be a primitive type in the JSON string" diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 83460e0d..2ba3e483 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -145,7 +145,7 @@ public SubjectTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SUBJECT_IDS = "subjectIds"; @SerializedName(SERIALIZED_NAME_SUBJECT_IDS) - private List subjectIds = null; + private List subjectIds = new ArrayList<>(); public CreateSourceRegulationV1Input() {} @@ -181,8 +181,8 @@ public CreateSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { * * @return subjectType */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The subject type.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The subject type.") public SubjectTypeEnum getSubjectType() { return subjectType; } @@ -198,9 +198,6 @@ public CreateSourceRegulationV1Input subjectIds(List subjectIds) { } public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { - if (this.subjectIds == null) { - this.subjectIds = new ArrayList<>(); - } this.subjectIds.add(subjectIdsItem); return this; } @@ -211,8 +208,9 @@ public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { * * @return subjectIds */ - @javax.annotation.Nullable + @javax.annotation.Nonnull @ApiModelProperty( + required = true, value = "The user or object ids of the subjects to regulate. Config API note: equal to" + " `parent` but allows an array.") @@ -279,6 +277,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("regulationType"); + openapiRequiredFields.add("subjectType"); + openapiRequiredFields.add("subjectIds"); } /** @@ -328,16 +328,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("regulationType").toString())); } - if ((jsonObj.get("subjectType") != null && !jsonObj.get("subjectType").isJsonNull()) - && !jsonObj.get("subjectType").isJsonPrimitive()) { + if (!jsonObj.get("subjectType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `subjectType` to be a primitive type in the JSON" + " string but got `%s`", jsonObj.get("subjectType").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("subjectIds") != null && !jsonObj.get("subjectIds").isJsonArray()) { + // ensure the required json array is present + if (jsonObj.get("subjectIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("subjectIds").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `subjectIds` to be an array in the JSON string but" diff --git a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java index fa8adf0a..8f15ee1f 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceAdvancedSyncScheduleForWarehouseV1Input.java @@ -56,8 +56,10 @@ public ReplaceAdvancedSyncScheduleForWarehouseV1Input enabled(Boolean enabled) { * * @return enabled */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to turn on an advanced sync schedule for the Warehouse.") + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Enable to turn on an advanced sync schedule for the Warehouse.") public Boolean getEnabled() { return enabled; } @@ -140,6 +142,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); } /** @@ -176,6 +179,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + ReplaceAdvancedSyncScheduleForWarehouseV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java index 03a24f1b..d3187998 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceLabelsInSourceV1Input.java @@ -39,7 +39,7 @@ public class ReplaceLabelsInSourceV1Input { public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = null; + private List labels = new ArrayList<>(); public ReplaceLabelsInSourceV1Input() {} @@ -50,9 +50,6 @@ public ReplaceLabelsInSourceV1Input labels(List labels) { } public ReplaceLabelsInSourceV1Input addLabelsItem(LabelV1 labelsItem) { - if (this.labels == null) { - this.labels = new ArrayList<>(); - } this.labels.add(labelsItem); return this; } @@ -62,8 +59,8 @@ public ReplaceLabelsInSourceV1Input addLabelsItem(LabelV1 labelsItem) { * * @return labels */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of labels to replace in the Source.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The list of labels to replace in the Source.") public List getLabels() { return labels; } @@ -120,6 +117,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("labels"); } /** @@ -152,19 +150,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - if (jsonArraylabels != null) { - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `labels` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("labels").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReplaceLabelsInSourceV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("labels").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `labels` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("labels").toString())); + } + + JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java index 3dcc3aec..e05b642b 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserGroupV1Input.java @@ -39,7 +39,7 @@ public class ReplacePermissionsForUserGroupV1Input { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; + private List permissions = new ArrayList<>(); public ReplacePermissionsForUserGroupV1Input() {} @@ -51,9 +51,6 @@ public ReplacePermissionsForUserGroupV1Input permissions(List public ReplacePermissionsForUserGroupV1Input addPermissionsItem( PermissionInputV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } this.permissions.add(permissionsItem); return this; } @@ -63,8 +60,8 @@ public ReplacePermissionsForUserGroupV1Input addPermissionsItem( * * @return permissions */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to replace with.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The permissions to replace with.") public List getPermissions() { return permissions; } @@ -121,6 +118,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissions"); } /** @@ -155,19 +153,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `permissions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("permissions").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReplacePermissionsForUserGroupV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("permissions").toString())); + } + + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java index eeb793a9..6e281957 100644 --- a/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplacePermissionsForUserV1Input.java @@ -39,7 +39,7 @@ public class ReplacePermissionsForUserV1Input { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; + private List permissions = new ArrayList<>(); public ReplacePermissionsForUserV1Input() {} @@ -50,9 +50,6 @@ public ReplacePermissionsForUserV1Input permissions(List perm } public ReplacePermissionsForUserV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { - if (this.permissions == null) { - this.permissions = new ArrayList<>(); - } this.permissions.add(permissionsItem); return this; } @@ -62,8 +59,8 @@ public ReplacePermissionsForUserV1Input addPermissionsItem(PermissionInputV1 per * * @return permissions */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to add.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The permissions to add.") public List getPermissions() { return permissions; } @@ -120,6 +117,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("permissions"); } /** @@ -152,19 +150,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("permissions") != null && !jsonObj.get("permissions").isJsonNull()) { - JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); - if (jsonArraypermissions != null) { - // ensure the json data is an array - if (!jsonObj.get("permissions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `permissions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("permissions").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReplacePermissionsForUserV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("permissions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `permissions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("permissions").toString())); + } + + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java index 489c11aa..bb09a9dd 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java @@ -39,7 +39,7 @@ public class ReplaceRulesInTrackingPlanV1Input { public static final String SERIALIZED_NAME_RULES = "rules"; @SerializedName(SERIALIZED_NAME_RULES) - private List rules = null; + private List rules = new ArrayList<>(); public ReplaceRulesInTrackingPlanV1Input() {} @@ -50,9 +50,6 @@ public ReplaceRulesInTrackingPlanV1Input rules(List rules) { } public ReplaceRulesInTrackingPlanV1Input addRulesItem(RuleV1 rulesItem) { - if (this.rules == null) { - this.rules = new ArrayList<>(); - } this.rules.add(rulesItem); return this; } @@ -62,8 +59,8 @@ public ReplaceRulesInTrackingPlanV1Input addRulesItem(RuleV1 rulesItem) { * * @return rules */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Rules to replace.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Rules to replace.") public List getRules() { return rules; } @@ -120,6 +117,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rules"); } /** @@ -153,19 +151,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { - JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); - if (jsonArrayrules != null) { - // ensure the json data is an array - if (!jsonObj.get("rules").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rules` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("rules").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReplaceRulesInTrackingPlanV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rules` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("rules").toString())); + } + + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java index 90687b57..bd822c90 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceUsersInUserGroupV1Input.java @@ -38,7 +38,7 @@ public class ReplaceUsersInUserGroupV1Input { public static final String SERIALIZED_NAME_EMAILS = "emails"; @SerializedName(SERIALIZED_NAME_EMAILS) - private List emails = null; + private List emails = new ArrayList<>(); public ReplaceUsersInUserGroupV1Input() {} @@ -49,9 +49,6 @@ public ReplaceUsersInUserGroupV1Input emails(List emails) { } public ReplaceUsersInUserGroupV1Input addEmailsItem(String emailsItem) { - if (this.emails == null) { - this.emails = new ArrayList<>(); - } this.emails.add(emailsItem); return this; } @@ -61,8 +58,10 @@ public ReplaceUsersInUserGroupV1Input addEmailsItem(String emailsItem) { * * @return emails */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses of the users and invites to replace.") + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The email addresses of the users and invites to replace.") public List getEmails() { return emails; } @@ -119,6 +118,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emails"); } /** @@ -151,8 +151,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - // ensure the optional json data is an array if present - if (jsonObj.get("emails") != null && !jsonObj.get("emails").isJsonArray()) { + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReplaceUsersInUserGroupV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("emails") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("emails").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `emails` to be an array in the JSON string but got" diff --git a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java index 901d912a..60ca2787 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateRulesInTrackingPlanV1Input.java @@ -39,7 +39,7 @@ public class UpdateRulesInTrackingPlanV1Input { public static final String SERIALIZED_NAME_RULES = "rules"; @SerializedName(SERIALIZED_NAME_RULES) - private List rules = null; + private List rules = new ArrayList<>(); public UpdateRulesInTrackingPlanV1Input() {} @@ -50,9 +50,6 @@ public UpdateRulesInTrackingPlanV1Input rules(List rules) { } public UpdateRulesInTrackingPlanV1Input addRulesItem(UpsertRuleV1 rulesItem) { - if (this.rules == null) { - this.rules = new ArrayList<>(); - } this.rules.add(rulesItem); return this; } @@ -62,8 +59,8 @@ public UpdateRulesInTrackingPlanV1Input addRulesItem(UpsertRuleV1 rulesItem) { * * @return rules */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Rules to update or insert.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Rules to update or insert.") public List getRules() { return rules; } @@ -120,6 +117,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rules"); } /** @@ -152,19 +150,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { - JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); - if (jsonArrayrules != null) { - // ensure the json data is an array - if (!jsonObj.get("rules").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rules` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("rules").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateRulesInTrackingPlanV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rules` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("rules").toString())); + } + + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java index 378802f4..6ec343d4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseV1Input.java @@ -39,7 +39,7 @@ public class UpdateSelectiveSyncForWarehouseV1Input { public static final String SERIALIZED_NAME_SYNC_OVERRIDES = "syncOverrides"; @SerializedName(SERIALIZED_NAME_SYNC_OVERRIDES) - private List syncOverrides = null; + private List syncOverrides = new ArrayList<>(); public UpdateSelectiveSyncForWarehouseV1Input() {} @@ -52,9 +52,6 @@ public UpdateSelectiveSyncForWarehouseV1Input syncOverrides( public UpdateSelectiveSyncForWarehouseV1Input addSyncOverridesItem( WarehouseSyncOverrideV1 syncOverridesItem) { - if (this.syncOverrides == null) { - this.syncOverrides = new ArrayList<>(); - } this.syncOverrides.add(syncOverridesItem); return this; } @@ -64,8 +61,10 @@ public UpdateSelectiveSyncForWarehouseV1Input addSyncOverridesItem( * * @return syncOverrides */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of sync schema overrides to apply to this Warehouse.") + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A list of sync schema overrides to apply to this Warehouse.") public List getSyncOverrides() { return syncOverrides; } @@ -123,6 +122,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("syncOverrides"); } /** @@ -157,19 +157,26 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if (jsonObj.get("syncOverrides") != null && !jsonObj.get("syncOverrides").isJsonNull()) { - JsonArray jsonArraysyncOverrides = jsonObj.getAsJsonArray("syncOverrides"); - if (jsonArraysyncOverrides != null) { - // ensure the json data is an array - if (!jsonObj.get("syncOverrides").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `syncOverrides` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("syncOverrides").toString())); - } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSelectiveSyncForWarehouseV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); } } + // ensure the json data is an array + if (!jsonObj.get("syncOverrides").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `syncOverrides` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("syncOverrides").toString())); + } + + JsonArray jsonArraysyncOverrides = jsonObj.getAsJsonArray("syncOverrides"); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java index 375d8a90..cbc8572e 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateUserGroupV1Input.java @@ -51,8 +51,8 @@ public UpdateUserGroupV1Input name(String name) { * * @return name */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The intended value to rename the user group to.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The intended value to rename the user group to.") public String getName() { return name; } @@ -108,6 +108,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); } /** @@ -139,8 +140,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateUserGroupV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `name` to be a primitive type in the JSON string" diff --git a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java index 8a7f58d8..9cbb126b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateWarehouseV1Input.java @@ -112,6 +112,7 @@ public UpdateWarehouseV1Input settings(Map settings) { */ @javax.annotation.Nullable @ApiModelProperty( + required = true, value = "A key-value object that contains instance-specific settings for a Warehouse. " + " Different kinds of Warehouses require different settings. The required" @@ -196,6 +197,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settings"); } /** @@ -227,6 +229,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateWarehouseV1Input.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( From 780146a8ca53161833d8c14005e483c2618c55eb Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 4 Jan 2023 17:20:07 +0000 Subject: [PATCH 027/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c13c814. From 7010b50a584ede30fe4ac087365ff114f3cf818a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 9 Jan 2023 23:40:23 +0000 Subject: [PATCH 028/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@71c46f8. --- .../segment/publicapi/api/AuditTrailApi.java | 30 +++++----- .../api/DeletionAndSuppressionApi.java | 56 +++++++++---------- .../publicapi/api/TrackingPlansApi.java | 26 ++++----- 3 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index eee8b577..2ae48890 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -67,7 +67,6 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for listAuditEvents * - * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param startTime Filter response to events that happened after this time. This parameter * exists in v1. (optional) * @param endTime Filter response to events that happened before this time. Defaults to the @@ -77,6 +76,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * single Source. This parameter exists in v1. (optional) * @param resourceType Filter response to events that affect a specific type, for example, * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -90,11 +90,11 @@ public void setCustomBaseUrl(String customBaseUrl) { * */ public okhttp3.Call listAuditEventsCall( - PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -178,11 +178,11 @@ public okhttp3.Call listAuditEventsCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAuditEventsValidateBeforeCall( - PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { @@ -195,14 +195,13 @@ private okhttp3.Call listAuditEventsValidateBeforeCall( okhttp3.Call localVarCall = listAuditEventsCall( - pagination, startTime, endTime, resourceId, resourceType, _callback); + startTime, endTime, resourceId, resourceType, pagination, _callback); return localVarCall; } /** * List Audit Events Returns a list of Audit Trail events. * - * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param startTime Filter response to events that happened after this time. This parameter * exists in v1. (optional) * @param endTime Filter response to events that happened before this time. Defaults to the @@ -212,6 +211,7 @@ private okhttp3.Call listAuditEventsValidateBeforeCall( * single Source. This parameter exists in v1. (optional) * @param resourceType Filter response to events that affect a specific type, for example, * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ListAuditEvents200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -225,22 +225,21 @@ private okhttp3.Call listAuditEventsValidateBeforeCall( * */ public ListAuditEvents200Response listAuditEvents( - PaginationInput pagination, String startTime, String endTime, String resourceId, - String resourceType) + String resourceType, + PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listAuditEventsWithHttpInfo( - pagination, startTime, endTime, resourceId, resourceType); + startTime, endTime, resourceId, resourceType, pagination); return localVarResp.getData(); } /** * List Audit Events Returns a list of Audit Trail events. * - * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param startTime Filter response to events that happened after this time. This parameter * exists in v1. (optional) * @param endTime Filter response to events that happened before this time. Defaults to the @@ -250,6 +249,7 @@ public ListAuditEvents200Response listAuditEvents( * single Source. This parameter exists in v1. (optional) * @param resourceType Filter response to events that affect a specific type, for example, * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListAuditEvents200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -263,15 +263,15 @@ public ListAuditEvents200Response listAuditEvents( * */ public ApiResponse listAuditEventsWithHttpInfo( - PaginationInput pagination, String startTime, String endTime, String resourceId, - String resourceType) + String resourceType, + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAuditEventsValidateBeforeCall( - pagination, startTime, endTime, resourceId, resourceType, null); + startTime, endTime, resourceId, resourceType, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -279,7 +279,6 @@ public ApiResponse listAuditEventsWithHttpInfo( /** * List Audit Events (asynchronously) Returns a list of Audit Trail events. * - * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param startTime Filter response to events that happened after this time. This parameter * exists in v1. (optional) * @param endTime Filter response to events that happened before this time. Defaults to the @@ -289,6 +288,7 @@ public ApiResponse listAuditEventsWithHttpInfo( * single Source. This parameter exists in v1. (optional) * @param resourceType Filter response to events that affect a specific type, for example, * Sources, Warehouses, and Tracking Plans. This parameter exists in v1. (optional) + * @param pagination Defines the pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -303,17 +303,17 @@ public ApiResponse listAuditEventsWithHttpInfo( * */ public okhttp3.Call listAuditEventsAsync( - PaginationInput pagination, String startTime, String endTime, String resourceId, String resourceType, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listAuditEventsValidateBeforeCall( - pagination, startTime, endTime, resourceId, resourceType, _callback); + startTime, endTime, resourceId, resourceType, pagination, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 9de184b2..095987a4 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -1014,11 +1014,11 @@ public okhttp3.Call getRegulationAsync( * Build call for listRegulationsFromSource * * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter returned regulations. This parameter exists in * v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1033,9 +1033,9 @@ public okhttp3.Call getRegulationAsync( */ public okhttp3.Call listRegulationsFromSourceCall( String sourceId, - PaginationInput pagination, String status, List regulationTypes, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1116,9 +1116,9 @@ public okhttp3.Call listRegulationsFromSourceCall( @SuppressWarnings("rawtypes") private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( String sourceId, - PaginationInput pagination, String status, List regulationTypes, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { @@ -1138,7 +1138,7 @@ private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( okhttp3.Call localVarCall = listRegulationsFromSourceCall( - sourceId, pagination, status, regulationTypes, _callback); + sourceId, status, regulationTypes, pagination, _callback); return localVarCall; } @@ -1146,11 +1146,11 @@ private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( * List Regulations from Source Lists all Source-scoped regulations. * * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter returned regulations. This parameter exists in * v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @return ListRegulationsFromSource200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1165,13 +1165,13 @@ private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( */ public ListRegulationsFromSource200Response listRegulationsFromSource( String sourceId, - PaginationInput pagination, String status, - List regulationTypes) + List regulationTypes, + PaginationInput pagination) throws ApiException { ApiResponse localVarResp = listRegulationsFromSourceWithHttpInfo( - sourceId, pagination, status, regulationTypes); + sourceId, status, regulationTypes, pagination); return localVarResp.getData(); } @@ -1179,11 +1179,11 @@ public ListRegulationsFromSource200Response listRegulationsFromSource( * List Regulations from Source Lists all Source-scoped regulations. * * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter returned regulations. This parameter exists in * v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListRegulationsFromSource200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1198,13 +1198,13 @@ public ListRegulationsFromSource200Response listRegulationsFromSource( */ public ApiResponse listRegulationsFromSourceWithHttpInfo( String sourceId, - PaginationInput pagination, String status, - List regulationTypes) + List regulationTypes, + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listRegulationsFromSourceValidateBeforeCall( - sourceId, pagination, status, regulationTypes, null); + sourceId, status, regulationTypes, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -1214,11 +1214,11 @@ public ApiResponse listRegulationsFromSour * List Regulations from Source (asynchronously) Lists all Source-scoped regulations. * * @param sourceId (required) - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter returned regulations. This parameter exists in * v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1234,15 +1234,15 @@ public ApiResponse listRegulationsFromSour */ public okhttp3.Call listRegulationsFromSourceAsync( String sourceId, - PaginationInput pagination, String status, List regulationTypes, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listRegulationsFromSourceValidateBeforeCall( - sourceId, pagination, status, regulationTypes, _callback); + sourceId, status, regulationTypes, pagination, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); @@ -1418,11 +1418,11 @@ public okhttp3.Call listSuppressionsAsync( /** * Build call for listWorkspaceRegulations * - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter the returned regulations. This parameter exists * in v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1436,9 +1436,9 @@ public okhttp3.Call listSuppressionsAsync( * */ public okhttp3.Call listWorkspaceRegulationsCall( - PaginationInput pagination, String status, List regulationTypes, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1514,9 +1514,9 @@ public okhttp3.Call listWorkspaceRegulationsCall( @SuppressWarnings("rawtypes") private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall( - PaginationInput pagination, String status, List regulationTypes, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { @@ -1528,18 +1528,18 @@ private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall( } okhttp3.Call localVarCall = - listWorkspaceRegulationsCall(pagination, status, regulationTypes, _callback); + listWorkspaceRegulationsCall(status, regulationTypes, pagination, _callback); return localVarCall; } /** * List Workspace Regulations Lists all Workspace-scoped regulations. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter the returned regulations. This parameter exists * in v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @return ListWorkspaceRegulations200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1553,21 +1553,21 @@ private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall( * */ public ListWorkspaceRegulations200Response listWorkspaceRegulations( - PaginationInput pagination, String status, List regulationTypes) + String status, List regulationTypes, PaginationInput pagination) throws ApiException { ApiResponse localVarResp = - listWorkspaceRegulationsWithHttpInfo(pagination, status, regulationTypes); + listWorkspaceRegulationsWithHttpInfo(status, regulationTypes, pagination); return localVarResp.getData(); } /** * List Workspace Regulations Lists all Workspace-scoped regulations. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter the returned regulations. This parameter exists * in v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @return ApiResponse<ListWorkspaceRegulations200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1581,11 +1581,11 @@ public ListWorkspaceRegulations200Response listWorkspaceRegulations( * */ public ApiResponse listWorkspaceRegulationsWithHttpInfo( - PaginationInput pagination, String status, List regulationTypes) + String status, List regulationTypes, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listWorkspaceRegulationsValidateBeforeCall( - pagination, status, regulationTypes, null); + status, regulationTypes, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1593,11 +1593,11 @@ public ApiResponse listWorkspaceRegulations /** * List Workspace Regulations (asynchronously) Lists all Workspace-scoped regulations. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param status The status on which to filter the returned regulations. This parameter exists * in v1. (optional) * @param regulationTypes The regulation types on which to filter returned regulations. This * parameter exists in v1. (optional) + * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1612,15 +1612,15 @@ public ApiResponse listWorkspaceRegulations * */ public okhttp3.Call listWorkspaceRegulationsAsync( - PaginationInput pagination, String status, List regulationTypes, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listWorkspaceRegulationsValidateBeforeCall( - pagination, status, regulationTypes, _callback); + status, regulationTypes, pagination, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index 476afd10..ac199d8e 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -1229,9 +1229,9 @@ public okhttp3.Call listSourcesFromTrackingPlanAsync( /** * Build call for listTrackingPlans * - * @param pagination Pagination options. This parameter exists in v1. (required) * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This * parameter exists in v1. (optional) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1245,7 +1245,7 @@ public okhttp3.Call listSourcesFromTrackingPlanAsync( * */ public okhttp3.Call listTrackingPlansCall( - PaginationInput pagination, String type, final ApiCallback _callback) + String type, PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1315,7 +1315,7 @@ public okhttp3.Call listTrackingPlansCall( @SuppressWarnings("rawtypes") private okhttp3.Call listTrackingPlansValidateBeforeCall( - PaginationInput pagination, String type, final ApiCallback _callback) + String type, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pagination' is set @@ -1325,7 +1325,7 @@ private okhttp3.Call listTrackingPlansValidateBeforeCall( + " listTrackingPlans(Async)"); } - okhttp3.Call localVarCall = listTrackingPlansCall(pagination, type, _callback); + okhttp3.Call localVarCall = listTrackingPlansCall(type, pagination, _callback); return localVarCall; } @@ -1334,9 +1334,9 @@ private okhttp3.Call listTrackingPlansValidateBeforeCall( * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please * reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This * parameter exists in v1. (optional) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListTrackingPlans200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1349,10 +1349,10 @@ private okhttp3.Call listTrackingPlansValidateBeforeCall( * 429 Too many requests - * */ - public ListTrackingPlans200Response listTrackingPlans(PaginationInput pagination, String type) + public ListTrackingPlans200Response listTrackingPlans(String type, PaginationInput pagination) throws ApiException { ApiResponse localVarResp = - listTrackingPlansWithHttpInfo(pagination, type); + listTrackingPlansWithHttpInfo(type, pagination); return localVarResp.getData(); } @@ -1361,9 +1361,9 @@ public ListTrackingPlans200Response listTrackingPlans(PaginationInput pagination * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please * reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This * parameter exists in v1. (optional) + * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListTrackingPlans200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1377,8 +1377,8 @@ public ListTrackingPlans200Response listTrackingPlans(PaginationInput pagination * */ public ApiResponse listTrackingPlansWithHttpInfo( - PaginationInput pagination, String type) throws ApiException { - okhttp3.Call localVarCall = listTrackingPlansValidateBeforeCall(pagination, type, null); + String type, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listTrackingPlansValidateBeforeCall(type, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1388,9 +1388,9 @@ public ApiResponse listTrackingPlansWithHttpInfo( * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination options. This parameter exists in v1. (required) * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This * parameter exists in v1. (optional) + * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1405,13 +1405,13 @@ public ApiResponse listTrackingPlansWithHttpInfo( * */ public okhttp3.Call listTrackingPlansAsync( - PaginationInput pagination, String type, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listTrackingPlansValidateBeforeCall(pagination, type, _callback); + listTrackingPlansValidateBeforeCall(type, pagination, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; From 6665a81730553db909ace38b814dafd3ffd20c52 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 18 Jan 2023 19:40:50 +0000 Subject: [PATCH 029/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@794b841. --- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../api/DeletionAndSuppressionApi.java | 26 +- .../publicapi/api/DestinationFiltersApi.java | 24 +- .../publicapi/api/DestinationsApi.java | 117 +++++++-- .../publicapi/api/EdgeFunctionsApi.java | 96 ++++--- .../segment/publicapi/api/FunctionsApi.java | 88 +++---- .../segment/publicapi/api/IamGroupsApi.java | 132 +++++----- .../segment/publicapi/api/IamUsersApi.java | 69 +++-- .../com/segment/publicapi/api/LabelsApi.java | 12 +- .../publicapi/api/SelectiveSyncApi.java | 6 +- .../com/segment/publicapi/api/SourcesApi.java | 40 +-- .../com/segment/publicapi/api/SpacesApi.java | 65 +++-- .../publicapi/api/TrackingPlansApi.java | 248 +++++++++--------- .../publicapi/api/TransformationsApi.java | 105 ++++---- .../segment/publicapi/api/WarehousesApi.java | 36 +-- 15 files changed, 583 insertions(+), 483 deletions(-) diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 1ced96f8..120cc325 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/33.0.4/java"); + setUserAgent("Public API SDK 33.0.4 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 095987a4..f6965605 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -393,7 +393,7 @@ private okhttp3.Call createSourceRegulationValidateBeforeCall( } /** - * Create Source Regulation Creates a Source-scoped regulation. When called, this endpoint may + * Create Source Regulation Creates a Source-scoped regulation. • When called, this endpoint may * generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` @@ -421,7 +421,7 @@ public CreateSourceRegulation200Response createSourceRegulation( } /** - * Create Source Regulation Creates a Source-scoped regulation. When called, this endpoint may + * Create Source Regulation Creates a Source-scoped regulation. • When called, this endpoint may * generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` @@ -451,7 +451,7 @@ public ApiResponse createSourceRegulationWith } /** - * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. When called, + * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. • When called, * this endpoint may generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` @@ -584,8 +584,8 @@ private okhttp3.Call createWorkspaceRegulationValidateBeforeCall( } /** - * Create Workspace Regulation Creates a Workspace-scoped regulation. When called, this endpoint - * may generate the `Workspace Regulation Created` event in the [audit + * Create Workspace Regulation Creates a Workspace-scoped regulation. • When called, this + * endpoint may generate the `Workspace Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * @@ -610,8 +610,8 @@ public CreateWorkspaceRegulation200Response createWorkspaceRegulation( } /** - * Create Workspace Regulation Creates a Workspace-scoped regulation. When called, this endpoint - * may generate the `Workspace Regulation Created` event in the [audit + * Create Workspace Regulation Creates a Workspace-scoped regulation. • When called, this + * endpoint may generate the `Workspace Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * @@ -638,7 +638,7 @@ public ApiResponse createWorkspaceRegulati } /** - * Create Workspace Regulation (asynchronously) Creates a Workspace-scoped regulation. When + * Create Workspace Regulation (asynchronously) Creates a Workspace-scoped regulation. • When * called, this endpoint may generate the `Workspace Regulation Created` event in the * [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` @@ -767,8 +767,8 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the - * initialized state to be deleted. When called, this endpoint may generate the `Regulation - * Deleted` event in the [audit trail](/tag/Audit-Trail). + * initialized state to be deleted. • When called, this endpoint may generate the + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return DeleteRegulation200Response @@ -791,8 +791,8 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the - * initialized state to be deleted. When called, this endpoint may generate the `Regulation - * Deleted` event in the [audit trail](/tag/Audit-Trail). + * initialized state to be deleted. • When called, this endpoint may generate the + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -816,7 +816,7 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation - * must be in the initialized state to be deleted. When called, this endpoint may generate the + * must be in the initialized state to be deleted. • When called, this endpoint may generate the * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index a8002fea..b984711b 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -187,7 +187,7 @@ private okhttp3.Call createFilterForDestinationValidateBeforeCall( } /** - * Create Filter for Destination Creates a filter in a Destination. When called, this endpoint + * Create Filter for Destination Creates a filter in a Destination. • When called, this endpoint * may generate the `Destination Filter Created` event in the [audit * trail](/tag/Audit-Trail). * @@ -216,7 +216,7 @@ public CreateFilterForDestination200Response createFilterForDestination( } /** - * Create Filter for Destination Creates a filter in a Destination. When called, this endpoint + * Create Filter for Destination Creates a filter in a Destination. • When called, this endpoint * may generate the `Destination Filter Created` event in the [audit * trail](/tag/Audit-Trail). * @@ -248,7 +248,7 @@ public CreateFilterForDestination200Response createFilterForDestination( } /** - * Create Filter for Destination (asynchronously) Creates a filter in a Destination. When + * Create Filter for Destination (asynchronously) Creates a filter in a Destination. • When * called, this endpoint may generate the `Destination Filter Created` event in the * [audit trail](/tag/Audit-Trail). * @@ -948,7 +948,7 @@ private okhttp3.Call removeFilterFromDestinationValidateBeforeCall( } /** - * Remove Filter from Destination Deletes a Destination filter. When called, this endpoint may + * Remove Filter from Destination Deletes a Destination filter. • When called, this endpoint may * generate the `Destination Filter Deleted` event in the [audit * trail](/tag/Audit-Trail). * @@ -974,7 +974,7 @@ public RemoveFilterFromDestination200Response removeFilterFromDestination( } /** - * Remove Filter from Destination Deletes a Destination filter. When called, this endpoint may + * Remove Filter from Destination Deletes a Destination filter. • When called, this endpoint may * generate the `Destination Filter Deleted` event in the [audit * trail](/tag/Audit-Trail). * @@ -1003,7 +1003,7 @@ public RemoveFilterFromDestination200Response removeFilterFromDestination( } /** - * Remove Filter from Destination (asynchronously) Deletes a Destination filter. When called, + * Remove Filter from Destination (asynchronously) Deletes a Destination filter. • When called, * this endpoint may generate the `Destination Filter Deleted` event in the [audit * trail](/tag/Audit-Trail). * @@ -1163,8 +1163,8 @@ private okhttp3.Call updateFilterForDestinationValidateBeforeCall( } /** - * Update Filter for Destination Updates a filter in a Destination. When called, this endpoint - * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * + * Update Filter for Destination Updates a filter in a Destination. • When called, this endpoint + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* * Destination Filter Enabled * Destination Filter Disabled * * @param destinationId (required) @@ -1194,8 +1194,8 @@ public UpdateFilterForDestination200Response updateFilterForDestination( } /** - * Update Filter for Destination Updates a filter in a Destination. When called, this endpoint - * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * + * Update Filter for Destination Updates a filter in a Destination. • When called, this endpoint + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* * Destination Filter Enabled * Destination Filter Disabled * * @param destinationId (required) @@ -1228,9 +1228,9 @@ public UpdateFilterForDestination200Response updateFilterForDestination( } /** - * Update Filter for Destination (asynchronously) Updates a filter in a Destination. When + * Update Filter for Destination (asynchronously) Updates a filter in a Destination. • When * called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Destination Filter Enabled * Destination Filter Disabled + * trail](/tag/Audit-Trail) events:* Destination Filter Enabled * Destination Filter Disabled * * @param destinationId (required) * @param filterId (required) diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index b30394bf..379f821c 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -175,7 +175,7 @@ private okhttp3.Call createDestinationValidateBeforeCall( } /** - * Create Destination Creates a new Destination. When called, this endpoint may generate the + * Create Destination Creates a new Destination. • When called, this endpoint may generate the * `Integration Created` event in the [audit trail](/tag/Audit-Trail). * * @param createDestinationV1Input (required) @@ -199,7 +199,7 @@ public CreateDestination200Response createDestination( } /** - * Create Destination Creates a new Destination. When called, this endpoint may generate the + * Create Destination Creates a new Destination. • When called, this endpoint may generate the * `Integration Created` event in the [audit trail](/tag/Audit-Trail). * * @param createDestinationV1Input (required) @@ -224,8 +224,9 @@ public ApiResponse createDestinationWithHttpInfo( } /** - * Create Destination (asynchronously) Creates a new Destination. When called, this endpoint may - * generate the `Integration Created` event in the [audit trail](/tag/Audit-Trail). + * Create Destination (asynchronously) Creates a new Destination. • When called, this endpoint + * may generate the `Integration Created` event in the [audit + * trail](/tag/Audit-Trail). * * @param createDestinationV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -360,7 +361,11 @@ private okhttp3.Call createDestinationSubscriptionValidateBeforeCall( } /** - * Create Destination Subscription Creates a new Destination subscription. + * Create Destination Subscription Creates a new Destination subscription. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the + * Destination Subscriptions feature enabled. Please reach out to your customer success manager + * for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -387,7 +392,11 @@ public CreateDestinationSubscription200Response createDestinationSubscription( } /** - * Create Destination Subscription Creates a new Destination subscription. + * Create Destination Subscription Creates a new Destination subscription. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the + * Destination Subscriptions feature enabled. Please reach out to your customer success manager + * for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -417,7 +426,11 @@ public CreateDestinationSubscription200Response createDestinationSubscription( } /** - * Create Destination Subscription (asynchronously) Creates a new Destination subscription. + * Create Destination Subscription (asynchronously) Creates a new Destination subscription. • + * This endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -544,7 +557,7 @@ private okhttp3.Call deleteDestinationValidateBeforeCall( } /** - * Delete Destination Deletes an existing Destination. When called, this endpoint may generate + * Delete Destination Deletes an existing Destination. • When called, this endpoint may generate * the `Integration Deleted` event in the [audit trail](/tag/Audit-Trail). Config API * omitted fields: - `catalogId` * @@ -569,7 +582,7 @@ public DeleteDestination200Response deleteDestination(String destinationId) } /** - * Delete Destination Deletes an existing Destination. When called, this endpoint may generate + * Delete Destination Deletes an existing Destination. • When called, this endpoint may generate * the `Integration Deleted` event in the [audit trail](/tag/Audit-Trail). Config API * omitted fields: - `catalogId` * @@ -594,7 +607,7 @@ public ApiResponse deleteDestinationWithHttpInfo( } /** - * Delete Destination (asynchronously) Deletes an existing Destination. When called, this + * Delete Destination (asynchronously) Deletes an existing Destination. • When called, this * endpoint may generate the `Integration Deleted` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `catalogId` * @@ -895,7 +908,11 @@ private okhttp3.Call getSubscriptionFromDestinationValidateBeforeCall( } /** - * Get Subscription from Destination Gets a Destination subscription by id. + * Get Subscription from Destination Gets a Destination subscription by id. • This endpoint is + * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Destination Subscriptions feature enabled. Please reach out to your customer success manager + * for more information. * * @param destinationId (required) * @param id (required) @@ -919,7 +936,11 @@ public GetSubscriptionFromDestination200Response getSubscriptionFromDestination( } /** - * Get Subscription from Destination Gets a Destination subscription by id. + * Get Subscription from Destination Gets a Destination subscription by id. • This endpoint is + * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Destination Subscriptions feature enabled. Please reach out to your customer success manager + * for more information. * * @param destinationId (required) * @param id (required) @@ -946,7 +967,11 @@ public GetSubscriptionFromDestination200Response getSubscriptionFromDestination( } /** - * Get Subscription from Destination (asynchronously) Gets a Destination subscription by id. + * Get Subscription from Destination (asynchronously) Gets a Destination subscription by id. • + * This endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param id (required) @@ -1538,7 +1563,11 @@ private okhttp3.Call listSubscriptionsFromDestinationValidateBeforeCall( } /** - * List Subscriptions from Destination Lists subscriptions for a Destination. + * List Subscriptions from Destination Lists subscriptions for a Destination. • This endpoint is + * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Destination Subscriptions feature enabled. Please reach out to your customer success manager + * for more information. * * @param destinationId (required) * @param pagination Pagination options. This parameter exists in alpha. (required) @@ -1562,7 +1591,11 @@ public ListSubscriptionsFromDestination200Response listSubscriptionsFromDestinat } /** - * List Subscriptions from Destination Lists subscriptions for a Destination. + * List Subscriptions from Destination Lists subscriptions for a Destination. • This endpoint is + * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Destination Subscriptions feature enabled. Please reach out to your customer success manager + * for more information. * * @param destinationId (required) * @param pagination Pagination options. This parameter exists in alpha. (required) @@ -1589,7 +1622,11 @@ public ListSubscriptionsFromDestination200Response listSubscriptionsFromDestinat } /** - * List Subscriptions from Destination (asynchronously) Lists subscriptions for a Destination. + * List Subscriptions from Destination (asynchronously) Lists subscriptions for a Destination. • + * This endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param pagination Pagination options. This parameter exists in alpha. (required) @@ -1725,7 +1762,11 @@ private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall( } /** - * Remove Subscription from Destination Deletes an existing Destination subscription. + * Remove Subscription from Destination Deletes an existing Destination subscription. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param id (required) @@ -1749,7 +1790,11 @@ public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestin } /** - * Remove Subscription from Destination Deletes an existing Destination subscription. + * Remove Subscription from Destination Deletes an existing Destination subscription. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param id (required) @@ -1777,7 +1822,10 @@ public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestin /** * Remove Subscription from Destination (asynchronously) Deletes an existing Destination - * subscription. + * subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to + * your customer success manager for more information. * * @param destinationId (required) * @param id (required) @@ -1925,9 +1973,9 @@ private okhttp3.Call updateDestinationValidateBeforeCall( * read-only settings for your destination you'll encounter the following behavior: * If * only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If * there's a mix of writable and read-only properties in the payload, the request will be - * accepted, the writable properties will be updated and the read-only properties ignored. When - * called, this endpoint may generate the `Integration Disabled` event in the [audit - * trail](/tag/Audit-Trail). Config API omitted fields: - `updateMask` + * accepted, the writable properties will be updated and the read-only properties ignored. • + * When called, this endpoint may generate the `Integration Disabled` event in the + * [audit trail](/tag/Audit-Trail). Config API omitted fields: - `updateMask` * * @param destinationId (required) * @param updateDestinationV1Input (required) @@ -1956,9 +2004,9 @@ public UpdateDestination200Response updateDestination( * read-only settings for your destination you'll encounter the following behavior: * If * only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If * there's a mix of writable and read-only properties in the payload, the request will be - * accepted, the writable properties will be updated and the read-only properties ignored. When - * called, this endpoint may generate the `Integration Disabled` event in the [audit - * trail](/tag/Audit-Trail). Config API omitted fields: - `updateMask` + * accepted, the writable properties will be updated and the read-only properties ignored. • + * When called, this endpoint may generate the `Integration Disabled` event in the + * [audit trail](/tag/Audit-Trail). Config API omitted fields: - `updateMask` * * @param destinationId (required) * @param updateDestinationV1Input (required) @@ -1989,7 +2037,7 @@ public ApiResponse updateDestinationWithHttpInfo( * behavior: * If only read-only properties are being updated, the endpoint will return an HTTP * 400 error. * If there's a mix of writable and read-only properties in the payload, the * request will be accepted, the writable properties will be updated and the read-only - * properties ignored. When called, this endpoint may generate the `Integration + * properties ignored. • When called, this endpoint may generate the `Integration * Disabled` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - * `updateMask` * @@ -2142,7 +2190,11 @@ private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall( } /** - * Update Subscription for Destination Updates an existing Destination subscription. + * Update Subscription for Destination Updates an existing Destination subscription. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param id (required) @@ -2171,7 +2223,11 @@ public UpdateSubscriptionForDestination200Response updateSubscriptionForDestinat } /** - * Update Subscription for Destination Updates an existing Destination subscription. + * Update Subscription for Destination Updates an existing Destination subscription. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Destination Subscriptions feature enabled. Please reach out to your + * customer success manager for more information. * * @param destinationId (required) * @param id (required) @@ -2205,7 +2261,10 @@ public UpdateSubscriptionForDestination200Response updateSubscriptionForDestinat /** * Update Subscription for Destination (asynchronously) Updates an existing Destination - * subscription. + * subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to + * your customer success manager for more information. * * @param destinationId (required) * @param id (required) diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index 8ab3a094..6dc4f864 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -174,10 +174,11 @@ private okhttp3.Call createEdgeFunctionsValidateBeforeCall( } /** - * Create Edge Functions Create EdgeFunctions for your Source, given a valid upload URL for an - * Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified - * Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer - * success manager for more information. + * Create Edge Functions Create EdgeFunctions for your Source given a valid upload URL for an + * Edge Functions bundle. • This endpoint is in **Alpha** testing. Please submit any feedback by + * sending email to friends@segment.com. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Edge Functions feature enabled. Please reach out to + * your customer success manager for more information. * * @param sourceId (required) * @param createEdgeFunctionsAlphaInput (required) @@ -202,10 +203,11 @@ public CreateEdgeFunctions200Response createEdgeFunctions( } /** - * Create Edge Functions Create EdgeFunctions for your Source, given a valid upload URL for an - * Edge Functions bundle. **Note**: In order to successfully call this endpoint, the specified - * Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer - * success manager for more information. + * Create Edge Functions Create EdgeFunctions for your Source given a valid upload URL for an + * Edge Functions bundle. • This endpoint is in **Alpha** testing. Please submit any feedback by + * sending email to friends@segment.com. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Edge Functions feature enabled. Please reach out to + * your customer success manager for more information. * * @param sourceId (required) * @param createEdgeFunctionsAlphaInput (required) @@ -232,10 +234,11 @@ public ApiResponse createEdgeFunctionsWithHttpIn } /** - * Create Edge Functions (asynchronously) Create EdgeFunctions for your Source, given a valid - * upload URL for an Edge Functions bundle. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please - * reach out to your customer success manager for more information. + * Create Edge Functions (asynchronously) Create EdgeFunctions for your Source given a valid + * upload URL for an Edge Functions bundle. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending email to friends@segment.com. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Edge Functions feature enabled. + * Please reach out to your customer success manager for more information. * * @param sourceId (required) * @param createEdgeFunctionsAlphaInput (required) @@ -358,9 +361,11 @@ private okhttp3.Call disableEdgeFunctionsValidateBeforeCall( } /** - * Disable Edge Functions Disable Edge Functions for your Source. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Edge Functions - * feature enabled. Please reach out to your customer success manager for more information. + * Disable Edge Functions Disable Edge Functions for your Source. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Functions feature enabled. Please reach out to your customer success manager for more + * information. * * @param sourceId (required) * @return DisableEdgeFunctions200Response @@ -383,9 +388,11 @@ public DisableEdgeFunctions200Response disableEdgeFunctions(String sourceId) } /** - * Disable Edge Functions Disable Edge Functions for your Source. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Edge Functions - * feature enabled. Please reach out to your customer success manager for more information. + * Disable Edge Functions Disable Edge Functions for your Source. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Functions feature enabled. Please reach out to your customer success manager for more + * information. * * @param sourceId (required) * @return ApiResponse<DisableEdgeFunctions200Response> @@ -408,10 +415,11 @@ public ApiResponse disableEdgeFunctionsWithHttp } /** - * Disable Edge Functions (asynchronously) Disable Edge Functions for your Source. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Edge - * Functions feature enabled. Please reach out to your customer success manager for more - * information. + * Disable Edge Functions (asynchronously) Disable Edge Functions for your Source. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Edge Functions feature enabled. Please reach out to your customer success + * manager for more information. * * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes @@ -529,10 +537,11 @@ private okhttp3.Call generateUploadURLForEdgeFunctionsValidateBeforeCall( } /** - * Generate Upload URL for Edge Functions Generate a temporary upload URL, that can be used to - * upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Edge Functions feature enabled. Please reach out to - * your customer success manager for more information. + * Generate Upload URL for Edge Functions Generate a temporary upload URL that can be used to + * upload an Edge Functions bundle. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please + * reach out to your customer success manager for more information. * * @param sourceId (required) * @return GenerateUploadURLForEdgeFunctions200Response @@ -555,10 +564,11 @@ public GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunc } /** - * Generate Upload URL for Edge Functions Generate a temporary upload URL, that can be used to - * upload an Edge Functions bundle. **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Edge Functions feature enabled. Please reach out to - * your customer success manager for more information. + * Generate Upload URL for Edge Functions Generate a temporary upload URL that can be used to + * upload an Edge Functions bundle. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please + * reach out to your customer success manager for more information. * * @param sourceId (required) * @return ApiResponse<GenerateUploadURLForEdgeFunctions200Response> @@ -583,10 +593,11 @@ public GenerateUploadURLForEdgeFunctions200Response generateUploadURLForEdgeFunc } /** - * Generate Upload URL for Edge Functions (asynchronously) Generate a temporary upload URL, that - * can be used to upload an Edge Functions bundle. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Edge Functions feature enabled. Please - * reach out to your customer success manager for more information. + * Generate Upload URL for Edge Functions (asynchronously) Generate a temporary upload URL that + * can be used to upload an Edge Functions bundle. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Edge Functions + * feature enabled. Please reach out to your customer success manager for more information. * * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes @@ -707,8 +718,9 @@ private okhttp3.Call getLatestFromEdgeFunctionsValidateBeforeCall( } /** - * Get Latest from Edge Functions Get the latest Edge Functions for your Source. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Get Latest from Edge Functions Get the latest Edge Functions for your Source. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. + * • In order to successfully call this endpoint, the specified Workspace needs to have the Edge * Functions feature enabled. Please reach out to your customer success manager for more * information. * @@ -733,8 +745,9 @@ public GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions(String s } /** - * Get Latest from Edge Functions Get the latest Edge Functions for your Source. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Edge + * Get Latest from Edge Functions Get the latest Edge Functions for your Source. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. + * • In order to successfully call this endpoint, the specified Workspace needs to have the Edge * Functions feature enabled. Please reach out to your customer success manager for more * information. * @@ -761,9 +774,10 @@ public GetLatestFromEdgeFunctions200Response getLatestFromEdgeFunctions(String s /** * Get Latest from Edge Functions (asynchronously) Get the latest Edge Functions for your - * Source. **Note**: In order to successfully call this endpoint, the specified Workspace needs - * to have the Edge Functions feature enabled. Please reach out to your customer success manager - * for more information. + * Source. • This endpoint is in **Alpha** testing. Please submit any feedback by sending email + * to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Edge Functions feature enabled. Please reach out to your customer + * success manager for more information. * * @param sourceId (required) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 446bcd40..de9d1a7b 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -168,8 +168,8 @@ private okhttp3.Call createFunctionValidateBeforeCall( } /** - * Create Function Creates a Function. **Note**: In order to successfully call this endpoint, - * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * Create Function Creates a Function. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your * customer success manager for more information. * * @param createFunctionV1Input (required) @@ -193,8 +193,8 @@ public CreateFunction200Response createFunction(CreateFunctionV1Input createFunc } /** - * Create Function Creates a Function. **Note**: In order to successfully call this endpoint, - * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * Create Function Creates a Function. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your * customer success manager for more information. * * @param createFunctionV1Input (required) @@ -218,9 +218,9 @@ public ApiResponse createFunctionWithHttpInfo( } /** - * Create Function (asynchronously) Creates a Function. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please - * reach out to your customer success manager for more information. + * Create Function (asynchronously) Creates a Function. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * * @param createFunctionV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -344,8 +344,8 @@ private okhttp3.Call createFunctionDeploymentValidateBeforeCall( /** * Create Function Deployment Deploys a Function. Only applicable to Source Function instances. - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Functions feature enabled. Please reach out to your customer success manager for more + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Functions feature enabled. Please reach out to your customer success manager for more * information. * * @param functionId (required) @@ -370,8 +370,8 @@ public CreateFunctionDeployment200Response createFunctionDeployment(String funct /** * Create Function Deployment Deploys a Function. Only applicable to Source Function instances. - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Functions feature enabled. Please reach out to your customer success manager for more + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Functions feature enabled. Please reach out to your customer success manager for more * information. * * @param functionId (required) @@ -396,9 +396,9 @@ public ApiResponse createFunctionDeployment /** * Create Function Deployment (asynchronously) Deploys a Function. Only applicable to Source - * Function instances. **Note**: In order to successfully call this endpoint, the specified - * Workspace needs to have the Functions feature enabled. Please reach out to your customer - * success manager for more information. + * Function instances. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Functions feature enabled. Please reach out to your customer success + * manager for more information. * * @param functionId (required) * @param _callback The callback to be executed when the API call finishes @@ -520,8 +520,8 @@ private okhttp3.Call deleteFunctionValidateBeforeCall( } /** - * Delete Function Deletes a Function. **Note**: In order to successfully call this endpoint, - * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * Delete Function Deletes a Function. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your * customer success manager for more information. * * @param functionId (required) @@ -544,8 +544,8 @@ public DeleteFunction200Response deleteFunction(String functionId) throws ApiExc } /** - * Delete Function Deletes a Function. **Note**: In order to successfully call this endpoint, - * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * Delete Function Deletes a Function. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your * customer success manager for more information. * * @param functionId (required) @@ -569,9 +569,9 @@ public ApiResponse deleteFunctionWithHttpInfo(String } /** - * Delete Function (asynchronously) Deletes a Function. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please - * reach out to your customer success manager for more information. + * Delete Function (asynchronously) Deletes a Function. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * * @param functionId (required) * @param _callback The callback to be executed when the API call finishes @@ -691,9 +691,9 @@ private okhttp3.Call getFunctionValidateBeforeCall( } /** - * Get Function Gets a Function. **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Functions feature enabled. Please reach out to your - * customer success manager for more information. + * Get Function Gets a Function. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Functions feature enabled. Please reach out to your customer + * success manager for more information. * * @param functionId (required) * @return GetFunction200Response @@ -714,9 +714,9 @@ public GetFunction200Response getFunction(String functionId) throws ApiException } /** - * Get Function Gets a Function. **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Functions feature enabled. Please reach out to your - * customer success manager for more information. + * Get Function Gets a Function. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Functions feature enabled. Please reach out to your customer + * success manager for more information. * * @param functionId (required) * @return ApiResponse<GetFunction200Response> @@ -739,9 +739,9 @@ public ApiResponse getFunctionWithHttpInfo(String functi } /** - * Get Function (asynchronously) Gets a Function. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * Get Function (asynchronously) Gets a Function. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. * * @param functionId (required) * @param _callback The callback to be executed when the API call finishes @@ -878,9 +878,9 @@ private okhttp3.Call listFunctionsValidateBeforeCall( } /** - * List Functions Lists all Functions in a Workspace. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please - * reach out to your customer success manager for more information. + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param resourceType The Function type. Config API note: equal to `type`. This @@ -905,9 +905,9 @@ public ListFunctions200Response listFunctions(PaginationInput pagination, String } /** - * List Functions Lists all Functions in a Workspace. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please - * reach out to your customer success manager for more information. + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * * @param pagination Pagination parameters. This parameter exists in v1. (required) * @param resourceType The Function type. Config API note: equal to `type`. This @@ -932,7 +932,7 @@ public ApiResponse listFunctionsWithHttpInfo( } /** - * List Functions (asynchronously) Lists all Functions in a Workspace. **Note**: In order to + * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1078,8 +1078,8 @@ private okhttp3.Call updateFunctionValidateBeforeCall( } /** - * Update Function Updates a Function. **Note**: In order to successfully call this endpoint, - * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * Update Function Updates a Function. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your * customer success manager for more information. Config API omitted fields: - * `updateMask` * @@ -1105,8 +1105,8 @@ public UpdateFunction200Response updateFunction( } /** - * Update Function Updates a Function. **Note**: In order to successfully call this endpoint, - * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * Update Function Updates a Function. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your * customer success manager for more information. Config API omitted fields: - * `updateMask` * @@ -1133,9 +1133,9 @@ public ApiResponse updateFunctionWithHttpInfo( } /** - * Update Function (asynchronously) Updates a Function. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Functions feature enabled. Please - * reach out to your customer success manager for more information. Config API omitted fields: - + * Update Function (asynchronously) Updates a Function. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. Config API omitted fields: - * `updateMask` * * @param functionId (required) diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index 8a4eefa2..34c639f8 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -196,12 +196,13 @@ private okhttp3.Call addPermissionsToUserGroupValidateBeforeCall( } /** - * Add Permissions to User Group Adds a list of access permissions to a user group. When called, - * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) - * events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Add Permissions to User Group Adds a list of access permissions to a user group. • When + * called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events:* Policy Created * User Group Policy Updated The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param userGroupId (required) * @param addPermissionsToUserGroupV1Input (required) @@ -227,12 +228,13 @@ public AddPermissionsToUserGroup200Response addPermissionsToUserGroup( } /** - * Add Permissions to User Group Adds a list of access permissions to a user group. When called, - * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) - * events: * Policy Created * User Group Policy Updated The rate limit for this endpoint is 60 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Add Permissions to User Group Adds a list of access permissions to a user group. • When + * called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events:* Policy Created * User Group Policy Updated The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param userGroupId (required) * @param addPermissionsToUserGroupV1Input (required) @@ -261,8 +263,8 @@ public ApiResponse addPermissionsToUserGro /** * Add Permissions to User Group (asynchronously) Adds a list of access permissions to a user - * group. When called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Policy Created * User Group Policy Updated The rate limit + * group. • When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events:* Policy Created * User Group Policy Updated The rate limit * for this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more @@ -411,8 +413,8 @@ private okhttp3.Call addUsersToUserGroupValidateBeforeCall( } /** - * Add Users to User Group Adds a list of users or invites to a user group. When called, this - * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * + * Add Users to User Group Adds a list of users or invites to a user group. • When called, this + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the @@ -441,8 +443,8 @@ public AddUsersToUserGroup200Response addUsersToUserGroup( } /** - * Add Users to User Group Adds a list of users or invites to a user group. When called, this - * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * + * Add Users to User Group Adds a list of users or invites to a user group. • When called, this + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* * Subjects Added to Group * User Added To User Group The rate limit for this endpoint is 60 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the @@ -473,11 +475,11 @@ public ApiResponse addUsersToUserGroupWithHttpIn } /** - * Add Users to User Group (asynchronously) Adds a list of users or invites to a user group. + * Add Users to User Group (asynchronously) Adds a list of users or invites to a user group. • * When called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group The - * rate limit for this endpoint is 60 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * trail](/tag/Audit-Trail) events:* Subjects Added to Group * User Added To User Group The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -606,11 +608,11 @@ private okhttp3.Call createUserGroupValidateBeforeCall( } /** - * Create User Group Creates a user group. When called, this endpoint may generate one or more - * of the following [audit trail](/tag/Audit-Trail) events: * User Group Created * Policy - * Created The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Create User Group Creates a user group. • When called, this endpoint may generate one or more + * of the following [audit trail](/tag/Audit-Trail) events:* User Group Created * Policy Created + * The rate limit for this endpoint is 60 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param createUserGroupV1Input (required) @@ -634,11 +636,11 @@ public CreateUserGroup200Response createUserGroup(CreateUserGroupV1Input createU } /** - * Create User Group Creates a user group. When called, this endpoint may generate one or more - * of the following [audit trail](/tag/Audit-Trail) events: * User Group Created * Policy - * Created The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Create User Group Creates a user group. • When called, this endpoint may generate one or more + * of the following [audit trail](/tag/Audit-Trail) events:* User Group Created * Policy Created + * The rate limit for this endpoint is 60 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param createUserGroupV1Input (required) @@ -662,8 +664,8 @@ public ApiResponse createUserGroupWithHttpInfo( } /** - * Create User Group (asynchronously) Creates a user group. When called, this endpoint may - * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * User Group + * Create User Group (asynchronously) Creates a user group. • When called, this endpoint may + * generate one or more of the following [audit trail](/tag/Audit-Trail) events:* User Group * Created * Policy Created The rate limit for this endpoint is 60 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -790,7 +792,7 @@ private okhttp3.Call deleteUserGroupValidateBeforeCall( } /** - * Delete User Group Removes a user group from a Workspace. When called, this endpoint may + * Delete User Group Removes a user group from a Workspace. • When called, this endpoint may * generate the `User Group Deleted` event in the [audit trail](/tag/Audit-Trail). The * rate limit for this endpoint is 60 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -817,7 +819,7 @@ public DeleteUserGroup200Response deleteUserGroup(String userGroupId) throws Api } /** - * Delete User Group Removes a user group from a Workspace. When called, this endpoint may + * Delete User Group Removes a user group from a Workspace. • When called, this endpoint may * generate the `User Group Deleted` event in the [audit trail](/tag/Audit-Trail). The * rate limit for this endpoint is 60 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -845,7 +847,7 @@ public ApiResponse deleteUserGroupWithHttpInfo(Strin } /** - * Delete User Group (asynchronously) Removes a user group from a Workspace. When called, this + * Delete User Group (asynchronously) Removes a user group from a Workspace. • When called, this * endpoint may generate the `User Group Deleted` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint @@ -1701,8 +1703,8 @@ private okhttp3.Call removeUsersFromUserGroupValidateBeforeCall( /** * Remove Users from User Group Removes one or multiple users or invites from a user group by - * email. When called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group + * email. • When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events:* Group Memberships Deleted * User Removed From User Group * The rate limit for this endpoint is 60 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate @@ -1732,8 +1734,8 @@ public RemoveUsersFromUserGroup200Response removeUsersFromUserGroup( /** * Remove Users from User Group Removes one or multiple users or invites from a user group by - * email. When called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User Group + * email. • When called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events:* Group Memberships Deleted * User Removed From User Group * The rate limit for this endpoint is 60 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate @@ -1764,8 +1766,8 @@ public ApiResponse removeUsersFromUserGroup /** * Remove Users from User Group (asynchronously) Removes one or multiple users or invites from a - * user group by email. When called, this endpoint may generate one or more of the following - * [audit trail](/tag/Audit-Trail) events: * Group Memberships Deleted * User Removed From User + * user group by email. • When called, this endpoint may generate one or more of the following + * [audit trail](/tag/Audit-Trail) events:* Group Memberships Deleted * User Removed From User * Group The rate limit for this endpoint is 60 requests per minute, which is lower than the * default due to access pattern restrictions. Once reached, this endpoint will respond with the * 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -1914,7 +1916,7 @@ private okhttp3.Call replacePermissionsForUserGroupValidateBeforeCall( } /** - * Replace Permissions for User Group Updates the list of access permissions for a user group. + * Replace Permissions for User Group Updates the list of access permissions for a user group. • * When called, this endpoint may generate the `Policy Deleted` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint @@ -1946,7 +1948,7 @@ public ReplacePermissionsForUserGroup200Response replacePermissionsForUserGroup( } /** - * Replace Permissions for User Group Updates the list of access permissions for a user group. + * Replace Permissions for User Group Updates the list of access permissions for a user group. • * When called, this endpoint may generate the `Policy Deleted` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint @@ -1982,7 +1984,7 @@ public ReplacePermissionsForUserGroup200Response replacePermissionsForUserGroup( /** * Replace Permissions for User Group (asynchronously) Updates the list of access permissions - * for a user group. When called, this endpoint may generate the `Policy Deleted` + * for a user group. • When called, this endpoint may generate the `Policy Deleted` * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -2131,13 +2133,13 @@ private okhttp3.Call replaceUsersInUserGroupValidateBeforeCall( } /** - * Replace Users in User Group Replaces the members of a user group by email. When called, this - * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * - * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit - * for this endpoint is 60 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * Replace Users in User Group Replaces the members of a user group by email. • When called, + * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) + * events:* Subjects Added to Group * User Added To User Group * Group Memberships Deleted The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param userGroupId (required) * @param replaceUsersInUserGroupV1Input (required) @@ -2162,13 +2164,13 @@ public ReplaceUsersInUserGroup200Response replaceUsersInUserGroup( } /** - * Replace Users in User Group Replaces the members of a user group by email. When called, this - * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * - * Subjects Added to Group * User Added To User Group * Group Memberships Deleted The rate limit - * for this endpoint is 60 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * Replace Users in User Group Replaces the members of a user group by email. • When called, + * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) + * events:* Subjects Added to Group * User Added To User Group * Group Memberships Deleted The + * rate limit for this endpoint is 60 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param userGroupId (required) * @param replaceUsersInUserGroupV1Input (required) @@ -2195,9 +2197,9 @@ public ApiResponse replaceUsersInUserGroupWi } /** - * Replace Users in User Group (asynchronously) Replaces the members of a user group by email. + * Replace Users in User Group (asynchronously) Replaces the members of a user group by email. • * When called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Subjects Added to Group * User Added To User Group * Group + * trail](/tag/Audit-Trail) events:* Subjects Added to Group * User Added To User Group * Group * Memberships Deleted The rate limit for this endpoint is 60 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -2345,7 +2347,7 @@ private okhttp3.Call updateUserGroupValidateBeforeCall( } /** - * Update User Group Updates a user group for a Workspace. When called, this endpoint may + * Update User Group Updates a user group for a Workspace. • When called, this endpoint may * generate the `User Group Updated` event in the [audit trail](/tag/Audit-Trail). The * rate limit for this endpoint is 60 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -2374,7 +2376,7 @@ public UpdateUserGroup200Response updateUserGroup( } /** - * Update User Group Updates a user group for a Workspace. When called, this endpoint may + * Update User Group Updates a user group for a Workspace. • When called, this endpoint may * generate the `User Group Updated` event in the [audit trail](/tag/Audit-Trail). The * rate limit for this endpoint is 60 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -2404,7 +2406,7 @@ public ApiResponse updateUserGroupWithHttpInfo( } /** - * Update User Group (asynchronously) Updates a user group for a Workspace. When called, this + * Update User Group (asynchronously) Updates a user group for a Workspace. • When called, this * endpoint may generate the `User Group Updated` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 3f4dbe23..0029bb08 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -189,8 +189,8 @@ private okhttp3.Call addPermissionsToUserValidateBeforeCall( } /** - * Add Permissions to User Adds a list of access permissions to a user. When called, this - * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * + * Add Permissions to User Adds a list of access permissions to a user. • When called, this + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -219,8 +219,8 @@ public AddPermissionsToUser200Response addPermissionsToUser( } /** - * Add Permissions to User Adds a list of access permissions to a user. When called, this - * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * + * Add Permissions to User Adds a list of access permissions to a user. • When called, this + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* * Policy Created * User Policy Updated The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -250,9 +250,9 @@ public ApiResponse addPermissionsToUserWithHttp } /** - * Add Permissions to User (asynchronously) Adds a list of access permissions to a user. When + * Add Permissions to User (asynchronously) Adds a list of access permissions to a user. • When * called, this endpoint may generate one or more of the following [audit - * trail](/tag/Audit-Trail) events: * Policy Created * User Policy Updated The rate limit for + * trail](/tag/Audit-Trail) events:* Policy Created * User Policy Updated The rate limit for * this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more @@ -383,8 +383,8 @@ private okhttp3.Call createInvitesValidateBeforeCall( } /** - * Create Invites Invites a list of users to join a Workspace. When called, this endpoint may - * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Non-Segment + * Create Invites Invites a list of users to join a Workspace. • When called, this endpoint may + * generate one or more of the following [audit trail](/tag/Audit-Trail) events:* Non-Segment * User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API * omitted fields: - `parent` The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, @@ -412,8 +412,8 @@ public CreateInvites200Response createInvites(CreateInvitesV1Input createInvites } /** - * Create Invites Invites a list of users to join a Workspace. When called, this endpoint may - * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Non-Segment + * Create Invites Invites a list of users to join a Workspace. • When called, this endpoint may + * generate one or more of the following [audit trail](/tag/Audit-Trail) events:* Non-Segment * User Invited to Workspace * Policy Created * New Segment User Invited to Workspace Config API * omitted fields: - `parent` The rate limit for this endpoint is 60 requests per * minute, which is lower than the default due to access pattern restrictions. Once reached, @@ -441,14 +441,13 @@ public ApiResponse createInvitesWithHttpInfo( } /** - * Create Invites (asynchronously) Invites a list of users to join a Workspace. When called, + * Create Invites (asynchronously) Invites a list of users to join a Workspace. • When called, * this endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) - * events: * Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited - * to Workspace Config API omitted fields: - `parent` The rate limit for this endpoint - * is 60 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * events:* Non-Segment User Invited to Workspace * Policy Created * New Segment User Invited to + * Workspace Config API omitted fields: - `parent` The rate limit for this endpoint is + * 60 requests per minute, which is lower than the default due to access pattern restrictions. + * Once reached, this endpoint will respond with the 429 HTTP status code with headers + * indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param createInvitesV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -572,10 +571,10 @@ private okhttp3.Call deleteInvitesValidateBeforeCall( } /** - * Delete Invites Removes a list of invitations to join a Workspace. When called, this endpoint - * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Invite - * Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per - * minute, which is lower than the default due to access pattern restrictions. Once reached, + * Delete Invites Removes a list of invitations to join a Workspace. • When called, this + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* + * Invite Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * @@ -599,10 +598,10 @@ public DeleteInvites200Response deleteInvites(List emails) throws ApiExc } /** - * Delete Invites Removes a list of invitations to join a Workspace. When called, this endpoint - * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Invite - * Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests per - * minute, which is lower than the default due to access pattern restrictions. Once reached, + * Delete Invites Removes a list of invitations to join a Workspace. • When called, this + * endpoint may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* + * Invite Deleted * Group Memberships Deleted The rate limit for this endpoint is 60 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * @@ -628,9 +627,9 @@ public ApiResponse deleteInvitesWithHttpInfo(List userIds) throws ApiExcept } /** - * Delete Users Removes one or multiple users. When called, this endpoint may generate the + * Delete Users Removes one or multiple users. • When called, this endpoint may generate the * `Group Memberships Deleted` event in the [audit trail](/tag/Audit-Trail). The rate * limit for this endpoint is 60 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -810,7 +809,7 @@ public ApiResponse deleteUsersWithHttpInfo(List } /** - * Delete Users (asynchronously) Removes one or multiple users. When called, this endpoint may + * Delete Users (asynchronously) Removes one or multiple users. • When called, this endpoint may * generate the `Group Memberships Deleted` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint @@ -1635,8 +1634,8 @@ private okhttp3.Call replacePermissionsForUserValidateBeforeCall( } /** - * Replace Permissions for User Updates the list of access permissions for a user. When called, - * this endpoint may generate the `Policy Deleted` event in the [audit + * Replace Permissions for User Updates the list of access permissions for a user. • When + * called, this endpoint may generate the `Policy Deleted` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint * will respond with the 429 HTTP status code with headers indicating the limit parameters. See @@ -1665,8 +1664,8 @@ public ReplacePermissionsForUser200Response replacePermissionsForUser( } /** - * Replace Permissions for User Updates the list of access permissions for a user. When called, - * this endpoint may generate the `Policy Deleted` event in the [audit + * Replace Permissions for User Updates the list of access permissions for a user. • When + * called, this endpoint may generate the `Policy Deleted` event in the [audit * trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint * will respond with the 429 HTTP status code with headers indicating the limit parameters. See @@ -1699,7 +1698,7 @@ public ApiResponse replacePermissionsForUs /** * Replace Permissions for User (asynchronously) Updates the list of access permissions for a - * user. When called, this endpoint may generate the `Policy Deleted` event in the + * user. • When called, this endpoint may generate the `Policy Deleted` event in the * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, * which is lower than the default due to access pattern restrictions. Once reached, this * endpoint will respond with the 429 HTTP status code with headers indicating the limit diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index 2ca43ac6..10e9ebe8 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -163,7 +163,7 @@ private okhttp3.Call createLabelValidateBeforeCall( } /** - * Create Label Creates a new label. When called, this endpoint may generate the `Label + * Create Label Creates a new label. • When called, this endpoint may generate the `Label * Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint * is 60 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with @@ -191,7 +191,7 @@ public CreateLabel200Response createLabel(CreateLabelV1Input createLabelV1Input) } /** - * Create Label Creates a new label. When called, this endpoint may generate the `Label + * Create Label Creates a new label. • When called, this endpoint may generate the `Label * Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint * is 60 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with @@ -219,7 +219,7 @@ public ApiResponse createLabelWithHttpInfo( } /** - * Create Label (asynchronously) Creates a new label. When called, this endpoint may generate + * Create Label (asynchronously) Creates a new label. • When called, this endpoint may generate * the `Label Created` event in the [audit trail](/tag/Audit-Trail). The rate limit * for this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code @@ -355,7 +355,7 @@ private okhttp3.Call deleteLabelValidateBeforeCall( } /** - * Delete Label Deletes a label. When called, this endpoint may generate the `Label + * Delete Label Deletes a label. • When called, this endpoint may generate the `Label * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint * is 60 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with @@ -382,7 +382,7 @@ public DeleteLabel200Response deleteLabel(String key, String value) throws ApiEx } /** - * Delete Label Deletes a label. When called, this endpoint may generate the `Label + * Delete Label Deletes a label. • When called, this endpoint may generate the `Label * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint * is 60 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with @@ -411,7 +411,7 @@ public ApiResponse deleteLabelWithHttpInfo(String key, S } /** - * Delete Label (asynchronously) Deletes a label. When called, this endpoint may generate the + * Delete Label (asynchronously) Deletes a label. • When called, this endpoint may generate the * `Label Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for * this endpoint is 60 requests per minute, which is lower than the default due to access * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index c1d41745..7b7ee5b6 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -1256,7 +1256,7 @@ private okhttp3.Call updateSelectiveSyncForWarehouseValidateBeforeCall( /** * Update Selective Sync for Warehouse Configures the schema for a Warehouse, including Sources, - * Collections, and Properties. When called, this endpoint may generate the `Storage + * Collections, and Properties. • When called, this endpoint may generate the `Storage * Destination Modified` event in the [audit trail](/tag/Audit-Trail). The rate limit for * this endpoint is 2 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with @@ -1289,7 +1289,7 @@ public UpdateSelectiveSyncForWarehouse200Response updateSelectiveSyncForWarehous /** * Update Selective Sync for Warehouse Configures the schema for a Warehouse, including Sources, - * Collections, and Properties. When called, this endpoint may generate the `Storage + * Collections, and Properties. • When called, this endpoint may generate the `Storage * Destination Modified` event in the [audit trail](/tag/Audit-Trail). The rate limit for * this endpoint is 2 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with @@ -1325,7 +1325,7 @@ public UpdateSelectiveSyncForWarehouse200Response updateSelectiveSyncForWarehous /** * Update Selective Sync for Warehouse (asynchronously) Configures the schema for a Warehouse, - * including Sources, Collections, and Properties. When called, this endpoint may generate the + * including Sources, Collections, and Properties. • When called, this endpoint may generate the * `Storage Destination Modified` event in the [audit trail](/tag/Audit-Trail). The * rate limit for this endpoint is 2 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index 2c95b01a..d7ac8128 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -193,7 +193,7 @@ private okhttp3.Call addLabelsToSourceValidateBeforeCall( } /** - * Add Labels to Source Adds an existing label to a Source. When called, this endpoint may + * Add Labels to Source Adds an existing label to a Source. • When called, this endpoint may * generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) @@ -219,7 +219,7 @@ public AddLabelsToSource200Response addLabelsToSource( } /** - * Add Labels to Source Adds an existing label to a Source. When called, this endpoint may + * Add Labels to Source Adds an existing label to a Source. • When called, this endpoint may * generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) @@ -246,7 +246,7 @@ public ApiResponse addLabelsToSourceWithHttpInfo( } /** - * Add Labels to Source (asynchronously) Adds an existing label to a Source. When called, this + * Add Labels to Source (asynchronously) Adds an existing label to a Source. • When called, this * endpoint may generate the `Source Modified` event in the [audit * trail](/tag/Audit-Trail). * @@ -374,8 +374,8 @@ private okhttp3.Call createSourceValidateBeforeCall( } /** - * Create Source Creates a new Source. When called, this endpoint may generate the `Source - * Created` event in the [audit trail](/tag/Audit-Trail). + * Create Source Creates a new Source. • When called, this endpoint may generate the + * `Source Created` event in the [audit trail](/tag/Audit-Trail). * * @param createSourceV1Input (required) * @return CreateSource200Response @@ -398,8 +398,8 @@ public CreateSource200Response createSource(CreateSourceV1Input createSourceV1In } /** - * Create Source Creates a new Source. When called, this endpoint may generate the `Source - * Created` event in the [audit trail](/tag/Audit-Trail). + * Create Source Creates a new Source. • When called, this endpoint may generate the + * `Source Created` event in the [audit trail](/tag/Audit-Trail). * * @param createSourceV1Input (required) * @return ApiResponse<CreateSource200Response> @@ -422,8 +422,8 @@ public ApiResponse createSourceWithHttpInfo( } /** - * Create Source (asynchronously) Creates a new Source. When called, this endpoint may generate - * the `Source Created` event in the [audit trail](/tag/Audit-Trail). + * Create Source (asynchronously) Creates a new Source. • When called, this endpoint may + * generate the `Source Created` event in the [audit trail](/tag/Audit-Trail). * * @param createSourceV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -544,7 +544,7 @@ private okhttp3.Call deleteSourceValidateBeforeCall( } /** - * Delete Source Deletes an existing Source. When called, this endpoint may generate the + * Delete Source Deletes an existing Source. • When called, this endpoint may generate the * `Source Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) @@ -566,7 +566,7 @@ public DeleteSource200Response deleteSource(String sourceId) throws ApiException } /** - * Delete Source Deletes an existing Source. When called, this endpoint may generate the + * Delete Source Deletes an existing Source. • When called, this endpoint may generate the * `Source Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) @@ -590,7 +590,7 @@ public ApiResponse deleteSourceWithHttpInfo(String sour } /** - * Delete Source (asynchronously) Deletes an existing Source. When called, this endpoint may + * Delete Source (asynchronously) Deletes an existing Source. • When called, this endpoint may * generate the `Source Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param sourceId (required) @@ -2033,9 +2033,9 @@ private okhttp3.Call updateSourceValidateBeforeCall( } /** - * Update Source Updates an existing Source. When called, this endpoint may generate one or more - * of the following [audit trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * - * Source Settings Modified * Source Disabled Config API omitted fields: - + * Update Source Updates an existing Source. • When called, this endpoint may generate one or + * more of the following [audit trail](/tag/Audit-Trail) events:* Source Modified * Source + * Enabled * Source Settings Modified * Source Disabled Config API omitted fields: - * `updateMask` * * @param sourceId (required) @@ -2060,9 +2060,9 @@ public UpdateSource200Response updateSource( } /** - * Update Source Updates an existing Source. When called, this endpoint may generate one or more - * of the following [audit trail](/tag/Audit-Trail) events: * Source Modified * Source Enabled * - * Source Settings Modified * Source Disabled Config API omitted fields: - + * Update Source Updates an existing Source. • When called, this endpoint may generate one or + * more of the following [audit trail](/tag/Audit-Trail) events:* Source Modified * Source + * Enabled * Source Settings Modified * Source Disabled Config API omitted fields: - * `updateMask` * * @param sourceId (required) @@ -2088,8 +2088,8 @@ public ApiResponse updateSourceWithHttpInfo( } /** - * Update Source (asynchronously) Updates an existing Source. When called, this endpoint may - * generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Source + * Update Source (asynchronously) Updates an existing Source. • When called, this endpoint may + * generate one or more of the following [audit trail](/tag/Audit-Trail) events:* Source * Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted * fields: - `updateMask` * diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 150f573a..687470a9 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -178,7 +178,11 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( } /** - * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. + * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Spaces feature enabled. Please reach out to your customer success manager + * for more information. * * @param spaceId (required) * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) @@ -207,7 +211,11 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( } /** - * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. + * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Spaces feature enabled. Please reach out to your customer success manager + * for more information. * * @param spaceId (required) * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) @@ -239,7 +247,10 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( /** * Batch Query Messaging Subscriptions for Space (asynchronously) Get Messaging Subscriptions - * for space. + * for space. • This endpoint is in **Alpha** testing. Please submit any feedback by sending + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Spaces feature enabled. Please reach out to your customer success + * manager for more information. * * @param spaceId (required) * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) @@ -363,7 +374,10 @@ private okhttp3.Call getSpaceValidateBeforeCall(String spaceId, final ApiCallbac } /** - * Get Space Returns the Space by id. + * Get Space Returns the Space by id. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out + * to your customer success manager for more information. * * @param spaceId (required) * @return GetSpace200Response @@ -384,7 +398,10 @@ public GetSpace200Response getSpace(String spaceId) throws ApiException { } /** - * Get Space Returns the Space by id. + * Get Space Returns the Space by id. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out + * to your customer success manager for more information. * * @param spaceId (required) * @return ApiResponse<GetSpace200Response> @@ -407,7 +424,10 @@ public ApiResponse getSpaceWithHttpInfo(String spaceId) } /** - * Get Space (asynchronously) Returns the Space by id. + * Get Space (asynchronously) Returns the Space by id. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Spaces feature + * enabled. Please reach out to your customer success manager for more information. * * @param spaceId (required) * @param _callback The callback to be executed when the API call finishes @@ -542,10 +562,13 @@ private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall( } /** - * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. The rate - * limit for this endpoint is 60 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate + * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Spaces feature enabled. Please reach out to your customer success manager + * for more information. The rate limit for this endpoint is 60 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -574,10 +597,13 @@ public ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscrip } /** - * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. The rate - * limit for this endpoint is 60 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate + * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Spaces feature enabled. Please reach out to your customer success manager + * for more information. The rate limit for this endpoint is 60 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -610,10 +636,13 @@ public ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscrip /** * Replace Messaging Subscriptions in Spaces (asynchronously) Replace Messaging Subscriptions in - * Spaces. The rate limit for this endpoint is 60 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * Spaces. • This endpoint is in **Alpha** testing. Please submit any feedback by sending email + * to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Spaces feature enabled. Please reach out to your customer success + * manager for more information. The rate limit for this endpoint is 60 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index ac199d8e..ad4b6567 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -196,11 +196,11 @@ private okhttp3.Call addSourceToTrackingPlanValidateBeforeCall( } /** - * Add Source to Tracking Plan Connects a Source to a Tracking Plan. When called, this endpoint - * may generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * Add Source to Tracking Plan Connects a Source to a Tracking Plan. • When called, this + * endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param trackingPlanId (required) * @param addSourceToTrackingPlanV1Input (required) @@ -225,11 +225,11 @@ public AddSourceToTrackingPlan200Response addSourceToTrackingPlan( } /** - * Add Source to Tracking Plan Connects a Source to a Tracking Plan. When called, this endpoint - * may generate the `Source Modified` event in the [audit trail](/tag/Audit-Trail). - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * Add Source to Tracking Plan Connects a Source to a Tracking Plan. • When called, this + * endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param trackingPlanId (required) * @param addSourceToTrackingPlanV1Input (required) @@ -256,11 +256,11 @@ public ApiResponse addSourceToTrackingPlanWi } /** - * Add Source to Tracking Plan (asynchronously) Connects a Source to a Tracking Plan. When + * Add Source to Tracking Plan (asynchronously) Connects a Source to a Tracking Plan. • When * called, this endpoint may generate the `Source Modified` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param trackingPlanId (required) * @param addSourceToTrackingPlanV1Input (required) @@ -387,9 +387,9 @@ private okhttp3.Call createTrackingPlanValidateBeforeCall( } /** - * Create Tracking Plan Creates a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Create Tracking Plan Creates a Tracking Plan. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param createTrackingPlanV1Input (required) * @return CreateTrackingPlan200Response @@ -412,9 +412,9 @@ public CreateTrackingPlan200Response createTrackingPlan( } /** - * Create Tracking Plan Creates a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Create Tracking Plan Creates a Tracking Plan. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param createTrackingPlanV1Input (required) * @return ApiResponse<CreateTrackingPlan200Response> @@ -438,9 +438,9 @@ public ApiResponse createTrackingPlanWithHttpInfo } /** - * Create Tracking Plan (asynchronously) Creates a Tracking Plan. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Create Tracking Plan (asynchronously) Creates a Tracking Plan. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. * * @param createTrackingPlanV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -563,9 +563,9 @@ private okhttp3.Call deleteTrackingPlanValidateBeforeCall( } /** - * Delete Tracking Plan Deletes a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Delete Tracking Plan Deletes a Tracking Plan. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param trackingPlanId (required) * @return DeleteTrackingPlan200Response @@ -588,9 +588,9 @@ public DeleteTrackingPlan200Response deleteTrackingPlan(String trackingPlanId) } /** - * Delete Tracking Plan Deletes a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Delete Tracking Plan Deletes a Tracking Plan. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param trackingPlanId (required) * @return ApiResponse<DeleteTrackingPlan200Response> @@ -613,9 +613,9 @@ public ApiResponse deleteTrackingPlanWithHttpInfo } /** - * Delete Tracking Plan (asynchronously) Deletes a Tracking Plan. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Delete Tracking Plan (asynchronously) Deletes a Tracking Plan. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param _callback The callback to be executed when the API call finishes @@ -736,9 +736,9 @@ private okhttp3.Call getTrackingPlanValidateBeforeCall( } /** - * Get Tracking Plan Returns a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Get Tracking Plan Returns a Tracking Plan. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param trackingPlanId (required) * @return GetTrackingPlan200Response @@ -760,9 +760,9 @@ public GetTrackingPlan200Response getTrackingPlan(String trackingPlanId) throws } /** - * Get Tracking Plan Returns a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Get Tracking Plan Returns a Tracking Plan. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param trackingPlanId (required) * @return ApiResponse<GetTrackingPlan200Response> @@ -785,9 +785,9 @@ public ApiResponse getTrackingPlanWithHttpInfo( } /** - * Get Tracking Plan (asynchronously) Returns a Tracking Plan. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Get Tracking Plan (asynchronously) Returns a Tracking Plan. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param _callback The callback to be executed when the API call finishes @@ -923,12 +923,12 @@ private okhttp3.Call listRulesFromTrackingPlanValidateBeforeCall( } /** - * List Rules from Tracking Plan Lists Tracking Plan rules. **Note**: In order to successfully - * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 20 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * List Rules from Tracking Plan Lists Tracking Plan rules. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 20 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param trackingPlanId (required) @@ -953,12 +953,12 @@ public ListRulesFromTrackingPlan200Response listRulesFromTrackingPlan( } /** - * List Rules from Tracking Plan Lists Tracking Plan rules. **Note**: In order to successfully - * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 20 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * List Rules from Tracking Plan Lists Tracking Plan rules. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 20 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param trackingPlanId (required) @@ -985,11 +985,11 @@ public ApiResponse listRulesFromTrackingPl } /** - * List Rules from Tracking Plan (asynchronously) Lists Tracking Plan rules. **Note**: In order - * to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 20 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * List Rules from Tracking Plan (asynchronously) Lists Tracking Plan rules. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 20 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -1132,9 +1132,9 @@ private okhttp3.Call listSourcesFromTrackingPlanValidateBeforeCall( } /** - * List Sources from Tracking Plan Lists Sources connected to a Tracking Plan. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. This + * List Sources from Tracking Plan Lists Sources connected to a Tracking Plan. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. This * endpoint requires the user to have at least the following permission(s): * Source Read-only * * Tracking Plan Read-only * @@ -1160,9 +1160,9 @@ public ListSourcesFromTrackingPlan200Response listSourcesFromTrackingPlan( } /** - * List Sources from Tracking Plan Lists Sources connected to a Tracking Plan. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. This + * List Sources from Tracking Plan Lists Sources connected to a Tracking Plan. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. This * endpoint requires the user to have at least the following permission(s): * Source Read-only * * Tracking Plan Read-only * @@ -1192,8 +1192,8 @@ public ListSourcesFromTrackingPlan200Response listSourcesFromTrackingPlan( /** * List Sources from Tracking Plan (asynchronously) Lists Sources connected to a Tracking Plan. - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Protocols feature enabled. Please reach out to your customer success manager for more * information. This endpoint requires the user to have at least the following permission(s): * * Source Read-only * Tracking Plan Read-only * @@ -1330,9 +1330,9 @@ private okhttp3.Call listTrackingPlansValidateBeforeCall( } /** - * List Tracking Plans Returns a list of Tracking Plans. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please - * reach out to your customer success manager for more information. + * List Tracking Plans Returns a list of Tracking Plans. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. * * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This * parameter exists in v1. (optional) @@ -1357,9 +1357,9 @@ public ListTrackingPlans200Response listTrackingPlans(String type, PaginationInp } /** - * List Tracking Plans Returns a list of Tracking Plans. **Note**: In order to successfully call - * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please - * reach out to your customer success manager for more information. + * List Tracking Plans Returns a list of Tracking Plans. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach + * out to your customer success manager for more information. * * @param type Requests Tracking Plans of a certain type. If omitted, lists all types. This * parameter exists in v1. (optional) @@ -1384,7 +1384,7 @@ public ApiResponse listTrackingPlansWithHttpInfo( } /** - * List Tracking Plans (asynchronously) Returns a list of Tracking Plans. **Note**: In order to + * List Tracking Plans (asynchronously) Returns a list of Tracking Plans. • In order to * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. * @@ -1528,9 +1528,9 @@ private okhttp3.Call removeRulesFromTrackingPlanValidateBeforeCall( } /** - * Remove Rules from Tracking Plan Deletes Tracking Plan rules. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Remove Rules from Tracking Plan Deletes Tracking Plan rules. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param rules Rules to delete. This parameter exists in v1. (required) @@ -1554,9 +1554,9 @@ public RemoveRulesFromTrackingPlan200Response removeRulesFromTrackingPlan( } /** - * Remove Rules from Tracking Plan Deletes Tracking Plan rules. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Remove Rules from Tracking Plan Deletes Tracking Plan rules. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param rules Rules to delete. This parameter exists in v1. (required) @@ -1583,9 +1583,9 @@ public RemoveRulesFromTrackingPlan200Response removeRulesFromTrackingPlan( } /** - * Remove Rules from Tracking Plan (asynchronously) Deletes Tracking Plan rules. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. + * Remove Rules from Tracking Plan (asynchronously) Deletes Tracking Plan rules. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param rules Rules to delete. This parameter exists in v1. (required) @@ -1727,11 +1727,11 @@ private okhttp3.Call removeSourceFromTrackingPlanValidateBeforeCall( } /** - * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. When called, this - * endpoint may generate the `Source Modified` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. • When called, + * this endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param trackingPlanId (required) * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: @@ -1756,11 +1756,11 @@ public RemoveSourceFromTrackingPlan200Response removeSourceFromTrackingPlan( } /** - * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. When called, this - * endpoint may generate the `Source Modified` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * Remove Source from Tracking Plan Disconnects a Source from a Tracking Plan. • When called, + * this endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param trackingPlanId (required) * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: @@ -1789,10 +1789,10 @@ public RemoveSourceFromTrackingPlan200Response removeSourceFromTrackingPlan( /** * Remove Source from Tracking Plan (asynchronously) Disconnects a Source from a Tracking Plan. - * When called, this endpoint may generate the `Source Modified` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * • When called, this endpoint may generate the `Source Modified` event in the [audit + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param trackingPlanId (required) * @param sourceId The id of the Source associated with the Tracking Plan. Config API note: @@ -1938,9 +1938,9 @@ private okhttp3.Call replaceRulesInTrackingPlanValidateBeforeCall( } /** - * Replace Rules in Tracking Plan Replaces Tracking Plan rules. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Replace Rules in Tracking Plan Replaces Tracking Plan rules. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param replaceRulesInTrackingPlanV1Input (required) @@ -1967,9 +1967,9 @@ public ReplaceRulesInTrackingPlan200Response replaceRulesInTrackingPlan( } /** - * Replace Rules in Tracking Plan Replaces Tracking Plan rules. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * Replace Rules in Tracking Plan Replaces Tracking Plan rules. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param replaceRulesInTrackingPlanV1Input (required) @@ -1999,9 +1999,9 @@ public ReplaceRulesInTrackingPlan200Response replaceRulesInTrackingPlan( } /** - * Replace Rules in Tracking Plan (asynchronously) Replaces Tracking Plan rules. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. + * Replace Rules in Tracking Plan (asynchronously) Replaces Tracking Plan rules. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param replaceRulesInTrackingPlanV1Input (required) @@ -2147,9 +2147,9 @@ private okhttp3.Call updateRulesInTrackingPlanValidateBeforeCall( } /** - * Update Rules in Tracking Plan Updates Tracking Plan rules. **Note**: In order to successfully - * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. - * Please reach out to your customer success manager for more information. + * Update Rules in Tracking Plan Updates Tracking Plan rules. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param updateRulesInTrackingPlanV1Input (required) @@ -2176,9 +2176,9 @@ public UpdateRulesInTrackingPlan200Response updateRulesInTrackingPlan( } /** - * Update Rules in Tracking Plan Updates Tracking Plan rules. **Note**: In order to successfully - * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. - * Please reach out to your customer success manager for more information. + * Update Rules in Tracking Plan Updates Tracking Plan rules. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param updateRulesInTrackingPlanV1Input (required) @@ -2207,9 +2207,9 @@ public ApiResponse updateRulesInTrackingPl } /** - * Update Rules in Tracking Plan (asynchronously) Updates Tracking Plan rules. **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols - * feature enabled. Please reach out to your customer success manager for more information. + * Update Rules in Tracking Plan (asynchronously) Updates Tracking Plan rules. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Protocols feature + * enabled. Please reach out to your customer success manager for more information. * * @param trackingPlanId (required) * @param updateRulesInTrackingPlanV1Input (required) @@ -2354,9 +2354,9 @@ private okhttp3.Call updateTrackingPlanValidateBeforeCall( } /** - * Update Tracking Plan Updates a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. Config API omitted fields: - + * Update Tracking Plan Updates a Tracking Plan. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. Config API omitted fields: - * `updateMask` * * @param trackingPlanId (required) @@ -2382,9 +2382,9 @@ public UpdateTrackingPlan200Response updateTrackingPlan( } /** - * Update Tracking Plan Updates a Tracking Plan. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. Config API omitted fields: - + * Update Tracking Plan Updates a Tracking Plan. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. Config API omitted fields: - * `updateMask` * * @param trackingPlanId (required) @@ -2412,10 +2412,10 @@ public ApiResponse updateTrackingPlanWithHttpInfo } /** - * Update Tracking Plan (asynchronously) Updates a Tracking Plan. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. Config API - * omitted fields: - `updateMask` + * Update Tracking Plan (asynchronously) Updates a Tracking Plan. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. Config API omitted + * fields: - `updateMask` * * @param trackingPlanId (required) * @param updateTrackingPlanV1Input (required) diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index faf9ad16..e7b4a01b 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -168,11 +168,10 @@ private okhttp3.Call createTransformationValidateBeforeCall( } /** - * Create Transformation Creates a new Transformation. When called, this endpoint may generate - * the `Transformation Created` event in the [audit trail](/tag/Audit-Trail). - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * Create Transformation Creates a new Transformation. • When called, this endpoint may generate + * the `Transformation Created` event in the [audit trail](/tag/Audit-Trail). • In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. * * @param createTransformationV1Input (required) * @return CreateTransformation200Response @@ -195,11 +194,10 @@ public CreateTransformation200Response createTransformation( } /** - * Create Transformation Creates a new Transformation. When called, this endpoint may generate - * the `Transformation Created` event in the [audit trail](/tag/Audit-Trail). - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * Create Transformation Creates a new Transformation. • When called, this endpoint may generate + * the `Transformation Created` event in the [audit trail](/tag/Audit-Trail). • In + * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. * * @param createTransformationV1Input (required) * @return ApiResponse<CreateTransformation200Response> @@ -223,11 +221,11 @@ public ApiResponse createTransformationWithHttp } /** - * Create Transformation (asynchronously) Creates a new Transformation. When called, this + * Create Transformation (asynchronously) Creates a new Transformation. • When called, this * endpoint may generate the `Transformation Created` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param createTransformationV1Input (required) * @param _callback The callback to be executed when the API call finishes @@ -350,9 +348,9 @@ private okhttp3.Call deleteTransformationValidateBeforeCall( } /** - * Delete Transformation Deletes a Transformation. When called, this endpoint may generate the - * `Transformation Deleted` event in the [audit trail](/tag/Audit-Trail). **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * Delete Transformation Deletes a Transformation. • When called, this endpoint may generate the + * `Transformation Deleted` event in the [audit trail](/tag/Audit-Trail). • In order + * to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * * @param transformationId (required) @@ -376,9 +374,9 @@ public DeleteTransformation200Response deleteTransformation(String transformatio } /** - * Delete Transformation Deletes a Transformation. When called, this endpoint may generate the - * `Transformation Deleted` event in the [audit trail](/tag/Audit-Trail). **Note**: In - * order to successfully call this endpoint, the specified Workspace needs to have the Protocols + * Delete Transformation Deletes a Transformation. • When called, this endpoint may generate the + * `Transformation Deleted` event in the [audit trail](/tag/Audit-Trail). • In order + * to successfully call this endpoint, the specified Workspace needs to have the Protocols * feature enabled. Please reach out to your customer success manager for more information. * * @param transformationId (required) @@ -402,11 +400,11 @@ public ApiResponse deleteTransformationWithHttp } /** - * Delete Transformation (asynchronously) Deletes a Transformation. When called, this endpoint + * Delete Transformation (asynchronously) Deletes a Transformation. • When called, this endpoint * may generate the `Transformation Deleted` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param transformationId (required) * @param _callback The callback to be executed when the API call finishes @@ -528,9 +526,9 @@ private okhttp3.Call getTransformationValidateBeforeCall( } /** - * Get Transformation Gets a Transformation. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Get Transformation Gets a Transformation. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param transformationId (required) * @return GetTransformation200Response @@ -553,9 +551,9 @@ public GetTransformation200Response getTransformation(String transformationId) } /** - * Get Transformation Gets a Transformation. **Note**: In order to successfully call this - * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach - * out to your customer success manager for more information. + * Get Transformation Gets a Transformation. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Protocols feature enabled. Please reach out to your + * customer success manager for more information. * * @param transformationId (required) * @return ApiResponse<GetTransformation200Response> @@ -578,9 +576,9 @@ public ApiResponse getTransformationWithHttpInfo( } /** - * Get Transformation (asynchronously) Gets a Transformation. **Note**: In order to successfully - * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. - * Please reach out to your customer success manager for more information. + * Get Transformation (asynchronously) Gets a Transformation. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Protocols feature enabled. Please + * reach out to your customer success manager for more information. * * @param transformationId (required) * @param _callback The callback to be executed when the API call finishes @@ -702,9 +700,9 @@ private okhttp3.Call listTransformationsValidateBeforeCall( } /** - * List Transformations Lists all Transformations in the Workspace. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * List Transformations Lists all Transformations in the Workspace. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. * * @param pagination Pagination options. This parameter exists in v1. (required) * @return ListTransformations200Response @@ -727,9 +725,9 @@ public ListTransformations200Response listTransformations(PaginationInput pagina } /** - * List Transformations Lists all Transformations in the Workspace. **Note**: In order to - * successfully call this endpoint, the specified Workspace needs to have the Protocols feature - * enabled. Please reach out to your customer success manager for more information. + * List Transformations Lists all Transformations in the Workspace. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Protocols feature enabled. + * Please reach out to your customer success manager for more information. * * @param pagination Pagination options. This parameter exists in v1. (required) * @return ApiResponse<ListTransformations200Response> @@ -752,10 +750,9 @@ public ApiResponse listTransformationsWithHttpIn } /** - * List Transformations (asynchronously) Lists all Transformations in the Workspace. **Note**: - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Protocols feature enabled. Please reach out to your customer success manager for more - * information. + * List Transformations (asynchronously) Lists all Transformations in the Workspace. • In order + * to successfully call this endpoint, the specified Workspace needs to have the Protocols + * feature enabled. Please reach out to your customer success manager for more information. * * @param pagination Pagination options. This parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes @@ -894,10 +891,10 @@ private okhttp3.Call updateTransformationValidateBeforeCall( } /** - * Update Transformation Updates an existing Transformation. When called, this endpoint may + * Update Transformation Updates an existing Transformation. • When called, this endpoint may * generate the `Transformation Updated` event in the [audit trail](/tag/Audit-Trail). - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Protocols feature enabled. Please reach out to your customer success manager for more * information. * * @param transformationId (required) @@ -923,10 +920,10 @@ public UpdateTransformation200Response updateTransformation( } /** - * Update Transformation Updates an existing Transformation. When called, this endpoint may + * Update Transformation Updates an existing Transformation. • When called, this endpoint may * generate the `Transformation Updated` event in the [audit trail](/tag/Audit-Trail). - * **Note**: In order to successfully call this endpoint, the specified Workspace needs to have - * the Protocols feature enabled. Please reach out to your customer success manager for more + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Protocols feature enabled. Please reach out to your customer success manager for more * information. * * @param transformationId (required) @@ -954,11 +951,11 @@ public ApiResponse updateTransformationWithHttp } /** - * Update Transformation (asynchronously) Updates an existing Transformation. When called, this - * endpoint may generate the `Transformation Updated` event in the [audit - * trail](/tag/Audit-Trail). **Note**: In order to successfully call this endpoint, the - * specified Workspace needs to have the Protocols feature enabled. Please reach out to your - * customer success manager for more information. + * Update Transformation (asynchronously) Updates an existing Transformation. • When called, + * this endpoint may generate the `Transformation Updated` event in the [audit + * trail](/tag/Audit-Trail). • In order to successfully call this endpoint, the specified + * Workspace needs to have the Protocols feature enabled. Please reach out to your customer + * success manager for more information. * * @param transformationId (required) * @param updateTransformationV1Input (required) diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index ad23bc33..9db9c77a 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -184,7 +184,7 @@ private okhttp3.Call addConnectionFromSourceToWarehouseValidateBeforeCall( } /** - * Add Connection from Source to Warehouse Connects a Source to a Warehouse. When called, this + * Add Connection from Source to Warehouse Connects a Source to a Warehouse. • When called, this * endpoint may generate the `Storage Destination Modified` event in the [audit * trail](/tag/Audit-Trail). * @@ -210,7 +210,7 @@ public AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWa } /** - * Add Connection from Source to Warehouse Connects a Source to a Warehouse. When called, this + * Add Connection from Source to Warehouse Connects a Source to a Warehouse. • When called, this * endpoint may generate the `Storage Destination Modified` event in the [audit * trail](/tag/Audit-Trail). * @@ -239,7 +239,7 @@ public AddConnectionFromSourceToWarehouse200Response addConnectionFromSourceToWa } /** - * Add Connection from Source to Warehouse (asynchronously) Connects a Source to a Warehouse. + * Add Connection from Source to Warehouse (asynchronously) Connects a Source to a Warehouse. • * When called, this endpoint may generate the `Storage Destination Modified` event in * the [audit trail](/tag/Audit-Trail). * @@ -372,7 +372,7 @@ private okhttp3.Call createValidationInWarehouseValidateBeforeCall( } /** - * Create Validation in Warehouse Validates input settings against a Warehouse. When called, + * Create Validation in Warehouse Validates input settings against a Warehouse. • When called, * this endpoint may generate the `Storage Destination Settings Validation` event in * the [audit trail](/tag/Audit-Trail). * @@ -398,7 +398,7 @@ public CreateValidationInWarehouse200Response createValidationInWarehouse( } /** - * Create Validation in Warehouse Validates input settings against a Warehouse. When called, + * Create Validation in Warehouse Validates input settings against a Warehouse. • When called, * this endpoint may generate the `Storage Destination Settings Validation` event in * the [audit trail](/tag/Audit-Trail). * @@ -429,7 +429,7 @@ public CreateValidationInWarehouse200Response createValidationInWarehouse( /** * Create Validation in Warehouse (asynchronously) Validates input settings against a Warehouse. - * When called, this endpoint may generate the `Storage Destination Settings + * • When called, this endpoint may generate the `Storage Destination Settings * Validation` event in the [audit trail](/tag/Audit-Trail). * * @param createValidationInWarehouseV1Input (required) @@ -556,7 +556,7 @@ private okhttp3.Call createWarehouseValidateBeforeCall( } /** - * Create Warehouse Creates a new Warehouse. When called, this endpoint may generate the + * Create Warehouse Creates a new Warehouse. • When called, this endpoint may generate the * `Storage Destination Created` event in the [audit trail](/tag/Audit-Trail). * * @param createWarehouseV1Input (required) @@ -580,7 +580,7 @@ public CreateWarehouse200Response createWarehouse(CreateWarehouseV1Input createW } /** - * Create Warehouse Creates a new Warehouse. When called, this endpoint may generate the + * Create Warehouse Creates a new Warehouse. • When called, this endpoint may generate the * `Storage Destination Created` event in the [audit trail](/tag/Audit-Trail). * * @param createWarehouseV1Input (required) @@ -604,7 +604,7 @@ public ApiResponse createWarehouseWithHttpInfo( } /** - * Create Warehouse (asynchronously) Creates a new Warehouse. When called, this endpoint may + * Create Warehouse (asynchronously) Creates a new Warehouse. • When called, this endpoint may * generate the `Storage Destination Created` event in the [audit * trail](/tag/Audit-Trail). * @@ -729,7 +729,7 @@ private okhttp3.Call deleteWarehouseValidateBeforeCall( } /** - * Delete Warehouse Deletes an existing Warehouse. When called, this endpoint may generate the + * Delete Warehouse Deletes an existing Warehouse. • When called, this endpoint may generate the * `Storage Destination Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param warehouseId (required) @@ -752,7 +752,7 @@ public DeleteWarehouse200Response deleteWarehouse(String warehouseId) throws Api } /** - * Delete Warehouse Deletes an existing Warehouse. When called, this endpoint may generate the + * Delete Warehouse Deletes an existing Warehouse. • When called, this endpoint may generate the * `Storage Destination Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param warehouseId (required) @@ -776,7 +776,7 @@ public ApiResponse deleteWarehouseWithHttpInfo(Strin } /** - * Delete Warehouse (asynchronously) Deletes an existing Warehouse. When called, this endpoint + * Delete Warehouse (asynchronously) Deletes an existing Warehouse. • When called, this endpoint * may generate the `Storage Destination Deleted` event in the [audit * trail](/tag/Audit-Trail). * @@ -1820,8 +1820,8 @@ private okhttp3.Call updateWarehouseValidateBeforeCall( } /** - * Update Warehouse Updates an existing Warehouse. When called, this endpoint may generate one - * or more of the following [audit trail](/tag/Audit-Trail) events: * Storage Destination + * Update Warehouse Updates an existing Warehouse. • When called, this endpoint may generate one + * or more of the following [audit trail](/tag/Audit-Trail) events:* Storage Destination * Modified * Storage Destination Enabled * * @param warehouseId (required) @@ -1846,8 +1846,8 @@ public UpdateWarehouse200Response updateWarehouse( } /** - * Update Warehouse Updates an existing Warehouse. When called, this endpoint may generate one - * or more of the following [audit trail](/tag/Audit-Trail) events: * Storage Destination + * Update Warehouse Updates an existing Warehouse. • When called, this endpoint may generate one + * or more of the following [audit trail](/tag/Audit-Trail) events:* Storage Destination * Modified * Storage Destination Enabled * * @param warehouseId (required) @@ -1873,8 +1873,8 @@ public ApiResponse updateWarehouseWithHttpInfo( } /** - * Update Warehouse (asynchronously) Updates an existing Warehouse. When called, this endpoint - * may generate one or more of the following [audit trail](/tag/Audit-Trail) events: * Storage + * Update Warehouse (asynchronously) Updates an existing Warehouse. • When called, this endpoint + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* Storage * Destination Modified * Storage Destination Enabled * * @param warehouseId (required) From 4e0512f0739bd51370fa56328c7f11365e1c3ac4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 19 Jan 2023 00:12:16 +0000 Subject: [PATCH 030/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b58ce15. From e34e29ae48a81ee820d5fc8ee2fadaba3a7c34a1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 20 Jan 2023 18:57:01 +0000 Subject: [PATCH 031/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2ce9baf. From 4d2ee7b38f8452dc3aa772fcd4ed350b940f974f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 20 Jan 2023 20:11:01 +0000 Subject: [PATCH 032/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@181c806. From b267a25d7882b70918e1453a1b8e1e73cedef187 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 20 Jan 2023 20:26:49 +0000 Subject: [PATCH 033/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b0efe8e. From dba5b69123a3ebd603c77c9d0e28051b2b463ed4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jan 2023 16:30:55 +0000 Subject: [PATCH 034/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@485ec37. From 5a98b5fbfae05080a2c949cebc786df888ab04e6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jan 2023 18:30:23 +0000 Subject: [PATCH 035/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4f2ee45. From 7275acc16bde81d5618243897a93d8c7aec25a33 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jan 2023 19:38:05 +0000 Subject: [PATCH 036/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e2499ec. From f3acf1d847f56124fffcc1f34ea3b6e3a75d86b2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jan 2023 21:04:00 +0000 Subject: [PATCH 037/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@73dcbd6. From 81d91e61489aae69a732803cdc1e22f91f29e63a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jan 2023 21:28:17 +0000 Subject: [PATCH 038/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9f0be49. From 5c06c5de2120ae0f1ab6c2be7d6f32b1a7d1d40b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 25 Jan 2023 16:09:26 +0000 Subject: [PATCH 039/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3651917. From 3d57d4a2b581d42ae8c55e167cd4ddd116938427 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 26 Jan 2023 16:52:32 +0000 Subject: [PATCH 040/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@290ffe1. From c3a6545cbe994854482c695a2d012513d50307e2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 1 Feb 2023 19:13:58 +0000 Subject: [PATCH 041/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6d90e23. --- src/main/java/com/segment/publicapi/JSON.java | 5 + .../GetEventsVolumeFromWorkspaceV1Output.java | 71 +- .../GetEventsVolumeFromWorkspaceV1Query.java | 681 ++++++++++++++++++ .../com/segment/publicapi/models/Query.java | 672 +++++++++++++++++ .../publicapi/models/SourceEventVolumeV1.java | 5 +- 5 files changed, 1429 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java create mode 100644 src/main/java/com/segment/publicapi/models/Query.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 5c5a4363..97e84a4d 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -575,6 +575,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Query + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetFilterInDestination200Response .CustomTypeAdapterFactory()); @@ -974,6 +977,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Query.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 1add9558..311eb714 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -39,6 +39,16 @@ "GetEventsVolumeFromWorkspaceV1Output represents the results given the input" + " query.") public class GetEventsVolumeFromWorkspaceV1Output { + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private Query query; + public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) @@ -51,6 +61,48 @@ public class GetEventsVolumeFromWorkspaceV1Output { public GetEventsVolumeFromWorkspaceV1Output() {} + public GetEventsVolumeFromWorkspaceV1Output path(String path) { + + this.path = path; + return this; + } + + /** + * Observability event volume path + * + * @return path + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Observability event volume path") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public GetEventsVolumeFromWorkspaceV1Output query(Query query) { + + this.query = query; + return this; + } + + /** + * Get query + * + * @return query + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Query getQuery() { + return query; + } + + public void setQuery(Query query) { + this.query = query; + } + public GetEventsVolumeFromWorkspaceV1Output result(List result) { this.result = result; @@ -115,19 +167,23 @@ public boolean equals(Object o) { } GetEventsVolumeFromWorkspaceV1Output getEventsVolumeFromWorkspaceV1Output = (GetEventsVolumeFromWorkspaceV1Output) o; - return Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) + return Objects.equals(this.path, getEventsVolumeFromWorkspaceV1Output.path) + && Objects.equals(this.query, getEventsVolumeFromWorkspaceV1Output.query) + && Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) && Objects.equals(this.pagination, getEventsVolumeFromWorkspaceV1Output.pagination); } @Override public int hashCode() { - return Objects.hash(result, pagination); + return Objects.hash(path, query, result, pagination); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetEventsVolumeFromWorkspaceV1Output {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" result: ").append(toIndentedString(result)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -151,11 +207,15 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("path"); + openapiFields.add("query"); openapiFields.add("result"); openapiFields.add("pagination"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("path"); + openapiRequiredFields.add("query"); openapiRequiredFields.add("result"); } @@ -201,6 +261,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `path` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("path").toString())); + } // ensure the json data is an array if (!jsonObj.get("result").isJsonArray()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java new file mode 100644 index 00000000..26e1c2fc --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java @@ -0,0 +1,681 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetEventVolumeOutputQuery represents the inout query sent to output */ +@ApiModel(description = "GetEventVolumeOutputQuery represents the inout query sent to output") +public class GetEventsVolumeFromWorkspaceV1Query { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + /** Granularity corresponds to the requested bucket granularity */ + @JsonAdapter(GranularityEnum.Adapter.class) + public enum GranularityEnum { + DAY("day"), + + HOUR("hour"), + + MINUTE("minute"); + + private String value; + + GranularityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GranularityEnum fromValue(String value) { + for (GranularityEnum b : GranularityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GranularityEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GranularityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GranularityEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_GRANULARITY = "granularity"; + + @SerializedName(SERIALIZED_NAME_GRANULARITY) + private GranularityEnum granularity; + + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + private String startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + private String endTime; + + public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; + + @SerializedName(SERIALIZED_NAME_GROUP_BY) + private List groupBy = null; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private List sourceId = null; + + public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; + + @SerializedName(SERIALIZED_NAME_EVENT_NAME) + private List eventName = null; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private List eventType = null; + + public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; + + @SerializedName(SERIALIZED_NAME_APP_VERSION) + private List appVersion = null; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + private BigDecimal limit; + + public GetEventsVolumeFromWorkspaceV1Query() {} + + public GetEventsVolumeFromWorkspaceV1Query workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * workspaceId corresponds to the workspace being requested. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "workspaceId corresponds to the workspace being requested.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public GetEventsVolumeFromWorkspaceV1Query granularity(GranularityEnum granularity) { + + this.granularity = granularity; + return this; + } + + /** + * Granularity corresponds to the requested bucket granularity + * + * @return granularity + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Granularity corresponds to the requested bucket granularity") + public GranularityEnum getGranularity() { + return granularity; + } + + public void setGranularity(GranularityEnum granularity) { + this.granularity = granularity; + } + + public GetEventsVolumeFromWorkspaceV1Query startTime(String startTime) { + + this.startTime = startTime; + return this; + } + + /** + * StartTime is the ISO8601 formatted timestamp corresponding to the beginning of the requested + * timeframe, inclusive. + * + * @return startTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" + + " the requested timeframe, inclusive.") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public GetEventsVolumeFromWorkspaceV1Query endTime(String endTime) { + + this.endTime = endTime; + return this; + } + + /** + * EndTime is the ISO8601 formatted timestamp corresponding to the end of the requested + * timeframe, noninclusive. + * + * @return endTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" + + " requested timeframe, noninclusive.") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public GetEventsVolumeFromWorkspaceV1Query groupBy(List groupBy) { + + this.groupBy = groupBy; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addGroupByItem(String groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + return this; + } + + /** + * GroupBy is a comma-delimited list of strings representing the dimensions to group the result + * by. The current options are: `eventName` or `eventType` + * + * @return groupBy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GroupBy is a comma-delimited list of strings representing the dimensions to" + + " group the result by. The current options are: `eventName` or" + + " `eventType`") + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public GetEventsVolumeFromWorkspaceV1Query sourceId(List sourceId) { + + this.sourceId = sourceId; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addSourceIdItem(String sourceIdItem) { + if (this.sourceId == null) { + this.sourceId = new ArrayList<>(); + } + this.sourceId.add(sourceIdItem); + return this; + } + + /** + * SourceId is a list of strings which allow you to restrict the result to just the given + * sourceIds. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SourceId is a list of strings which allow you to restrict the result to just" + + " the given sourceIds.") + public List getSourceId() { + return sourceId; + } + + public void setSourceId(List sourceId) { + this.sourceId = sourceId; + } + + public GetEventsVolumeFromWorkspaceV1Query eventName(List eventName) { + + this.eventName = eventName; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addEventNameItem(String eventNameItem) { + if (this.eventName == null) { + this.eventName = new ArrayList<>(); + } + this.eventName.add(eventNameItem); + return this; + } + + /** + * EventName is a list of strings which allow you to restrict the result to just the given + * eventNames. + * + * @return eventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventName is a list of strings which allow you to restrict the result to just" + + " the given eventNames.") + public List getEventName() { + return eventName; + } + + public void setEventName(List eventName) { + this.eventName = eventName; + } + + public GetEventsVolumeFromWorkspaceV1Query eventType(List eventType) { + + this.eventType = eventType; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * EventType is a list of strings which allow you to restrict the result to just the given + * eventTypes. + * + * @return eventType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventType is a list of strings which allow you to restrict the result to just" + + " the given eventTypes.") + public List getEventType() { + return eventType; + } + + public void setEventType(List eventType) { + this.eventType = eventType; + } + + public GetEventsVolumeFromWorkspaceV1Query appVersion(List appVersion) { + + this.appVersion = appVersion; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addAppVersionItem(String appVersionItem) { + if (this.appVersion == null) { + this.appVersion = new ArrayList<>(); + } + this.appVersion.add(appVersionItem); + return this; + } + + /** + * AppVersion is a list of strings which allow you to restrict the result to just the given + * appVersions. + * + * @return appVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AppVersion is a list of strings which allow you to restrict the result to just" + + " the given appVersions.") + public List getAppVersion() { + return appVersion; + } + + public void setAppVersion(List appVersion) { + this.appVersion = appVersion; + } + + public GetEventsVolumeFromWorkspaceV1Query limit(BigDecimal limit) { + + this.limit = limit; + return this; + } + + /** + * Limit is the total number of items in the result + * + * @return limit + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Limit is the total number of items in the result") + public BigDecimal getLimit() { + return limit; + } + + public void setLimit(BigDecimal limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventsVolumeFromWorkspaceV1Query getEventsVolumeFromWorkspaceV1Query = + (GetEventsVolumeFromWorkspaceV1Query) o; + return Objects.equals(this.workspaceId, getEventsVolumeFromWorkspaceV1Query.workspaceId) + && Objects.equals(this.granularity, getEventsVolumeFromWorkspaceV1Query.granularity) + && Objects.equals(this.startTime, getEventsVolumeFromWorkspaceV1Query.startTime) + && Objects.equals(this.endTime, getEventsVolumeFromWorkspaceV1Query.endTime) + && Objects.equals(this.groupBy, getEventsVolumeFromWorkspaceV1Query.groupBy) + && Objects.equals(this.sourceId, getEventsVolumeFromWorkspaceV1Query.sourceId) + && Objects.equals(this.eventName, getEventsVolumeFromWorkspaceV1Query.eventName) + && Objects.equals(this.eventType, getEventsVolumeFromWorkspaceV1Query.eventType) + && Objects.equals(this.appVersion, getEventsVolumeFromWorkspaceV1Query.appVersion) + && Objects.equals(this.limit, getEventsVolumeFromWorkspaceV1Query.limit); + } + + @Override + public int hashCode() { + return Objects.hash( + workspaceId, + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventsVolumeFromWorkspaceV1Query {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" granularity: ").append(toIndentedString(granularity)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workspaceId"); + openapiFields.add("granularity"); + openapiFields.add("startTime"); + openapiFields.add("endTime"); + openapiFields.add("groupBy"); + openapiFields.add("sourceId"); + openapiFields.add("eventName"); + openapiFields.add("eventType"); + openapiFields.add("appVersion"); + openapiFields.add("limit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("granularity"); + openapiRequiredFields.add("startTime"); + openapiRequiredFields.add("endTime"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetEventsVolumeFromWorkspaceV1Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetEventsVolumeFromWorkspaceV1Query is" + + " not found in the empty JSON string", + GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetEventsVolumeFromWorkspaceV1Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetEventsVolumeFromWorkspaceV1Query` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("granularity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `granularity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("granularity").toString())); + } + if (!jsonObj.get("startTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `startTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("startTime").toString())); + } + if (!jsonObj.get("endTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `endTime` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("endTime").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groupBy` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("groupBy").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("sourceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventName` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventType` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `appVersion` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("appVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetEventsVolumeFromWorkspaceV1Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetEventsVolumeFromWorkspaceV1Query' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetEventsVolumeFromWorkspaceV1Query.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetEventsVolumeFromWorkspaceV1Query value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetEventsVolumeFromWorkspaceV1Query read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetEventsVolumeFromWorkspaceV1Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEventsVolumeFromWorkspaceV1Query + * @throws IOException if the JSON string is invalid with respect to + * GetEventsVolumeFromWorkspaceV1Query + */ + public static GetEventsVolumeFromWorkspaceV1Query fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspaceV1Query.class); + } + + /** + * Convert an instance of GetEventsVolumeFromWorkspaceV1Query to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Query.java b/src/main/java/com/segment/publicapi/models/Query.java new file mode 100644 index 00000000..161a4a23 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Query.java @@ -0,0 +1,672 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Input query returned */ +@ApiModel(description = "Input query returned") +public class Query { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + /** Granularity corresponds to the requested bucket granularity */ + @JsonAdapter(GranularityEnum.Adapter.class) + public enum GranularityEnum { + DAY("day"), + + HOUR("hour"), + + MINUTE("minute"); + + private String value; + + GranularityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GranularityEnum fromValue(String value) { + for (GranularityEnum b : GranularityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GranularityEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GranularityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GranularityEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_GRANULARITY = "granularity"; + + @SerializedName(SERIALIZED_NAME_GRANULARITY) + private GranularityEnum granularity; + + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + private String startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + private String endTime; + + public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; + + @SerializedName(SERIALIZED_NAME_GROUP_BY) + private List groupBy = null; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private List sourceId = null; + + public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; + + @SerializedName(SERIALIZED_NAME_EVENT_NAME) + private List eventName = null; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private List eventType = null; + + public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; + + @SerializedName(SERIALIZED_NAME_APP_VERSION) + private List appVersion = null; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + private BigDecimal limit; + + public Query() {} + + public Query workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * workspaceId corresponds to the workspace being requested. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "workspaceId corresponds to the workspace being requested.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public Query granularity(GranularityEnum granularity) { + + this.granularity = granularity; + return this; + } + + /** + * Granularity corresponds to the requested bucket granularity + * + * @return granularity + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Granularity corresponds to the requested bucket granularity") + public GranularityEnum getGranularity() { + return granularity; + } + + public void setGranularity(GranularityEnum granularity) { + this.granularity = granularity; + } + + public Query startTime(String startTime) { + + this.startTime = startTime; + return this; + } + + /** + * StartTime is the ISO8601 formatted timestamp corresponding to the beginning of the requested + * timeframe, inclusive. + * + * @return startTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" + + " the requested timeframe, inclusive.") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public Query endTime(String endTime) { + + this.endTime = endTime; + return this; + } + + /** + * EndTime is the ISO8601 formatted timestamp corresponding to the end of the requested + * timeframe, noninclusive. + * + * @return endTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" + + " requested timeframe, noninclusive.") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Query groupBy(List groupBy) { + + this.groupBy = groupBy; + return this; + } + + public Query addGroupByItem(String groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + return this; + } + + /** + * GroupBy is a comma-delimited list of strings representing the dimensions to group the result + * by. The current options are: `eventName` or `eventType` + * + * @return groupBy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GroupBy is a comma-delimited list of strings representing the dimensions to" + + " group the result by. The current options are: `eventName` or" + + " `eventType`") + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public Query sourceId(List sourceId) { + + this.sourceId = sourceId; + return this; + } + + public Query addSourceIdItem(String sourceIdItem) { + if (this.sourceId == null) { + this.sourceId = new ArrayList<>(); + } + this.sourceId.add(sourceIdItem); + return this; + } + + /** + * SourceId is a list of strings which allow you to restrict the result to just the given + * sourceIds. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "SourceId is a list of strings which allow you to restrict the result to just" + + " the given sourceIds.") + public List getSourceId() { + return sourceId; + } + + public void setSourceId(List sourceId) { + this.sourceId = sourceId; + } + + public Query eventName(List eventName) { + + this.eventName = eventName; + return this; + } + + public Query addEventNameItem(String eventNameItem) { + if (this.eventName == null) { + this.eventName = new ArrayList<>(); + } + this.eventName.add(eventNameItem); + return this; + } + + /** + * EventName is a list of strings which allow you to restrict the result to just the given + * eventNames. + * + * @return eventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventName is a list of strings which allow you to restrict the result to just" + + " the given eventNames.") + public List getEventName() { + return eventName; + } + + public void setEventName(List eventName) { + this.eventName = eventName; + } + + public Query eventType(List eventType) { + + this.eventType = eventType; + return this; + } + + public Query addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * EventType is a list of strings which allow you to restrict the result to just the given + * eventTypes. + * + * @return eventType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventType is a list of strings which allow you to restrict the result to just" + + " the given eventTypes.") + public List getEventType() { + return eventType; + } + + public void setEventType(List eventType) { + this.eventType = eventType; + } + + public Query appVersion(List appVersion) { + + this.appVersion = appVersion; + return this; + } + + public Query addAppVersionItem(String appVersionItem) { + if (this.appVersion == null) { + this.appVersion = new ArrayList<>(); + } + this.appVersion.add(appVersionItem); + return this; + } + + /** + * AppVersion is a list of strings which allow you to restrict the result to just the given + * appVersions. + * + * @return appVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AppVersion is a list of strings which allow you to restrict the result to just" + + " the given appVersions.") + public List getAppVersion() { + return appVersion; + } + + public void setAppVersion(List appVersion) { + this.appVersion = appVersion; + } + + public Query limit(BigDecimal limit) { + + this.limit = limit; + return this; + } + + /** + * Limit is the total number of items in the result + * + * @return limit + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Limit is the total number of items in the result") + public BigDecimal getLimit() { + return limit; + } + + public void setLimit(BigDecimal limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Query query = (Query) o; + return Objects.equals(this.workspaceId, query.workspaceId) + && Objects.equals(this.granularity, query.granularity) + && Objects.equals(this.startTime, query.startTime) + && Objects.equals(this.endTime, query.endTime) + && Objects.equals(this.groupBy, query.groupBy) + && Objects.equals(this.sourceId, query.sourceId) + && Objects.equals(this.eventName, query.eventName) + && Objects.equals(this.eventType, query.eventType) + && Objects.equals(this.appVersion, query.appVersion) + && Objects.equals(this.limit, query.limit); + } + + @Override + public int hashCode() { + return Objects.hash( + workspaceId, + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Query {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" granularity: ").append(toIndentedString(granularity)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workspaceId"); + openapiFields.add("granularity"); + openapiFields.add("startTime"); + openapiFields.add("endTime"); + openapiFields.add("groupBy"); + openapiFields.add("sourceId"); + openapiFields.add("eventName"); + openapiFields.add("eventType"); + openapiFields.add("appVersion"); + openapiFields.add("limit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("granularity"); + openapiRequiredFields.add("startTime"); + openapiRequiredFields.add("endTime"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Query.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Query is not found in the empty JSON" + + " string", + Query.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Query`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Query.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("granularity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `granularity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("granularity").toString())); + } + if (!jsonObj.get("startTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `startTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("startTime").toString())); + } + if (!jsonObj.get("endTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `endTime` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("endTime").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groupBy` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("groupBy").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("sourceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventName` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventType` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `appVersion` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("appVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Query' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Query.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Query value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Query read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of Query + * @throws IOException if the JSON string is invalid with respect to Query + */ + public static Query fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Query.class); + } + + /** + * Convert an instance of Query to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index cbb9d642..b9ff2a12 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -81,8 +81,8 @@ public SourceEventVolumeV1 source(Source source) { * * @return source */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") public Source getSource() { return source; } @@ -243,7 +243,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("source"); openapiRequiredFields.add("total"); openapiRequiredFields.add("series"); } From c75aa695c1bfdab9e33985b459f1d836483843a4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 1 Feb 2023 19:27:43 +0000 Subject: [PATCH 042/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@de40aae. --- src/main/java/com/segment/publicapi/JSON.java | 5 - .../GetEventsVolumeFromWorkspaceV1Output.java | 71 +- .../GetEventsVolumeFromWorkspaceV1Query.java | 681 ------------------ .../com/segment/publicapi/models/Query.java | 672 ----------------- .../publicapi/models/SourceEventVolumeV1.java | 5 +- 5 files changed, 5 insertions(+), 1429 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java delete mode 100644 src/main/java/com/segment/publicapi/models/Query.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 97e84a4d..5c5a4363 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -575,9 +575,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Query - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetFilterInDestination200Response .CustomTypeAdapterFactory()); @@ -977,8 +974,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Query.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 311eb714..1add9558 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -39,16 +39,6 @@ "GetEventsVolumeFromWorkspaceV1Output represents the results given the input" + " query.") public class GetEventsVolumeFromWorkspaceV1Output { - public static final String SERIALIZED_NAME_PATH = "path"; - - @SerializedName(SERIALIZED_NAME_PATH) - private String path; - - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private Query query; - public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) @@ -61,48 +51,6 @@ public class GetEventsVolumeFromWorkspaceV1Output { public GetEventsVolumeFromWorkspaceV1Output() {} - public GetEventsVolumeFromWorkspaceV1Output path(String path) { - - this.path = path; - return this; - } - - /** - * Observability event volume path - * - * @return path - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Observability event volume path") - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public GetEventsVolumeFromWorkspaceV1Output query(Query query) { - - this.query = query; - return this; - } - - /** - * Get query - * - * @return query - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Query getQuery() { - return query; - } - - public void setQuery(Query query) { - this.query = query; - } - public GetEventsVolumeFromWorkspaceV1Output result(List result) { this.result = result; @@ -167,23 +115,19 @@ public boolean equals(Object o) { } GetEventsVolumeFromWorkspaceV1Output getEventsVolumeFromWorkspaceV1Output = (GetEventsVolumeFromWorkspaceV1Output) o; - return Objects.equals(this.path, getEventsVolumeFromWorkspaceV1Output.path) - && Objects.equals(this.query, getEventsVolumeFromWorkspaceV1Output.query) - && Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) + return Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) && Objects.equals(this.pagination, getEventsVolumeFromWorkspaceV1Output.pagination); } @Override public int hashCode() { - return Objects.hash(path, query, result, pagination); + return Objects.hash(result, pagination); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetEventsVolumeFromWorkspaceV1Output {\n"); - sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" result: ").append(toIndentedString(result)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -207,15 +151,11 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("path"); - openapiFields.add("query"); openapiFields.add("result"); openapiFields.add("pagination"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("path"); - openapiRequiredFields.add("query"); openapiRequiredFields.add("result"); } @@ -261,13 +201,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } - if (!jsonObj.get("path").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `path` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("path").toString())); - } // ensure the json data is an array if (!jsonObj.get("result").isJsonArray()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java deleted file mode 100644 index 26e1c2fc..00000000 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java +++ /dev/null @@ -1,681 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** GetEventVolumeOutputQuery represents the inout query sent to output */ -@ApiModel(description = "GetEventVolumeOutputQuery represents the inout query sent to output") -public class GetEventsVolumeFromWorkspaceV1Query { - public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; - - @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) - private String workspaceId; - - /** Granularity corresponds to the requested bucket granularity */ - @JsonAdapter(GranularityEnum.Adapter.class) - public enum GranularityEnum { - DAY("day"), - - HOUR("hour"), - - MINUTE("minute"); - - private String value; - - GranularityEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static GranularityEnum fromValue(String value) { - for (GranularityEnum b : GranularityEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final GranularityEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public GranularityEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return GranularityEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_GRANULARITY = "granularity"; - - @SerializedName(SERIALIZED_NAME_GRANULARITY) - private GranularityEnum granularity; - - public static final String SERIALIZED_NAME_START_TIME = "startTime"; - - @SerializedName(SERIALIZED_NAME_START_TIME) - private String startTime; - - public static final String SERIALIZED_NAME_END_TIME = "endTime"; - - @SerializedName(SERIALIZED_NAME_END_TIME) - private String endTime; - - public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; - - @SerializedName(SERIALIZED_NAME_GROUP_BY) - private List groupBy = null; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private List sourceId = null; - - public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; - - @SerializedName(SERIALIZED_NAME_EVENT_NAME) - private List eventName = null; - - public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; - - @SerializedName(SERIALIZED_NAME_EVENT_TYPE) - private List eventType = null; - - public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; - - @SerializedName(SERIALIZED_NAME_APP_VERSION) - private List appVersion = null; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - private BigDecimal limit; - - public GetEventsVolumeFromWorkspaceV1Query() {} - - public GetEventsVolumeFromWorkspaceV1Query workspaceId(String workspaceId) { - - this.workspaceId = workspaceId; - return this; - } - - /** - * workspaceId corresponds to the workspace being requested. - * - * @return workspaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "workspaceId corresponds to the workspace being requested.") - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } - - public GetEventsVolumeFromWorkspaceV1Query granularity(GranularityEnum granularity) { - - this.granularity = granularity; - return this; - } - - /** - * Granularity corresponds to the requested bucket granularity - * - * @return granularity - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Granularity corresponds to the requested bucket granularity") - public GranularityEnum getGranularity() { - return granularity; - } - - public void setGranularity(GranularityEnum granularity) { - this.granularity = granularity; - } - - public GetEventsVolumeFromWorkspaceV1Query startTime(String startTime) { - - this.startTime = startTime; - return this; - } - - /** - * StartTime is the ISO8601 formatted timestamp corresponding to the beginning of the requested - * timeframe, inclusive. - * - * @return startTime - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" - + " the requested timeframe, inclusive.") - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public GetEventsVolumeFromWorkspaceV1Query endTime(String endTime) { - - this.endTime = endTime; - return this; - } - - /** - * EndTime is the ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. - * - * @return endTime - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" - + " requested timeframe, noninclusive.") - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public GetEventsVolumeFromWorkspaceV1Query groupBy(List groupBy) { - - this.groupBy = groupBy; - return this; - } - - public GetEventsVolumeFromWorkspaceV1Query addGroupByItem(String groupByItem) { - if (this.groupBy == null) { - this.groupBy = new ArrayList<>(); - } - this.groupBy.add(groupByItem); - return this; - } - - /** - * GroupBy is a comma-delimited list of strings representing the dimensions to group the result - * by. The current options are: `eventName` or `eventType` - * - * @return groupBy - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "GroupBy is a comma-delimited list of strings representing the dimensions to" - + " group the result by. The current options are: `eventName` or" - + " `eventType`") - public List getGroupBy() { - return groupBy; - } - - public void setGroupBy(List groupBy) { - this.groupBy = groupBy; - } - - public GetEventsVolumeFromWorkspaceV1Query sourceId(List sourceId) { - - this.sourceId = sourceId; - return this; - } - - public GetEventsVolumeFromWorkspaceV1Query addSourceIdItem(String sourceIdItem) { - if (this.sourceId == null) { - this.sourceId = new ArrayList<>(); - } - this.sourceId.add(sourceIdItem); - return this; - } - - /** - * SourceId is a list of strings which allow you to restrict the result to just the given - * sourceIds. - * - * @return sourceId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "SourceId is a list of strings which allow you to restrict the result to just" - + " the given sourceIds.") - public List getSourceId() { - return sourceId; - } - - public void setSourceId(List sourceId) { - this.sourceId = sourceId; - } - - public GetEventsVolumeFromWorkspaceV1Query eventName(List eventName) { - - this.eventName = eventName; - return this; - } - - public GetEventsVolumeFromWorkspaceV1Query addEventNameItem(String eventNameItem) { - if (this.eventName == null) { - this.eventName = new ArrayList<>(); - } - this.eventName.add(eventNameItem); - return this; - } - - /** - * EventName is a list of strings which allow you to restrict the result to just the given - * eventNames. - * - * @return eventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "EventName is a list of strings which allow you to restrict the result to just" - + " the given eventNames.") - public List getEventName() { - return eventName; - } - - public void setEventName(List eventName) { - this.eventName = eventName; - } - - public GetEventsVolumeFromWorkspaceV1Query eventType(List eventType) { - - this.eventType = eventType; - return this; - } - - public GetEventsVolumeFromWorkspaceV1Query addEventTypeItem(String eventTypeItem) { - if (this.eventType == null) { - this.eventType = new ArrayList<>(); - } - this.eventType.add(eventTypeItem); - return this; - } - - /** - * EventType is a list of strings which allow you to restrict the result to just the given - * eventTypes. - * - * @return eventType - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "EventType is a list of strings which allow you to restrict the result to just" - + " the given eventTypes.") - public List getEventType() { - return eventType; - } - - public void setEventType(List eventType) { - this.eventType = eventType; - } - - public GetEventsVolumeFromWorkspaceV1Query appVersion(List appVersion) { - - this.appVersion = appVersion; - return this; - } - - public GetEventsVolumeFromWorkspaceV1Query addAppVersionItem(String appVersionItem) { - if (this.appVersion == null) { - this.appVersion = new ArrayList<>(); - } - this.appVersion.add(appVersionItem); - return this; - } - - /** - * AppVersion is a list of strings which allow you to restrict the result to just the given - * appVersions. - * - * @return appVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "AppVersion is a list of strings which allow you to restrict the result to just" - + " the given appVersions.") - public List getAppVersion() { - return appVersion; - } - - public void setAppVersion(List appVersion) { - this.appVersion = appVersion; - } - - public GetEventsVolumeFromWorkspaceV1Query limit(BigDecimal limit) { - - this.limit = limit; - return this; - } - - /** - * Limit is the total number of items in the result - * - * @return limit - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Limit is the total number of items in the result") - public BigDecimal getLimit() { - return limit; - } - - public void setLimit(BigDecimal limit) { - this.limit = limit; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetEventsVolumeFromWorkspaceV1Query getEventsVolumeFromWorkspaceV1Query = - (GetEventsVolumeFromWorkspaceV1Query) o; - return Objects.equals(this.workspaceId, getEventsVolumeFromWorkspaceV1Query.workspaceId) - && Objects.equals(this.granularity, getEventsVolumeFromWorkspaceV1Query.granularity) - && Objects.equals(this.startTime, getEventsVolumeFromWorkspaceV1Query.startTime) - && Objects.equals(this.endTime, getEventsVolumeFromWorkspaceV1Query.endTime) - && Objects.equals(this.groupBy, getEventsVolumeFromWorkspaceV1Query.groupBy) - && Objects.equals(this.sourceId, getEventsVolumeFromWorkspaceV1Query.sourceId) - && Objects.equals(this.eventName, getEventsVolumeFromWorkspaceV1Query.eventName) - && Objects.equals(this.eventType, getEventsVolumeFromWorkspaceV1Query.eventType) - && Objects.equals(this.appVersion, getEventsVolumeFromWorkspaceV1Query.appVersion) - && Objects.equals(this.limit, getEventsVolumeFromWorkspaceV1Query.limit); - } - - @Override - public int hashCode() { - return Objects.hash( - workspaceId, - granularity, - startTime, - endTime, - groupBy, - sourceId, - eventName, - eventType, - appVersion, - limit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetEventsVolumeFromWorkspaceV1Query {\n"); - sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); - sb.append(" granularity: ").append(toIndentedString(granularity)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); - sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); - sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); - sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("workspaceId"); - openapiFields.add("granularity"); - openapiFields.add("startTime"); - openapiFields.add("endTime"); - openapiFields.add("groupBy"); - openapiFields.add("sourceId"); - openapiFields.add("eventName"); - openapiFields.add("eventType"); - openapiFields.add("appVersion"); - openapiFields.add("limit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("workspaceId"); - openapiRequiredFields.add("granularity"); - openapiRequiredFields.add("startTime"); - openapiRequiredFields.add("endTime"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * GetEventsVolumeFromWorkspaceV1Query - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetEventsVolumeFromWorkspaceV1Query is" - + " not found in the empty JSON string", - GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetEventsVolumeFromWorkspaceV1Query.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetEventsVolumeFromWorkspaceV1Query` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("workspaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workspaceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workspaceId").toString())); - } - if (!jsonObj.get("granularity").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `granularity` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("granularity").toString())); - } - if (!jsonObj.get("startTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `startTime` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("startTime").toString())); - } - if (!jsonObj.get("endTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `endTime` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("endTime").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `groupBy` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("groupBy").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("sourceId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventName` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("eventName").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventType` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("eventType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `appVersion` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("appVersion").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetEventsVolumeFromWorkspaceV1Query.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetEventsVolumeFromWorkspaceV1Query' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetEventsVolumeFromWorkspaceV1Query.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetEventsVolumeFromWorkspaceV1Query value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetEventsVolumeFromWorkspaceV1Query read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetEventsVolumeFromWorkspaceV1Query given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetEventsVolumeFromWorkspaceV1Query - * @throws IOException if the JSON string is invalid with respect to - * GetEventsVolumeFromWorkspaceV1Query - */ - public static GetEventsVolumeFromWorkspaceV1Query fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspaceV1Query.class); - } - - /** - * Convert an instance of GetEventsVolumeFromWorkspaceV1Query to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Query.java b/src/main/java/com/segment/publicapi/models/Query.java deleted file mode 100644 index 161a4a23..00000000 --- a/src/main/java/com/segment/publicapi/models/Query.java +++ /dev/null @@ -1,672 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Input query returned */ -@ApiModel(description = "Input query returned") -public class Query { - public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; - - @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) - private String workspaceId; - - /** Granularity corresponds to the requested bucket granularity */ - @JsonAdapter(GranularityEnum.Adapter.class) - public enum GranularityEnum { - DAY("day"), - - HOUR("hour"), - - MINUTE("minute"); - - private String value; - - GranularityEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static GranularityEnum fromValue(String value) { - for (GranularityEnum b : GranularityEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final GranularityEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public GranularityEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return GranularityEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_GRANULARITY = "granularity"; - - @SerializedName(SERIALIZED_NAME_GRANULARITY) - private GranularityEnum granularity; - - public static final String SERIALIZED_NAME_START_TIME = "startTime"; - - @SerializedName(SERIALIZED_NAME_START_TIME) - private String startTime; - - public static final String SERIALIZED_NAME_END_TIME = "endTime"; - - @SerializedName(SERIALIZED_NAME_END_TIME) - private String endTime; - - public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; - - @SerializedName(SERIALIZED_NAME_GROUP_BY) - private List groupBy = null; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private List sourceId = null; - - public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; - - @SerializedName(SERIALIZED_NAME_EVENT_NAME) - private List eventName = null; - - public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; - - @SerializedName(SERIALIZED_NAME_EVENT_TYPE) - private List eventType = null; - - public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; - - @SerializedName(SERIALIZED_NAME_APP_VERSION) - private List appVersion = null; - - public static final String SERIALIZED_NAME_LIMIT = "limit"; - - @SerializedName(SERIALIZED_NAME_LIMIT) - private BigDecimal limit; - - public Query() {} - - public Query workspaceId(String workspaceId) { - - this.workspaceId = workspaceId; - return this; - } - - /** - * workspaceId corresponds to the workspace being requested. - * - * @return workspaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "workspaceId corresponds to the workspace being requested.") - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } - - public Query granularity(GranularityEnum granularity) { - - this.granularity = granularity; - return this; - } - - /** - * Granularity corresponds to the requested bucket granularity - * - * @return granularity - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Granularity corresponds to the requested bucket granularity") - public GranularityEnum getGranularity() { - return granularity; - } - - public void setGranularity(GranularityEnum granularity) { - this.granularity = granularity; - } - - public Query startTime(String startTime) { - - this.startTime = startTime; - return this; - } - - /** - * StartTime is the ISO8601 formatted timestamp corresponding to the beginning of the requested - * timeframe, inclusive. - * - * @return startTime - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" - + " the requested timeframe, inclusive.") - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public Query endTime(String endTime) { - - this.endTime = endTime; - return this; - } - - /** - * EndTime is the ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. - * - * @return endTime - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" - + " requested timeframe, noninclusive.") - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public Query groupBy(List groupBy) { - - this.groupBy = groupBy; - return this; - } - - public Query addGroupByItem(String groupByItem) { - if (this.groupBy == null) { - this.groupBy = new ArrayList<>(); - } - this.groupBy.add(groupByItem); - return this; - } - - /** - * GroupBy is a comma-delimited list of strings representing the dimensions to group the result - * by. The current options are: `eventName` or `eventType` - * - * @return groupBy - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "GroupBy is a comma-delimited list of strings representing the dimensions to" - + " group the result by. The current options are: `eventName` or" - + " `eventType`") - public List getGroupBy() { - return groupBy; - } - - public void setGroupBy(List groupBy) { - this.groupBy = groupBy; - } - - public Query sourceId(List sourceId) { - - this.sourceId = sourceId; - return this; - } - - public Query addSourceIdItem(String sourceIdItem) { - if (this.sourceId == null) { - this.sourceId = new ArrayList<>(); - } - this.sourceId.add(sourceIdItem); - return this; - } - - /** - * SourceId is a list of strings which allow you to restrict the result to just the given - * sourceIds. - * - * @return sourceId - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "SourceId is a list of strings which allow you to restrict the result to just" - + " the given sourceIds.") - public List getSourceId() { - return sourceId; - } - - public void setSourceId(List sourceId) { - this.sourceId = sourceId; - } - - public Query eventName(List eventName) { - - this.eventName = eventName; - return this; - } - - public Query addEventNameItem(String eventNameItem) { - if (this.eventName == null) { - this.eventName = new ArrayList<>(); - } - this.eventName.add(eventNameItem); - return this; - } - - /** - * EventName is a list of strings which allow you to restrict the result to just the given - * eventNames. - * - * @return eventName - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "EventName is a list of strings which allow you to restrict the result to just" - + " the given eventNames.") - public List getEventName() { - return eventName; - } - - public void setEventName(List eventName) { - this.eventName = eventName; - } - - public Query eventType(List eventType) { - - this.eventType = eventType; - return this; - } - - public Query addEventTypeItem(String eventTypeItem) { - if (this.eventType == null) { - this.eventType = new ArrayList<>(); - } - this.eventType.add(eventTypeItem); - return this; - } - - /** - * EventType is a list of strings which allow you to restrict the result to just the given - * eventTypes. - * - * @return eventType - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "EventType is a list of strings which allow you to restrict the result to just" - + " the given eventTypes.") - public List getEventType() { - return eventType; - } - - public void setEventType(List eventType) { - this.eventType = eventType; - } - - public Query appVersion(List appVersion) { - - this.appVersion = appVersion; - return this; - } - - public Query addAppVersionItem(String appVersionItem) { - if (this.appVersion == null) { - this.appVersion = new ArrayList<>(); - } - this.appVersion.add(appVersionItem); - return this; - } - - /** - * AppVersion is a list of strings which allow you to restrict the result to just the given - * appVersions. - * - * @return appVersion - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "AppVersion is a list of strings which allow you to restrict the result to just" - + " the given appVersions.") - public List getAppVersion() { - return appVersion; - } - - public void setAppVersion(List appVersion) { - this.appVersion = appVersion; - } - - public Query limit(BigDecimal limit) { - - this.limit = limit; - return this; - } - - /** - * Limit is the total number of items in the result - * - * @return limit - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Limit is the total number of items in the result") - public BigDecimal getLimit() { - return limit; - } - - public void setLimit(BigDecimal limit) { - this.limit = limit; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Query query = (Query) o; - return Objects.equals(this.workspaceId, query.workspaceId) - && Objects.equals(this.granularity, query.granularity) - && Objects.equals(this.startTime, query.startTime) - && Objects.equals(this.endTime, query.endTime) - && Objects.equals(this.groupBy, query.groupBy) - && Objects.equals(this.sourceId, query.sourceId) - && Objects.equals(this.eventName, query.eventName) - && Objects.equals(this.eventType, query.eventType) - && Objects.equals(this.appVersion, query.appVersion) - && Objects.equals(this.limit, query.limit); - } - - @Override - public int hashCode() { - return Objects.hash( - workspaceId, - granularity, - startTime, - endTime, - groupBy, - sourceId, - eventName, - eventType, - appVersion, - limit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Query {\n"); - sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); - sb.append(" granularity: ").append(toIndentedString(granularity)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); - sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); - sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); - sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); - sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("workspaceId"); - openapiFields.add("granularity"); - openapiFields.add("startTime"); - openapiFields.add("endTime"); - openapiFields.add("groupBy"); - openapiFields.add("sourceId"); - openapiFields.add("eventName"); - openapiFields.add("eventType"); - openapiFields.add("appVersion"); - openapiFields.add("limit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("workspaceId"); - openapiRequiredFields.add("granularity"); - openapiRequiredFields.add("startTime"); - openapiRequiredFields.add("endTime"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Query - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Query.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Query is not found in the empty JSON" - + " string", - Query.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Query.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Query`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Query.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("workspaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workspaceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workspaceId").toString())); - } - if (!jsonObj.get("granularity").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `granularity` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("granularity").toString())); - } - if (!jsonObj.get("startTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `startTime` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("startTime").toString())); - } - if (!jsonObj.get("endTime").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `endTime` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("endTime").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `groupBy` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("groupBy").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("sourceId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventName` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("eventName").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventType` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("eventType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `appVersion` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("appVersion").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Query.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Query' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Query.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Query value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Query read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Query given an JSON string - * - * @param jsonString JSON string - * @return An instance of Query - * @throws IOException if the JSON string is invalid with respect to Query - */ - public static Query fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Query.class); - } - - /** - * Convert an instance of Query to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index b9ff2a12..cbb9d642 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -81,8 +81,8 @@ public SourceEventVolumeV1 source(Source source) { * * @return source */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") public Source getSource() { return source; } @@ -243,6 +243,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("source"); openapiRequiredFields.add("total"); openapiRequiredFields.add("series"); } From 984b00f8b7ee77ee47773c82b714b932718198b5 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 2 Feb 2023 01:41:05 +0000 Subject: [PATCH 043/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a6d65ee. From 5f707b6048ee5c255591151afc5d3e0dfe3e5e15 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 2 Feb 2023 18:45:34 +0000 Subject: [PATCH 044/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@06cc30e. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 5 + .../com/segment/publicapi/models/Contact.java | 21 +- .../GetEventsVolumeFromWorkspaceV1Output.java | 71 +- .../GetEventsVolumeFromWorkspaceV1Query.java | 678 ++++++++++++++++++ .../com/segment/publicapi/models/Query.java | 669 +++++++++++++++++ .../publicapi/models/SourceEventVolumeV1.java | 5 +- 9 files changed, 1439 insertions(+), 22 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java create mode 100644 src/main/java/com/segment/publicapi/models/Query.java diff --git a/README.md b/README.md index 51ce7848..072d363e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 33.0.4 +Latest API and SDK version: 34.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 33.0.4 + 34.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:33.0.4" + implementation "com.segment.publicapi:segment-publicapi:34.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-33.0.4.jar` +* `target/segment-publicapi-34.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index e319e4b5..bf2e4526 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 33.0.4 + 34.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 120cc325..6a331dec 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 33.0.4 (Java)"); + setUserAgent("Public API SDK 34.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 5c5a4363..97e84a4d 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -575,6 +575,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Query + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetFilterInDestination200Response .CustomTypeAdapterFactory()); @@ -974,6 +977,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Query.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index 3842f54b..6280dda3 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -66,8 +66,8 @@ public Contact name(String name) { * * @return name */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of this contact.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Name of this contact.") public String getName() { return name; } @@ -108,8 +108,8 @@ public Contact role(String role) { * * @return role */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Role of this contact.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Role of this contact.") public String getRole() { return role; } @@ -129,8 +129,8 @@ public Contact isPrimary(Boolean isPrimary) { * * @return isPrimary */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this is a primary contact.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether this is a primary contact.") public Boolean getIsPrimary() { return isPrimary; } @@ -195,10 +195,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); openapiRequiredFields.add("email"); - openapiRequiredFields.add("role"); - openapiRequiredFields.add("isPrimary"); } /** @@ -240,7 +237,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } - if (!jsonObj.get("name").isJsonPrimitive()) { + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `name` to be a primitive type in the JSON string" @@ -254,7 +252,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("email").toString())); } - if (!jsonObj.get("role").isJsonPrimitive()) { + if ((jsonObj.get("role") != null && !jsonObj.get("role").isJsonNull()) + && !jsonObj.get("role").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `role` to be a primitive type in the JSON string" diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 1add9558..20ee1334 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -39,6 +39,16 @@ "GetEventsVolumeFromWorkspaceV1Output represents the results given the input" + " query.") public class GetEventsVolumeFromWorkspaceV1Output { + public static final String SERIALIZED_NAME_PATH = "path"; + + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private Query query; + public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) @@ -51,6 +61,48 @@ public class GetEventsVolumeFromWorkspaceV1Output { public GetEventsVolumeFromWorkspaceV1Output() {} + public GetEventsVolumeFromWorkspaceV1Output path(String path) { + + this.path = path; + return this; + } + + /** + * Observability event volume path. + * + * @return path + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Observability event volume path.") + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public GetEventsVolumeFromWorkspaceV1Output query(Query query) { + + this.query = query; + return this; + } + + /** + * Get query + * + * @return query + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Query getQuery() { + return query; + } + + public void setQuery(Query query) { + this.query = query; + } + public GetEventsVolumeFromWorkspaceV1Output result(List result) { this.result = result; @@ -115,19 +167,23 @@ public boolean equals(Object o) { } GetEventsVolumeFromWorkspaceV1Output getEventsVolumeFromWorkspaceV1Output = (GetEventsVolumeFromWorkspaceV1Output) o; - return Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) + return Objects.equals(this.path, getEventsVolumeFromWorkspaceV1Output.path) + && Objects.equals(this.query, getEventsVolumeFromWorkspaceV1Output.query) + && Objects.equals(this.result, getEventsVolumeFromWorkspaceV1Output.result) && Objects.equals(this.pagination, getEventsVolumeFromWorkspaceV1Output.pagination); } @Override public int hashCode() { - return Objects.hash(result, pagination); + return Objects.hash(path, query, result, pagination); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetEventsVolumeFromWorkspaceV1Output {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" result: ").append(toIndentedString(result)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -151,11 +207,15 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("path"); + openapiFields.add("query"); openapiFields.add("result"); openapiFields.add("pagination"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("path"); + openapiRequiredFields.add("query"); openapiRequiredFields.add("result"); } @@ -201,6 +261,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } + if (!jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `path` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("path").toString())); + } // ensure the json data is an array if (!jsonObj.get("result").isJsonArray()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java new file mode 100644 index 00000000..aa3b33fa --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java @@ -0,0 +1,678 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetEventVolumeOutputQuery represents the input query sent to output. */ +@ApiModel(description = "GetEventVolumeOutputQuery represents the input query sent to output.") +public class GetEventsVolumeFromWorkspaceV1Query { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + /** Granularity corresponds to the requested bucket granularity. */ + @JsonAdapter(GranularityEnum.Adapter.class) + public enum GranularityEnum { + DAY("DAY"), + + HOUR("HOUR"), + + MINUTE("MINUTE"); + + private String value; + + GranularityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GranularityEnum fromValue(String value) { + for (GranularityEnum b : GranularityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GranularityEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GranularityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GranularityEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_GRANULARITY = "granularity"; + + @SerializedName(SERIALIZED_NAME_GRANULARITY) + private GranularityEnum granularity; + + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + private String startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + private String endTime; + + public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; + + @SerializedName(SERIALIZED_NAME_GROUP_BY) + private List groupBy = null; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private List sourceId = null; + + public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; + + @SerializedName(SERIALIZED_NAME_EVENT_NAME) + private List eventName = null; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private List eventType = null; + + public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; + + @SerializedName(SERIALIZED_NAME_APP_VERSION) + private List appVersion = null; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + private BigDecimal limit; + + public GetEventsVolumeFromWorkspaceV1Query() {} + + public GetEventsVolumeFromWorkspaceV1Query workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * Workspace being requested. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Workspace being requested.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public GetEventsVolumeFromWorkspaceV1Query granularity(GranularityEnum granularity) { + + this.granularity = granularity; + return this; + } + + /** + * Granularity corresponds to the requested bucket granularity. + * + * @return granularity + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Granularity corresponds to the requested bucket granularity.") + public GranularityEnum getGranularity() { + return granularity; + } + + public void setGranularity(GranularityEnum granularity) { + this.granularity = granularity; + } + + public GetEventsVolumeFromWorkspaceV1Query startTime(String startTime) { + + this.startTime = startTime; + return this; + } + + /** + * StartTime is the ISO8601 formatted timestamp corresponding to the beginning of the requested + * time frame, inclusive. + * + * @return startTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" + + " the requested time frame, inclusive.") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public GetEventsVolumeFromWorkspaceV1Query endTime(String endTime) { + + this.endTime = endTime; + return this; + } + + /** + * EndTime is the ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. + * + * @return endTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" + + " requested time frame, noninclusive.") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public GetEventsVolumeFromWorkspaceV1Query groupBy(List groupBy) { + + this.groupBy = groupBy; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addGroupByItem(String groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + return this; + } + + /** + * GroupBy is a comma-delimited list of strings representing the dimensions to group the result + * by. The current options are: `eventName` or `eventType`. + * + * @return groupBy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GroupBy is a comma-delimited list of strings representing the dimensions to" + + " group the result by. The current options are: `eventName` or" + + " `eventType`.") + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public GetEventsVolumeFromWorkspaceV1Query sourceId(List sourceId) { + + this.sourceId = sourceId; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addSourceIdItem(String sourceIdItem) { + if (this.sourceId == null) { + this.sourceId = new ArrayList<>(); + } + this.sourceId.add(sourceIdItem); + return this; + } + + /** + * List of strings which allow you to restrict the result to just the given Sources. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of strings which allow you to restrict the result to just the given" + + " Sources.") + public List getSourceId() { + return sourceId; + } + + public void setSourceId(List sourceId) { + this.sourceId = sourceId; + } + + public GetEventsVolumeFromWorkspaceV1Query eventName(List eventName) { + + this.eventName = eventName; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addEventNameItem(String eventNameItem) { + if (this.eventName == null) { + this.eventName = new ArrayList<>(); + } + this.eventName.add(eventNameItem); + return this; + } + + /** + * EventName is a list of strings which allow you to restrict the result to just the given event + * names. + * + * @return eventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventName is a list of strings which allow you to restrict the result to just" + + " the given event names.") + public List getEventName() { + return eventName; + } + + public void setEventName(List eventName) { + this.eventName = eventName; + } + + public GetEventsVolumeFromWorkspaceV1Query eventType(List eventType) { + + this.eventType = eventType; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * EventType is a list of strings which allow you to restrict the result to just the given event + * types. + * + * @return eventType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventType is a list of strings which allow you to restrict the result to just" + + " the given event types.") + public List getEventType() { + return eventType; + } + + public void setEventType(List eventType) { + this.eventType = eventType; + } + + public GetEventsVolumeFromWorkspaceV1Query appVersion(List appVersion) { + + this.appVersion = appVersion; + return this; + } + + public GetEventsVolumeFromWorkspaceV1Query addAppVersionItem(String appVersionItem) { + if (this.appVersion == null) { + this.appVersion = new ArrayList<>(); + } + this.appVersion.add(appVersionItem); + return this; + } + + /** + * AppVersion is a list of strings which allow you to restrict the result to just the given + * application versions. + * + * @return appVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AppVersion is a list of strings which allow you to restrict the result to just" + + " the given application versions.") + public List getAppVersion() { + return appVersion; + } + + public void setAppVersion(List appVersion) { + this.appVersion = appVersion; + } + + public GetEventsVolumeFromWorkspaceV1Query limit(BigDecimal limit) { + + this.limit = limit; + return this; + } + + /** + * Limit is the total number of items in the result. + * + * @return limit + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Limit is the total number of items in the result.") + public BigDecimal getLimit() { + return limit; + } + + public void setLimit(BigDecimal limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEventsVolumeFromWorkspaceV1Query getEventsVolumeFromWorkspaceV1Query = + (GetEventsVolumeFromWorkspaceV1Query) o; + return Objects.equals(this.workspaceId, getEventsVolumeFromWorkspaceV1Query.workspaceId) + && Objects.equals(this.granularity, getEventsVolumeFromWorkspaceV1Query.granularity) + && Objects.equals(this.startTime, getEventsVolumeFromWorkspaceV1Query.startTime) + && Objects.equals(this.endTime, getEventsVolumeFromWorkspaceV1Query.endTime) + && Objects.equals(this.groupBy, getEventsVolumeFromWorkspaceV1Query.groupBy) + && Objects.equals(this.sourceId, getEventsVolumeFromWorkspaceV1Query.sourceId) + && Objects.equals(this.eventName, getEventsVolumeFromWorkspaceV1Query.eventName) + && Objects.equals(this.eventType, getEventsVolumeFromWorkspaceV1Query.eventType) + && Objects.equals(this.appVersion, getEventsVolumeFromWorkspaceV1Query.appVersion) + && Objects.equals(this.limit, getEventsVolumeFromWorkspaceV1Query.limit); + } + + @Override + public int hashCode() { + return Objects.hash( + workspaceId, + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEventsVolumeFromWorkspaceV1Query {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" granularity: ").append(toIndentedString(granularity)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workspaceId"); + openapiFields.add("granularity"); + openapiFields.add("startTime"); + openapiFields.add("endTime"); + openapiFields.add("groupBy"); + openapiFields.add("sourceId"); + openapiFields.add("eventName"); + openapiFields.add("eventType"); + openapiFields.add("appVersion"); + openapiFields.add("limit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("granularity"); + openapiRequiredFields.add("startTime"); + openapiRequiredFields.add("endTime"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetEventsVolumeFromWorkspaceV1Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetEventsVolumeFromWorkspaceV1Query is" + + " not found in the empty JSON string", + GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetEventsVolumeFromWorkspaceV1Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetEventsVolumeFromWorkspaceV1Query` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("granularity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `granularity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("granularity").toString())); + } + if (!jsonObj.get("startTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `startTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("startTime").toString())); + } + if (!jsonObj.get("endTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `endTime` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("endTime").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groupBy` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("groupBy").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("sourceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventName` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventType` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `appVersion` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("appVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetEventsVolumeFromWorkspaceV1Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetEventsVolumeFromWorkspaceV1Query' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetEventsVolumeFromWorkspaceV1Query.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetEventsVolumeFromWorkspaceV1Query value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetEventsVolumeFromWorkspaceV1Query read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetEventsVolumeFromWorkspaceV1Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEventsVolumeFromWorkspaceV1Query + * @throws IOException if the JSON string is invalid with respect to + * GetEventsVolumeFromWorkspaceV1Query + */ + public static GetEventsVolumeFromWorkspaceV1Query fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetEventsVolumeFromWorkspaceV1Query.class); + } + + /** + * Convert an instance of GetEventsVolumeFromWorkspaceV1Query to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Query.java b/src/main/java/com/segment/publicapi/models/Query.java new file mode 100644 index 00000000..6feeb2c2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Query.java @@ -0,0 +1,669 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Input query returned. */ +@ApiModel(description = "Input query returned.") +public class Query { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + /** Granularity corresponds to the requested bucket granularity. */ + @JsonAdapter(GranularityEnum.Adapter.class) + public enum GranularityEnum { + DAY("DAY"), + + HOUR("HOUR"), + + MINUTE("MINUTE"); + + private String value; + + GranularityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GranularityEnum fromValue(String value) { + for (GranularityEnum b : GranularityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final GranularityEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GranularityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GranularityEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_GRANULARITY = "granularity"; + + @SerializedName(SERIALIZED_NAME_GRANULARITY) + private GranularityEnum granularity; + + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + private String startTime; + + public static final String SERIALIZED_NAME_END_TIME = "endTime"; + + @SerializedName(SERIALIZED_NAME_END_TIME) + private String endTime; + + public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; + + @SerializedName(SERIALIZED_NAME_GROUP_BY) + private List groupBy = null; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private List sourceId = null; + + public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; + + @SerializedName(SERIALIZED_NAME_EVENT_NAME) + private List eventName = null; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private List eventType = null; + + public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; + + @SerializedName(SERIALIZED_NAME_APP_VERSION) + private List appVersion = null; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + private BigDecimal limit; + + public Query() {} + + public Query workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * Workspace being requested. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Workspace being requested.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public Query granularity(GranularityEnum granularity) { + + this.granularity = granularity; + return this; + } + + /** + * Granularity corresponds to the requested bucket granularity. + * + * @return granularity + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Granularity corresponds to the requested bucket granularity.") + public GranularityEnum getGranularity() { + return granularity; + } + + public void setGranularity(GranularityEnum granularity) { + this.granularity = granularity; + } + + public Query startTime(String startTime) { + + this.startTime = startTime; + return this; + } + + /** + * StartTime is the ISO8601 formatted timestamp corresponding to the beginning of the requested + * time frame, inclusive. + * + * @return startTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" + + " the requested time frame, inclusive.") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public Query endTime(String endTime) { + + this.endTime = endTime; + return this; + } + + /** + * EndTime is the ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. + * + * @return endTime + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" + + " requested time frame, noninclusive.") + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Query groupBy(List groupBy) { + + this.groupBy = groupBy; + return this; + } + + public Query addGroupByItem(String groupByItem) { + if (this.groupBy == null) { + this.groupBy = new ArrayList<>(); + } + this.groupBy.add(groupByItem); + return this; + } + + /** + * GroupBy is a comma-delimited list of strings representing the dimensions to group the result + * by. The current options are: `eventName` or `eventType`. + * + * @return groupBy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "GroupBy is a comma-delimited list of strings representing the dimensions to" + + " group the result by. The current options are: `eventName` or" + + " `eventType`.") + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public Query sourceId(List sourceId) { + + this.sourceId = sourceId; + return this; + } + + public Query addSourceIdItem(String sourceIdItem) { + if (this.sourceId == null) { + this.sourceId = new ArrayList<>(); + } + this.sourceId.add(sourceIdItem); + return this; + } + + /** + * List of strings which allow you to restrict the result to just the given Sources. + * + * @return sourceId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "List of strings which allow you to restrict the result to just the given" + + " Sources.") + public List getSourceId() { + return sourceId; + } + + public void setSourceId(List sourceId) { + this.sourceId = sourceId; + } + + public Query eventName(List eventName) { + + this.eventName = eventName; + return this; + } + + public Query addEventNameItem(String eventNameItem) { + if (this.eventName == null) { + this.eventName = new ArrayList<>(); + } + this.eventName.add(eventNameItem); + return this; + } + + /** + * EventName is a list of strings which allow you to restrict the result to just the given event + * names. + * + * @return eventName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventName is a list of strings which allow you to restrict the result to just" + + " the given event names.") + public List getEventName() { + return eventName; + } + + public void setEventName(List eventName) { + this.eventName = eventName; + } + + public Query eventType(List eventType) { + + this.eventType = eventType; + return this; + } + + public Query addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * EventType is a list of strings which allow you to restrict the result to just the given event + * types. + * + * @return eventType + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "EventType is a list of strings which allow you to restrict the result to just" + + " the given event types.") + public List getEventType() { + return eventType; + } + + public void setEventType(List eventType) { + this.eventType = eventType; + } + + public Query appVersion(List appVersion) { + + this.appVersion = appVersion; + return this; + } + + public Query addAppVersionItem(String appVersionItem) { + if (this.appVersion == null) { + this.appVersion = new ArrayList<>(); + } + this.appVersion.add(appVersionItem); + return this; + } + + /** + * AppVersion is a list of strings which allow you to restrict the result to just the given + * application versions. + * + * @return appVersion + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "AppVersion is a list of strings which allow you to restrict the result to just" + + " the given application versions.") + public List getAppVersion() { + return appVersion; + } + + public void setAppVersion(List appVersion) { + this.appVersion = appVersion; + } + + public Query limit(BigDecimal limit) { + + this.limit = limit; + return this; + } + + /** + * Limit is the total number of items in the result. + * + * @return limit + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Limit is the total number of items in the result.") + public BigDecimal getLimit() { + return limit; + } + + public void setLimit(BigDecimal limit) { + this.limit = limit; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Query query = (Query) o; + return Objects.equals(this.workspaceId, query.workspaceId) + && Objects.equals(this.granularity, query.granularity) + && Objects.equals(this.startTime, query.startTime) + && Objects.equals(this.endTime, query.endTime) + && Objects.equals(this.groupBy, query.groupBy) + && Objects.equals(this.sourceId, query.sourceId) + && Objects.equals(this.eventName, query.eventName) + && Objects.equals(this.eventType, query.eventType) + && Objects.equals(this.appVersion, query.appVersion) + && Objects.equals(this.limit, query.limit); + } + + @Override + public int hashCode() { + return Objects.hash( + workspaceId, + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + limit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Query {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" granularity: ").append(toIndentedString(granularity)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workspaceId"); + openapiFields.add("granularity"); + openapiFields.add("startTime"); + openapiFields.add("endTime"); + openapiFields.add("groupBy"); + openapiFields.add("sourceId"); + openapiFields.add("eventName"); + openapiFields.add("eventType"); + openapiFields.add("appVersion"); + openapiFields.add("limit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("granularity"); + openapiRequiredFields.add("startTime"); + openapiRequiredFields.add("endTime"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Query.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Query is not found in the empty JSON" + + " string", + Query.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Query`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Query.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("granularity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `granularity` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("granularity").toString())); + } + if (!jsonObj.get("startTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `startTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("startTime").toString())); + } + if (!jsonObj.get("endTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `endTime` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("endTime").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groupBy` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("groupBy").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("sourceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventName` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventType` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `appVersion` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("appVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Query' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Query.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Query value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Query read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of Query + * @throws IOException if the JSON string is invalid with respect to Query + */ + public static Query fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Query.class); + } + + /** + * Convert an instance of Query to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java index cbb9d642..b9ff2a12 100644 --- a/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceEventVolumeV1.java @@ -81,8 +81,8 @@ public SourceEventVolumeV1 source(Source source) { * * @return source */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(value = "") public Source getSource() { return source; } @@ -243,7 +243,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("source"); openapiRequiredFields.add("total"); openapiRequiredFields.add("series"); } From c6a7ce00659ccc8faf98a45ac1f33dabe22a6047 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 3 Feb 2023 22:14:33 +0000 Subject: [PATCH 045/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c3175028. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 13 ++++++++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 072d363e..c4ccc44f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.0.0 +Latest API and SDK version: 34.0.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.0.0 + 34.0.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.0.0" + implementation "com.segment.publicapi:segment-publicapi:34.0.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.0.0.jar` +* `target/segment-publicapi-34.0.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index bf2e4526..d8797f37 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.0.0 + 34.0.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 6a331dec..e06ab02e 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.0.0 (Java)"); + setUserAgent("Public API SDK 34.0.1 (Java)"); authentications = new HashMap(); } @@ -686,13 +686,20 @@ public List parameterToPairs(String collectionFormat, String name, Collect delimiter = escapeString("|"); } + boolean quotesNeeded = + !value.isEmpty() && value.iterator().next().getClass().equals(String.class); + StringBuilder sb = new StringBuilder(); for (Object item : value) { sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); + if (quotesNeeded) { + sb.append(escapeString("\"" + parameterToString(item) + "\"")); + } else { + sb.append(escapeString(parameterToString(item))); + } } - params.add(new Pair(name, sb.substring(delimiter.length()))); + params.add(new Pair(name, "[".concat(sb.substring(delimiter.length())).concat("]"))); return params; } From 379aaa7c7407210afdab43cb29f2ae38d74f5842 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 3 Feb 2023 23:57:43 +0000 Subject: [PATCH 046/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a96d874. From a62c518e6471d924c8d33a08aaa4679c6b7716c2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 4 Feb 2023 00:43:37 +0000 Subject: [PATCH 047/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4851e54. From bd6a01c791c4384eb16cdf414861de2b0a6bff2a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 4 Feb 2023 01:31:15 +0000 Subject: [PATCH 048/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@41c0dbf. From 651181970fb66b33f24417d8ef2edc25f1f28486 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 8 Feb 2023 09:50:17 +0000 Subject: [PATCH 049/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@044027b. From 720e2c5cbabfa6c5da72d5d68b9627b110fd7dd4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 8 Feb 2023 12:48:27 +0000 Subject: [PATCH 050/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ae2e06c. From 9d7438d37af653ee795c28ad2ab122aa50ec44a4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 20 Feb 2023 08:17:29 +0000 Subject: [PATCH 051/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c539e0c. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 40 + .../publicapi/api/DestinationsApi.java | 45 +- .../segment/publicapi/api/ReverseEtlApi.java | 936 ++++++++++++++++++ ...eateDestinationSubscriptionAlphaInput.java | 44 +- .../models/CreateFunctionV1Input.java | 2 + .../CreateReverseEtlModel200Response.java | 197 ++++ .../models/CreateReverseEtlModelInput.java | 547 ++++++++++ .../models/CreateReverseEtlModelOutput.java | 205 ++++ .../DeleteReverseEtlModel200Response.java | 197 ++++ .../models/DeleteReverseEtlModelOutput.java | 257 +++++ .../models/DestinationSubscription.java | 45 +- .../segment/publicapi/models/Function.java | 2 + .../segment/publicapi/models/Function1.java | 2 + .../segment/publicapi/models/Function2.java | 2 + .../segment/publicapi/models/FunctionV1.java | 2 + .../models/GetReverseEtlModel200Response.java | 197 ++++ .../models/GetReverseEtlModelOutput.java | 205 ++++ .../publicapi/models/ListFunctionItemV1.java | 2 + .../ListReverseEtlModels200Response.java | 197 ++++ .../models/ListReverseEtlModelsOutput.java | 253 +++++ .../publicapi/models/ReverseEtlModel.java | 532 ++++++++++ .../publicapi/models/ReverseEtlModel1.java | 532 ++++++++++ .../publicapi/models/Subscription.java | 45 +- .../UpdateReverseEtlModel200Response.java | 197 ++++ .../models/UpdateReverseEtlModelInput.java | 510 ++++++++++ .../models/UpdateReverseEtlModelOutput.java | 205 ++++ 29 files changed, 5380 insertions(+), 30 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/api/ReverseEtlApi.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListReverseEtlModels200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListReverseEtlModelsOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlModel.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlModel1.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateReverseEtlModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelOutput.java diff --git a/README.md b/README.md index c4ccc44f..875458e0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.0.1 +Latest API and SDK version: 34.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.0.1 + 34.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.0.1" + implementation "com.segment.publicapi:segment-publicapi:34.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.0.1.jar` +* `target/segment-publicapi-34.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index d8797f37..3fbdeff7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.0.1 + 34.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index e06ab02e..fdd41965 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.0.1 (Java)"); + setUserAgent("Public API SDK 34.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 97e84a4d..465cdf1e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -259,6 +259,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateLabelV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateLabelV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateReverseEtlModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateReverseEtlModelInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateReverseEtlModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateSource200Response .CustomTypeAdapterFactory()); @@ -372,6 +381,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteRegulationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteReverseEtlModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteReverseEtlModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteSource200Response .CustomTypeAdapterFactory()); @@ -605,6 +620,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetRegulationV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetReverseEtlModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetReverseEtlModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetSource200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -799,6 +820,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListRegulationsFromSourceV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListReverseEtlModels200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListReverseEtlModelsOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListRoles200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1099,6 +1126,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RequestErrorEnvelope.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ResourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlModel1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1214,6 +1245,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.UpdateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateReverseEtlModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateReverseEtlModelInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateReverseEtlModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateRulesInTrackingPlan200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 379f821c..faca56cf 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -1144,12 +1144,15 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall } /** - * List Delivery Metrics Summary from Destination Get event delivery metrics summary from a - * Destination. Based on the granularity, there are restrictions on the time range you can - * query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 - * hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start - * time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible - * start time: 60 days in the past + * List Delivery Metrics Summary from Destination Get an event delivery metrics summary from a + * Destination. Based on the granularity chosen, there are restrictions on the time range you + * can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in + * the past **Hour**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past + * **Day**: - Max time range: 60 days - Oldest possible start time: 60 days in the past The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to @@ -1189,12 +1192,15 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall } /** - * List Delivery Metrics Summary from Destination Get event delivery metrics summary from a - * Destination. Based on the granularity, there are restrictions on the time range you can - * query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible start time: 48 - * hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest possible start - * time: 10 days in the past **Day Granularity**: - Max time range: 60 days - Oldest possible - * start time: 60 days in the past + * List Delivery Metrics Summary from Destination Get an event delivery metrics summary from a + * Destination. Based on the granularity chosen, there are restrictions on the time range you + * can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in + * the past **Hour**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past + * **Day**: - Max time range: 60 days - Oldest possible start time: 60 days in the past The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to @@ -1236,12 +1242,15 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall } /** - * List Delivery Metrics Summary from Destination (asynchronously) Get event delivery metrics - * summary from a Destination. Based on the granularity, there are restrictions on the time - * range you can query: **Minute Granularity**: - Max time range: 4 hours - Oldest possible - * start time: 48 hours in the past **Hour Granularity**: - Max Time range: 1 week - Oldest - * possible start time: 10 days in the past **Day Granularity**: - Max time range: 60 days - - * Oldest possible start time: 60 days in the past + * List Delivery Metrics Summary from Destination (asynchronously) Get an event delivery metrics + * summary from a Destination. Based on the granularity chosen, there are restrictions on the + * time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: + * 48 hours in the past **Hour**: - Max Time range: 1 week - Oldest possible start time: 10 days + * in the past **Day**: - Max time range: 60 days - Oldest possible start time: 60 days in the + * past The rate limit for this endpoint is 60 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param sourceId The id of the Source linked to the Destination. Config API note: analogous to diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java new file mode 100644 index 00000000..fe5aa548 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -0,0 +1,936 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateReverseEtlModel200Response; +import com.segment.publicapi.models.CreateReverseEtlModelInput; +import com.segment.publicapi.models.DeleteReverseEtlModel200Response; +import com.segment.publicapi.models.GetReverseEtlModel200Response; +import com.segment.publicapi.models.ListReverseEtlModels200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.UpdateReverseEtlModel200Response; +import com.segment.publicapi.models.UpdateReverseEtlModelInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ReverseEtlApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ReverseEtlApi() { + this(Configuration.getDefaultApiClient()); + } + + public ReverseEtlApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createReverseEtlModel + * + * @param createReverseEtlModelInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createReverseEtlModelCall( + CreateReverseEtlModelInput createReverseEtlModelInput, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createReverseEtlModelInput; + + // create path and map variables + String localVarPath = "/reverse-etl-models"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createReverseEtlModelValidateBeforeCall( + CreateReverseEtlModelInput createReverseEtlModelInput, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'createReverseEtlModelInput' is set + if (createReverseEtlModelInput == null) { + throw new ApiException( + "Missing the required parameter 'createReverseEtlModelInput' when calling" + + " createReverseEtlModel(Async)"); + } + + okhttp3.Call localVarCall = + createReverseEtlModelCall(createReverseEtlModelInput, _callback); + return localVarCall; + } + + /** + * Create Reverse Etl Model Creates a new Reverse ETL Model. • When called, this endpoint may + * generate the `Model Created` event in the [audit trail](/tag/Audit-Trail). + * + * @param createReverseEtlModelInput (required) + * @return CreateReverseEtlModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateReverseEtlModel200Response createReverseEtlModel( + CreateReverseEtlModelInput createReverseEtlModelInput) throws ApiException { + ApiResponse localVarResp = + createReverseEtlModelWithHttpInfo(createReverseEtlModelInput); + return localVarResp.getData(); + } + + /** + * Create Reverse Etl Model Creates a new Reverse ETL Model. • When called, this endpoint may + * generate the `Model Created` event in the [audit trail](/tag/Audit-Trail). + * + * @param createReverseEtlModelInput (required) + * @return ApiResponse<CreateReverseEtlModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createReverseEtlModelWithHttpInfo( + CreateReverseEtlModelInput createReverseEtlModelInput) throws ApiException { + okhttp3.Call localVarCall = + createReverseEtlModelValidateBeforeCall(createReverseEtlModelInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Reverse Etl Model (asynchronously) Creates a new Reverse ETL Model. • When called, + * this endpoint may generate the `Model Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param createReverseEtlModelInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createReverseEtlModelAsync( + CreateReverseEtlModelInput createReverseEtlModelInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createReverseEtlModelValidateBeforeCall(createReverseEtlModelInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteReverseEtlModel + * + * @param modelId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteReverseEtlModelCall(String modelId, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}" + .replaceAll( + "\\{" + "modelId" + "\\}", + localVarApiClient.escapeString(modelId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteReverseEtlModelValidateBeforeCall( + String modelId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " deleteReverseEtlModel(Async)"); + } + + okhttp3.Call localVarCall = deleteReverseEtlModelCall(modelId, _callback); + return localVarCall; + } + + /** + * Delete Reverse Etl Model Deletes an existing Model. • When called, this endpoint may generate + * the `Model Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param modelId (required) + * @return DeleteReverseEtlModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public DeleteReverseEtlModel200Response deleteReverseEtlModel(String modelId) + throws ApiException { + ApiResponse localVarResp = + deleteReverseEtlModelWithHttpInfo(modelId); + return localVarResp.getData(); + } + + /** + * Delete Reverse Etl Model Deletes an existing Model. • When called, this endpoint may generate + * the `Model Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param modelId (required) + * @return ApiResponse<DeleteReverseEtlModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse deleteReverseEtlModelWithHttpInfo( + String modelId) throws ApiException { + okhttp3.Call localVarCall = deleteReverseEtlModelValidateBeforeCall(modelId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Reverse Etl Model (asynchronously) Deletes an existing Model. • When called, this + * endpoint may generate the `Model Deleted` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param modelId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteReverseEtlModelAsync( + String modelId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = deleteReverseEtlModelValidateBeforeCall(modelId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getReverseEtlModel + * + * @param modelId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}" + .replaceAll( + "\\{" + "modelId" + "\\}", + localVarApiClient.escapeString(modelId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getReverseEtlModelValidateBeforeCall( + String modelId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " getReverseEtlModel(Async)"); + } + + okhttp3.Call localVarCall = getReverseEtlModelCall(modelId, _callback); + return localVarCall; + } + + /** + * Get Reverse Etl Model Returns a Reverse ETL Model by its id. + * + * @param modelId (required) + * @return GetReverseEtlModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetReverseEtlModel200Response getReverseEtlModel(String modelId) throws ApiException { + ApiResponse localVarResp = + getReverseEtlModelWithHttpInfo(modelId); + return localVarResp.getData(); + } + + /** + * Get Reverse Etl Model Returns a Reverse ETL Model by its id. + * + * @param modelId (required) + * @return ApiResponse<GetReverseEtlModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getReverseEtlModelWithHttpInfo(String modelId) + throws ApiException { + okhttp3.Call localVarCall = getReverseEtlModelValidateBeforeCall(modelId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Reverse Etl Model (asynchronously) Returns a Reverse ETL Model by its id. + * + * @param modelId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getReverseEtlModelAsync( + String modelId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getReverseEtlModelValidateBeforeCall(modelId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listReverseEtlModels + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listReverseEtlModelsCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/reverse-etl-models"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listReverseEtlModelsValidateBeforeCall( + PaginationInput pagination, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listReverseEtlModels(Async)"); + } + + okhttp3.Call localVarCall = listReverseEtlModelsCall(pagination, _callback); + return localVarCall; + } + + /** + * List Reverse Etl Models Returns a list of Reverse ETL Models. + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ListReverseEtlModels200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListReverseEtlModels200Response listReverseEtlModels(PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listReverseEtlModelsWithHttpInfo(pagination); + return localVarResp.getData(); + } + + /** + * List Reverse Etl Models Returns a list of Reverse ETL Models. + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListReverseEtlModels200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listReverseEtlModelsWithHttpInfo( + PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listReverseEtlModelsValidateBeforeCall(pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Reverse Etl Models (asynchronously) Returns a list of Reverse ETL Models. + * + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listReverseEtlModelsAsync( + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listReverseEtlModelsValidateBeforeCall(pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateReverseEtlModel + * + * @param modelId (required) + * @param updateReverseEtlModelInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateReverseEtlModelCall( + String modelId, + UpdateReverseEtlModelInput updateReverseEtlModelInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateReverseEtlModelInput; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}" + .replaceAll( + "\\{" + "modelId" + "\\}", + localVarApiClient.escapeString(modelId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateReverseEtlModelValidateBeforeCall( + String modelId, + UpdateReverseEtlModelInput updateReverseEtlModelInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " updateReverseEtlModel(Async)"); + } + + // verify the required parameter 'updateReverseEtlModelInput' is set + if (updateReverseEtlModelInput == null) { + throw new ApiException( + "Missing the required parameter 'updateReverseEtlModelInput' when calling" + + " updateReverseEtlModel(Async)"); + } + + okhttp3.Call localVarCall = + updateReverseEtlModelCall(modelId, updateReverseEtlModelInput, _callback); + return localVarCall; + } + + /** + * Update Reverse Etl Model Updates an existing Reverse ETL Model. • When called, this endpoint + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* Model + * Settings Saved * Model State Change Toggled + * + * @param modelId (required) + * @param updateReverseEtlModelInput (required) + * @return UpdateReverseEtlModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateReverseEtlModel200Response updateReverseEtlModel( + String modelId, UpdateReverseEtlModelInput updateReverseEtlModelInput) + throws ApiException { + ApiResponse localVarResp = + updateReverseEtlModelWithHttpInfo(modelId, updateReverseEtlModelInput); + return localVarResp.getData(); + } + + /** + * Update Reverse Etl Model Updates an existing Reverse ETL Model. • When called, this endpoint + * may generate one or more of the following [audit trail](/tag/Audit-Trail) events:* Model + * Settings Saved * Model State Change Toggled + * + * @param modelId (required) + * @param updateReverseEtlModelInput (required) + * @return ApiResponse<UpdateReverseEtlModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse updateReverseEtlModelWithHttpInfo( + String modelId, UpdateReverseEtlModelInput updateReverseEtlModelInput) + throws ApiException { + okhttp3.Call localVarCall = + updateReverseEtlModelValidateBeforeCall(modelId, updateReverseEtlModelInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Reverse Etl Model (asynchronously) Updates an existing Reverse ETL Model. • When + * called, this endpoint may generate one or more of the following [audit + * trail](/tag/Audit-Trail) events:* Model Settings Saved * Model State Change Toggled + * + * @param modelId (required) + * @param updateReverseEtlModelInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateReverseEtlModelAsync( + String modelId, + UpdateReverseEtlModelInput updateReverseEtlModelInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateReverseEtlModelValidateBeforeCall( + modelId, updateReverseEtlModelInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index 4c106b62..b494f567 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -61,6 +61,11 @@ public class CreateDestinationSubscriptionAlphaInput { @SerializedName(SERIALIZED_NAME_SETTINGS) private Map settings; + public static final String SERIALIZED_NAME_MODEL_ID = "modelId"; + + @SerializedName(SERIALIZED_NAME_MODEL_ID) + private String modelId; + public CreateDestinationSubscriptionAlphaInput() {} public CreateDestinationSubscriptionAlphaInput name(String name) { @@ -170,6 +175,30 @@ public void setSettings(Map settings) { this.settings = settings; } + public CreateDestinationSubscriptionAlphaInput modelId(String modelId) { + + this.modelId = modelId; + return this; + } + + /** + * When creating a Reverse ETL connection, indicates the Model being used to extract data. + * + * @return modelId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "When creating a Reverse ETL connection, indicates the Model being used to" + + " extract data.") + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -184,7 +213,8 @@ public boolean equals(Object o) { && Objects.equals(this.actionId, createDestinationSubscriptionAlphaInput.actionId) && Objects.equals(this.trigger, createDestinationSubscriptionAlphaInput.trigger) && Objects.equals(this.enabled, createDestinationSubscriptionAlphaInput.enabled) - && Objects.equals(this.settings, createDestinationSubscriptionAlphaInput.settings); + && Objects.equals(this.settings, createDestinationSubscriptionAlphaInput.settings) + && Objects.equals(this.modelId, createDestinationSubscriptionAlphaInput.modelId); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -198,7 +228,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(name, actionId, trigger, enabled, settings); + return Objects.hash(name, actionId, trigger, enabled, settings, modelId); } private static int hashCodeNullable(JsonNullable a) { @@ -217,6 +247,7 @@ public String toString() { sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -243,6 +274,7 @@ private String toIndentedString(Object o) { openapiFields.add("trigger"); openapiFields.add("enabled"); openapiFields.add("settings"); + openapiFields.add("modelId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -316,6 +348,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("trigger").toString())); } + if ((jsonObj.get("modelId") != null && !jsonObj.get("modelId").isJsonNull()) + && !jsonObj.get("modelId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `modelId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("modelId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 9bc33f12..afd5bf38 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -62,6 +62,8 @@ public class CreateFunctionV1Input { public enum ResourceTypeEnum { DESTINATION("DESTINATION"), + INSERT_DESTINATION("INSERT_DESTINATION"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java new file mode 100644 index 00000000..bd19f9f2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** CreateReverseEtlModel200Response */ +public class CreateReverseEtlModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateReverseEtlModelOutput data; + + public CreateReverseEtlModel200Response() {} + + public CreateReverseEtlModel200Response data(CreateReverseEtlModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateReverseEtlModelOutput getData() { + return data; + } + + public void setData(CreateReverseEtlModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateReverseEtlModel200Response createReverseEtlModel200Response = + (CreateReverseEtlModel200Response) o; + return Objects.equals(this.data, createReverseEtlModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateReverseEtlModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateReverseEtlModel200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateReverseEtlModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateReverseEtlModel200Response is" + + " not found in the empty JSON string", + CreateReverseEtlModel200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateReverseEtlModel200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateReverseEtlModel200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateReverseEtlModel200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateReverseEtlModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateReverseEtlModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateReverseEtlModel200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateReverseEtlModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateReverseEtlModel200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateReverseEtlModel200Response + */ + public static CreateReverseEtlModel200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateReverseEtlModel200Response.class); + } + + /** + * Convert an instance of CreateReverseEtlModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java new file mode 100644 index 00000000..4870da01 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java @@ -0,0 +1,547 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines how to create a new Model. */ +@ApiModel(description = "Defines how to create a new Model.") +public class CreateReverseEtlModelInput { + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + /** + * Determines the strategy used for triggering syncs, which will be used in conjunction with + * scheduleConfig. + */ + @JsonAdapter(ScheduleStrategyEnum.Adapter.class) + public enum ScheduleStrategyEnum { + MANUAL("MANUAL"), + + PERIODIC("PERIODIC"), + + SPECIFIC_DAYS("SPECIFIC_DAYS"); + + private String value; + + ScheduleStrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScheduleStrategyEnum fromValue(String value) { + for (ScheduleStrategyEnum b : ScheduleStrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ScheduleStrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScheduleStrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScheduleStrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) + private ScheduleStrategyEnum scheduleStrategy; + + public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) + private Map scheduleConfig; + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + public static final String SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN = "queryIdentifierColumn"; + + @SerializedName(SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN) + private String queryIdentifierColumn; + + public CreateReverseEtlModelInput() {} + + public CreateReverseEtlModelInput sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * Indicates which Source to attach this model to. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Indicates which Source to attach this model to.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public CreateReverseEtlModelInput name(String name) { + + this.name = name; + return this; + } + + /** + * A short, human-readable description of the Model. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A short, human-readable description of the Model.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateReverseEtlModelInput description(String description) { + + this.description = description; + return this; + } + + /** + * A longer, more descriptive explanation of the Model. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A longer, more descriptive explanation of the Model.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateReverseEtlModelInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the Model should have syncs enabled. When disabled, no syncs will be + * triggered, regardless of the enabled status of the attached destinations/subscriptions. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Indicates whether the Model should have syncs enabled. When disabled, no syncs" + + " will be triggered, regardless of the enabled status of the attached" + + " destinations/subscriptions.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateReverseEtlModelInput scheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { + + this.scheduleStrategy = scheduleStrategy; + return this; + } + + /** + * Determines the strategy used for triggering syncs, which will be used in conjunction with + * scheduleConfig. + * + * @return scheduleStrategy + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Determines the strategy used for triggering syncs, which will be used in" + + " conjunction with scheduleConfig.") + public ScheduleStrategyEnum getScheduleStrategy() { + return scheduleStrategy; + } + + public void setScheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { + this.scheduleStrategy = scheduleStrategy; + } + + public CreateReverseEtlModelInput scheduleConfig(Map scheduleConfig) { + + this.scheduleConfig = scheduleConfig; + return this; + } + + /** + * Depending on the chosen strategy, configures the schedule for this model. + * + * @return scheduleConfig + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = "Depending on the chosen strategy, configures the schedule for this model.") + public Map getScheduleConfig() { + return scheduleConfig; + } + + public void setScheduleConfig(Map scheduleConfig) { + this.scheduleConfig = scheduleConfig; + } + + public CreateReverseEtlModelInput query(String query) { + + this.query = query; + return this; + } + + /** + * The SQL query that will be executed to extract data from the connected Source. + * + * @return query + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The SQL query that will be executed to extract data from the connected" + + " Source.") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public CreateReverseEtlModelInput queryIdentifierColumn(String queryIdentifierColumn) { + + this.queryIdentifierColumn = queryIdentifierColumn; + return this; + } + + /** + * Indicates the column named in `query` that should be used to uniquely identify the + * extracted records. + * + * @return queryIdentifierColumn + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Indicates the column named in `query` that should be used to uniquely identify" + + " the extracted records.") + public String getQueryIdentifierColumn() { + return queryIdentifierColumn; + } + + public void setQueryIdentifierColumn(String queryIdentifierColumn) { + this.queryIdentifierColumn = queryIdentifierColumn; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateReverseEtlModelInput createReverseEtlModelInput = (CreateReverseEtlModelInput) o; + return Objects.equals(this.sourceId, createReverseEtlModelInput.sourceId) + && Objects.equals(this.name, createReverseEtlModelInput.name) + && Objects.equals(this.description, createReverseEtlModelInput.description) + && Objects.equals(this.enabled, createReverseEtlModelInput.enabled) + && Objects.equals( + this.scheduleStrategy, createReverseEtlModelInput.scheduleStrategy) + && Objects.equals(this.scheduleConfig, createReverseEtlModelInput.scheduleConfig) + && Objects.equals(this.query, createReverseEtlModelInput.query) + && Objects.equals( + this.queryIdentifierColumn, + createReverseEtlModelInput.queryIdentifierColumn); + } + + @Override + public int hashCode() { + return Objects.hash( + sourceId, + name, + description, + enabled, + scheduleStrategy, + scheduleConfig, + query, + queryIdentifierColumn); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateReverseEtlModelInput {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); + sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" queryIdentifierColumn: ") + .append(toIndentedString(queryIdentifierColumn)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("scheduleStrategy"); + openapiFields.add("scheduleConfig"); + openapiFields.add("query"); + openapiFields.add("queryIdentifierColumn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("scheduleStrategy"); + openapiRequiredFields.add("scheduleConfig"); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("queryIdentifierColumn"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateReverseEtlModelInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateReverseEtlModelInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateReverseEtlModelInput is not" + + " found in the empty JSON string", + CreateReverseEtlModelInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateReverseEtlModelInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateReverseEtlModelInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateReverseEtlModelInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("scheduleStrategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `scheduleStrategy` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("scheduleStrategy").toString())); + } + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if (!jsonObj.get("queryIdentifierColumn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `queryIdentifierColumn` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("queryIdentifierColumn").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateReverseEtlModelInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateReverseEtlModelInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateReverseEtlModelInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateReverseEtlModelInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateReverseEtlModelInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateReverseEtlModelInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateReverseEtlModelInput + * @throws IOException if the JSON string is invalid with respect to CreateReverseEtlModelInput + */ + public static CreateReverseEtlModelInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateReverseEtlModelInput.class); + } + + /** + * Convert an instance of CreateReverseEtlModelInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java new file mode 100644 index 00000000..9b2b8f2d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines the results of creating a Model. */ +@ApiModel(description = "Defines the results of creating a Model.") +public class CreateReverseEtlModelOutput { + public static final String SERIALIZED_NAME_REVERSE_ETL_MODEL = "reverseEtlModel"; + + @SerializedName(SERIALIZED_NAME_REVERSE_ETL_MODEL) + private ReverseEtlModel reverseEtlModel; + + public CreateReverseEtlModelOutput() {} + + public CreateReverseEtlModelOutput reverseEtlModel(ReverseEtlModel reverseEtlModel) { + + this.reverseEtlModel = reverseEtlModel; + return this; + } + + /** + * Get reverseEtlModel + * + * @return reverseEtlModel + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ReverseEtlModel getReverseEtlModel() { + return reverseEtlModel; + } + + public void setReverseEtlModel(ReverseEtlModel reverseEtlModel) { + this.reverseEtlModel = reverseEtlModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateReverseEtlModelOutput createReverseEtlModelOutput = (CreateReverseEtlModelOutput) o; + return Objects.equals(this.reverseEtlModel, createReverseEtlModelOutput.reverseEtlModel); + } + + @Override + public int hashCode() { + return Objects.hash(reverseEtlModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateReverseEtlModelOutput {\n"); + sb.append(" reverseEtlModel: ").append(toIndentedString(reverseEtlModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reverseEtlModel"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("reverseEtlModel"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateReverseEtlModelOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateReverseEtlModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateReverseEtlModelOutput is not" + + " found in the empty JSON string", + CreateReverseEtlModelOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateReverseEtlModelOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateReverseEtlModelOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateReverseEtlModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateReverseEtlModelOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateReverseEtlModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateReverseEtlModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateReverseEtlModelOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateReverseEtlModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateReverseEtlModelOutput + * @throws IOException if the JSON string is invalid with respect to CreateReverseEtlModelOutput + */ + public static CreateReverseEtlModelOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateReverseEtlModelOutput.class); + } + + /** + * Convert an instance of CreateReverseEtlModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java new file mode 100644 index 00000000..0b802205 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** DeleteReverseEtlModel200Response */ +public class DeleteReverseEtlModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteReverseEtlModelOutput data; + + public DeleteReverseEtlModel200Response() {} + + public DeleteReverseEtlModel200Response data(DeleteReverseEtlModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteReverseEtlModelOutput getData() { + return data; + } + + public void setData(DeleteReverseEtlModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteReverseEtlModel200Response deleteReverseEtlModel200Response = + (DeleteReverseEtlModel200Response) o; + return Objects.equals(this.data, deleteReverseEtlModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteReverseEtlModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteReverseEtlModel200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteReverseEtlModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteReverseEtlModel200Response is" + + " not found in the empty JSON string", + DeleteReverseEtlModel200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteReverseEtlModel200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteReverseEtlModel200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteReverseEtlModel200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteReverseEtlModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteReverseEtlModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteReverseEtlModel200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteReverseEtlModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteReverseEtlModel200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteReverseEtlModel200Response + */ + public static DeleteReverseEtlModel200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteReverseEtlModel200Response.class); + } + + /** + * Convert an instance of DeleteReverseEtlModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java new file mode 100644 index 00000000..4bc34a18 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java @@ -0,0 +1,257 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines the result of getting a Model. */ +@ApiModel(description = "Defines the result of getting a Model.") +public class DeleteReverseEtlModelOutput { + /** The result of the deletion. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteReverseEtlModelOutput() {} + + public DeleteReverseEtlModelOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The result of the deletion. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The result of the deletion.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteReverseEtlModelOutput deleteReverseEtlModelOutput = (DeleteReverseEtlModelOutput) o; + return Objects.equals(this.status, deleteReverseEtlModelOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteReverseEtlModelOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteReverseEtlModelOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteReverseEtlModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteReverseEtlModelOutput is not" + + " found in the empty JSON string", + DeleteReverseEtlModelOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteReverseEtlModelOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteReverseEtlModelOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteReverseEtlModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteReverseEtlModelOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteReverseEtlModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteReverseEtlModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteReverseEtlModelOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteReverseEtlModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteReverseEtlModelOutput + * @throws IOException if the JSON string is invalid with respect to DeleteReverseEtlModelOutput + */ + public static DeleteReverseEtlModelOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteReverseEtlModelOutput.class); + } + + /** + * Convert an instance of DeleteReverseEtlModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 278abe79..bd09251c 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -74,6 +74,11 @@ public class DestinationSubscription { @SerializedName(SERIALIZED_NAME_TRIGGER) private String trigger; + public static final String SERIALIZED_NAME_MODEL_ID = "modelId"; + + @SerializedName(SERIALIZED_NAME_MODEL_ID) + private String modelId; + public DestinationSubscription() {} public DestinationSubscription id(String id) { @@ -250,6 +255,31 @@ public void setTrigger(String trigger) { this.trigger = trigger; } + public DestinationSubscription modelId(String modelId) { + + this.modelId = modelId; + return this; + } + + /** + * The unique identifier for the linked ReverseETLModel, if this part of a Reverse ETL + * connection. + * + * @return modelId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The unique identifier for the linked ReverseETLModel, if this part of a" + + " Reverse ETL connection.") + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -266,13 +296,14 @@ public boolean equals(Object o) { && Objects.equals(this.destinationId, destinationSubscription.destinationId) && Objects.equals(this.enabled, destinationSubscription.enabled) && Objects.equals(this.settings, destinationSubscription.settings) - && Objects.equals(this.trigger, destinationSubscription.trigger); + && Objects.equals(this.trigger, destinationSubscription.trigger) + && Objects.equals(this.modelId, destinationSubscription.modelId); } @Override public int hashCode() { return Objects.hash( - id, name, actionId, actionSlug, destinationId, enabled, settings, trigger); + id, name, actionId, actionSlug, destinationId, enabled, settings, trigger, modelId); } @Override @@ -287,6 +318,7 @@ public String toString() { sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -316,6 +348,7 @@ private String toIndentedString(Object o) { openapiFields.add("enabled"); openapiFields.add("settings"); openapiFields.add("trigger"); + openapiFields.add("modelId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -410,6 +443,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("trigger").toString())); } + if ((jsonObj.get("modelId") != null && !jsonObj.get("modelId").isJsonNull()) + && !jsonObj.get("modelId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `modelId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("modelId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index f20febe4..73f8cc11 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -50,6 +50,8 @@ public class Function { public enum ResourceTypeEnum { DESTINATION("DESTINATION"), + INSERT_DESTINATION("INSERT_DESTINATION"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java index 8059f0f2..fc7ffe8c 100644 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ b/src/main/java/com/segment/publicapi/models/Function1.java @@ -50,6 +50,8 @@ public class Function1 { public enum ResourceTypeEnum { DESTINATION("DESTINATION"), + INSERT_DESTINATION("INSERT_DESTINATION"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java index 7bba1c6a..296df480 100644 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ b/src/main/java/com/segment/publicapi/models/Function2.java @@ -50,6 +50,8 @@ public class Function2 { public enum ResourceTypeEnum { DESTINATION("DESTINATION"), + INSERT_DESTINATION("INSERT_DESTINATION"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index c6717cbd..57a9b7bc 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -50,6 +50,8 @@ public class FunctionV1 { public enum ResourceTypeEnum { DESTINATION("DESTINATION"), + INSERT_DESTINATION("INSERT_DESTINATION"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java new file mode 100644 index 00000000..02b6574f --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetReverseEtlModel200Response */ +public class GetReverseEtlModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetReverseEtlModelOutput data; + + public GetReverseEtlModel200Response() {} + + public GetReverseEtlModel200Response data(GetReverseEtlModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetReverseEtlModelOutput getData() { + return data; + } + + public void setData(GetReverseEtlModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetReverseEtlModel200Response getReverseEtlModel200Response = + (GetReverseEtlModel200Response) o; + return Objects.equals(this.data, getReverseEtlModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetReverseEtlModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetReverseEtlModel200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetReverseEtlModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetReverseEtlModel200Response is not" + + " found in the empty JSON string", + GetReverseEtlModel200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetReverseEtlModel200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetReverseEtlModel200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetReverseEtlModel200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetReverseEtlModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetReverseEtlModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetReverseEtlModel200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetReverseEtlModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetReverseEtlModel200Response + * @throws IOException if the JSON string is invalid with respect to + * GetReverseEtlModel200Response + */ + public static GetReverseEtlModel200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetReverseEtlModel200Response.class); + } + + /** + * Convert an instance of GetReverseEtlModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java new file mode 100644 index 00000000..578dc5c7 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines the result of getting a Model. */ +@ApiModel(description = "Defines the result of getting a Model.") +public class GetReverseEtlModelOutput { + public static final String SERIALIZED_NAME_REVERSE_ETL_MODEL = "reverseEtlModel"; + + @SerializedName(SERIALIZED_NAME_REVERSE_ETL_MODEL) + private ReverseEtlModel1 reverseEtlModel; + + public GetReverseEtlModelOutput() {} + + public GetReverseEtlModelOutput reverseEtlModel(ReverseEtlModel1 reverseEtlModel) { + + this.reverseEtlModel = reverseEtlModel; + return this; + } + + /** + * Get reverseEtlModel + * + * @return reverseEtlModel + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ReverseEtlModel1 getReverseEtlModel() { + return reverseEtlModel; + } + + public void setReverseEtlModel(ReverseEtlModel1 reverseEtlModel) { + this.reverseEtlModel = reverseEtlModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetReverseEtlModelOutput getReverseEtlModelOutput = (GetReverseEtlModelOutput) o; + return Objects.equals(this.reverseEtlModel, getReverseEtlModelOutput.reverseEtlModel); + } + + @Override + public int hashCode() { + return Objects.hash(reverseEtlModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetReverseEtlModelOutput {\n"); + sb.append(" reverseEtlModel: ").append(toIndentedString(reverseEtlModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reverseEtlModel"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("reverseEtlModel"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetReverseEtlModelOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetReverseEtlModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetReverseEtlModelOutput is not found" + + " in the empty JSON string", + GetReverseEtlModelOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetReverseEtlModelOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetReverseEtlModelOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetReverseEtlModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetReverseEtlModelOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetReverseEtlModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetReverseEtlModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetReverseEtlModelOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetReverseEtlModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetReverseEtlModelOutput + * @throws IOException if the JSON string is invalid with respect to GetReverseEtlModelOutput + */ + public static GetReverseEtlModelOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetReverseEtlModelOutput.class); + } + + /** + * Convert an instance of GetReverseEtlModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index 66c69339..e5cb9494 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -44,6 +44,8 @@ public class ListFunctionItemV1 { public enum ResourceTypeEnum { DESTINATION("DESTINATION"), + INSERT_DESTINATION("INSERT_DESTINATION"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/ListReverseEtlModels200Response.java b/src/main/java/com/segment/publicapi/models/ListReverseEtlModels200Response.java new file mode 100644 index 00000000..3bdb3b6a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListReverseEtlModels200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListReverseEtlModels200Response */ +public class ListReverseEtlModels200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListReverseEtlModelsOutput data; + + public ListReverseEtlModels200Response() {} + + public ListReverseEtlModels200Response data(ListReverseEtlModelsOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListReverseEtlModelsOutput getData() { + return data; + } + + public void setData(ListReverseEtlModelsOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListReverseEtlModels200Response listReverseEtlModels200Response = + (ListReverseEtlModels200Response) o; + return Objects.equals(this.data, listReverseEtlModels200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListReverseEtlModels200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListReverseEtlModels200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListReverseEtlModels200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListReverseEtlModels200Response is not" + + " found in the empty JSON string", + ListReverseEtlModels200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListReverseEtlModels200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListReverseEtlModels200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListReverseEtlModels200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListReverseEtlModels200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListReverseEtlModels200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListReverseEtlModels200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListReverseEtlModels200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListReverseEtlModels200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListReverseEtlModels200Response + * @throws IOException if the JSON string is invalid with respect to + * ListReverseEtlModels200Response + */ + public static ListReverseEtlModels200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListReverseEtlModels200Response.class); + } + + /** + * Convert an instance of ListReverseEtlModels200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListReverseEtlModelsOutput.java b/src/main/java/com/segment/publicapi/models/ListReverseEtlModelsOutput.java new file mode 100644 index 00000000..89b88713 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListReverseEtlModelsOutput.java @@ -0,0 +1,253 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines the result of listing Models. */ +@ApiModel(description = "Defines the result of listing Models.") +public class ListReverseEtlModelsOutput { + public static final String SERIALIZED_NAME_MODELS = "models"; + + @SerializedName(SERIALIZED_NAME_MODELS) + private List models = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListReverseEtlModelsOutput() {} + + public ListReverseEtlModelsOutput models(List models) { + + this.models = models; + return this; + } + + public ListReverseEtlModelsOutput addModelsItem(ReverseEtlModel modelsItem) { + this.models.add(modelsItem); + return this; + } + + /** + * A list of Models that belong to the Workspace. + * + * @return models + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of Models that belong to the Workspace.") + public List getModels() { + return models; + } + + public void setModels(List models) { + this.models = models; + } + + public ListReverseEtlModelsOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListReverseEtlModelsOutput listReverseEtlModelsOutput = (ListReverseEtlModelsOutput) o; + return Objects.equals(this.models, listReverseEtlModelsOutput.models) + && Objects.equals(this.pagination, listReverseEtlModelsOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(models, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListReverseEtlModelsOutput {\n"); + sb.append(" models: ").append(toIndentedString(models)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("models"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("models"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListReverseEtlModelsOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListReverseEtlModelsOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListReverseEtlModelsOutput is not" + + " found in the empty JSON string", + ListReverseEtlModelsOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListReverseEtlModelsOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListReverseEtlModelsOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListReverseEtlModelsOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("models").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `models` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("models").toString())); + } + + JsonArray jsonArraymodels = jsonObj.getAsJsonArray("models"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListReverseEtlModelsOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListReverseEtlModelsOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListReverseEtlModelsOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListReverseEtlModelsOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListReverseEtlModelsOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListReverseEtlModelsOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListReverseEtlModelsOutput + * @throws IOException if the JSON string is invalid with respect to ListReverseEtlModelsOutput + */ + public static ListReverseEtlModelsOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListReverseEtlModelsOutput.class); + } + + /** + * Convert an instance of ListReverseEtlModelsOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java new file mode 100644 index 00000000..19ad6a93 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java @@ -0,0 +1,532 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created Model. */ +@ApiModel(description = "The created Model.") +public class ReverseEtlModel { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) + private String scheduleStrategy; + + public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) + private Map scheduleConfig; + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + public static final String SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN = "queryIdentifierColumn"; + + @SerializedName(SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN) + private String queryIdentifierColumn; + + public ReverseEtlModel() {} + + public ReverseEtlModel id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Model. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Model.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ReverseEtlModel sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The id for the attached Source. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id for the attached Source.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public ReverseEtlModel name(String name) { + + this.name = name; + return this; + } + + /** + * A short, human-readable description of the Model. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A short, human-readable description of the Model.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ReverseEtlModel description(String description) { + + this.description = description; + return this; + } + + /** + * A longer, more descriptive explanation of the Model. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A longer, more descriptive explanation of the Model.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ReverseEtlModel enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the Model should have syncs enabled. When disabled, no syncs will be + * triggered, regardless of the enabled status of the attached destinations/subscriptions. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Indicates whether the Model should have syncs enabled. When disabled, no syncs" + + " will be triggered, regardless of the enabled status of the attached" + + " destinations/subscriptions.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ReverseEtlModel scheduleStrategy(String scheduleStrategy) { + + this.scheduleStrategy = scheduleStrategy; + return this; + } + + /** + * Determines the strategy used for triggering syncs, which will be used in conjunction with + * scheduleConfig. Possible values: \"manual\", \"periodic\", + * \"specific_days\". + * + * @return scheduleStrategy + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Determines the strategy used for triggering syncs, which will be used in" + + " conjunction with scheduleConfig. Possible values: \"manual\"," + + " \"periodic\", \"specific_days\".") + public String getScheduleStrategy() { + return scheduleStrategy; + } + + public void setScheduleStrategy(String scheduleStrategy) { + this.scheduleStrategy = scheduleStrategy; + } + + public ReverseEtlModel scheduleConfig(Map scheduleConfig) { + + this.scheduleConfig = scheduleConfig; + return this; + } + + /** + * Depending on the chosen strategy, configures the schedule for this model. + * + * @return scheduleConfig + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = "Depending on the chosen strategy, configures the schedule for this model.") + public Map getScheduleConfig() { + return scheduleConfig; + } + + public void setScheduleConfig(Map scheduleConfig) { + this.scheduleConfig = scheduleConfig; + } + + public ReverseEtlModel query(String query) { + + this.query = query; + return this; + } + + /** + * The SQL query that will be executed to extract data from the connected Source. + * + * @return query + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The SQL query that will be executed to extract data from the connected" + + " Source.") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public ReverseEtlModel queryIdentifierColumn(String queryIdentifierColumn) { + + this.queryIdentifierColumn = queryIdentifierColumn; + return this; + } + + /** + * Indicates the column named in `query` that should be used to uniquely identify the + * extracted records. + * + * @return queryIdentifierColumn + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Indicates the column named in `query` that should be used to uniquely identify" + + " the extracted records.") + public String getQueryIdentifierColumn() { + return queryIdentifierColumn; + } + + public void setQueryIdentifierColumn(String queryIdentifierColumn) { + this.queryIdentifierColumn = queryIdentifierColumn; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlModel reverseEtlModel = (ReverseEtlModel) o; + return Objects.equals(this.id, reverseEtlModel.id) + && Objects.equals(this.sourceId, reverseEtlModel.sourceId) + && Objects.equals(this.name, reverseEtlModel.name) + && Objects.equals(this.description, reverseEtlModel.description) + && Objects.equals(this.enabled, reverseEtlModel.enabled) + && Objects.equals(this.scheduleStrategy, reverseEtlModel.scheduleStrategy) + && Objects.equals(this.scheduleConfig, reverseEtlModel.scheduleConfig) + && Objects.equals(this.query, reverseEtlModel.query) + && Objects.equals( + this.queryIdentifierColumn, reverseEtlModel.queryIdentifierColumn); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + sourceId, + name, + description, + enabled, + scheduleStrategy, + scheduleConfig, + query, + queryIdentifierColumn); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlModel {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); + sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" queryIdentifierColumn: ") + .append(toIndentedString(queryIdentifierColumn)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("scheduleStrategy"); + openapiFields.add("scheduleConfig"); + openapiFields.add("query"); + openapiFields.add("queryIdentifierColumn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("scheduleStrategy"); + openapiRequiredFields.add("scheduleConfig"); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("queryIdentifierColumn"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReverseEtlModel + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ReverseEtlModel.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlModel is not found in the" + + " empty JSON string", + ReverseEtlModel.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReverseEtlModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlModel` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlModel.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("scheduleStrategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `scheduleStrategy` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("scheduleStrategy").toString())); + } + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if (!jsonObj.get("queryIdentifierColumn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `queryIdentifierColumn` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("queryIdentifierColumn").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReverseEtlModel.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlModel value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlModel read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlModel + * @throws IOException if the JSON string is invalid with respect to ReverseEtlModel + */ + public static ReverseEtlModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlModel.class); + } + + /** + * Convert an instance of ReverseEtlModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlModel1.java b/src/main/java/com/segment/publicapi/models/ReverseEtlModel1.java new file mode 100644 index 00000000..c633b6ff --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlModel1.java @@ -0,0 +1,532 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The requested Model. */ +@ApiModel(description = "The requested Model.") +public class ReverseEtlModel1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) + private String scheduleStrategy; + + public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) + private Map scheduleConfig; + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + public static final String SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN = "queryIdentifierColumn"; + + @SerializedName(SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN) + private String queryIdentifierColumn; + + public ReverseEtlModel1() {} + + public ReverseEtlModel1 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Model. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Model.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ReverseEtlModel1 sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The id for the attached Source. + * + * @return sourceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id for the attached Source.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public ReverseEtlModel1 name(String name) { + + this.name = name; + return this; + } + + /** + * A short, human-readable description of the Model. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A short, human-readable description of the Model.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ReverseEtlModel1 description(String description) { + + this.description = description; + return this; + } + + /** + * A longer, more descriptive explanation of the Model. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "A longer, more descriptive explanation of the Model.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ReverseEtlModel1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the Model should have syncs enabled. When disabled, no syncs will be + * triggered, regardless of the enabled status of the attached destinations/subscriptions. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Indicates whether the Model should have syncs enabled. When disabled, no syncs" + + " will be triggered, regardless of the enabled status of the attached" + + " destinations/subscriptions.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ReverseEtlModel1 scheduleStrategy(String scheduleStrategy) { + + this.scheduleStrategy = scheduleStrategy; + return this; + } + + /** + * Determines the strategy used for triggering syncs, which will be used in conjunction with + * scheduleConfig. Possible values: \"manual\", \"periodic\", + * \"specific_days\". + * + * @return scheduleStrategy + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Determines the strategy used for triggering syncs, which will be used in" + + " conjunction with scheduleConfig. Possible values: \"manual\"," + + " \"periodic\", \"specific_days\".") + public String getScheduleStrategy() { + return scheduleStrategy; + } + + public void setScheduleStrategy(String scheduleStrategy) { + this.scheduleStrategy = scheduleStrategy; + } + + public ReverseEtlModel1 scheduleConfig(Map scheduleConfig) { + + this.scheduleConfig = scheduleConfig; + return this; + } + + /** + * Depending on the chosen strategy, configures the schedule for this model. + * + * @return scheduleConfig + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = "Depending on the chosen strategy, configures the schedule for this model.") + public Map getScheduleConfig() { + return scheduleConfig; + } + + public void setScheduleConfig(Map scheduleConfig) { + this.scheduleConfig = scheduleConfig; + } + + public ReverseEtlModel1 query(String query) { + + this.query = query; + return this; + } + + /** + * The SQL query that will be executed to extract data from the connected Source. + * + * @return query + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "The SQL query that will be executed to extract data from the connected" + + " Source.") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public ReverseEtlModel1 queryIdentifierColumn(String queryIdentifierColumn) { + + this.queryIdentifierColumn = queryIdentifierColumn; + return this; + } + + /** + * Indicates the column named in `query` that should be used to uniquely identify the + * extracted records. + * + * @return queryIdentifierColumn + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Indicates the column named in `query` that should be used to uniquely identify" + + " the extracted records.") + public String getQueryIdentifierColumn() { + return queryIdentifierColumn; + } + + public void setQueryIdentifierColumn(String queryIdentifierColumn) { + this.queryIdentifierColumn = queryIdentifierColumn; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlModel1 reverseEtlModel1 = (ReverseEtlModel1) o; + return Objects.equals(this.id, reverseEtlModel1.id) + && Objects.equals(this.sourceId, reverseEtlModel1.sourceId) + && Objects.equals(this.name, reverseEtlModel1.name) + && Objects.equals(this.description, reverseEtlModel1.description) + && Objects.equals(this.enabled, reverseEtlModel1.enabled) + && Objects.equals(this.scheduleStrategy, reverseEtlModel1.scheduleStrategy) + && Objects.equals(this.scheduleConfig, reverseEtlModel1.scheduleConfig) + && Objects.equals(this.query, reverseEtlModel1.query) + && Objects.equals( + this.queryIdentifierColumn, reverseEtlModel1.queryIdentifierColumn); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + sourceId, + name, + description, + enabled, + scheduleStrategy, + scheduleConfig, + query, + queryIdentifierColumn); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlModel1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); + sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" queryIdentifierColumn: ") + .append(toIndentedString(queryIdentifierColumn)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("scheduleStrategy"); + openapiFields.add("scheduleConfig"); + openapiFields.add("query"); + openapiFields.add("queryIdentifierColumn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("sourceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("scheduleStrategy"); + openapiRequiredFields.add("scheduleConfig"); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("queryIdentifierColumn"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReverseEtlModel1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ReverseEtlModel1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlModel1 is not found in the" + + " empty JSON string", + ReverseEtlModel1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReverseEtlModel1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlModel1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlModel1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("scheduleStrategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `scheduleStrategy` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("scheduleStrategy").toString())); + } + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if (!jsonObj.get("queryIdentifierColumn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `queryIdentifierColumn` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("queryIdentifierColumn").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlModel1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlModel1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReverseEtlModel1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlModel1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlModel1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlModel1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlModel1 + * @throws IOException if the JSON string is invalid with respect to ReverseEtlModel1 + */ + public static ReverseEtlModel1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlModel1.class); + } + + /** + * Convert an instance of ReverseEtlModel1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Subscription.java b/src/main/java/com/segment/publicapi/models/Subscription.java index e91e48ac..13bf0f4b 100644 --- a/src/main/java/com/segment/publicapi/models/Subscription.java +++ b/src/main/java/com/segment/publicapi/models/Subscription.java @@ -74,6 +74,11 @@ public class Subscription { @SerializedName(SERIALIZED_NAME_TRIGGER) private String trigger; + public static final String SERIALIZED_NAME_MODEL_ID = "modelId"; + + @SerializedName(SERIALIZED_NAME_MODEL_ID) + private String modelId; + public Subscription() {} public Subscription id(String id) { @@ -250,6 +255,31 @@ public void setTrigger(String trigger) { this.trigger = trigger; } + public Subscription modelId(String modelId) { + + this.modelId = modelId; + return this; + } + + /** + * The unique identifier for the linked ReverseETLModel, if this part of a Reverse ETL + * connection. + * + * @return modelId + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The unique identifier for the linked ReverseETLModel, if this part of a" + + " Reverse ETL connection.") + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -266,13 +296,14 @@ public boolean equals(Object o) { && Objects.equals(this.destinationId, subscription.destinationId) && Objects.equals(this.enabled, subscription.enabled) && Objects.equals(this.settings, subscription.settings) - && Objects.equals(this.trigger, subscription.trigger); + && Objects.equals(this.trigger, subscription.trigger) + && Objects.equals(this.modelId, subscription.modelId); } @Override public int hashCode() { return Objects.hash( - id, name, actionId, actionSlug, destinationId, enabled, settings, trigger); + id, name, actionId, actionSlug, destinationId, enabled, settings, trigger, modelId); } @Override @@ -287,6 +318,7 @@ public String toString() { sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -316,6 +348,7 @@ private String toIndentedString(Object o) { openapiFields.add("enabled"); openapiFields.add("settings"); openapiFields.add("trigger"); + openapiFields.add("modelId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -410,6 +443,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("trigger").toString())); } + if ((jsonObj.get("modelId") != null && !jsonObj.get("modelId").isJsonNull()) + && !jsonObj.get("modelId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `modelId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("modelId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModel200Response.java new file mode 100644 index 00000000..1a090934 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModel200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateReverseEtlModel200Response */ +public class UpdateReverseEtlModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateReverseEtlModelOutput data; + + public UpdateReverseEtlModel200Response() {} + + public UpdateReverseEtlModel200Response data(UpdateReverseEtlModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateReverseEtlModelOutput getData() { + return data; + } + + public void setData(UpdateReverseEtlModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateReverseEtlModel200Response updateReverseEtlModel200Response = + (UpdateReverseEtlModel200Response) o; + return Objects.equals(this.data, updateReverseEtlModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateReverseEtlModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateReverseEtlModel200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateReverseEtlModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateReverseEtlModel200Response is" + + " not found in the empty JSON string", + UpdateReverseEtlModel200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateReverseEtlModel200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateReverseEtlModel200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateReverseEtlModel200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateReverseEtlModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateReverseEtlModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateReverseEtlModel200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateReverseEtlModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateReverseEtlModel200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateReverseEtlModel200Response + */ + public static UpdateReverseEtlModel200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateReverseEtlModel200Response.class); + } + + /** + * Convert an instance of UpdateReverseEtlModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java new file mode 100644 index 00000000..af3e08af --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Defines how to update an existing Model. */ +@ApiModel(description = "Defines how to update an existing Model.") +public class UpdateReverseEtlModelInput { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + /** + * Determines the strategy used for triggering syncs, which will be used in conjunction with + * scheduleConfig. + */ + @JsonAdapter(ScheduleStrategyEnum.Adapter.class) + public enum ScheduleStrategyEnum { + MANUAL("MANUAL"), + + PERIODIC("PERIODIC"), + + SPECIFIC_DAYS("SPECIFIC_DAYS"); + + private String value; + + ScheduleStrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScheduleStrategyEnum fromValue(String value) { + for (ScheduleStrategyEnum b : ScheduleStrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ScheduleStrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScheduleStrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScheduleStrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) + private ScheduleStrategyEnum scheduleStrategy; + + public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; + + @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) + private Map scheduleConfig; + + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + public static final String SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN = "queryIdentifierColumn"; + + @SerializedName(SERIALIZED_NAME_QUERY_IDENTIFIER_COLUMN) + private String queryIdentifierColumn; + + public UpdateReverseEtlModelInput() {} + + public UpdateReverseEtlModelInput name(String name) { + + this.name = name; + return this; + } + + /** + * A short, human-readable description of the Model. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A short, human-readable description of the Model.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateReverseEtlModelInput description(String description) { + + this.description = description; + return this; + } + + /** + * A longer, more descriptive explanation of the Model. + * + * @return description + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A longer, more descriptive explanation of the Model.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public UpdateReverseEtlModelInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the Model should have syncs enabled. When disabled, no syncs will be + * triggered, regardless of the enabled status of the attached destinations/subscriptions. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Indicates whether the Model should have syncs enabled. When disabled, no syncs" + + " will be triggered, regardless of the enabled status of the attached" + + " destinations/subscriptions.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateReverseEtlModelInput scheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { + + this.scheduleStrategy = scheduleStrategy; + return this; + } + + /** + * Determines the strategy used for triggering syncs, which will be used in conjunction with + * scheduleConfig. + * + * @return scheduleStrategy + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Determines the strategy used for triggering syncs, which will be used in" + + " conjunction with scheduleConfig.") + public ScheduleStrategyEnum getScheduleStrategy() { + return scheduleStrategy; + } + + public void setScheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { + this.scheduleStrategy = scheduleStrategy; + } + + public UpdateReverseEtlModelInput scheduleConfig(Map scheduleConfig) { + + this.scheduleConfig = scheduleConfig; + return this; + } + + /** + * Depending on the chosen strategy, configures the schedule for this model. + * + * @return scheduleConfig + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Depending on the chosen strategy, configures the schedule for this model.") + public Map getScheduleConfig() { + return scheduleConfig; + } + + public void setScheduleConfig(Map scheduleConfig) { + this.scheduleConfig = scheduleConfig; + } + + public UpdateReverseEtlModelInput query(String query) { + + this.query = query; + return this; + } + + /** + * The SQL query that will be executed to extract data from the connected Source. + * + * @return query + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The SQL query that will be executed to extract data from the connected" + + " Source.") + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public UpdateReverseEtlModelInput queryIdentifierColumn(String queryIdentifierColumn) { + + this.queryIdentifierColumn = queryIdentifierColumn; + return this; + } + + /** + * Indicates the column named in `query` that should be used to uniquely identify the + * extracted records. + * + * @return queryIdentifierColumn + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Indicates the column named in `query` that should be used to uniquely identify" + + " the extracted records.") + public String getQueryIdentifierColumn() { + return queryIdentifierColumn; + } + + public void setQueryIdentifierColumn(String queryIdentifierColumn) { + this.queryIdentifierColumn = queryIdentifierColumn; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateReverseEtlModelInput updateReverseEtlModelInput = (UpdateReverseEtlModelInput) o; + return Objects.equals(this.name, updateReverseEtlModelInput.name) + && Objects.equals(this.description, updateReverseEtlModelInput.description) + && Objects.equals(this.enabled, updateReverseEtlModelInput.enabled) + && Objects.equals( + this.scheduleStrategy, updateReverseEtlModelInput.scheduleStrategy) + && Objects.equals(this.scheduleConfig, updateReverseEtlModelInput.scheduleConfig) + && Objects.equals(this.query, updateReverseEtlModelInput.query) + && Objects.equals( + this.queryIdentifierColumn, + updateReverseEtlModelInput.queryIdentifierColumn); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + name, + description, + enabled, + scheduleStrategy, + scheduleConfig, + query, + queryIdentifierColumn); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateReverseEtlModelInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); + sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" queryIdentifierColumn: ") + .append(toIndentedString(queryIdentifierColumn)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("enabled"); + openapiFields.add("scheduleStrategy"); + openapiFields.add("scheduleConfig"); + openapiFields.add("query"); + openapiFields.add("queryIdentifierColumn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateReverseEtlModelInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateReverseEtlModelInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateReverseEtlModelInput is not" + + " found in the empty JSON string", + UpdateReverseEtlModelInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateReverseEtlModelInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateReverseEtlModelInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("scheduleStrategy") != null + && !jsonObj.get("scheduleStrategy").isJsonNull()) + && !jsonObj.get("scheduleStrategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `scheduleStrategy` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("scheduleStrategy").toString())); + } + if ((jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) + && !jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if ((jsonObj.get("queryIdentifierColumn") != null + && !jsonObj.get("queryIdentifierColumn").isJsonNull()) + && !jsonObj.get("queryIdentifierColumn").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `queryIdentifierColumn` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("queryIdentifierColumn").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateReverseEtlModelInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateReverseEtlModelInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateReverseEtlModelInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateReverseEtlModelInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateReverseEtlModelInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateReverseEtlModelInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateReverseEtlModelInput + * @throws IOException if the JSON string is invalid with respect to UpdateReverseEtlModelInput + */ + public static UpdateReverseEtlModelInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateReverseEtlModelInput.class); + } + + /** + * Convert an instance of UpdateReverseEtlModelInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelOutput.java new file mode 100644 index 00000000..f5a924db --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelOutput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines the results of updating a Model. */ +@ApiModel(description = "Defines the results of updating a Model.") +public class UpdateReverseEtlModelOutput { + public static final String SERIALIZED_NAME_REVERSE_ETL_MODEL = "reverseEtlModel"; + + @SerializedName(SERIALIZED_NAME_REVERSE_ETL_MODEL) + private ReverseEtlModel reverseEtlModel; + + public UpdateReverseEtlModelOutput() {} + + public UpdateReverseEtlModelOutput reverseEtlModel(ReverseEtlModel reverseEtlModel) { + + this.reverseEtlModel = reverseEtlModel; + return this; + } + + /** + * Get reverseEtlModel + * + * @return reverseEtlModel + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ReverseEtlModel getReverseEtlModel() { + return reverseEtlModel; + } + + public void setReverseEtlModel(ReverseEtlModel reverseEtlModel) { + this.reverseEtlModel = reverseEtlModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateReverseEtlModelOutput updateReverseEtlModelOutput = (UpdateReverseEtlModelOutput) o; + return Objects.equals(this.reverseEtlModel, updateReverseEtlModelOutput.reverseEtlModel); + } + + @Override + public int hashCode() { + return Objects.hash(reverseEtlModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateReverseEtlModelOutput {\n"); + sb.append(" reverseEtlModel: ").append(toIndentedString(reverseEtlModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reverseEtlModel"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("reverseEtlModel"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateReverseEtlModelOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateReverseEtlModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateReverseEtlModelOutput is not" + + " found in the empty JSON string", + UpdateReverseEtlModelOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateReverseEtlModelOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateReverseEtlModelOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateReverseEtlModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateReverseEtlModelOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateReverseEtlModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateReverseEtlModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateReverseEtlModelOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateReverseEtlModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateReverseEtlModelOutput + * @throws IOException if the JSON string is invalid with respect to UpdateReverseEtlModelOutput + */ + public static UpdateReverseEtlModelOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateReverseEtlModelOutput.class); + } + + /** + * Convert an instance of UpdateReverseEtlModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 8ab798926ee83ac1776145f6420b13039b0a23be Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 20 Feb 2023 09:13:20 +0000 Subject: [PATCH 052/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@450d551. From 072b237f7c6bcbf8d4c9e075036c71f2f32569e0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 22 Feb 2023 05:26:58 +0000 Subject: [PATCH 053/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@efd92c8. From 15d042f69fc075bdf987bda91614818ba3464b04 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 22 Feb 2023 05:50:00 +0000 Subject: [PATCH 054/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@efd92c8. From d36c2d76fcf31d9df6e1214f48e1d4227e24d364 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 22 Feb 2023 05:53:48 +0000 Subject: [PATCH 055/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c539e0c. From 7e88d914d7a7b8a927239d88297c3f4d55ac3654 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 22 Feb 2023 07:15:57 +0000 Subject: [PATCH 056/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3800349. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 2 + .../models/CreateTransformationV1Input.java | 66 ++++- .../models/FQLDefinedPropertyV1.java | 246 ++++++++++++++++++ .../publicapi/models/Transformation3.java | 63 ++++- .../publicapi/models/Transformation4.java | 63 ++++- .../publicapi/models/Transformation5.java | 63 ++++- .../publicapi/models/TransformationV1.java | 63 ++++- .../models/UpdateTransformationV1Input.java | 66 ++++- 11 files changed, 626 insertions(+), 18 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java diff --git a/README.md b/README.md index 875458e0..733ef235 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.1.0 +Latest API and SDK version: 34.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.1.0 + 34.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.1.0" + implementation "com.segment.publicapi:segment-publicapi:34.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.1.0.jar` +* `target/segment-publicapi-34.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 3fbdeff7..a1fba8ab 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.1.0 + 34.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index fdd41965..a8f82863 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.1.0 (Java)"); + setUserAgent("Public API SDK 34.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 465cdf1e..c8273c14 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -505,6 +505,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index 9cd2178c..609e126d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -77,6 +77,11 @@ public class CreateTransformationV1Input { @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) private List propertyValueTransformations = null; + public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; + + @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) + private List fqlDefinedProperties = null; + public CreateTransformationV1Input() {} public CreateTransformationV1Input name(String name) { @@ -289,6 +294,40 @@ public void setPropertyValueTransformations( this.propertyValueTransformations = propertyValueTransformations; } + public CreateTransformationV1Input fqlDefinedProperties( + List fqlDefinedProperties) { + + this.fqlDefinedProperties = fqlDefinedProperties; + return this; + } + + public CreateTransformationV1Input addFqlDefinedPropertiesItem( + FQLDefinedPropertyV1 fqlDefinedPropertiesItem) { + if (this.fqlDefinedProperties == null) { + this.fqlDefinedProperties = new ArrayList<>(); + } + this.fqlDefinedProperties.add(fqlDefinedPropertiesItem); + return this; + } + + /** + * Optional array for defining new properties in FQL. Currently limited to 1 property. + * + * @return fqlDefinedProperties + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for defining new properties in FQL. Currently limited to 1" + + " property.") + public List getFqlDefinedProperties() { + return fqlDefinedProperties; + } + + public void setFqlDefinedProperties(List fqlDefinedProperties) { + this.fqlDefinedProperties = fqlDefinedProperties; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -309,7 +348,10 @@ public boolean equals(Object o) { && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) && Objects.equals( this.propertyValueTransformations, - createTransformationV1Input.propertyValueTransformations); + createTransformationV1Input.propertyValueTransformations) + && Objects.equals( + this.fqlDefinedProperties, + createTransformationV1Input.fqlDefinedProperties); } @Override @@ -322,7 +364,8 @@ public int hashCode() { _if, newEventName, propertyRenames, - propertyValueTransformations); + propertyValueTransformations, + fqlDefinedProperties); } @Override @@ -341,6 +384,9 @@ public String toString() { sb.append(" propertyValueTransformations: ") .append(toIndentedString(propertyValueTransformations)) .append("\n"); + sb.append(" fqlDefinedProperties: ") + .append(toIndentedString(fqlDefinedProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -370,6 +416,7 @@ private String toIndentedString(Object o) { openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); + openapiFields.add("fqlDefinedProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -485,6 +532,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("fqlDefinedProperties") != null + && !jsonObj.get("fqlDefinedProperties").isJsonNull()) { + JsonArray jsonArrayfqlDefinedProperties = + jsonObj.getAsJsonArray("fqlDefinedProperties"); + if (jsonArrayfqlDefinedProperties != null) { + // ensure the json data is an array + if (!jsonObj.get("fqlDefinedProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fqlDefinedProperties` to be an array in" + + " the JSON string but got `%s`", + jsonObj.get("fqlDefinedProperties").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java b/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java new file mode 100644 index 00000000..8cca0cab --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java @@ -0,0 +1,246 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** FQLDefinedPropertyV1 */ +public class FQLDefinedPropertyV1 { + public static final String SERIALIZED_NAME_FQL = "fql"; + + @SerializedName(SERIALIZED_NAME_FQL) + private String fql; + + public static final String SERIALIZED_NAME_PROPERTY_NAME = "propertyName"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_NAME) + private String propertyName; + + public FQLDefinedPropertyV1() {} + + public FQLDefinedPropertyV1 fql(String fql) { + + this.fql = fql; + return this; + } + + /** + * The FQL expression used to compute the property. + * + * @return fql + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The FQL expression used to compute the property.") + public String getFql() { + return fql; + } + + public void setFql(String fql) { + this.fql = fql; + } + + public FQLDefinedPropertyV1 propertyName(String propertyName) { + + this.propertyName = propertyName; + return this; + } + + /** + * The new property name. + * + * @return propertyName + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The new property name.") + public String getPropertyName() { + return propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FQLDefinedPropertyV1 fqLDefinedPropertyV1 = (FQLDefinedPropertyV1) o; + return Objects.equals(this.fql, fqLDefinedPropertyV1.fql) + && Objects.equals(this.propertyName, fqLDefinedPropertyV1.propertyName); + } + + @Override + public int hashCode() { + return Objects.hash(fql, propertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FQLDefinedPropertyV1 {\n"); + sb.append(" fql: ").append(toIndentedString(fql)).append("\n"); + sb.append(" propertyName: ").append(toIndentedString(propertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fql"); + openapiFields.add("propertyName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fql"); + openapiRequiredFields.add("propertyName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FQLDefinedPropertyV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FQLDefinedPropertyV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FQLDefinedPropertyV1 is not found in" + + " the empty JSON string", + FQLDefinedPropertyV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FQLDefinedPropertyV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FQLDefinedPropertyV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FQLDefinedPropertyV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("fql").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fql` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("fql").toString())); + } + if (!jsonObj.get("propertyName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("propertyName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FQLDefinedPropertyV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FQLDefinedPropertyV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FQLDefinedPropertyV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FQLDefinedPropertyV1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FQLDefinedPropertyV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FQLDefinedPropertyV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of FQLDefinedPropertyV1 + * @throws IOException if the JSON string is invalid with respect to FQLDefinedPropertyV1 + */ + public static FQLDefinedPropertyV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FQLDefinedPropertyV1.class); + } + + /** + * Convert an instance of FQLDefinedPropertyV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transformation3.java b/src/main/java/com/segment/publicapi/models/Transformation3.java index d96809eb..e7f3f76d 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation3.java +++ b/src/main/java/com/segment/publicapi/models/Transformation3.java @@ -82,6 +82,11 @@ public class Transformation3 { @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) private List propertyValueTransformations = null; + public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; + + @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) + private List fqlDefinedProperties = null; + public Transformation3() {} public Transformation3 id(String id) { @@ -310,6 +315,39 @@ public void setPropertyValueTransformations( this.propertyValueTransformations = propertyValueTransformations; } + public Transformation3 fqlDefinedProperties(List fqlDefinedProperties) { + + this.fqlDefinedProperties = fqlDefinedProperties; + return this; + } + + public Transformation3 addFqlDefinedPropertiesItem( + FQLDefinedPropertyV1 fqlDefinedPropertiesItem) { + if (this.fqlDefinedProperties == null) { + this.fqlDefinedProperties = new ArrayList<>(); + } + this.fqlDefinedProperties.add(fqlDefinedPropertiesItem); + return this; + } + + /** + * Optional array for defining new properties in FQL. Limited to 1 property right now. + * + * @return fqlDefinedProperties + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for defining new properties in FQL. Limited to 1 property right" + + " now.") + public List getFqlDefinedProperties() { + return fqlDefinedProperties; + } + + public void setFqlDefinedProperties(List fqlDefinedProperties) { + this.fqlDefinedProperties = fqlDefinedProperties; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -329,7 +367,8 @@ public boolean equals(Object o) { && Objects.equals(this.propertyRenames, transformation3.propertyRenames) && Objects.equals( this.propertyValueTransformations, - transformation3.propertyValueTransformations); + transformation3.propertyValueTransformations) + && Objects.equals(this.fqlDefinedProperties, transformation3.fqlDefinedProperties); } @Override @@ -343,7 +382,8 @@ public int hashCode() { _if, newEventName, propertyRenames, - propertyValueTransformations); + propertyValueTransformations, + fqlDefinedProperties); } @Override @@ -363,6 +403,9 @@ public String toString() { sb.append(" propertyValueTransformations: ") .append(toIndentedString(propertyValueTransformations)) .append("\n"); + sb.append(" fqlDefinedProperties: ") + .append(toIndentedString(fqlDefinedProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -393,6 +436,7 @@ private String toIndentedString(Object o) { openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); + openapiFields.add("fqlDefinedProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -516,6 +560,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("fqlDefinedProperties") != null + && !jsonObj.get("fqlDefinedProperties").isJsonNull()) { + JsonArray jsonArrayfqlDefinedProperties = + jsonObj.getAsJsonArray("fqlDefinedProperties"); + if (jsonArrayfqlDefinedProperties != null) { + // ensure the json data is an array + if (!jsonObj.get("fqlDefinedProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fqlDefinedProperties` to be an array in" + + " the JSON string but got `%s`", + jsonObj.get("fqlDefinedProperties").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation4.java b/src/main/java/com/segment/publicapi/models/Transformation4.java index ec91dbe6..a6b93c2f 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation4.java +++ b/src/main/java/com/segment/publicapi/models/Transformation4.java @@ -82,6 +82,11 @@ public class Transformation4 { @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) private List propertyValueTransformations = null; + public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; + + @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) + private List fqlDefinedProperties = null; + public Transformation4() {} public Transformation4 id(String id) { @@ -310,6 +315,39 @@ public void setPropertyValueTransformations( this.propertyValueTransformations = propertyValueTransformations; } + public Transformation4 fqlDefinedProperties(List fqlDefinedProperties) { + + this.fqlDefinedProperties = fqlDefinedProperties; + return this; + } + + public Transformation4 addFqlDefinedPropertiesItem( + FQLDefinedPropertyV1 fqlDefinedPropertiesItem) { + if (this.fqlDefinedProperties == null) { + this.fqlDefinedProperties = new ArrayList<>(); + } + this.fqlDefinedProperties.add(fqlDefinedPropertiesItem); + return this; + } + + /** + * Optional array for defining new properties in FQL. Limited to 1 property right now. + * + * @return fqlDefinedProperties + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for defining new properties in FQL. Limited to 1 property right" + + " now.") + public List getFqlDefinedProperties() { + return fqlDefinedProperties; + } + + public void setFqlDefinedProperties(List fqlDefinedProperties) { + this.fqlDefinedProperties = fqlDefinedProperties; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -329,7 +367,8 @@ public boolean equals(Object o) { && Objects.equals(this.propertyRenames, transformation4.propertyRenames) && Objects.equals( this.propertyValueTransformations, - transformation4.propertyValueTransformations); + transformation4.propertyValueTransformations) + && Objects.equals(this.fqlDefinedProperties, transformation4.fqlDefinedProperties); } @Override @@ -343,7 +382,8 @@ public int hashCode() { _if, newEventName, propertyRenames, - propertyValueTransformations); + propertyValueTransformations, + fqlDefinedProperties); } @Override @@ -363,6 +403,9 @@ public String toString() { sb.append(" propertyValueTransformations: ") .append(toIndentedString(propertyValueTransformations)) .append("\n"); + sb.append(" fqlDefinedProperties: ") + .append(toIndentedString(fqlDefinedProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -393,6 +436,7 @@ private String toIndentedString(Object o) { openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); + openapiFields.add("fqlDefinedProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -516,6 +560,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("fqlDefinedProperties") != null + && !jsonObj.get("fqlDefinedProperties").isJsonNull()) { + JsonArray jsonArrayfqlDefinedProperties = + jsonObj.getAsJsonArray("fqlDefinedProperties"); + if (jsonArrayfqlDefinedProperties != null) { + // ensure the json data is an array + if (!jsonObj.get("fqlDefinedProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fqlDefinedProperties` to be an array in" + + " the JSON string but got `%s`", + jsonObj.get("fqlDefinedProperties").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Transformation5.java b/src/main/java/com/segment/publicapi/models/Transformation5.java index adac93ee..40558134 100644 --- a/src/main/java/com/segment/publicapi/models/Transformation5.java +++ b/src/main/java/com/segment/publicapi/models/Transformation5.java @@ -82,6 +82,11 @@ public class Transformation5 { @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) private List propertyValueTransformations = null; + public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; + + @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) + private List fqlDefinedProperties = null; + public Transformation5() {} public Transformation5 id(String id) { @@ -310,6 +315,39 @@ public void setPropertyValueTransformations( this.propertyValueTransformations = propertyValueTransformations; } + public Transformation5 fqlDefinedProperties(List fqlDefinedProperties) { + + this.fqlDefinedProperties = fqlDefinedProperties; + return this; + } + + public Transformation5 addFqlDefinedPropertiesItem( + FQLDefinedPropertyV1 fqlDefinedPropertiesItem) { + if (this.fqlDefinedProperties == null) { + this.fqlDefinedProperties = new ArrayList<>(); + } + this.fqlDefinedProperties.add(fqlDefinedPropertiesItem); + return this; + } + + /** + * Optional array for defining new properties in FQL. Limited to 1 property right now. + * + * @return fqlDefinedProperties + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for defining new properties in FQL. Limited to 1 property right" + + " now.") + public List getFqlDefinedProperties() { + return fqlDefinedProperties; + } + + public void setFqlDefinedProperties(List fqlDefinedProperties) { + this.fqlDefinedProperties = fqlDefinedProperties; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -329,7 +367,8 @@ public boolean equals(Object o) { && Objects.equals(this.propertyRenames, transformation5.propertyRenames) && Objects.equals( this.propertyValueTransformations, - transformation5.propertyValueTransformations); + transformation5.propertyValueTransformations) + && Objects.equals(this.fqlDefinedProperties, transformation5.fqlDefinedProperties); } @Override @@ -343,7 +382,8 @@ public int hashCode() { _if, newEventName, propertyRenames, - propertyValueTransformations); + propertyValueTransformations, + fqlDefinedProperties); } @Override @@ -363,6 +403,9 @@ public String toString() { sb.append(" propertyValueTransformations: ") .append(toIndentedString(propertyValueTransformations)) .append("\n"); + sb.append(" fqlDefinedProperties: ") + .append(toIndentedString(fqlDefinedProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -393,6 +436,7 @@ private String toIndentedString(Object o) { openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); + openapiFields.add("fqlDefinedProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -516,6 +560,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("fqlDefinedProperties") != null + && !jsonObj.get("fqlDefinedProperties").isJsonNull()) { + JsonArray jsonArrayfqlDefinedProperties = + jsonObj.getAsJsonArray("fqlDefinedProperties"); + if (jsonArrayfqlDefinedProperties != null) { + // ensure the json data is an array + if (!jsonObj.get("fqlDefinedProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fqlDefinedProperties` to be an array in" + + " the JSON string but got `%s`", + jsonObj.get("fqlDefinedProperties").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java index abe887da..a268f27a 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -82,6 +82,11 @@ public class TransformationV1 { @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) private List propertyValueTransformations = null; + public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; + + @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) + private List fqlDefinedProperties = null; + public TransformationV1() {} public TransformationV1 id(String id) { @@ -310,6 +315,39 @@ public void setPropertyValueTransformations( this.propertyValueTransformations = propertyValueTransformations; } + public TransformationV1 fqlDefinedProperties(List fqlDefinedProperties) { + + this.fqlDefinedProperties = fqlDefinedProperties; + return this; + } + + public TransformationV1 addFqlDefinedPropertiesItem( + FQLDefinedPropertyV1 fqlDefinedPropertiesItem) { + if (this.fqlDefinedProperties == null) { + this.fqlDefinedProperties = new ArrayList<>(); + } + this.fqlDefinedProperties.add(fqlDefinedPropertiesItem); + return this; + } + + /** + * Optional array for defining new properties in FQL. Limited to 1 property right now. + * + * @return fqlDefinedProperties + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for defining new properties in FQL. Limited to 1 property right" + + " now.") + public List getFqlDefinedProperties() { + return fqlDefinedProperties; + } + + public void setFqlDefinedProperties(List fqlDefinedProperties) { + this.fqlDefinedProperties = fqlDefinedProperties; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -330,7 +368,8 @@ public boolean equals(Object o) { && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) && Objects.equals( this.propertyValueTransformations, - transformationV1.propertyValueTransformations); + transformationV1.propertyValueTransformations) + && Objects.equals(this.fqlDefinedProperties, transformationV1.fqlDefinedProperties); } @Override @@ -344,7 +383,8 @@ public int hashCode() { _if, newEventName, propertyRenames, - propertyValueTransformations); + propertyValueTransformations, + fqlDefinedProperties); } @Override @@ -364,6 +404,9 @@ public String toString() { sb.append(" propertyValueTransformations: ") .append(toIndentedString(propertyValueTransformations)) .append("\n"); + sb.append(" fqlDefinedProperties: ") + .append(toIndentedString(fqlDefinedProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -394,6 +437,7 @@ private String toIndentedString(Object o) { openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); + openapiFields.add("fqlDefinedProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -517,6 +561,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("fqlDefinedProperties") != null + && !jsonObj.get("fqlDefinedProperties").isJsonNull()) { + JsonArray jsonArrayfqlDefinedProperties = + jsonObj.getAsJsonArray("fqlDefinedProperties"); + if (jsonArrayfqlDefinedProperties != null) { + // ensure the json data is an array + if (!jsonObj.get("fqlDefinedProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fqlDefinedProperties` to be an array in" + + " the JSON string but got `%s`", + jsonObj.get("fqlDefinedProperties").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java index 716d22b5..14ca0cb1 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -77,6 +77,11 @@ public class UpdateTransformationV1Input { @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) private List propertyValueTransformations = null; + public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; + + @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) + private List fqlDefinedProperties = null; + public UpdateTransformationV1Input() {} public UpdateTransformationV1Input name(String name) { @@ -284,6 +289,40 @@ public void setPropertyValueTransformations( this.propertyValueTransformations = propertyValueTransformations; } + public UpdateTransformationV1Input fqlDefinedProperties( + List fqlDefinedProperties) { + + this.fqlDefinedProperties = fqlDefinedProperties; + return this; + } + + public UpdateTransformationV1Input addFqlDefinedPropertiesItem( + FQLDefinedPropertyV1 fqlDefinedPropertiesItem) { + if (this.fqlDefinedProperties == null) { + this.fqlDefinedProperties = new ArrayList<>(); + } + this.fqlDefinedProperties.add(fqlDefinedPropertiesItem); + return this; + } + + /** + * Optional array for defining new properties in FQL. Currently limited to 1 property. + * + * @return fqlDefinedProperties + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "Optional array for defining new properties in FQL. Currently limited to 1" + + " property.") + public List getFqlDefinedProperties() { + return fqlDefinedProperties; + } + + public void setFqlDefinedProperties(List fqlDefinedProperties) { + this.fqlDefinedProperties = fqlDefinedProperties; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -304,7 +343,10 @@ public boolean equals(Object o) { && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) && Objects.equals( this.propertyValueTransformations, - updateTransformationV1Input.propertyValueTransformations); + updateTransformationV1Input.propertyValueTransformations) + && Objects.equals( + this.fqlDefinedProperties, + updateTransformationV1Input.fqlDefinedProperties); } @Override @@ -317,7 +359,8 @@ public int hashCode() { _if, newEventName, propertyRenames, - propertyValueTransformations); + propertyValueTransformations, + fqlDefinedProperties); } @Override @@ -336,6 +379,9 @@ public String toString() { sb.append(" propertyValueTransformations: ") .append(toIndentedString(propertyValueTransformations)) .append("\n"); + sb.append(" fqlDefinedProperties: ") + .append(toIndentedString(fqlDefinedProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -365,6 +411,7 @@ private String toIndentedString(Object o) { openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); + openapiFields.add("fqlDefinedProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -469,6 +516,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("fqlDefinedProperties") != null + && !jsonObj.get("fqlDefinedProperties").isJsonNull()) { + JsonArray jsonArrayfqlDefinedProperties = + jsonObj.getAsJsonArray("fqlDefinedProperties"); + if (jsonArrayfqlDefinedProperties != null) { + // ensure the json data is an array + if (!jsonObj.get("fqlDefinedProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fqlDefinedProperties` to be an array in" + + " the JSON string but got `%s`", + jsonObj.get("fqlDefinedProperties").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 1ca248525db0c203aa0bf2257171e11120963e9a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 22 Feb 2023 07:25:06 +0000 Subject: [PATCH 057/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@29fff7c. From 1c5d09d1ef9f88b781c4d0fa1092f3f63e857825 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 28 Feb 2023 09:31:39 +0000 Subject: [PATCH 058/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@39fb781. From 14498752c08e36ae069a3d51bda2f991509f5809 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 28 Feb 2023 09:44:27 +0000 Subject: [PATCH 059/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8d2e9fd. From 11b6c53e46b7b60f91054ffca8df124c40d53657 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 28 Feb 2023 09:55:02 +0000 Subject: [PATCH 060/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@88ddd8d. From d3bec16a408e064cfce20638bd8a31d753562a89 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 28 Feb 2023 19:28:12 +0000 Subject: [PATCH 061/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c7c57f4. From 103b49e1595efbb9952c38e6aec6fc83bc5ceb8e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 2 Mar 2023 23:47:59 +0000 Subject: [PATCH 062/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@227c80f. --- .../publicapi/models/CreateTransformationV1Input.java | 8 +++++--- .../publicapi/models/UpdateTransformationV1Input.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index 609e126d..54cac2cf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -311,15 +311,17 @@ public CreateTransformationV1Input addFqlDefinedPropertiesItem( } /** - * Optional array for defining new properties in FQL. Currently limited to 1 property. + * Optional array for defining new properties in + * [FQL](https://segment.com/docs/config-api/fql/). Currently limited to 1 property. * * @return fqlDefinedProperties */ @javax.annotation.Nullable @ApiModelProperty( value = - "Optional array for defining new properties in FQL. Currently limited to 1" - + " property.") + "Optional array for defining new properties in" + + " [FQL](https://segment.com/docs/config-api/fql/). Currently limited to 1" + + " property.") public List getFqlDefinedProperties() { return fqlDefinedProperties; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java index 14ca0cb1..a08deb57 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -306,15 +306,17 @@ public UpdateTransformationV1Input addFqlDefinedPropertiesItem( } /** - * Optional array for defining new properties in FQL. Currently limited to 1 property. + * Optional array for updating properties defined in + * [FQL](https://segment.com/docs/config-api/fql/). Currently limited to 1 property. * * @return fqlDefinedProperties */ @javax.annotation.Nullable @ApiModelProperty( value = - "Optional array for defining new properties in FQL. Currently limited to 1" - + " property.") + "Optional array for updating properties defined in" + + " [FQL](https://segment.com/docs/config-api/fql/). Currently limited to 1" + + " property.") public List getFqlDefinedProperties() { return fqlDefinedProperties; } From 37bec3ee52073d5cbf63735c099762ae79b4479c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 10 Mar 2023 18:13:07 +0000 Subject: [PATCH 063/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2716e16. From 17d4ec59fa21603af8b4a65ecc473ded0378f200 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 14 Mar 2023 14:19:14 +0000 Subject: [PATCH 064/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7214362. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 13 + .../publicapi/api/ProfilesSyncApi.java | 262 +++++++++++ .../CreateProfilesWarehouse200Response.java | 199 +++++++++ .../CreateProfilesWarehouseAlphaInput.java | 368 +++++++++++++++ .../CreateProfilesWarehouseAlphaOutput.java | 216 +++++++++ .../segment/publicapi/models/Metadata1.java | 136 +----- .../segment/publicapi/models/Metadata2.java | 136 +++++- .../publicapi/models/ProfilesWarehouse.java | 420 ++++++++++++++++++ .../models/ProfilesWarehouseAlpha.java | 420 ++++++++++++++++++ .../com/segment/publicapi/models/Source1.java | 8 +- .../com/segment/publicapi/models/Source2.java | 8 +- .../com/segment/publicapi/models/Source3.java | 8 +- .../com/segment/publicapi/models/Source4.java | 8 +- .../com/segment/publicapi/models/Source5.java | 8 +- .../com/segment/publicapi/models/Source6.java | 8 +- .../segment/publicapi/models/SourceAlpha.java | 8 +- .../segment/publicapi/models/SourceV1.java | 8 +- .../segment/publicapi/models/Warehouse.java | 8 +- .../segment/publicapi/models/Warehouse1.java | 8 +- .../segment/publicapi/models/Warehouse2.java | 8 +- .../segment/publicapi/models/WarehouseV1.java | 8 +- 24 files changed, 2088 insertions(+), 190 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java create mode 100644 src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java diff --git a/README.md b/README.md index 733ef235..27d916d9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.2.0 +Latest API and SDK version: 34.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.2.0 + 34.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.2.0" + implementation "com.segment.publicapi:segment-publicapi:34.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.2.0.jar` +* `target/segment-publicapi-34.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index a1fba8ab..a97e8a18 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.2.0 + 34.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index a8f82863..2d22e577 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.2.0 (Java)"); + setUserAgent("Public API SDK 34.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index c8273c14..7fc46111 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -259,6 +259,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateLabelV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateLabelV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateProfilesWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateProfilesWarehouseAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateProfilesWarehouseAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateReverseEtlModel200Response .CustomTypeAdapterFactory()); @@ -996,6 +1005,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilterV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ProfilesWarehouse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ProfilesWarehouseAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java new file mode 100644 index 00000000..2c88a0b6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -0,0 +1,262 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateProfilesWarehouse200Response; +import com.segment.publicapi.models.CreateProfilesWarehouseAlphaInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProfilesSyncApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ProfilesSyncApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProfilesSyncApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createProfilesWarehouse + * + * @param spaceId (required) + * @param createProfilesWarehouseAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createProfilesWarehouseCall( + String spaceId, + CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createProfilesWarehouseAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createProfilesWarehouseValidateBeforeCall( + String spaceId, + CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " createProfilesWarehouse(Async)"); + } + + // verify the required parameter 'createProfilesWarehouseAlphaInput' is set + if (createProfilesWarehouseAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createProfilesWarehouseAlphaInput' when" + + " calling createProfilesWarehouse(Async)"); + } + + okhttp3.Call localVarCall = + createProfilesWarehouseCall(spaceId, createProfilesWarehouseAlphaInput, _callback); + return localVarCall; + } + + /** + * Create Profiles Warehouse Creates a new Profiles Warehouse. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param createProfilesWarehouseAlphaInput (required) + * @return CreateProfilesWarehouse200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateProfilesWarehouse200Response createProfilesWarehouse( + String spaceId, CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createProfilesWarehouseWithHttpInfo(spaceId, createProfilesWarehouseAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Profiles Warehouse Creates a new Profiles Warehouse. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param createProfilesWarehouseAlphaInput (required) + * @return ApiResponse<CreateProfilesWarehouse200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createProfilesWarehouseWithHttpInfo( + String spaceId, CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createProfilesWarehouseValidateBeforeCall( + spaceId, createProfilesWarehouseAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Profiles Warehouse (asynchronously) Creates a new Profiles Warehouse. • When called, + * this endpoint may generate the `Profiles Sync Warehouse Created` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param createProfilesWarehouseAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createProfilesWarehouseAsync( + String spaceId, + CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createProfilesWarehouseValidateBeforeCall( + spaceId, createProfilesWarehouseAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java new file mode 100644 index 00000000..2667dfd6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** CreateProfilesWarehouse200Response */ +public class CreateProfilesWarehouse200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateProfilesWarehouseAlphaOutput data; + + public CreateProfilesWarehouse200Response() {} + + public CreateProfilesWarehouse200Response data(CreateProfilesWarehouseAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateProfilesWarehouseAlphaOutput getData() { + return data; + } + + public void setData(CreateProfilesWarehouseAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProfilesWarehouse200Response createProfilesWarehouse200Response = + (CreateProfilesWarehouse200Response) o; + return Objects.equals(this.data, createProfilesWarehouse200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProfilesWarehouse200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateProfilesWarehouse200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateProfilesWarehouse200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateProfilesWarehouse200Response is" + + " not found in the empty JSON string", + CreateProfilesWarehouse200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateProfilesWarehouse200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateProfilesWarehouse200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateProfilesWarehouse200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateProfilesWarehouse200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateProfilesWarehouse200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateProfilesWarehouse200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateProfilesWarehouse200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateProfilesWarehouse200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateProfilesWarehouse200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateProfilesWarehouse200Response + */ + public static CreateProfilesWarehouse200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateProfilesWarehouse200Response.class); + } + + /** + * Convert an instance of CreateProfilesWarehouse200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java new file mode 100644 index 00000000..d66052e3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java @@ -0,0 +1,368 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Create a new Profiles Warehouse based on a set of parameters. */ +@ApiModel(description = "Create a new Profiles Warehouse based on a set of parameters.") +public class CreateProfilesWarehouseAlphaInput { + public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; + + @SerializedName(SERIALIZED_NAME_METADATA_ID) + private String metadataId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; + + public static final String SERIALIZED_NAME_SCHEMA_NAME = "schemaName"; + + @SerializedName(SERIALIZED_NAME_SCHEMA_NAME) + private String schemaName; + + public CreateProfilesWarehouseAlphaInput() {} + + public CreateProfilesWarehouseAlphaInput metadataId(String metadataId) { + + this.metadataId = metadataId; + return this; + } + + /** + * The Warehouse metadata to use. + * + * @return metadataId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Warehouse metadata to use.") + public String getMetadataId() { + return metadataId; + } + + public void setMetadataId(String metadataId) { + this.metadataId = metadataId; + } + + public CreateProfilesWarehouseAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * An optional human-readable name for this Warehouse. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional human-readable name for this Warehouse.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateProfilesWarehouseAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enable to allow this Warehouse to receive data. Defaults to true. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Enable to allow this Warehouse to receive data. Defaults to true.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateProfilesWarehouseAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + /** + * A key-value object that contains instance-specific settings for a Warehouse. Different kinds + * of Warehouses require different settings. The required and optional settings for a Warehouse + * are described in the `options` object of the associated Warehouse metadata. You can + * find the full list of Warehouse metadata and related settings information in the + * `/catalog/warehouses` endpoint. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = + "A key-value object that contains instance-specific settings for a Warehouse. " + + " Different kinds of Warehouses require different settings. The required" + + " and optional settings for a Warehouse are described in the `options`" + + " object of the associated Warehouse metadata. You can find the full" + + " list of Warehouse metadata and related settings information in the" + + " `/catalog/warehouses` endpoint.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public CreateProfilesWarehouseAlphaInput schemaName(String schemaName) { + + this.schemaName = schemaName; + return this; + } + + /** + * The custom schema name that is going to be use on the Warehouse side, space slug value is + * default otherwise. + * + * @return schemaName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The custom schema name that is going to be use on the Warehouse side, space" + + " slug value is default otherwise.") + public String getSchemaName() { + return schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput = + (CreateProfilesWarehouseAlphaInput) o; + return Objects.equals(this.metadataId, createProfilesWarehouseAlphaInput.metadataId) + && Objects.equals(this.name, createProfilesWarehouseAlphaInput.name) + && Objects.equals(this.enabled, createProfilesWarehouseAlphaInput.enabled) + && Objects.equals(this.settings, createProfilesWarehouseAlphaInput.settings) + && Objects.equals(this.schemaName, createProfilesWarehouseAlphaInput.schemaName); + } + + @Override + public int hashCode() { + return Objects.hash(metadataId, name, enabled, settings, schemaName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProfilesWarehouseAlphaInput {\n"); + sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" schemaName: ").append(toIndentedString(schemaName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("metadataId"); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + openapiFields.add("schemaName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("metadataId"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateProfilesWarehouseAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateProfilesWarehouseAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateProfilesWarehouseAlphaInput is" + + " not found in the empty JSON string", + CreateProfilesWarehouseAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateProfilesWarehouseAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateProfilesWarehouseAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateProfilesWarehouseAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("metadataId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `metadataId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("metadataId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("schemaName") != null && !jsonObj.get("schemaName").isJsonNull()) + && !jsonObj.get("schemaName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schemaName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("schemaName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateProfilesWarehouseAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateProfilesWarehouseAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateProfilesWarehouseAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateProfilesWarehouseAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateProfilesWarehouseAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateProfilesWarehouseAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateProfilesWarehouseAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateProfilesWarehouseAlphaInput + */ + public static CreateProfilesWarehouseAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateProfilesWarehouseAlphaInput.class); + } + + /** + * Convert an instance of CreateProfilesWarehouseAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java new file mode 100644 index 00000000..091c8b74 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java @@ -0,0 +1,216 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns the newly created Warehouse. */ +@ApiModel(description = "Returns the newly created Warehouse.") +public class CreateProfilesWarehouseAlphaOutput { + public static final String SERIALIZED_NAME_PROFILES_WAREHOUSE = "profilesWarehouse"; + + @SerializedName(SERIALIZED_NAME_PROFILES_WAREHOUSE) + private ProfilesWarehouse profilesWarehouse; + + public CreateProfilesWarehouseAlphaOutput() {} + + public CreateProfilesWarehouseAlphaOutput profilesWarehouse( + ProfilesWarehouse profilesWarehouse) { + + this.profilesWarehouse = profilesWarehouse; + return this; + } + + /** + * Get profilesWarehouse + * + * @return profilesWarehouse + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ProfilesWarehouse getProfilesWarehouse() { + return profilesWarehouse; + } + + public void setProfilesWarehouse(ProfilesWarehouse profilesWarehouse) { + this.profilesWarehouse = profilesWarehouse; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateProfilesWarehouseAlphaOutput createProfilesWarehouseAlphaOutput = + (CreateProfilesWarehouseAlphaOutput) o; + return Objects.equals( + this.profilesWarehouse, createProfilesWarehouseAlphaOutput.profilesWarehouse); + } + + @Override + public int hashCode() { + return Objects.hash(profilesWarehouse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateProfilesWarehouseAlphaOutput {\n"); + sb.append(" profilesWarehouse: ") + .append(toIndentedString(profilesWarehouse)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("profilesWarehouse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("profilesWarehouse"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateProfilesWarehouseAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateProfilesWarehouseAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateProfilesWarehouseAlphaOutput is" + + " not found in the empty JSON string", + CreateProfilesWarehouseAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateProfilesWarehouseAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateProfilesWarehouseAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateProfilesWarehouseAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateProfilesWarehouseAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateProfilesWarehouseAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateProfilesWarehouseAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateProfilesWarehouseAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateProfilesWarehouseAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateProfilesWarehouseAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateProfilesWarehouseAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateProfilesWarehouseAlphaOutput + */ + public static CreateProfilesWarehouseAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateProfilesWarehouseAlphaOutput.class); + } + + /** + * Convert an instance of CreateProfilesWarehouseAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Metadata1.java b/src/main/java/com/segment/publicapi/models/Metadata1.java index 8a845b8c..177ae637 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata1.java +++ b/src/main/java/com/segment/publicapi/models/Metadata1.java @@ -33,14 +33,8 @@ import java.util.Objects; import java.util.Set; -/** - * The metadata for the Source. Config API note: includes `catalogName` and - * `catalogId`. - */ -@ApiModel( - description = - "The metadata for the Source. Config API note: includes `catalogName` and" - + " `catalogId`.") +/** The metadata for the Warehouse. */ +@ApiModel(description = "The metadata for the Warehouse.") public class Metadata1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -65,23 +59,13 @@ public class Metadata1 { public static final String SERIALIZED_NAME_LOGOS = "logos"; @SerializedName(SERIALIZED_NAME_LOGOS) - private Logos1 logos; + private Logos2 logos; public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) private List options = new ArrayList<>(); - public static final String SERIALIZED_NAME_CATEGORIES = "categories"; - - @SerializedName(SERIALIZED_NAME_CATEGORIES) - private List categories = new ArrayList<>(); - - public static final String SERIALIZED_NAME_IS_CLOUD_EVENT_SOURCE = "isCloudEventSource"; - - @SerializedName(SERIALIZED_NAME_IS_CLOUD_EVENT_SOURCE) - private Boolean isCloudEventSource; - public Metadata1() {} public Metadata1 id(String id) { @@ -91,17 +75,12 @@ public Metadata1 id(String id) { } /** - * The id for this Source metadata in the Segment catalog. Config API note: analogous to - * `name`. + * The id of this object. * * @return id */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id for this Source metadata in the Segment catalog. Config API note:" - + " analogous to `name`.") + @ApiModelProperty(required = true, value = "The id of this object.") public String getId() { return id; } @@ -117,16 +96,12 @@ public Metadata1 name(String name) { } /** - * The user-friendly name of this Source. Config API note: equal to `displayName`. + * The name of this object. * * @return name */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The user-friendly name of this Source. Config API note: equal to" - + " `displayName`.") + @ApiModelProperty(required = true, value = "The name of this object.") public String getName() { return name; } @@ -142,17 +117,12 @@ public Metadata1 slug(String slug) { } /** - * The slug that identifies this Source in the Segment app. Config API note: equal to - * `name`. + * A human-readable, unique identifier for object. * * @return slug */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The slug that identifies this Source in the Segment app. Config API note:" - + " equal to `name`.") + @ApiModelProperty(required = true, value = "A human-readable, unique identifier for object.") public String getSlug() { return slug; } @@ -168,12 +138,12 @@ public Metadata1 description(String description) { } /** - * The description of this Source. + * A description, in English, of this object. * * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The description of this Source.") + @ApiModelProperty(required = true, value = "A description, in English, of this object.") public String getDescription() { return description; } @@ -182,7 +152,7 @@ public void setDescription(String description) { this.description = description; } - public Metadata1 logos(Logos1 logos) { + public Metadata1 logos(Logos2 logos) { this.logos = logos; return this; @@ -195,11 +165,11 @@ public Metadata1 logos(Logos1 logos) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Logos1 getLogos() { + public Logos2 getLogos() { return logos; } - public void setLogos(Logos1 logos) { + public void setLogos(Logos2 logos) { this.logos = logos; } @@ -215,12 +185,12 @@ public Metadata1 addOptionsItem(IntegrationOptionBeta optionsItem) { } /** - * Options for this Source. + * The Integration options for this object. * * @return options */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Options for this Source.") + @ApiModelProperty(required = true, value = "The Integration options for this object.") public List getOptions() { return options; } @@ -229,53 +199,6 @@ public void setOptions(List options) { this.options = options; } - public Metadata1 categories(List categories) { - - this.categories = categories; - return this; - } - - public Metadata1 addCategoriesItem(String categoriesItem) { - this.categories.add(categoriesItem); - return this; - } - - /** - * A list of categories this Source belongs to. - * - * @return categories - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of categories this Source belongs to.") - public List getCategories() { - return categories; - } - - public void setCategories(List categories) { - this.categories = categories; - } - - public Metadata1 isCloudEventSource(Boolean isCloudEventSource) { - - this.isCloudEventSource = isCloudEventSource; - return this; - } - - /** - * True if this is a Cloud Event Source. - * - * @return isCloudEventSource - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "True if this is a Cloud Event Source.") - public Boolean getIsCloudEventSource() { - return isCloudEventSource; - } - - public void setIsCloudEventSource(Boolean isCloudEventSource) { - this.isCloudEventSource = isCloudEventSource; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -290,15 +213,12 @@ public boolean equals(Object o) { && Objects.equals(this.slug, metadata1.slug) && Objects.equals(this.description, metadata1.description) && Objects.equals(this.logos, metadata1.logos) - && Objects.equals(this.options, metadata1.options) - && Objects.equals(this.categories, metadata1.categories) - && Objects.equals(this.isCloudEventSource, metadata1.isCloudEventSource); + && Objects.equals(this.options, metadata1.options); } @Override public int hashCode() { - return Objects.hash( - id, name, slug, description, logos, options, categories, isCloudEventSource); + return Objects.hash(id, name, slug, description, logos, options); } @Override @@ -311,10 +231,6 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); - sb.append(" isCloudEventSource: ") - .append(toIndentedString(isCloudEventSource)) - .append("\n"); sb.append("}"); return sb.toString(); } @@ -342,8 +258,6 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("logos"); openapiFields.add("options"); - openapiFields.add("categories"); - openapiFields.add("isCloudEventSource"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -353,8 +267,6 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("description"); openapiRequiredFields.add("logos"); openapiRequiredFields.add("options"); - openapiRequiredFields.add("categories"); - openapiRequiredFields.add("isCloudEventSource"); } /** @@ -434,18 +346,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); - // ensure the required json array is present - if (jsonObj.get("categories") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("categories").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `categories` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("categories").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Metadata2.java b/src/main/java/com/segment/publicapi/models/Metadata2.java index 50dae21a..e8582b8c 100644 --- a/src/main/java/com/segment/publicapi/models/Metadata2.java +++ b/src/main/java/com/segment/publicapi/models/Metadata2.java @@ -33,8 +33,14 @@ import java.util.Objects; import java.util.Set; -/** The metadata for the Warehouse. */ -@ApiModel(description = "The metadata for the Warehouse.") +/** + * The metadata for the Source. Config API note: includes `catalogName` and + * `catalogId`. + */ +@ApiModel( + description = + "The metadata for the Source. Config API note: includes `catalogName` and" + + " `catalogId`.") public class Metadata2 { public static final String SERIALIZED_NAME_ID = "id"; @@ -59,13 +65,23 @@ public class Metadata2 { public static final String SERIALIZED_NAME_LOGOS = "logos"; @SerializedName(SERIALIZED_NAME_LOGOS) - private Logos2 logos; + private Logos1 logos; public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) private List options = new ArrayList<>(); + public static final String SERIALIZED_NAME_CATEGORIES = "categories"; + + @SerializedName(SERIALIZED_NAME_CATEGORIES) + private List categories = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_CLOUD_EVENT_SOURCE = "isCloudEventSource"; + + @SerializedName(SERIALIZED_NAME_IS_CLOUD_EVENT_SOURCE) + private Boolean isCloudEventSource; + public Metadata2() {} public Metadata2 id(String id) { @@ -75,12 +91,17 @@ public Metadata2 id(String id) { } /** - * The id of this object. + * The id for this Source metadata in the Segment catalog. Config API note: analogous to + * `name`. * * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of this object.") + @ApiModelProperty( + required = true, + value = + "The id for this Source metadata in the Segment catalog. Config API note:" + + " analogous to `name`.") public String getId() { return id; } @@ -96,12 +117,16 @@ public Metadata2 name(String name) { } /** - * The name of this object. + * The user-friendly name of this Source. Config API note: equal to `displayName`. * * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this object.") + @ApiModelProperty( + required = true, + value = + "The user-friendly name of this Source. Config API note: equal to" + + " `displayName`.") public String getName() { return name; } @@ -117,12 +142,17 @@ public Metadata2 slug(String slug) { } /** - * A human-readable, unique identifier for object. + * The slug that identifies this Source in the Segment app. Config API note: equal to + * `name`. * * @return slug */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable, unique identifier for object.") + @ApiModelProperty( + required = true, + value = + "The slug that identifies this Source in the Segment app. Config API note:" + + " equal to `name`.") public String getSlug() { return slug; } @@ -138,12 +168,12 @@ public Metadata2 description(String description) { } /** - * A description, in English, of this object. + * The description of this Source. * * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A description, in English, of this object.") + @ApiModelProperty(required = true, value = "The description of this Source.") public String getDescription() { return description; } @@ -152,7 +182,7 @@ public void setDescription(String description) { this.description = description; } - public Metadata2 logos(Logos2 logos) { + public Metadata2 logos(Logos1 logos) { this.logos = logos; return this; @@ -165,11 +195,11 @@ public Metadata2 logos(Logos2 logos) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Logos2 getLogos() { + public Logos1 getLogos() { return logos; } - public void setLogos(Logos2 logos) { + public void setLogos(Logos1 logos) { this.logos = logos; } @@ -185,12 +215,12 @@ public Metadata2 addOptionsItem(IntegrationOptionBeta optionsItem) { } /** - * The Integration options for this object. + * Options for this Source. * * @return options */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Integration options for this object.") + @ApiModelProperty(required = true, value = "Options for this Source.") public List getOptions() { return options; } @@ -199,6 +229,53 @@ public void setOptions(List options) { this.options = options; } + public Metadata2 categories(List categories) { + + this.categories = categories; + return this; + } + + public Metadata2 addCategoriesItem(String categoriesItem) { + this.categories.add(categoriesItem); + return this; + } + + /** + * A list of categories this Source belongs to. + * + * @return categories + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of categories this Source belongs to.") + public List getCategories() { + return categories; + } + + public void setCategories(List categories) { + this.categories = categories; + } + + public Metadata2 isCloudEventSource(Boolean isCloudEventSource) { + + this.isCloudEventSource = isCloudEventSource; + return this; + } + + /** + * True if this is a Cloud Event Source. + * + * @return isCloudEventSource + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "True if this is a Cloud Event Source.") + public Boolean getIsCloudEventSource() { + return isCloudEventSource; + } + + public void setIsCloudEventSource(Boolean isCloudEventSource) { + this.isCloudEventSource = isCloudEventSource; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -213,12 +290,15 @@ public boolean equals(Object o) { && Objects.equals(this.slug, metadata2.slug) && Objects.equals(this.description, metadata2.description) && Objects.equals(this.logos, metadata2.logos) - && Objects.equals(this.options, metadata2.options); + && Objects.equals(this.options, metadata2.options) + && Objects.equals(this.categories, metadata2.categories) + && Objects.equals(this.isCloudEventSource, metadata2.isCloudEventSource); } @Override public int hashCode() { - return Objects.hash(id, name, slug, description, logos, options); + return Objects.hash( + id, name, slug, description, logos, options, categories, isCloudEventSource); } @Override @@ -231,6 +311,10 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" isCloudEventSource: ") + .append(toIndentedString(isCloudEventSource)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -258,6 +342,8 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("logos"); openapiFields.add("options"); + openapiFields.add("categories"); + openapiFields.add("isCloudEventSource"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -267,6 +353,8 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("description"); openapiRequiredFields.add("logos"); openapiRequiredFields.add("options"); + openapiRequiredFields.add("categories"); + openapiRequiredFields.add("isCloudEventSource"); } /** @@ -346,6 +434,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); + // ensure the required json array is present + if (jsonObj.get("categories") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("categories").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `categories` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("categories").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java b/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java new file mode 100644 index 00000000..dc787be8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java @@ -0,0 +1,420 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The newly created Warehouse. */ +@ApiModel(description = "The newly created Warehouse.") +public class ProfilesWarehouse { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata1 metadata; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; + + public static final String SERIALIZED_NAME_SCHEMA_NAME = "schemaName"; + + @SerializedName(SERIALIZED_NAME_SCHEMA_NAME) + private String schemaName; + + public ProfilesWarehouse() {} + + public ProfilesWarehouse id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Warehouse. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Warehouse.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProfilesWarehouse spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * The Space id. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Space id.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ProfilesWarehouse metadata(Metadata1 metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata1 getMetadata() { + return metadata; + } + + public void setMetadata(Metadata1 metadata) { + this.metadata = metadata; + } + + public ProfilesWarehouse workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The id of the Workspace that owns this Warehouse. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Workspace that owns this Warehouse.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public ProfilesWarehouse enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * When set to true, this Warehouse receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this Warehouse receives data.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ProfilesWarehouse settings(Map settings) { + + this.settings = settings; + return this; + } + + /** + * The settings associated with this Warehouse. Common settings are connection-related + * configuration used to connect to it, for example host, username, and port. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = + "The settings associated with this Warehouse. Common settings are" + + " connection-related configuration used to connect to it, for example" + + " host, username, and port.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public ProfilesWarehouse schemaName(String schemaName) { + + this.schemaName = schemaName; + return this; + } + + /** + * The custom schema name that is going to be use on the Warehouse side. + * + * @return schemaName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The custom schema name that is going to be use on the Warehouse side.") + public String getSchemaName() { + return schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilesWarehouse profilesWarehouse = (ProfilesWarehouse) o; + return Objects.equals(this.id, profilesWarehouse.id) + && Objects.equals(this.spaceId, profilesWarehouse.spaceId) + && Objects.equals(this.metadata, profilesWarehouse.metadata) + && Objects.equals(this.workspaceId, profilesWarehouse.workspaceId) + && Objects.equals(this.enabled, profilesWarehouse.enabled) + && Objects.equals(this.settings, profilesWarehouse.settings) + && Objects.equals(this.schemaName, profilesWarehouse.schemaName); + } + + @Override + public int hashCode() { + return Objects.hash(id, spaceId, metadata, workspaceId, enabled, settings, schemaName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilesWarehouse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" schemaName: ").append(toIndentedString(schemaName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("metadata"); + openapiFields.add("workspaceId"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + openapiFields.add("schemaName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ProfilesWarehouse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ProfilesWarehouse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ProfilesWarehouse is not found in the" + + " empty JSON string", + ProfilesWarehouse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ProfilesWarehouse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ProfilesWarehouse` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProfilesWarehouse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if ((jsonObj.get("schemaName") != null && !jsonObj.get("schemaName").isJsonNull()) + && !jsonObj.get("schemaName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schemaName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("schemaName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProfilesWarehouse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilesWarehouse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ProfilesWarehouse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ProfilesWarehouse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProfilesWarehouse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilesWarehouse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilesWarehouse + * @throws IOException if the JSON string is invalid with respect to ProfilesWarehouse + */ + public static ProfilesWarehouse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilesWarehouse.class); + } + + /** + * Convert an instance of ProfilesWarehouse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java b/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java new file mode 100644 index 00000000..1243fd44 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java @@ -0,0 +1,420 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines a Profiles data Warehouse used as a Destination for Segment data. */ +@ApiModel(description = "Defines a Profiles data Warehouse used as a Destination for Segment data.") +public class ProfilesWarehouseAlpha { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata1 metadata; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; + + public static final String SERIALIZED_NAME_SCHEMA_NAME = "schemaName"; + + @SerializedName(SERIALIZED_NAME_SCHEMA_NAME) + private String schemaName; + + public ProfilesWarehouseAlpha() {} + + public ProfilesWarehouseAlpha id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Warehouse. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Warehouse.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProfilesWarehouseAlpha spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * The Space id. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Space id.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ProfilesWarehouseAlpha metadata(Metadata1 metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata1 getMetadata() { + return metadata; + } + + public void setMetadata(Metadata1 metadata) { + this.metadata = metadata; + } + + public ProfilesWarehouseAlpha workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The id of the Workspace that owns this Warehouse. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Workspace that owns this Warehouse.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public ProfilesWarehouseAlpha enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * When set to true, this Warehouse receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this Warehouse receives data.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ProfilesWarehouseAlpha settings(Map settings) { + + this.settings = settings; + return this; + } + + /** + * The settings associated with this Warehouse. Common settings are connection-related + * configuration used to connect to it, for example host, username, and port. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = + "The settings associated with this Warehouse. Common settings are" + + " connection-related configuration used to connect to it, for example" + + " host, username, and port.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public ProfilesWarehouseAlpha schemaName(String schemaName) { + + this.schemaName = schemaName; + return this; + } + + /** + * The custom schema name that is going to be use on the Warehouse side. + * + * @return schemaName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "The custom schema name that is going to be use on the Warehouse side.") + public String getSchemaName() { + return schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilesWarehouseAlpha profilesWarehouseAlpha = (ProfilesWarehouseAlpha) o; + return Objects.equals(this.id, profilesWarehouseAlpha.id) + && Objects.equals(this.spaceId, profilesWarehouseAlpha.spaceId) + && Objects.equals(this.metadata, profilesWarehouseAlpha.metadata) + && Objects.equals(this.workspaceId, profilesWarehouseAlpha.workspaceId) + && Objects.equals(this.enabled, profilesWarehouseAlpha.enabled) + && Objects.equals(this.settings, profilesWarehouseAlpha.settings) + && Objects.equals(this.schemaName, profilesWarehouseAlpha.schemaName); + } + + @Override + public int hashCode() { + return Objects.hash(id, spaceId, metadata, workspaceId, enabled, settings, schemaName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilesWarehouseAlpha {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" schemaName: ").append(toIndentedString(schemaName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("metadata"); + openapiFields.add("workspaceId"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + openapiFields.add("schemaName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ProfilesWarehouseAlpha + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ProfilesWarehouseAlpha.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ProfilesWarehouseAlpha is not found in" + + " the empty JSON string", + ProfilesWarehouseAlpha.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ProfilesWarehouseAlpha.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ProfilesWarehouseAlpha` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProfilesWarehouseAlpha.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if ((jsonObj.get("schemaName") != null && !jsonObj.get("schemaName").isJsonNull()) + && !jsonObj.get("schemaName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schemaName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("schemaName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProfilesWarehouseAlpha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilesWarehouseAlpha' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ProfilesWarehouseAlpha.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ProfilesWarehouseAlpha value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProfilesWarehouseAlpha read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilesWarehouseAlpha given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilesWarehouseAlpha + * @throws IOException if the JSON string is invalid with respect to ProfilesWarehouseAlpha + */ + public static ProfilesWarehouseAlpha fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilesWarehouseAlpha.class); + } + + /** + * Convert an instance of ProfilesWarehouseAlpha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Source1.java b/src/main/java/com/segment/publicapi/models/Source1.java index d8014cf0..6cc80909 100644 --- a/src/main/java/com/segment/publicapi/models/Source1.java +++ b/src/main/java/com/segment/publicapi/models/Source1.java @@ -57,7 +57,7 @@ public class Source1 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public Source1 metadata(Metadata1 metadata) { + public Source1 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public Source1 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Source2.java b/src/main/java/com/segment/publicapi/models/Source2.java index f227ff90..551f44e8 100644 --- a/src/main/java/com/segment/publicapi/models/Source2.java +++ b/src/main/java/com/segment/publicapi/models/Source2.java @@ -57,7 +57,7 @@ public class Source2 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public Source2 metadata(Metadata1 metadata) { + public Source2 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public Source2 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Source3.java b/src/main/java/com/segment/publicapi/models/Source3.java index d6aafe2c..1872b676 100644 --- a/src/main/java/com/segment/publicapi/models/Source3.java +++ b/src/main/java/com/segment/publicapi/models/Source3.java @@ -57,7 +57,7 @@ public class Source3 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public Source3 metadata(Metadata1 metadata) { + public Source3 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public Source3 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Source4.java b/src/main/java/com/segment/publicapi/models/Source4.java index c75dc398..9d5d9e91 100644 --- a/src/main/java/com/segment/publicapi/models/Source4.java +++ b/src/main/java/com/segment/publicapi/models/Source4.java @@ -57,7 +57,7 @@ public class Source4 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public Source4 metadata(Metadata1 metadata) { + public Source4 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public Source4 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Source5.java b/src/main/java/com/segment/publicapi/models/Source5.java index 073acaf6..9bebb206 100644 --- a/src/main/java/com/segment/publicapi/models/Source5.java +++ b/src/main/java/com/segment/publicapi/models/Source5.java @@ -57,7 +57,7 @@ public class Source5 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public Source5 metadata(Metadata1 metadata) { + public Source5 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public Source5 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Source6.java b/src/main/java/com/segment/publicapi/models/Source6.java index fc023adb..1cf386b7 100644 --- a/src/main/java/com/segment/publicapi/models/Source6.java +++ b/src/main/java/com/segment/publicapi/models/Source6.java @@ -57,7 +57,7 @@ public class Source6 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public Source6 metadata(Metadata1 metadata) { + public Source6 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public Source6 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/SourceAlpha.java b/src/main/java/com/segment/publicapi/models/SourceAlpha.java index 91cf1eaf..5370884b 100644 --- a/src/main/java/com/segment/publicapi/models/SourceAlpha.java +++ b/src/main/java/com/segment/publicapi/models/SourceAlpha.java @@ -57,7 +57,7 @@ public class SourceAlpha { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public SourceAlpha metadata(Metadata1 metadata) { + public SourceAlpha metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public SourceAlpha metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/SourceV1.java b/src/main/java/com/segment/publicapi/models/SourceV1.java index b6a7f6c7..9d75e86a 100644 --- a/src/main/java/com/segment/publicapi/models/SourceV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceV1.java @@ -57,7 +57,7 @@ public class SourceV1 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata1 metadata; + private Metadata2 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -156,7 +156,7 @@ public void setName(String name) { this.name = name; } - public SourceV1 metadata(Metadata1 metadata) { + public SourceV1 metadata(Metadata2 metadata) { this.metadata = metadata; return this; @@ -169,11 +169,11 @@ public SourceV1 metadata(Metadata1 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata1 getMetadata() { + public Metadata2 getMetadata() { return metadata; } - public void setMetadata(Metadata1 metadata) { + public void setMetadata(Metadata2 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Warehouse.java b/src/main/java/com/segment/publicapi/models/Warehouse.java index 33defef5..20b2a7f6 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse.java @@ -42,7 +42,7 @@ public class Warehouse { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata2 metadata; + private Metadata1 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -82,7 +82,7 @@ public void setId(String id) { this.id = id; } - public Warehouse metadata(Metadata2 metadata) { + public Warehouse metadata(Metadata1 metadata) { this.metadata = metadata; return this; @@ -95,11 +95,11 @@ public Warehouse metadata(Metadata2 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata2 getMetadata() { + public Metadata1 getMetadata() { return metadata; } - public void setMetadata(Metadata2 metadata) { + public void setMetadata(Metadata1 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Warehouse1.java b/src/main/java/com/segment/publicapi/models/Warehouse1.java index beedc382..def03961 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse1.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse1.java @@ -42,7 +42,7 @@ public class Warehouse1 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata2 metadata; + private Metadata1 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -82,7 +82,7 @@ public void setId(String id) { this.id = id; } - public Warehouse1 metadata(Metadata2 metadata) { + public Warehouse1 metadata(Metadata1 metadata) { this.metadata = metadata; return this; @@ -95,11 +95,11 @@ public Warehouse1 metadata(Metadata2 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata2 getMetadata() { + public Metadata1 getMetadata() { return metadata; } - public void setMetadata(Metadata2 metadata) { + public void setMetadata(Metadata1 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/Warehouse2.java b/src/main/java/com/segment/publicapi/models/Warehouse2.java index 86c1c3fb..155f467e 100644 --- a/src/main/java/com/segment/publicapi/models/Warehouse2.java +++ b/src/main/java/com/segment/publicapi/models/Warehouse2.java @@ -42,7 +42,7 @@ public class Warehouse2 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata2 metadata; + private Metadata1 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -82,7 +82,7 @@ public void setId(String id) { this.id = id; } - public Warehouse2 metadata(Metadata2 metadata) { + public Warehouse2 metadata(Metadata1 metadata) { this.metadata = metadata; return this; @@ -95,11 +95,11 @@ public Warehouse2 metadata(Metadata2 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata2 getMetadata() { + public Metadata1 getMetadata() { return metadata; } - public void setMetadata(Metadata2 metadata) { + public void setMetadata(Metadata1 metadata) { this.metadata = metadata; } diff --git a/src/main/java/com/segment/publicapi/models/WarehouseV1.java b/src/main/java/com/segment/publicapi/models/WarehouseV1.java index e3de3705..7c6e06e7 100644 --- a/src/main/java/com/segment/publicapi/models/WarehouseV1.java +++ b/src/main/java/com/segment/publicapi/models/WarehouseV1.java @@ -42,7 +42,7 @@ public class WarehouseV1 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata2 metadata; + private Metadata1 metadata; public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -82,7 +82,7 @@ public void setId(String id) { this.id = id; } - public WarehouseV1 metadata(Metadata2 metadata) { + public WarehouseV1 metadata(Metadata1 metadata) { this.metadata = metadata; return this; @@ -95,11 +95,11 @@ public WarehouseV1 metadata(Metadata2 metadata) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Metadata2 getMetadata() { + public Metadata1 getMetadata() { return metadata; } - public void setMetadata(Metadata2 metadata) { + public void setMetadata(Metadata1 metadata) { this.metadata = metadata; } From 8cc6802f41e675f7835d5d63b2c9dd3ec68200a7 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 14 Mar 2023 18:18:34 +0000 Subject: [PATCH 065/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@bfabc70. From 47b298295a6eb958a535ca6928aa4cbec3a78e4a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 15 Mar 2023 14:05:08 +0000 Subject: [PATCH 066/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4c22645. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 6 + .../publicapi/api/ProfilesSyncApi.java | 193 +++++++++++++ .../CreateProfilesWarehouseAlphaInput.java | 6 +- .../publicapi/models/ProfilesWarehouse.java | 5 +- .../models/ProfilesWarehouseAlpha.java | 5 +- ...ProfilesWarehouseFromSpace200Response.java | 206 +++++++++++++ ...ProfilesWarehouseFromSpaceAlphaOutput.java | 271 ++++++++++++++++++ 10 files changed, 689 insertions(+), 15 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java diff --git a/README.md b/README.md index 27d916d9..d72b5ebc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.0 +Latest API and SDK version: 34.3.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.0 + 34.3.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.0" + implementation "com.segment.publicapi:segment-publicapi:34.3.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.0.jar` +* `target/segment-publicapi-34.3.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index a97e8a18..97cb716e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.0 + 34.3.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 2d22e577..ea023f8f 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.0 (Java)"); + setUserAgent("Public API SDK 34.3.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7fc46111..16d8c681 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1031,6 +1031,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveRuleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index 2c88a0b6..c9c694d8 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -21,6 +21,7 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateProfilesWarehouse200Response; import com.segment.publicapi.models.CreateProfilesWarehouseAlphaInput; +import com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -259,4 +260,196 @@ public okhttp3.Call createProfilesWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for removeProfilesWarehouseFromSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeProfilesWarehouseFromSpaceCall( + String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeProfilesWarehouseFromSpaceValidateBeforeCall( + String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeProfilesWarehouseFromSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " removeProfilesWarehouseFromSpace(Async)"); + } + + okhttp3.Call localVarCall = + removeProfilesWarehouseFromSpaceCall(spaceId, warehouseId, _callback); + return localVarCall; + } + + /** + * Remove Profiles Warehouse from Space Deletes an existing Profiles Warehouse. • When called, + * this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @return RemoveProfilesWarehouseFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveProfilesWarehouseFromSpace200Response removeProfilesWarehouseFromSpace( + String spaceId, String warehouseId) throws ApiException { + ApiResponse localVarResp = + removeProfilesWarehouseFromSpaceWithHttpInfo(spaceId, warehouseId); + return localVarResp.getData(); + } + + /** + * Remove Profiles Warehouse from Space Deletes an existing Profiles Warehouse. • When called, + * this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @return ApiResponse<RemoveProfilesWarehouseFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + removeProfilesWarehouseFromSpaceWithHttpInfo(String spaceId, String warehouseId) + throws ApiException { + okhttp3.Call localVarCall = + removeProfilesWarehouseFromSpaceValidateBeforeCall(spaceId, warehouseId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Profiles Warehouse from Space (asynchronously) Deletes an existing Profiles Warehouse. + * • When called, this endpoint may generate the `Profiles Sync Warehouse Deleted` + * event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeProfilesWarehouseFromSpaceAsync( + String spaceId, + String warehouseId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeProfilesWarehouseFromSpaceValidateBeforeCall(spaceId, warehouseId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java index d66052e3..4cf6bf23 100644 --- a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java @@ -164,7 +164,7 @@ public CreateProfilesWarehouseAlphaInput schemaName(String schemaName) { } /** - * The custom schema name that is going to be use on the Warehouse side, space slug value is + * The custom schema name that Segment uses on the Warehouse side. The space slug value is * default otherwise. * * @return schemaName @@ -172,8 +172,8 @@ public CreateProfilesWarehouseAlphaInput schemaName(String schemaName) { @javax.annotation.Nullable @ApiModelProperty( value = - "The custom schema name that is going to be use on the Warehouse side, space" - + " slug value is default otherwise.") + "The custom schema name that Segment uses on the Warehouse side. The space slug" + + " value is default otherwise.") public String getSchemaName() { return schemaName; } diff --git a/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java b/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java index dc787be8..f73ae5f8 100644 --- a/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java +++ b/src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java @@ -210,13 +210,12 @@ public ProfilesWarehouse schemaName(String schemaName) { } /** - * The custom schema name that is going to be use on the Warehouse side. + * The custom schema name that Segment uses on the Warehouse side. * * @return schemaName */ @javax.annotation.Nullable - @ApiModelProperty( - value = "The custom schema name that is going to be use on the Warehouse side.") + @ApiModelProperty(value = "The custom schema name that Segment uses on the Warehouse side.") public String getSchemaName() { return schemaName; } diff --git a/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java b/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java index 1243fd44..289c355a 100644 --- a/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java +++ b/src/main/java/com/segment/publicapi/models/ProfilesWarehouseAlpha.java @@ -210,13 +210,12 @@ public ProfilesWarehouseAlpha schemaName(String schemaName) { } /** - * The custom schema name that is going to be use on the Warehouse side. + * The custom schema name that Segment uses on the Warehouse side. * * @return schemaName */ @javax.annotation.Nullable - @ApiModelProperty( - value = "The custom schema name that is going to be use on the Warehouse side.") + @ApiModelProperty(value = "The custom schema name that Segment uses on the Warehouse side.") public String getSchemaName() { return schemaName; } diff --git a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java new file mode 100644 index 00000000..5a88f239 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RemoveProfilesWarehouseFromSpace200Response */ +public class RemoveProfilesWarehouseFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveProfilesWarehouseFromSpaceAlphaOutput data; + + public RemoveProfilesWarehouseFromSpace200Response() {} + + public RemoveProfilesWarehouseFromSpace200Response data( + RemoveProfilesWarehouseFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RemoveProfilesWarehouseFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveProfilesWarehouseFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveProfilesWarehouseFromSpace200Response removeProfilesWarehouseFromSpace200Response = + (RemoveProfilesWarehouseFromSpace200Response) o; + return Objects.equals(this.data, removeProfilesWarehouseFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveProfilesWarehouseFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveProfilesWarehouseFromSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveProfilesWarehouseFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveProfilesWarehouseFromSpace200Response is not found in" + + " the empty JSON string", + RemoveProfilesWarehouseFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveProfilesWarehouseFromSpace200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveProfilesWarehouseFromSpace200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveProfilesWarehouseFromSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'RemoveProfilesWarehouseFromSpace200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveProfilesWarehouseFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveProfilesWarehouseFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveProfilesWarehouseFromSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveProfilesWarehouseFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveProfilesWarehouseFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveProfilesWarehouseFromSpace200Response + */ + public static RemoveProfilesWarehouseFromSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, RemoveProfilesWarehouseFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveProfilesWarehouseFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java new file mode 100644 index 00000000..ac9e2457 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java @@ -0,0 +1,271 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns the status of a Warehouse deletion. */ +@ApiModel(description = "Returns the status of a Warehouse deletion.") +public class RemoveProfilesWarehouseFromSpaceAlphaOutput { + /** The status of the Warehouse deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveProfilesWarehouseFromSpaceAlphaOutput() {} + + public RemoveProfilesWarehouseFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the Warehouse deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveProfilesWarehouseFromSpaceAlphaOutput removeProfilesWarehouseFromSpaceAlphaOutput = + (RemoveProfilesWarehouseFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeProfilesWarehouseFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveProfilesWarehouseFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveProfilesWarehouseFromSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveProfilesWarehouseFromSpaceAlphaOutput is not found in" + + " the empty JSON string", + RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveProfilesWarehouseFromSpaceAlphaOutput` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'RemoveProfilesWarehouseFromSpaceAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveProfilesWarehouseFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveProfilesWarehouseFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveProfilesWarehouseFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveProfilesWarehouseFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveProfilesWarehouseFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveProfilesWarehouseFromSpaceAlphaOutput + */ + public static RemoveProfilesWarehouseFromSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, RemoveProfilesWarehouseFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveProfilesWarehouseFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 31e48a5bcc7afb7c981dfe3dcbd38fdaaa76a8de Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 15 Mar 2023 14:49:08 +0000 Subject: [PATCH 067/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c8cea76. From fac4e9b0feed179f726f5dc56065a998d9ea7d2a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 15 Mar 2023 16:02:59 +0000 Subject: [PATCH 068/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6772404. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 6 - .../publicapi/api/ProfilesSyncApi.java | 193 ------------- ...ProfilesWarehouseFromSpace200Response.java | 206 ------------- ...ProfilesWarehouseFromSpaceAlphaOutput.java | 271 ------------------ 7 files changed, 6 insertions(+), 682 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java diff --git a/README.md b/README.md index d72b5ebc..27d916d9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.1 +Latest API and SDK version: 34.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.1 + 34.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.1" + implementation "com.segment.publicapi:segment-publicapi:34.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.1.jar` +* `target/segment-publicapi-34.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 97cb716e..a97e8a18 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.1 + 34.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index ea023f8f..2d22e577 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.1 (Java)"); + setUserAgent("Public API SDK 34.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 16d8c681..7fc46111 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1031,12 +1031,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpaceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveRuleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index c9c694d8..2c88a0b6 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -21,7 +21,6 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateProfilesWarehouse200Response; import com.segment.publicapi.models.CreateProfilesWarehouseAlphaInput; -import com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -260,196 +259,4 @@ public okhttp3.Call createProfilesWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for removeProfilesWarehouseFromSpace - * - * @param spaceId (required) - * @param warehouseId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeProfilesWarehouseFromSpaceCall( - String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/profiles-warehouses/{warehouseId}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", - localVarApiClient.escapeString(warehouseId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call removeProfilesWarehouseFromSpaceValidateBeforeCall( - String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " removeProfilesWarehouseFromSpace(Async)"); - } - - // verify the required parameter 'warehouseId' is set - if (warehouseId == null) { - throw new ApiException( - "Missing the required parameter 'warehouseId' when calling" - + " removeProfilesWarehouseFromSpace(Async)"); - } - - okhttp3.Call localVarCall = - removeProfilesWarehouseFromSpaceCall(spaceId, warehouseId, _callback); - return localVarCall; - } - - /** - * Remove Profiles Warehouse from Space Deletes an existing Profiles Warehouse. • When called, - * this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the - * [audit trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @return RemoveProfilesWarehouseFromSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public RemoveProfilesWarehouseFromSpace200Response removeProfilesWarehouseFromSpace( - String spaceId, String warehouseId) throws ApiException { - ApiResponse localVarResp = - removeProfilesWarehouseFromSpaceWithHttpInfo(spaceId, warehouseId); - return localVarResp.getData(); - } - - /** - * Remove Profiles Warehouse from Space Deletes an existing Profiles Warehouse. • When called, - * this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the - * [audit trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @return ApiResponse<RemoveProfilesWarehouseFromSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - removeProfilesWarehouseFromSpaceWithHttpInfo(String spaceId, String warehouseId) - throws ApiException { - okhttp3.Call localVarCall = - removeProfilesWarehouseFromSpaceValidateBeforeCall(spaceId, warehouseId, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Remove Profiles Warehouse from Space (asynchronously) Deletes an existing Profiles Warehouse. - * • When called, this endpoint may generate the `Profiles Sync Warehouse Deleted` - * event in the [audit trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeProfilesWarehouseFromSpaceAsync( - String spaceId, - String warehouseId, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - removeProfilesWarehouseFromSpaceValidateBeforeCall(spaceId, warehouseId, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java deleted file mode 100644 index 5a88f239..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** RemoveProfilesWarehouseFromSpace200Response */ -public class RemoveProfilesWarehouseFromSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private RemoveProfilesWarehouseFromSpaceAlphaOutput data; - - public RemoveProfilesWarehouseFromSpace200Response() {} - - public RemoveProfilesWarehouseFromSpace200Response data( - RemoveProfilesWarehouseFromSpaceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public RemoveProfilesWarehouseFromSpaceAlphaOutput getData() { - return data; - } - - public void setData(RemoveProfilesWarehouseFromSpaceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveProfilesWarehouseFromSpace200Response removeProfilesWarehouseFromSpace200Response = - (RemoveProfilesWarehouseFromSpace200Response) o; - return Objects.equals(this.data, removeProfilesWarehouseFromSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveProfilesWarehouseFromSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RemoveProfilesWarehouseFromSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RemoveProfilesWarehouseFromSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " RemoveProfilesWarehouseFromSpace200Response is not found in" - + " the empty JSON string", - RemoveProfilesWarehouseFromSpace200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RemoveProfilesWarehouseFromSpace200Response.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveProfilesWarehouseFromSpace200Response` properties." - + " JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveProfilesWarehouseFromSpace200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'RemoveProfilesWarehouseFromSpace200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveProfilesWarehouseFromSpace200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, RemoveProfilesWarehouseFromSpace200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveProfilesWarehouseFromSpace200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveProfilesWarehouseFromSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveProfilesWarehouseFromSpace200Response - * @throws IOException if the JSON string is invalid with respect to - * RemoveProfilesWarehouseFromSpace200Response - */ - public static RemoveProfilesWarehouseFromSpace200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, RemoveProfilesWarehouseFromSpace200Response.class); - } - - /** - * Convert an instance of RemoveProfilesWarehouseFromSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java deleted file mode 100644 index ac9e2457..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Returns the status of a Warehouse deletion. */ -@ApiModel(description = "Returns the status of a Warehouse deletion.") -public class RemoveProfilesWarehouseFromSpaceAlphaOutput { - /** The status of the Warehouse deletion operation. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public RemoveProfilesWarehouseFromSpaceAlphaOutput() {} - - public RemoveProfilesWarehouseFromSpaceAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The status of the Warehouse deletion operation. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveProfilesWarehouseFromSpaceAlphaOutput removeProfilesWarehouseFromSpaceAlphaOutput = - (RemoveProfilesWarehouseFromSpaceAlphaOutput) o; - return Objects.equals(this.status, removeProfilesWarehouseFromSpaceAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveProfilesWarehouseFromSpaceAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RemoveProfilesWarehouseFromSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " RemoveProfilesWarehouseFromSpaceAlphaOutput is not found in" - + " the empty JSON string", - RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveProfilesWarehouseFromSpaceAlphaOutput` properties." - + " JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'RemoveProfilesWarehouseFromSpaceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveProfilesWarehouseFromSpaceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, RemoveProfilesWarehouseFromSpaceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveProfilesWarehouseFromSpaceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveProfilesWarehouseFromSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveProfilesWarehouseFromSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * RemoveProfilesWarehouseFromSpaceAlphaOutput - */ - public static RemoveProfilesWarehouseFromSpaceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, RemoveProfilesWarehouseFromSpaceAlphaOutput.class); - } - - /** - * Convert an instance of RemoveProfilesWarehouseFromSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From c6a295df91b70411d82fd6cbbe53a1ab3a8a685d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 15 Mar 2023 16:16:54 +0000 Subject: [PATCH 069/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d66aeab. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 17 + .../segment/publicapi/api/FunctionsApi.java | 369 +++++++++++++++ .../ListFunctionVersions200Response.java | 197 ++++++++ .../models/ListVersionsAlphaOutput.java | 223 +++++++++ .../RestoreFunctionVersion200Response.java | 198 ++++++++ .../RestoreFunctionVersionAlphaInput.java | 217 +++++++++ .../RestoreFunctionVersionAlphaOutput.java | 211 +++++++++ .../com/segment/publicapi/models/Version.java | 424 ++++++++++++++++++ 11 files changed, 1862 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/Version.java diff --git a/README.md b/README.md index 27d916d9..6d91a1b1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.0 +Latest API and SDK version: 34.4.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.0 + 34.4.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.0" + implementation "com.segment.publicapi:segment-publicapi:34.4.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.0.jar` +* `target/segment-publicapi-34.4.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index a97e8a18..4d694d52 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.0 + 34.4.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 2d22e577..36c0ad9a 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.0 (Java)"); + setUserAgent("Public API SDK 34.4.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7fc46111..793523d3 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -802,6 +802,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionItemV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFunctionVersions200Response + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctions200Response .CustomTypeAdapterFactory()); @@ -937,6 +940,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUsersV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListVersionsAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListWarehouses200Response .CustomTypeAdapterFactory()); @@ -1141,6 +1147,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RequestErrorEnvelope.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ResourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RestoreFunctionVersion200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RestoreFunctionVersionAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RestoreFunctionVersionAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1379,6 +1394,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UsersPerSourceSnapshotV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Version.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Warehouse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index de9d1a7b..efe60572 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -24,8 +24,11 @@ import com.segment.publicapi.models.CreateFunctionV1Input; import com.segment.publicapi.models.DeleteFunction200Response; import com.segment.publicapi.models.GetFunction200Response; +import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RestoreFunctionVersion200Response; +import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; import java.lang.reflect.Type; @@ -766,6 +769,176 @@ public okhttp3.Call getFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for listFunctionVersions + * + * @param functionId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsCall(String functionId, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/functions/{functionId}/versions" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFunctionVersionsValidateBeforeCall( + String functionId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " listFunctionVersions(Async)"); + } + + okhttp3.Call localVarCall = listFunctionVersionsCall(functionId, _callback); + return localVarCall; + } + + /** + * List Function Versions Lists versions for a Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @return ListFunctionVersions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListFunctionVersions200Response listFunctionVersions(String functionId) + throws ApiException { + ApiResponse localVarResp = + listFunctionVersionsWithHttpInfo(functionId); + return localVarResp.getData(); + } + + /** + * List Function Versions Lists versions for a Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @return ApiResponse<ListFunctionVersions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listFunctionVersionsWithHttpInfo( + String functionId) throws ApiException { + okhttp3.Call localVarCall = listFunctionVersionsValidateBeforeCall(functionId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Function Versions (asynchronously) Lists versions for a Functions in a Workspace. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsAsync( + String functionId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listFunctionVersionsValidateBeforeCall(functionId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for listFunctions * @@ -964,6 +1137,202 @@ public okhttp3.Call listFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for restoreFunctionVersion + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call restoreFunctionVersionCall( + String functionId, + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = restoreFunctionVersionAlphaInput; + + // create path and map variables + String localVarPath = + "/functions/{functionId}/versions" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call restoreFunctionVersionValidateBeforeCall( + String functionId, + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " restoreFunctionVersion(Async)"); + } + + // verify the required parameter 'restoreFunctionVersionAlphaInput' is set + if (restoreFunctionVersionAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'restoreFunctionVersionAlphaInput' when calling" + + " restoreFunctionVersion(Async)"); + } + + okhttp3.Call localVarCall = + restoreFunctionVersionCall(functionId, restoreFunctionVersionAlphaInput, _callback); + return localVarCall; + } + + /** + * Restore Function Version Restore a given Function version and make the latest version. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @return RestoreFunctionVersion200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RestoreFunctionVersion200Response restoreFunctionVersion( + String functionId, RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput) + throws ApiException { + ApiResponse localVarResp = + restoreFunctionVersionWithHttpInfo(functionId, restoreFunctionVersionAlphaInput); + return localVarResp.getData(); + } + + /** + * Restore Function Version Restore a given Function version and make the latest version. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @return ApiResponse<RestoreFunctionVersion200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse restoreFunctionVersionWithHttpInfo( + String functionId, RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + restoreFunctionVersionValidateBeforeCall( + functionId, restoreFunctionVersionAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Restore Function Version (asynchronously) Restore a given Function version and make the + * latest version. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call restoreFunctionVersionAsync( + String functionId, + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + restoreFunctionVersionValidateBeforeCall( + functionId, restoreFunctionVersionAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for updateFunction * diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java new file mode 100644 index 00000000..ec1c8512 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListFunctionVersions200Response */ +public class ListFunctionVersions200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListVersionsAlphaOutput data; + + public ListFunctionVersions200Response() {} + + public ListFunctionVersions200Response data(ListVersionsAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListVersionsAlphaOutput getData() { + return data; + } + + public void setData(ListVersionsAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFunctionVersions200Response listFunctionVersions200Response = + (ListFunctionVersions200Response) o; + return Objects.equals(this.data, listFunctionVersions200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFunctionVersions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListFunctionVersions200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListFunctionVersions200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListFunctionVersions200Response is not" + + " found in the empty JSON string", + ListFunctionVersions200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListFunctionVersions200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListFunctionVersions200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFunctionVersions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFunctionVersions200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListFunctionVersions200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFunctionVersions200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFunctionVersions200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListFunctionVersions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFunctionVersions200Response + * @throws IOException if the JSON string is invalid with respect to + * ListFunctionVersions200Response + */ + public static ListFunctionVersions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFunctionVersions200Response.class); + } + + /** + * Convert an instance of ListFunctionVersions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java new file mode 100644 index 00000000..f2076b00 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java @@ -0,0 +1,223 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists Versions of a Function. */ +@ApiModel(description = "Lists Versions of a Function.") +public class ListVersionsAlphaOutput { + public static final String SERIALIZED_NAME_VERSIONS = "versions"; + + @SerializedName(SERIALIZED_NAME_VERSIONS) + private List versions = new ArrayList<>(); + + public ListVersionsAlphaOutput() {} + + public ListVersionsAlphaOutput versions(List versions) { + + this.versions = versions; + return this; + } + + public ListVersionsAlphaOutput addVersionsItem(Version versionsItem) { + this.versions.add(versionsItem); + return this; + } + + /** + * An array of Functions. + * + * @return versions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An array of Functions.") + public List getVersions() { + return versions; + } + + public void setVersions(List versions) { + this.versions = versions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListVersionsAlphaOutput listVersionsAlphaOutput = (ListVersionsAlphaOutput) o; + return Objects.equals(this.versions, listVersionsAlphaOutput.versions); + } + + @Override + public int hashCode() { + return Objects.hash(versions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListVersionsAlphaOutput {\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("versions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("versions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListVersionsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListVersionsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListVersionsAlphaOutput is not found" + + " in the empty JSON string", + ListVersionsAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListVersionsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListVersionsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListVersionsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("versions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `versions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("versions").toString())); + } + + JsonArray jsonArrayversions = jsonObj.getAsJsonArray("versions"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListVersionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListVersionsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListVersionsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListVersionsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListVersionsAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListVersionsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListVersionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to ListVersionsAlphaOutput + */ + public static ListVersionsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListVersionsAlphaOutput.class); + } + + /** + * Convert an instance of ListVersionsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java new file mode 100644 index 00000000..c18a4ca5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java @@ -0,0 +1,198 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RestoreFunctionVersion200Response */ +public class RestoreFunctionVersion200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RestoreFunctionVersionAlphaOutput data; + + public RestoreFunctionVersion200Response() {} + + public RestoreFunctionVersion200Response data(RestoreFunctionVersionAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RestoreFunctionVersionAlphaOutput getData() { + return data; + } + + public void setData(RestoreFunctionVersionAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreFunctionVersion200Response restoreFunctionVersion200Response = + (RestoreFunctionVersion200Response) o; + return Objects.equals(this.data, restoreFunctionVersion200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreFunctionVersion200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RestoreFunctionVersion200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RestoreFunctionVersion200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RestoreFunctionVersion200Response is" + + " not found in the empty JSON string", + RestoreFunctionVersion200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestoreFunctionVersion200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RestoreFunctionVersion200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreFunctionVersion200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreFunctionVersion200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RestoreFunctionVersion200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreFunctionVersion200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestoreFunctionVersion200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreFunctionVersion200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreFunctionVersion200Response + * @throws IOException if the JSON string is invalid with respect to + * RestoreFunctionVersion200Response + */ + public static RestoreFunctionVersion200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreFunctionVersion200Response.class); + } + + /** + * Convert an instance of RestoreFunctionVersion200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java new file mode 100644 index 00000000..248e0be1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java @@ -0,0 +1,217 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Restore a given Function version. */ +@ApiModel(description = "Restore a given Function version.") +public class RestoreFunctionVersionAlphaInput { + public static final String SERIALIZED_NAME_VERSION_ID = "versionId"; + + @SerializedName(SERIALIZED_NAME_VERSION_ID) + private String versionId; + + public RestoreFunctionVersionAlphaInput() {} + + public RestoreFunctionVersionAlphaInput versionId(String versionId) { + + this.versionId = versionId; + return this; + } + + /** + * An identifier for this version. + * + * @return versionId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An identifier for this version.") + public String getVersionId() { + return versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput = + (RestoreFunctionVersionAlphaInput) o; + return Objects.equals(this.versionId, restoreFunctionVersionAlphaInput.versionId); + } + + @Override + public int hashCode() { + return Objects.hash(versionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreFunctionVersionAlphaInput {\n"); + sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("versionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("versionId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RestoreFunctionVersionAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RestoreFunctionVersionAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RestoreFunctionVersionAlphaInput is" + + " not found in the empty JSON string", + RestoreFunctionVersionAlphaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestoreFunctionVersionAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RestoreFunctionVersionAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestoreFunctionVersionAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("versionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `versionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("versionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreFunctionVersionAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreFunctionVersionAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RestoreFunctionVersionAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreFunctionVersionAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestoreFunctionVersionAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreFunctionVersionAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreFunctionVersionAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * RestoreFunctionVersionAlphaInput + */ + public static RestoreFunctionVersionAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreFunctionVersionAlphaInput.class); + } + + /** + * Convert an instance of RestoreFunctionVersionAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java new file mode 100644 index 00000000..faf825af --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java @@ -0,0 +1,211 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Restore version output. */ +@ApiModel(description = "Restore version output.") +public class RestoreFunctionVersionAlphaOutput { + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private Version version; + + public RestoreFunctionVersionAlphaOutput() {} + + public RestoreFunctionVersionAlphaOutput version(Version version) { + + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreFunctionVersionAlphaOutput restoreFunctionVersionAlphaOutput = + (RestoreFunctionVersionAlphaOutput) o; + return Objects.equals(this.version, restoreFunctionVersionAlphaOutput.version); + } + + @Override + public int hashCode() { + return Objects.hash(version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreFunctionVersionAlphaOutput {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RestoreFunctionVersionAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RestoreFunctionVersionAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RestoreFunctionVersionAlphaOutput is" + + " not found in the empty JSON string", + RestoreFunctionVersionAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestoreFunctionVersionAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RestoreFunctionVersionAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestoreFunctionVersionAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreFunctionVersionAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreFunctionVersionAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RestoreFunctionVersionAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreFunctionVersionAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestoreFunctionVersionAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreFunctionVersionAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreFunctionVersionAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RestoreFunctionVersionAlphaOutput + */ + public static RestoreFunctionVersionAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreFunctionVersionAlphaOutput.class); + } + + /** + * Convert an instance of RestoreFunctionVersionAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Version.java b/src/main/java/com/segment/publicapi/models/Version.java new file mode 100644 index 00000000..7f1ac3f6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Version.java @@ -0,0 +1,424 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Restored version. */ +@ApiModel(description = "Restored version.") +public class Version { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_AUTHOR = "author"; + + @SerializedName(SERIALIZED_NAME_AUTHOR) + private String author; + + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_IS_DEPLOYED = "isDeployed"; + + @SerializedName(SERIALIZED_NAME_IS_DEPLOYED) + private Boolean isDeployed; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; + + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; + + public Version() {} + + public Version id(String id) { + + this.id = id; + return this; + } + + /** + * An identifier for this version. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An identifier for this version.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Version author(String author) { + + this.author = author; + return this; + } + + /** + * Author of this version. + * + * @return author + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Author of this version.") + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Version code(String code) { + + this.code = code; + return this; + } + + /** + * Source code of this version. + * + * @return code + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Source code of this version.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Version isDeployed(Boolean isDeployed) { + + this.isDeployed = isDeployed; + return this; + } + + /** + * The deployed status of this version. + * + * @return isDeployed + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The deployed status of this version.") + public Boolean getIsDeployed() { + return isDeployed; + } + + public void setIsDeployed(Boolean isDeployed) { + this.isDeployed = isDeployed; + } + + public Version createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The time of this Version's creation. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Version updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The time of this Version's latest update. + * + * @return updatedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's latest update.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public Version deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + + /** + * The time of this Version's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's last deployment.") + public String getDeployedAt() { + return deployedAt; + } + + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Version version = (Version) o; + return Objects.equals(this.id, version.id) + && Objects.equals(this.author, version.author) + && Objects.equals(this.code, version.code) + && Objects.equals(this.isDeployed, version.isDeployed) + && Objects.equals(this.createdAt, version.createdAt) + && Objects.equals(this.updatedAt, version.updatedAt) + && Objects.equals(this.deployedAt, version.deployedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, author, code, isDeployed, createdAt, updatedAt, deployedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Version {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" isDeployed: ").append(toIndentedString(isDeployed)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("author"); + openapiFields.add("code"); + openapiFields.add("isDeployed"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("deployedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("code"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Version + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Version.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Version is not found in the empty JSON" + + " string", + Version.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Version.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Version`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Version.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("author") != null && !jsonObj.get("author").isJsonNull()) + && !jsonObj.get("author").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `author` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("author").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Version.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Version' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Version.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Version value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Version read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Version given an JSON string + * + * @param jsonString JSON string + * @return An instance of Version + * @throws IOException if the JSON string is invalid with respect to Version + */ + public static Version fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Version.class); + } + + /** + * Convert an instance of Version to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 88f8b9ef151fdc0126582080e9b39d1faa815cfb Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 15 Mar 2023 19:17:43 +0000 Subject: [PATCH 070/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5519822. --- src/main/java/com/segment/publicapi/JSON.java | 12 + .../publicapi/api/ProfilesSyncApi.java | 387 ++++++++++++++++++ ...stProfilesWarehouseInSpace200Response.java | 204 +++++++++ ...stProfilesWarehouseInSpaceAlphaOutput.java | 270 ++++++++++++ ...ProfilesWarehouseFromSpace200Response.java | 206 ++++++++++ ...ProfilesWarehouseFromSpaceAlphaOutput.java | 271 ++++++++++++ 6 files changed, 1350 insertions(+) create mode 100644 src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 793523d3..49a370e6 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -828,6 +828,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ListLabelsAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListLabelsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListProfilesWarehouseInSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListProfilesWarehouseInSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListRegulationsFromSource200Response .CustomTypeAdapterFactory()); @@ -1037,6 +1043,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveRuleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index 2c88a0b6..5996ba15 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -21,6 +21,9 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateProfilesWarehouse200Response; import com.segment.publicapi.models.CreateProfilesWarehouseAlphaInput; +import com.segment.publicapi.models.ListProfilesWarehouseInSpace200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -259,4 +262,388 @@ public okhttp3.Call createProfilesWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for listProfilesWarehouseInSpace + * + * @param spaceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listProfilesWarehouseInSpaceCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listProfilesWarehouseInSpaceValidateBeforeCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listProfilesWarehouseInSpace(Async)"); + } + + okhttp3.Call localVarCall = + listProfilesWarehouseInSpaceCall(spaceId, pagination, _callback); + return localVarCall; + } + + /** + * List Profiles Warehouse in Space Lists all Profile Warehouses for a given space id. • When + * called, this endpoint may generate the `Profiles Sync Warehouse Retrieved` event in + * the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (optional) + * @return ListProfilesWarehouseInSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListProfilesWarehouseInSpace200Response listProfilesWarehouseInSpace( + String spaceId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listProfilesWarehouseInSpaceWithHttpInfo(spaceId, pagination); + return localVarResp.getData(); + } + + /** + * List Profiles Warehouse in Space Lists all Profile Warehouses for a given space id. • When + * called, this endpoint may generate the `Profiles Sync Warehouse Retrieved` event in + * the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (optional) + * @return ApiResponse<ListProfilesWarehouseInSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listProfilesWarehouseInSpaceWithHttpInfo(String spaceId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listProfilesWarehouseInSpaceValidateBeforeCall(spaceId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Profiles Warehouse in Space (asynchronously) Lists all Profile Warehouses for a given + * space id. • When called, this endpoint may generate the `Profiles Sync Warehouse + * Retrieved` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listProfilesWarehouseInSpaceAsync( + String spaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listProfilesWarehouseInSpaceValidateBeforeCall(spaceId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removeProfilesWarehouseFromSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeProfilesWarehouseFromSpaceCall( + String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeProfilesWarehouseFromSpaceValidateBeforeCall( + String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeProfilesWarehouseFromSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " removeProfilesWarehouseFromSpace(Async)"); + } + + okhttp3.Call localVarCall = + removeProfilesWarehouseFromSpaceCall(spaceId, warehouseId, _callback); + return localVarCall; + } + + /** + * Remove Profiles Warehouse from Space Deletes an existing Profiles Warehouse. • When called, + * this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @return RemoveProfilesWarehouseFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveProfilesWarehouseFromSpace200Response removeProfilesWarehouseFromSpace( + String spaceId, String warehouseId) throws ApiException { + ApiResponse localVarResp = + removeProfilesWarehouseFromSpaceWithHttpInfo(spaceId, warehouseId); + return localVarResp.getData(); + } + + /** + * Remove Profiles Warehouse from Space Deletes an existing Profiles Warehouse. • When called, + * this endpoint may generate the `Profiles Sync Warehouse Deleted` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @return ApiResponse<RemoveProfilesWarehouseFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + removeProfilesWarehouseFromSpaceWithHttpInfo(String spaceId, String warehouseId) + throws ApiException { + okhttp3.Call localVarCall = + removeProfilesWarehouseFromSpaceValidateBeforeCall(spaceId, warehouseId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Profiles Warehouse from Space (asynchronously) Deletes an existing Profiles Warehouse. + * • When called, this endpoint may generate the `Profiles Sync Warehouse Deleted` + * event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeProfilesWarehouseFromSpaceAsync( + String spaceId, + String warehouseId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeProfilesWarehouseFromSpaceValidateBeforeCall(spaceId, warehouseId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpace200Response.java b/src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpace200Response.java new file mode 100644 index 00000000..29aeed58 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpace200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListProfilesWarehouseInSpace200Response */ +public class ListProfilesWarehouseInSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListProfilesWarehouseInSpaceAlphaOutput data; + + public ListProfilesWarehouseInSpace200Response() {} + + public ListProfilesWarehouseInSpace200Response data( + ListProfilesWarehouseInSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListProfilesWarehouseInSpaceAlphaOutput getData() { + return data; + } + + public void setData(ListProfilesWarehouseInSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListProfilesWarehouseInSpace200Response listProfilesWarehouseInSpace200Response = + (ListProfilesWarehouseInSpace200Response) o; + return Objects.equals(this.data, listProfilesWarehouseInSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListProfilesWarehouseInSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListProfilesWarehouseInSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListProfilesWarehouseInSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListProfilesWarehouseInSpace200Response is not found in the" + + " empty JSON string", + ListProfilesWarehouseInSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListProfilesWarehouseInSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListProfilesWarehouseInSpace200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListProfilesWarehouseInSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'ListProfilesWarehouseInSpace200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListProfilesWarehouseInSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListProfilesWarehouseInSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListProfilesWarehouseInSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListProfilesWarehouseInSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListProfilesWarehouseInSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * ListProfilesWarehouseInSpace200Response + */ + public static ListProfilesWarehouseInSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListProfilesWarehouseInSpace200Response.class); + } + + /** + * Convert an instance of ListProfilesWarehouseInSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpaceAlphaOutput.java new file mode 100644 index 00000000..3c000344 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListProfilesWarehouseInSpaceAlphaOutput.java @@ -0,0 +1,270 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns all Profiles Warehouse based on spaceID and pagination. */ +@ApiModel(description = "Returns all Profiles Warehouse based on spaceID and pagination.") +public class ListProfilesWarehouseInSpaceAlphaOutput { + public static final String SERIALIZED_NAME_PROFILES_WAREHOUSES = "profilesWarehouses"; + + @SerializedName(SERIALIZED_NAME_PROFILES_WAREHOUSES) + private List profilesWarehouses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListProfilesWarehouseInSpaceAlphaOutput() {} + + public ListProfilesWarehouseInSpaceAlphaOutput profilesWarehouses( + List profilesWarehouses) { + + this.profilesWarehouses = profilesWarehouses; + return this; + } + + public ListProfilesWarehouseInSpaceAlphaOutput addProfilesWarehousesItem( + ProfilesWarehouseAlpha profilesWarehousesItem) { + this.profilesWarehouses.add(profilesWarehousesItem); + return this; + } + + /** + * A list of Warehouses that belong to the Workspace. + * + * @return profilesWarehouses + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of Warehouses that belong to the Workspace.") + public List getProfilesWarehouses() { + return profilesWarehouses; + } + + public void setProfilesWarehouses(List profilesWarehouses) { + this.profilesWarehouses = profilesWarehouses; + } + + public ListProfilesWarehouseInSpaceAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListProfilesWarehouseInSpaceAlphaOutput listProfilesWarehouseInSpaceAlphaOutput = + (ListProfilesWarehouseInSpaceAlphaOutput) o; + return Objects.equals( + this.profilesWarehouses, + listProfilesWarehouseInSpaceAlphaOutput.profilesWarehouses) + && Objects.equals( + this.pagination, listProfilesWarehouseInSpaceAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(profilesWarehouses, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListProfilesWarehouseInSpaceAlphaOutput {\n"); + sb.append(" profilesWarehouses: ") + .append(toIndentedString(profilesWarehouses)) + .append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("profilesWarehouses"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("profilesWarehouses"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListProfilesWarehouseInSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListProfilesWarehouseInSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListProfilesWarehouseInSpaceAlphaOutput is not found in the" + + " empty JSON string", + ListProfilesWarehouseInSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListProfilesWarehouseInSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListProfilesWarehouseInSpaceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListProfilesWarehouseInSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("profilesWarehouses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `profilesWarehouses` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("profilesWarehouses").toString())); + } + + JsonArray jsonArrayprofilesWarehouses = jsonObj.getAsJsonArray("profilesWarehouses"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListProfilesWarehouseInSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'ListProfilesWarehouseInSpaceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListProfilesWarehouseInSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListProfilesWarehouseInSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListProfilesWarehouseInSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListProfilesWarehouseInSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListProfilesWarehouseInSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListProfilesWarehouseInSpaceAlphaOutput + */ + public static ListProfilesWarehouseInSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListProfilesWarehouseInSpaceAlphaOutput.class); + } + + /** + * Convert an instance of ListProfilesWarehouseInSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java new file mode 100644 index 00000000..5a88f239 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpace200Response.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RemoveProfilesWarehouseFromSpace200Response */ +public class RemoveProfilesWarehouseFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveProfilesWarehouseFromSpaceAlphaOutput data; + + public RemoveProfilesWarehouseFromSpace200Response() {} + + public RemoveProfilesWarehouseFromSpace200Response data( + RemoveProfilesWarehouseFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RemoveProfilesWarehouseFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveProfilesWarehouseFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveProfilesWarehouseFromSpace200Response removeProfilesWarehouseFromSpace200Response = + (RemoveProfilesWarehouseFromSpace200Response) o; + return Objects.equals(this.data, removeProfilesWarehouseFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveProfilesWarehouseFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveProfilesWarehouseFromSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveProfilesWarehouseFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveProfilesWarehouseFromSpace200Response is not found in" + + " the empty JSON string", + RemoveProfilesWarehouseFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveProfilesWarehouseFromSpace200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveProfilesWarehouseFromSpace200Response` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveProfilesWarehouseFromSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'RemoveProfilesWarehouseFromSpace200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveProfilesWarehouseFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveProfilesWarehouseFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveProfilesWarehouseFromSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveProfilesWarehouseFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveProfilesWarehouseFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveProfilesWarehouseFromSpace200Response + */ + public static RemoveProfilesWarehouseFromSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, RemoveProfilesWarehouseFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveProfilesWarehouseFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java new file mode 100644 index 00000000..ac9e2457 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveProfilesWarehouseFromSpaceAlphaOutput.java @@ -0,0 +1,271 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns the status of a Warehouse deletion. */ +@ApiModel(description = "Returns the status of a Warehouse deletion.") +public class RemoveProfilesWarehouseFromSpaceAlphaOutput { + /** The status of the Warehouse deletion operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveProfilesWarehouseFromSpaceAlphaOutput() {} + + public RemoveProfilesWarehouseFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the Warehouse deletion operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveProfilesWarehouseFromSpaceAlphaOutput removeProfilesWarehouseFromSpaceAlphaOutput = + (RemoveProfilesWarehouseFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeProfilesWarehouseFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveProfilesWarehouseFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveProfilesWarehouseFromSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveProfilesWarehouseFromSpaceAlphaOutput is not found in" + + " the empty JSON string", + RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveProfilesWarehouseFromSpaceAlphaOutput` properties." + + " JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + RemoveProfilesWarehouseFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveProfilesWarehouseFromSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'RemoveProfilesWarehouseFromSpaceAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveProfilesWarehouseFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveProfilesWarehouseFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveProfilesWarehouseFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveProfilesWarehouseFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveProfilesWarehouseFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveProfilesWarehouseFromSpaceAlphaOutput + */ + public static RemoveProfilesWarehouseFromSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, RemoveProfilesWarehouseFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveProfilesWarehouseFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 443ab56f05cb2a1a24298c8d478d3f70b94d38a6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 16 Mar 2023 17:24:20 +0000 Subject: [PATCH 071/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4b60a78. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 28 +- .../segment/publicapi/api/FunctionsApi.java | 369 --------------- .../publicapi/api/ProfilesSyncApi.java | 239 ++++++++++ .../ListFunctionVersions200Response.java | 197 -------- .../models/ListVersionsAlphaOutput.java | 223 --------- .../publicapi/models/ProfilesWarehouse1.java | 419 +++++++++++++++++ .../RestoreFunctionVersionAlphaInput.java | 217 --------- ...arehouseForSpaceWarehouse200Response.java} | 81 ++-- ...sWarehouseForSpaceWarehouseAlphaInput.java | 349 ++++++++++++++ ...arehouseForSpaceWarehouseAlphaOutput.java} | 112 +++-- .../com/segment/publicapi/models/Version.java | 424 ------------------ 14 files changed, 1138 insertions(+), 1532 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ProfilesWarehouse1.java delete mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java rename src/main/java/com/segment/publicapi/models/{RestoreFunctionVersion200Response.java => UpdateProfilesWarehouseForSpaceWarehouse200Response.java} (60%) create mode 100644 src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.java rename src/main/java/com/segment/publicapi/models/{RestoreFunctionVersionAlphaOutput.java => UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.java} (56%) delete mode 100644 src/main/java/com/segment/publicapi/models/Version.java diff --git a/README.md b/README.md index 6d91a1b1..c346a507 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.4.0 +Latest API and SDK version: 34.3.3 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.4.0 + 34.3.3 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.4.0" + implementation "com.segment.publicapi:segment-publicapi:34.3.3" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.4.0.jar` +* `target/segment-publicapi-34.3.3.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 4d694d52..56ef3499 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.4.0 + 34.3.3 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 36c0ad9a..9ea3ab25 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.4.0 (Java)"); + setUserAgent("Public API SDK 34.3.3 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 49a370e6..f007cf2b 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -802,9 +802,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionItemV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListFunctionVersions200Response - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctions200Response .CustomTypeAdapterFactory()); @@ -946,9 +943,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUsersV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListVersionsAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListWarehouses200Response .CustomTypeAdapterFactory()); @@ -1019,6 +1013,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ProfilesWarehouse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ProfilesWarehouse1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ProfilesWarehouseAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1159,15 +1155,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RequestErrorEnvelope.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ResourceV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RestoreFunctionVersion200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RestoreFunctionVersionAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RestoreFunctionVersionAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1287,6 +1274,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.UpdateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateReverseEtlModel200Response .CustomTypeAdapterFactory()); @@ -1406,8 +1402,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UsersPerSourceSnapshotV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Version.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Warehouse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index efe60572..de9d1a7b 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -24,11 +24,8 @@ import com.segment.publicapi.models.CreateFunctionV1Input; import com.segment.publicapi.models.DeleteFunction200Response; import com.segment.publicapi.models.GetFunction200Response; -import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RestoreFunctionVersion200Response; -import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; import java.lang.reflect.Type; @@ -769,176 +766,6 @@ public okhttp3.Call getFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for listFunctionVersions - * - * @param functionId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listFunctionVersionsCall(String functionId, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/functions/{functionId}/versions" - .replaceAll( - "\\{" + "functionId" + "\\}", - localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionVersionsValidateBeforeCall( - String functionId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException( - "Missing the required parameter 'functionId' when calling" - + " listFunctionVersions(Async)"); - } - - okhttp3.Call localVarCall = listFunctionVersionsCall(functionId, _callback); - return localVarCall; - } - - /** - * List Function Versions Lists versions for a Functions in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @return ListFunctionVersions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListFunctionVersions200Response listFunctionVersions(String functionId) - throws ApiException { - ApiResponse localVarResp = - listFunctionVersionsWithHttpInfo(functionId); - return localVarResp.getData(); - } - - /** - * List Function Versions Lists versions for a Functions in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @return ApiResponse<ListFunctionVersions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse listFunctionVersionsWithHttpInfo( - String functionId) throws ApiException { - okhttp3.Call localVarCall = listFunctionVersionsValidateBeforeCall(functionId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Function Versions (asynchronously) Lists versions for a Functions in a Workspace. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listFunctionVersionsAsync( - String functionId, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = listFunctionVersionsValidateBeforeCall(functionId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for listFunctions * @@ -1137,202 +964,6 @@ public okhttp3.Call listFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for restoreFunctionVersion - * - * @param functionId (required) - * @param restoreFunctionVersionAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call restoreFunctionVersionCall( - String functionId, - RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = restoreFunctionVersionAlphaInput; - - // create path and map variables - String localVarPath = - "/functions/{functionId}/versions" - .replaceAll( - "\\{" + "functionId" + "\\}", - localVarApiClient.escapeString(functionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call restoreFunctionVersionValidateBeforeCall( - String functionId, - RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'functionId' is set - if (functionId == null) { - throw new ApiException( - "Missing the required parameter 'functionId' when calling" - + " restoreFunctionVersion(Async)"); - } - - // verify the required parameter 'restoreFunctionVersionAlphaInput' is set - if (restoreFunctionVersionAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'restoreFunctionVersionAlphaInput' when calling" - + " restoreFunctionVersion(Async)"); - } - - okhttp3.Call localVarCall = - restoreFunctionVersionCall(functionId, restoreFunctionVersionAlphaInput, _callback); - return localVarCall; - } - - /** - * Restore Function Version Restore a given Function version and make the latest version. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @param restoreFunctionVersionAlphaInput (required) - * @return RestoreFunctionVersion200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public RestoreFunctionVersion200Response restoreFunctionVersion( - String functionId, RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput) - throws ApiException { - ApiResponse localVarResp = - restoreFunctionVersionWithHttpInfo(functionId, restoreFunctionVersionAlphaInput); - return localVarResp.getData(); - } - - /** - * Restore Function Version Restore a given Function version and make the latest version. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @param restoreFunctionVersionAlphaInput (required) - * @return ApiResponse<RestoreFunctionVersion200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse restoreFunctionVersionWithHttpInfo( - String functionId, RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - restoreFunctionVersionValidateBeforeCall( - functionId, restoreFunctionVersionAlphaInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Restore Function Version (asynchronously) Restore a given Function version and make the - * latest version. • In order to successfully call this endpoint, the specified Workspace needs - * to have the Functions feature enabled. Please reach out to your customer success manager for - * more information. - * - * @param functionId (required) - * @param restoreFunctionVersionAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call restoreFunctionVersionAsync( - String functionId, - RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - restoreFunctionVersionValidateBeforeCall( - functionId, restoreFunctionVersionAlphaInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for updateFunction * diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index 5996ba15..6a05c3b5 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -24,6 +24,8 @@ import com.segment.publicapi.models.ListProfilesWarehouseInSpace200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response; +import com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response; +import com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouseAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -646,4 +648,241 @@ public okhttp3.Call removeProfilesWarehouseFromSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updateProfilesWarehouseForSpaceWarehouse + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateProfilesWarehouseForSpaceWarehouseAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateProfilesWarehouseForSpaceWarehouseCall( + String spaceId, + String warehouseId, + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateProfilesWarehouseForSpaceWarehouseAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateProfilesWarehouseForSpaceWarehouseValidateBeforeCall( + String spaceId, + String warehouseId, + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateProfilesWarehouseForSpaceWarehouse(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " updateProfilesWarehouseForSpaceWarehouse(Async)"); + } + + // verify the required parameter 'updateProfilesWarehouseForSpaceWarehouseAlphaInput' is set + if (updateProfilesWarehouseForSpaceWarehouseAlphaInput == null) { + throw new ApiException( + "Missing the required parameter" + + " 'updateProfilesWarehouseForSpaceWarehouseAlphaInput' when calling" + + " updateProfilesWarehouseForSpaceWarehouse(Async)"); + } + + okhttp3.Call localVarCall = + updateProfilesWarehouseForSpaceWarehouseCall( + spaceId, + warehouseId, + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + _callback); + return localVarCall; + } + + /** + * Update Profiles Warehouse for Space Warehouse Updates an existing Profiles Warehouse. • When + * called, this endpoint may generate the `Profiles Sync Warehouse Updated` event in + * the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateProfilesWarehouseForSpaceWarehouseAlphaInput (required) + * @return UpdateProfilesWarehouseForSpaceWarehouse200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateProfilesWarehouseForSpaceWarehouse200Response + updateProfilesWarehouseForSpaceWarehouse( + String spaceId, + String warehouseId, + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + updateProfilesWarehouseForSpaceWarehouseAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateProfilesWarehouseForSpaceWarehouseWithHttpInfo( + spaceId, warehouseId, updateProfilesWarehouseForSpaceWarehouseAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Profiles Warehouse for Space Warehouse Updates an existing Profiles Warehouse. • When + * called, this endpoint may generate the `Profiles Sync Warehouse Updated` event in + * the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateProfilesWarehouseForSpaceWarehouseAlphaInput (required) + * @return ApiResponse<UpdateProfilesWarehouseForSpaceWarehouse200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateProfilesWarehouseForSpaceWarehouseWithHttpInfo( + String spaceId, + String warehouseId, + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + updateProfilesWarehouseForSpaceWarehouseAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateProfilesWarehouseForSpaceWarehouseValidateBeforeCall( + spaceId, + warehouseId, + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Profiles Warehouse for Space Warehouse (asynchronously) Updates an existing Profiles + * Warehouse. • When called, this endpoint may generate the `Profiles Sync Warehouse + * Updated` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateProfilesWarehouseForSpaceWarehouseAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateProfilesWarehouseForSpaceWarehouseAsync( + String spaceId, + String warehouseId, + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateProfilesWarehouseForSpaceWarehouseValidateBeforeCall( + spaceId, + warehouseId, + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java deleted file mode 100644 index ec1c8512..00000000 --- a/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** ListFunctionVersions200Response */ -public class ListFunctionVersions200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ListVersionsAlphaOutput data; - - public ListFunctionVersions200Response() {} - - public ListFunctionVersions200Response data(ListVersionsAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ListVersionsAlphaOutput getData() { - return data; - } - - public void setData(ListVersionsAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListFunctionVersions200Response listFunctionVersions200Response = - (ListFunctionVersions200Response) o; - return Objects.equals(this.data, listFunctionVersions200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListFunctionVersions200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListFunctionVersions200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListFunctionVersions200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListFunctionVersions200Response is not" - + " found in the empty JSON string", - ListFunctionVersions200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListFunctionVersions200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListFunctionVersions200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListFunctionVersions200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListFunctionVersions200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListFunctionVersions200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListFunctionVersions200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListFunctionVersions200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListFunctionVersions200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListFunctionVersions200Response - * @throws IOException if the JSON string is invalid with respect to - * ListFunctionVersions200Response - */ - public static ListFunctionVersions200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListFunctionVersions200Response.class); - } - - /** - * Convert an instance of ListFunctionVersions200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java deleted file mode 100644 index f2076b00..00000000 --- a/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Lists Versions of a Function. */ -@ApiModel(description = "Lists Versions of a Function.") -public class ListVersionsAlphaOutput { - public static final String SERIALIZED_NAME_VERSIONS = "versions"; - - @SerializedName(SERIALIZED_NAME_VERSIONS) - private List versions = new ArrayList<>(); - - public ListVersionsAlphaOutput() {} - - public ListVersionsAlphaOutput versions(List versions) { - - this.versions = versions; - return this; - } - - public ListVersionsAlphaOutput addVersionsItem(Version versionsItem) { - this.versions.add(versionsItem); - return this; - } - - /** - * An array of Functions. - * - * @return versions - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of Functions.") - public List getVersions() { - return versions; - } - - public void setVersions(List versions) { - this.versions = versions; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListVersionsAlphaOutput listVersionsAlphaOutput = (ListVersionsAlphaOutput) o; - return Objects.equals(this.versions, listVersionsAlphaOutput.versions); - } - - @Override - public int hashCode() { - return Objects.hash(versions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListVersionsAlphaOutput {\n"); - sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("versions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("versions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ListVersionsAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListVersionsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListVersionsAlphaOutput is not found" - + " in the empty JSON string", - ListVersionsAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListVersionsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListVersionsAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListVersionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("versions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `versions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("versions").toString())); - } - - JsonArray jsonArrayversions = jsonObj.getAsJsonArray("versions"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListVersionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListVersionsAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListVersionsAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListVersionsAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListVersionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListVersionsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListVersionsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to ListVersionsAlphaOutput - */ - public static ListVersionsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListVersionsAlphaOutput.class); - } - - /** - * Convert an instance of ListVersionsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ProfilesWarehouse1.java b/src/main/java/com/segment/publicapi/models/ProfilesWarehouse1.java new file mode 100644 index 00000000..0fe2b18c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ProfilesWarehouse1.java @@ -0,0 +1,419 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated Warehouse. */ +@ApiModel(description = "The updated Warehouse.") +public class ProfilesWarehouse1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + + @SerializedName(SERIALIZED_NAME_METADATA) + private Metadata1 metadata; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; + + public static final String SERIALIZED_NAME_SCHEMA_NAME = "schemaName"; + + @SerializedName(SERIALIZED_NAME_SCHEMA_NAME) + private String schemaName; + + public ProfilesWarehouse1() {} + + public ProfilesWarehouse1 id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the Warehouse. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Warehouse.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ProfilesWarehouse1 spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * The Space id. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Space id.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ProfilesWarehouse1 metadata(Metadata1 metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * + * @return metadata + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Metadata1 getMetadata() { + return metadata; + } + + public void setMetadata(Metadata1 metadata) { + this.metadata = metadata; + } + + public ProfilesWarehouse1 workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The id of the Workspace that owns this Warehouse. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Workspace that owns this Warehouse.") + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public ProfilesWarehouse1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * When set to true, this Warehouse receives data. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "When set to true, this Warehouse receives data.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ProfilesWarehouse1 settings(Map settings) { + + this.settings = settings; + return this; + } + + /** + * The settings associated with this Warehouse. Common settings are connection-related + * configuration used to connect to it, for example host, username, and port. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = + "The settings associated with this Warehouse. Common settings are" + + " connection-related configuration used to connect to it, for example" + + " host, username, and port.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public ProfilesWarehouse1 schemaName(String schemaName) { + + this.schemaName = schemaName; + return this; + } + + /** + * The custom schema name that Segment uses on the Warehouse side. + * + * @return schemaName + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The custom schema name that Segment uses on the Warehouse side.") + public String getSchemaName() { + return schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilesWarehouse1 profilesWarehouse1 = (ProfilesWarehouse1) o; + return Objects.equals(this.id, profilesWarehouse1.id) + && Objects.equals(this.spaceId, profilesWarehouse1.spaceId) + && Objects.equals(this.metadata, profilesWarehouse1.metadata) + && Objects.equals(this.workspaceId, profilesWarehouse1.workspaceId) + && Objects.equals(this.enabled, profilesWarehouse1.enabled) + && Objects.equals(this.settings, profilesWarehouse1.settings) + && Objects.equals(this.schemaName, profilesWarehouse1.schemaName); + } + + @Override + public int hashCode() { + return Objects.hash(id, spaceId, metadata, workspaceId, enabled, settings, schemaName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilesWarehouse1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" schemaName: ").append(toIndentedString(schemaName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("metadata"); + openapiFields.add("workspaceId"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + openapiFields.add("schemaName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("metadata"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ProfilesWarehouse1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ProfilesWarehouse1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ProfilesWarehouse1 is not found in the" + + " empty JSON string", + ProfilesWarehouse1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ProfilesWarehouse1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ProfilesWarehouse1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProfilesWarehouse1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if ((jsonObj.get("schemaName") != null && !jsonObj.get("schemaName").isJsonNull()) + && !jsonObj.get("schemaName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schemaName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("schemaName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProfilesWarehouse1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilesWarehouse1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ProfilesWarehouse1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ProfilesWarehouse1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProfilesWarehouse1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilesWarehouse1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilesWarehouse1 + * @throws IOException if the JSON string is invalid with respect to ProfilesWarehouse1 + */ + public static ProfilesWarehouse1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilesWarehouse1.class); + } + + /** + * Convert an instance of ProfilesWarehouse1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java deleted file mode 100644 index 248e0be1..00000000 --- a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Restore a given Function version. */ -@ApiModel(description = "Restore a given Function version.") -public class RestoreFunctionVersionAlphaInput { - public static final String SERIALIZED_NAME_VERSION_ID = "versionId"; - - @SerializedName(SERIALIZED_NAME_VERSION_ID) - private String versionId; - - public RestoreFunctionVersionAlphaInput() {} - - public RestoreFunctionVersionAlphaInput versionId(String versionId) { - - this.versionId = versionId; - return this; - } - - /** - * An identifier for this version. - * - * @return versionId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An identifier for this version.") - public String getVersionId() { - return versionId; - } - - public void setVersionId(String versionId) { - this.versionId = versionId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput = - (RestoreFunctionVersionAlphaInput) o; - return Objects.equals(this.versionId, restoreFunctionVersionAlphaInput.versionId); - } - - @Override - public int hashCode() { - return Objects.hash(versionId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RestoreFunctionVersionAlphaInput {\n"); - sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("versionId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("versionId"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RestoreFunctionVersionAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RestoreFunctionVersionAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RestoreFunctionVersionAlphaInput is" - + " not found in the empty JSON string", - RestoreFunctionVersionAlphaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RestoreFunctionVersionAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RestoreFunctionVersionAlphaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RestoreFunctionVersionAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("versionId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `versionId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("versionId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RestoreFunctionVersionAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RestoreFunctionVersionAlphaInput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RestoreFunctionVersionAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RestoreFunctionVersionAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RestoreFunctionVersionAlphaInput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RestoreFunctionVersionAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of RestoreFunctionVersionAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * RestoreFunctionVersionAlphaInput - */ - public static RestoreFunctionVersionAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RestoreFunctionVersionAlphaInput.class); - } - - /** - * Convert an instance of RestoreFunctionVersionAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java b/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouse200Response.java similarity index 60% rename from src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java rename to src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouse200Response.java index c18a4ca5..d0ddf985 100644 --- a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java +++ b/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouse200Response.java @@ -29,16 +29,17 @@ import java.util.Objects; import java.util.Set; -/** RestoreFunctionVersion200Response */ -public class RestoreFunctionVersion200Response { +/** UpdateProfilesWarehouseForSpaceWarehouse200Response */ +public class UpdateProfilesWarehouseForSpaceWarehouse200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private RestoreFunctionVersionAlphaOutput data; + private UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput data; - public RestoreFunctionVersion200Response() {} + public UpdateProfilesWarehouseForSpaceWarehouse200Response() {} - public RestoreFunctionVersion200Response data(RestoreFunctionVersionAlphaOutput data) { + public UpdateProfilesWarehouseForSpaceWarehouse200Response data( + UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput data) { this.data = data; return this; @@ -51,11 +52,11 @@ public RestoreFunctionVersion200Response data(RestoreFunctionVersionAlphaOutput */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public RestoreFunctionVersionAlphaOutput getData() { + public UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput getData() { return data; } - public void setData(RestoreFunctionVersionAlphaOutput data) { + public void setData(UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput data) { this.data = data; } @@ -67,9 +68,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RestoreFunctionVersion200Response restoreFunctionVersion200Response = - (RestoreFunctionVersion200Response) o; - return Objects.equals(this.data, restoreFunctionVersion200Response.data); + UpdateProfilesWarehouseForSpaceWarehouse200Response + updateProfilesWarehouseForSpaceWarehouse200Response = + (UpdateProfilesWarehouseForSpaceWarehouse200Response) o; + return Objects.equals(this.data, updateProfilesWarehouseForSpaceWarehouse200Response.data); } @Override @@ -80,7 +82,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RestoreFunctionVersion200Response {\n"); + sb.append("class UpdateProfilesWarehouseForSpaceWarehouse200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -114,17 +116,19 @@ private String toIndentedString(Object o) { * * @param jsonObj JSON Object * @throws IOException if the JSON Object is invalid with respect to - * RestoreFunctionVersion200Response + * UpdateProfilesWarehouseForSpaceWarehouse200Response */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (!RestoreFunctionVersion200Response.openapiRequiredFields + if (!UpdateProfilesWarehouseForSpaceWarehouse200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON object is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in RestoreFunctionVersion200Response is" - + " not found in the empty JSON string", - RestoreFunctionVersion200Response.openapiRequiredFields + "The required field(s) %s in" + + " UpdateProfilesWarehouseForSpaceWarehouse200Response is not" + + " found in the empty JSON string", + UpdateProfilesWarehouseForSpaceWarehouse200Response + .openapiRequiredFields .toString())); } } @@ -132,11 +136,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!RestoreFunctionVersion200Response.openapiFields.contains(entry.getKey())) { + if (!UpdateProfilesWarehouseForSpaceWarehouse200Response.openapiFields.contains( + entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `RestoreFunctionVersion200Response` properties. JSON: %s", + + " `UpdateProfilesWarehouseForSpaceWarehouse200Response`" + + " properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } @@ -146,27 +152,33 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!RestoreFunctionVersion200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RestoreFunctionVersion200Response' and - // its subtypes + if (!UpdateProfilesWarehouseForSpaceWarehouse200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UpdateProfilesWarehouseForSpaceWarehouse200Response' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(RestoreFunctionVersion200Response.class)); + this, + TypeToken.get( + UpdateProfilesWarehouseForSpaceWarehouse200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, RestoreFunctionVersion200Response value) + public void write( + JsonWriter out, + UpdateProfilesWarehouseForSpaceWarehouse200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public RestoreFunctionVersion200Response read(JsonReader in) - throws IOException { + public UpdateProfilesWarehouseForSpaceWarehouse200Response read( + JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -176,19 +188,22 @@ public RestoreFunctionVersion200Response read(JsonReader in) } /** - * Create an instance of RestoreFunctionVersion200Response given an JSON string + * Create an instance of UpdateProfilesWarehouseForSpaceWarehouse200Response given an JSON + * string * * @param jsonString JSON string - * @return An instance of RestoreFunctionVersion200Response + * @return An instance of UpdateProfilesWarehouseForSpaceWarehouse200Response * @throws IOException if the JSON string is invalid with respect to - * RestoreFunctionVersion200Response + * UpdateProfilesWarehouseForSpaceWarehouse200Response */ - public static RestoreFunctionVersion200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RestoreFunctionVersion200Response.class); + public static UpdateProfilesWarehouseForSpaceWarehouse200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, UpdateProfilesWarehouseForSpaceWarehouse200Response.class); } /** - * Convert an instance of RestoreFunctionVersion200Response to an JSON string + * Convert an instance of UpdateProfilesWarehouseForSpaceWarehouse200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.java new file mode 100644 index 00000000..ef144eec --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.java @@ -0,0 +1,349 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Updates a Profiles Warehouse based on a set of parameters. */ +@ApiModel(description = "Updates a Profiles Warehouse based on a set of parameters.") +public class UpdateProfilesWarehouseForSpaceWarehouseAlphaInput { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings; + + public static final String SERIALIZED_NAME_SCHEMA_NAME = "schemaName"; + + @SerializedName(SERIALIZED_NAME_SCHEMA_NAME) + private String schemaName; + + public UpdateProfilesWarehouseForSpaceWarehouseAlphaInput() {} + + public UpdateProfilesWarehouseForSpaceWarehouseAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * An optional human-readable name for this Warehouse. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "An optional human-readable name for this Warehouse.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateProfilesWarehouseForSpaceWarehouseAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enable to allow this Warehouse to receive data. Defaults to true. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Enable to allow this Warehouse to receive data. Defaults to true.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateProfilesWarehouseForSpaceWarehouseAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + /** + * A key-value object that contains instance-specific settings for a Warehouse. Different kinds + * of Warehouses require different settings. The required and optional settings for a Warehouse + * are described in the `options` object of the associated Warehouse metadata. You can + * find the full list of Warehouse metadata and related settings information in the + * `/catalog/warehouses` endpoint. + * + * @return settings + */ + @javax.annotation.Nullable + @ApiModelProperty( + required = true, + value = + "A key-value object that contains instance-specific settings for a Warehouse. " + + " Different kinds of Warehouses require different settings. The required" + + " and optional settings for a Warehouse are described in the `options`" + + " object of the associated Warehouse metadata. You can find the full" + + " list of Warehouse metadata and related settings information in the" + + " `/catalog/warehouses` endpoint.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public UpdateProfilesWarehouseForSpaceWarehouseAlphaInput schemaName(String schemaName) { + + this.schemaName = schemaName; + return this; + } + + /** + * The custom schema name that Segment uses on the Warehouse side. The space slug value is + * default otherwise. + * + * @return schemaName + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "The custom schema name that Segment uses on the Warehouse side. The space slug" + + " value is default otherwise.") + public String getSchemaName() { + return schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + updateProfilesWarehouseForSpaceWarehouseAlphaInput = + (UpdateProfilesWarehouseForSpaceWarehouseAlphaInput) o; + return Objects.equals(this.name, updateProfilesWarehouseForSpaceWarehouseAlphaInput.name) + && Objects.equals( + this.enabled, updateProfilesWarehouseForSpaceWarehouseAlphaInput.enabled) + && Objects.equals( + this.settings, updateProfilesWarehouseForSpaceWarehouseAlphaInput.settings) + && Objects.equals( + this.schemaName, + updateProfilesWarehouseForSpaceWarehouseAlphaInput.schemaName); + } + + @Override + public int hashCode() { + return Objects.hash(name, enabled, settings, schemaName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateProfilesWarehouseForSpaceWarehouseAlphaInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" schemaName: ").append(toIndentedString(schemaName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("settings"); + openapiFields.add("schemaName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateProfilesWarehouseForSpaceWarehouseAlphaInput is not" + + " found in the empty JSON string", + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateProfilesWarehouseForSpaceWarehouseAlphaInput`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("schemaName") != null && !jsonObj.get("schemaName").isJsonNull()) + && !jsonObj.get("schemaName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schemaName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("schemaName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UpdateProfilesWarehouseForSpaceWarehouseAlphaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + UpdateProfilesWarehouseForSpaceWarehouseAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateProfilesWarehouseForSpaceWarehouseAlphaInput read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateProfilesWarehouseForSpaceWarehouseAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateProfilesWarehouseForSpaceWarehouseAlphaInput + */ + public static UpdateProfilesWarehouseForSpaceWarehouseAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, UpdateProfilesWarehouseForSpaceWarehouseAlphaInput.class); + } + + /** + * Convert an instance of UpdateProfilesWarehouseForSpaceWarehouseAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.java similarity index 56% rename from src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java rename to src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.java index faf825af..34f78484 100644 --- a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.java @@ -30,35 +30,36 @@ import java.util.Objects; import java.util.Set; -/** Restore version output. */ -@ApiModel(description = "Restore version output.") -public class RestoreFunctionVersionAlphaOutput { - public static final String SERIALIZED_NAME_VERSION = "version"; +/** Returns the updated Warehouse. */ +@ApiModel(description = "Returns the updated Warehouse.") +public class UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput { + public static final String SERIALIZED_NAME_PROFILES_WAREHOUSE = "profilesWarehouse"; - @SerializedName(SERIALIZED_NAME_VERSION) - private Version version; + @SerializedName(SERIALIZED_NAME_PROFILES_WAREHOUSE) + private ProfilesWarehouse1 profilesWarehouse; - public RestoreFunctionVersionAlphaOutput() {} + public UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput() {} - public RestoreFunctionVersionAlphaOutput version(Version version) { + public UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput profilesWarehouse( + ProfilesWarehouse1 profilesWarehouse) { - this.version = version; + this.profilesWarehouse = profilesWarehouse; return this; } /** - * Get version + * Get profilesWarehouse * - * @return version + * @return profilesWarehouse */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Version getVersion() { - return version; + public ProfilesWarehouse1 getProfilesWarehouse() { + return profilesWarehouse; } - public void setVersion(Version version) { - this.version = version; + public void setProfilesWarehouse(ProfilesWarehouse1 profilesWarehouse) { + this.profilesWarehouse = profilesWarehouse; } @Override @@ -69,21 +70,26 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RestoreFunctionVersionAlphaOutput restoreFunctionVersionAlphaOutput = - (RestoreFunctionVersionAlphaOutput) o; - return Objects.equals(this.version, restoreFunctionVersionAlphaOutput.version); + UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput + updateProfilesWarehouseForSpaceWarehouseAlphaOutput = + (UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput) o; + return Objects.equals( + this.profilesWarehouse, + updateProfilesWarehouseForSpaceWarehouseAlphaOutput.profilesWarehouse); } @Override public int hashCode() { - return Objects.hash(version); + return Objects.hash(profilesWarehouse); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RestoreFunctionVersionAlphaOutput {\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("class UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput {\n"); + sb.append(" profilesWarehouse: ") + .append(toIndentedString(profilesWarehouse)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -105,11 +111,11 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("version"); + openapiFields.add("profilesWarehouse"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("version"); + openapiRequiredFields.add("profilesWarehouse"); } /** @@ -117,17 +123,19 @@ private String toIndentedString(Object o) { * * @param jsonObj JSON Object * @throws IOException if the JSON Object is invalid with respect to - * RestoreFunctionVersionAlphaOutput + * UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (!RestoreFunctionVersionAlphaOutput.openapiRequiredFields + if (!UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON object is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in RestoreFunctionVersionAlphaOutput is" - + " not found in the empty JSON string", - RestoreFunctionVersionAlphaOutput.openapiRequiredFields + "The required field(s) %s in" + + " UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput is not" + + " found in the empty JSON string", + UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput + .openapiRequiredFields .toString())); } } @@ -135,17 +143,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!RestoreFunctionVersionAlphaOutput.openapiFields.contains(entry.getKey())) { + if (!UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.openapiFields.contains( + entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `RestoreFunctionVersionAlphaOutput` properties. JSON: %s", + + " `UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput`" + + " properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RestoreFunctionVersionAlphaOutput.openapiRequiredFields) { + for (String requiredField : + UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -159,27 +170,33 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!RestoreFunctionVersionAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RestoreFunctionVersionAlphaOutput' and - // its subtypes + if (!UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(RestoreFunctionVersionAlphaOutput.class)); + this, + TypeToken.get( + UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, RestoreFunctionVersionAlphaOutput value) + public void write( + JsonWriter out, + UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public RestoreFunctionVersionAlphaOutput read(JsonReader in) - throws IOException { + public UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput read( + JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -189,19 +206,22 @@ public RestoreFunctionVersionAlphaOutput read(JsonReader in) } /** - * Create an instance of RestoreFunctionVersionAlphaOutput given an JSON string + * Create an instance of UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput given an JSON + * string * * @param jsonString JSON string - * @return An instance of RestoreFunctionVersionAlphaOutput + * @return An instance of UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput * @throws IOException if the JSON string is invalid with respect to - * RestoreFunctionVersionAlphaOutput + * UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput */ - public static RestoreFunctionVersionAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RestoreFunctionVersionAlphaOutput.class); + public static UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput.class); } /** - * Convert an instance of RestoreFunctionVersionAlphaOutput to an JSON string + * Convert an instance of UpdateProfilesWarehouseForSpaceWarehouseAlphaOutput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/Version.java b/src/main/java/com/segment/publicapi/models/Version.java deleted file mode 100644 index 7f1ac3f6..00000000 --- a/src/main/java/com/segment/publicapi/models/Version.java +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Restored version. */ -@ApiModel(description = "Restored version.") -public class Version { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_AUTHOR = "author"; - - @SerializedName(SERIALIZED_NAME_AUTHOR) - private String author; - - public static final String SERIALIZED_NAME_CODE = "code"; - - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_IS_DEPLOYED = "isDeployed"; - - @SerializedName(SERIALIZED_NAME_IS_DEPLOYED) - private Boolean isDeployed; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; - - public Version() {} - - public Version id(String id) { - - this.id = id; - return this; - } - - /** - * An identifier for this version. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An identifier for this version.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Version author(String author) { - - this.author = author; - return this; - } - - /** - * Author of this version. - * - * @return author - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Author of this version.") - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public Version code(String code) { - - this.code = code; - return this; - } - - /** - * Source code of this version. - * - * @return code - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Source code of this version.") - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Version isDeployed(Boolean isDeployed) { - - this.isDeployed = isDeployed; - return this; - } - - /** - * The deployed status of this version. - * - * @return isDeployed - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The deployed status of this version.") - public Boolean getIsDeployed() { - return isDeployed; - } - - public void setIsDeployed(Boolean isDeployed) { - this.isDeployed = isDeployed; - } - - public Version createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The time of this Version's creation. - * - * @return createdAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Version's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Version updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The time of this Version's latest update. - * - * @return updatedAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Version's latest update.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public Version deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } - - /** - * The time of this Version's last deployment. - * - * @return deployedAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Version's last deployment.") - public String getDeployedAt() { - return deployedAt; - } - - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Version version = (Version) o; - return Objects.equals(this.id, version.id) - && Objects.equals(this.author, version.author) - && Objects.equals(this.code, version.code) - && Objects.equals(this.isDeployed, version.isDeployed) - && Objects.equals(this.createdAt, version.createdAt) - && Objects.equals(this.updatedAt, version.updatedAt) - && Objects.equals(this.deployedAt, version.deployedAt); - } - - @Override - public int hashCode() { - return Objects.hash(id, author, code, isDeployed, createdAt, updatedAt, deployedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Version {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" author: ").append(toIndentedString(author)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" isDeployed: ").append(toIndentedString(isDeployed)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("author"); - openapiFields.add("code"); - openapiFields.add("isDeployed"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("deployedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("code"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Version - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Version.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Version is not found in the empty JSON" - + " string", - Version.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Version.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Version`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Version.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("author") != null && !jsonObj.get("author").isJsonNull()) - && !jsonObj.get("author").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `author` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("author").toString())); - } - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `code` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("code").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) - && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) - && !jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) - && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `deployedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("deployedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Version.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Version' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Version.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Version value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Version read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Version given an JSON string - * - * @param jsonString JSON string - * @return An instance of Version - * @throws IOException if the JSON string is invalid with respect to Version - */ - public static Version fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Version.class); - } - - /** - * Convert an instance of Version to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 8f5c4c0399341c4a6bc38eb0f0da18ba3611d280 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 16 Mar 2023 22:27:49 +0000 Subject: [PATCH 072/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d07fbe5. From 83f7f33fc63fb39e8ab26e6bff445604acdfc550 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 23 Mar 2023 09:30:44 +0000 Subject: [PATCH 073/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@11ae263. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 29 + .../segment/publicapi/api/FunctionsApi.java | 579 ++++++++++++++++++ .../models/GetFunctionVersion200Response.java | 197 ++++++ .../models/GetFunctionVersionAlphaOutput.java | 210 +++++++ .../publicapi/models/HandleWebhookInput.java | 322 ++++++++++ .../publicapi/models/HandleWebhookOutput.java | 235 +++++++ .../ListFunctionVersions200Response.java | 197 ++++++ .../models/ListVersionsAlphaOutput.java | 253 ++++++++ .../RestoreFunctionVersion200Response.java | 198 ++++++ .../RestoreFunctionVersionAlphaInput.java | 217 +++++++ .../RestoreFunctionVersionAlphaOutput.java | 211 +++++++ .../com/segment/publicapi/models/Version.java | 424 +++++++++++++ .../segment/publicapi/models/Version1.java | 424 +++++++++++++ 16 files changed, 3502 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/HandleWebhookInput.java create mode 100644 src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/Version.java create mode 100644 src/main/java/com/segment/publicapi/models/Version1.java diff --git a/README.md b/README.md index c346a507..6e3a5702 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.3 +Latest API and SDK version: 34.3.4 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.3 + 34.3.4 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.3" + implementation "com.segment.publicapi:segment-publicapi:34.3.4" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.3.jar` +* `target/segment-publicapi-34.3.4.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 56ef3499..9b02759a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.3 + 34.3.4 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9ea3ab25..9ef67343 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.3 (Java)"); + setUserAgent("Public API SDK 34.3.4 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index f007cf2b..26ab8bbc 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -614,6 +614,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetFunction200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFunctionVersion200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFunctionVersionAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response .CustomTypeAdapterFactory()); @@ -722,6 +728,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Group.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GroupSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.HandleWebhookInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.HandleWebhookOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Identify.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -802,6 +812,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionItemV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFunctionVersions200Response + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctions200Response .CustomTypeAdapterFactory()); @@ -943,6 +956,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUsersV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListVersionsAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListWarehouses200Response .CustomTypeAdapterFactory()); @@ -1155,6 +1171,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RequestErrorEnvelope.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ResourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RestoreFunctionVersion200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RestoreFunctionVersionAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RestoreFunctionVersionAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1402,6 +1427,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UsersPerSourceSnapshotV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Version.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Version1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Warehouse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index de9d1a7b..61562437 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -24,8 +24,12 @@ import com.segment.publicapi.models.CreateFunctionV1Input; import com.segment.publicapi.models.DeleteFunction200Response; import com.segment.publicapi.models.GetFunction200Response; +import com.segment.publicapi.models.GetFunctionVersion200Response; +import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RestoreFunctionVersion200Response; +import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; import java.lang.reflect.Type; @@ -766,6 +770,385 @@ public okhttp3.Call getFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getFunctionVersion + * + * @param functionId (required) + * @param versionId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getFunctionVersionCall( + String functionId, String versionId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/functions/{functionId}/versions/{versionId}" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())) + .replaceAll( + "\\{" + "versionId" + "\\}", + localVarApiClient.escapeString(versionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFunctionVersionValidateBeforeCall( + String functionId, String versionId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " getFunctionVersion(Async)"); + } + + // verify the required parameter 'versionId' is set + if (versionId == null) { + throw new ApiException( + "Missing the required parameter 'versionId' when calling" + + " getFunctionVersion(Async)"); + } + + okhttp3.Call localVarCall = getFunctionVersionCall(functionId, versionId, _callback); + return localVarCall; + } + + /** + * Get Function Version Gets a Function version. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param functionId (required) + * @param versionId (required) + * @return GetFunctionVersion200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetFunctionVersion200Response getFunctionVersion(String functionId, String versionId) + throws ApiException { + ApiResponse localVarResp = + getFunctionVersionWithHttpInfo(functionId, versionId); + return localVarResp.getData(); + } + + /** + * Get Function Version Gets a Function version. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param functionId (required) + * @param versionId (required) + * @return ApiResponse<GetFunctionVersion200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getFunctionVersionWithHttpInfo( + String functionId, String versionId) throws ApiException { + okhttp3.Call localVarCall = + getFunctionVersionValidateBeforeCall(functionId, versionId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Function Version (asynchronously) Gets a Function version. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Functions feature enabled. + * Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param versionId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getFunctionVersionAsync( + String functionId, + String versionId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getFunctionVersionValidateBeforeCall(functionId, versionId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listFunctionVersions + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsCall( + String functionId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/functions/{functionId}/versions" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFunctionVersionsValidateBeforeCall( + String functionId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " listFunctionVersions(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listFunctionVersions(Async)"); + } + + okhttp3.Call localVarCall = listFunctionVersionsCall(functionId, pagination, _callback); + return localVarCall; + } + + /** + * List Function Versions Lists versions for a Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @return ListFunctionVersions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListFunctionVersions200Response listFunctionVersions( + String functionId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listFunctionVersionsWithHttpInfo(functionId, pagination); + return localVarResp.getData(); + } + + /** + * List Function Versions Lists versions for a Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @return ApiResponse<ListFunctionVersions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listFunctionVersionsWithHttpInfo( + String functionId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Function Versions (asynchronously) Lists versions for a Functions in a Workspace. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsAsync( + String functionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for listFunctions * @@ -964,6 +1347,202 @@ public okhttp3.Call listFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for restoreFunctionVersion + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call restoreFunctionVersionCall( + String functionId, + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = restoreFunctionVersionAlphaInput; + + // create path and map variables + String localVarPath = + "/functions/{functionId}/versions" + .replaceAll( + "\\{" + "functionId" + "\\}", + localVarApiClient.escapeString(functionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call restoreFunctionVersionValidateBeforeCall( + String functionId, + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'functionId' is set + if (functionId == null) { + throw new ApiException( + "Missing the required parameter 'functionId' when calling" + + " restoreFunctionVersion(Async)"); + } + + // verify the required parameter 'restoreFunctionVersionAlphaInput' is set + if (restoreFunctionVersionAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'restoreFunctionVersionAlphaInput' when calling" + + " restoreFunctionVersion(Async)"); + } + + okhttp3.Call localVarCall = + restoreFunctionVersionCall(functionId, restoreFunctionVersionAlphaInput, _callback); + return localVarCall; + } + + /** + * Restore Function Version Restore an old Function version as a latest version. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @return RestoreFunctionVersion200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RestoreFunctionVersion200Response restoreFunctionVersion( + String functionId, RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput) + throws ApiException { + ApiResponse localVarResp = + restoreFunctionVersionWithHttpInfo(functionId, restoreFunctionVersionAlphaInput); + return localVarResp.getData(); + } + + /** + * Restore Function Version Restore an old Function version as a latest version. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @return ApiResponse<RestoreFunctionVersion200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse restoreFunctionVersionWithHttpInfo( + String functionId, RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + restoreFunctionVersionValidateBeforeCall( + functionId, restoreFunctionVersionAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Restore Function Version (asynchronously) Restore an old Function version as a latest + * version. • In order to successfully call this endpoint, the specified Workspace needs to have + * the Functions feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param functionId (required) + * @param restoreFunctionVersionAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call restoreFunctionVersionAsync( + String functionId, + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + restoreFunctionVersionValidateBeforeCall( + functionId, restoreFunctionVersionAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for updateFunction * diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java b/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java new file mode 100644 index 00000000..ed8f0f9a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetFunctionVersion200Response */ +public class GetFunctionVersion200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetFunctionVersionAlphaOutput data; + + public GetFunctionVersion200Response() {} + + public GetFunctionVersion200Response data(GetFunctionVersionAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetFunctionVersionAlphaOutput getData() { + return data; + } + + public void setData(GetFunctionVersionAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFunctionVersion200Response getFunctionVersion200Response = + (GetFunctionVersion200Response) o; + return Objects.equals(this.data, getFunctionVersion200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFunctionVersion200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetFunctionVersion200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetFunctionVersion200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFunctionVersion200Response is not" + + " found in the empty JSON string", + GetFunctionVersion200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetFunctionVersion200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFunctionVersion200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFunctionVersion200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFunctionVersion200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetFunctionVersion200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFunctionVersion200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFunctionVersion200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFunctionVersion200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFunctionVersion200Response + * @throws IOException if the JSON string is invalid with respect to + * GetFunctionVersion200Response + */ + public static GetFunctionVersion200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFunctionVersion200Response.class); + } + + /** + * Convert an instance of GetFunctionVersion200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java new file mode 100644 index 00000000..343881ca --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Get Function version output. */ +@ApiModel(description = "Get Function version output.") +public class GetFunctionVersionAlphaOutput { + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private Version version; + + public GetFunctionVersionAlphaOutput() {} + + public GetFunctionVersionAlphaOutput version(Version version) { + + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFunctionVersionAlphaOutput getFunctionVersionAlphaOutput = + (GetFunctionVersionAlphaOutput) o; + return Objects.equals(this.version, getFunctionVersionAlphaOutput.version); + } + + @Override + public int hashCode() { + return Objects.hash(version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFunctionVersionAlphaOutput {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GetFunctionVersionAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetFunctionVersionAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFunctionVersionAlphaOutput is not" + + " found in the empty JSON string", + GetFunctionVersionAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetFunctionVersionAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFunctionVersionAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetFunctionVersionAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFunctionVersionAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFunctionVersionAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetFunctionVersionAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFunctionVersionAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFunctionVersionAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFunctionVersionAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFunctionVersionAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetFunctionVersionAlphaOutput + */ + public static GetFunctionVersionAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFunctionVersionAlphaOutput.class); + } + + /** + * Convert an instance of GetFunctionVersionAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java b/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java new file mode 100644 index 00000000..b3d3119d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java @@ -0,0 +1,322 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Function webhook input. */ +@ApiModel(description = "Function webhook input.") +public class HandleWebhookInput { + public static final String SERIALIZED_NAME_W = "w"; + + @SerializedName(SERIALIZED_NAME_W) + private String w; + + public static final String SERIALIZED_NAME_N = "n"; + + @SerializedName(SERIALIZED_NAME_N) + private String n; + + public static final String SERIALIZED_NAME_T = "t"; + + @SerializedName(SERIALIZED_NAME_T) + private String t; + + public static final String SERIALIZED_NAME_S = "s"; + + @SerializedName(SERIALIZED_NAME_S) + private String s; + + public HandleWebhookInput() {} + + public HandleWebhookInput w(String w) { + + this.w = w; + return this; + } + + /** + * The Workspace id. + * + * @return w + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Workspace id.") + public String getW() { + return w; + } + + public void setW(String w) { + this.w = w; + } + + public HandleWebhookInput n(String n) { + + this.n = n; + return this; + } + + /** + * The webhook nonce. + * + * @return n + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The webhook nonce.") + public String getN() { + return n; + } + + public void setN(String n) { + this.n = n; + } + + public HandleWebhookInput t(String t) { + + this.t = t; + return this; + } + + /** + * The webhook timestamp. + * + * @return t + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The webhook timestamp.") + public String getT() { + return t; + } + + public void setT(String t) { + this.t = t; + } + + public HandleWebhookInput s(String s) { + + this.s = s; + return this; + } + + /** + * The webhook signature. + * + * @return s + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The webhook signature.") + public String getS() { + return s; + } + + public void setS(String s) { + this.s = s; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HandleWebhookInput handleWebhookInput = (HandleWebhookInput) o; + return Objects.equals(this.w, handleWebhookInput.w) + && Objects.equals(this.n, handleWebhookInput.n) + && Objects.equals(this.t, handleWebhookInput.t) + && Objects.equals(this.s, handleWebhookInput.s); + } + + @Override + public int hashCode() { + return Objects.hash(w, n, t, s); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HandleWebhookInput {\n"); + sb.append(" w: ").append(toIndentedString(w)).append("\n"); + sb.append(" n: ").append(toIndentedString(n)).append("\n"); + sb.append(" t: ").append(toIndentedString(t)).append("\n"); + sb.append(" s: ").append(toIndentedString(s)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("w"); + openapiFields.add("n"); + openapiFields.add("t"); + openapiFields.add("s"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("w"); + openapiRequiredFields.add("n"); + openapiRequiredFields.add("t"); + openapiRequiredFields.add("s"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HandleWebhookInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HandleWebhookInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in HandleWebhookInput is not found in the" + + " empty JSON string", + HandleWebhookInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HandleWebhookInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `HandleWebhookInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HandleWebhookInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("w").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `w` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("w").toString())); + } + if (!jsonObj.get("n").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `n` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("n").toString())); + } + if (!jsonObj.get("t").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `t` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("t").toString())); + } + if (!jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `s` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HandleWebhookInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HandleWebhookInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(HandleWebhookInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, HandleWebhookInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HandleWebhookInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of HandleWebhookInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of HandleWebhookInput + * @throws IOException if the JSON string is invalid with respect to HandleWebhookInput + */ + public static HandleWebhookInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HandleWebhookInput.class); + } + + /** + * Convert an instance of HandleWebhookInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java b/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java new file mode 100644 index 00000000..286b3a15 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java @@ -0,0 +1,235 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Function webhook output status. */ +@ApiModel(description = "Function webhook output status.") +public class HandleWebhookOutput { + public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode"; + + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private BigDecimal statusCode; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public HandleWebhookOutput() {} + + public HandleWebhookOutput statusCode(BigDecimal statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * The http status code. + * + * @return statusCode + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The http status code.") + public BigDecimal getStatusCode() { + return statusCode; + } + + public void setStatusCode(BigDecimal statusCode) { + this.statusCode = statusCode; + } + + public HandleWebhookOutput success(Boolean success) { + + this.success = success; + return this; + } + + /** + * The status of the operation. + * + * @return success + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public Boolean getSuccess() { + return success; + } + + public void setSuccess(Boolean success) { + this.success = success; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HandleWebhookOutput handleWebhookOutput = (HandleWebhookOutput) o; + return Objects.equals(this.statusCode, handleWebhookOutput.statusCode) + && Objects.equals(this.success, handleWebhookOutput.success); + } + + @Override + public int hashCode() { + return Objects.hash(statusCode, success); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HandleWebhookOutput {\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("statusCode"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("statusCode"); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HandleWebhookOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HandleWebhookOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in HandleWebhookOutput is not found in" + + " the empty JSON string", + HandleWebhookOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HandleWebhookOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `HandleWebhookOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HandleWebhookOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HandleWebhookOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HandleWebhookOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(HandleWebhookOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, HandleWebhookOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HandleWebhookOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of HandleWebhookOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of HandleWebhookOutput + * @throws IOException if the JSON string is invalid with respect to HandleWebhookOutput + */ + public static HandleWebhookOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HandleWebhookOutput.class); + } + + /** + * Convert an instance of HandleWebhookOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java new file mode 100644 index 00000000..ec1c8512 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListFunctionVersions200Response */ +public class ListFunctionVersions200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListVersionsAlphaOutput data; + + public ListFunctionVersions200Response() {} + + public ListFunctionVersions200Response data(ListVersionsAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListVersionsAlphaOutput getData() { + return data; + } + + public void setData(ListVersionsAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFunctionVersions200Response listFunctionVersions200Response = + (ListFunctionVersions200Response) o; + return Objects.equals(this.data, listFunctionVersions200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFunctionVersions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListFunctionVersions200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListFunctionVersions200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListFunctionVersions200Response is not" + + " found in the empty JSON string", + ListFunctionVersions200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListFunctionVersions200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListFunctionVersions200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFunctionVersions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFunctionVersions200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListFunctionVersions200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFunctionVersions200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFunctionVersions200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListFunctionVersions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFunctionVersions200Response + * @throws IOException if the JSON string is invalid with respect to + * ListFunctionVersions200Response + */ + public static ListFunctionVersions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFunctionVersions200Response.class); + } + + /** + * Convert an instance of ListFunctionVersions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java new file mode 100644 index 00000000..b2c270a2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java @@ -0,0 +1,253 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Lists Versions of a Function. */ +@ApiModel(description = "Lists Versions of a Function.") +public class ListVersionsAlphaOutput { + public static final String SERIALIZED_NAME_VERSIONS = "versions"; + + @SerializedName(SERIALIZED_NAME_VERSIONS) + private List versions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListVersionsAlphaOutput() {} + + public ListVersionsAlphaOutput versions(List versions) { + + this.versions = versions; + return this; + } + + public ListVersionsAlphaOutput addVersionsItem(Version versionsItem) { + this.versions.add(versionsItem); + return this; + } + + /** + * An array of Functions. + * + * @return versions + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An array of Functions.") + public List getVersions() { + return versions; + } + + public void setVersions(List versions) { + this.versions = versions; + } + + public ListVersionsAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListVersionsAlphaOutput listVersionsAlphaOutput = (ListVersionsAlphaOutput) o; + return Objects.equals(this.versions, listVersionsAlphaOutput.versions) + && Objects.equals(this.pagination, listVersionsAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(versions, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListVersionsAlphaOutput {\n"); + sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("versions"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("versions"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListVersionsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListVersionsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListVersionsAlphaOutput is not found" + + " in the empty JSON string", + ListVersionsAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListVersionsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListVersionsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListVersionsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("versions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `versions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("versions").toString())); + } + + JsonArray jsonArrayversions = jsonObj.getAsJsonArray("versions"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListVersionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListVersionsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListVersionsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListVersionsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListVersionsAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListVersionsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListVersionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to ListVersionsAlphaOutput + */ + public static ListVersionsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListVersionsAlphaOutput.class); + } + + /** + * Convert an instance of ListVersionsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java new file mode 100644 index 00000000..c18a4ca5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersion200Response.java @@ -0,0 +1,198 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RestoreFunctionVersion200Response */ +public class RestoreFunctionVersion200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RestoreFunctionVersionAlphaOutput data; + + public RestoreFunctionVersion200Response() {} + + public RestoreFunctionVersion200Response data(RestoreFunctionVersionAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RestoreFunctionVersionAlphaOutput getData() { + return data; + } + + public void setData(RestoreFunctionVersionAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreFunctionVersion200Response restoreFunctionVersion200Response = + (RestoreFunctionVersion200Response) o; + return Objects.equals(this.data, restoreFunctionVersion200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreFunctionVersion200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RestoreFunctionVersion200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RestoreFunctionVersion200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RestoreFunctionVersion200Response is" + + " not found in the empty JSON string", + RestoreFunctionVersion200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestoreFunctionVersion200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RestoreFunctionVersion200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreFunctionVersion200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreFunctionVersion200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RestoreFunctionVersion200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreFunctionVersion200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestoreFunctionVersion200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreFunctionVersion200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreFunctionVersion200Response + * @throws IOException if the JSON string is invalid with respect to + * RestoreFunctionVersion200Response + */ + public static RestoreFunctionVersion200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreFunctionVersion200Response.class); + } + + /** + * Convert an instance of RestoreFunctionVersion200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java new file mode 100644 index 00000000..248e0be1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaInput.java @@ -0,0 +1,217 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Restore a given Function version. */ +@ApiModel(description = "Restore a given Function version.") +public class RestoreFunctionVersionAlphaInput { + public static final String SERIALIZED_NAME_VERSION_ID = "versionId"; + + @SerializedName(SERIALIZED_NAME_VERSION_ID) + private String versionId; + + public RestoreFunctionVersionAlphaInput() {} + + public RestoreFunctionVersionAlphaInput versionId(String versionId) { + + this.versionId = versionId; + return this; + } + + /** + * An identifier for this version. + * + * @return versionId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An identifier for this version.") + public String getVersionId() { + return versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput = + (RestoreFunctionVersionAlphaInput) o; + return Objects.equals(this.versionId, restoreFunctionVersionAlphaInput.versionId); + } + + @Override + public int hashCode() { + return Objects.hash(versionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreFunctionVersionAlphaInput {\n"); + sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("versionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("versionId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RestoreFunctionVersionAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RestoreFunctionVersionAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RestoreFunctionVersionAlphaInput is" + + " not found in the empty JSON string", + RestoreFunctionVersionAlphaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestoreFunctionVersionAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RestoreFunctionVersionAlphaInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestoreFunctionVersionAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("versionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `versionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("versionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreFunctionVersionAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreFunctionVersionAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RestoreFunctionVersionAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreFunctionVersionAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestoreFunctionVersionAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreFunctionVersionAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreFunctionVersionAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * RestoreFunctionVersionAlphaInput + */ + public static RestoreFunctionVersionAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreFunctionVersionAlphaInput.class); + } + + /** + * Convert an instance of RestoreFunctionVersionAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java new file mode 100644 index 00000000..c71ed747 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RestoreFunctionVersionAlphaOutput.java @@ -0,0 +1,211 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Restore version output. */ +@ApiModel(description = "Restore version output.") +public class RestoreFunctionVersionAlphaOutput { + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private Version1 version; + + public RestoreFunctionVersionAlphaOutput() {} + + public RestoreFunctionVersionAlphaOutput version(Version1 version) { + + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Version1 getVersion() { + return version; + } + + public void setVersion(Version1 version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreFunctionVersionAlphaOutput restoreFunctionVersionAlphaOutput = + (RestoreFunctionVersionAlphaOutput) o; + return Objects.equals(this.version, restoreFunctionVersionAlphaOutput.version); + } + + @Override + public int hashCode() { + return Objects.hash(version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreFunctionVersionAlphaOutput {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RestoreFunctionVersionAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RestoreFunctionVersionAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RestoreFunctionVersionAlphaOutput is" + + " not found in the empty JSON string", + RestoreFunctionVersionAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestoreFunctionVersionAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RestoreFunctionVersionAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestoreFunctionVersionAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestoreFunctionVersionAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreFunctionVersionAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RestoreFunctionVersionAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RestoreFunctionVersionAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestoreFunctionVersionAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreFunctionVersionAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreFunctionVersionAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RestoreFunctionVersionAlphaOutput + */ + public static RestoreFunctionVersionAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreFunctionVersionAlphaOutput.class); + } + + /** + * Convert an instance of RestoreFunctionVersionAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Version.java b/src/main/java/com/segment/publicapi/models/Version.java new file mode 100644 index 00000000..d09c509b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Version.java @@ -0,0 +1,424 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Functions version. */ +@ApiModel(description = "Functions version.") +public class Version { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_AUTHOR = "author"; + + @SerializedName(SERIALIZED_NAME_AUTHOR) + private String author; + + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_IS_DEPLOYED = "isDeployed"; + + @SerializedName(SERIALIZED_NAME_IS_DEPLOYED) + private Boolean isDeployed; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; + + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; + + public Version() {} + + public Version id(String id) { + + this.id = id; + return this; + } + + /** + * An identifier for this version. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An identifier for this version.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Version author(String author) { + + this.author = author; + return this; + } + + /** + * Author of this version. + * + * @return author + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Author of this version.") + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Version code(String code) { + + this.code = code; + return this; + } + + /** + * Source code of this version. + * + * @return code + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Source code of this version.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Version isDeployed(Boolean isDeployed) { + + this.isDeployed = isDeployed; + return this; + } + + /** + * The deployed status of this version. + * + * @return isDeployed + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The deployed status of this version.") + public Boolean getIsDeployed() { + return isDeployed; + } + + public void setIsDeployed(Boolean isDeployed) { + this.isDeployed = isDeployed; + } + + public Version createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The time of this Version's creation. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Version updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The time of this Version's latest update. + * + * @return updatedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's latest update.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public Version deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + + /** + * The time of this Version's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's last deployment.") + public String getDeployedAt() { + return deployedAt; + } + + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Version version = (Version) o; + return Objects.equals(this.id, version.id) + && Objects.equals(this.author, version.author) + && Objects.equals(this.code, version.code) + && Objects.equals(this.isDeployed, version.isDeployed) + && Objects.equals(this.createdAt, version.createdAt) + && Objects.equals(this.updatedAt, version.updatedAt) + && Objects.equals(this.deployedAt, version.deployedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, author, code, isDeployed, createdAt, updatedAt, deployedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Version {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" isDeployed: ").append(toIndentedString(isDeployed)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("author"); + openapiFields.add("code"); + openapiFields.add("isDeployed"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("deployedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("code"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Version + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Version.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Version is not found in the empty JSON" + + " string", + Version.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Version.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Version`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Version.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("author") != null && !jsonObj.get("author").isJsonNull()) + && !jsonObj.get("author").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `author` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("author").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Version.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Version' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Version.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Version value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Version read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Version given an JSON string + * + * @param jsonString JSON string + * @return An instance of Version + * @throws IOException if the JSON string is invalid with respect to Version + */ + public static Version fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Version.class); + } + + /** + * Convert an instance of Version to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Version1.java b/src/main/java/com/segment/publicapi/models/Version1.java new file mode 100644 index 00000000..92bbe293 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Version1.java @@ -0,0 +1,424 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Restored version. */ +@ApiModel(description = "Restored version.") +public class Version1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_AUTHOR = "author"; + + @SerializedName(SERIALIZED_NAME_AUTHOR) + private String author; + + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_IS_DEPLOYED = "isDeployed"; + + @SerializedName(SERIALIZED_NAME_IS_DEPLOYED) + private Boolean isDeployed; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; + + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; + + public Version1() {} + + public Version1 id(String id) { + + this.id = id; + return this; + } + + /** + * An identifier for this version. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "An identifier for this version.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Version1 author(String author) { + + this.author = author; + return this; + } + + /** + * Author of this version. + * + * @return author + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Author of this version.") + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Version1 code(String code) { + + this.code = code; + return this; + } + + /** + * Source code of this version. + * + * @return code + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Source code of this version.") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Version1 isDeployed(Boolean isDeployed) { + + this.isDeployed = isDeployed; + return this; + } + + /** + * The deployed status of this version. + * + * @return isDeployed + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The deployed status of this version.") + public Boolean getIsDeployed() { + return isDeployed; + } + + public void setIsDeployed(Boolean isDeployed) { + this.isDeployed = isDeployed; + } + + public Version1 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The time of this Version's creation. + * + * @return createdAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Version1 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The time of this Version's latest update. + * + * @return updatedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's latest update.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public Version1 deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + + /** + * The time of this Version's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The time of this Version's last deployment.") + public String getDeployedAt() { + return deployedAt; + } + + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Version1 version1 = (Version1) o; + return Objects.equals(this.id, version1.id) + && Objects.equals(this.author, version1.author) + && Objects.equals(this.code, version1.code) + && Objects.equals(this.isDeployed, version1.isDeployed) + && Objects.equals(this.createdAt, version1.createdAt) + && Objects.equals(this.updatedAt, version1.updatedAt) + && Objects.equals(this.deployedAt, version1.deployedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, author, code, isDeployed, createdAt, updatedAt, deployedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Version1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" isDeployed: ").append(toIndentedString(isDeployed)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("author"); + openapiFields.add("code"); + openapiFields.add("isDeployed"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("deployedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("code"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Version1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Version1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Version1 is not found in the empty" + + " JSON string", + Version1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Version1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Version1`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Version1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("author") != null && !jsonObj.get("author").isJsonNull()) + && !jsonObj.get("author").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `author` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("author").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Version1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Version1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Version1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Version1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Version1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Version1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Version1 + * @throws IOException if the JSON string is invalid with respect to Version1 + */ + public static Version1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Version1.class); + } + + /** + * Convert an instance of Version1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 50ef37a9b858cfc56b293dd4675a5c92c0a930cf Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 3 Apr 2023 19:01:34 +0000 Subject: [PATCH 074/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@bf66df6. --- src/main/java/com/segment/publicapi/JSON.java | 6 +- .../segment/publicapi/api/FunctionsApi.java | 6 +- .../ListFunctionVersions200Response.java | 8 +-- ...a => ListFunctionVersionsAlphaOutput.java} | 65 ++++++++++--------- 4 files changed, 45 insertions(+), 40 deletions(-) rename src/main/java/com/segment/publicapi/models/{ListVersionsAlphaOutput.java => ListFunctionVersionsAlphaOutput.java} (75%) diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 26ab8bbc..803436af 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -815,6 +815,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionVersions200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFunctionVersionsAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctions200Response .CustomTypeAdapterFactory()); @@ -956,9 +959,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListUsersV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListVersionsAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListWarehouses200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 61562437..77b5f3ef 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -1065,7 +1065,7 @@ private okhttp3.Call listFunctionVersionsValidateBeforeCall( } /** - * List Function Versions Lists versions for a Functions in a Workspace. • In order to + * List Function Versions Lists versions for a Function in a Workspace. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1091,7 +1091,7 @@ public ListFunctionVersions200Response listFunctionVersions( } /** - * List Function Versions Lists versions for a Functions in a Workspace. • In order to + * List Function Versions Lists versions for a Function in a Workspace. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1118,7 +1118,7 @@ public ApiResponse listFunctionVersionsWithHttp } /** - * List Function Versions (asynchronously) Lists versions for a Functions in a Workspace. • In + * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In * order to successfully call this endpoint, the specified Workspace needs to have the Functions * feature enabled. Please reach out to your customer success manager for more information. * diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java index ec1c8512..2c86bf3c 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionVersions200Response.java @@ -34,11 +34,11 @@ public class ListFunctionVersions200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListVersionsAlphaOutput data; + private ListFunctionVersionsAlphaOutput data; public ListFunctionVersions200Response() {} - public ListFunctionVersions200Response data(ListVersionsAlphaOutput data) { + public ListFunctionVersions200Response data(ListFunctionVersionsAlphaOutput data) { this.data = data; return this; @@ -51,11 +51,11 @@ public ListFunctionVersions200Response data(ListVersionsAlphaOutput data) { */ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ListVersionsAlphaOutput getData() { + public ListFunctionVersionsAlphaOutput getData() { return data; } - public void setData(ListVersionsAlphaOutput data) { + public void setData(ListFunctionVersionsAlphaOutput data) { this.data = data; } diff --git a/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListFunctionVersionsAlphaOutput.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java rename to src/main/java/com/segment/publicapi/models/ListFunctionVersionsAlphaOutput.java index b2c270a2..b398dd9c 100644 --- a/src/main/java/com/segment/publicapi/models/ListVersionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionVersionsAlphaOutput.java @@ -35,7 +35,7 @@ /** Lists Versions of a Function. */ @ApiModel(description = "Lists Versions of a Function.") -public class ListVersionsAlphaOutput { +public class ListFunctionVersionsAlphaOutput { public static final String SERIALIZED_NAME_VERSIONS = "versions"; @SerializedName(SERIALIZED_NAME_VERSIONS) @@ -46,15 +46,15 @@ public class ListVersionsAlphaOutput { @SerializedName(SERIALIZED_NAME_PAGINATION) private Pagination pagination; - public ListVersionsAlphaOutput() {} + public ListFunctionVersionsAlphaOutput() {} - public ListVersionsAlphaOutput versions(List versions) { + public ListFunctionVersionsAlphaOutput versions(List versions) { this.versions = versions; return this; } - public ListVersionsAlphaOutput addVersionsItem(Version versionsItem) { + public ListFunctionVersionsAlphaOutput addVersionsItem(Version versionsItem) { this.versions.add(versionsItem); return this; } @@ -74,7 +74,7 @@ public void setVersions(List versions) { this.versions = versions; } - public ListVersionsAlphaOutput pagination(Pagination pagination) { + public ListFunctionVersionsAlphaOutput pagination(Pagination pagination) { this.pagination = pagination; return this; @@ -103,9 +103,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ListVersionsAlphaOutput listVersionsAlphaOutput = (ListVersionsAlphaOutput) o; - return Objects.equals(this.versions, listVersionsAlphaOutput.versions) - && Objects.equals(this.pagination, listVersionsAlphaOutput.pagination); + ListFunctionVersionsAlphaOutput listFunctionVersionsAlphaOutput = + (ListFunctionVersionsAlphaOutput) o; + return Objects.equals(this.versions, listFunctionVersionsAlphaOutput.versions) + && Objects.equals(this.pagination, listFunctionVersionsAlphaOutput.pagination); } @Override @@ -116,7 +117,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ListVersionsAlphaOutput {\n"); + sb.append("class ListFunctionVersionsAlphaOutput {\n"); sb.append(" versions: ").append(toIndentedString(versions)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -153,34 +154,35 @@ private String toIndentedString(Object o) { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ListVersionsAlphaOutput + * @throws IOException if the JSON Object is invalid with respect to + * ListFunctionVersionsAlphaOutput */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (!ListVersionsAlphaOutput.openapiRequiredFields + if (!ListFunctionVersionsAlphaOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON object is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ListVersionsAlphaOutput is not found" - + " in the empty JSON string", - ListVersionsAlphaOutput.openapiRequiredFields.toString())); + "The required field(s) %s in ListFunctionVersionsAlphaOutput is not" + + " found in the empty JSON string", + ListFunctionVersionsAlphaOutput.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!ListVersionsAlphaOutput.openapiFields.contains(entry.getKey())) { + if (!ListFunctionVersionsAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ListVersionsAlphaOutput` properties. JSON: %s", + + " `ListFunctionVersionsAlphaOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListVersionsAlphaOutput.openapiRequiredFields) { + for (String requiredField : ListFunctionVersionsAlphaOutput.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -204,25 +206,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListVersionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListVersionsAlphaOutput' and its + if (!ListFunctionVersionsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFunctionVersionsAlphaOutput' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListVersionsAlphaOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListFunctionVersionsAlphaOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ListVersionsAlphaOutput value) + public void write(JsonWriter out, ListFunctionVersionsAlphaOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ListVersionsAlphaOutput read(JsonReader in) throws IOException { + public ListFunctionVersionsAlphaOutput read(JsonReader in) + throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -232,18 +236,19 @@ public ListVersionsAlphaOutput read(JsonReader in) throws IOException { } /** - * Create an instance of ListVersionsAlphaOutput given an JSON string + * Create an instance of ListFunctionVersionsAlphaOutput given an JSON string * * @param jsonString JSON string - * @return An instance of ListVersionsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to ListVersionsAlphaOutput + * @return An instance of ListFunctionVersionsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListFunctionVersionsAlphaOutput */ - public static ListVersionsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListVersionsAlphaOutput.class); + public static ListFunctionVersionsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFunctionVersionsAlphaOutput.class); } /** - * Convert an instance of ListVersionsAlphaOutput to an JSON string + * Convert an instance of ListFunctionVersionsAlphaOutput to an JSON string * * @return JSON string */ From 3cf2f8f4a1ee44ff4c96d5e199a052fc0ba711b2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 18:36:28 +0000 Subject: [PATCH 075/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d766824. From b7d248a3d35893f41d13a8db89fe01142a10f680 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 18:43:17 +0000 Subject: [PATCH 076/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6f7ab56. From 9f6a11253e8157f0ed66ed2c4758a220180624e6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 18:53:47 +0000 Subject: [PATCH 077/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@81609d3. From 187227036761b36c807bdbfc80ec3bd1aedda6cd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 20:29:47 +0000 Subject: [PATCH 078/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e68556f. From 4823bddeef94519c4426d9ca2dcb9235559c057d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 21:11:07 +0000 Subject: [PATCH 079/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e68556f. From 54b8d7b637afcec35b95be445399a070d7b03f69 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 21:56:16 +0000 Subject: [PATCH 080/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b6beab3. From 2ed61245709a7d36b3e5514a331c18539b507a58 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Apr 2023 22:59:52 +0000 Subject: [PATCH 081/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@1c83fa1. From c198c1e7fbac81043c86cf373684ab6784c1d004 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 6 Apr 2023 06:46:54 +0000 Subject: [PATCH 082/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6fb606b. From d744456b6afef949f18b22d90cbae2277c58ed4f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 11 Apr 2023 15:51:58 +0000 Subject: [PATCH 083/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@60da9c8. From a001c3780e4304a3ffe1e73612dccd08c077f68d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 12 Apr 2023 18:06:58 +0000 Subject: [PATCH 084/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c11ff28f. From afe505a751d85daf23fbe6d65c72099d9ee2683c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 18 Apr 2023 08:06:59 +0000 Subject: [PATCH 085/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@98f9525. --- .../publicapi/models/FunctionSettingV1.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index 68bd50c8..8cc0c7d4 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -47,7 +47,7 @@ public class FunctionSettingV1 { @SerializedName(SERIALIZED_NAME_DESCRIPTION) private String description; - /** The Function type. */ + /** The type of this Function Setting. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { ARRAY("ARRAY"), @@ -121,12 +121,12 @@ public FunctionSettingV1 name(String name) { } /** - * The name of this Function. + * The name of this Function Setting. * * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this Function.") + @ApiModelProperty(required = true, value = "The name of this Function Setting.") public String getName() { return name; } @@ -142,12 +142,12 @@ public FunctionSettingV1 label(String label) { } /** - * The label for this Function. + * The label for this Function Setting. * * @return label */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The label for this Function.") + @ApiModelProperty(required = true, value = "The label for this Function Setting.") public String getLabel() { return label; } @@ -163,12 +163,12 @@ public FunctionSettingV1 description(String description) { } /** - * A description of this Function. + * A description of this Function Setting. * * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A description of this Function.") + @ApiModelProperty(required = true, value = "A description of this Function Setting.") public String getDescription() { return description; } @@ -184,12 +184,12 @@ public FunctionSettingV1 type(TypeEnum type) { } /** - * The Function type. + * The type of this Function Setting. * * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Function type.") + @ApiModelProperty(required = true, value = "The type of this Function Setting.") public TypeEnum getType() { return type; } @@ -205,12 +205,12 @@ public FunctionSettingV1 required(Boolean required) { } /** - * Whether this Function is required. + * Whether this Function Setting is required. * * @return required */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this Function is required.") + @ApiModelProperty(required = true, value = "Whether this Function Setting is required.") public Boolean getRequired() { return required; } @@ -226,14 +226,14 @@ public FunctionSettingV1 sensitive(Boolean sensitive) { } /** - * Whether this Function contains sensitive information. + * Whether this Function Setting contains sensitive information. * * @return sensitive */ @javax.annotation.Nonnull @ApiModelProperty( required = true, - value = "Whether this Function contains sensitive information.") + value = "Whether this Function Setting contains sensitive information.") public Boolean getSensitive() { return sensitive; } From 62c56e32659ee402fcdf6b299dcc58314d1ef487 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 24 Apr 2023 16:21:46 +0000 Subject: [PATCH 086/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@34b5369. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 9 + .../api/ProfilesSelectiveSyncApi.java | 297 +++++++++++++ ...SyncsFromWarehouseAndSpace200Response.java | 212 +++++++++ ...SyncsFromWarehouseAndSpaceAlphaOutput.java | 284 ++++++++++++ .../SpaceWarehouseSelectiveSyncItemAlpha.java | 412 ++++++++++++++++++ 8 files changed, 1220 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java create mode 100644 src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java diff --git a/README.md b/README.md index 6e3a5702..de87042f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.4 +Latest API and SDK version: 34.3.5 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.4 + 34.3.5 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.4" + implementation "com.segment.publicapi:segment-publicapi:34.3.5" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.4.jar` +* `target/segment-publicapi-34.3.5.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 9b02759a..5fbd0de8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.4 + 34.3.5 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9ef67343..530091e4 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.4 (Java)"); + setUserAgent("Public API SDK 34.3.5 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 803436af..cb3116ba 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -881,6 +881,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSourceV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListSources200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1232,6 +1238,9 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.SourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Space.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java new file mode 100644 index 00000000..032ec5bb --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java @@ -0,0 +1,297 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; +import com.segment.publicapi.models.PaginationInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProfilesSelectiveSyncApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ProfilesSelectiveSyncApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProfilesSelectiveSyncApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for listSelectiveSyncsFromWarehouseAndSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceCall( + spaceId, warehouseId, pagination, _callback); + return localVarCall; + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ListSelectiveSyncsFromWarehouseAndSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListSelectiveSyncsFromWarehouseAndSpace200Response + listSelectiveSyncsFromWarehouseAndSpace( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + spaceId, warehouseId, pagination); + return localVarResp.getData(); + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space + * Warehouse connection, including Sources, Collections, and Properties. • When called, this + * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpace200Response.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpace200Response.java new file mode 100644 index 00000000..d227277d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpace200Response.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListSelectiveSyncsFromWarehouseAndSpace200Response */ +public class ListSelectiveSyncsFromWarehouseAndSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput data; + + public ListSelectiveSyncsFromWarehouseAndSpace200Response() {} + + public ListSelectiveSyncsFromWarehouseAndSpace200Response data( + ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput getData() { + return data; + } + + public void setData(ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSelectiveSyncsFromWarehouseAndSpace200Response + listSelectiveSyncsFromWarehouseAndSpace200Response = + (ListSelectiveSyncsFromWarehouseAndSpace200Response) o; + return Objects.equals(this.data, listSelectiveSyncsFromWarehouseAndSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSelectiveSyncsFromWarehouseAndSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListSelectiveSyncsFromWarehouseAndSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListSelectiveSyncsFromWarehouseAndSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListSelectiveSyncsFromWarehouseAndSpace200Response is not" + + " found in the empty JSON string", + ListSelectiveSyncsFromWarehouseAndSpace200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListSelectiveSyncsFromWarehouseAndSpace200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListSelectiveSyncsFromWarehouseAndSpace200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListSelectiveSyncsFromWarehouseAndSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListSelectiveSyncsFromWarehouseAndSpace200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListSelectiveSyncsFromWarehouseAndSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListSelectiveSyncsFromWarehouseAndSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListSelectiveSyncsFromWarehouseAndSpace200Response read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListSelectiveSyncsFromWarehouseAndSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListSelectiveSyncsFromWarehouseAndSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * ListSelectiveSyncsFromWarehouseAndSpace200Response + */ + public static ListSelectiveSyncsFromWarehouseAndSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListSelectiveSyncsFromWarehouseAndSpace200Response.class); + } + + /** + * Convert an instance of ListSelectiveSyncsFromWarehouseAndSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java new file mode 100644 index 00000000..d3e0128c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java @@ -0,0 +1,284 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Results containing the Selective Sync configuration for a Space Warehouse Connection. */ +@ApiModel( + description = + "Results containing the Selective Sync configuration for a Space Warehouse" + + " Connection.") +public class ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput { + public static final String SERIALIZED_NAME_ITEMS = "items"; + + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput() {} + + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput items( + List items) { + + this.items = items; + return this; + } + + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput addItemsItem( + SpaceWarehouseSelectiveSyncItemAlpha itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * Represents a list of Source, collection, and properties synced to the Warehouse. + * + * @return items + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "Represents a list of Source, collection, and properties synced to the" + + " Warehouse.") + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } + + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput + listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput = + (ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput) o; + return Objects.equals(this.items, listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.items) + && Objects.equals( + this.pagination, + listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(items, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("items"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("items"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput is not" + + " found in the empty JSON string", + ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `items` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput + */ + public static ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.class); + } + + /** + * Convert an instance of ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java new file mode 100644 index 00000000..fdd0d7fa --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java @@ -0,0 +1,412 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** + * Represents an entry in the Space Warehouse Selective Sync schema for a Warehouse and Space pair. + */ +@ApiModel( + description = + "Represents an entry in the Space Warehouse Selective Sync schema for a Warehouse" + + " and Space pair.") +public class SpaceWarehouseSelectiveSyncItemAlpha { + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_COLLECTION = "collection"; + + @SerializedName(SERIALIZED_NAME_COLLECTION) + private String collection; + + public static final String SERIALIZED_NAME_WAREHOUSE_ID = "warehouseId"; + + @SerializedName(SERIALIZED_NAME_WAREHOUSE_ID) + private String warehouseId; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_PROPERTIES = "properties"; + + @SerializedName(SERIALIZED_NAME_PROPERTIES) + private Map properties = new HashMap<>(); + + public SpaceWarehouseSelectiveSyncItemAlpha() {} + + public SpaceWarehouseSelectiveSyncItemAlpha spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * The space id attached to this Warehouse. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The space id attached to this Warehouse.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public SpaceWarehouseSelectiveSyncItemAlpha collection(String collection) { + + this.collection = collection; + return this; + } + + /** + * The collection within the Source. + * + * @return collection + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The collection within the Source.") + public String getCollection() { + return collection; + } + + public void setCollection(String collection) { + this.collection = collection; + } + + public SpaceWarehouseSelectiveSyncItemAlpha warehouseId(String warehouseId) { + + this.warehouseId = warehouseId; + return this; + } + + /** + * The id of the Warehouse this sync belongs to. + * + * @return warehouseId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The id of the Warehouse this sync belongs to.") + public String getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(String warehouseId) { + this.warehouseId = warehouseId; + } + + public SpaceWarehouseSelectiveSyncItemAlpha source(String source) { + + this.source = source; + return this; + } + + /** + * The Source of the collection in this Space Warehouse. + * + * @return source + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Source of the collection in this Space Warehouse.") + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public SpaceWarehouseSelectiveSyncItemAlpha enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * The Enabled flag ok telling whether the Collection is enabled or not. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Enabled flag ok telling whether the Collection is enabled or not.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public SpaceWarehouseSelectiveSyncItemAlpha properties(Map properties) { + + this.properties = properties; + return this; + } + + public SpaceWarehouseSelectiveSyncItemAlpha putPropertiesItem( + String key, Object propertiesItem) { + this.properties.put(key, propertiesItem); + return this; + } + + /** + * A map that contains the properties within the collection to which the Warehouse should sync. + * + * @return properties + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "A map that contains the properties within the collection to which the" + + " Warehouse should sync.") + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpaceWarehouseSelectiveSyncItemAlpha spaceWarehouseSelectiveSyncItemAlpha = + (SpaceWarehouseSelectiveSyncItemAlpha) o; + return Objects.equals(this.spaceId, spaceWarehouseSelectiveSyncItemAlpha.spaceId) + && Objects.equals(this.collection, spaceWarehouseSelectiveSyncItemAlpha.collection) + && Objects.equals( + this.warehouseId, spaceWarehouseSelectiveSyncItemAlpha.warehouseId) + && Objects.equals(this.source, spaceWarehouseSelectiveSyncItemAlpha.source) + && Objects.equals(this.enabled, spaceWarehouseSelectiveSyncItemAlpha.enabled) + && Objects.equals(this.properties, spaceWarehouseSelectiveSyncItemAlpha.properties); + } + + @Override + public int hashCode() { + return Objects.hash(spaceId, collection, warehouseId, source, enabled, properties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpaceWarehouseSelectiveSyncItemAlpha {\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); + sb.append(" warehouseId: ").append(toIndentedString(warehouseId)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("spaceId"); + openapiFields.add("collection"); + openapiFields.add("warehouseId"); + openapiFields.add("source"); + openapiFields.add("enabled"); + openapiFields.add("properties"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("collection"); + openapiRequiredFields.add("warehouseId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("properties"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * SpaceWarehouseSelectiveSyncItemAlpha + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SpaceWarehouseSelectiveSyncItemAlpha.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SpaceWarehouseSelectiveSyncItemAlpha" + + " is not found in the empty JSON string", + SpaceWarehouseSelectiveSyncItemAlpha.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpaceWarehouseSelectiveSyncItemAlpha.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SpaceWarehouseSelectiveSyncItemAlpha` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SpaceWarehouseSelectiveSyncItemAlpha.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("collection").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `collection` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("collection").toString())); + } + if (!jsonObj.get("warehouseId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `warehouseId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("warehouseId").toString())); + } + if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) + && !jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `source` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("source").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpaceWarehouseSelectiveSyncItemAlpha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpaceWarehouseSelectiveSyncItemAlpha' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SpaceWarehouseSelectiveSyncItemAlpha.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, SpaceWarehouseSelectiveSyncItemAlpha value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpaceWarehouseSelectiveSyncItemAlpha read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SpaceWarehouseSelectiveSyncItemAlpha given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpaceWarehouseSelectiveSyncItemAlpha + * @throws IOException if the JSON string is invalid with respect to + * SpaceWarehouseSelectiveSyncItemAlpha + */ + public static SpaceWarehouseSelectiveSyncItemAlpha fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, SpaceWarehouseSelectiveSyncItemAlpha.class); + } + + /** + * Convert an instance of SpaceWarehouseSelectiveSyncItemAlpha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From a819437918f64ccaa9d1bce180082b88301dc9d4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 24 Apr 2023 16:30:26 +0000 Subject: [PATCH 087/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d8f583a. --- .../api/ProfilesSelectiveSyncApi.java | 297 ------------------ .../publicapi/api/SelectiveSyncApi.java | 240 ++++++++++++++ 2 files changed, 240 insertions(+), 297 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java deleted file mode 100644 index 032ec5bb..00000000 --- a/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; -import com.segment.publicapi.models.PaginationInput; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ProfilesSelectiveSyncApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ProfilesSelectiveSyncApi() { - this(Configuration.getDefaultApiClient()); - } - - public ProfilesSelectiveSyncApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for listSelectiveSyncsFromWarehouseAndSpace - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", - localVarApiClient.escapeString(warehouseId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - // verify the required parameter 'warehouseId' is set - if (warehouseId == null) { - throw new ApiException( - "Missing the required parameter 'warehouseId' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - // verify the required parameter 'pagination' is set - if (pagination == null) { - throw new ApiException( - "Missing the required parameter 'pagination' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceCall( - spaceId, warehouseId, pagination, _callback); - return localVarCall; - } - - /** - * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @return ListSelectiveSyncsFromWarehouseAndSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListSelectiveSyncsFromWarehouseAndSpace200Response - listSelectiveSyncsFromWarehouseAndSpace( - String spaceId, String warehouseId, PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( - spaceId, warehouseId, pagination); - return localVarResp.getData(); - } - - /** - * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( - String spaceId, String warehouseId, PaginationInput pagination) - throws ApiException { - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - spaceId, warehouseId, pagination, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space - * Warehouse connection, including Sources, Collections, and Properties. • When called, this - * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the - * [audit trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - spaceId, warehouseId, pagination, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 7b7ee5b6..c820e282 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -21,6 +21,7 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouse200Response; import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSource200Response; +import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; import com.segment.publicapi.models.ListSyncsFromWarehouse200Response; import com.segment.publicapi.models.ListSyncsFromWarehouseAndSource200Response; import com.segment.publicapi.models.PaginationInput; @@ -489,6 +490,245 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for listSelectiveSyncsFromWarehouseAndSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceCall( + spaceId, warehouseId, pagination, _callback); + return localVarCall; + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 2 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ListSelectiveSyncsFromWarehouseAndSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListSelectiveSyncsFromWarehouseAndSpace200Response + listSelectiveSyncsFromWarehouseAndSpace( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + spaceId, warehouseId, pagination); + return localVarResp.getData(); + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 2 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space + * Warehouse connection, including Sources, Collections, and Properties. • When called, this + * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 2 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for listSyncsFromWarehouse * From 550cc54aca75ba348c7511518678d1c2c58ba412 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 24 Apr 2023 16:46:00 +0000 Subject: [PATCH 088/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@806f81f. --- .../api/ProfilesSelectiveSyncApi.java | 297 ++++++++++++++++++ .../publicapi/api/SelectiveSyncApi.java | 240 -------------- 2 files changed, 297 insertions(+), 240 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java new file mode 100644 index 00000000..032ec5bb --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java @@ -0,0 +1,297 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; +import com.segment.publicapi.models.PaginationInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProfilesSelectiveSyncApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ProfilesSelectiveSyncApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProfilesSelectiveSyncApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for listSelectiveSyncsFromWarehouseAndSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceCall( + spaceId, warehouseId, pagination, _callback); + return localVarCall; + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ListSelectiveSyncsFromWarehouseAndSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListSelectiveSyncsFromWarehouseAndSpace200Response + listSelectiveSyncsFromWarehouseAndSpace( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + spaceId, warehouseId, pagination); + return localVarResp.getData(); + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space + * Warehouse connection, including Sources, Collections, and Properties. • When called, this + * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index c820e282..7b7ee5b6 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -21,7 +21,6 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouse200Response; import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSource200Response; -import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; import com.segment.publicapi.models.ListSyncsFromWarehouse200Response; import com.segment.publicapi.models.ListSyncsFromWarehouseAndSource200Response; import com.segment.publicapi.models.PaginationInput; @@ -490,245 +489,6 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for listSelectiveSyncsFromWarehouseAndSpace - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", - localVarApiClient.escapeString(warehouseId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - // verify the required parameter 'warehouseId' is set - if (warehouseId == null) { - throw new ApiException( - "Missing the required parameter 'warehouseId' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - // verify the required parameter 'pagination' is set - if (pagination == null) { - throw new ApiException( - "Missing the required parameter 'pagination' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceCall( - spaceId, warehouseId, pagination, _callback); - return localVarCall; - } - - /** - * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 2 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @return ListSelectiveSyncsFromWarehouseAndSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListSelectiveSyncsFromWarehouseAndSpace200Response - listSelectiveSyncsFromWarehouseAndSpace( - String spaceId, String warehouseId, PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( - spaceId, warehouseId, pagination); - return localVarResp.getData(); - } - - /** - * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 2 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( - String spaceId, String warehouseId, PaginationInput pagination) - throws ApiException { - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - spaceId, warehouseId, pagination, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space - * Warehouse connection, including Sources, Collections, and Properties. • When called, this - * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the - * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 2 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - spaceId, warehouseId, pagination, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for listSyncsFromWarehouse * From 68b626c1308ffa35bc83c8ab57184b40ef22fc5c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 24 Apr 2023 18:05:41 +0000 Subject: [PATCH 089/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3093eb6. --- .../api/ProfilesSelectiveSyncApi.java | 297 ------------------ .../publicapi/api/ProfilesSyncApi.java | 231 ++++++++++++++ 2 files changed, 231 insertions(+), 297 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java deleted file mode 100644 index 032ec5bb..00000000 --- a/src/main/java/com/segment/publicapi/api/ProfilesSelectiveSyncApi.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; -import com.segment.publicapi.models.PaginationInput; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ProfilesSelectiveSyncApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ProfilesSelectiveSyncApi() { - this(Configuration.getDefaultApiClient()); - } - - public ProfilesSelectiveSyncApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for listSelectiveSyncsFromWarehouseAndSpace - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", - localVarApiClient.escapeString(warehouseId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - // verify the required parameter 'warehouseId' is set - if (warehouseId == null) { - throw new ApiException( - "Missing the required parameter 'warehouseId' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - // verify the required parameter 'pagination' is set - if (pagination == null) { - throw new ApiException( - "Missing the required parameter 'pagination' when calling" - + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); - } - - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceCall( - spaceId, warehouseId, pagination, _callback); - return localVarCall; - } - - /** - * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @return ListSelectiveSyncsFromWarehouseAndSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListSelectiveSyncsFromWarehouseAndSpace200Response - listSelectiveSyncsFromWarehouseAndSpace( - String spaceId, String warehouseId, PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( - spaceId, warehouseId, pagination); - return localVarResp.getData(); - } - - /** - * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( - String spaceId, String warehouseId, PaginationInput pagination) - throws ApiException { - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - spaceId, warehouseId, pagination, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space - * Warehouse connection, including Sources, Collections, and Properties. • When called, this - * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the - * [audit trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param warehouseId (required) - * @param pagination Defines the pagination parameters. This parameter exists in alpha. - * (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( - String spaceId, - String warehouseId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( - spaceId, warehouseId, pagination, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index 6a05c3b5..7de94f93 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -22,6 +22,7 @@ import com.segment.publicapi.models.CreateProfilesWarehouse200Response; import com.segment.publicapi.models.CreateProfilesWarehouseAlphaInput; import com.segment.publicapi.models.ListProfilesWarehouseInSpace200Response; +import com.segment.publicapi.models.ListSelectiveSyncsFromWarehouseAndSpace200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response; import com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response; @@ -456,6 +457,236 @@ public okhttp3.Call listProfilesWarehouseInSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for listSelectiveSyncsFromWarehouseAndSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); + } + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceCall( + spaceId, warehouseId, pagination, _callback); + return localVarCall; + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ListSelectiveSyncsFromWarehouseAndSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListSelectiveSyncsFromWarehouseAndSpace200Response + listSelectiveSyncsFromWarehouseAndSpace( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + spaceId, warehouseId, pagination); + return localVarResp.getData(); + } + + /** + * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse + * connection, including Sources, Collections, and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListSelectiveSyncsFromWarehouseAndSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listSelectiveSyncsFromWarehouseAndSpaceWithHttpInfo( + String spaceId, String warehouseId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space + * Warehouse connection, including Sources, Collections, and Properties. • When called, this + * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param pagination Defines the pagination parameters. This parameter exists in alpha. + * (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( + String spaceId, + String warehouseId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + spaceId, warehouseId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for removeProfilesWarehouseFromSpace * From 70cee49070eb233435e2d3af6adf667e3726974d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 27 Apr 2023 18:25:17 +0000 Subject: [PATCH 090/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7a06c5ce. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 12 + .../publicapi/api/ProfilesSyncApi.java | 239 +++++++++++ .../models/SpaceWarehouseSchemaOverride.java | 370 ++++++++++++++++++ ...veSyncForWarehouseAndSpace200Response.java | 212 ++++++++++ ...iveSyncForWarehouseAndSpaceAlphaInput.java | 278 +++++++++++++ ...veSyncForWarehouseAndSpaceAlphaOutput.java | 330 ++++++++++++++++ 9 files changed, 1447 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java diff --git a/README.md b/README.md index de87042f..8d71ecd8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.5 +Latest API and SDK version: 34.3.6 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.5 + 34.3.6 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.5" + implementation "com.segment.publicapi:segment-publicapi:34.3.6" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.5.jar` +* `target/segment-publicapi-34.3.6.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 5fbd0de8..7fc7570c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.5 + 34.3.6 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 530091e4..b3c001a2 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.5 (Java)"); + setUserAgent("Public API SDK 34.3.6 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index cb3116ba..962dcd22 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1238,6 +1238,9 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.SourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Space.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SpaceWarehouseSchemaOverride + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); @@ -1347,6 +1350,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouse200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseAndSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseV1Input .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index 7de94f93..a1f0dbf0 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -27,6 +27,8 @@ import com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response; import com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response; import com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouseAlphaInput; +import com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseAndSpace200Response; +import com.segment.publicapi.models.UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -1116,4 +1118,241 @@ public okhttp3.Call updateProfilesWarehouseForSpaceWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updateSelectiveSyncForWarehouseAndSpace + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseAndSpaceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceCall( + String spaceId, + String warehouseId, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + updateSelectiveSyncForWarehouseAndSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSelectiveSyncForWarehouseAndSpaceAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "warehouseId" + "\\}", + localVarApiClient.escapeString(warehouseId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( + String spaceId, + String warehouseId, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + updateSelectiveSyncForWarehouseAndSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateSelectiveSyncForWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'warehouseId' is set + if (warehouseId == null) { + throw new ApiException( + "Missing the required parameter 'warehouseId' when calling" + + " updateSelectiveSyncForWarehouseAndSpace(Async)"); + } + + // verify the required parameter 'updateSelectiveSyncForWarehouseAndSpaceAlphaInput' is set + if (updateSelectiveSyncForWarehouseAndSpaceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter" + + " 'updateSelectiveSyncForWarehouseAndSpaceAlphaInput' when calling" + + " updateSelectiveSyncForWarehouseAndSpace(Async)"); + } + + okhttp3.Call localVarCall = + updateSelectiveSyncForWarehouseAndSpaceCall( + spaceId, + warehouseId, + updateSelectiveSyncForWarehouseAndSpaceAlphaInput, + _callback); + return localVarCall; + } + + /** + * Update Selective Sync for Warehouse And Space Updates an existing Profiles Warehouse. • When + * called, this endpoint may generate the `Profiles Sync Schema Updated` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseAndSpaceAlphaInput (required) + * @return UpdateSelectiveSyncForWarehouseAndSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateSelectiveSyncForWarehouseAndSpace200Response + updateSelectiveSyncForWarehouseAndSpace( + String spaceId, + String warehouseId, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + updateSelectiveSyncForWarehouseAndSpaceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateSelectiveSyncForWarehouseAndSpaceWithHttpInfo( + spaceId, warehouseId, updateSelectiveSyncForWarehouseAndSpaceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Selective Sync for Warehouse And Space Updates an existing Profiles Warehouse. • When + * called, this endpoint may generate the `Profiles Sync Schema Updated` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseAndSpaceAlphaInput (required) + * @return ApiResponse<UpdateSelectiveSyncForWarehouseAndSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateSelectiveSyncForWarehouseAndSpaceWithHttpInfo( + String spaceId, + String warehouseId, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + updateSelectiveSyncForWarehouseAndSpaceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( + spaceId, + warehouseId, + updateSelectiveSyncForWarehouseAndSpaceAlphaInput, + null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Selective Sync for Warehouse And Space (asynchronously) Updates an existing Profiles + * Warehouse. • When called, this endpoint may generate the `Profiles Sync Schema + * Updated` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param warehouseId (required) + * @param updateSelectiveSyncForWarehouseAndSpaceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceAsync( + String spaceId, + String warehouseId, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + updateSelectiveSyncForWarehouseAndSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( + spaceId, + warehouseId, + updateSelectiveSyncForWarehouseAndSpaceAlphaInput, + _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java new file mode 100644 index 00000000..9598b629 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java @@ -0,0 +1,370 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Represents the override for a Source/collection/property? path to apply to a Space Warehouse. */ +@ApiModel( + description = + "Represents the override for a Source/collection/property? path to apply to a Space" + + " Warehouse.") +public class SpaceWarehouseSchemaOverride { + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_COLLECTION = "collection"; + + @SerializedName(SERIALIZED_NAME_COLLECTION) + private String collection; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_PROPERTY = "property"; + + @SerializedName(SERIALIZED_NAME_PROPERTY) + private String property; + + public SpaceWarehouseSchemaOverride() {} + + public SpaceWarehouseSchemaOverride spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * The id of the space this schema item should apply to. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The id of the space this schema item should apply to.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public SpaceWarehouseSchemaOverride collection(String collection) { + + this.collection = collection; + return this; + } + + /** + * The collection within the Source. + * + * @return collection + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The collection within the Source.") + public String getCollection() { + return collection; + } + + public void setCollection(String collection) { + this.collection = collection; + } + + public SpaceWarehouseSchemaOverride source(String source) { + + this.source = source; + return this; + } + + /** + * The Source of the collection in this Space Warehouse. + * + * @return source + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Source of the collection in this Space Warehouse.") + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public SpaceWarehouseSchemaOverride enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * The Enabled flag ok telling whether the Collection is enabled or not. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The Enabled flag ok telling whether the Collection is enabled or not.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public SpaceWarehouseSchemaOverride property(String property) { + + this.property = property; + return this; + } + + /** + * A map that contains the properties within the collection to which the Warehouse should sync. + * + * @return property + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "A map that contains the properties within the collection to which the" + + " Warehouse should sync.") + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpaceWarehouseSchemaOverride spaceWarehouseSchemaOverride = + (SpaceWarehouseSchemaOverride) o; + return Objects.equals(this.spaceId, spaceWarehouseSchemaOverride.spaceId) + && Objects.equals(this.collection, spaceWarehouseSchemaOverride.collection) + && Objects.equals(this.source, spaceWarehouseSchemaOverride.source) + && Objects.equals(this.enabled, spaceWarehouseSchemaOverride.enabled) + && Objects.equals(this.property, spaceWarehouseSchemaOverride.property); + } + + @Override + public int hashCode() { + return Objects.hash(spaceId, collection, source, enabled, property); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpaceWarehouseSchemaOverride {\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("spaceId"); + openapiFields.add("collection"); + openapiFields.add("source"); + openapiFields.add("enabled"); + openapiFields.add("property"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("collection"); + openapiRequiredFields.add("source"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("property"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * SpaceWarehouseSchemaOverride + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SpaceWarehouseSchemaOverride.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SpaceWarehouseSchemaOverride is not" + + " found in the empty JSON string", + SpaceWarehouseSchemaOverride.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpaceWarehouseSchemaOverride.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SpaceWarehouseSchemaOverride` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SpaceWarehouseSchemaOverride.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("collection").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `collection` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("collection").toString())); + } + if (!jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `source` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("source").toString())); + } + if (!jsonObj.get("property").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `property` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("property").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpaceWarehouseSchemaOverride.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpaceWarehouseSchemaOverride' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SpaceWarehouseSchemaOverride.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SpaceWarehouseSchemaOverride value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpaceWarehouseSchemaOverride read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SpaceWarehouseSchemaOverride given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpaceWarehouseSchemaOverride + * @throws IOException if the JSON string is invalid with respect to + * SpaceWarehouseSchemaOverride + */ + public static SpaceWarehouseSchemaOverride fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpaceWarehouseSchemaOverride.class); + } + + /** + * Convert an instance of SpaceWarehouseSchemaOverride to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpace200Response.java new file mode 100644 index 00000000..a11396c4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpace200Response.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateSelectiveSyncForWarehouseAndSpace200Response */ +public class UpdateSelectiveSyncForWarehouseAndSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput data; + + public UpdateSelectiveSyncForWarehouseAndSpace200Response() {} + + public UpdateSelectiveSyncForWarehouseAndSpace200Response data( + UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput getData() { + return data; + } + + public void setData(UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSelectiveSyncForWarehouseAndSpace200Response + updateSelectiveSyncForWarehouseAndSpace200Response = + (UpdateSelectiveSyncForWarehouseAndSpace200Response) o; + return Objects.equals(this.data, updateSelectiveSyncForWarehouseAndSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSelectiveSyncForWarehouseAndSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateSelectiveSyncForWarehouseAndSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateSelectiveSyncForWarehouseAndSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateSelectiveSyncForWarehouseAndSpace200Response is not" + + " found in the empty JSON string", + UpdateSelectiveSyncForWarehouseAndSpace200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateSelectiveSyncForWarehouseAndSpace200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSelectiveSyncForWarehouseAndSpace200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSelectiveSyncForWarehouseAndSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UpdateSelectiveSyncForWarehouseAndSpace200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + UpdateSelectiveSyncForWarehouseAndSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + UpdateSelectiveSyncForWarehouseAndSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSelectiveSyncForWarehouseAndSpace200Response read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSelectiveSyncForWarehouseAndSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSelectiveSyncForWarehouseAndSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateSelectiveSyncForWarehouseAndSpace200Response + */ + public static UpdateSelectiveSyncForWarehouseAndSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, UpdateSelectiveSyncForWarehouseAndSpace200Response.class); + } + + /** + * Convert an instance of UpdateSelectiveSyncForWarehouseAndSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java new file mode 100644 index 00000000..adffe2c4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java @@ -0,0 +1,278 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Updates the schema for a Warehouse/sources pair. */ +@ApiModel(description = "Updates the schema for a Warehouse/sources pair.") +public class UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput { + public static final String SERIALIZED_NAME_SYNC_OVERRIDES = "syncOverrides"; + + @SerializedName(SERIALIZED_NAME_SYNC_OVERRIDES) + private List syncOverrides = null; + + public static final String SERIALIZED_NAME_ENABLE_EVENT_TABLES = "enableEventTables"; + + @SerializedName(SERIALIZED_NAME_ENABLE_EVENT_TABLES) + private Boolean enableEventTables; + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput() {} + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput syncOverrides( + List syncOverrides) { + + this.syncOverrides = syncOverrides; + return this; + } + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput addSyncOverridesItem( + SpaceWarehouseSchemaOverride syncOverridesItem) { + if (this.syncOverrides == null) { + this.syncOverrides = new ArrayList<>(); + } + this.syncOverrides.add(syncOverridesItem); + return this; + } + + /** + * A list of sync schema overrides to apply to this Space Warehouse. Note: Selective enabling of + * the tables under disabled all event tables conditions is not currently supported. + * + * @return syncOverrides + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A list of sync schema overrides to apply to this Space Warehouse. Note:" + + " Selective enabling of the tables under disabled all event tables" + + " conditions is not currently supported.") + public List getSyncOverrides() { + return syncOverrides; + } + + public void setSyncOverrides(List syncOverrides) { + this.syncOverrides = syncOverrides; + } + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput enableEventTables( + Boolean enableEventTables) { + + this.enableEventTables = enableEventTables; + return this; + } + + /** + * A flag that indicates to enable or disable all event Tables. + * + * @return enableEventTables + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A flag that indicates to enable or disable all event Tables.") + public Boolean getEnableEventTables() { + return enableEventTables; + } + + public void setEnableEventTables(Boolean enableEventTables) { + this.enableEventTables = enableEventTables; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + updateSelectiveSyncForWarehouseAndSpaceAlphaInput = + (UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput) o; + return Objects.equals( + this.syncOverrides, + updateSelectiveSyncForWarehouseAndSpaceAlphaInput.syncOverrides) + && Objects.equals( + this.enableEventTables, + updateSelectiveSyncForWarehouseAndSpaceAlphaInput.enableEventTables); + } + + @Override + public int hashCode() { + return Objects.hash(syncOverrides, enableEventTables); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput {\n"); + sb.append(" syncOverrides: ").append(toIndentedString(syncOverrides)).append("\n"); + sb.append(" enableEventTables: ") + .append(toIndentedString(enableEventTables)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("syncOverrides"); + openapiFields.add("enableEventTables"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput is not" + + " found in the empty JSON string", + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("syncOverrides") != null && !jsonObj.get("syncOverrides").isJsonNull()) { + JsonArray jsonArraysyncOverrides = jsonObj.getAsJsonArray("syncOverrides"); + if (jsonArraysyncOverrides != null) { + // ensure the json data is an array + if (!jsonObj.get("syncOverrides").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `syncOverrides` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("syncOverrides").toString())); + } + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput + */ + public static UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.class); + } + + /** + * Convert an instance of UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java new file mode 100644 index 00000000..fa5526e5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java @@ -0,0 +1,330 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Results from a selectiveSync patch to a Warehouse/Space pair. */ +@ApiModel(description = "Results from a selectiveSync patch to a Warehouse/Space pair.") +public class UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput { + /** Status of the update operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + UNCHANGED("UNCHANGED"), + + UPDATED("UPDATED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_WARNINGS = "warnings"; + + @SerializedName(SERIALIZED_NAME_WARNINGS) + private List warnings = new ArrayList<>(); + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput() {} + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the update operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Status of the update operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput warnings(List warnings) { + + this.warnings = warnings; + return this; + } + + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput addWarningsItem(String warningsItem) { + this.warnings.add(warningsItem); + return this; + } + + /** + * Warnings returned by the operation. + * + * @return warnings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Warnings returned by the operation.") + public List getWarnings() { + return warnings; + } + + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput + updateSelectiveSyncForWarehouseAndSpaceAlphaOutput = + (UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput) o; + return Objects.equals( + this.status, updateSelectiveSyncForWarehouseAndSpaceAlphaOutput.status) + && Objects.equals( + this.warnings, updateSelectiveSyncForWarehouseAndSpaceAlphaOutput.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(status, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("warnings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("warnings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput is not" + + " found in the empty JSON string", + UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the required json array is present + if (jsonObj.get("warnings") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("warnings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `warnings` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("warnings").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput read( + JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput + */ + public static UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 19350a431ac58652f6c9bb0cea19862dad933d98 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 27 Apr 2023 19:02:52 +0000 Subject: [PATCH 091/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7a06c5c. From e9d60fc12e90c4f44f20e23850a773e49c041cf5 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 27 Apr 2023 22:13:28 +0000 Subject: [PATCH 092/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@cd1f073. --- ...electiveSyncForWarehouseAndSpaceAlphaInput.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java index adffe2c4..a05a26ab 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java @@ -66,7 +66,9 @@ public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput addSyncOverridesItem( /** * A list of sync schema overrides to apply to this Space Warehouse. Note: Selective enabling of - * the tables under disabled all event tables conditions is not currently supported. + * Event tables under disabled all event tables conditions is not currently supported. + * EnableEventTables flag need to be set to true before any selective operation on the event + * tables. * * @return syncOverrides */ @@ -74,8 +76,9 @@ public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput addSyncOverridesItem( @ApiModelProperty( value = "A list of sync schema overrides to apply to this Space Warehouse. Note:" - + " Selective enabling of the tables under disabled all event tables" - + " conditions is not currently supported.") + + " Selective enabling of Event tables under disabled all event tables" + + " conditions is not currently supported. EnableEventTables flag need to" + + " be set to true before any selective operation on the event tables.") public List getSyncOverrides() { return syncOverrides; } @@ -92,12 +95,13 @@ public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput enableEventTables( } /** - * A flag that indicates to enable or disable all event Tables. + * A flag that indicates an event to enable or disable all event Tables. * * @return enableEventTables */ @javax.annotation.Nullable - @ApiModelProperty(value = "A flag that indicates to enable or disable all event Tables.") + @ApiModelProperty( + value = "A flag that indicates an event to enable or disable all event Tables.") public Boolean getEnableEventTables() { return enableEventTables; } From cef58b2f46d706483f5fda4b44028b4a659ba32f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 28 Apr 2023 02:01:04 +0000 Subject: [PATCH 093/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b99adadd. --- .../UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java index a05a26ab..115815ec 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java @@ -95,13 +95,12 @@ public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput enableEventTables( } /** - * A flag that indicates an event to enable or disable all event Tables. + * A flag to enable or disable all event Tables. * * @return enableEventTables */ @javax.annotation.Nullable - @ApiModelProperty( - value = "A flag that indicates an event to enable or disable all event Tables.") + @ApiModelProperty(value = "A flag to enable or disable all event Tables.") public Boolean getEnableEventTables() { return enableEventTables; } From 9b992b94cb2829a310e57cf79ba18b43da91eb13 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 1 May 2023 15:22:55 +0000 Subject: [PATCH 094/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c7622bb. From 277212af974cd0636e553448078e022874706efb Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 1 May 2023 15:42:08 +0000 Subject: [PATCH 095/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4c50b2f. --- .../com/segment/publicapi/models/DestinationStatusV1.java | 8 +++++++- .../java/com/segment/publicapi/models/Regulation.java | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index c62376c8..5a6c475d 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -51,15 +51,21 @@ public enum StatusEnum { FINISHED("FINISHED"), + FORWARDED("FORWARDED"), + INITIALIZED("INITIALIZED"), INVALID("INVALID"), + IN_PROGRESS("IN_PROGRESS"), + NOT_SUPPORTED("NOT_SUPPORTED"), PARTIAL_SUCCESS("PARTIAL_SUCCESS"), - RUNNING("RUNNING"); + RUNNING("RUNNING"), + + SUCCESS("SUCCESS"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index b1059c08..ddfd8770 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -58,11 +58,15 @@ public enum OverallStatusEnum { INVALID("INVALID"), + IN_PROGRESS("IN_PROGRESS"), + NOT_SUPPORTED("NOT_SUPPORTED"), PARTIAL_SUCCESS("PARTIAL_SUCCESS"), - RUNNING("RUNNING"); + RUNNING("RUNNING"), + + SUCCESS("SUCCESS"); private String value; From 6bdb085d4a26d03211ba8a31ff77373310209b5c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 1 May 2023 21:49:24 +0000 Subject: [PATCH 096/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@81331ef. --- .../publicapi/api/ProfilesSyncApi.java | 33 ++++---- .../models/SpaceWarehouseSchemaOverride.java | 82 +------------------ .../SpaceWarehouseSelectiveSyncItemAlpha.java | 78 +----------------- 3 files changed, 19 insertions(+), 174 deletions(-) diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index a1f0dbf0..8f83fdac 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -587,9 +587,7 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( /** * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). + * connection, including Collections and Properties. * * @param spaceId (required) * @param warehouseId (required) @@ -619,9 +617,7 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( /** * List Selective Syncs from Warehouse And Space Returns the schema for a Space Warehouse - * connection, including Sources, Collections, and Properties. • When called, this endpoint may - * generate the `Profiles Sync Warehouse Schema Retrieved` event in the [audit - * trail](/tag/Audit-Trail). + * connection, including Collections and Properties. * * @param spaceId (required) * @param warehouseId (required) @@ -653,9 +649,7 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( /** * List Selective Syncs from Warehouse And Space (asynchronously) Returns the schema for a Space - * Warehouse connection, including Sources, Collections, and Properties. • When called, this - * endpoint may generate the `Profiles Sync Warehouse Schema Retrieved` event in the - * [audit trail](/tag/Audit-Trail). + * Warehouse connection, including Collections and Properties. * * @param spaceId (required) * @param warehouseId (required) @@ -1245,9 +1239,10 @@ private okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( } /** - * Update Selective Sync for Warehouse And Space Updates an existing Profiles Warehouse. • When - * called, this endpoint may generate the `Profiles Sync Schema Updated` event in the - * [audit trail](/tag/Audit-Trail). + * Update Selective Sync for Warehouse And Space Updates the schema for a Space Warehouse + * connection, including Collections and Properties. • When called, this endpoint may generate + * the `Profiles Sync Warehouse Modified` event in the [audit + * trail](/tag/Audit-Trail). * * @param spaceId (required) * @param warehouseId (required) @@ -1278,9 +1273,10 @@ private okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( } /** - * Update Selective Sync for Warehouse And Space Updates an existing Profiles Warehouse. • When - * called, this endpoint may generate the `Profiles Sync Schema Updated` event in the - * [audit trail](/tag/Audit-Trail). + * Update Selective Sync for Warehouse And Space Updates the schema for a Space Warehouse + * connection, including Collections and Properties. • When called, this endpoint may generate + * the `Profiles Sync Warehouse Modified` event in the [audit + * trail](/tag/Audit-Trail). * * @param spaceId (required) * @param warehouseId (required) @@ -1316,9 +1312,10 @@ private okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( } /** - * Update Selective Sync for Warehouse And Space (asynchronously) Updates an existing Profiles - * Warehouse. • When called, this endpoint may generate the `Profiles Sync Schema - * Updated` event in the [audit trail](/tag/Audit-Trail). + * Update Selective Sync for Warehouse And Space (asynchronously) Updates the schema for a Space + * Warehouse connection, including Collections and Properties. • When called, this endpoint may + * generate the `Profiles Sync Warehouse Modified` event in the [audit + * trail](/tag/Audit-Trail). * * @param spaceId (required) * @param warehouseId (required) diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java index 9598b629..80b22d26 100644 --- a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java @@ -36,21 +36,11 @@ "Represents the override for a Source/collection/property? path to apply to a Space" + " Warehouse.") public class SpaceWarehouseSchemaOverride { - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - public static final String SERIALIZED_NAME_COLLECTION = "collection"; @SerializedName(SERIALIZED_NAME_COLLECTION) private String collection; - public static final String SERIALIZED_NAME_SOURCE = "source"; - - @SerializedName(SERIALIZED_NAME_SOURCE) - private String source; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; @SerializedName(SERIALIZED_NAME_ENABLED) @@ -63,29 +53,6 @@ public class SpaceWarehouseSchemaOverride { public SpaceWarehouseSchemaOverride() {} - public SpaceWarehouseSchemaOverride spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * The id of the space this schema item should apply to. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the space this schema item should apply to.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - public SpaceWarehouseSchemaOverride collection(String collection) { this.collection = collection; @@ -107,29 +74,6 @@ public void setCollection(String collection) { this.collection = collection; } - public SpaceWarehouseSchemaOverride source(String source) { - - this.source = source; - return this; - } - - /** - * The Source of the collection in this Space Warehouse. - * - * @return source - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source of the collection in this Space Warehouse.") - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - public SpaceWarehouseSchemaOverride enabled(Boolean enabled) { this.enabled = enabled; @@ -188,25 +132,21 @@ public boolean equals(Object o) { } SpaceWarehouseSchemaOverride spaceWarehouseSchemaOverride = (SpaceWarehouseSchemaOverride) o; - return Objects.equals(this.spaceId, spaceWarehouseSchemaOverride.spaceId) - && Objects.equals(this.collection, spaceWarehouseSchemaOverride.collection) - && Objects.equals(this.source, spaceWarehouseSchemaOverride.source) + return Objects.equals(this.collection, spaceWarehouseSchemaOverride.collection) && Objects.equals(this.enabled, spaceWarehouseSchemaOverride.enabled) && Objects.equals(this.property, spaceWarehouseSchemaOverride.property); } @Override public int hashCode() { - return Objects.hash(spaceId, collection, source, enabled, property); + return Objects.hash(collection, enabled, property); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpaceWarehouseSchemaOverride {\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" property: ").append(toIndentedString(property)).append("\n"); sb.append("}"); @@ -230,17 +170,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("spaceId"); openapiFields.add("collection"); - openapiFields.add("source"); openapiFields.add("enabled"); openapiFields.add("property"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spaceId"); openapiRequiredFields.add("collection"); - openapiRequiredFields.add("source"); openapiRequiredFields.add("enabled"); openapiRequiredFields.add("property"); } @@ -285,13 +221,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } if (!jsonObj.get("collection").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -299,13 +228,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("collection").toString())); } - if (!jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `source` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("source").toString())); - } if (!jsonObj.get("property").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java index fdd0d7fa..c5417c21 100644 --- a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSelectiveSyncItemAlpha.java @@ -40,11 +40,6 @@ "Represents an entry in the Space Warehouse Selective Sync schema for a Warehouse" + " and Space pair.") public class SpaceWarehouseSelectiveSyncItemAlpha { - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - public static final String SERIALIZED_NAME_COLLECTION = "collection"; @SerializedName(SERIALIZED_NAME_COLLECTION) @@ -55,11 +50,6 @@ public class SpaceWarehouseSelectiveSyncItemAlpha { @SerializedName(SERIALIZED_NAME_WAREHOUSE_ID) private String warehouseId; - public static final String SERIALIZED_NAME_SOURCE = "source"; - - @SerializedName(SERIALIZED_NAME_SOURCE) - private String source; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; @SerializedName(SERIALIZED_NAME_ENABLED) @@ -72,27 +62,6 @@ public class SpaceWarehouseSelectiveSyncItemAlpha { public SpaceWarehouseSelectiveSyncItemAlpha() {} - public SpaceWarehouseSelectiveSyncItemAlpha spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * The space id attached to this Warehouse. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The space id attached to this Warehouse.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - public SpaceWarehouseSelectiveSyncItemAlpha collection(String collection) { this.collection = collection; @@ -135,27 +104,6 @@ public void setWarehouseId(String warehouseId) { this.warehouseId = warehouseId; } - public SpaceWarehouseSelectiveSyncItemAlpha source(String source) { - - this.source = source; - return this; - } - - /** - * The Source of the collection in this Space Warehouse. - * - * @return source - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Source of the collection in this Space Warehouse.") - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - public SpaceWarehouseSelectiveSyncItemAlpha enabled(Boolean enabled) { this.enabled = enabled; @@ -220,28 +168,24 @@ public boolean equals(Object o) { } SpaceWarehouseSelectiveSyncItemAlpha spaceWarehouseSelectiveSyncItemAlpha = (SpaceWarehouseSelectiveSyncItemAlpha) o; - return Objects.equals(this.spaceId, spaceWarehouseSelectiveSyncItemAlpha.spaceId) - && Objects.equals(this.collection, spaceWarehouseSelectiveSyncItemAlpha.collection) + return Objects.equals(this.collection, spaceWarehouseSelectiveSyncItemAlpha.collection) && Objects.equals( this.warehouseId, spaceWarehouseSelectiveSyncItemAlpha.warehouseId) - && Objects.equals(this.source, spaceWarehouseSelectiveSyncItemAlpha.source) && Objects.equals(this.enabled, spaceWarehouseSelectiveSyncItemAlpha.enabled) && Objects.equals(this.properties, spaceWarehouseSelectiveSyncItemAlpha.properties); } @Override public int hashCode() { - return Objects.hash(spaceId, collection, warehouseId, source, enabled, properties); + return Objects.hash(collection, warehouseId, enabled, properties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpaceWarehouseSelectiveSyncItemAlpha {\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append(" collection: ").append(toIndentedString(collection)).append("\n"); sb.append(" warehouseId: ").append(toIndentedString(warehouseId)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append("}"); @@ -265,16 +209,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("spaceId"); openapiFields.add("collection"); openapiFields.add("warehouseId"); - openapiFields.add("source"); openapiFields.add("enabled"); openapiFields.add("properties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spaceId"); openapiRequiredFields.add("collection"); openapiRequiredFields.add("warehouseId"); openapiRequiredFields.add("enabled"); @@ -323,13 +264,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { requiredField, jsonObj.toString())); } } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } if (!jsonObj.get("collection").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -344,14 +278,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("warehouseId").toString())); } - if ((jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) - && !jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `source` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("source").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From b24d8495d5d7837f944eae48824707b50f095cd5 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 2 May 2023 03:37:10 +0000 Subject: [PATCH 097/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4eefc1f. --- ...SyncsFromWarehouseAndSpaceAlphaOutput.java | 42 ++++++++++++++++--- .../models/SpaceWarehouseSchemaOverride.java | 4 +- ...iveSyncForWarehouseAndSpaceAlphaInput.java | 4 +- ...veSyncForWarehouseAndSpaceAlphaOutput.java | 4 +- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java index d3e0128c..0a7eb23d 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java @@ -44,6 +44,11 @@ public class ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput { @SerializedName(SERIALIZED_NAME_ITEMS) private List items = new ArrayList<>(); + public static final String SERIALIZED_NAME_ENABLE_EVENT_TABLES = "enableEventTables"; + + @SerializedName(SERIALIZED_NAME_ENABLE_EVENT_TABLES) + private Boolean enableEventTables; + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -65,16 +70,14 @@ public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput addItemsItem( } /** - * Represents a list of Source, collection, and properties synced to the Warehouse. + * Represents a list of collection and properties synced to the Warehouse. * * @return items */ @javax.annotation.Nonnull @ApiModelProperty( required = true, - value = - "Represents a list of Source, collection, and properties synced to the" - + " Warehouse.") + value = "Represents a list of collection and properties synced to the Warehouse.") public List getItems() { return items; } @@ -83,6 +86,28 @@ public void setItems(List items) { this.items = items; } + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput enableEventTables( + Boolean enableEventTables) { + + this.enableEventTables = enableEventTables; + return this; + } + + /** + * A flag that represent if all event Tables are enable or disable. + * + * @return enableEventTables + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "A flag that represent if all event Tables are enable or disable.") + public Boolean getEnableEventTables() { + return enableEventTables; + } + + public void setEnableEventTables(Boolean enableEventTables) { + this.enableEventTables = enableEventTables; + } + public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput pagination(Pagination pagination) { this.pagination = pagination; @@ -116,6 +141,9 @@ public boolean equals(Object o) { listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput = (ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput) o; return Objects.equals(this.items, listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.items) + && Objects.equals( + this.enableEventTables, + listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.enableEventTables) && Objects.equals( this.pagination, listSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.pagination); @@ -123,7 +151,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(items, pagination); + return Objects.hash(items, enableEventTables, pagination); } @Override @@ -131,6 +159,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput {\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" enableEventTables: ") + .append(toIndentedString(enableEventTables)) + .append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); return sb.toString(); @@ -154,6 +185,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("items"); + openapiFields.add("enableEventTables"); openapiFields.add("pagination"); // a set of required properties/fields (JSON key names) diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java index 80b22d26..a39a4162 100644 --- a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java @@ -30,10 +30,10 @@ import java.util.Objects; import java.util.Set; -/** Represents the override for a Source/collection/property? path to apply to a Space Warehouse. */ +/** Represents the override for a collection/property? path to apply to a Space Warehouse. */ @ApiModel( description = - "Represents the override for a Source/collection/property? path to apply to a Space" + "Represents the override for a collection/property? path to apply to a Space" + " Warehouse.") public class SpaceWarehouseSchemaOverride { public static final String SERIALIZED_NAME_COLLECTION = "collection"; diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java index 115815ec..cf943144 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java @@ -33,8 +33,8 @@ import java.util.Objects; import java.util.Set; -/** Updates the schema for a Warehouse/sources pair. */ -@ApiModel(description = "Updates the schema for a Warehouse/sources pair.") +/** Updates the schema for a Space Warehouse connection. */ +@ApiModel(description = "Updates the schema for a Space Warehouse connection.") public class UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput { public static final String SERIALIZED_NAME_SYNC_OVERRIDES = "syncOverrides"; diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java index fa5526e5..a16d74e5 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java @@ -33,8 +33,8 @@ import java.util.Objects; import java.util.Set; -/** Results from a selectiveSync patch to a Warehouse/Space pair. */ -@ApiModel(description = "Results from a selectiveSync patch to a Warehouse/Space pair.") +/** Results from a selectiveSync patch to a Space Warehouse connection. */ +@ApiModel(description = "Results from a selectiveSync patch to a Space Warehouse connection.") public class UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput { /** Status of the update operation. */ @JsonAdapter(StatusEnum.Adapter.class) From aef95b54273952a52b7f81dd929611ef341d3fb9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 8 May 2023 19:15:34 +0000 Subject: [PATCH 098/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8239b11. --- .../CreateCloudSourceRegulationV1Input.java | 8 +-- .../models/CreateSourceRegulationV1Input.java | 8 +-- .../CreateWorkspaceRegulationV1Input.java | 8 +-- ...SyncsFromWarehouseAndSpaceAlphaOutput.java | 4 +- .../models/SpaceWarehouseSchemaOverride.java | 7 ++- ...iveSyncForWarehouseAndSpaceAlphaInput.java | 13 ++--- ...veSyncForWarehouseAndSpaceAlphaOutput.java | 54 +------------------ 7 files changed, 24 insertions(+), 78 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 6b77eba9..64fe6808 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -210,8 +210,8 @@ public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsIte } /** - * The user or object ids of the subjects to regulate. Config API note: equal to - * `parent` but allows an array. + * The list of `userId` or `objectId` values of the subjects to regulate. + * Config API note: equal to `parent` but allows an array. * * @return subjectIds */ @@ -219,8 +219,8 @@ public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsIte @ApiModelProperty( required = true, value = - "The user or object ids of the subjects to regulate. Config API note: equal to" - + " `parent` but allows an array.") + "The list of `userId` or `objectId` values of the subjects to regulate. Config" + + " API note: equal to `parent` but allows an array.") public List getSubjectIds() { return subjectIds; } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 2ba3e483..753518b7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -203,8 +203,8 @@ public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { } /** - * The user or object ids of the subjects to regulate. Config API note: equal to - * `parent` but allows an array. + * The list of `userId` or `objectId` values of the subjects to regulate. + * Config API note: equal to `parent` but allows an array. * * @return subjectIds */ @@ -212,8 +212,8 @@ public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { @ApiModelProperty( required = true, value = - "The user or object ids of the subjects to regulate. Config API note: equal to" - + " `parent` but allows an array.") + "The list of `userId` or `objectId` values of the subjects to regulate. Config" + + " API note: equal to `parent` but allows an array.") public List getSubjectIds() { return subjectIds; } diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index 64bf8ae4..5692ae18 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -207,8 +207,8 @@ public CreateWorkspaceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) } /** - * The user or object ids of the subjects to regulate. Config API note: equal to - * `parent` but allows an array. + * The list of `userId` or `objectId` values of the subjects to regulate. + * Config API note: equal to `parent` but allows an array. * * @return subjectIds */ @@ -216,8 +216,8 @@ public CreateWorkspaceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) @ApiModelProperty( required = true, value = - "The user or object ids of the subjects to regulate. Config API note: equal to" - + " `parent` but allows an array.") + "The list of `userId` or `objectId` values of the subjects to regulate. Config" + + " API note: equal to `parent` but allows an array.") public List getSubjectIds() { return subjectIds; } diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java index 0a7eb23d..6813aa2a 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java @@ -70,14 +70,14 @@ public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput addItemsItem( } /** - * Represents a list of collection and properties synced to the Warehouse. + * Represents a list of collections and properties synced to the Warehouse. * * @return items */ @javax.annotation.Nonnull @ApiModelProperty( required = true, - value = "Represents a list of collection and properties synced to the Warehouse.") + value = "Represents a list of collections and properties synced to the Warehouse.") public List getItems() { return items; } diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java index a39a4162..0044eda0 100644 --- a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java @@ -108,9 +108,8 @@ public SpaceWarehouseSchemaOverride property(String property) { * * @return property */ - @javax.annotation.Nonnull + @javax.annotation.Nullable @ApiModelProperty( - required = true, value = "A map that contains the properties within the collection to which the" + " Warehouse should sync.") @@ -178,7 +177,6 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("collection"); openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("property"); } /** @@ -228,7 +226,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("collection").toString())); } - if (!jsonObj.get("property").isJsonPrimitive()) { + if ((jsonObj.get("property") != null && !jsonObj.get("property").isJsonNull()) + && !jsonObj.get("property").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `property` to be a primitive type in the JSON" diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java index cf943144..c5911da2 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java @@ -65,20 +65,17 @@ public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput addSyncOverridesItem( } /** - * A list of sync schema overrides to apply to this Space Warehouse. Note: Selective enabling of - * Event tables under disabled all event tables conditions is not currently supported. - * EnableEventTables flag need to be set to true before any selective operation on the event - * tables. + * A list of sync Schema overrides to apply to this Space Warehouse. Note: Selective Sync is not + * supported if the enableEventTables flag is false. * * @return syncOverrides */ @javax.annotation.Nullable @ApiModelProperty( value = - "A list of sync schema overrides to apply to this Space Warehouse. Note:" - + " Selective enabling of Event tables under disabled all event tables" - + " conditions is not currently supported. EnableEventTables flag need to" - + " be set to true before any selective operation on the event tables.") + "A list of sync Schema overrides to apply to this Space Warehouse. Note:" + + " Selective Sync is not supported if the enableEventTables flag is" + + " false.") public List getSyncOverrides() { return syncOverrides; } diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java index a16d74e5..313c0297 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java @@ -26,9 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; @@ -87,11 +85,6 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; - public static final String SERIALIZED_NAME_WARNINGS = "warnings"; - - @SerializedName(SERIALIZED_NAME_WARNINGS) - private List warnings = new ArrayList<>(); - public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput() {} public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput status(StatusEnum status) { @@ -115,32 +108,6 @@ public void setStatus(StatusEnum status) { this.status = status; } - public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput warnings(List warnings) { - - this.warnings = warnings; - return this; - } - - public UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput addWarningsItem(String warningsItem) { - this.warnings.add(warningsItem); - return this; - } - - /** - * Warnings returned by the operation. - * - * @return warnings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warnings returned by the operation.") - public List getWarnings() { - return warnings; - } - - public void setWarnings(List warnings) { - this.warnings = warnings; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -153,14 +120,12 @@ public boolean equals(Object o) { updateSelectiveSyncForWarehouseAndSpaceAlphaOutput = (UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput) o; return Objects.equals( - this.status, updateSelectiveSyncForWarehouseAndSpaceAlphaOutput.status) - && Objects.equals( - this.warnings, updateSelectiveSyncForWarehouseAndSpaceAlphaOutput.warnings); + this.status, updateSelectiveSyncForWarehouseAndSpaceAlphaOutput.status); } @Override public int hashCode() { - return Objects.hash(status, warnings); + return Objects.hash(status); } @Override @@ -168,7 +133,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput {\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); sb.append("}"); return sb.toString(); } @@ -191,12 +155,10 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("status"); - openapiFields.add("warnings"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("status"); - openapiRequiredFields.add("warnings"); } /** @@ -252,18 +214,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("status").toString())); } - // ensure the required json array is present - if (jsonObj.get("warnings") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("warnings").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `warnings` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("warnings").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From ed45582d70fea5e14e9b57346978c18cff3fdf8b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 10 May 2023 06:58:55 +0000 Subject: [PATCH 099/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@65aca61. --- ...ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java index 6813aa2a..6b6430a7 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java @@ -94,12 +94,15 @@ public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput enableEventTables( } /** - * A flag that represent if all event Tables are enable or disable. + * A flag that represent if all event Tables are enable or disable. This field is optional. * * @return enableEventTables */ @javax.annotation.Nullable - @ApiModelProperty(value = "A flag that represent if all event Tables are enable or disable.") + @ApiModelProperty( + value = + "A flag that represent if all event Tables are enable or disable. This field is" + + " optional.") public Boolean getEnableEventTables() { return enableEventTables; } From 4e46911aa3a285b77bd2e8be38361d7f0f30bc61 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 10 May 2023 07:18:32 +0000 Subject: [PATCH 100/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@cc480a8. --- .../UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java index c5911da2..f803dc7b 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput.java @@ -92,12 +92,13 @@ public UpdateSelectiveSyncForWarehouseAndSpaceAlphaInput enableEventTables( } /** - * A flag to enable or disable all event Tables. + * A flag to enable or disable all event Tables. This field is optional. * * @return enableEventTables */ @javax.annotation.Nullable - @ApiModelProperty(value = "A flag to enable or disable all event Tables.") + @ApiModelProperty( + value = "A flag to enable or disable all event Tables. This field is optional.") public Boolean getEnableEventTables() { return enableEventTables; } From d928b962ff4b547f3a63270fd599a5be6e60a84a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 17 May 2023 13:09:22 +0000 Subject: [PATCH 101/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5b7dac49. --- ...tiveSyncsFromWarehouseAndSpaceAlphaOutput.java | 7 ++----- .../models/SpaceWarehouseSchemaOverride.java | 15 ++++++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java index 6b6430a7..3f7de2e1 100644 --- a/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput.java @@ -94,15 +94,12 @@ public ListSelectiveSyncsFromWarehouseAndSpaceAlphaOutput enableEventTables( } /** - * A flag that represent if all event Tables are enable or disable. This field is optional. + * Optional. Represents the enabled state of all event tables. * * @return enableEventTables */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "A flag that represent if all event Tables are enable or disable. This field is" - + " optional.") + @ApiModelProperty(value = "Optional. Represents the enabled state of all event tables.") public Boolean getEnableEventTables() { return enableEventTables; } diff --git a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java index 0044eda0..f846ee64 100644 --- a/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java +++ b/src/main/java/com/segment/publicapi/models/SpaceWarehouseSchemaOverride.java @@ -30,11 +30,14 @@ import java.util.Objects; import java.util.Set; -/** Represents the override for a collection/property? path to apply to a Space Warehouse. */ +/** + * Overrides the enabled or disabled state of the specified collection and / or properties within + * the schema. + */ @ApiModel( description = - "Represents the override for a collection/property? path to apply to a Space" - + " Warehouse.") + "Overrides the enabled or disabled state of the specified collection and / or" + + " properties within the schema.") public class SpaceWarehouseSchemaOverride { public static final String SERIALIZED_NAME_COLLECTION = "collection"; @@ -81,14 +84,16 @@ public SpaceWarehouseSchemaOverride enabled(Boolean enabled) { } /** - * The Enabled flag ok telling whether the Collection is enabled or not. + * Represents the overridden enabled state for the listed collection and / or properties. * * @return enabled */ @javax.annotation.Nonnull @ApiModelProperty( required = true, - value = "The Enabled flag ok telling whether the Collection is enabled or not.") + value = + "Represents the overridden enabled state for the listed collection and / or" + + " properties.") public Boolean getEnabled() { return enabled; } From fbd0f67b93faa75d6207b2608eb30bae474bfc8f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 17 May 2023 18:31:57 +0000 Subject: [PATCH 102/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3108d60. From 64206be4c7580c2c6ebb26d2cf17b7d965da4a1f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 19 May 2023 19:43:57 +0000 Subject: [PATCH 103/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d816de8. --- .../com/segment/publicapi/models/DestinationStatusV1.java | 8 +------- .../java/com/segment/publicapi/models/Regulation.java | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index 5a6c475d..c62376c8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -51,21 +51,15 @@ public enum StatusEnum { FINISHED("FINISHED"), - FORWARDED("FORWARDED"), - INITIALIZED("INITIALIZED"), INVALID("INVALID"), - IN_PROGRESS("IN_PROGRESS"), - NOT_SUPPORTED("NOT_SUPPORTED"), PARTIAL_SUCCESS("PARTIAL_SUCCESS"), - RUNNING("RUNNING"), - - SUCCESS("SUCCESS"); + RUNNING("RUNNING"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index ddfd8770..b1059c08 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -58,15 +58,11 @@ public enum OverallStatusEnum { INVALID("INVALID"), - IN_PROGRESS("IN_PROGRESS"), - NOT_SUPPORTED("NOT_SUPPORTED"), PARTIAL_SUCCESS("PARTIAL_SUCCESS"), - RUNNING("RUNNING"), - - SUCCESS("SUCCESS"); + RUNNING("RUNNING"); private String value; From cf08ab5f4883246aeb042d6f71733a4073724eaf Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 19 May 2023 19:50:13 +0000 Subject: [PATCH 104/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5fa43f1. From a46b008acf0c70abe778bbf4b43784af30c6d553 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 19 May 2023 20:10:37 +0000 Subject: [PATCH 105/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d816de8. From 3b8dd81f752a6f136cc75669b35f3a598028e71a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 24 May 2023 17:59:32 +0000 Subject: [PATCH 106/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b9629a5. --- .../com/segment/publicapi/models/RemoveRuleV1.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java index 13ce5fba..73345309 100644 --- a/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RemoveRuleV1.java @@ -35,7 +35,7 @@ /** Represents the parameters needed to identify a rule on the backend-side. */ @ApiModel(description = "Represents the parameters needed to identify a rule on the backend-side.") public class RemoveRuleV1 { - /** Gets or Sets type */ + /** The type for this Tracking Plan rule. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { COMMON("COMMON"), @@ -113,12 +113,12 @@ public RemoveRuleV1 type(TypeEnum type) { } /** - * Get type + * The type for this Tracking Plan rule. * * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "The type for this Tracking Plan rule.") public TypeEnum getType() { return type; } @@ -134,12 +134,12 @@ public RemoveRuleV1 key(String key) { } /** - * Get key + * Key to this rule (free-form string like 'Button clicked'). * * @return key */ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(value = "Key to this rule (free-form string like 'Button clicked').") public String getKey() { return key; } @@ -155,12 +155,12 @@ public RemoveRuleV1 version(BigDecimal version) { } /** - * Get version + * Version of this rule. * * @return version */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "Version of this rule.") public BigDecimal getVersion() { return version; } From 246ffd824f8dfe19c51e6c4721f1585f5225033e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 24 May 2023 19:43:27 +0000 Subject: [PATCH 107/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d5426d8. From a10e19224874195f94fd6a2714478fcb640f1b42 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 25 May 2023 17:17:20 +0000 Subject: [PATCH 108/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2cd7c3a. From 1c1f6ae15c2c7327d4ac1965e0c06782ea714daa Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 25 May 2023 18:11:11 +0000 Subject: [PATCH 109/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b84544f. From 281389fb32dba698fc32fa7b816fec2f74d6155e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 25 May 2023 20:13:30 +0000 Subject: [PATCH 110/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@44f6537. From 9c5e500a2e6ff3a88b068f7be04e438a6678fabf Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 25 May 2023 20:57:43 +0000 Subject: [PATCH 111/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9ceeed3. From 3be517556e4215287526b01a7c364ea3a76fff4e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 26 May 2023 18:59:37 +0000 Subject: [PATCH 112/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f89f7632. From 8e960be1f52703a28079c883b4b196debf2d484d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 26 May 2023 22:03:18 +0000 Subject: [PATCH 113/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@90382f2. From 049d3f2d485040a61b4a32c81685d1c32d2dc7bf Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 26 May 2023 22:50:03 +0000 Subject: [PATCH 114/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5ce99542. From 22b4bcb53de501ed5c0a3f2c01a1be197554d94c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 26 May 2023 23:47:42 +0000 Subject: [PATCH 115/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@94ef3a0. From 7062d50dceaa57d9891017509438747886ef9748 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 8 Jun 2023 22:00:15 +0000 Subject: [PATCH 116/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@220f464. From 2adb120b848e8704c39d740e3784750ce9bd1af4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 12 Jun 2023 02:22:28 +0000 Subject: [PATCH 117/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8df6ece. From 74887b06d8dff1cee2a7531e791f143fcc14f0b3 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 14 Jun 2023 18:16:08 +0000 Subject: [PATCH 118/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d6a6aae. From 43fe3a4895e34b541879982de2e248916baf78e0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 15 Jun 2023 23:59:28 +0000 Subject: [PATCH 119/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b4be888. From f9a798b7ba01a5bfdffe1e6dcce8b3cda87779d2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 16 Jun 2023 14:55:57 +0000 Subject: [PATCH 120/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@35747d1. From 08be74ba9c53d9e399821105a9a95eea9ab6a404 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 16 Jun 2023 19:56:11 +0000 Subject: [PATCH 121/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@aa11200. From 724b315fa076719f74ca0aa0a7582528ad136728 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 16 Jun 2023 19:57:31 +0000 Subject: [PATCH 122/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ca192e3. From ede1c721e430f32d5be14a4a0f40c9088dab2397 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 20 Jun 2023 19:51:11 +0000 Subject: [PATCH 123/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0eee3c6. From 7b7e516f51cd0bd3c102d622d541bb258cf45f24 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 20 Jun 2023 20:28:52 +0000 Subject: [PATCH 124/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c29deb4. From 0b5efc8bf7c6d2b1dc273c3884c44d86b82408a4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 20 Jun 2023 20:52:49 +0000 Subject: [PATCH 125/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8c9a93a. From 4de2969c2810fff1379a8d917cd2ae1aeddb986f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 21 Jun 2023 19:12:27 +0000 Subject: [PATCH 126/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3d22ee2. From 3861c6e37d7e0b1988648708ea5271f96505eaaa Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 21 Jun 2023 23:28:06 +0000 Subject: [PATCH 127/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b6a8356. From 22dfecd0251425df985ed451e841ac8c2d1b8f95 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 21 Jun 2023 23:59:49 +0000 Subject: [PATCH 128/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c81487a. --- .../models/CreateTrackingPlanV1Input.java | 2 ++ .../com/segment/publicapi/models/RuleV1.java | 26 +++++++++++++++---- .../publicapi/models/TrackingPlan.java | 2 ++ .../publicapi/models/TrackingPlan1.java | 2 ++ .../publicapi/models/TrackingPlanV1.java | 2 ++ .../publicapi/models/UpsertRuleV1.java | 26 +++++++++++++++---- 6 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index 199d6774..ed37e3f6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -47,6 +47,8 @@ public class CreateTrackingPlanV1Input { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index 78adf379..3796f7f2 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; /** Represents a rule from a Tracking Plan. */ @ApiModel(description = "Represents a rule from a Tracking Plan.") @@ -180,7 +182,7 @@ public RuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "JSON Schema of this rule.") + @ApiModelProperty(value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -200,8 +202,8 @@ public RuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Version of this rule.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -291,11 +293,27 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, ruleV1.deprecatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -339,8 +357,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); - openapiRequiredFields.add("jsonSchema"); - openapiRequiredFields.add("version"); } /** diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index 524daf30..015de56b 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -57,6 +57,8 @@ public class TrackingPlan { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 44d6ac94..92a0b8da 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -57,6 +57,8 @@ public class TrackingPlan1 { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index b6b79632..51a2f83b 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -57,6 +57,8 @@ public class TrackingPlanV1 { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index a1bcdf85..56d69690 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; /** UpsertRuleV1 */ public class UpsertRuleV1 { @@ -204,7 +206,7 @@ public UpsertRuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "JSON Schema of this rule.") + @ApiModelProperty(value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -224,8 +226,8 @@ public UpsertRuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Version of this rule.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -316,12 +318,28 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, upsertRuleV1.deprecatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash( newKey, type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -367,8 +385,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); - openapiRequiredFields.add("jsonSchema"); - openapiRequiredFields.add("version"); } /** From 88a426472d1caf4174ff8cd40110e2f7c36230ff Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 22 Jun 2023 15:09:47 +0000 Subject: [PATCH 129/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ce3d4ca. --- .../models/CreateTrackingPlanV1Input.java | 2 -- .../com/segment/publicapi/models/RuleV1.java | 26 ++++--------------- .../publicapi/models/TrackingPlan.java | 2 -- .../publicapi/models/TrackingPlan1.java | 2 -- .../publicapi/models/TrackingPlanV1.java | 2 -- .../publicapi/models/UpsertRuleV1.java | 26 ++++--------------- 6 files changed, 10 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index ed37e3f6..199d6774 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -47,8 +47,6 @@ public class CreateTrackingPlanV1Input { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ENGAGE("ENGAGE"), - LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index 3796f7f2..78adf379 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -27,12 +27,10 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** Represents a rule from a Tracking Plan. */ @ApiModel(description = "Represents a rule from a Tracking Plan.") @@ -182,7 +180,7 @@ public RuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(value = "JSON Schema of this rule.") + @ApiModelProperty(required = true, value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -202,8 +200,8 @@ public RuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Version of this rule.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -293,27 +291,11 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, ruleV1.deprecatedAt); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -357,6 +339,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); + openapiRequiredFields.add("jsonSchema"); + openapiRequiredFields.add("version"); } /** diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index 015de56b..524daf30 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -57,8 +57,6 @@ public class TrackingPlan { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ENGAGE("ENGAGE"), - LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 92a0b8da..44d6ac94 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -57,8 +57,6 @@ public class TrackingPlan1 { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ENGAGE("ENGAGE"), - LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index 51a2f83b..b6b79632 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -57,8 +57,6 @@ public class TrackingPlanV1 { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ENGAGE("ENGAGE"), - LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index 56d69690..a1bcdf85 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -26,12 +26,10 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** UpsertRuleV1 */ public class UpsertRuleV1 { @@ -206,7 +204,7 @@ public UpsertRuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(value = "JSON Schema of this rule.") + @ApiModelProperty(required = true, value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -226,8 +224,8 @@ public UpsertRuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Version of this rule.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -318,28 +316,12 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, upsertRuleV1.deprecatedAt); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash( newKey, type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -385,6 +367,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); + openapiRequiredFields.add("jsonSchema"); + openapiRequiredFields.add("version"); } /** From 5083a98e3fdba7d78e71ff0008e210d36cf99990 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 22 Jun 2023 21:35:14 +0000 Subject: [PATCH 130/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2b5fc27. From 5bf52523efec24898691031ac2631b18049a370e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 22 Jun 2023 21:52:54 +0000 Subject: [PATCH 131/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d302a7d. From 192ec5e39771d36faf5d86b16baed795508a2cf8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 23 Jun 2023 16:42:30 +0000 Subject: [PATCH 132/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c1d6511. From b7f7c245e3c0845deeb27ad07e04eaa2207f2d18 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 23 Jun 2023 19:12:01 +0000 Subject: [PATCH 133/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@eaae9c4. From 7875cd54c7cf5ab2cb5be48240b8e20f22fd2270 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 28 Jun 2023 19:18:05 +0000 Subject: [PATCH 134/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2a68676. --- .../com/segment/publicapi/api/DestinationsApi.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index faca56cf..8ed769f3 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -1147,8 +1147,8 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall * List Delivery Metrics Summary from Destination Get an event delivery metrics summary from a * Destination. Based on the granularity chosen, there are restrictions on the time range you * can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in - * the past **Hour**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past - * **Day**: - Max time range: 60 days - Oldest possible start time: 60 days in the past The rate + * the past **Hour**: - Max Time range: 7 days - Oldest possible start time: 7 days in the past + * **Day**: - Max time range: 14 days - Oldest possible start time: 14 days in the past The rate * limit for this endpoint is 60 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate @@ -1195,8 +1195,8 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall * List Delivery Metrics Summary from Destination Get an event delivery metrics summary from a * Destination. Based on the granularity chosen, there are restrictions on the time range you * can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in - * the past **Hour**: - Max Time range: 1 week - Oldest possible start time: 10 days in the past - * **Day**: - Max time range: 60 days - Oldest possible start time: 60 days in the past The rate + * the past **Hour**: - Max Time range: 7 days - Oldest possible start time: 7 days in the past + * **Day**: - Max time range: 14 days - Oldest possible start time: 14 days in the past The rate * limit for this endpoint is 60 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate @@ -1245,8 +1245,8 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall * List Delivery Metrics Summary from Destination (asynchronously) Get an event delivery metrics * summary from a Destination. Based on the granularity chosen, there are restrictions on the * time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: - * 48 hours in the past **Hour**: - Max Time range: 1 week - Oldest possible start time: 10 days - * in the past **Day**: - Max time range: 60 days - Oldest possible start time: 60 days in the + * 48 hours in the past **Hour**: - Max Time range: 7 days - Oldest possible start time: 7 days + * in the past **Day**: - Max time range: 14 days - Oldest possible start time: 14 days in the * past The rate limit for this endpoint is 60 requests per minute, which is lower than the * default due to access pattern restrictions. Once reached, this endpoint will respond with the * 429 HTTP status code with headers indicating the limit parameters. See [Rate From 0e2c2ddd8121ed3067ab22a5dfe60728e447f25b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 28 Jun 2023 20:48:10 +0000 Subject: [PATCH 135/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9dd952a. --- src/main/java/com/segment/publicapi/JSON.java | 9 - .../segment/publicapi/api/FunctionsApi.java | 6 +- .../models/CreateLabel200Response1.java | 192 ------------ .../models/CreateLabelAlphaInput.java | 204 ------------- .../models/CreateLabelAlphaOutput.java | 222 -------------- .../publicapi/models/CreateLabelV1Input.java | 8 +- .../publicapi/models/CreateLabelV1Output.java | 8 +- .../com/segment/publicapi/models/Label1.java | 4 +- .../com/segment/publicapi/models/Label2.java | 284 ------------------ 9 files changed, 13 insertions(+), 924 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/Label2.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 962dcd22..69e18ce8 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -248,13 +248,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateInvitesV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateLabel200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateLabel200Response1 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateLabelAlphaInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateLabelAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateLabelV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -749,8 +742,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Label.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Label1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Label2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 77b5f3ef..7ffa3443 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -1454,7 +1454,7 @@ private okhttp3.Call restoreFunctionVersionValidateBeforeCall( } /** - * Restore Function Version Restore an old Function version as a latest version. • In order to + * Restore Function Version Restore an old Function version as the latest version. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1481,7 +1481,7 @@ public RestoreFunctionVersion200Response restoreFunctionVersion( } /** - * Restore Function Version Restore an old Function version as a latest version. • In order to + * Restore Function Version Restore an old Function version as the latest version. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1510,7 +1510,7 @@ public ApiResponse restoreFunctionVersionWith } /** - * Restore Function Version (asynchronously) Restore an old Function version as a latest + * Restore Function Version (asynchronously) Restore an old Function version as the latest * version. • In order to successfully call this endpoint, the specified Workspace needs to have * the Functions feature enabled. Please reach out to your customer success manager for more * information. diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java deleted file mode 100644 index f1774f85..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response1.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** CreateLabel200Response1 */ -public class CreateLabel200Response1 { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CreateLabelAlphaOutput data; - - public CreateLabel200Response1() {} - - public CreateLabel200Response1 data(CreateLabelAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public CreateLabelAlphaOutput getData() { - return data; - } - - public void setData(CreateLabelAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateLabel200Response1 createLabel200Response1 = (CreateLabel200Response1) o; - return Objects.equals(this.data, createLabel200Response1.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabel200Response1 {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabel200Response1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabel200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateLabel200Response1 is not found" - + " in the empty JSON string", - CreateLabel200Response1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabel200Response1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateLabel200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabel200Response1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabel200Response1' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateLabel200Response1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabel200Response1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabel200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateLabel200Response1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabel200Response1 - * @throws IOException if the JSON string is invalid with respect to CreateLabel200Response1 - */ - public static CreateLabel200Response1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabel200Response1.class); - } - - /** - * Convert an instance of CreateLabel200Response1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java deleted file mode 100644 index 80d4882c..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaInput.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Creates a new label in the current Workspace. */ -@ApiModel(description = "Creates a new label in the current Workspace.") -public class CreateLabelAlphaInput { - public static final String SERIALIZED_NAME_LABEL = "label"; - - @SerializedName(SERIALIZED_NAME_LABEL) - private Label label; - - public CreateLabelAlphaInput() {} - - public CreateLabelAlphaInput label(Label label) { - - this.label = label; - return this; - } - - /** - * Get label - * - * @return label - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Label getLabel() { - return label; - } - - public void setLabel(Label label) { - this.label = label; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateLabelAlphaInput createLabelAlphaInput = (CreateLabelAlphaInput) o; - return Objects.equals(this.label, createLabelAlphaInput.label); - } - - @Override - public int hashCode() { - return Objects.hash(label); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabelAlphaInput {\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("label"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("label"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabelAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateLabelAlphaInput is not found in" - + " the empty JSON string", - CreateLabelAlphaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabelAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateLabelAlphaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateLabelAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabelAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabelAlphaInput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateLabelAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabelAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabelAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateLabelAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabelAlphaInput - * @throws IOException if the JSON string is invalid with respect to CreateLabelAlphaInput - */ - public static CreateLabelAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabelAlphaInput.class); - } - - /** - * Convert an instance of CreateLabelAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java deleted file mode 100644 index 6a49977b..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateLabelAlphaOutput.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Result of creating a new label in the current Workspace. */ -@ApiModel(description = "Result of creating a new label in the current Workspace.") -public class CreateLabelAlphaOutput { - public static final String SERIALIZED_NAME_LABELS = "labels"; - - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = new ArrayList<>(); - - public CreateLabelAlphaOutput() {} - - public CreateLabelAlphaOutput labels(List labels) { - - this.labels = labels; - return this; - } - - public CreateLabelAlphaOutput addLabelsItem(LabelAlpha labelsItem) { - this.labels.add(labelsItem); - return this; - } - - /** - * All labels associated with the current Workspace. - * - * @return labels - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All labels associated with the current Workspace.") - public List getLabels() { - return labels; - } - - public void setLabels(List labels) { - this.labels = labels; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateLabelAlphaOutput createLabelAlphaOutput = (CreateLabelAlphaOutput) o; - return Objects.equals(this.labels, createLabelAlphaOutput.labels); - } - - @Override - public int hashCode() { - return Objects.hash(labels); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateLabelAlphaOutput {\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("labels"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("labels"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateLabelAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateLabelAlphaOutput is not found in" - + " the empty JSON string", - CreateLabelAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateLabelAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateLabelAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateLabelAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("labels").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `labels` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("labels").toString())); - } - - JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateLabelAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateLabelAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateLabelAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateLabelAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateLabelAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateLabelAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateLabelAlphaOutput - * @throws IOException if the JSON string is invalid with respect to CreateLabelAlphaOutput - */ - public static CreateLabelAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateLabelAlphaOutput.class); - } - - /** - * Convert an instance of CreateLabelAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index 4929d123..569efc86 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -36,11 +36,11 @@ public class CreateLabelV1Input { public static final String SERIALIZED_NAME_LABEL = "label"; @SerializedName(SERIALIZED_NAME_LABEL) - private Label1 label; + private Label label; public CreateLabelV1Input() {} - public CreateLabelV1Input label(Label1 label) { + public CreateLabelV1Input label(Label label) { this.label = label; return this; @@ -53,11 +53,11 @@ public CreateLabelV1Input label(Label1 label) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Label1 getLabel() { + public Label getLabel() { return label; } - public void setLabel(Label1 label) { + public void setLabel(Label label) { this.label = label; } diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index ef6b38b7..40af0108 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -36,11 +36,11 @@ public class CreateLabelV1Output { public static final String SERIALIZED_NAME_LABEL = "label"; @SerializedName(SERIALIZED_NAME_LABEL) - private Label2 label; + private Label1 label; public CreateLabelV1Output() {} - public CreateLabelV1Output label(Label2 label) { + public CreateLabelV1Output label(Label1 label) { this.label = label; return this; @@ -53,11 +53,11 @@ public CreateLabelV1Output label(Label2 label) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "") - public Label2 getLabel() { + public Label1 getLabel() { return label; } - public void setLabel(Label2 label) { + public void setLabel(Label1 label) { this.label = label; } diff --git a/src/main/java/com/segment/publicapi/models/Label1.java b/src/main/java/com/segment/publicapi/models/Label1.java index abf663f5..77e26183 100644 --- a/src/main/java/com/segment/publicapi/models/Label1.java +++ b/src/main/java/com/segment/publicapi/models/Label1.java @@ -30,8 +30,8 @@ import java.util.Objects; import java.util.Set; -/** The new label to create in the Workspace. */ -@ApiModel(description = "The new label to create in the Workspace.") +/** The newly created label. */ +@ApiModel(description = "The newly created label.") public class Label1 { public static final String SERIALIZED_NAME_KEY = "key"; diff --git a/src/main/java/com/segment/publicapi/models/Label2.java b/src/main/java/com/segment/publicapi/models/Label2.java deleted file mode 100644 index 07e41ab1..00000000 --- a/src/main/java/com/segment/publicapi/models/Label2.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The newly created label. */ -@ApiModel(description = "The newly created label.") -public class Label2 { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public Label2() {} - - public Label2 key(String key) { - - this.key = key; - return this; - } - - /** - * The key that represents the name of this label. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The key that represents the name of this label.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Label2 value(String value) { - - this.value = value; - return this; - } - - /** - * The value associated with the key of this label. - * - * @return value - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value associated with the key of this label.") - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public Label2 description(String description) { - - this.description = description; - return this; - } - - /** - * An optional description of the purpose of this label. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional description of the purpose of this label.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Label2 label2 = (Label2) o; - return Objects.equals(this.key, label2.key) - && Objects.equals(this.value, label2.value) - && Objects.equals(this.description, label2.description); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Label2 {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("value"); - openapiFields.add("description"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Label2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Label2.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Label2 is not found in the empty JSON" - + " string", - Label2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Label2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Label2`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Label2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `value` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("value").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Label2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Label2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Label2.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Label2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Label2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Label2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Label2 - * @throws IOException if the JSON string is invalid with respect to Label2 - */ - public static Label2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Label2.class); - } - - /** - * Convert an instance of Label2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 02b192c5ae649d638152c9d92c2ddf1e6f113ebf Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 29 Jun 2023 17:00:46 +0000 Subject: [PATCH 136/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@79f27e5. From 27016bf6e0baa8c5416868ace7dcfb535b34a3c3 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 3 Jul 2023 20:49:13 +0000 Subject: [PATCH 137/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a8b4277. --- README.md | 8 +++--- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../segment/publicapi/api/FunctionsApi.java | 6 ++--- .../com/segment/publicapi/models/RuleV1.java | 26 +++++++++++++++---- .../publicapi/models/TrackingPlan.java | 2 ++ .../publicapi/models/TrackingPlan1.java | 2 ++ .../publicapi/models/TrackingPlanV1.java | 2 ++ .../publicapi/models/UpsertRuleV1.java | 26 +++++++++++++++---- 9 files changed, 57 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8d71ecd8..29c1ce36 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 34.3.6 +Latest API and SDK version: 35.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 34.3.6 + 35.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:34.3.6" + implementation "com.segment.publicapi:segment-publicapi:35.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-34.3.6.jar` +* `target/segment-publicapi-35.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 7fc7570c..e3efc53b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 34.3.6 + 35.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index b3c001a2..a8797ed1 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 34.3.6 (Java)"); + setUserAgent("Public API SDK 35.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 7ffa3443..77b5f3ef 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -1454,7 +1454,7 @@ private okhttp3.Call restoreFunctionVersionValidateBeforeCall( } /** - * Restore Function Version Restore an old Function version as the latest version. • In order to + * Restore Function Version Restore an old Function version as a latest version. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1481,7 +1481,7 @@ public RestoreFunctionVersion200Response restoreFunctionVersion( } /** - * Restore Function Version Restore an old Function version as the latest version. • In order to + * Restore Function Version Restore an old Function version as a latest version. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1510,7 +1510,7 @@ public ApiResponse restoreFunctionVersionWith } /** - * Restore Function Version (asynchronously) Restore an old Function version as the latest + * Restore Function Version (asynchronously) Restore an old Function version as a latest * version. • In order to successfully call this endpoint, the specified Workspace needs to have * the Functions feature enabled. Please reach out to your customer success manager for more * information. diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index 78adf379..3796f7f2 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; /** Represents a rule from a Tracking Plan. */ @ApiModel(description = "Represents a rule from a Tracking Plan.") @@ -180,7 +182,7 @@ public RuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "JSON Schema of this rule.") + @ApiModelProperty(value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -200,8 +202,8 @@ public RuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Version of this rule.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -291,11 +293,27 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, ruleV1.deprecatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash(type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -339,8 +357,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); - openapiRequiredFields.add("jsonSchema"); - openapiRequiredFields.add("version"); } /** diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan.java b/src/main/java/com/segment/publicapi/models/TrackingPlan.java index 524daf30..015de56b 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan.java @@ -57,6 +57,8 @@ public class TrackingPlan { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java index 44d6ac94..92a0b8da 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlan1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlan1.java @@ -57,6 +57,8 @@ public class TrackingPlan1 { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java index b6b79632..51a2f83b 100644 --- a/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java +++ b/src/main/java/com/segment/publicapi/models/TrackingPlanV1.java @@ -57,6 +57,8 @@ public class TrackingPlanV1 { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index a1bcdf85..56d69690 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; /** UpsertRuleV1 */ public class UpsertRuleV1 { @@ -204,7 +206,7 @@ public UpsertRuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "JSON Schema of this rule.") + @ApiModelProperty(value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -224,8 +226,8 @@ public UpsertRuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Version of this rule.") + @javax.annotation.Nullable + @ApiModelProperty(value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -316,12 +318,28 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, upsertRuleV1.deprecatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash( newKey, type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -367,8 +385,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); - openapiRequiredFields.add("jsonSchema"); - openapiRequiredFields.add("version"); } /** From ff1b431614a33a5e746d2287b10d23d886ef0580 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 13 Jul 2023 17:42:21 +0000 Subject: [PATCH 138/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b13c173. --- README.md | 8 +++--- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../models/CreateTrackingPlanV1Input.java | 2 ++ .../com/segment/publicapi/models/RuleV1.java | 26 ++++--------------- ...veSyncForWarehouseAndSpaceAlphaOutput.java | 4 +-- .../publicapi/models/UpsertRuleV1.java | 26 ++++--------------- 7 files changed, 20 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 29c1ce36..42760f97 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 35.0.0 +Latest API and SDK version: 36.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 35.0.0 + 36.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:35.0.0" + implementation "com.segment.publicapi:segment-publicapi:36.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-35.0.0.jar` +* `target/segment-publicapi-36.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index e3efc53b..feb2c500 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 35.0.0 + 36.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index a8797ed1..0ac40979 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 35.0.0 (Java)"); + setUserAgent("Public API SDK 36.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index 199d6774..ed37e3f6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -47,6 +47,8 @@ public class CreateTrackingPlanV1Input { /** The Tracking Plan's type. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ENGAGE("ENGAGE"), + LIVE("LIVE"), PROPERTY_LIBRARY("PROPERTY_LIBRARY"), diff --git a/src/main/java/com/segment/publicapi/models/RuleV1.java b/src/main/java/com/segment/publicapi/models/RuleV1.java index 3796f7f2..78adf379 100644 --- a/src/main/java/com/segment/publicapi/models/RuleV1.java +++ b/src/main/java/com/segment/publicapi/models/RuleV1.java @@ -27,12 +27,10 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** Represents a rule from a Tracking Plan. */ @ApiModel(description = "Represents a rule from a Tracking Plan.") @@ -182,7 +180,7 @@ public RuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(value = "JSON Schema of this rule.") + @ApiModelProperty(required = true, value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -202,8 +200,8 @@ public RuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Version of this rule.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -293,27 +291,11 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, ruleV1.deprecatedAt); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -357,6 +339,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); + openapiRequiredFields.add("jsonSchema"); + openapiRequiredFields.add("version"); } /** diff --git a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java index 313c0297..506b1db2 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput.java @@ -31,8 +31,8 @@ import java.util.Objects; import java.util.Set; -/** Results from a selectiveSync patch to a Space Warehouse connection. */ -@ApiModel(description = "Results from a selectiveSync patch to a Space Warehouse connection.") +/** Results from a SelectiveSync patch to a Space Warehouse connection. */ +@ApiModel(description = "Results from a SelectiveSync patch to a Space Warehouse connection.") public class UpdateSelectiveSyncForWarehouseAndSpaceAlphaOutput { /** Status of the update operation. */ @JsonAdapter(StatusEnum.Adapter.class) diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index 56d69690..a1bcdf85 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -26,12 +26,10 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import java.util.Arrays; import java.util.HashSet; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** UpsertRuleV1 */ public class UpsertRuleV1 { @@ -206,7 +204,7 @@ public UpsertRuleV1 jsonSchema(Object jsonSchema) { * @return jsonSchema */ @javax.annotation.Nullable - @ApiModelProperty(value = "JSON Schema of this rule.") + @ApiModelProperty(required = true, value = "JSON Schema of this rule.") public Object getJsonSchema() { return jsonSchema; } @@ -226,8 +224,8 @@ public UpsertRuleV1 version(BigDecimal version) { * * @return version */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Version of this rule.") + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Version of this rule.") public BigDecimal getVersion() { return version; } @@ -318,28 +316,12 @@ public boolean equals(Object o) { && Objects.equals(this.deprecatedAt, upsertRuleV1.deprecatedAt); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash( newKey, type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -385,6 +367,8 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); + openapiRequiredFields.add("jsonSchema"); + openapiRequiredFields.add("version"); } /** From 588204b57a460613c64f10970d61c9bc2219b4cd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 8 Aug 2023 16:19:13 +0000 Subject: [PATCH 139/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3004589. --- src/main/java/com/segment/publicapi/JSON.java | 9 + .../segment/publicapi/api/FunctionsApi.java | 6 +- ...tMessagingSubscriptionSuccessResponse.java | 109 ++++- .../models/GetSubscriptionRequest.java | 12 +- .../models/GroupSubscriptionStatus.java | 298 ++++++++++++++ .../GroupSubscriptionStatusResponse.java | 377 ++++++++++++++++++ .../models/MessageSubscriptionResponse.java | 75 +++- .../models/MessagesSubscriptionRequest.java | 83 +++- ...UpdateGroupSubscriptionStatusResponse.java | 344 ++++++++++++++++ 9 files changed, 1268 insertions(+), 45 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java create mode 100644 src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateGroupSubscriptionStatusResponse.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 69e18ce8..32b26d4f 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -721,6 +721,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Group.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GroupSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GroupSubscriptionStatus + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GroupSubscriptionStatusResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.HandleWebhookInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1302,6 +1308,9 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.UpdateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateGroupSubscriptionStatusResponse + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 77b5f3ef..7ffa3443 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -1454,7 +1454,7 @@ private okhttp3.Call restoreFunctionVersionValidateBeforeCall( } /** - * Restore Function Version Restore an old Function version as a latest version. • In order to + * Restore Function Version Restore an old Function version as the latest version. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1481,7 +1481,7 @@ public RestoreFunctionVersion200Response restoreFunctionVersion( } /** - * Restore Function Version Restore an old Function version as a latest version. • In order to + * Restore Function Version Restore an old Function version as the latest version. • In order to * successfully call this endpoint, the specified Workspace needs to have the Functions feature * enabled. Please reach out to your customer success manager for more information. * @@ -1510,7 +1510,7 @@ public ApiResponse restoreFunctionVersionWith } /** - * Restore Function Version (asynchronously) Restore an old Function version as a latest + * Restore Function Version (asynchronously) Restore an old Function version as the latest * version. • In order to successfully call this endpoint, the specified Workspace needs to have * the Functions feature enabled. Please reach out to your customer success manager for more * information. diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index 67f7241e..ac6945b9 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -13,6 +13,7 @@ import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -25,7 +26,9 @@ import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; @@ -37,12 +40,14 @@ public class GetMessagingSubscriptionSuccessResponse { @SerializedName(SERIALIZED_NAME_KEY) private String key; - /** Type is communication medium used. Either EMAIL or SMS. */ + /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { EMAIL("EMAIL"), - SMS("SMS"); + SMS("SMS"), + + WHATSAPP("WHATSAPP"); private String value; @@ -144,6 +149,16 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public static final String SERIALIZED_NAME_GROUPS = "groups"; + + @SerializedName(SERIALIZED_NAME_GROUPS) + private List groups = null; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + public GetMessagingSubscriptionSuccessResponse() {} public GetMessagingSubscriptionSuccessResponse key(String key) { @@ -174,14 +189,12 @@ public GetMessagingSubscriptionSuccessResponse type(TypeEnum type) { } /** - * Type is communication medium used. Either EMAIL or SMS. + * Type is communication medium used. * * @return type */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Type is communication medium used. Either EMAIL or SMS.") + @ApiModelProperty(required = true, value = "Type is communication medium used.") public TypeEnum getType() { return type; } @@ -215,6 +228,58 @@ public void setStatus(StatusEnum status) { this.status = status; } + public GetMessagingSubscriptionSuccessResponse groups( + List groups) { + + this.groups = groups; + return this; + } + + public GetMessagingSubscriptionSuccessResponse addGroupsItem( + GroupSubscriptionStatusResponse groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Optional subscription groups. + * + * @return groups + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional subscription groups.") + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + + public GetMessagingSubscriptionSuccessResponse updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this subscription status's last change. + * + * @return updatedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The timestamp of this subscription status's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -227,12 +292,15 @@ public boolean equals(Object o) { (GetMessagingSubscriptionSuccessResponse) o; return Objects.equals(this.key, getMessagingSubscriptionSuccessResponse.key) && Objects.equals(this.type, getMessagingSubscriptionSuccessResponse.type) - && Objects.equals(this.status, getMessagingSubscriptionSuccessResponse.status); + && Objects.equals(this.status, getMessagingSubscriptionSuccessResponse.status) + && Objects.equals(this.groups, getMessagingSubscriptionSuccessResponse.groups) + && Objects.equals( + this.updatedAt, getMessagingSubscriptionSuccessResponse.updatedAt); } @Override public int hashCode() { - return Objects.hash(key, type, status); + return Objects.hash(key, type, status, groups, updatedAt); } @Override @@ -242,6 +310,8 @@ public String toString() { sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -266,6 +336,8 @@ private String toIndentedString(Object o) { openapiFields.add("key"); openapiFields.add("type"); openapiFields.add("status"); + openapiFields.add("groups"); + openapiFields.add("updatedAt"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -338,6 +410,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("status").toString())); } + if (jsonObj.get("groups") != null && !jsonObj.get("groups").isJsonNull()) { + JsonArray jsonArraygroups = jsonObj.getAsJsonArray("groups"); + if (jsonArraygroups != null) { + // ensure the json data is an array + if (!jsonObj.get("groups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groups` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("groups").toString())); + } + } + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index bf7c207f..26dfd8bc 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -37,12 +37,14 @@ public class GetSubscriptionRequest { @SerializedName(SERIALIZED_NAME_KEY) private String key; - /** Type is communication medium used. Either EMAIL or SMS. */ + /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { EMAIL("EMAIL"), - SMS("SMS"); + SMS("SMS"), + + WHATSAPP("WHATSAPP"); private String value; @@ -118,14 +120,12 @@ public GetSubscriptionRequest type(TypeEnum type) { } /** - * Type is communication medium used. Either EMAIL or SMS. + * Type is communication medium used. * * @return type */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Type is communication medium used. Either EMAIL or SMS.") + @ApiModelProperty(required = true, value = "Type is communication medium used.") public TypeEnum getType() { return type; } diff --git a/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java new file mode 100644 index 00000000..ca2ae006 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java @@ -0,0 +1,298 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GroupSubscriptionStatus */ +public class GroupSubscriptionStatus { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** The user subscribed, unsubscribed, or on initial status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DID_NOT_SUBSCRIBE("DID_NOT_SUBSCRIBE"), + + SUBSCRIBED("SUBSCRIBED"), + + UNSUBSCRIBED("UNSUBSCRIBED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public GroupSubscriptionStatus() {} + + public GroupSubscriptionStatus name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the group. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the group.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GroupSubscriptionStatus status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The user subscribed, unsubscribed, or on initial status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The user subscribed, unsubscribed, or on initial status.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupSubscriptionStatus groupSubscriptionStatus = (GroupSubscriptionStatus) o; + return Objects.equals(this.name, groupSubscriptionStatus.name) + && Objects.equals(this.status, groupSubscriptionStatus.status); + } + + @Override + public int hashCode() { + return Objects.hash(name, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupSubscriptionStatus {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GroupSubscriptionStatus + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GroupSubscriptionStatus.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GroupSubscriptionStatus is not found" + + " in the empty JSON string", + GroupSubscriptionStatus.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GroupSubscriptionStatus.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GroupSubscriptionStatus` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupSubscriptionStatus.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupSubscriptionStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupSubscriptionStatus' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GroupSubscriptionStatus.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupSubscriptionStatus value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GroupSubscriptionStatus read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GroupSubscriptionStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupSubscriptionStatus + * @throws IOException if the JSON string is invalid with respect to GroupSubscriptionStatus + */ + public static GroupSubscriptionStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupSubscriptionStatus.class); + } + + /** + * Convert an instance of GroupSubscriptionStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java new file mode 100644 index 00000000..98f49a5d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java @@ -0,0 +1,377 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GroupSubscriptionStatusResponse */ +public class GroupSubscriptionStatusResponse { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** The user subscribed, unsubscribed, or on initial status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DID_NOT_SUBSCRIBE("DID_NOT_SUBSCRIBE"), + + SUBSCRIBED("SUBSCRIBED"), + + UNSUBSCRIBED("UNSUBSCRIBED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public GroupSubscriptionStatusResponse() {} + + public GroupSubscriptionStatusResponse name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the group. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the group.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public GroupSubscriptionStatusResponse status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The user subscribed, unsubscribed, or on initial status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The user subscribed, unsubscribed, or on initial status.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public GroupSubscriptionStatusResponse id(String id) { + + this.id = id; + return this; + } + + /** + * The group id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The group id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GroupSubscriptionStatusResponse updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this subscription status's last change. + * + * @return updatedAt + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "The timestamp of this subscription status's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupSubscriptionStatusResponse groupSubscriptionStatusResponse = + (GroupSubscriptionStatusResponse) o; + return Objects.equals(this.name, groupSubscriptionStatusResponse.name) + && Objects.equals(this.status, groupSubscriptionStatusResponse.status) + && Objects.equals(this.id, groupSubscriptionStatusResponse.id) + && Objects.equals(this.updatedAt, groupSubscriptionStatusResponse.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(name, status, id, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupSubscriptionStatusResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("status"); + openapiFields.add("id"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * GroupSubscriptionStatusResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GroupSubscriptionStatusResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GroupSubscriptionStatusResponse is not" + + " found in the empty JSON string", + GroupSubscriptionStatusResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GroupSubscriptionStatusResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GroupSubscriptionStatusResponse` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GroupSubscriptionStatusResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GroupSubscriptionStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GroupSubscriptionStatusResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GroupSubscriptionStatusResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GroupSubscriptionStatusResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GroupSubscriptionStatusResponse read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GroupSubscriptionStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupSubscriptionStatusResponse + * @throws IOException if the JSON string is invalid with respect to + * GroupSubscriptionStatusResponse + */ + public static GroupSubscriptionStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GroupSubscriptionStatusResponse.class); + } + + /** + * Convert an instance of GroupSubscriptionStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 7c2f24cb..4c937f19 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -40,12 +40,14 @@ public class MessageSubscriptionResponse { @SerializedName(SERIALIZED_NAME_KEY) private String key; - /** Type is communication medium used. Either EMAIL or SMS. */ + /** Type is communication medium used. Either SMS, EMAIL or WHATSAPP. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { EMAIL("EMAIL"), - SMS("SMS"); + SMS("SMS"), + + WHATSAPP("WHATSAPP"); private String value; @@ -149,6 +151,11 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ERRORS) private List errors = null; + public static final String SERIALIZED_NAME_GROUPS = "groups"; + + @SerializedName(SERIALIZED_NAME_GROUPS) + private List groups = null; + public MessageSubscriptionResponse() {} public MessageSubscriptionResponse key(String key) { @@ -179,14 +186,14 @@ public MessageSubscriptionResponse type(TypeEnum type) { } /** - * Type is communication medium used. Either EMAIL or SMS. + * Type is communication medium used. Either SMS, EMAIL or WHATSAPP. * * @return type */ @javax.annotation.Nonnull @ApiModelProperty( required = true, - value = "Type is communication medium used. Either EMAIL or SMS.") + value = "Type is communication medium used. Either SMS, EMAIL or WHATSAPP.") public TypeEnum getType() { return type; } @@ -206,10 +213,8 @@ public MessageSubscriptionResponse status(StatusEnum status) { * * @return status */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The user subscribed, unsubscribed, or on initial status.") + @javax.annotation.Nullable + @ApiModelProperty(value = "The user subscribed, unsubscribed, or on initial status.") public StatusEnum getStatus() { return status; } @@ -247,6 +252,36 @@ public void setErrors(List errors) { this.errors = errors; } + public MessageSubscriptionResponse groups(List groups) { + + this.groups = groups; + return this; + } + + public MessageSubscriptionResponse addGroupsItem( + UpdateGroupSubscriptionStatusResponse groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Optional subscription groups. + * + * @return groups + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional subscription groups.") + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -259,12 +294,13 @@ public boolean equals(Object o) { return Objects.equals(this.key, messageSubscriptionResponse.key) && Objects.equals(this.type, messageSubscriptionResponse.type) && Objects.equals(this.status, messageSubscriptionResponse.status) - && Objects.equals(this.errors, messageSubscriptionResponse.errors); + && Objects.equals(this.errors, messageSubscriptionResponse.errors) + && Objects.equals(this.groups, messageSubscriptionResponse.groups); } @Override public int hashCode() { - return Objects.hash(key, type, status, errors); + return Objects.hash(key, type, status, errors, groups); } @Override @@ -275,6 +311,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); sb.append("}"); return sb.toString(); } @@ -300,12 +337,12 @@ private String toIndentedString(Object o) { openapiFields.add("type"); openapiFields.add("status"); openapiFields.add("errors"); + openapiFields.add("groups"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("key"); openapiRequiredFields.add("type"); - openapiRequiredFields.add("status"); } /** @@ -361,7 +398,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("type").toString())); } - if (!jsonObj.get("status").isJsonPrimitive()) { + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `status` to be a primitive type in the JSON string" @@ -381,6 +419,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } } + if (jsonObj.get("groups") != null && !jsonObj.get("groups").isJsonNull()) { + JsonArray jsonArraygroups = jsonObj.getAsJsonArray("groups"); + if (jsonArraygroups != null) { + // ensure the json data is an array + if (!jsonObj.get("groups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groups` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("groups").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index 5621edf6..99cf361a 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -13,6 +13,7 @@ import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -25,7 +26,9 @@ import com.segment.publicapi.JSON; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Map.Entry; import java.util.Objects; import java.util.Set; @@ -37,12 +40,14 @@ public class MessagesSubscriptionRequest { @SerializedName(SERIALIZED_NAME_KEY) private String key; - /** Type is communication medium used. Either EMAIL or SMS. */ + /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { EMAIL("EMAIL"), - SMS("SMS"); + SMS("SMS"), + + WHATSAPP("WHATSAPP"); private String value; @@ -88,7 +93,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type; - /** The user subscribed, unsubscribed, or on initial status. */ + /** The user subscribed, unsubscribed, or on initial status globally. */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { DID_NOT_SUBSCRIBE("DID_NOT_SUBSCRIBE"), @@ -141,6 +146,11 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; + public static final String SERIALIZED_NAME_GROUPS = "groups"; + + @SerializedName(SERIALIZED_NAME_GROUPS) + private List groups = null; + public MessagesSubscriptionRequest() {} public MessagesSubscriptionRequest key(String key) { @@ -171,14 +181,12 @@ public MessagesSubscriptionRequest type(TypeEnum type) { } /** - * Type is communication medium used. Either EMAIL or SMS. + * Type is communication medium used. * * @return type */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Type is communication medium used. Either EMAIL or SMS.") + @ApiModelProperty(required = true, value = "Type is communication medium used.") public TypeEnum getType() { return type; } @@ -194,14 +202,12 @@ public MessagesSubscriptionRequest status(StatusEnum status) { } /** - * The user subscribed, unsubscribed, or on initial status. + * The user subscribed, unsubscribed, or on initial status globally. * * @return status */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The user subscribed, unsubscribed, or on initial status.") + @javax.annotation.Nullable + @ApiModelProperty(value = "The user subscribed, unsubscribed, or on initial status globally.") public StatusEnum getStatus() { return status; } @@ -210,6 +216,35 @@ public void setStatus(StatusEnum status) { this.status = status; } + public MessagesSubscriptionRequest groups(List groups) { + + this.groups = groups; + return this; + } + + public MessagesSubscriptionRequest addGroupsItem(GroupSubscriptionStatus groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Optional groups subscription status. + * + * @return groups + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Optional groups subscription status.") + public List getGroups() { + return groups; + } + + public void setGroups(List groups) { + this.groups = groups; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -221,12 +256,13 @@ public boolean equals(Object o) { MessagesSubscriptionRequest messagesSubscriptionRequest = (MessagesSubscriptionRequest) o; return Objects.equals(this.key, messagesSubscriptionRequest.key) && Objects.equals(this.type, messagesSubscriptionRequest.type) - && Objects.equals(this.status, messagesSubscriptionRequest.status); + && Objects.equals(this.status, messagesSubscriptionRequest.status) + && Objects.equals(this.groups, messagesSubscriptionRequest.groups); } @Override public int hashCode() { - return Objects.hash(key, type, status); + return Objects.hash(key, type, status, groups); } @Override @@ -236,6 +272,7 @@ public String toString() { sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); sb.append("}"); return sb.toString(); } @@ -260,12 +297,12 @@ private String toIndentedString(Object o) { openapiFields.add("key"); openapiFields.add("type"); openapiFields.add("status"); + openapiFields.add("groups"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("key"); openapiRequiredFields.add("type"); - openapiRequiredFields.add("status"); } /** @@ -321,13 +358,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("type").toString())); } - if (!jsonObj.get("status").isJsonPrimitive()) { + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `status` to be a primitive type in the JSON string" + " but got `%s`", jsonObj.get("status").toString())); } + if (jsonObj.get("groups") != null && !jsonObj.get("groups").isJsonNull()) { + JsonArray jsonArraygroups = jsonObj.getAsJsonArray("groups"); + if (jsonArraygroups != null) { + // ensure the json data is an array + if (!jsonObj.get("groups").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `groups` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("groups").toString())); + } + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/UpdateGroupSubscriptionStatusResponse.java b/src/main/java/com/segment/publicapi/models/UpdateGroupSubscriptionStatusResponse.java new file mode 100644 index 00000000..a44a0440 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateGroupSubscriptionStatusResponse.java @@ -0,0 +1,344 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateGroupSubscriptionStatusResponse */ +public class UpdateGroupSubscriptionStatusResponse { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** The user subscribed, unsubscribed, or on initial status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DID_NOT_SUBSCRIBE("DID_NOT_SUBSCRIBE"), + + SUBSCRIBED("SUBSCRIBED"), + + UNSUBSCRIBED("UNSUBSCRIBED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public UpdateGroupSubscriptionStatusResponse() {} + + public UpdateGroupSubscriptionStatusResponse name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the group. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the group.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateGroupSubscriptionStatusResponse status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The user subscribed, unsubscribed, or on initial status. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "The user subscribed, unsubscribed, or on initial status.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public UpdateGroupSubscriptionStatusResponse id(String id) { + + this.id = id; + return this; + } + + /** + * The group id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The group id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateGroupSubscriptionStatusResponse updateGroupSubscriptionStatusResponse = + (UpdateGroupSubscriptionStatusResponse) o; + return Objects.equals(this.name, updateGroupSubscriptionStatusResponse.name) + && Objects.equals(this.status, updateGroupSubscriptionStatusResponse.status) + && Objects.equals(this.id, updateGroupSubscriptionStatusResponse.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, status, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateGroupSubscriptionStatusResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("status"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateGroupSubscriptionStatusResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateGroupSubscriptionStatusResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateGroupSubscriptionStatusResponse" + + " is not found in the empty JSON string", + UpdateGroupSubscriptionStatusResponse.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateGroupSubscriptionStatusResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateGroupSubscriptionStatusResponse` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateGroupSubscriptionStatusResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateGroupSubscriptionStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateGroupSubscriptionStatusResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateGroupSubscriptionStatusResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateGroupSubscriptionStatusResponse value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateGroupSubscriptionStatusResponse read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateGroupSubscriptionStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateGroupSubscriptionStatusResponse + * @throws IOException if the JSON string is invalid with respect to + * UpdateGroupSubscriptionStatusResponse + */ + public static UpdateGroupSubscriptionStatusResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateGroupSubscriptionStatusResponse.class); + } + + /** + * Convert an instance of UpdateGroupSubscriptionStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From cdc25c1eb01da9e806ee524f683c9a40cb10e16a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 8 Aug 2023 19:08:00 +0000 Subject: [PATCH 140/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a20a85a. From dd4a9cde0eb3b1347e1f4220f28cfdc7e9c91f0e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 23 Aug 2023 06:06:52 +0000 Subject: [PATCH 141/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@84d22a4. From 7f850b775524de519dc44fd955c975009e045af1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 23 Aug 2023 07:50:49 +0000 Subject: [PATCH 142/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@40c7de8. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 38 + .../segment/publicapi/api/FunctionsApi.java | 922 ++++++++++++++++-- ...eateInsertFunctionInstance200Response.java | 204 ++++ ...reateInsertFunctionInstanceAlphaInput.java | 454 +++++++++ ...eateInsertFunctionInstanceAlphaOutput.java | 221 +++++ ...leteInsertFunctionInstance200Response.java | 204 ++++ ...leteInsertFunctionInstanceAlphaOutput.java | 268 +++++ ...tMessagingSubscriptionSuccessResponse.java | 4 + .../models/InsertFunctionInstance.java | 510 ++++++++++ .../models/InsertFunctionInstance1.java | 512 ++++++++++ .../models/InsertFunctionInstanceAlpha.java | 510 ++++++++++ ...istInsertFunctionInstances200Response.java | 202 ++++ ...istInsertFunctionInstancesAlphaOutput.java | 267 +++++ .../models/MessageSubscriptionResponse.java | 4 + ...dateInsertFunctionInstance200Response.java | 204 ++++ ...pdateInsertFunctionInstanceAlphaInput.java | 293 ++++++ ...dateInsertFunctionInstanceAlphaOutput.java | 221 +++++ 20 files changed, 4968 insertions(+), 82 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java create mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java diff --git a/README.md b/README.md index 42760f97..918c30b1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 36.1.0 +Latest API and SDK version: 36.1.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 36.1.0 + 36.1.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:36.1.0" + implementation "com.segment.publicapi:segment-publicapi:36.1.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-36.1.0.jar` +* `target/segment-publicapi-36.1.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index feb2c500..00425dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 36.1.0 + 36.1.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 0ac40979..6902f22d 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 36.1.0 (Java)"); + setUserAgent("Public API SDK 36.1.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 32b26d4f..39eed4e2 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -239,6 +239,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateInvites200Response .CustomTypeAdapterFactory()); @@ -363,6 +372,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteInvites200Response .CustomTypeAdapterFactory()); @@ -738,6 +753,14 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstance1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstanceAlpha + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.IntegrationOptionBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -820,6 +843,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInsertFunctionInstances200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInsertFunctionInstancesAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListInvites200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1311,6 +1340,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateGroupSubscriptionStatusResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 7ffa3443..44b305e1 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -22,16 +22,22 @@ import com.segment.publicapi.models.CreateFunction200Response; import com.segment.publicapi.models.CreateFunctionDeployment200Response; import com.segment.publicapi.models.CreateFunctionV1Input; +import com.segment.publicapi.models.CreateInsertFunctionInstance200Response; +import com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput; import com.segment.publicapi.models.DeleteFunction200Response; +import com.segment.publicapi.models.DeleteInsertFunctionInstance200Response; import com.segment.publicapi.models.GetFunction200Response; import com.segment.publicapi.models.GetFunctionVersion200Response; import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; +import com.segment.publicapi.models.ListInsertFunctionInstances200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RestoreFunctionVersion200Response; import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; +import com.segment.publicapi.models.UpdateInsertFunctionInstance200Response; +import com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -428,6 +434,189 @@ public okhttp3.Call createFunctionDeploymentAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createInsertFunctionInstance + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createInsertFunctionInstanceCall( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createInsertFunctionInstanceAlphaInput; + + // create path and map variables + String localVarPath = "/insert-function/instance"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createInsertFunctionInstanceValidateBeforeCall( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'createInsertFunctionInstanceAlphaInput' is set + if (createInsertFunctionInstanceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createInsertFunctionInstanceAlphaInput' when" + + " calling createInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = + createInsertFunctionInstanceCall(createInsertFunctionInstanceAlphaInput, _callback); + return localVarCall; + } + + /** + * Create Insert Function Instance Creates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @return CreateInsertFunctionInstance200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateInsertFunctionInstance200Response createInsertFunctionInstance( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createInsertFunctionInstanceWithHttpInfo(createInsertFunctionInstanceAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Insert Function Instance Creates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @return ApiResponse<CreateInsertFunctionInstance200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + createInsertFunctionInstanceWithHttpInfo( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createInsertFunctionInstanceValidateBeforeCall( + createInsertFunctionInstanceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Insert Function Instance (asynchronously) Creates an insert Function instance + * connected to the given Destination. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createInsertFunctionInstanceAsync( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createInsertFunctionInstanceValidateBeforeCall( + createInsertFunctionInstanceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for deleteFunction * @@ -600,6 +789,180 @@ public okhttp3.Call deleteFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for deleteInsertFunctionInstance + * + * @param instanceId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteInsertFunctionInstanceCall( + String instanceId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/insert-function/instance/{instanceId}" + .replaceAll( + "\\{" + "instanceId" + "\\}", + localVarApiClient.escapeString(instanceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteInsertFunctionInstanceValidateBeforeCall( + String instanceId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + "Missing the required parameter 'instanceId' when calling" + + " deleteInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = deleteInsertFunctionInstanceCall(instanceId, _callback); + return localVarCall; + } + + /** + * Delete Insert Function Instance Deletes an insert Function instance. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @return DeleteInsertFunctionInstance200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance(String instanceId) + throws ApiException { + ApiResponse localVarResp = + deleteInsertFunctionInstanceWithHttpInfo(instanceId); + return localVarResp.getData(); + } + + /** + * Delete Insert Function Instance Deletes an insert Function instance. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @return ApiResponse<DeleteInsertFunctionInstance200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + deleteInsertFunctionInstanceWithHttpInfo(String instanceId) throws ApiException { + okhttp3.Call localVarCall = + deleteInsertFunctionInstanceValidateBeforeCall(instanceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Insert Function Instance (asynchronously) Deletes an insert Function instance. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteInsertFunctionInstanceAsync( + String instanceId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteInsertFunctionInstanceValidateBeforeCall(instanceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getFunction * @@ -1091,13 +1454,211 @@ public ListFunctionVersions200Response listFunctionVersions( } /** - * List Function Versions Lists versions for a Function in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Function Versions Lists versions for a Function in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @return ApiResponse<ListFunctionVersions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listFunctionVersionsWithHttpInfo( + String functionId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsAsync( + String functionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listFunctions + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionsCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/functions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + if (resourceType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("resourceType", resourceType)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFunctionsValidateBeforeCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listFunctions(Async)"); + } + + // verify the required parameter 'resourceType' is set + if (resourceType == null) { + throw new ApiException( + "Missing the required parameter 'resourceType' when calling" + + " listFunctions(Async)"); + } + + okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); + return localVarCall; + } + + /** + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ListFunctions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) + throws ApiException { + ApiResponse localVarResp = + listFunctionsWithHttpInfo(pagination, resourceType); + return localVarResp.getData(); + } + + /** + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @return ApiResponse<ListFunctionVersions200Response> + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ApiResponse<ListFunctions200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1109,21 +1670,21 @@ public ListFunctionVersions200Response listFunctionVersions( * 429 Too many requests - * */ - public ApiResponse listFunctionVersionsWithHttpInfo( - String functionId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse listFunctionsWithHttpInfo( + PaginationInput pagination, String resourceType) throws ApiException { + okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. + * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1137,24 +1698,24 @@ public ApiResponse listFunctionVersionsWithHttp * 429 Too many requests - * */ - public okhttp3.Call listFunctionVersionsAsync( - String functionId, + public okhttp3.Call listFunctionsAsync( PaginationInput pagination, - final ApiCallback _callback) + String resourceType, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listFunctionsValidateBeforeCall(pagination, resourceType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listFunctions + * Build call for listInsertFunctionInstances * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1167,8 +1728,8 @@ public okhttp3.Call listFunctionVersionsAsync( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) + public okhttp3.Call listInsertFunctionInstancesCall( + PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1186,7 +1747,7 @@ public okhttp3.Call listFunctionsCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/functions"; + String localVarPath = "/insert-function/instances"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1198,16 +1759,12 @@ public okhttp3.Call listFunctionsCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } - if (resourceType != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("resourceType", resourceType)); + if (functionId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("functionId", functionId)); } final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1238,37 +1795,39 @@ public okhttp3.Call listFunctionsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionsValidateBeforeCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) + private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( + PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling" - + " listFunctions(Async)"); + + " listInsertFunctionInstances(Async)"); } - // verify the required parameter 'resourceType' is set - if (resourceType == null) { + // verify the required parameter 'functionId' is set + if (functionId == null) { throw new ApiException( - "Missing the required parameter 'resourceType' when calling" - + " listFunctions(Async)"); + "Missing the required parameter 'functionId' when calling" + + " listInsertFunctionInstances(Async)"); } - okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); + okhttp3.Call localVarCall = + listInsertFunctionInstancesCall(pagination, functionId, _callback); return localVarCall; } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Insert Function Instances Lists all insert Function instances connected to the given + * insert Function. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ListFunctions200Response + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) + * @return ListInsertFunctionInstances200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1280,22 +1839,23 @@ private okhttp3.Call listFunctionsValidateBeforeCall( * 429 Too many requests - * */ - public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) - throws ApiException { - ApiResponse localVarResp = - listFunctionsWithHttpInfo(pagination, resourceType); + public ListInsertFunctionInstances200Response listInsertFunctionInstances( + PaginationInput pagination, String functionId) throws ApiException { + ApiResponse localVarResp = + listInsertFunctionInstancesWithHttpInfo(pagination, functionId); return localVarResp.getData(); } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Insert Function Instances Lists all insert Function instances connected to the given + * insert Function. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ApiResponse<ListFunctions200Response> + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListInsertFunctionInstances200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1307,21 +1867,25 @@ public ListFunctions200Response listFunctions(PaginationInput pagination, String * 429 Too many requests - * */ - public ApiResponse listFunctionsWithHttpInfo( - PaginationInput pagination, String resourceType) throws ApiException { - okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse + listInsertFunctionInstancesWithHttpInfo(PaginationInput pagination, String functionId) + throws ApiException { + okhttp3.Call localVarCall = + listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Insert Function Instances (asynchronously) Lists all insert Function instances connected + * to the given insert Function. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Functions feature enabled. Please reach out to your customer + * success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1335,15 +1899,16 @@ public ApiResponse listFunctionsWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsAsync( + public okhttp3.Call listInsertFunctionInstancesAsync( PaginationInput pagination, - String resourceType, - final ApiCallback _callback) + String functionId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionsValidateBeforeCall(pagination, resourceType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1744,4 +2309,209 @@ public okhttp3.Call updateFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updateInsertFunctionInstance + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateInsertFunctionInstanceCall( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateInsertFunctionInstanceAlphaInput; + + // create path and map variables + String localVarPath = + "/insert-function/instance/{instanceId}" + .replaceAll( + "\\{" + "instanceId" + "\\}", + localVarApiClient.escapeString(instanceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateInsertFunctionInstanceValidateBeforeCall( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + "Missing the required parameter 'instanceId' when calling" + + " updateInsertFunctionInstance(Async)"); + } + + // verify the required parameter 'updateInsertFunctionInstanceAlphaInput' is set + if (updateInsertFunctionInstanceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateInsertFunctionInstanceAlphaInput' when" + + " calling updateInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = + updateInsertFunctionInstanceCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); + return localVarCall; + } + + /** + * Update Insert Function Instance Updates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @return UpdateInsertFunctionInstance200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateInsertFunctionInstance200Response updateInsertFunctionInstance( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateInsertFunctionInstanceWithHttpInfo( + instanceId, updateInsertFunctionInstanceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Insert Function Instance Updates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @return ApiResponse<UpdateInsertFunctionInstance200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateInsertFunctionInstanceWithHttpInfo( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateInsertFunctionInstanceValidateBeforeCall( + instanceId, updateInsertFunctionInstanceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Insert Function Instance (asynchronously) Updates an insert Function instance + * connected to the given Destination. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateInsertFunctionInstanceAsync( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateInsertFunctionInstanceValidateBeforeCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java new file mode 100644 index 00000000..1cc532a5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** CreateInsertFunctionInstance200Response */ +public class CreateInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateInsertFunctionInstanceAlphaOutput data; + + public CreateInsertFunctionInstance200Response() {} + + public CreateInsertFunctionInstance200Response data( + CreateInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(CreateInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstance200Response createInsertFunctionInstance200Response = + (CreateInsertFunctionInstance200Response) o; + return Objects.equals(this.data, createInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + CreateInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstance200Response + */ + public static CreateInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java new file mode 100644 index 00000000..2ee247d9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java @@ -0,0 +1,454 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Creates an insert Function instance. */ +@ApiModel(description = "Creates an insert Function instance.") +public class CreateInsertFunctionInstanceAlphaInput { + public static final String SERIALIZED_NAME_FUNCTION_ID = "functionId"; + + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + private String functionId; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + /** The insert Function type. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INSERT_FUNCTION_DESTINATION("INSERT_FUNCTION_DESTINATION"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public CreateInsertFunctionInstanceAlphaInput() {} + + public CreateInsertFunctionInstanceAlphaInput functionId(String functionId) { + + this.functionId = functionId; + return this; + } + + /** + * Insert Function id to which this instance is associated. + * + * @return functionId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Insert Function id to which this instance is associated.") + public String getFunctionId() { + return functionId; + } + + public void setFunctionId(String functionId) { + this.functionId = functionId; + } + + public CreateInsertFunctionInstanceAlphaInput integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * The Source or Destination id to be connected. + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source or Destination id to be connected.") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public CreateInsertFunctionInstanceAlphaInput type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The insert Function type. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The insert Function type.") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public CreateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether this insert Function instance should be enabled for the Destination. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this insert Function instance should be enabled for the Destination.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateInsertFunctionInstanceAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * Defines the display name of the insert Function instance. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Defines the display name of the insert Function instance.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateInsertFunctionInstanceAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + public CreateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * An object that contains settings for this insert Function instance based on the settings + * present in the insert Function class. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for this insert Function instance based on" + + " the settings present in the insert Function class.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput = + (CreateInsertFunctionInstanceAlphaInput) o; + return Objects.equals(this.functionId, createInsertFunctionInstanceAlphaInput.functionId) + && Objects.equals( + this.integrationId, createInsertFunctionInstanceAlphaInput.integrationId) + && Objects.equals(this.type, createInsertFunctionInstanceAlphaInput.type) + && Objects.equals(this.enabled, createInsertFunctionInstanceAlphaInput.enabled) + && Objects.equals(this.name, createInsertFunctionInstanceAlphaInput.name) + && Objects.equals(this.settings, createInsertFunctionInstanceAlphaInput.settings); + } + + @Override + public int hashCode() { + return Objects.hash(functionId, integrationId, type, enabled, name, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstanceAlphaInput {\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("functionId"); + openapiFields.add("integrationId"); + openapiFields.add("type"); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("functionId"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstanceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateInsertFunctionInstanceAlphaInput" + + " is not found in the empty JSON string", + CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstanceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("functionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `functionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("functionId").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstanceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstanceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstanceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstanceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstanceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstanceAlphaInput + */ + public static CreateInsertFunctionInstanceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaInput.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstanceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..19d37394 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Creates an insert Function instance. */ +@ApiModel(description = "Creates an insert Function instance.") +public class CreateInsertFunctionInstanceAlphaOutput { + public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; + + @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) + private InsertFunctionInstance insertFunctionInstance; + + public CreateInsertFunctionInstanceAlphaOutput() {} + + public CreateInsertFunctionInstanceAlphaOutput insertFunctionInstance( + InsertFunctionInstance insertFunctionInstance) { + + this.insertFunctionInstance = insertFunctionInstance; + return this; + } + + /** + * Get insertFunctionInstance + * + * @return insertFunctionInstance + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public InsertFunctionInstance getInsertFunctionInstance() { + return insertFunctionInstance; + } + + public void setInsertFunctionInstance(InsertFunctionInstance insertFunctionInstance) { + this.insertFunctionInstance = insertFunctionInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstanceAlphaOutput createInsertFunctionInstanceAlphaOutput = + (CreateInsertFunctionInstanceAlphaOutput) o; + return Objects.equals( + this.insertFunctionInstance, + createInsertFunctionInstanceAlphaOutput.insertFunctionInstance); + } + + @Override + public int hashCode() { + return Objects.hash(insertFunctionInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" insertFunctionInstance: ") + .append(toIndentedString(insertFunctionInstance)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("insertFunctionInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("insertFunctionInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstanceAlphaOutput + */ + public static CreateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java new file mode 100644 index 00000000..00630b51 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** DeleteInsertFunctionInstance200Response */ +public class DeleteInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteInsertFunctionInstanceAlphaOutput data; + + public DeleteInsertFunctionInstance200Response() {} + + public DeleteInsertFunctionInstance200Response data( + DeleteInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(DeleteInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance200Response = + (DeleteInsertFunctionInstance200Response) o; + return Objects.equals(this.data, deleteInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DeleteInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + DeleteInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DeleteInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DeleteInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteInsertFunctionInstance200Response + */ + public static DeleteInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of DeleteInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..99baa644 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete an insert Function instance. */ +@ApiModel(description = "Delete an insert Function instance.") +public class DeleteInsertFunctionInstanceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteInsertFunctionInstanceAlphaOutput() {} + + public DeleteInsertFunctionInstanceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInsertFunctionInstanceAlphaOutput deleteInsertFunctionInstanceAlphaOutput = + (DeleteInsertFunctionInstanceAlphaOutput) o; + return Objects.equals(this.status, deleteInsertFunctionInstanceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DeleteInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DeleteInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DeleteInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * DeleteInsertFunctionInstanceAlphaOutput + */ + public static DeleteInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of DeleteInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index ac6945b9..05ac64d3 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -43,8 +43,12 @@ public class GetMessagingSubscriptionSuccessResponse { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java new file mode 100644 index 00000000..3c0cadf9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created instance. */ +@ApiModel(description = "The created instance.") +public class InsertFunctionInstance { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstance() {} + + public InsertFunctionInstance id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstance name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstance integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstance classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstance enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstance createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstance updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstance settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstance putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstance encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstance putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstance insertFunctionInstance = (InsertFunctionInstance) o; + return Objects.equals(this.id, insertFunctionInstance.id) + && Objects.equals(this.name, insertFunctionInstance.name) + && Objects.equals(this.integrationId, insertFunctionInstance.integrationId) + && Objects.equals(this.classId, insertFunctionInstance.classId) + && Objects.equals(this.enabled, insertFunctionInstance.enabled) + && Objects.equals(this.createdAt, insertFunctionInstance.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstance.updatedAt) + && Objects.equals(this.settings, insertFunctionInstance.settings) + && Objects.equals(this.encryptedSettings, insertFunctionInstance.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstance {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstance.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstance is not found in" + + " the empty JSON string", + InsertFunctionInstance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstance` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstance value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstance given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstance + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance + */ + public static InsertFunctionInstance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstance.class); + } + + /** + * Convert an instance of InsertFunctionInstance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java new file mode 100644 index 00000000..88b17c35 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java @@ -0,0 +1,512 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated instance. */ +@ApiModel(description = "The updated instance.") +public class InsertFunctionInstance1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstance1() {} + + public InsertFunctionInstance1 id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstance1 name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstance1 integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstance1 classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstance1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstance1 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstance1 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstance1 settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstance1 putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstance1 encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstance1 putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstance1 insertFunctionInstance1 = (InsertFunctionInstance1) o; + return Objects.equals(this.id, insertFunctionInstance1.id) + && Objects.equals(this.name, insertFunctionInstance1.name) + && Objects.equals(this.integrationId, insertFunctionInstance1.integrationId) + && Objects.equals(this.classId, insertFunctionInstance1.classId) + && Objects.equals(this.enabled, insertFunctionInstance1.enabled) + && Objects.equals(this.createdAt, insertFunctionInstance1.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstance1.updatedAt) + && Objects.equals(this.settings, insertFunctionInstance1.settings) + && Objects.equals( + this.encryptedSettings, insertFunctionInstance1.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstance1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstance1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstance1 is not found" + + " in the empty JSON string", + InsertFunctionInstance1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstance1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstance1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstance1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstance1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstance1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstance1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstance1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstance1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstance1 + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance1 + */ + public static InsertFunctionInstance1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstance1.class); + } + + /** + * Convert an instance of InsertFunctionInstance1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java new file mode 100644 index 00000000..f64bb2d2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** InsertFunctionInstanceAlpha */ +public class InsertFunctionInstanceAlpha { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstanceAlpha() {} + + public InsertFunctionInstanceAlpha id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstanceAlpha name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstanceAlpha integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstanceAlpha classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstanceAlpha enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstanceAlpha createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstanceAlpha updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstanceAlpha settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstanceAlpha putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstanceAlpha encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstanceAlpha putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstanceAlpha insertFunctionInstanceAlpha = (InsertFunctionInstanceAlpha) o; + return Objects.equals(this.id, insertFunctionInstanceAlpha.id) + && Objects.equals(this.name, insertFunctionInstanceAlpha.name) + && Objects.equals(this.integrationId, insertFunctionInstanceAlpha.integrationId) + && Objects.equals(this.classId, insertFunctionInstanceAlpha.classId) + && Objects.equals(this.enabled, insertFunctionInstanceAlpha.enabled) + && Objects.equals(this.createdAt, insertFunctionInstanceAlpha.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstanceAlpha.updatedAt) + && Objects.equals(this.settings, insertFunctionInstanceAlpha.settings) + && Objects.equals( + this.encryptedSettings, insertFunctionInstanceAlpha.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstanceAlpha {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstanceAlpha + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstanceAlpha.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstanceAlpha is not" + + " found in the empty JSON string", + InsertFunctionInstanceAlpha.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstanceAlpha.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstanceAlpha` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstanceAlpha.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstanceAlpha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstanceAlpha' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstanceAlpha.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstanceAlpha value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstanceAlpha read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstanceAlpha given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstanceAlpha + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstanceAlpha + */ + public static InsertFunctionInstanceAlpha fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstanceAlpha.class); + } + + /** + * Convert an instance of InsertFunctionInstanceAlpha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java new file mode 100644 index 00000000..3ef99e9a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListInsertFunctionInstances200Response */ +public class ListInsertFunctionInstances200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListInsertFunctionInstancesAlphaOutput data; + + public ListInsertFunctionInstances200Response() {} + + public ListInsertFunctionInstances200Response data( + ListInsertFunctionInstancesAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListInsertFunctionInstancesAlphaOutput getData() { + return data; + } + + public void setData(ListInsertFunctionInstancesAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInsertFunctionInstances200Response listInsertFunctionInstances200Response = + (ListInsertFunctionInstances200Response) o; + return Objects.equals(this.data, listInsertFunctionInstances200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInsertFunctionInstances200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListInsertFunctionInstances200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListInsertFunctionInstances200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListInsertFunctionInstances200Response" + + " is not found in the empty JSON string", + ListInsertFunctionInstances200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListInsertFunctionInstances200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListInsertFunctionInstances200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListInsertFunctionInstances200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInsertFunctionInstances200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListInsertFunctionInstances200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListInsertFunctionInstances200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListInsertFunctionInstances200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListInsertFunctionInstances200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInsertFunctionInstances200Response + * @throws IOException if the JSON string is invalid with respect to + * ListInsertFunctionInstances200Response + */ + public static ListInsertFunctionInstances200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstances200Response.class); + } + + /** + * Convert an instance of ListInsertFunctionInstances200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java new file mode 100644 index 00000000..2dfba5f1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java @@ -0,0 +1,267 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns a list of insert Function instances connected to the insert Function. */ +@ApiModel( + description = + "Returns a list of insert Function instances connected to the insert Function.") +public class ListInsertFunctionInstancesAlphaOutput { + public static final String SERIALIZED_NAME_INSTANCES = "instances"; + + @SerializedName(SERIALIZED_NAME_INSTANCES) + private List instances = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListInsertFunctionInstancesAlphaOutput() {} + + public ListInsertFunctionInstancesAlphaOutput instances( + List instances) { + + this.instances = instances; + return this; + } + + public ListInsertFunctionInstancesAlphaOutput addInstancesItem( + InsertFunctionInstanceAlpha instancesItem) { + this.instances.add(instancesItem); + return this; + } + + /** + * All insert Function instances found. + * + * @return instances + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "All insert Function instances found.") + public List getInstances() { + return instances; + } + + public void setInstances(List instances) { + this.instances = instances; + } + + public ListInsertFunctionInstancesAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInsertFunctionInstancesAlphaOutput listInsertFunctionInstancesAlphaOutput = + (ListInsertFunctionInstancesAlphaOutput) o; + return Objects.equals(this.instances, listInsertFunctionInstancesAlphaOutput.instances) + && Objects.equals( + this.pagination, listInsertFunctionInstancesAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(instances, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInsertFunctionInstancesAlphaOutput {\n"); + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instances"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instances"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListInsertFunctionInstancesAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListInsertFunctionInstancesAlphaOutput" + + " is not found in the empty JSON string", + ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListInsertFunctionInstancesAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListInsertFunctionInstancesAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("instances").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `instances` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("instances").toString())); + } + + JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("instances"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListInsertFunctionInstancesAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInsertFunctionInstancesAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListInsertFunctionInstancesAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListInsertFunctionInstancesAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListInsertFunctionInstancesAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListInsertFunctionInstancesAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInsertFunctionInstancesAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListInsertFunctionInstancesAlphaOutput + */ + public static ListInsertFunctionInstancesAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstancesAlphaOutput.class); + } + + /** + * Convert an instance of ListInsertFunctionInstancesAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 4c937f19..56c8c90d 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -43,8 +43,12 @@ public class MessageSubscriptionResponse { /** Type is communication medium used. Either SMS, EMAIL or WHATSAPP. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java new file mode 100644 index 00000000..013bb044 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateInsertFunctionInstance200Response */ +public class UpdateInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateInsertFunctionInstanceAlphaOutput data; + + public UpdateInsertFunctionInstance200Response() {} + + public UpdateInsertFunctionInstance200Response data( + UpdateInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(UpdateInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstance200Response updateInsertFunctionInstance200Response = + (UpdateInsertFunctionInstance200Response) o; + return Objects.equals(this.data, updateInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + UpdateInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstance200Response + */ + public static UpdateInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java new file mode 100644 index 00000000..4b1e6365 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java @@ -0,0 +1,293 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Updates an insert Function instance. */ +@ApiModel(description = "Updates an insert Function instance.") +public class UpdateInsertFunctionInstanceAlphaInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public UpdateInsertFunctionInstanceAlphaInput() {} + + public UpdateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether this insert Function instance should be enabled for the Destination. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this insert Function instance should be enabled for the Destination.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateInsertFunctionInstanceAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * Defines the display name of the insert Function instance. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Defines the display name of the insert Function instance.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateInsertFunctionInstanceAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + public UpdateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * An object that contains settings for this insert Function instance based on the settings + * present in the insert Function class. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for this insert Function instance based on" + + " the settings present in the insert Function class.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput = + (UpdateInsertFunctionInstanceAlphaInput) o; + return Objects.equals(this.enabled, updateInsertFunctionInstanceAlphaInput.enabled) + && Objects.equals(this.name, updateInsertFunctionInstanceAlphaInput.name) + && Objects.equals(this.settings, updateInsertFunctionInstanceAlphaInput.settings); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, name, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstanceAlphaInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstanceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateInsertFunctionInstanceAlphaInput" + + " is not found in the empty JSON string", + UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstanceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstanceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstanceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstanceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstanceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstanceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstanceAlphaInput + */ + public static UpdateInsertFunctionInstanceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaInput.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstanceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..30658358 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns the updated insert Function instance. */ +@ApiModel(description = "Returns the updated insert Function instance.") +public class UpdateInsertFunctionInstanceAlphaOutput { + public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; + + @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) + private InsertFunctionInstance1 insertFunctionInstance; + + public UpdateInsertFunctionInstanceAlphaOutput() {} + + public UpdateInsertFunctionInstanceAlphaOutput insertFunctionInstance( + InsertFunctionInstance1 insertFunctionInstance) { + + this.insertFunctionInstance = insertFunctionInstance; + return this; + } + + /** + * Get insertFunctionInstance + * + * @return insertFunctionInstance + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public InsertFunctionInstance1 getInsertFunctionInstance() { + return insertFunctionInstance; + } + + public void setInsertFunctionInstance(InsertFunctionInstance1 insertFunctionInstance) { + this.insertFunctionInstance = insertFunctionInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstanceAlphaOutput updateInsertFunctionInstanceAlphaOutput = + (UpdateInsertFunctionInstanceAlphaOutput) o; + return Objects.equals( + this.insertFunctionInstance, + updateInsertFunctionInstanceAlphaOutput.insertFunctionInstance); + } + + @Override + public int hashCode() { + return Objects.hash(insertFunctionInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" insertFunctionInstance: ") + .append(toIndentedString(insertFunctionInstance)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("insertFunctionInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("insertFunctionInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstanceAlphaOutput + */ + public static UpdateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 92d7b2d40463e3e639f07d04e1a488a0c36cb960 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 31 Aug 2023 15:20:11 +0000 Subject: [PATCH 143/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d95285ec. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 60 ++ .../segment/publicapi/api/AudiencesApi.java | 875 +++++++++++++++++ .../publicapi/api/ComputedTraitsApi.java | 897 ++++++++++++++++++ .../com/segment/publicapi/api/EventsApi.java | 6 +- .../segment/publicapi/models/Audience.java | 546 +++++++++++ .../publicapi/models/AudienceSummary.java | 547 +++++++++++ .../publicapi/models/ComputedTrait.java | 546 +++++++++++ .../models/ComputedTraitSummary.java | 547 +++++++++++ .../models/GetAudience200Response.java | 191 ++++ .../models/GetAudienceAlphaOutput.java | 204 ++++ .../models/GetComputedTrait200Response.java | 192 ++++ .../models/GetComputedTraitAlphaOutput.java | 205 ++++ .../models/GetSubscriptionRequest.java | 4 + .../models/ListAudiences200Response.java | 192 ++++ .../models/ListAudiencesAlphaOutput.java | 253 +++++ .../models/ListComputedTraits200Response.java | 197 ++++ .../models/ListComputedTraitsAlphaOutput.java | 259 +++++ .../models/MessagesSubscriptionRequest.java | 4 + .../RemoveAudienceFromSpace200Response.java | 199 ++++ .../RemoveAudienceFromSpaceAlphaOutput.java | 264 ++++++ ...moveComputedTraitFromSpace200Response.java | 204 ++++ ...moveComputedTraitFromSpaceAlphaOutput.java | 268 ++++++ .../UpdateAudienceForSpace200Response.java | 198 ++++ .../UpdateAudienceForSpaceAlphaOutput.java | 211 ++++ .../models/UpdateAudienceForSpaceInput.java | 205 ++++ ...pdateComputedTraitForSpace200Response.java | 202 ++++ ...UpdateComputedTraitForSpaceAlphaInput.java | 214 +++++ ...pdateComputedTraitForSpaceAlphaOutput.java | 215 +++++ 31 files changed, 7908 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/api/AudiencesApi.java create mode 100644 src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java create mode 100644 src/main/java/com/segment/publicapi/models/Audience.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummary.java create mode 100644 src/main/java/com/segment/publicapi/models/ComputedTrait.java create mode 100644 src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiences200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java diff --git a/README.md b/README.md index 918c30b1..6ecc4cc9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 36.1.1 +Latest API and SDK version: 36.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 36.1.1 + 36.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:36.1.1" + implementation "com.segment.publicapi:segment-publicapi:36.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-36.1.1.jar` +* `target/segment-publicapi-36.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 00425dc8..b925423e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 36.1.1 + 36.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 6902f22d..1d2f0beb 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 36.1.1 (Java)"); + setUserAgent("Public API SDK 36.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 39eed4e2..bb47364c 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -164,6 +164,10 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Audience.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -179,6 +183,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ComputedTrait.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ComputedTraitSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -556,6 +564,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouseV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudience200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetComputedTrait200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetComputedTraitAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetConnectionStateFromWarehouse200Response .CustomTypeAdapterFactory()); @@ -775,12 +793,24 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiences200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEventsV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListComputedTraits200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListComputedTraitsAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response .CustomTypeAdapterFactory()); @@ -1081,6 +1111,18 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveAudienceFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveAudienceFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveComputedTraitFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestination200Response .CustomTypeAdapterFactory()); @@ -1312,6 +1354,24 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateAudienceForSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateAudienceForSpaceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateAudienceForSpaceInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateComputedTraitForSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java new file mode 100644 index 00000000..d56b00a4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -0,0 +1,875 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.ListAudiences200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; +import com.segment.publicapi.models.UpdateAudienceForSpace200Response; +import com.segment.publicapi.models.UpdateAudienceForSpaceInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AudiencesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AudiencesApi() { + this(Configuration.getDefaultApiClient()); + } + + public AudiencesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getAudience + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudienceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling getAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getAudience(Async)"); + } + + okhttp3.Call localVarCall = getAudienceCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @return GetAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudience200Response getAudience(String spaceId, String id) throws ApiException { + ApiResponse localVarResp = getAudienceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<GetAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getAudienceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceAsync( + String spaceId, String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listAudiences + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudiencesCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAudiencesValidateBeforeCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listAudiences(Async)"); + } + + okhttp3.Call localVarCall = listAudiencesCall(spaceId, pagination, _callback); + return localVarCall; + } + + /** + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending email to friends@segment.com. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ListAudiences200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listAudiencesWithHttpInfo(spaceId, pagination); + return localVarResp.getData(); + } + + /** + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending email to friends@segment.com. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please + * reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ApiResponse<ListAudiences200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listAudiencesWithHttpInfo( + String spaceId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudiencesAsync( + String spaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removeAudienceFromSpace + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeAudienceFromSpaceCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeAudienceFromSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " removeAudienceFromSpace(Async)"); + } + + okhttp3.Call localVarCall = removeAudienceFromSpaceCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Deleted` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param id (required) + * @return RemoveAudienceFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveAudienceFromSpace200Response removeAudienceFromSpace(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + removeAudienceFromSpaceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Deleted` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<RemoveAudienceFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse removeAudienceFromSpaceWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = removeAudienceFromSpaceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Audience from Space (asynchronously) Deletes an Audience by id and spaceId. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Audience + * Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeAudienceFromSpaceAsync( + String spaceId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeAudienceFromSpaceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateAudienceForSpace + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateAudienceForSpaceCall( + String spaceId, + String id, + UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateAudienceForSpaceInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( + String spaceId, + String id, + UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateAudienceForSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " updateAudienceForSpace(Async)"); + } + + // verify the required parameter 'updateAudienceForSpaceInput' is set + if (updateAudienceForSpaceInput == null) { + throw new ApiException( + "Missing the required parameter 'updateAudienceForSpaceInput' when calling" + + " updateAudienceForSpace(Async)"); + } + + okhttp3.Call localVarCall = + updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceInput, _callback); + return localVarCall; + } + + /** + * Update Audience for Space Updates the enabled status for an audience • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Modified` event in the [audit + * trail](/tag/Audit-Trail). • Note that when the definition of a Audience is updated, the + * Audience will be locked from future edits until the changes have been incorporated. You can + * find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @return UpdateAudienceForSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateAudienceForSpace200Response updateAudienceForSpace( + String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) + throws ApiException { + ApiResponse localVarResp = + updateAudienceForSpaceWithHttpInfo(spaceId, id, updateAudienceForSpaceInput); + return localVarResp.getData(); + } + + /** + * Update Audience for Space Updates the enabled status for an audience • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Modified` event in the [audit + * trail](/tag/Audit-Trail). • Note that when the definition of a Audience is updated, the + * Audience will be locked from future edits until the changes have been incorporated. You can + * find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @return ApiResponse<UpdateAudienceForSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse updateAudienceForSpaceWithHttpInfo( + String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) + throws ApiException { + okhttp3.Call localVarCall = + updateAudienceForSpaceValidateBeforeCall( + spaceId, id, updateAudienceForSpaceInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Audience for Space (asynchronously) Updates the enabled status for an audience • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Audience + * Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the definition + * of a Audience is updated, the Audience will be locked from future edits until the changes + * have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateAudienceForSpaceAsync( + String spaceId, + String id, + UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateAudienceForSpaceValidateBeforeCall( + spaceId, id, updateAudienceForSpaceInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java new file mode 100644 index 00000000..6edec67b --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -0,0 +1,897 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.GetComputedTrait200Response; +import com.segment.publicapi.models.ListComputedTraits200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response; +import com.segment.publicapi.models.UpdateComputedTraitForSpace200Response; +import com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ComputedTraitsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ComputedTraitsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ComputedTraitsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getComputedTrait + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getComputedTraitCall(String spaceId, String id, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getComputedTraitValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getComputedTrait(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getComputedTrait(Async)"); + } + + okhttp3.Call localVarCall = getComputedTraitCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Computed + * Traits feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @return GetComputedTrait200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetComputedTrait200Response getComputedTrait(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + getComputedTraitWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Computed + * Traits feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<GetComputedTrait200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getComputedTraitWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = getComputedTraitValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Computed Trait (asynchronously) Returns the Computed Trait by id and spaceId • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getComputedTraitAsync( + String spaceId, String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getComputedTraitValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listComputedTraits + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listComputedTraitsCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listComputedTraitsValidateBeforeCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listComputedTraits(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listComputedTraits(Async)"); + } + + okhttp3.Call localVarCall = listComputedTraitsCall(spaceId, pagination, _callback); + return localVarCall; + } + + /** + * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Computed Traits + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ListComputedTraits200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListComputedTraits200Response listComputedTraits( + String spaceId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listComputedTraitsWithHttpInfo(spaceId, pagination); + return localVarResp.getData(); + } + + /** + * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Computed Traits + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ApiResponse<ListComputedTraits200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listComputedTraitsWithHttpInfo( + String spaceId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listComputedTraitsValidateBeforeCall(spaceId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Computed Traits (asynchronously) Returns Computed Traits by spaceId. • This endpoint is + * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Computed Traits feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listComputedTraitsAsync( + String spaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listComputedTraitsValidateBeforeCall(spaceId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removeComputedTraitFromSpace + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeComputedTraitFromSpaceCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeComputedTraitFromSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " removeComputedTraitFromSpace(Async)"); + } + + okhttp3.Call localVarCall = removeComputedTraitFromSpaceCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Computed Traits feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Computed Trait Deleted` + * event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param id (required) + * @return RemoveComputedTraitFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( + String spaceId, String id) throws ApiException { + ApiResponse localVarResp = + removeComputedTraitFromSpaceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Computed Traits feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Computed Trait Deleted` + * event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<RemoveComputedTraitFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + removeComputedTraitFromSpaceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = + removeComputedTraitFromSpaceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Computed Trait from Space (asynchronously) Deletes a Computed Trait by id and spaceId. + * • This endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeComputedTraitFromSpaceAsync( + String spaceId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeComputedTraitFromSpaceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateComputedTraitForSpace + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateComputedTraitForSpaceCall( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateComputedTraitForSpaceAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateComputedTraitForSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " updateComputedTraitForSpace(Async)"); + } + + // verify the required parameter 'updateComputedTraitForSpaceAlphaInput' is set + if (updateComputedTraitForSpaceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateComputedTraitForSpaceAlphaInput' when" + + " calling updateComputedTraitForSpace(Async)"); + } + + okhttp3.Call localVarCall = + updateComputedTraitForSpaceCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); + return localVarCall; + } + + /** + * Update Computed Trait for Space Updates the enabled status for a computed trait. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the + * definition of a is updated, the will be locked from future edits until the changes have been + * incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/). + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @return UpdateComputedTraitForSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateComputedTraitForSpaceWithHttpInfo( + spaceId, id, updateComputedTraitForSpaceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Computed Trait for Space Updates the enabled status for a computed trait. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the + * definition of a is updated, the will be locked from future edits until the changes have been + * incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/). + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @return ApiResponse<UpdateComputedTraitForSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateComputedTraitForSpaceWithHttpInfo( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateComputedTraitForSpaceValidateBeforeCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Computed Trait for Space (asynchronously) Updates the enabled status for a computed + * trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending email + * to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Computed Traits feature enabled. Please reach out to your + * customer success manager for more information. • When called, this endpoint may generate the + * `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that + * when the definition of a is updated, the will be locked from future edits until the changes + * have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/). + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateComputedTraitForSpaceAsync( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateComputedTraitForSpaceValidateBeforeCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index 7e7dccd4..daeccfc1 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -264,7 +264,7 @@ private okhttp3.Call getEventsVolumeFromWorkspaceValidateBeforeCall( /** * Get Events Volume from Workspace Enumerates the Workspace event volumes over time in minute - * increments. The rate limit for this endpoint is 20 requests per minute, which is lower than + * increments. The rate limit for this endpoint is 60 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -329,7 +329,7 @@ public GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace( /** * Get Events Volume from Workspace Enumerates the Workspace event volumes over time in minute - * increments. The rate limit for this endpoint is 20 requests per minute, which is lower than + * increments. The rate limit for this endpoint is 60 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -398,7 +398,7 @@ public GetEventsVolumeFromWorkspace200Response getEventsVolumeFromWorkspace( /** * Get Events Volume from Workspace (asynchronously) Enumerates the Workspace event volumes over - * time in minute increments. The rate limit for this endpoint is 20 requests per minute, which + * time in minute increments. The rate limit for this endpoint is 60 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint * will respond with the 429 HTTP status code with headers indicating the limit parameters. See * [Rate Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/models/Audience.java b/src/main/java/com/segment/publicapi/models/Audience.java new file mode 100644 index 00000000..2b085c47 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Audience.java @@ -0,0 +1,546 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The audience summary output. */ +@ApiModel(description = "The audience summary output.") +public class Audience { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public Audience() {} + + public Audience id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Audience id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Audience spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the audience.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public Audience name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the audience.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Audience description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the audience.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Audience key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the audience.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public Audience enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Audience createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the audience.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Audience updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the audience.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public Audience createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was created.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Audience updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was last updated.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Audience audience = (Audience) o; + return Objects.equals(this.id, audience.id) + && Objects.equals(this.spaceId, audience.spaceId) + && Objects.equals(this.name, audience.name) + && Objects.equals(this.description, audience.description) + && Objects.equals(this.key, audience.key) + && Objects.equals(this.enabled, audience.enabled) + && Objects.equals(this.createdBy, audience.createdBy) + && Objects.equals(this.updatedBy, audience.updatedBy) + && Objects.equals(this.createdAt, audience.createdAt) + && Objects.equals(this.updatedAt, audience.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Audience {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Audience + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Audience.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Audience is not found in the empty" + + " JSON string", + Audience.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Audience.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Audience`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Audience.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Audience.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Audience' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Audience.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Audience value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Audience read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Audience given an JSON string + * + * @param jsonString JSON string + * @return An instance of Audience + * @throws IOException if the JSON string is invalid with respect to Audience + */ + public static Audience fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Audience.class); + } + + /** + * Convert an instance of Audience to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java new file mode 100644 index 00000000..cb21bf50 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -0,0 +1,547 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines an Audience. */ +@ApiModel(description = "Defines an Audience.") +public class AudienceSummary { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public AudienceSummary() {} + + public AudienceSummary id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Audience id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummary spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the audience.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummary name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the audience.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummary description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the audience.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummary key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the audience.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummary enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummary createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the audience.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummary updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the audience.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummary createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was created.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummary updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was last updated.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummary audienceSummary = (AudienceSummary) o; + return Objects.equals(this.id, audienceSummary.id) + && Objects.equals(this.spaceId, audienceSummary.spaceId) + && Objects.equals(this.name, audienceSummary.name) + && Objects.equals(this.description, audienceSummary.description) + && Objects.equals(this.key, audienceSummary.key) + && Objects.equals(this.enabled, audienceSummary.enabled) + && Objects.equals(this.createdBy, audienceSummary.createdBy) + && Objects.equals(this.updatedBy, audienceSummary.updatedBy) + && Objects.equals(this.createdAt, audienceSummary.createdAt) + && Objects.equals(this.updatedAt, audienceSummary.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AudienceSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AudienceSummary.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSummary is not found in the" + + " empty JSON string", + AudienceSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AudienceSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummary` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSummary.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSummary.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSummary value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummary + * @throws IOException if the JSON string is invalid with respect to AudienceSummary + */ + public static AudienceSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSummary.class); + } + + /** + * Convert an instance of AudienceSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTrait.java b/src/main/java/com/segment/publicapi/models/ComputedTrait.java new file mode 100644 index 00000000..71624541 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ComputedTrait.java @@ -0,0 +1,546 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The computed trait summary output. */ +@ApiModel(description = "The computed trait summary output.") +public class ComputedTrait { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public ComputedTrait() {} + + public ComputedTrait id(String id) { + + this.id = id; + return this; + } + + /** + * Computed trait id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Computed trait id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ComputedTrait spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the computed trait. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the computed trait.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ComputedTrait name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the computed trait. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the computed trait.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ComputedTrait description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the computed trait. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the computed trait.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ComputedTrait key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the computed trait. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the computed trait.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ComputedTrait enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the computed trait. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ComputedTrait createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the computed trait. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the computed trait.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public ComputedTrait updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the computed trait. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public ComputedTrait createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of the computed trait's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public ComputedTrait updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of the computed trait's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComputedTrait computedTrait = (ComputedTrait) o; + return Objects.equals(this.id, computedTrait.id) + && Objects.equals(this.spaceId, computedTrait.spaceId) + && Objects.equals(this.name, computedTrait.name) + && Objects.equals(this.description, computedTrait.description) + && Objects.equals(this.key, computedTrait.key) + && Objects.equals(this.enabled, computedTrait.enabled) + && Objects.equals(this.createdBy, computedTrait.createdBy) + && Objects.equals(this.updatedBy, computedTrait.updatedBy) + && Objects.equals(this.createdAt, computedTrait.createdAt) + && Objects.equals(this.updatedAt, computedTrait.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComputedTrait {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ComputedTrait + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ComputedTrait.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ComputedTrait is not found in the" + + " empty JSON string", + ComputedTrait.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ComputedTrait.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ComputedTrait` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComputedTrait.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComputedTrait.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComputedTrait' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ComputedTrait.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ComputedTrait value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ComputedTrait read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ComputedTrait given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComputedTrait + * @throws IOException if the JSON string is invalid with respect to ComputedTrait + */ + public static ComputedTrait fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComputedTrait.class); + } + + /** + * Convert an instance of ComputedTrait to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java new file mode 100644 index 00000000..e330303e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -0,0 +1,547 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines a Computed trait. */ +@ApiModel(description = "Defines a Computed trait.") +public class ComputedTraitSummary { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public ComputedTraitSummary() {} + + public ComputedTraitSummary id(String id) { + + this.id = id; + return this; + } + + /** + * Computed trait id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Computed trait id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ComputedTraitSummary spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the computed trait. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the computed trait.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ComputedTraitSummary name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the computed trait. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the computed trait.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ComputedTraitSummary description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the computed trait. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the computed trait.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ComputedTraitSummary key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the computed trait. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the computed trait.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ComputedTraitSummary enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the computed trait. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ComputedTraitSummary createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the computed trait. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the computed trait.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public ComputedTraitSummary updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the computed trait. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public ComputedTraitSummary createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of the computed trait's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public ComputedTraitSummary updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of the computed trait's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComputedTraitSummary computedTraitSummary = (ComputedTraitSummary) o; + return Objects.equals(this.id, computedTraitSummary.id) + && Objects.equals(this.spaceId, computedTraitSummary.spaceId) + && Objects.equals(this.name, computedTraitSummary.name) + && Objects.equals(this.description, computedTraitSummary.description) + && Objects.equals(this.key, computedTraitSummary.key) + && Objects.equals(this.enabled, computedTraitSummary.enabled) + && Objects.equals(this.createdBy, computedTraitSummary.createdBy) + && Objects.equals(this.updatedBy, computedTraitSummary.updatedBy) + && Objects.equals(this.createdAt, computedTraitSummary.createdAt) + && Objects.equals(this.updatedAt, computedTraitSummary.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComputedTraitSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ComputedTraitSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ComputedTraitSummary.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ComputedTraitSummary is not found in" + + " the empty JSON string", + ComputedTraitSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ComputedTraitSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ComputedTraitSummary` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComputedTraitSummary.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComputedTraitSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComputedTraitSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ComputedTraitSummary.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ComputedTraitSummary value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ComputedTraitSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ComputedTraitSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComputedTraitSummary + * @throws IOException if the JSON string is invalid with respect to ComputedTraitSummary + */ + public static ComputedTraitSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComputedTraitSummary.class); + } + + /** + * Convert an instance of ComputedTraitSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java new file mode 100644 index 00000000..fb719310 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java @@ -0,0 +1,191 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetAudience200Response */ +public class GetAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetAudienceAlphaOutput data; + + public GetAudience200Response() {} + + public GetAudience200Response data(GetAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetAudienceAlphaOutput getData() { + return data; + } + + public void setData(GetAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudience200Response getAudience200Response = (GetAudience200Response) o; + return Objects.equals(this.data, getAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAudience200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudience200Response is not found in" + + " the empty JSON string", + GetAudience200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudience200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudience200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudience200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudience200Response + * @throws IOException if the JSON string is invalid with respect to GetAudience200Response + */ + public static GetAudience200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudience200Response.class); + } + + /** + * Convert an instance of GetAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java new file mode 100644 index 00000000..425598b3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Audience output for update. */ +@ApiModel(description = "Audience output for update.") +public class GetAudienceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private Audience audience; + + public GetAudienceAlphaOutput() {} + + public GetAudienceAlphaOutput audience(Audience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * + * @return audience + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Audience getAudience() { + return audience; + } + + public void setAudience(Audience audience) { + this.audience = audience; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceAlphaOutput getAudienceAlphaOutput = (GetAudienceAlphaOutput) o; + return Objects.equals(this.audience, getAudienceAlphaOutput.audience); + } + + @Override + public int hashCode() { + return Objects.hash(audience); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceAlphaOutput {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audience"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audience"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAudienceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudienceAlphaOutput is not found in" + + " the empty JSON string", + GetAudienceAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAudienceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAudienceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudienceAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetAudienceAlphaOutput + */ + public static GetAudienceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudienceAlphaOutput.class); + } + + /** + * Convert an instance of GetAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java new file mode 100644 index 00000000..e66b7d4c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java @@ -0,0 +1,192 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetComputedTrait200Response */ +public class GetComputedTrait200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetComputedTraitAlphaOutput data; + + public GetComputedTrait200Response() {} + + public GetComputedTrait200Response data(GetComputedTraitAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetComputedTraitAlphaOutput getData() { + return data; + } + + public void setData(GetComputedTraitAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetComputedTrait200Response getComputedTrait200Response = (GetComputedTrait200Response) o; + return Objects.equals(this.data, getComputedTrait200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetComputedTrait200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetComputedTrait200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetComputedTrait200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetComputedTrait200Response is not" + + " found in the empty JSON string", + GetComputedTrait200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetComputedTrait200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetComputedTrait200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetComputedTrait200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetComputedTrait200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetComputedTrait200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetComputedTrait200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetComputedTrait200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetComputedTrait200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetComputedTrait200Response + * @throws IOException if the JSON string is invalid with respect to GetComputedTrait200Response + */ + public static GetComputedTrait200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetComputedTrait200Response.class); + } + + /** + * Convert an instance of GetComputedTrait200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java new file mode 100644 index 00000000..2940b617 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Computed Trait output for get and update. */ +@ApiModel(description = "Computed Trait output for get and update.") +public class GetComputedTraitAlphaOutput { + public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; + + @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) + private ComputedTrait computedTrait; + + public GetComputedTraitAlphaOutput() {} + + public GetComputedTraitAlphaOutput computedTrait(ComputedTrait computedTrait) { + + this.computedTrait = computedTrait; + return this; + } + + /** + * Get computedTrait + * + * @return computedTrait + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ComputedTrait getComputedTrait() { + return computedTrait; + } + + public void setComputedTrait(ComputedTrait computedTrait) { + this.computedTrait = computedTrait; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetComputedTraitAlphaOutput getComputedTraitAlphaOutput = (GetComputedTraitAlphaOutput) o; + return Objects.equals(this.computedTrait, getComputedTraitAlphaOutput.computedTrait); + } + + @Override + public int hashCode() { + return Objects.hash(computedTrait); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetComputedTraitAlphaOutput {\n"); + sb.append(" computedTrait: ").append(toIndentedString(computedTrait)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("computedTrait"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("computedTrait"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetComputedTraitAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetComputedTraitAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetComputedTraitAlphaOutput is not" + + " found in the empty JSON string", + GetComputedTraitAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetComputedTraitAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetComputedTraitAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetComputedTraitAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetComputedTraitAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetComputedTraitAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetComputedTraitAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetComputedTraitAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetComputedTraitAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetComputedTraitAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetComputedTraitAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetComputedTraitAlphaOutput + */ + public static GetComputedTraitAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetComputedTraitAlphaOutput.class); + } + + /** + * Convert an instance of GetComputedTraitAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 26dfd8bc..7fdeb2c9 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -40,8 +40,12 @@ public class GetSubscriptionRequest { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java new file mode 100644 index 00000000..984032ac --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java @@ -0,0 +1,192 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListAudiences200Response */ +public class ListAudiences200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListAudiencesAlphaOutput data; + + public ListAudiences200Response() {} + + public ListAudiences200Response data(ListAudiencesAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListAudiencesAlphaOutput getData() { + return data; + } + + public void setData(ListAudiencesAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiences200Response listAudiences200Response = (ListAudiences200Response) o; + return Objects.equals(this.data, listAudiences200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiences200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListAudiences200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListAudiences200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiences200Response is not found" + + " in the empty JSON string", + ListAudiences200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListAudiences200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiences200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiences200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiences200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudiences200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiences200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiences200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiences200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiences200Response + * @throws IOException if the JSON string is invalid with respect to ListAudiences200Response + */ + public static ListAudiences200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiences200Response.class); + } + + /** + * Convert an instance of ListAudiences200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java new file mode 100644 index 00000000..590af909 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -0,0 +1,253 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** List audiences endpoint output. */ +@ApiModel(description = "List audiences endpoint output.") +public class ListAudiencesAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; + + @SerializedName(SERIALIZED_NAME_AUDIENCES) + private List audiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListAudiencesAlphaOutput() {} + + public ListAudiencesAlphaOutput audiences(List audiences) { + + this.audiences = audiences; + return this; + } + + public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { + this.audiences.add(audiencesItem); + return this; + } + + /** + * A list of audience summary results. + * + * @return audiences + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of audience summary results.") + public List getAudiences() { + return audiences; + } + + public void setAudiences(List audiences) { + this.audiences = audiences; + } + + public ListAudiencesAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesAlphaOutput listAudiencesAlphaOutput = (ListAudiencesAlphaOutput) o; + return Objects.equals(this.audiences, listAudiencesAlphaOutput.audiences) + && Objects.equals(this.pagination, listAudiencesAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(audiences, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesAlphaOutput {\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiences"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiences"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListAudiencesAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListAudiencesAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesAlphaOutput is not found" + + " in the empty JSON string", + ListAudiencesAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListAudiencesAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("audiences").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audiences` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audiences").toString())); + } + + JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudiencesAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesAlphaOutput + * @throws IOException if the JSON string is invalid with respect to ListAudiencesAlphaOutput + */ + public static ListAudiencesAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesAlphaOutput.class); + } + + /** + * Convert an instance of ListAudiencesAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java b/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java new file mode 100644 index 00000000..936cbc5d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListComputedTraits200Response */ +public class ListComputedTraits200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListComputedTraitsAlphaOutput data; + + public ListComputedTraits200Response() {} + + public ListComputedTraits200Response data(ListComputedTraitsAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListComputedTraitsAlphaOutput getData() { + return data; + } + + public void setData(ListComputedTraitsAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListComputedTraits200Response listComputedTraits200Response = + (ListComputedTraits200Response) o; + return Objects.equals(this.data, listComputedTraits200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListComputedTraits200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListComputedTraits200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListComputedTraits200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListComputedTraits200Response is not" + + " found in the empty JSON string", + ListComputedTraits200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListComputedTraits200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListComputedTraits200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListComputedTraits200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListComputedTraits200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListComputedTraits200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListComputedTraits200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListComputedTraits200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListComputedTraits200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListComputedTraits200Response + * @throws IOException if the JSON string is invalid with respect to + * ListComputedTraits200Response + */ + public static ListComputedTraits200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListComputedTraits200Response.class); + } + + /** + * Convert an instance of ListComputedTraits200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java new file mode 100644 index 00000000..17eec196 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java @@ -0,0 +1,259 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** List computed traits endpoint output. */ +@ApiModel(description = "List computed traits endpoint output.") +public class ListComputedTraitsAlphaOutput { + public static final String SERIALIZED_NAME_COMPUTED_TRAITS = "computedTraits"; + + @SerializedName(SERIALIZED_NAME_COMPUTED_TRAITS) + private List computedTraits = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListComputedTraitsAlphaOutput() {} + + public ListComputedTraitsAlphaOutput computedTraits(List computedTraits) { + + this.computedTraits = computedTraits; + return this; + } + + public ListComputedTraitsAlphaOutput addComputedTraitsItem( + ComputedTraitSummary computedTraitsItem) { + this.computedTraits.add(computedTraitsItem); + return this; + } + + /** + * A list of computed trait summary results. + * + * @return computedTraits + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of computed trait summary results.") + public List getComputedTraits() { + return computedTraits; + } + + public void setComputedTraits(List computedTraits) { + this.computedTraits = computedTraits; + } + + public ListComputedTraitsAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListComputedTraitsAlphaOutput listComputedTraitsAlphaOutput = + (ListComputedTraitsAlphaOutput) o; + return Objects.equals(this.computedTraits, listComputedTraitsAlphaOutput.computedTraits) + && Objects.equals(this.pagination, listComputedTraitsAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(computedTraits, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListComputedTraitsAlphaOutput {\n"); + sb.append(" computedTraits: ").append(toIndentedString(computedTraits)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("computedTraits"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("computedTraits"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListComputedTraitsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListComputedTraitsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListComputedTraitsAlphaOutput is not" + + " found in the empty JSON string", + ListComputedTraitsAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListComputedTraitsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListComputedTraitsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListComputedTraitsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("computedTraits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `computedTraits` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("computedTraits").toString())); + } + + JsonArray jsonArraycomputedTraits = jsonObj.getAsJsonArray("computedTraits"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListComputedTraitsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListComputedTraitsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListComputedTraitsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListComputedTraitsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListComputedTraitsAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListComputedTraitsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListComputedTraitsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListComputedTraitsAlphaOutput + */ + public static ListComputedTraitsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListComputedTraitsAlphaOutput.class); + } + + /** + * Convert an instance of ListComputedTraitsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index 99cf361a..b01616f2 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -43,8 +43,12 @@ public class MessagesSubscriptionRequest { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java new file mode 100644 index 00000000..fc93f5a8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RemoveAudienceFromSpace200Response */ +public class RemoveAudienceFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveAudienceFromSpaceAlphaOutput data; + + public RemoveAudienceFromSpace200Response() {} + + public RemoveAudienceFromSpace200Response data(RemoveAudienceFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RemoveAudienceFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveAudienceFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveAudienceFromSpace200Response removeAudienceFromSpace200Response = + (RemoveAudienceFromSpace200Response) o; + return Objects.equals(this.data, removeAudienceFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveAudienceFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveAudienceFromSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveAudienceFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveAudienceFromSpace200Response is" + + " not found in the empty JSON string", + RemoveAudienceFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveAudienceFromSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveAudienceFromSpace200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveAudienceFromSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveAudienceFromSpace200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveAudienceFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveAudienceFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveAudienceFromSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveAudienceFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveAudienceFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveAudienceFromSpace200Response + */ + public static RemoveAudienceFromSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveAudienceFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java new file mode 100644 index 00000000..9b77ee03 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java @@ -0,0 +1,264 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete audience endpoint output. */ +@ApiModel(description = "Delete audience endpoint output.") +public class RemoveAudienceFromSpaceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveAudienceFromSpaceAlphaOutput() {} + + public RemoveAudienceFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveAudienceFromSpaceAlphaOutput removeAudienceFromSpaceAlphaOutput = + (RemoveAudienceFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeAudienceFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveAudienceFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveAudienceFromSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveAudienceFromSpaceAlphaOutput is" + + " not found in the empty JSON string", + RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveAudienceFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveAudienceFromSpaceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveAudienceFromSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveAudienceFromSpaceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveAudienceFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveAudienceFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveAudienceFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveAudienceFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveAudienceFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveAudienceFromSpaceAlphaOutput + */ + public static RemoveAudienceFromSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveAudienceFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java new file mode 100644 index 00000000..c75ef599 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RemoveComputedTraitFromSpace200Response */ +public class RemoveComputedTraitFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveComputedTraitFromSpaceAlphaOutput data; + + public RemoveComputedTraitFromSpace200Response() {} + + public RemoveComputedTraitFromSpace200Response data( + RemoveComputedTraitFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RemoveComputedTraitFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveComputedTraitFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace200Response = + (RemoveComputedTraitFromSpace200Response) o; + return Objects.equals(this.data, removeComputedTraitFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveComputedTraitFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveComputedTraitFromSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveComputedTraitFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveComputedTraitFromSpace200Response is not found in the" + + " empty JSON string", + RemoveComputedTraitFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveComputedTraitFromSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveComputedTraitFromSpace200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveComputedTraitFromSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'RemoveComputedTraitFromSpace200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveComputedTraitFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveComputedTraitFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveComputedTraitFromSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveComputedTraitFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveComputedTraitFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveComputedTraitFromSpace200Response + */ + public static RemoveComputedTraitFromSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveComputedTraitFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveComputedTraitFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java new file mode 100644 index 00000000..10af6e84 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete computed trait endpoint output. */ +@ApiModel(description = "Delete computed trait endpoint output.") +public class RemoveComputedTraitFromSpaceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveComputedTraitFromSpaceAlphaOutput() {} + + public RemoveComputedTraitFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveComputedTraitFromSpaceAlphaOutput removeComputedTraitFromSpaceAlphaOutput = + (RemoveComputedTraitFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeComputedTraitFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveComputedTraitFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveComputedTraitFromSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveComputedTraitFromSpaceAlphaOutput is not found in the" + + " empty JSON string", + RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveComputedTraitFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveComputedTraitFromSpaceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveComputedTraitFromSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'RemoveComputedTraitFromSpaceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveComputedTraitFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveComputedTraitFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveComputedTraitFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveComputedTraitFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveComputedTraitFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveComputedTraitFromSpaceAlphaOutput + */ + public static RemoveComputedTraitFromSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveComputedTraitFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveComputedTraitFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java new file mode 100644 index 00000000..e9820fd9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java @@ -0,0 +1,198 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateAudienceForSpace200Response */ +public class UpdateAudienceForSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateAudienceForSpaceAlphaOutput data; + + public UpdateAudienceForSpace200Response() {} + + public UpdateAudienceForSpace200Response data(UpdateAudienceForSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateAudienceForSpaceAlphaOutput getData() { + return data; + } + + public void setData(UpdateAudienceForSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAudienceForSpace200Response updateAudienceForSpace200Response = + (UpdateAudienceForSpace200Response) o; + return Objects.equals(this.data, updateAudienceForSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAudienceForSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateAudienceForSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateAudienceForSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateAudienceForSpace200Response is" + + " not found in the empty JSON string", + UpdateAudienceForSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateAudienceForSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateAudienceForSpace200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAudienceForSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpace200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateAudienceForSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAudienceForSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAudienceForSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAudienceForSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAudienceForSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateAudienceForSpace200Response + */ + public static UpdateAudienceForSpace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpace200Response.class); + } + + /** + * Convert an instance of UpdateAudienceForSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java new file mode 100644 index 00000000..0ad08cf1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java @@ -0,0 +1,211 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Audience output for get. */ +@ApiModel(description = "Audience output for get.") +public class UpdateAudienceForSpaceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private Audience audience; + + public UpdateAudienceForSpaceAlphaOutput() {} + + public UpdateAudienceForSpaceAlphaOutput audience(Audience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * + * @return audience + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Audience getAudience() { + return audience; + } + + public void setAudience(Audience audience) { + this.audience = audience; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAudienceForSpaceAlphaOutput updateAudienceForSpaceAlphaOutput = + (UpdateAudienceForSpaceAlphaOutput) o; + return Objects.equals(this.audience, updateAudienceForSpaceAlphaOutput.audience); + } + + @Override + public int hashCode() { + return Objects.hash(audience); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAudienceForSpaceAlphaOutput {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audience"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audience"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateAudienceForSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateAudienceForSpaceAlphaOutput is" + + " not found in the empty JSON string", + UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateAudienceForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateAudienceForSpaceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAudienceForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpaceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateAudienceForSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAudienceForSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAudienceForSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAudienceForSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAudienceForSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateAudienceForSpaceAlphaOutput + */ + public static UpdateAudienceForSpaceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateAudienceForSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java new file mode 100644 index 00000000..9a42b1f4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Input to update an audience. */ +@ApiModel(description = "Input to update an audience.") +public class UpdateAudienceForSpaceInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public UpdateAudienceForSpaceInput() {} + + public UpdateAudienceForSpaceInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAudienceForSpaceInput updateAudienceForSpaceInput = (UpdateAudienceForSpaceInput) o; + return Objects.equals(this.enabled, updateAudienceForSpaceInput.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAudienceForSpaceInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateAudienceForSpaceInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateAudienceForSpaceInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateAudienceForSpaceInput is not" + + " found in the empty JSON string", + UpdateAudienceForSpaceInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateAudienceForSpaceInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateAudienceForSpaceInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateAudienceForSpaceInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAudienceForSpaceInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpaceInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateAudienceForSpaceInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAudienceForSpaceInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAudienceForSpaceInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAudienceForSpaceInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAudienceForSpaceInput + * @throws IOException if the JSON string is invalid with respect to UpdateAudienceForSpaceInput + */ + public static UpdateAudienceForSpaceInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceInput.class); + } + + /** + * Convert an instance of UpdateAudienceForSpaceInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java new file mode 100644 index 00000000..dbe239a2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateComputedTraitForSpace200Response */ +public class UpdateComputedTraitForSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateComputedTraitForSpaceAlphaOutput data; + + public UpdateComputedTraitForSpace200Response() {} + + public UpdateComputedTraitForSpace200Response data( + UpdateComputedTraitForSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateComputedTraitForSpaceAlphaOutput getData() { + return data; + } + + public void setData(UpdateComputedTraitForSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComputedTraitForSpace200Response updateComputedTraitForSpace200Response = + (UpdateComputedTraitForSpace200Response) o; + return Objects.equals(this.data, updateComputedTraitForSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComputedTraitForSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateComputedTraitForSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateComputedTraitForSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateComputedTraitForSpace200Response" + + " is not found in the empty JSON string", + UpdateComputedTraitForSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateComputedTraitForSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateComputedTraitForSpace200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComputedTraitForSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComputedTraitForSpace200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateComputedTraitForSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateComputedTraitForSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateComputedTraitForSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComputedTraitForSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComputedTraitForSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateComputedTraitForSpace200Response + */ + public static UpdateComputedTraitForSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpace200Response.class); + } + + /** + * Convert an instance of UpdateComputedTraitForSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java new file mode 100644 index 00000000..5556639e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java @@ -0,0 +1,214 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Input to update a computed trait. */ +@ApiModel(description = "Input to update a computed trait.") +public class UpdateComputedTraitForSpaceAlphaInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public UpdateComputedTraitForSpaceAlphaInput() {} + + public UpdateComputedTraitForSpaceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the computed trait. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput = + (UpdateComputedTraitForSpaceAlphaInput) o; + return Objects.equals(this.enabled, updateComputedTraitForSpaceAlphaInput.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComputedTraitForSpaceAlphaInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateComputedTraitForSpaceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateComputedTraitForSpaceAlphaInput" + + " is not found in the empty JSON string", + UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateComputedTraitForSpaceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateComputedTraitForSpaceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComputedTraitForSpaceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComputedTraitForSpaceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateComputedTraitForSpaceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateComputedTraitForSpaceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateComputedTraitForSpaceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComputedTraitForSpaceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComputedTraitForSpaceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateComputedTraitForSpaceAlphaInput + */ + public static UpdateComputedTraitForSpaceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpaceAlphaInput.class); + } + + /** + * Convert an instance of UpdateComputedTraitForSpaceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java new file mode 100644 index 00000000..e779fe28 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java @@ -0,0 +1,215 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Computed Trait output for get and update. */ +@ApiModel(description = "Computed Trait output for get and update.") +public class UpdateComputedTraitForSpaceAlphaOutput { + public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; + + @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) + private ComputedTrait computedTrait; + + public UpdateComputedTraitForSpaceAlphaOutput() {} + + public UpdateComputedTraitForSpaceAlphaOutput computedTrait(ComputedTrait computedTrait) { + + this.computedTrait = computedTrait; + return this; + } + + /** + * Get computedTrait + * + * @return computedTrait + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ComputedTrait getComputedTrait() { + return computedTrait; + } + + public void setComputedTrait(ComputedTrait computedTrait) { + this.computedTrait = computedTrait; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComputedTraitForSpaceAlphaOutput updateComputedTraitForSpaceAlphaOutput = + (UpdateComputedTraitForSpaceAlphaOutput) o; + return Objects.equals( + this.computedTrait, updateComputedTraitForSpaceAlphaOutput.computedTrait); + } + + @Override + public int hashCode() { + return Objects.hash(computedTrait); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComputedTraitForSpaceAlphaOutput {\n"); + sb.append(" computedTrait: ").append(toIndentedString(computedTrait)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("computedTrait"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("computedTrait"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateComputedTraitForSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateComputedTraitForSpaceAlphaOutput" + + " is not found in the empty JSON string", + UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateComputedTraitForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateComputedTraitForSpaceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComputedTraitForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComputedTraitForSpaceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateComputedTraitForSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateComputedTraitForSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateComputedTraitForSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComputedTraitForSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComputedTraitForSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateComputedTraitForSpaceAlphaOutput + */ + public static UpdateComputedTraitForSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpaceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateComputedTraitForSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From cdf62d1785eb65d2fe7c31aa48d2d467ed9e979b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 31 Aug 2023 16:41:46 +0000 Subject: [PATCH 144/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@dea4ecc4. --- .../segment/publicapi/api/AudiencesApi.java | 64 ++++++++++++++++--- .../publicapi/api/ComputedTraitsApi.java | 63 ++++++++++++++---- 2 files changed, 106 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index d56b00a4..09138cd1 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -173,7 +173,11 @@ private okhttp3.Call getAudienceValidateBeforeCall( * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. * Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 20 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -198,7 +202,11 @@ public GetAudience200Response getAudience(String spaceId, String id) throws ApiE * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. * Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 20 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -225,7 +233,11 @@ public ApiResponse getAudienceWithHttpInfo(String spaceI * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -361,7 +373,11 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please * submit any feedback by sending email to friends@segment.com. • In order to successfully call * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please - * reach out to your customer success manager for more information. + * reach out to your customer success manager for more information. The rate limit for this + * endpoint is 5 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. This parameter exists in @@ -389,7 +405,11 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please * submit any feedback by sending email to friends@segment.com. • In order to successfully call * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please - * reach out to your customer success manager for more information. + * reach out to your customer success manager for more information. The rate limit for this + * endpoint is 5 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. This parameter exists in @@ -417,7 +437,11 @@ public ApiResponse listAudiencesWithHttpInfo( * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 5 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. This parameter exists in @@ -555,7 +579,10 @@ private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Audience Deleted` event in the [audit - * trail](/tag/Audit-Trail). + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -584,7 +611,10 @@ public RemoveAudienceFromSpace200Response removeAudienceFromSpace(String spaceId * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Audience Deleted` event in the [audit - * trail](/tag/Audit-Trail). + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -613,7 +643,11 @@ public ApiResponse removeAudienceFromSpaceWi * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Audience feature enabled. Please reach out to your customer success manager * for more information. • When called, this endpoint may generate the `Audience - * Deleted` event in the [audit trail](/tag/Audit-Trail). + * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint + * is 10 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param id (required) @@ -771,6 +805,10 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( * Audience will be locked from future edits until the changes have been incorporated. You can * find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -805,6 +843,10 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( * Audience will be locked from future edits until the changes have been incorporated. You can * find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -841,6 +883,10 @@ public ApiResponse updateAudienceForSpaceWith * of a Audience is updated, the Audience will be locked from future edits until the changes * have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java index 6edec67b..d121b1fe 100644 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -175,7 +175,10 @@ private okhttp3.Call getComputedTraitValidateBeforeCall( * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Computed * Traits feature enabled. Please reach out to your customer success manager for more - * information. + * information. The rate limit for this endpoint is 20 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -203,7 +206,10 @@ public GetComputedTrait200Response getComputedTrait(String spaceId, String id) * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Computed * Traits feature enabled. Please reach out to your customer success manager for more - * information. + * information. The rate limit for this endpoint is 20 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -231,7 +237,10 @@ public ApiResponse getComputedTraitWithHttpInfo( * endpoint is in **Alpha** testing. Please submit any feedback by sending email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Computed Traits feature enabled. Please reach out to your customer success - * manager for more information. + * manager for more information. The rate limit for this endpoint is 20 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -368,7 +377,11 @@ private okhttp3.Call listComputedTraitsValidateBeforeCall( * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Computed Traits - * feature enabled. Please reach out to your customer success manager for more information. + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 5 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. This parameter exists in @@ -396,7 +409,11 @@ public ListComputedTraits200Response listComputedTraits( * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Computed Traits - * feature enabled. Please reach out to your customer success manager for more information. + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 5 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. This parameter exists in @@ -425,7 +442,10 @@ public ApiResponse listComputedTraitsWithHttpInfo * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the * Computed Traits feature enabled. Please reach out to your customer success manager for more - * information. + * information. The rate limit for this endpoint is 5 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. This parameter exists in @@ -564,7 +584,10 @@ private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( * • In order to successfully call this endpoint, the specified Workspace needs to have the * Computed Traits feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Deleted` - * event in the [audit trail](/tag/Audit-Trail). + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -593,7 +616,10 @@ public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( * • In order to successfully call this endpoint, the specified Workspace needs to have the * Computed Traits feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Deleted` - * event in the [audit trail](/tag/Audit-Trail). + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -625,7 +651,11 @@ public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Computed Traits feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). + * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this + * endpoint is 10 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param id (required) @@ -784,7 +814,10 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the * definition of a is updated, the will be locked from future edits until the changes have been * incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/). + * docs](https://segment-docs.netlify.app/docs/). The rate limit for this endpoint is 2 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -821,7 +854,10 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the * definition of a is updated, the will be locked from future edits until the changes have been * incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/). + * docs](https://segment-docs.netlify.app/docs/). The rate limit for this endpoint is 2 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -861,7 +897,10 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that * when the definition of a is updated, the will be locked from future edits until the changes * have been incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/). + * docs](https://segment-docs.netlify.app/docs/). The rate limit for this endpoint is 2 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) From 54753d14698ebe2316b637363c0b914317644df0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 5 Sep 2023 18:16:43 +0000 Subject: [PATCH 145/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2625e61d. From c91e31e14e279330a6f7ec3c75a1db6b7fcf1ee2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 5 Sep 2023 19:44:31 +0000 Subject: [PATCH 146/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0f18232c. --- .../segment/publicapi/api/AudiencesApi.java | 18 ++--- .../publicapi/api/ComputedTraitsApi.java | 69 ++++++++++--------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 09138cd1..1648407d 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -801,9 +801,9 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Audience Modified` event in the [audit - * trail](/tag/Audit-Trail). • Note that when the definition of a Audience is updated, the - * Audience will be locked from future edits until the changes have been incorporated. You can - * find more information [in the Segment + * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be + * locked from future edits until the changes have been incorporated. You can find more + * information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). * The rate limit for this endpoint is 2 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 @@ -839,9 +839,9 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Audience Modified` event in the [audit - * trail](/tag/Audit-Trail). • Note that when the definition of a Audience is updated, the - * Audience will be locked from future edits until the changes have been incorporated. You can - * find more information [in the Segment + * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be + * locked from future edits until the changes have been incorporated. You can find more + * information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). * The rate limit for this endpoint is 2 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 @@ -879,9 +879,9 @@ public ApiResponse updateAudienceForSpaceWith * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Audience feature enabled. Please reach out to your customer success manager * for more information. • When called, this endpoint may generate the `Audience - * Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the definition - * of a Audience is updated, the Audience will be locked from future edits until the changes - * have been incorporated. You can find more information [in the Segment + * Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is + * updated, the Audience will be locked from future edits until the changes have been + * incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). * The rate limit for this endpoint is 2 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java index d121b1fe..eca45901 100644 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -174,7 +174,7 @@ private okhttp3.Call getComputedTraitValidateBeforeCall( * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Computed - * Traits feature enabled. Please reach out to your customer success manager for more + * Trait feature enabled. Please reach out to your customer success manager for more * information. The rate limit for this endpoint is 20 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -205,7 +205,7 @@ public GetComputedTrait200Response getComputedTrait(String spaceId, String id) * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Computed - * Traits feature enabled. Please reach out to your customer success manager for more + * Trait feature enabled. Please reach out to your customer success manager for more * information. The rate limit for this endpoint is 20 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -236,7 +236,7 @@ public ApiResponse getComputedTraitWithHttpInfo( * Get Computed Trait (asynchronously) Returns the Computed Trait by id and spaceId • This * endpoint is in **Alpha** testing. Please submit any feedback by sending email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * needs to have the Computed Trait feature enabled. Please reach out to your customer success * manager for more information. The rate limit for this endpoint is 20 requests per minute, * which is lower than the default due to access pattern restrictions. Once reached, this * endpoint will respond with the 429 HTTP status code with headers indicating the limit @@ -376,7 +376,7 @@ private okhttp3.Call listComputedTraitsValidateBeforeCall( /** * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Computed Traits + * successfully call this endpoint, the specified Workspace needs to have the Computed Trait * feature enabled. Please reach out to your customer success manager for more information. The * rate limit for this endpoint is 5 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -408,7 +408,7 @@ public ListComputedTraits200Response listComputedTraits( /** * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Computed Traits + * successfully call this endpoint, the specified Workspace needs to have the Computed Trait * feature enabled. Please reach out to your customer success manager for more information. The * rate limit for this endpoint is 5 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP @@ -441,7 +441,7 @@ public ApiResponse listComputedTraitsWithHttpInfo * List Computed Traits (asynchronously) Returns Computed Traits by spaceId. • This endpoint is * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the - * Computed Traits feature enabled. Please reach out to your customer success manager for more + * Computed Trait feature enabled. Please reach out to your customer success manager for more * information. The rate limit for this endpoint is 5 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate @@ -582,7 +582,7 @@ private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. * • In order to successfully call this endpoint, the specified Workspace needs to have the - * Computed Traits feature enabled. Please reach out to your customer success manager for more + * Computed Trait feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Deleted` * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests * per minute, which is lower than the default due to access pattern restrictions. Once reached, @@ -614,7 +614,7 @@ public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. * • In order to successfully call this endpoint, the specified Workspace needs to have the - * Computed Traits feature enabled. Please reach out to your customer success manager for more + * Computed Trait feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Deleted` * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests * per minute, which is lower than the default due to access pattern restrictions. Once reached, @@ -649,7 +649,7 @@ public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( * Remove Computed Trait from Space (asynchronously) Deletes a Computed Trait by id and spaceId. * • This endpoint is in **Alpha** testing. Please submit any feedback by sending email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * needs to have the Computed Trait feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Computed * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this * endpoint is 10 requests per minute, which is lower than the default due to access pattern @@ -809,15 +809,16 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( * Update Computed Trait for Space Updates the enabled status for a computed trait. • This * endpoint is in **Alpha** testing. Please submit any feedback by sending email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * needs to have the Computed Trait feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the - * definition of a is updated, the will be locked from future edits until the changes have been - * incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/). The rate limit for this endpoint is 2 requests - * per minute, which is lower than the default due to access pattern restrictions. Once reached, - * this endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a + * Computed Trait is updated, the Computed Trait will be locked from future edits until the + * changes have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -849,15 +850,16 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * Update Computed Trait for Space Updates the enabled status for a computed trait. • This * endpoint is in **Alpha** testing. Please submit any feedback by sending email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Traits feature enabled. Please reach out to your customer success + * needs to have the Computed Trait feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when the - * definition of a is updated, the will be locked from future edits until the changes have been - * incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/). The rate limit for this endpoint is 2 requests - * per minute, which is lower than the default due to access pattern restrictions. Once reached, - * this endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a + * Computed Trait is updated, the Computed Trait will be locked from future edits until the + * changes have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) @@ -892,15 +894,16 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * Update Computed Trait for Space (asynchronously) Updates the enabled status for a computed * trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending email * to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Computed Traits feature enabled. Please reach out to your - * customer success manager for more information. • When called, this endpoint may generate the + * Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer + * success manager for more information. • When called, this endpoint may generate the * `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that - * when the definition of a is updated, the will be locked from future edits until the changes - * have been incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/). The rate limit for this endpoint is 2 requests - * per minute, which is lower than the default due to access pattern restrictions. Once reached, - * this endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * when a Computed Trait is updated, the Computed Trait will be locked from future edits until + * the changes have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). + * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) From 57d7a6da6c445e915a5cf41562a1e04bba47d124 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 6 Sep 2023 16:10:33 +0000 Subject: [PATCH 147/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@da3447cd. --- .../segment/publicapi/api/AudiencesApi.java | 24 ++++++++-------- .../publicapi/api/ComputedTraitsApi.java | 28 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 1648407d..f4e92d61 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -174,7 +174,7 @@ private okhttp3.Call getAudienceValidateBeforeCall( * Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 20 requests per minute, which is lower than the default due to + * limit for this endpoint is 100 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -203,7 +203,7 @@ public GetAudience200Response getAudience(String spaceId, String id) throws ApiE * Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 20 requests per minute, which is lower than the default due to + * limit for this endpoint is 100 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -234,7 +234,7 @@ public ApiResponse getAudienceWithHttpInfo(String spaceI * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * rate limit for this endpoint is 100 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -374,7 +374,7 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * submit any feedback by sending email to friends@segment.com. • In order to successfully call * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please * reach out to your customer success manager for more information. The rate limit for this - * endpoint is 5 requests per minute, which is lower than the default due to access pattern + * endpoint is 25 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -406,7 +406,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa * submit any feedback by sending email to friends@segment.com. • In order to successfully call * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please * reach out to your customer success manager for more information. The rate limit for this - * endpoint is 5 requests per minute, which is lower than the default due to access pattern + * endpoint is 25 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -438,7 +438,7 @@ public ApiResponse listAudiencesWithHttpInfo( * testing. Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 5 requests per minute, which is lower than the default due to + * limit for this endpoint is 25 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -579,7 +579,7 @@ private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Audience Deleted` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint * will respond with the 429 HTTP status code with headers indicating the limit parameters. See * [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -611,7 +611,7 @@ public RemoveAudienceFromSpace200Response removeAudienceFromSpace(String spaceId * order to successfully call this endpoint, the specified Workspace needs to have the Audience * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Audience Deleted` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which * is lower than the default due to access pattern restrictions. Once reached, this endpoint * will respond with the 429 HTTP status code with headers indicating the limit parameters. See * [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -644,7 +644,7 @@ public ApiResponse removeAudienceFromSpaceWi * needs to have the Audience feature enabled. Please reach out to your customer success manager * for more information. • When called, this endpoint may generate the `Audience * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint - * is 10 requests per minute, which is lower than the default due to access pattern + * is 20 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -805,7 +805,7 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( * locked from future edits until the changes have been incorporated. You can find more * information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -843,7 +843,7 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( * locked from future edits until the changes have been incorporated. You can find more * information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -883,7 +883,7 @@ public ApiResponse updateAudienceForSpaceWith * updated, the Audience will be locked from future edits until the changes have been * incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java index eca45901..7909ad29 100644 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -175,7 +175,7 @@ private okhttp3.Call getComputedTraitValidateBeforeCall( * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Computed * Trait feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 20 requests per minute, which is lower than + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -206,7 +206,7 @@ public GetComputedTrait200Response getComputedTrait(String spaceId, String id) * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In * order to successfully call this endpoint, the specified Workspace needs to have the Computed * Trait feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 20 requests per minute, which is lower than + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -237,7 +237,7 @@ public ApiResponse getComputedTraitWithHttpInfo( * endpoint is in **Alpha** testing. Please submit any feedback by sending email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. The rate limit for this endpoint is 20 requests per minute, + * manager for more information. The rate limit for this endpoint is 100 requests per minute, * which is lower than the default due to access pattern restrictions. Once reached, this * endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -378,8 +378,8 @@ private okhttp3.Call listComputedTraitsValidateBeforeCall( * testing. Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Computed Trait * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 5 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * rate limit for this endpoint is 25 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -410,8 +410,8 @@ public ListComputedTraits200Response listComputedTraits( * testing. Please submit any feedback by sending email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Computed Trait * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 5 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * rate limit for this endpoint is 25 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * @@ -442,7 +442,7 @@ public ApiResponse listComputedTraitsWithHttpInfo * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the * Computed Trait feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 5 requests per minute, which is lower than + * information. The rate limit for this endpoint is 25 requests per minute, which is lower than * the default due to access pattern restrictions. Once reached, this endpoint will respond with * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -584,7 +584,7 @@ private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( * • In order to successfully call this endpoint, the specified Workspace needs to have the * Computed Trait feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Deleted` - * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -616,7 +616,7 @@ public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( * • In order to successfully call this endpoint, the specified Workspace needs to have the * Computed Trait feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Deleted` - * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -652,7 +652,7 @@ public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( * needs to have the Computed Trait feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Computed * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this - * endpoint is 10 requests per minute, which is lower than the default due to access pattern + * endpoint is 20 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -815,7 +815,7 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( * Computed Trait is updated, the Computed Trait will be locked from future edits until the * changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -856,7 +856,7 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * Computed Trait is updated, the Computed Trait will be locked from future edits until the * changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -900,7 +900,7 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * when a Computed Trait is updated, the Computed Trait will be locked from future edits until * the changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * The rate limit for this endpoint is 2 requests per minute, which is lower than the default + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. From 2bc81745112c570f2fc7fefbc03f36a0aa85dd40 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 6 Sep 2023 19:11:03 +0000 Subject: [PATCH 148/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7681e3a8. From c711bba9137460d0de3f04f479dd354059a17eb8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 6 Sep 2023 19:56:15 +0000 Subject: [PATCH 149/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4cd05680. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 98 -- .../segment/publicapi/api/AudiencesApi.java | 921 ----------------- .../publicapi/api/ComputedTraitsApi.java | 939 ------------------ .../segment/publicapi/api/FunctionsApi.java | 930 ++--------------- .../segment/publicapi/models/Audience.java | 546 ---------- .../publicapi/models/AudienceSummary.java | 547 ---------- .../publicapi/models/ComputedTrait.java | 546 ---------- .../models/ComputedTraitSummary.java | 547 ---------- ...eateInsertFunctionInstance200Response.java | 204 ---- ...reateInsertFunctionInstanceAlphaInput.java | 454 --------- ...eateInsertFunctionInstanceAlphaOutput.java | 221 ----- ...leteInsertFunctionInstance200Response.java | 204 ---- ...leteInsertFunctionInstanceAlphaOutput.java | 268 ----- .../models/GetAudience200Response.java | 191 ---- .../models/GetAudienceAlphaOutput.java | 204 ---- .../models/GetComputedTrait200Response.java | 192 ---- .../models/GetComputedTraitAlphaOutput.java | 205 ---- ...tMessagingSubscriptionSuccessResponse.java | 4 - .../models/GetSubscriptionRequest.java | 4 - .../models/InsertFunctionInstance.java | 510 ---------- .../models/InsertFunctionInstance1.java | 512 ---------- .../models/InsertFunctionInstanceAlpha.java | 510 ---------- .../models/ListAudiences200Response.java | 192 ---- .../models/ListAudiencesAlphaOutput.java | 253 ----- .../models/ListComputedTraits200Response.java | 197 ---- .../models/ListComputedTraitsAlphaOutput.java | 259 ----- ...istInsertFunctionInstances200Response.java | 202 ---- ...istInsertFunctionInstancesAlphaOutput.java | 267 ----- .../models/MessageSubscriptionResponse.java | 4 - .../models/MessagesSubscriptionRequest.java | 4 - .../RemoveAudienceFromSpace200Response.java | 199 ---- .../RemoveAudienceFromSpaceAlphaOutput.java | 264 ----- ...moveComputedTraitFromSpace200Response.java | 204 ---- ...moveComputedTraitFromSpaceAlphaOutput.java | 268 ----- .../UpdateAudienceForSpace200Response.java | 198 ---- .../UpdateAudienceForSpaceAlphaOutput.java | 211 ---- .../models/UpdateAudienceForSpaceInput.java | 205 ---- ...pdateComputedTraitForSpace200Response.java | 202 ---- ...UpdateComputedTraitForSpaceAlphaInput.java | 214 ---- ...pdateComputedTraitForSpaceAlphaOutput.java | 215 ---- ...dateInsertFunctionInstance200Response.java | 204 ---- ...pdateInsertFunctionInstanceAlphaInput.java | 293 ------ ...dateInsertFunctionInstanceAlphaOutput.java | 221 ----- 46 files changed, 86 insertions(+), 12959 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/api/AudiencesApi.java delete mode 100644 src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java delete mode 100644 src/main/java/com/segment/publicapi/models/Audience.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummary.java delete mode 100644 src/main/java/com/segment/publicapi/models/ComputedTrait.java delete mode 100644 src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetAudience200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java delete mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java delete mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudiences200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java diff --git a/README.md b/README.md index 6ecc4cc9..42760f97 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 36.2.0 +Latest API and SDK version: 36.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 36.2.0 + 36.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:36.2.0" + implementation "com.segment.publicapi:segment-publicapi:36.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-36.2.0.jar` +* `target/segment-publicapi-36.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index b925423e..feb2c500 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 36.2.0 + 36.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 1d2f0beb..0ac40979 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 36.2.0 (Java)"); + setUserAgent("Public API SDK 36.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index bb47364c..32b26d4f 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -164,10 +164,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Audience.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -183,10 +179,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ComputedTrait.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ComputedTraitSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -247,15 +239,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFunctionV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateInsertFunctionInstance200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateInvites200Response .CustomTypeAdapterFactory()); @@ -380,12 +363,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteFunctionV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeleteInsertFunctionInstance200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeleteInsertFunctionInstanceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteInvites200Response .CustomTypeAdapterFactory()); @@ -564,16 +541,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouseV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudience200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetComputedTrait200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetComputedTraitAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetConnectionStateFromWarehouse200Response .CustomTypeAdapterFactory()); @@ -771,14 +738,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.InsertFunctionInstance.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.InsertFunctionInstance1 - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.InsertFunctionInstanceAlpha - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.IntegrationOptionBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -793,24 +752,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudiences200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudiencesAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEventsV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListComputedTraits200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListComputedTraitsAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response .CustomTypeAdapterFactory()); @@ -873,12 +820,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionsV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListInsertFunctionInstances200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListInsertFunctionInstancesAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListInvites200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1111,18 +1052,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveAudienceFromSpace200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveAudienceFromSpaceAlphaOutput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveComputedTraitFromSpaceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestination200Response .CustomTypeAdapterFactory()); @@ -1354,24 +1283,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateAudienceForSpace200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateAudienceForSpaceAlphaOutput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateAudienceForSpaceInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateComputedTraitForSpace200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); @@ -1400,15 +1311,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateGroupSubscriptionStatusResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateInsertFunctionInstance200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java deleted file mode 100644 index f4e92d61..00000000 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ /dev/null @@ -1,921 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.GetAudience200Response; -import com.segment.publicapi.models.ListAudiences200Response; -import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; -import com.segment.publicapi.models.UpdateAudienceForSpace200Response; -import com.segment.publicapi.models.UpdateAudienceForSpaceInput; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AudiencesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AudiencesApi() { - this(Configuration.getDefaultApiClient()); - } - - public AudiencesApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getAudience - * - * @param spaceId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAudienceValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling getAudience(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling getAudience(Async)"); - } - - okhttp3.Call localVarCall = getAudienceCall(spaceId, id, _callback); - return localVarCall; - } - - /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return GetAudience200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetAudience200Response getAudience(String spaceId, String id) throws ApiException { - ApiResponse localVarResp = getAudienceWithHttpInfo(spaceId, id); - return localVarResp.getData(); - } - - /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return ApiResponse<GetAudience200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getAudienceWithHttpInfo(String spaceId, String id) - throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 100 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudienceAsync( - String spaceId, String id, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listAudiences - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listAudiencesCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); - } - - // verify the required parameter 'pagination' is set - if (pagination == null) { - throw new ApiException( - "Missing the required parameter 'pagination' when calling" - + " listAudiences(Async)"); - } - - okhttp3.Call localVarCall = listAudiencesCall(spaceId, pagination, _callback); - return localVarCall; - } - - /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending email to friends@segment.com. • In order to successfully call - * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please - * reach out to your customer success manager for more information. The rate limit for this - * endpoint is 25 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @return ListAudiences200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - listAudiencesWithHttpInfo(spaceId, pagination); - return localVarResp.getData(); - } - - /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending email to friends@segment.com. • In order to successfully call - * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please - * reach out to your customer success manager for more information. The rate limit for this - * endpoint is 25 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @return ApiResponse<ListAudiences200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse listAudiencesWithHttpInfo( - String spaceId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 25 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listAudiencesAsync( - String spaceId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for removeAudienceFromSpace - * - * @param spaceId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeAudienceFromSpaceCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " removeAudienceFromSpace(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling" - + " removeAudienceFromSpace(Async)"); - } - - okhttp3.Call localVarCall = removeAudienceFromSpaceCall(spaceId, id, _callback); - return localVarCall; - } - - /** - * Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. • - * When called, this endpoint may generate the `Audience Deleted` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which - * is lower than the default due to access pattern restrictions. Once reached, this endpoint - * will respond with the 429 HTTP status code with headers indicating the limit parameters. See - * [Rate Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return RemoveAudienceFromSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public RemoveAudienceFromSpace200Response removeAudienceFromSpace(String spaceId, String id) - throws ApiException { - ApiResponse localVarResp = - removeAudienceFromSpaceWithHttpInfo(spaceId, id); - return localVarResp.getData(); - } - - /** - * Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. • - * When called, this endpoint may generate the `Audience Deleted` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which - * is lower than the default due to access pattern restrictions. Once reached, this endpoint - * will respond with the 429 HTTP status code with headers indicating the limit parameters. See - * [Rate Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return ApiResponse<RemoveAudienceFromSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse removeAudienceFromSpaceWithHttpInfo( - String spaceId, String id) throws ApiException { - okhttp3.Call localVarCall = removeAudienceFromSpaceValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Remove Audience from Space (asynchronously) Deletes an Audience by id and spaceId. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Audience feature enabled. Please reach out to your customer success manager - * for more information. • When called, this endpoint may generate the `Audience - * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint - * is 20 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeAudienceFromSpaceAsync( - String spaceId, - String id, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - removeAudienceFromSpaceValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateAudienceForSpace - * - * @param spaceId (required) - * @param id (required) - * @param updateAudienceForSpaceInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateAudienceForSpaceCall( - String spaceId, - String id, - UpdateAudienceForSpaceInput updateAudienceForSpaceInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateAudienceForSpaceInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( - String spaceId, - String id, - UpdateAudienceForSpaceInput updateAudienceForSpaceInput, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " updateAudienceForSpace(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling" - + " updateAudienceForSpace(Async)"); - } - - // verify the required parameter 'updateAudienceForSpaceInput' is set - if (updateAudienceForSpaceInput == null) { - throw new ApiException( - "Missing the required parameter 'updateAudienceForSpaceInput' when calling" - + " updateAudienceForSpace(Async)"); - } - - okhttp3.Call localVarCall = - updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceInput, _callback); - return localVarCall; - } - - /** - * Update Audience for Space Updates the enabled status for an audience • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. • - * When called, this endpoint may generate the `Audience Modified` event in the [audit - * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be - * locked from future edits until the changes have been incorporated. You can find more - * information [in the Segment - * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param updateAudienceForSpaceInput (required) - * @return UpdateAudienceForSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public UpdateAudienceForSpace200Response updateAudienceForSpace( - String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) - throws ApiException { - ApiResponse localVarResp = - updateAudienceForSpaceWithHttpInfo(spaceId, id, updateAudienceForSpaceInput); - return localVarResp.getData(); - } - - /** - * Update Audience for Space Updates the enabled status for an audience • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. • - * When called, this endpoint may generate the `Audience Modified` event in the [audit - * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be - * locked from future edits until the changes have been incorporated. You can find more - * information [in the Segment - * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param updateAudienceForSpaceInput (required) - * @return ApiResponse<UpdateAudienceForSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse updateAudienceForSpaceWithHttpInfo( - String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) - throws ApiException { - okhttp3.Call localVarCall = - updateAudienceForSpaceValidateBeforeCall( - spaceId, id, updateAudienceForSpaceInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Audience for Space (asynchronously) Updates the enabled status for an audience • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Audience feature enabled. Please reach out to your customer success manager - * for more information. • When called, this endpoint may generate the `Audience - * Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is - * updated, the Audience will be locked from future edits until the changes have been - * incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param updateAudienceForSpaceInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateAudienceForSpaceAsync( - String spaceId, - String id, - UpdateAudienceForSpaceInput updateAudienceForSpaceInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateAudienceForSpaceValidateBeforeCall( - spaceId, id, updateAudienceForSpaceInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java deleted file mode 100644 index 7909ad29..00000000 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ /dev/null @@ -1,939 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.GetComputedTrait200Response; -import com.segment.publicapi.models.ListComputedTraits200Response; -import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response; -import com.segment.publicapi.models.UpdateComputedTraitForSpace200Response; -import com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaInput; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ComputedTraitsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ComputedTraitsApi() { - this(Configuration.getDefaultApiClient()); - } - - public ComputedTraitsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getComputedTrait - * - * @param spaceId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getComputedTraitCall(String spaceId, String id, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/computed-traits/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getComputedTraitValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getComputedTrait(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling getComputedTrait(Async)"); - } - - okhttp3.Call localVarCall = getComputedTraitCall(spaceId, id, _callback); - return localVarCall; - } - - /** - * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Computed - * Trait feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return GetComputedTrait200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetComputedTrait200Response getComputedTrait(String spaceId, String id) - throws ApiException { - ApiResponse localVarResp = - getComputedTraitWithHttpInfo(spaceId, id); - return localVarResp.getData(); - } - - /** - * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Computed - * Trait feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return ApiResponse<GetComputedTrait200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getComputedTraitWithHttpInfo( - String spaceId, String id) throws ApiException { - okhttp3.Call localVarCall = getComputedTraitValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Computed Trait (asynchronously) Returns the Computed Trait by id and spaceId • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. The rate limit for this endpoint is 100 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getComputedTraitAsync( - String spaceId, String id, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getComputedTraitValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listComputedTraits - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listComputedTraitsCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/computed-traits" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listComputedTraitsValidateBeforeCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " listComputedTraits(Async)"); - } - - // verify the required parameter 'pagination' is set - if (pagination == null) { - throw new ApiException( - "Missing the required parameter 'pagination' when calling" - + " listComputedTraits(Async)"); - } - - okhttp3.Call localVarCall = listComputedTraitsCall(spaceId, pagination, _callback); - return localVarCall; - } - - /** - * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Computed Trait - * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 25 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @return ListComputedTraits200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListComputedTraits200Response listComputedTraits( - String spaceId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = - listComputedTraitsWithHttpInfo(spaceId, pagination); - return localVarResp.getData(); - } - - /** - * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Computed Trait - * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 25 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @return ApiResponse<ListComputedTraits200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse listComputedTraitsWithHttpInfo( - String spaceId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listComputedTraitsValidateBeforeCall(spaceId, pagination, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Computed Traits (asynchronously) Returns Computed Traits by spaceId. • This endpoint is - * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Computed Trait feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 25 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param pagination Information about the pagination of this response. This parameter exists in - * alpha. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listComputedTraitsAsync( - String spaceId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listComputedTraitsValidateBeforeCall(spaceId, pagination, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for removeComputedTraitFromSpace - * - * @param spaceId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeComputedTraitFromSpaceCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/computed-traits/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " removeComputedTraitFromSpace(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling" - + " removeComputedTraitFromSpace(Async)"); - } - - okhttp3.Call localVarCall = removeComputedTraitFromSpaceCall(spaceId, id, _callback); - return localVarCall; - } - - /** - * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint - * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. - * • In order to successfully call this endpoint, the specified Workspace needs to have the - * Computed Trait feature enabled. Please reach out to your customer success manager for more - * information. • When called, this endpoint may generate the `Computed Trait Deleted` - * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests - * per minute, which is lower than the default due to access pattern restrictions. Once reached, - * this endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return RemoveComputedTraitFromSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( - String spaceId, String id) throws ApiException { - ApiResponse localVarResp = - removeComputedTraitFromSpaceWithHttpInfo(spaceId, id); - return localVarResp.getData(); - } - - /** - * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint - * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. - * • In order to successfully call this endpoint, the specified Workspace needs to have the - * Computed Trait feature enabled. Please reach out to your customer success manager for more - * information. • When called, this endpoint may generate the `Computed Trait Deleted` - * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests - * per minute, which is lower than the default due to access pattern restrictions. Once reached, - * this endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return ApiResponse<RemoveComputedTraitFromSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - removeComputedTraitFromSpaceWithHttpInfo(String spaceId, String id) - throws ApiException { - okhttp3.Call localVarCall = - removeComputedTraitFromSpaceValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Remove Computed Trait from Space (asynchronously) Deletes a Computed Trait by id and spaceId. - * • This endpoint is in **Alpha** testing. Please submit any feedback by sending email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this - * endpoint is 20 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeComputedTraitFromSpaceAsync( - String spaceId, - String id, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - removeComputedTraitFromSpaceValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for updateComputedTraitForSpace - * - * @param spaceId (required) - * @param id (required) - * @param updateComputedTraitForSpaceAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateComputedTraitForSpaceCall( - String spaceId, - String id, - UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateComputedTraitForSpaceAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/computed-traits/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", - localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( - String spaceId, - String id, - UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " updateComputedTraitForSpace(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling" - + " updateComputedTraitForSpace(Async)"); - } - - // verify the required parameter 'updateComputedTraitForSpaceAlphaInput' is set - if (updateComputedTraitForSpaceAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'updateComputedTraitForSpaceAlphaInput' when" - + " calling updateComputedTraitForSpace(Async)"); - } - - okhttp3.Call localVarCall = - updateComputedTraitForSpaceCall( - spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); - return localVarCall; - } - - /** - * Update Computed Trait for Space Updates the enabled status for a computed trait. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a - * Computed Trait is updated, the Computed Trait will be locked from future edits until the - * changes have been incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param updateComputedTraitForSpaceAlphaInput (required) - * @return UpdateComputedTraitForSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( - String spaceId, - String id, - UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput) - throws ApiException { - ApiResponse localVarResp = - updateComputedTraitForSpaceWithHttpInfo( - spaceId, id, updateComputedTraitForSpaceAlphaInput); - return localVarResp.getData(); - } - - /** - * Update Computed Trait for Space Updates the enabled status for a computed trait. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a - * Computed Trait is updated, the Computed Trait will be locked from future edits until the - * changes have been incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param updateComputedTraitForSpaceAlphaInput (required) - * @return ApiResponse<UpdateComputedTraitForSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - updateComputedTraitForSpaceWithHttpInfo( - String spaceId, - String id, - UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - updateComputedTraitForSpaceValidateBeforeCall( - spaceId, id, updateComputedTraitForSpaceAlphaInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Computed Trait for Space (asynchronously) Updates the enabled status for a computed - * trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending email - * to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer - * success manager for more information. • When called, this endpoint may generate the - * `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that - * when a Computed Trait is updated, the Computed Trait will be locked from future edits until - * the changes have been incorporated. You can find more information [in the Segment - * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param updateComputedTraitForSpaceAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateComputedTraitForSpaceAsync( - String spaceId, - String id, - UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateComputedTraitForSpaceValidateBeforeCall( - spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 44b305e1..7ffa3443 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -22,22 +22,16 @@ import com.segment.publicapi.models.CreateFunction200Response; import com.segment.publicapi.models.CreateFunctionDeployment200Response; import com.segment.publicapi.models.CreateFunctionV1Input; -import com.segment.publicapi.models.CreateInsertFunctionInstance200Response; -import com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput; import com.segment.publicapi.models.DeleteFunction200Response; -import com.segment.publicapi.models.DeleteInsertFunctionInstance200Response; import com.segment.publicapi.models.GetFunction200Response; import com.segment.publicapi.models.GetFunctionVersion200Response; import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; -import com.segment.publicapi.models.ListInsertFunctionInstances200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RestoreFunctionVersion200Response; import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; -import com.segment.publicapi.models.UpdateInsertFunctionInstance200Response; -import com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -434,189 +428,6 @@ public okhttp3.Call createFunctionDeploymentAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for createInsertFunctionInstance - * - * @param createInsertFunctionInstanceAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createInsertFunctionInstanceCall( - CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createInsertFunctionInstanceAlphaInput; - - // create path and map variables - String localVarPath = "/insert-function/instance"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createInsertFunctionInstanceValidateBeforeCall( - CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'createInsertFunctionInstanceAlphaInput' is set - if (createInsertFunctionInstanceAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'createInsertFunctionInstanceAlphaInput' when" - + " calling createInsertFunctionInstance(Async)"); - } - - okhttp3.Call localVarCall = - createInsertFunctionInstanceCall(createInsertFunctionInstanceAlphaInput, _callback); - return localVarCall; - } - - /** - * Create Insert Function Instance Creates an insert Function instance connected to the given - * Destination. • In order to successfully call this endpoint, the specified Workspace needs to - * have the Functions feature enabled. Please reach out to your customer success manager for - * more information. - * - * @param createInsertFunctionInstanceAlphaInput (required) - * @return CreateInsertFunctionInstance200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CreateInsertFunctionInstance200Response createInsertFunctionInstance( - CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) - throws ApiException { - ApiResponse localVarResp = - createInsertFunctionInstanceWithHttpInfo(createInsertFunctionInstanceAlphaInput); - return localVarResp.getData(); - } - - /** - * Create Insert Function Instance Creates an insert Function instance connected to the given - * Destination. • In order to successfully call this endpoint, the specified Workspace needs to - * have the Functions feature enabled. Please reach out to your customer success manager for - * more information. - * - * @param createInsertFunctionInstanceAlphaInput (required) - * @return ApiResponse<CreateInsertFunctionInstance200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - createInsertFunctionInstanceWithHttpInfo( - CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - createInsertFunctionInstanceValidateBeforeCall( - createInsertFunctionInstanceAlphaInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Insert Function Instance (asynchronously) Creates an insert Function instance - * connected to the given Destination. • In order to successfully call this endpoint, the - * specified Workspace needs to have the Functions feature enabled. Please reach out to your - * customer success manager for more information. - * - * @param createInsertFunctionInstanceAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createInsertFunctionInstanceAsync( - CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createInsertFunctionInstanceValidateBeforeCall( - createInsertFunctionInstanceAlphaInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for deleteFunction * @@ -789,180 +600,6 @@ public okhttp3.Call deleteFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for deleteInsertFunctionInstance - * - * @param instanceId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call deleteInsertFunctionInstanceCall( - String instanceId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/insert-function/instance/{instanceId}" - .replaceAll( - "\\{" + "instanceId" + "\\}", - localVarApiClient.escapeString(instanceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteInsertFunctionInstanceValidateBeforeCall( - String instanceId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'instanceId' is set - if (instanceId == null) { - throw new ApiException( - "Missing the required parameter 'instanceId' when calling" - + " deleteInsertFunctionInstance(Async)"); - } - - okhttp3.Call localVarCall = deleteInsertFunctionInstanceCall(instanceId, _callback); - return localVarCall; - } - - /** - * Delete Insert Function Instance Deletes an insert Function instance. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param instanceId (required) - * @return DeleteInsertFunctionInstance200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance(String instanceId) - throws ApiException { - ApiResponse localVarResp = - deleteInsertFunctionInstanceWithHttpInfo(instanceId); - return localVarResp.getData(); - } - - /** - * Delete Insert Function Instance Deletes an insert Function instance. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param instanceId (required) - * @return ApiResponse<DeleteInsertFunctionInstance200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - deleteInsertFunctionInstanceWithHttpInfo(String instanceId) throws ApiException { - okhttp3.Call localVarCall = - deleteInsertFunctionInstanceValidateBeforeCall(instanceId, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Delete Insert Function Instance (asynchronously) Deletes an insert Function instance. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. - * - * @param instanceId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call deleteInsertFunctionInstanceAsync( - String instanceId, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - deleteInsertFunctionInstanceValidateBeforeCall(instanceId, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getFunction * @@ -1446,219 +1083,21 @@ private okhttp3.Call listFunctionVersionsValidateBeforeCall( * 429 Too many requests - * */ - public ListFunctionVersions200Response listFunctionVersions( - String functionId, PaginationInput pagination) throws ApiException { - ApiResponse localVarResp = - listFunctionVersionsWithHttpInfo(functionId, pagination); - return localVarResp.getData(); - } - - /** - * List Function Versions Lists versions for a Function in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @return ApiResponse<ListFunctionVersions200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse listFunctionVersionsWithHttpInfo( - String functionId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. - * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listFunctionVersionsAsync( - String functionId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for listFunctions - * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listFunctionsCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/functions"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - if (resourceType != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("resourceType", resourceType)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionsValidateBeforeCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'pagination' is set - if (pagination == null) { - throw new ApiException( - "Missing the required parameter 'pagination' when calling" - + " listFunctions(Async)"); - } - - // verify the required parameter 'resourceType' is set - if (resourceType == null) { - throw new ApiException( - "Missing the required parameter 'resourceType' when calling" - + " listFunctions(Async)"); - } - - okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); - return localVarCall; - } - - /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. - * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ListFunctions200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) - throws ApiException { - ApiResponse localVarResp = - listFunctionsWithHttpInfo(pagination, resourceType); + public ListFunctionVersions200Response listFunctionVersions( + String functionId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listFunctionVersionsWithHttpInfo(functionId, pagination); return localVarResp.getData(); } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Function Versions Lists versions for a Function in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ApiResponse<ListFunctions200Response> + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @return ApiResponse<ListFunctionVersions200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1670,21 +1109,21 @@ public ListFunctions200Response listFunctions(PaginationInput pagination, String * 429 Too many requests - * */ - public ApiResponse listFunctionsWithHttpInfo( - PaginationInput pagination, String resourceType) throws ApiException { - okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse listFunctionVersionsWithHttpInfo( + String functionId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1698,24 +1137,24 @@ public ApiResponse listFunctionsWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsAsync( + public okhttp3.Call listFunctionVersionsAsync( + String functionId, PaginationInput pagination, - String resourceType, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionsValidateBeforeCall(pagination, resourceType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listInsertFunctionInstances + * Build call for listFunctions * - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param functionId The insert Function class id to lookup. This parameter exists in alpha. - * (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1728,8 +1167,8 @@ public okhttp3.Call listFunctionsAsync( * 429 Too many requests - * */ - public okhttp3.Call listInsertFunctionInstancesCall( - PaginationInput pagination, String functionId, final ApiCallback _callback) + public okhttp3.Call listFunctionsCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1747,7 +1186,7 @@ public okhttp3.Call listInsertFunctionInstancesCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/insert-function/instances"; + String localVarPath = "/functions"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1759,12 +1198,16 @@ public okhttp3.Call listInsertFunctionInstancesCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } - if (functionId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("functionId", functionId)); + if (resourceType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("resourceType", resourceType)); } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1795,39 +1238,37 @@ public okhttp3.Call listInsertFunctionInstancesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( - PaginationInput pagination, String functionId, final ApiCallback _callback) + private okhttp3.Call listFunctionsValidateBeforeCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling" - + " listInsertFunctionInstances(Async)"); + + " listFunctions(Async)"); } - // verify the required parameter 'functionId' is set - if (functionId == null) { + // verify the required parameter 'resourceType' is set + if (resourceType == null) { throw new ApiException( - "Missing the required parameter 'functionId' when calling" - + " listInsertFunctionInstances(Async)"); + "Missing the required parameter 'resourceType' when calling" + + " listFunctions(Async)"); } - okhttp3.Call localVarCall = - listInsertFunctionInstancesCall(pagination, functionId, _callback); + okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); return localVarCall; } /** - * List Insert Function Instances Lists all insert Function instances connected to the given - * insert Function. • In order to successfully call this endpoint, the specified Workspace needs - * to have the Functions feature enabled. Please reach out to your customer success manager for - * more information. + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param functionId The insert Function class id to lookup. This parameter exists in alpha. - * (required) - * @return ListInsertFunctionInstances200Response + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ListFunctions200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1839,23 +1280,22 @@ private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( * 429 Too many requests - * */ - public ListInsertFunctionInstances200Response listInsertFunctionInstances( - PaginationInput pagination, String functionId) throws ApiException { - ApiResponse localVarResp = - listInsertFunctionInstancesWithHttpInfo(pagination, functionId); + public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) + throws ApiException { + ApiResponse localVarResp = + listFunctionsWithHttpInfo(pagination, resourceType); return localVarResp.getData(); } /** - * List Insert Function Instances Lists all insert Function instances connected to the given - * insert Function. • In order to successfully call this endpoint, the specified Workspace needs - * to have the Functions feature enabled. Please reach out to your customer success manager for - * more information. + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param functionId The insert Function class id to lookup. This parameter exists in alpha. - * (required) - * @return ApiResponse<ListInsertFunctionInstances200Response> + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ApiResponse<ListFunctions200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1867,25 +1307,21 @@ public ListInsertFunctionInstances200Response listInsertFunctionInstances( * 429 Too many requests - * */ - public ApiResponse - listInsertFunctionInstancesWithHttpInfo(PaginationInput pagination, String functionId) - throws ApiException { - okhttp3.Call localVarCall = - listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, null); - Type localVarReturnType = - new TypeToken() {}.getType(); + public ApiResponse listFunctionsWithHttpInfo( + PaginationInput pagination, String resourceType) throws ApiException { + okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Insert Function Instances (asynchronously) Lists all insert Function instances connected - * to the given insert Function. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Functions feature enabled. Please reach out to your customer - * success manager for more information. + * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @param functionId The insert Function class id to lookup. This parameter exists in alpha. - * (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1899,16 +1335,15 @@ public ListInsertFunctionInstances200Response listInsertFunctionInstances( * 429 Too many requests - * */ - public okhttp3.Call listInsertFunctionInstancesAsync( + public okhttp3.Call listFunctionsAsync( PaginationInput pagination, - String functionId, - final ApiCallback _callback) + String resourceType, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); + listFunctionsValidateBeforeCall(pagination, resourceType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -2309,209 +1744,4 @@ public okhttp3.Call updateFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for updateInsertFunctionInstance - * - * @param instanceId (required) - * @param updateInsertFunctionInstanceAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateInsertFunctionInstanceCall( - String instanceId, - UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateInsertFunctionInstanceAlphaInput; - - // create path and map variables - String localVarPath = - "/insert-function/instance/{instanceId}" - .replaceAll( - "\\{" + "instanceId" + "\\}", - localVarApiClient.escapeString(instanceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateInsertFunctionInstanceValidateBeforeCall( - String instanceId, - UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, - final ApiCallback _callback) - throws ApiException { - - // verify the required parameter 'instanceId' is set - if (instanceId == null) { - throw new ApiException( - "Missing the required parameter 'instanceId' when calling" - + " updateInsertFunctionInstance(Async)"); - } - - // verify the required parameter 'updateInsertFunctionInstanceAlphaInput' is set - if (updateInsertFunctionInstanceAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'updateInsertFunctionInstanceAlphaInput' when" - + " calling updateInsertFunctionInstance(Async)"); - } - - okhttp3.Call localVarCall = - updateInsertFunctionInstanceCall( - instanceId, updateInsertFunctionInstanceAlphaInput, _callback); - return localVarCall; - } - - /** - * Update Insert Function Instance Updates an insert Function instance connected to the given - * Destination. • In order to successfully call this endpoint, the specified Workspace needs to - * have the Functions feature enabled. Please reach out to your customer success manager for - * more information. - * - * @param instanceId (required) - * @param updateInsertFunctionInstanceAlphaInput (required) - * @return UpdateInsertFunctionInstance200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public UpdateInsertFunctionInstance200Response updateInsertFunctionInstance( - String instanceId, - UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) - throws ApiException { - ApiResponse localVarResp = - updateInsertFunctionInstanceWithHttpInfo( - instanceId, updateInsertFunctionInstanceAlphaInput); - return localVarResp.getData(); - } - - /** - * Update Insert Function Instance Updates an insert Function instance connected to the given - * Destination. • In order to successfully call this endpoint, the specified Workspace needs to - * have the Functions feature enabled. Please reach out to your customer success manager for - * more information. - * - * @param instanceId (required) - * @param updateInsertFunctionInstanceAlphaInput (required) - * @return ApiResponse<UpdateInsertFunctionInstance200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - updateInsertFunctionInstanceWithHttpInfo( - String instanceId, - UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - updateInsertFunctionInstanceValidateBeforeCall( - instanceId, updateInsertFunctionInstanceAlphaInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Insert Function Instance (asynchronously) Updates an insert Function instance - * connected to the given Destination. • In order to successfully call this endpoint, the - * specified Workspace needs to have the Functions feature enabled. Please reach out to your - * customer success manager for more information. - * - * @param instanceId (required) - * @param updateInsertFunctionInstanceAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateInsertFunctionInstanceAsync( - String instanceId, - UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateInsertFunctionInstanceValidateBeforeCall( - instanceId, updateInsertFunctionInstanceAlphaInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/com/segment/publicapi/models/Audience.java b/src/main/java/com/segment/publicapi/models/Audience.java deleted file mode 100644 index 2b085c47..00000000 --- a/src/main/java/com/segment/publicapi/models/Audience.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The audience summary output. */ -@ApiModel(description = "The audience summary output.") -public class Audience { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public Audience() {} - - public Audience id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Audience id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Audience spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the audience.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public Audience name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the audience.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Audience description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the audience.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Audience key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the audience.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Audience enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Audience createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the audience.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Audience updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the audience.") - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public Audience createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was created.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Audience updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was last updated.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Audience audience = (Audience) o; - return Objects.equals(this.id, audience.id) - && Objects.equals(this.spaceId, audience.spaceId) - && Objects.equals(this.name, audience.name) - && Objects.equals(this.description, audience.description) - && Objects.equals(this.key, audience.key) - && Objects.equals(this.enabled, audience.enabled) - && Objects.equals(this.createdBy, audience.createdBy) - && Objects.equals(this.updatedBy, audience.updatedBy) - && Objects.equals(this.createdAt, audience.createdAt) - && Objects.equals(this.updatedAt, audience.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Audience {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Audience - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Audience.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Audience is not found in the empty" - + " JSON string", - Audience.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Audience.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Audience`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Audience.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Audience.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Audience' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Audience.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Audience value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Audience read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Audience given an JSON string - * - * @param jsonString JSON string - * @return An instance of Audience - * @throws IOException if the JSON string is invalid with respect to Audience - */ - public static Audience fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Audience.class); - } - - /** - * Convert an instance of Audience to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java deleted file mode 100644 index cb21bf50..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Defines an Audience. */ -@ApiModel(description = "Defines an Audience.") -public class AudienceSummary { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public AudienceSummary() {} - - public AudienceSummary id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Audience id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudienceSummary spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the audience.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public AudienceSummary name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the audience.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public AudienceSummary description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the audience.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public AudienceSummary key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the audience.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AudienceSummary enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceSummary createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the audience.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public AudienceSummary updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the audience.") - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public AudienceSummary createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was created.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public AudienceSummary updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was last updated.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSummary audienceSummary = (AudienceSummary) o; - return Objects.equals(this.id, audienceSummary.id) - && Objects.equals(this.spaceId, audienceSummary.spaceId) - && Objects.equals(this.name, audienceSummary.name) - && Objects.equals(this.description, audienceSummary.description) - && Objects.equals(this.key, audienceSummary.key) - && Objects.equals(this.enabled, audienceSummary.enabled) - && Objects.equals(this.createdBy, audienceSummary.createdBy) - && Objects.equals(this.updatedBy, audienceSummary.updatedBy) - && Objects.equals(this.createdAt, audienceSummary.createdAt) - && Objects.equals(this.updatedAt, audienceSummary.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSummary {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AudienceSummary - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!AudienceSummary.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceSummary is not found in the" - + " empty JSON string", - AudienceSummary.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!AudienceSummary.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSummary` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceSummary.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSummary.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceSummary' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceSummary.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceSummary value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSummary read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSummary given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSummary - * @throws IOException if the JSON string is invalid with respect to AudienceSummary - */ - public static AudienceSummary fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceSummary.class); - } - - /** - * Convert an instance of AudienceSummary to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTrait.java b/src/main/java/com/segment/publicapi/models/ComputedTrait.java deleted file mode 100644 index 71624541..00000000 --- a/src/main/java/com/segment/publicapi/models/ComputedTrait.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The computed trait summary output. */ -@ApiModel(description = "The computed trait summary output.") -public class ComputedTrait { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public ComputedTrait() {} - - public ComputedTrait id(String id) { - - this.id = id; - return this; - } - - /** - * Computed trait id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Computed trait id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ComputedTrait spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the computed trait. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the computed trait.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public ComputedTrait name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the computed trait. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the computed trait.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ComputedTrait description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the computed trait. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the computed trait.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public ComputedTrait key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the computed trait. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the computed trait.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public ComputedTrait enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the computed trait. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ComputedTrait createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the computed trait. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the computed trait.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public ComputedTrait updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the computed trait. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public ComputedTrait createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of the computed trait's creation. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public ComputedTrait updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of the computed trait's last change. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComputedTrait computedTrait = (ComputedTrait) o; - return Objects.equals(this.id, computedTrait.id) - && Objects.equals(this.spaceId, computedTrait.spaceId) - && Objects.equals(this.name, computedTrait.name) - && Objects.equals(this.description, computedTrait.description) - && Objects.equals(this.key, computedTrait.key) - && Objects.equals(this.enabled, computedTrait.enabled) - && Objects.equals(this.createdBy, computedTrait.createdBy) - && Objects.equals(this.updatedBy, computedTrait.updatedBy) - && Objects.equals(this.createdAt, computedTrait.createdAt) - && Objects.equals(this.updatedAt, computedTrait.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ComputedTrait {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ComputedTrait - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ComputedTrait.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ComputedTrait is not found in the" - + " empty JSON string", - ComputedTrait.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ComputedTrait.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ComputedTrait` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ComputedTrait.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ComputedTrait.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ComputedTrait' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ComputedTrait.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ComputedTrait value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ComputedTrait read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ComputedTrait given an JSON string - * - * @param jsonString JSON string - * @return An instance of ComputedTrait - * @throws IOException if the JSON string is invalid with respect to ComputedTrait - */ - public static ComputedTrait fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ComputedTrait.class); - } - - /** - * Convert an instance of ComputedTrait to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java deleted file mode 100644 index e330303e..00000000 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Defines a Computed trait. */ -@ApiModel(description = "Defines a Computed trait.") -public class ComputedTraitSummary { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public ComputedTraitSummary() {} - - public ComputedTraitSummary id(String id) { - - this.id = id; - return this; - } - - /** - * Computed trait id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Computed trait id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ComputedTraitSummary spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the computed trait. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the computed trait.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public ComputedTraitSummary name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the computed trait. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the computed trait.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ComputedTraitSummary description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the computed trait. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the computed trait.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public ComputedTraitSummary key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the computed trait. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the computed trait.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public ComputedTraitSummary enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the computed trait. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ComputedTraitSummary createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the computed trait. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the computed trait.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public ComputedTraitSummary updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the computed trait. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public ComputedTraitSummary createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of the computed trait's creation. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public ComputedTraitSummary updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of the computed trait's last change. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComputedTraitSummary computedTraitSummary = (ComputedTraitSummary) o; - return Objects.equals(this.id, computedTraitSummary.id) - && Objects.equals(this.spaceId, computedTraitSummary.spaceId) - && Objects.equals(this.name, computedTraitSummary.name) - && Objects.equals(this.description, computedTraitSummary.description) - && Objects.equals(this.key, computedTraitSummary.key) - && Objects.equals(this.enabled, computedTraitSummary.enabled) - && Objects.equals(this.createdBy, computedTraitSummary.createdBy) - && Objects.equals(this.updatedBy, computedTraitSummary.updatedBy) - && Objects.equals(this.createdAt, computedTraitSummary.createdAt) - && Objects.equals(this.updatedAt, computedTraitSummary.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ComputedTraitSummary {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ComputedTraitSummary - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ComputedTraitSummary.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ComputedTraitSummary is not found in" - + " the empty JSON string", - ComputedTraitSummary.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ComputedTraitSummary.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ComputedTraitSummary` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ComputedTraitSummary.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ComputedTraitSummary.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ComputedTraitSummary' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ComputedTraitSummary.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ComputedTraitSummary value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ComputedTraitSummary read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ComputedTraitSummary given an JSON string - * - * @param jsonString JSON string - * @return An instance of ComputedTraitSummary - * @throws IOException if the JSON string is invalid with respect to ComputedTraitSummary - */ - public static ComputedTraitSummary fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ComputedTraitSummary.class); - } - - /** - * Convert an instance of ComputedTraitSummary to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java deleted file mode 100644 index 1cc532a5..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** CreateInsertFunctionInstance200Response */ -public class CreateInsertFunctionInstance200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CreateInsertFunctionInstanceAlphaOutput data; - - public CreateInsertFunctionInstance200Response() {} - - public CreateInsertFunctionInstance200Response data( - CreateInsertFunctionInstanceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public CreateInsertFunctionInstanceAlphaOutput getData() { - return data; - } - - public void setData(CreateInsertFunctionInstanceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateInsertFunctionInstance200Response createInsertFunctionInstance200Response = - (CreateInsertFunctionInstance200Response) o; - return Objects.equals(this.data, createInsertFunctionInstance200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateInsertFunctionInstance200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * CreateInsertFunctionInstance200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateInsertFunctionInstance200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " CreateInsertFunctionInstance200Response is not found in the" - + " empty JSON string", - CreateInsertFunctionInstance200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateInsertFunctionInstance200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateInsertFunctionInstance200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'CreateInsertFunctionInstance200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateInsertFunctionInstance200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, CreateInsertFunctionInstance200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateInsertFunctionInstance200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateInsertFunctionInstance200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateInsertFunctionInstance200Response - * @throws IOException if the JSON string is invalid with respect to - * CreateInsertFunctionInstance200Response - */ - public static CreateInsertFunctionInstance200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstance200Response.class); - } - - /** - * Convert an instance of CreateInsertFunctionInstance200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java deleted file mode 100644 index 2ee247d9..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Creates an insert Function instance. */ -@ApiModel(description = "Creates an insert Function instance.") -public class CreateInsertFunctionInstanceAlphaInput { - public static final String SERIALIZED_NAME_FUNCTION_ID = "functionId"; - - @SerializedName(SERIALIZED_NAME_FUNCTION_ID) - private String functionId; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private String integrationId; - - /** The insert Function type. */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - INSERT_FUNCTION_DESTINATION("INSERT_FUNCTION_DESTINATION"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public CreateInsertFunctionInstanceAlphaInput() {} - - public CreateInsertFunctionInstanceAlphaInput functionId(String functionId) { - - this.functionId = functionId; - return this; - } - - /** - * Insert Function id to which this instance is associated. - * - * @return functionId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Insert Function id to which this instance is associated.") - public String getFunctionId() { - return functionId; - } - - public void setFunctionId(String functionId) { - this.functionId = functionId; - } - - public CreateInsertFunctionInstanceAlphaInput integrationId(String integrationId) { - - this.integrationId = integrationId; - return this; - } - - /** - * The Source or Destination id to be connected. - * - * @return integrationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source or Destination id to be connected.") - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(String integrationId) { - this.integrationId = integrationId; - } - - public CreateInsertFunctionInstanceAlphaInput type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The insert Function type. - * - * @return type - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The insert Function type.") - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public CreateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether this insert Function instance should be enabled for the Destination. - * - * @return enabled - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Whether this insert Function instance should be enabled for the Destination.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public CreateInsertFunctionInstanceAlphaInput name(String name) { - - this.name = name; - return this; - } - - /** - * Defines the display name of the insert Function instance. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Defines the display name of the insert Function instance.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CreateInsertFunctionInstanceAlphaInput settings(Map settings) { - - this.settings = settings; - return this; - } - - public CreateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * An object that contains settings for this insert Function instance based on the settings - * present in the insert Function class. - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "An object that contains settings for this insert Function instance based on" - + " the settings present in the insert Function class.") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput = - (CreateInsertFunctionInstanceAlphaInput) o; - return Objects.equals(this.functionId, createInsertFunctionInstanceAlphaInput.functionId) - && Objects.equals( - this.integrationId, createInsertFunctionInstanceAlphaInput.integrationId) - && Objects.equals(this.type, createInsertFunctionInstanceAlphaInput.type) - && Objects.equals(this.enabled, createInsertFunctionInstanceAlphaInput.enabled) - && Objects.equals(this.name, createInsertFunctionInstanceAlphaInput.name) - && Objects.equals(this.settings, createInsertFunctionInstanceAlphaInput.settings); - } - - @Override - public int hashCode() { - return Objects.hash(functionId, integrationId, type, enabled, name, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateInsertFunctionInstanceAlphaInput {\n"); - sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("functionId"); - openapiFields.add("integrationId"); - openapiFields.add("type"); - openapiFields.add("enabled"); - openapiFields.add("name"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("functionId"); - openapiRequiredFields.add("integrationId"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * CreateInsertFunctionInstanceAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateInsertFunctionInstanceAlphaInput" - + " is not found in the empty JSON string", - CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateInsertFunctionInstanceAlphaInput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("functionId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `functionId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("functionId").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `integrationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("integrationId").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaInput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateInsertFunctionInstanceAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, CreateInsertFunctionInstanceAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateInsertFunctionInstanceAlphaInput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateInsertFunctionInstanceAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateInsertFunctionInstanceAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * CreateInsertFunctionInstanceAlphaInput - */ - public static CreateInsertFunctionInstanceAlphaInput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaInput.class); - } - - /** - * Convert an instance of CreateInsertFunctionInstanceAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java deleted file mode 100644 index 19d37394..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Creates an insert Function instance. */ -@ApiModel(description = "Creates an insert Function instance.") -public class CreateInsertFunctionInstanceAlphaOutput { - public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; - - @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) - private InsertFunctionInstance insertFunctionInstance; - - public CreateInsertFunctionInstanceAlphaOutput() {} - - public CreateInsertFunctionInstanceAlphaOutput insertFunctionInstance( - InsertFunctionInstance insertFunctionInstance) { - - this.insertFunctionInstance = insertFunctionInstance; - return this; - } - - /** - * Get insertFunctionInstance - * - * @return insertFunctionInstance - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public InsertFunctionInstance getInsertFunctionInstance() { - return insertFunctionInstance; - } - - public void setInsertFunctionInstance(InsertFunctionInstance insertFunctionInstance) { - this.insertFunctionInstance = insertFunctionInstance; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateInsertFunctionInstanceAlphaOutput createInsertFunctionInstanceAlphaOutput = - (CreateInsertFunctionInstanceAlphaOutput) o; - return Objects.equals( - this.insertFunctionInstance, - createInsertFunctionInstanceAlphaOutput.insertFunctionInstance); - } - - @Override - public int hashCode() { - return Objects.hash(insertFunctionInstance); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateInsertFunctionInstanceAlphaOutput {\n"); - sb.append(" insertFunctionInstance: ") - .append(toIndentedString(insertFunctionInstance)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("insertFunctionInstance"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("insertFunctionInstance"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * CreateInsertFunctionInstanceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " CreateInsertFunctionInstanceAlphaOutput is not found in the" - + " empty JSON string", - CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CreateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateInsertFunctionInstanceAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateInsertFunctionInstanceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, CreateInsertFunctionInstanceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateInsertFunctionInstanceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateInsertFunctionInstanceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateInsertFunctionInstanceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * CreateInsertFunctionInstanceAlphaOutput - */ - public static CreateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaOutput.class); - } - - /** - * Convert an instance of CreateInsertFunctionInstanceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java deleted file mode 100644 index 00630b51..00000000 --- a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** DeleteInsertFunctionInstance200Response */ -public class DeleteInsertFunctionInstance200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private DeleteInsertFunctionInstanceAlphaOutput data; - - public DeleteInsertFunctionInstance200Response() {} - - public DeleteInsertFunctionInstance200Response data( - DeleteInsertFunctionInstanceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public DeleteInsertFunctionInstanceAlphaOutput getData() { - return data; - } - - public void setData(DeleteInsertFunctionInstanceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance200Response = - (DeleteInsertFunctionInstance200Response) o; - return Objects.equals(this.data, deleteInsertFunctionInstance200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteInsertFunctionInstance200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * DeleteInsertFunctionInstance200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteInsertFunctionInstance200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " DeleteInsertFunctionInstance200Response is not found in the" - + " empty JSON string", - DeleteInsertFunctionInstance200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteInsertFunctionInstance200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteInsertFunctionInstance200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'DeleteInsertFunctionInstance200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeleteInsertFunctionInstance200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, DeleteInsertFunctionInstance200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteInsertFunctionInstance200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteInsertFunctionInstance200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteInsertFunctionInstance200Response - * @throws IOException if the JSON string is invalid with respect to - * DeleteInsertFunctionInstance200Response - */ - public static DeleteInsertFunctionInstance200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstance200Response.class); - } - - /** - * Convert an instance of DeleteInsertFunctionInstance200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java deleted file mode 100644 index 99baa644..00000000 --- a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Delete an insert Function instance. */ -@ApiModel(description = "Delete an insert Function instance.") -public class DeleteInsertFunctionInstanceAlphaOutput { - /** The status of the operation. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public DeleteInsertFunctionInstanceAlphaOutput() {} - - public DeleteInsertFunctionInstanceAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The status of the operation. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeleteInsertFunctionInstanceAlphaOutput deleteInsertFunctionInstanceAlphaOutput = - (DeleteInsertFunctionInstanceAlphaOutput) o; - return Objects.equals(this.status, deleteInsertFunctionInstanceAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeleteInsertFunctionInstanceAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * DeleteInsertFunctionInstanceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " DeleteInsertFunctionInstanceAlphaOutput is not found in the" - + " empty JSON string", - DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeleteInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeleteInsertFunctionInstanceAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeleteInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'DeleteInsertFunctionInstanceAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeleteInsertFunctionInstanceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, DeleteInsertFunctionInstanceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeleteInsertFunctionInstanceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeleteInsertFunctionInstanceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeleteInsertFunctionInstanceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * DeleteInsertFunctionInstanceAlphaOutput - */ - public static DeleteInsertFunctionInstanceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstanceAlphaOutput.class); - } - - /** - * Convert an instance of DeleteInsertFunctionInstanceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java deleted file mode 100644 index fb719310..00000000 --- a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** GetAudience200Response */ -public class GetAudience200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetAudienceAlphaOutput data; - - public GetAudience200Response() {} - - public GetAudience200Response data(GetAudienceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public GetAudienceAlphaOutput getData() { - return data; - } - - public void setData(GetAudienceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAudience200Response getAudience200Response = (GetAudience200Response) o; - return Objects.equals(this.data, getAudience200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAudience200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetAudience200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetAudience200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetAudience200Response is not found in" - + " the empty JSON string", - GetAudience200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetAudience200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAudience200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudience200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAudience200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetAudience200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAudience200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAudience200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetAudience200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAudience200Response - * @throws IOException if the JSON string is invalid with respect to GetAudience200Response - */ - public static GetAudience200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAudience200Response.class); - } - - /** - * Convert an instance of GetAudience200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java deleted file mode 100644 index 425598b3..00000000 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Audience output for update. */ -@ApiModel(description = "Audience output for update.") -public class GetAudienceAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE = "audience"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE) - private Audience audience; - - public GetAudienceAlphaOutput() {} - - public GetAudienceAlphaOutput audience(Audience audience) { - - this.audience = audience; - return this; - } - - /** - * Get audience - * - * @return audience - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Audience getAudience() { - return audience; - } - - public void setAudience(Audience audience) { - this.audience = audience; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAudienceAlphaOutput getAudienceAlphaOutput = (GetAudienceAlphaOutput) o; - return Objects.equals(this.audience, getAudienceAlphaOutput.audience); - } - - @Override - public int hashCode() { - return Objects.hash(audience); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAudienceAlphaOutput {\n"); - sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audience"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audience"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetAudienceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetAudienceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetAudienceAlphaOutput is not found in" - + " the empty JSON string", - GetAudienceAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetAudienceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAudienceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetAudienceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudienceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAudienceAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetAudienceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAudienceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAudienceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetAudienceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAudienceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetAudienceAlphaOutput - */ - public static GetAudienceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAudienceAlphaOutput.class); - } - - /** - * Convert an instance of GetAudienceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java deleted file mode 100644 index e66b7d4c..00000000 --- a/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** GetComputedTrait200Response */ -public class GetComputedTrait200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetComputedTraitAlphaOutput data; - - public GetComputedTrait200Response() {} - - public GetComputedTrait200Response data(GetComputedTraitAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public GetComputedTraitAlphaOutput getData() { - return data; - } - - public void setData(GetComputedTraitAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetComputedTrait200Response getComputedTrait200Response = (GetComputedTrait200Response) o; - return Objects.equals(this.data, getComputedTrait200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetComputedTrait200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetComputedTrait200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetComputedTrait200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetComputedTrait200Response is not" - + " found in the empty JSON string", - GetComputedTrait200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetComputedTrait200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetComputedTrait200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetComputedTrait200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetComputedTrait200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetComputedTrait200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetComputedTrait200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetComputedTrait200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetComputedTrait200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetComputedTrait200Response - * @throws IOException if the JSON string is invalid with respect to GetComputedTrait200Response - */ - public static GetComputedTrait200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetComputedTrait200Response.class); - } - - /** - * Convert an instance of GetComputedTrait200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java deleted file mode 100644 index 2940b617..00000000 --- a/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Computed Trait output for get and update. */ -@ApiModel(description = "Computed Trait output for get and update.") -public class GetComputedTraitAlphaOutput { - public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; - - @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) - private ComputedTrait computedTrait; - - public GetComputedTraitAlphaOutput() {} - - public GetComputedTraitAlphaOutput computedTrait(ComputedTrait computedTrait) { - - this.computedTrait = computedTrait; - return this; - } - - /** - * Get computedTrait - * - * @return computedTrait - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public ComputedTrait getComputedTrait() { - return computedTrait; - } - - public void setComputedTrait(ComputedTrait computedTrait) { - this.computedTrait = computedTrait; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetComputedTraitAlphaOutput getComputedTraitAlphaOutput = (GetComputedTraitAlphaOutput) o; - return Objects.equals(this.computedTrait, getComputedTraitAlphaOutput.computedTrait); - } - - @Override - public int hashCode() { - return Objects.hash(computedTrait); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetComputedTraitAlphaOutput {\n"); - sb.append(" computedTrait: ").append(toIndentedString(computedTrait)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("computedTrait"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("computedTrait"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetComputedTraitAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!GetComputedTraitAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetComputedTraitAlphaOutput is not" - + " found in the empty JSON string", - GetComputedTraitAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!GetComputedTraitAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetComputedTraitAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetComputedTraitAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetComputedTraitAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetComputedTraitAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetComputedTraitAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetComputedTraitAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetComputedTraitAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetComputedTraitAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetComputedTraitAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetComputedTraitAlphaOutput - */ - public static GetComputedTraitAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetComputedTraitAlphaOutput.class); - } - - /** - * Convert an instance of GetComputedTraitAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index 05ac64d3..ac6945b9 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -43,12 +43,8 @@ public class GetMessagingSubscriptionSuccessResponse { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ANDROID_PUSH("ANDROID_PUSH"), - EMAIL("EMAIL"), - IOS_PUSH("IOS_PUSH"), - SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 7fdeb2c9..26dfd8bc 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -40,12 +40,8 @@ public class GetSubscriptionRequest { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ANDROID_PUSH("ANDROID_PUSH"), - EMAIL("EMAIL"), - IOS_PUSH("IOS_PUSH"), - SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java deleted file mode 100644 index 3c0cadf9..00000000 --- a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The created instance. */ -@ApiModel(description = "The created instance.") -public class InsertFunctionInstance { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private String integrationId; - - public static final String SERIALIZED_NAME_CLASS_ID = "classId"; - - @SerializedName(SERIALIZED_NAME_CLASS_ID) - private String classId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; - - @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) - private Map encryptedSettings = new HashMap<>(); - - public InsertFunctionInstance() {} - - public InsertFunctionInstance id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public InsertFunctionInstance name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InsertFunctionInstance integrationId(String integrationId) { - - this.integrationId = integrationId; - return this; - } - - /** - * Get integrationId - * - * @return integrationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(String integrationId) { - this.integrationId = integrationId; - } - - public InsertFunctionInstance classId(String classId) { - - this.classId = classId; - return this; - } - - /** - * Get classId - * - * @return classId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public InsertFunctionInstance enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public InsertFunctionInstance createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public InsertFunctionInstance updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public InsertFunctionInstance settings(Map settings) { - - this.settings = settings; - return this; - } - - public InsertFunctionInstance putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * Get settings - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - public InsertFunctionInstance encryptedSettings(Map encryptedSettings) { - - this.encryptedSettings = encryptedSettings; - return this; - } - - public InsertFunctionInstance putEncryptedSettingsItem( - String key, Object encryptedSettingsItem) { - this.encryptedSettings.put(key, encryptedSettingsItem); - return this; - } - - /** - * Get encryptedSettings - * - * @return encryptedSettings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getEncryptedSettings() { - return encryptedSettings; - } - - public void setEncryptedSettings(Map encryptedSettings) { - this.encryptedSettings = encryptedSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InsertFunctionInstance insertFunctionInstance = (InsertFunctionInstance) o; - return Objects.equals(this.id, insertFunctionInstance.id) - && Objects.equals(this.name, insertFunctionInstance.name) - && Objects.equals(this.integrationId, insertFunctionInstance.integrationId) - && Objects.equals(this.classId, insertFunctionInstance.classId) - && Objects.equals(this.enabled, insertFunctionInstance.enabled) - && Objects.equals(this.createdAt, insertFunctionInstance.createdAt) - && Objects.equals(this.updatedAt, insertFunctionInstance.updatedAt) - && Objects.equals(this.settings, insertFunctionInstance.settings) - && Objects.equals(this.encryptedSettings, insertFunctionInstance.encryptedSettings); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - integrationId, - classId, - enabled, - createdAt, - updatedAt, - settings, - encryptedSettings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InsertFunctionInstance {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" encryptedSettings: ") - .append(toIndentedString(encryptedSettings)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("integrationId"); - openapiFields.add("classId"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("settings"); - openapiFields.add("encryptedSettings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("integrationId"); - openapiRequiredFields.add("classId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - openapiRequiredFields.add("settings"); - openapiRequiredFields.add("encryptedSettings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InsertFunctionInstance.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InsertFunctionInstance is not found in" - + " the empty JSON string", - InsertFunctionInstance.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InsertFunctionInstance.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InsertFunctionInstance` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InsertFunctionInstance.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `integrationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("integrationId").toString())); - } - if (!jsonObj.get("classId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `classId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("classId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InsertFunctionInstance.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InsertFunctionInstance' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InsertFunctionInstance value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InsertFunctionInstance read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InsertFunctionInstance given an JSON string - * - * @param jsonString JSON string - * @return An instance of InsertFunctionInstance - * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance - */ - public static InsertFunctionInstance fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InsertFunctionInstance.class); - } - - /** - * Convert an instance of InsertFunctionInstance to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java deleted file mode 100644 index 88b17c35..00000000 --- a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java +++ /dev/null @@ -1,512 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The updated instance. */ -@ApiModel(description = "The updated instance.") -public class InsertFunctionInstance1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private String integrationId; - - public static final String SERIALIZED_NAME_CLASS_ID = "classId"; - - @SerializedName(SERIALIZED_NAME_CLASS_ID) - private String classId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; - - @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) - private Map encryptedSettings = new HashMap<>(); - - public InsertFunctionInstance1() {} - - public InsertFunctionInstance1 id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public InsertFunctionInstance1 name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InsertFunctionInstance1 integrationId(String integrationId) { - - this.integrationId = integrationId; - return this; - } - - /** - * Get integrationId - * - * @return integrationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(String integrationId) { - this.integrationId = integrationId; - } - - public InsertFunctionInstance1 classId(String classId) { - - this.classId = classId; - return this; - } - - /** - * Get classId - * - * @return classId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public InsertFunctionInstance1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public InsertFunctionInstance1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public InsertFunctionInstance1 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public InsertFunctionInstance1 settings(Map settings) { - - this.settings = settings; - return this; - } - - public InsertFunctionInstance1 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * Get settings - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - public InsertFunctionInstance1 encryptedSettings(Map encryptedSettings) { - - this.encryptedSettings = encryptedSettings; - return this; - } - - public InsertFunctionInstance1 putEncryptedSettingsItem( - String key, Object encryptedSettingsItem) { - this.encryptedSettings.put(key, encryptedSettingsItem); - return this; - } - - /** - * Get encryptedSettings - * - * @return encryptedSettings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getEncryptedSettings() { - return encryptedSettings; - } - - public void setEncryptedSettings(Map encryptedSettings) { - this.encryptedSettings = encryptedSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InsertFunctionInstance1 insertFunctionInstance1 = (InsertFunctionInstance1) o; - return Objects.equals(this.id, insertFunctionInstance1.id) - && Objects.equals(this.name, insertFunctionInstance1.name) - && Objects.equals(this.integrationId, insertFunctionInstance1.integrationId) - && Objects.equals(this.classId, insertFunctionInstance1.classId) - && Objects.equals(this.enabled, insertFunctionInstance1.enabled) - && Objects.equals(this.createdAt, insertFunctionInstance1.createdAt) - && Objects.equals(this.updatedAt, insertFunctionInstance1.updatedAt) - && Objects.equals(this.settings, insertFunctionInstance1.settings) - && Objects.equals( - this.encryptedSettings, insertFunctionInstance1.encryptedSettings); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - integrationId, - classId, - enabled, - createdAt, - updatedAt, - settings, - encryptedSettings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InsertFunctionInstance1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" encryptedSettings: ") - .append(toIndentedString(encryptedSettings)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("integrationId"); - openapiFields.add("classId"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("settings"); - openapiFields.add("encryptedSettings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("integrationId"); - openapiRequiredFields.add("classId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - openapiRequiredFields.add("settings"); - openapiRequiredFields.add("encryptedSettings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InsertFunctionInstance1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InsertFunctionInstance1 is not found" - + " in the empty JSON string", - InsertFunctionInstance1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InsertFunctionInstance1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InsertFunctionInstance1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InsertFunctionInstance1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `integrationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("integrationId").toString())); - } - if (!jsonObj.get("classId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `classId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("classId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InsertFunctionInstance1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InsertFunctionInstance1' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InsertFunctionInstance1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InsertFunctionInstance1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InsertFunctionInstance1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of InsertFunctionInstance1 - * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance1 - */ - public static InsertFunctionInstance1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InsertFunctionInstance1.class); - } - - /** - * Convert an instance of InsertFunctionInstance1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java deleted file mode 100644 index f64bb2d2..00000000 --- a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** InsertFunctionInstanceAlpha */ -public class InsertFunctionInstanceAlpha { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private String integrationId; - - public static final String SERIALIZED_NAME_CLASS_ID = "classId"; - - @SerializedName(SERIALIZED_NAME_CLASS_ID) - private String classId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; - - @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) - private Map encryptedSettings = new HashMap<>(); - - public InsertFunctionInstanceAlpha() {} - - public InsertFunctionInstanceAlpha id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public InsertFunctionInstanceAlpha name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InsertFunctionInstanceAlpha integrationId(String integrationId) { - - this.integrationId = integrationId; - return this; - } - - /** - * Get integrationId - * - * @return integrationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(String integrationId) { - this.integrationId = integrationId; - } - - public InsertFunctionInstanceAlpha classId(String classId) { - - this.classId = classId; - return this; - } - - /** - * Get classId - * - * @return classId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public InsertFunctionInstanceAlpha enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public InsertFunctionInstanceAlpha createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public InsertFunctionInstanceAlpha updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public InsertFunctionInstanceAlpha settings(Map settings) { - - this.settings = settings; - return this; - } - - public InsertFunctionInstanceAlpha putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * Get settings - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - public InsertFunctionInstanceAlpha encryptedSettings(Map encryptedSettings) { - - this.encryptedSettings = encryptedSettings; - return this; - } - - public InsertFunctionInstanceAlpha putEncryptedSettingsItem( - String key, Object encryptedSettingsItem) { - this.encryptedSettings.put(key, encryptedSettingsItem); - return this; - } - - /** - * Get encryptedSettings - * - * @return encryptedSettings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getEncryptedSettings() { - return encryptedSettings; - } - - public void setEncryptedSettings(Map encryptedSettings) { - this.encryptedSettings = encryptedSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InsertFunctionInstanceAlpha insertFunctionInstanceAlpha = (InsertFunctionInstanceAlpha) o; - return Objects.equals(this.id, insertFunctionInstanceAlpha.id) - && Objects.equals(this.name, insertFunctionInstanceAlpha.name) - && Objects.equals(this.integrationId, insertFunctionInstanceAlpha.integrationId) - && Objects.equals(this.classId, insertFunctionInstanceAlpha.classId) - && Objects.equals(this.enabled, insertFunctionInstanceAlpha.enabled) - && Objects.equals(this.createdAt, insertFunctionInstanceAlpha.createdAt) - && Objects.equals(this.updatedAt, insertFunctionInstanceAlpha.updatedAt) - && Objects.equals(this.settings, insertFunctionInstanceAlpha.settings) - && Objects.equals( - this.encryptedSettings, insertFunctionInstanceAlpha.encryptedSettings); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - integrationId, - classId, - enabled, - createdAt, - updatedAt, - settings, - encryptedSettings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InsertFunctionInstanceAlpha {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" encryptedSettings: ") - .append(toIndentedString(encryptedSettings)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("integrationId"); - openapiFields.add("classId"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("settings"); - openapiFields.add("encryptedSettings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("integrationId"); - openapiRequiredFields.add("classId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - openapiRequiredFields.add("settings"); - openapiRequiredFields.add("encryptedSettings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstanceAlpha - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InsertFunctionInstanceAlpha.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InsertFunctionInstanceAlpha is not" - + " found in the empty JSON string", - InsertFunctionInstanceAlpha.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InsertFunctionInstanceAlpha.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InsertFunctionInstanceAlpha` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InsertFunctionInstanceAlpha.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `integrationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("integrationId").toString())); - } - if (!jsonObj.get("classId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `classId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("classId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InsertFunctionInstanceAlpha.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InsertFunctionInstanceAlpha' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstanceAlpha.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InsertFunctionInstanceAlpha value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InsertFunctionInstanceAlpha read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InsertFunctionInstanceAlpha given an JSON string - * - * @param jsonString JSON string - * @return An instance of InsertFunctionInstanceAlpha - * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstanceAlpha - */ - public static InsertFunctionInstanceAlpha fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InsertFunctionInstanceAlpha.class); - } - - /** - * Convert an instance of InsertFunctionInstanceAlpha to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java deleted file mode 100644 index 984032ac..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** ListAudiences200Response */ -public class ListAudiences200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ListAudiencesAlphaOutput data; - - public ListAudiences200Response() {} - - public ListAudiences200Response data(ListAudiencesAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ListAudiencesAlphaOutput getData() { - return data; - } - - public void setData(ListAudiencesAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudiences200Response listAudiences200Response = (ListAudiences200Response) o; - return Objects.equals(this.data, listAudiences200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudiences200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ListAudiences200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListAudiences200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListAudiences200Response is not found" - + " in the empty JSON string", - ListAudiences200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListAudiences200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudiences200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudiences200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListAudiences200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListAudiences200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListAudiences200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudiences200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudiences200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListAudiences200Response - * @throws IOException if the JSON string is invalid with respect to ListAudiences200Response - */ - public static ListAudiences200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListAudiences200Response.class); - } - - /** - * Convert an instance of ListAudiences200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java deleted file mode 100644 index 590af909..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** List audiences endpoint output. */ -@ApiModel(description = "List audiences endpoint output.") -public class ListAudiencesAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; - - @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; - - public ListAudiencesAlphaOutput() {} - - public ListAudiencesAlphaOutput audiences(List audiences) { - - this.audiences = audiences; - return this; - } - - public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { - this.audiences.add(audiencesItem); - return this; - } - - /** - * A list of audience summary results. - * - * @return audiences - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of audience summary results.") - public List getAudiences() { - return audiences; - } - - public void setAudiences(List audiences) { - this.audiences = audiences; - } - - public ListAudiencesAlphaOutput pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudiencesAlphaOutput listAudiencesAlphaOutput = (ListAudiencesAlphaOutput) o; - return Objects.equals(this.audiences, listAudiencesAlphaOutput.audiences) - && Objects.equals(this.pagination, listAudiencesAlphaOutput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(audiences, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudiencesAlphaOutput {\n"); - sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audiences"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audiences"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ListAudiencesAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListAudiencesAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListAudiencesAlphaOutput is not found" - + " in the empty JSON string", - ListAudiencesAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListAudiencesAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudiencesAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListAudiencesAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("audiences").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audiences` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("audiences").toString())); - } - - JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudiencesAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListAudiencesAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ListAudiencesAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListAudiencesAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudiencesAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudiencesAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListAudiencesAlphaOutput - * @throws IOException if the JSON string is invalid with respect to ListAudiencesAlphaOutput - */ - public static ListAudiencesAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListAudiencesAlphaOutput.class); - } - - /** - * Convert an instance of ListAudiencesAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java b/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java deleted file mode 100644 index 936cbc5d..00000000 --- a/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** ListComputedTraits200Response */ -public class ListComputedTraits200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ListComputedTraitsAlphaOutput data; - - public ListComputedTraits200Response() {} - - public ListComputedTraits200Response data(ListComputedTraitsAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ListComputedTraitsAlphaOutput getData() { - return data; - } - - public void setData(ListComputedTraitsAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListComputedTraits200Response listComputedTraits200Response = - (ListComputedTraits200Response) o; - return Objects.equals(this.data, listComputedTraits200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListComputedTraits200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListComputedTraits200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListComputedTraits200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListComputedTraits200Response is not" - + " found in the empty JSON string", - ListComputedTraits200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListComputedTraits200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListComputedTraits200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListComputedTraits200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListComputedTraits200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListComputedTraits200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListComputedTraits200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListComputedTraits200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListComputedTraits200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListComputedTraits200Response - * @throws IOException if the JSON string is invalid with respect to - * ListComputedTraits200Response - */ - public static ListComputedTraits200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListComputedTraits200Response.class); - } - - /** - * Convert an instance of ListComputedTraits200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java deleted file mode 100644 index 17eec196..00000000 --- a/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** List computed traits endpoint output. */ -@ApiModel(description = "List computed traits endpoint output.") -public class ListComputedTraitsAlphaOutput { - public static final String SERIALIZED_NAME_COMPUTED_TRAITS = "computedTraits"; - - @SerializedName(SERIALIZED_NAME_COMPUTED_TRAITS) - private List computedTraits = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; - - public ListComputedTraitsAlphaOutput() {} - - public ListComputedTraitsAlphaOutput computedTraits(List computedTraits) { - - this.computedTraits = computedTraits; - return this; - } - - public ListComputedTraitsAlphaOutput addComputedTraitsItem( - ComputedTraitSummary computedTraitsItem) { - this.computedTraits.add(computedTraitsItem); - return this; - } - - /** - * A list of computed trait summary results. - * - * @return computedTraits - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of computed trait summary results.") - public List getComputedTraits() { - return computedTraits; - } - - public void setComputedTraits(List computedTraits) { - this.computedTraits = computedTraits; - } - - public ListComputedTraitsAlphaOutput pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListComputedTraitsAlphaOutput listComputedTraitsAlphaOutput = - (ListComputedTraitsAlphaOutput) o; - return Objects.equals(this.computedTraits, listComputedTraitsAlphaOutput.computedTraits) - && Objects.equals(this.pagination, listComputedTraitsAlphaOutput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(computedTraits, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListComputedTraitsAlphaOutput {\n"); - sb.append(" computedTraits: ").append(toIndentedString(computedTraits)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("computedTraits"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("computedTraits"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListComputedTraitsAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListComputedTraitsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListComputedTraitsAlphaOutput is not" - + " found in the empty JSON string", - ListComputedTraitsAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListComputedTraitsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListComputedTraitsAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListComputedTraitsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("computedTraits").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `computedTraits` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("computedTraits").toString())); - } - - JsonArray jsonArraycomputedTraits = jsonObj.getAsJsonArray("computedTraits"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListComputedTraitsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListComputedTraitsAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListComputedTraitsAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListComputedTraitsAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListComputedTraitsAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListComputedTraitsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListComputedTraitsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * ListComputedTraitsAlphaOutput - */ - public static ListComputedTraitsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListComputedTraitsAlphaOutput.class); - } - - /** - * Convert an instance of ListComputedTraitsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java deleted file mode 100644 index 3ef99e9a..00000000 --- a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** ListInsertFunctionInstances200Response */ -public class ListInsertFunctionInstances200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ListInsertFunctionInstancesAlphaOutput data; - - public ListInsertFunctionInstances200Response() {} - - public ListInsertFunctionInstances200Response data( - ListInsertFunctionInstancesAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public ListInsertFunctionInstancesAlphaOutput getData() { - return data; - } - - public void setData(ListInsertFunctionInstancesAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListInsertFunctionInstances200Response listInsertFunctionInstances200Response = - (ListInsertFunctionInstances200Response) o; - return Objects.equals(this.data, listInsertFunctionInstances200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListInsertFunctionInstances200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListInsertFunctionInstances200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListInsertFunctionInstances200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListInsertFunctionInstances200Response" - + " is not found in the empty JSON string", - ListInsertFunctionInstances200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListInsertFunctionInstances200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListInsertFunctionInstances200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListInsertFunctionInstances200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListInsertFunctionInstances200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListInsertFunctionInstances200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, ListInsertFunctionInstances200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListInsertFunctionInstances200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListInsertFunctionInstances200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListInsertFunctionInstances200Response - * @throws IOException if the JSON string is invalid with respect to - * ListInsertFunctionInstances200Response - */ - public static ListInsertFunctionInstances200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstances200Response.class); - } - - /** - * Convert an instance of ListInsertFunctionInstances200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java deleted file mode 100644 index 2dfba5f1..00000000 --- a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Returns a list of insert Function instances connected to the insert Function. */ -@ApiModel( - description = - "Returns a list of insert Function instances connected to the insert Function.") -public class ListInsertFunctionInstancesAlphaOutput { - public static final String SERIALIZED_NAME_INSTANCES = "instances"; - - @SerializedName(SERIALIZED_NAME_INSTANCES) - private List instances = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; - - public ListInsertFunctionInstancesAlphaOutput() {} - - public ListInsertFunctionInstancesAlphaOutput instances( - List instances) { - - this.instances = instances; - return this; - } - - public ListInsertFunctionInstancesAlphaOutput addInstancesItem( - InsertFunctionInstanceAlpha instancesItem) { - this.instances.add(instancesItem); - return this; - } - - /** - * All insert Function instances found. - * - * @return instances - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All insert Function instances found.") - public List getInstances() { - return instances; - } - - public void setInstances(List instances) { - this.instances = instances; - } - - public ListInsertFunctionInstancesAlphaOutput pagination(Pagination pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListInsertFunctionInstancesAlphaOutput listInsertFunctionInstancesAlphaOutput = - (ListInsertFunctionInstancesAlphaOutput) o; - return Objects.equals(this.instances, listInsertFunctionInstancesAlphaOutput.instances) - && Objects.equals( - this.pagination, listInsertFunctionInstancesAlphaOutput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(instances, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListInsertFunctionInstancesAlphaOutput {\n"); - sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("instances"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("instances"); - openapiRequiredFields.add("pagination"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * ListInsertFunctionInstancesAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListInsertFunctionInstancesAlphaOutput" - + " is not found in the empty JSON string", - ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ListInsertFunctionInstancesAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListInsertFunctionInstancesAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - // ensure the json data is an array - if (!jsonObj.get("instances").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `instances` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("instances").toString())); - } - - JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("instances"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListInsertFunctionInstancesAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListInsertFunctionInstancesAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListInsertFunctionInstancesAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, ListInsertFunctionInstancesAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListInsertFunctionInstancesAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListInsertFunctionInstancesAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListInsertFunctionInstancesAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * ListInsertFunctionInstancesAlphaOutput - */ - public static ListInsertFunctionInstancesAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstancesAlphaOutput.class); - } - - /** - * Convert an instance of ListInsertFunctionInstancesAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 56c8c90d..4c937f19 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -43,12 +43,8 @@ public class MessageSubscriptionResponse { /** Type is communication medium used. Either SMS, EMAIL or WHATSAPP. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ANDROID_PUSH("ANDROID_PUSH"), - EMAIL("EMAIL"), - IOS_PUSH("IOS_PUSH"), - SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index b01616f2..99cf361a 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -43,12 +43,8 @@ public class MessagesSubscriptionRequest { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ANDROID_PUSH("ANDROID_PUSH"), - EMAIL("EMAIL"), - IOS_PUSH("IOS_PUSH"), - SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java deleted file mode 100644 index fc93f5a8..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** RemoveAudienceFromSpace200Response */ -public class RemoveAudienceFromSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private RemoveAudienceFromSpaceAlphaOutput data; - - public RemoveAudienceFromSpace200Response() {} - - public RemoveAudienceFromSpace200Response data(RemoveAudienceFromSpaceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public RemoveAudienceFromSpaceAlphaOutput getData() { - return data; - } - - public void setData(RemoveAudienceFromSpaceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveAudienceFromSpace200Response removeAudienceFromSpace200Response = - (RemoveAudienceFromSpace200Response) o; - return Objects.equals(this.data, removeAudienceFromSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveAudienceFromSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RemoveAudienceFromSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RemoveAudienceFromSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RemoveAudienceFromSpace200Response is" - + " not found in the empty JSON string", - RemoveAudienceFromSpace200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RemoveAudienceFromSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveAudienceFromSpace200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveAudienceFromSpace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RemoveAudienceFromSpace200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveAudienceFromSpace200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RemoveAudienceFromSpace200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveAudienceFromSpace200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveAudienceFromSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveAudienceFromSpace200Response - * @throws IOException if the JSON string is invalid with respect to - * RemoveAudienceFromSpace200Response - */ - public static RemoveAudienceFromSpace200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpace200Response.class); - } - - /** - * Convert an instance of RemoveAudienceFromSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java deleted file mode 100644 index 9b77ee03..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Delete audience endpoint output. */ -@ApiModel(description = "Delete audience endpoint output.") -public class RemoveAudienceFromSpaceAlphaOutput { - /** The status of the operation. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public RemoveAudienceFromSpaceAlphaOutput() {} - - public RemoveAudienceFromSpaceAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The status of the operation. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveAudienceFromSpaceAlphaOutput removeAudienceFromSpaceAlphaOutput = - (RemoveAudienceFromSpaceAlphaOutput) o; - return Objects.equals(this.status, removeAudienceFromSpaceAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveAudienceFromSpaceAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RemoveAudienceFromSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RemoveAudienceFromSpaceAlphaOutput is" - + " not found in the empty JSON string", - RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RemoveAudienceFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveAudienceFromSpaceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveAudienceFromSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RemoveAudienceFromSpaceAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveAudienceFromSpaceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RemoveAudienceFromSpaceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveAudienceFromSpaceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveAudienceFromSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveAudienceFromSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * RemoveAudienceFromSpaceAlphaOutput - */ - public static RemoveAudienceFromSpaceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpaceAlphaOutput.class); - } - - /** - * Convert an instance of RemoveAudienceFromSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java deleted file mode 100644 index c75ef599..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** RemoveComputedTraitFromSpace200Response */ -public class RemoveComputedTraitFromSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private RemoveComputedTraitFromSpaceAlphaOutput data; - - public RemoveComputedTraitFromSpace200Response() {} - - public RemoveComputedTraitFromSpace200Response data( - RemoveComputedTraitFromSpaceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public RemoveComputedTraitFromSpaceAlphaOutput getData() { - return data; - } - - public void setData(RemoveComputedTraitFromSpaceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace200Response = - (RemoveComputedTraitFromSpace200Response) o; - return Objects.equals(this.data, removeComputedTraitFromSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveComputedTraitFromSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RemoveComputedTraitFromSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RemoveComputedTraitFromSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " RemoveComputedTraitFromSpace200Response is not found in the" - + " empty JSON string", - RemoveComputedTraitFromSpace200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RemoveComputedTraitFromSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveComputedTraitFromSpace200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveComputedTraitFromSpace200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'RemoveComputedTraitFromSpace200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveComputedTraitFromSpace200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, RemoveComputedTraitFromSpace200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveComputedTraitFromSpace200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveComputedTraitFromSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveComputedTraitFromSpace200Response - * @throws IOException if the JSON string is invalid with respect to - * RemoveComputedTraitFromSpace200Response - */ - public static RemoveComputedTraitFromSpace200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, RemoveComputedTraitFromSpace200Response.class); - } - - /** - * Convert an instance of RemoveComputedTraitFromSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java deleted file mode 100644 index 10af6e84..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Delete computed trait endpoint output. */ -@ApiModel(description = "Delete computed trait endpoint output.") -public class RemoveComputedTraitFromSpaceAlphaOutput { - /** The status of the operation. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public RemoveComputedTraitFromSpaceAlphaOutput() {} - - public RemoveComputedTraitFromSpaceAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The status of the operation. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveComputedTraitFromSpaceAlphaOutput removeComputedTraitFromSpaceAlphaOutput = - (RemoveComputedTraitFromSpaceAlphaOutput) o; - return Objects.equals(this.status, removeComputedTraitFromSpaceAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveComputedTraitFromSpaceAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * RemoveComputedTraitFromSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " RemoveComputedTraitFromSpaceAlphaOutput is not found in the" - + " empty JSON string", - RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RemoveComputedTraitFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveComputedTraitFromSpaceAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveComputedTraitFromSpaceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'RemoveComputedTraitFromSpaceAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveComputedTraitFromSpaceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, RemoveComputedTraitFromSpaceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveComputedTraitFromSpaceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveComputedTraitFromSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveComputedTraitFromSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * RemoveComputedTraitFromSpaceAlphaOutput - */ - public static RemoveComputedTraitFromSpaceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, RemoveComputedTraitFromSpaceAlphaOutput.class); - } - - /** - * Convert an instance of RemoveComputedTraitFromSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java deleted file mode 100644 index e9820fd9..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** UpdateAudienceForSpace200Response */ -public class UpdateAudienceForSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private UpdateAudienceForSpaceAlphaOutput data; - - public UpdateAudienceForSpace200Response() {} - - public UpdateAudienceForSpace200Response data(UpdateAudienceForSpaceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UpdateAudienceForSpaceAlphaOutput getData() { - return data; - } - - public void setData(UpdateAudienceForSpaceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateAudienceForSpace200Response updateAudienceForSpace200Response = - (UpdateAudienceForSpace200Response) o; - return Objects.equals(this.data, updateAudienceForSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateAudienceForSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateAudienceForSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateAudienceForSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateAudienceForSpace200Response is" - + " not found in the empty JSON string", - UpdateAudienceForSpace200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateAudienceForSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateAudienceForSpace200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateAudienceForSpace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateAudienceForSpace200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateAudienceForSpace200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateAudienceForSpace200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateAudienceForSpace200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateAudienceForSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateAudienceForSpace200Response - * @throws IOException if the JSON string is invalid with respect to - * UpdateAudienceForSpace200Response - */ - public static UpdateAudienceForSpace200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpace200Response.class); - } - - /** - * Convert an instance of UpdateAudienceForSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java deleted file mode 100644 index 0ad08cf1..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Audience output for get. */ -@ApiModel(description = "Audience output for get.") -public class UpdateAudienceForSpaceAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE = "audience"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE) - private Audience audience; - - public UpdateAudienceForSpaceAlphaOutput() {} - - public UpdateAudienceForSpaceAlphaOutput audience(Audience audience) { - - this.audience = audience; - return this; - } - - /** - * Get audience - * - * @return audience - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Audience getAudience() { - return audience; - } - - public void setAudience(Audience audience) { - this.audience = audience; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateAudienceForSpaceAlphaOutput updateAudienceForSpaceAlphaOutput = - (UpdateAudienceForSpaceAlphaOutput) o; - return Objects.equals(this.audience, updateAudienceForSpaceAlphaOutput.audience); - } - - @Override - public int hashCode() { - return Objects.hash(audience); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateAudienceForSpaceAlphaOutput {\n"); - sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audience"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audience"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateAudienceForSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateAudienceForSpaceAlphaOutput is" - + " not found in the empty JSON string", - UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateAudienceForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateAudienceForSpaceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateAudienceForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateAudienceForSpaceAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateAudienceForSpaceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateAudienceForSpaceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateAudienceForSpaceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateAudienceForSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateAudienceForSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * UpdateAudienceForSpaceAlphaOutput - */ - public static UpdateAudienceForSpaceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceAlphaOutput.class); - } - - /** - * Convert an instance of UpdateAudienceForSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java deleted file mode 100644 index 9a42b1f4..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Input to update an audience. */ -@ApiModel(description = "Input to update an audience.") -public class UpdateAudienceForSpaceInput { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public UpdateAudienceForSpaceInput() {} - - public UpdateAudienceForSpaceInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateAudienceForSpaceInput updateAudienceForSpaceInput = (UpdateAudienceForSpaceInput) o; - return Objects.equals(this.enabled, updateAudienceForSpaceInput.enabled); - } - - @Override - public int hashCode() { - return Objects.hash(enabled); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateAudienceForSpaceInput {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enabled"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("enabled"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to UpdateAudienceForSpaceInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateAudienceForSpaceInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateAudienceForSpaceInput is not" - + " found in the empty JSON string", - UpdateAudienceForSpaceInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateAudienceForSpaceInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateAudienceForSpaceInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateAudienceForSpaceInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateAudienceForSpaceInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateAudienceForSpaceInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateAudienceForSpaceInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateAudienceForSpaceInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateAudienceForSpaceInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateAudienceForSpaceInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateAudienceForSpaceInput - * @throws IOException if the JSON string is invalid with respect to UpdateAudienceForSpaceInput - */ - public static UpdateAudienceForSpaceInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceInput.class); - } - - /** - * Convert an instance of UpdateAudienceForSpaceInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java deleted file mode 100644 index dbe239a2..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** UpdateComputedTraitForSpace200Response */ -public class UpdateComputedTraitForSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private UpdateComputedTraitForSpaceAlphaOutput data; - - public UpdateComputedTraitForSpace200Response() {} - - public UpdateComputedTraitForSpace200Response data( - UpdateComputedTraitForSpaceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UpdateComputedTraitForSpaceAlphaOutput getData() { - return data; - } - - public void setData(UpdateComputedTraitForSpaceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateComputedTraitForSpace200Response updateComputedTraitForSpace200Response = - (UpdateComputedTraitForSpace200Response) o; - return Objects.equals(this.data, updateComputedTraitForSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateComputedTraitForSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateComputedTraitForSpace200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateComputedTraitForSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateComputedTraitForSpace200Response" - + " is not found in the empty JSON string", - UpdateComputedTraitForSpace200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateComputedTraitForSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateComputedTraitForSpace200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateComputedTraitForSpace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateComputedTraitForSpace200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateComputedTraitForSpace200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateComputedTraitForSpace200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateComputedTraitForSpace200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateComputedTraitForSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateComputedTraitForSpace200Response - * @throws IOException if the JSON string is invalid with respect to - * UpdateComputedTraitForSpace200Response - */ - public static UpdateComputedTraitForSpace200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpace200Response.class); - } - - /** - * Convert an instance of UpdateComputedTraitForSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java deleted file mode 100644 index 5556639e..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Input to update a computed trait. */ -@ApiModel(description = "Input to update a computed trait.") -public class UpdateComputedTraitForSpaceAlphaInput { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public UpdateComputedTraitForSpaceAlphaInput() {} - - public UpdateComputedTraitForSpaceAlphaInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the computed trait. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput = - (UpdateComputedTraitForSpaceAlphaInput) o; - return Objects.equals(this.enabled, updateComputedTraitForSpaceAlphaInput.enabled); - } - - @Override - public int hashCode() { - return Objects.hash(enabled); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateComputedTraitForSpaceAlphaInput {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enabled"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("enabled"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateComputedTraitForSpaceAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateComputedTraitForSpaceAlphaInput" - + " is not found in the empty JSON string", - UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateComputedTraitForSpaceAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateComputedTraitForSpaceAlphaInput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateComputedTraitForSpaceAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateComputedTraitForSpaceAlphaInput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateComputedTraitForSpaceAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateComputedTraitForSpaceAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateComputedTraitForSpaceAlphaInput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateComputedTraitForSpaceAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateComputedTraitForSpaceAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * UpdateComputedTraitForSpaceAlphaInput - */ - public static UpdateComputedTraitForSpaceAlphaInput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpaceAlphaInput.class); - } - - /** - * Convert an instance of UpdateComputedTraitForSpaceAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java deleted file mode 100644 index e779fe28..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Computed Trait output for get and update. */ -@ApiModel(description = "Computed Trait output for get and update.") -public class UpdateComputedTraitForSpaceAlphaOutput { - public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; - - @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) - private ComputedTrait computedTrait; - - public UpdateComputedTraitForSpaceAlphaOutput() {} - - public UpdateComputedTraitForSpaceAlphaOutput computedTrait(ComputedTrait computedTrait) { - - this.computedTrait = computedTrait; - return this; - } - - /** - * Get computedTrait - * - * @return computedTrait - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public ComputedTrait getComputedTrait() { - return computedTrait; - } - - public void setComputedTrait(ComputedTrait computedTrait) { - this.computedTrait = computedTrait; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateComputedTraitForSpaceAlphaOutput updateComputedTraitForSpaceAlphaOutput = - (UpdateComputedTraitForSpaceAlphaOutput) o; - return Objects.equals( - this.computedTrait, updateComputedTraitForSpaceAlphaOutput.computedTrait); - } - - @Override - public int hashCode() { - return Objects.hash(computedTrait); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateComputedTraitForSpaceAlphaOutput {\n"); - sb.append(" computedTrait: ").append(toIndentedString(computedTrait)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("computedTrait"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("computedTrait"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateComputedTraitForSpaceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateComputedTraitForSpaceAlphaOutput" - + " is not found in the empty JSON string", - UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateComputedTraitForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateComputedTraitForSpaceAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateComputedTraitForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateComputedTraitForSpaceAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateComputedTraitForSpaceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateComputedTraitForSpaceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateComputedTraitForSpaceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateComputedTraitForSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateComputedTraitForSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * UpdateComputedTraitForSpaceAlphaOutput - */ - public static UpdateComputedTraitForSpaceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpaceAlphaOutput.class); - } - - /** - * Convert an instance of UpdateComputedTraitForSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java deleted file mode 100644 index 013bb044..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** UpdateInsertFunctionInstance200Response */ -public class UpdateInsertFunctionInstance200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private UpdateInsertFunctionInstanceAlphaOutput data; - - public UpdateInsertFunctionInstance200Response() {} - - public UpdateInsertFunctionInstance200Response data( - UpdateInsertFunctionInstanceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public UpdateInsertFunctionInstanceAlphaOutput getData() { - return data; - } - - public void setData(UpdateInsertFunctionInstanceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateInsertFunctionInstance200Response updateInsertFunctionInstance200Response = - (UpdateInsertFunctionInstance200Response) o; - return Objects.equals(this.data, updateInsertFunctionInstance200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateInsertFunctionInstance200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateInsertFunctionInstance200Response - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateInsertFunctionInstance200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " UpdateInsertFunctionInstance200Response is not found in the" - + " empty JSON string", - UpdateInsertFunctionInstance200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateInsertFunctionInstance200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateInsertFunctionInstance200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'UpdateInsertFunctionInstance200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateInsertFunctionInstance200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateInsertFunctionInstance200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateInsertFunctionInstance200Response read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateInsertFunctionInstance200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateInsertFunctionInstance200Response - * @throws IOException if the JSON string is invalid with respect to - * UpdateInsertFunctionInstance200Response - */ - public static UpdateInsertFunctionInstance200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstance200Response.class); - } - - /** - * Convert an instance of UpdateInsertFunctionInstance200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java deleted file mode 100644 index 4b1e6365..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Updates an insert Function instance. */ -@ApiModel(description = "Updates an insert Function instance.") -public class UpdateInsertFunctionInstanceAlphaInput { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public UpdateInsertFunctionInstanceAlphaInput() {} - - public UpdateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether this insert Function instance should be enabled for the Destination. - * - * @return enabled - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = "Whether this insert Function instance should be enabled for the Destination.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public UpdateInsertFunctionInstanceAlphaInput name(String name) { - - this.name = name; - return this; - } - - /** - * Defines the display name of the insert Function instance. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Defines the display name of the insert Function instance.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public UpdateInsertFunctionInstanceAlphaInput settings(Map settings) { - - this.settings = settings; - return this; - } - - public UpdateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * An object that contains settings for this insert Function instance based on the settings - * present in the insert Function class. - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "An object that contains settings for this insert Function instance based on" - + " the settings present in the insert Function class.") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput = - (UpdateInsertFunctionInstanceAlphaInput) o; - return Objects.equals(this.enabled, updateInsertFunctionInstanceAlphaInput.enabled) - && Objects.equals(this.name, updateInsertFunctionInstanceAlphaInput.name) - && Objects.equals(this.settings, updateInsertFunctionInstanceAlphaInput.settings); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, name, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateInsertFunctionInstanceAlphaInput {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enabled"); - openapiFields.add("name"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateInsertFunctionInstanceAlphaInput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateInsertFunctionInstanceAlphaInput" - + " is not found in the empty JSON string", - UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateInsertFunctionInstanceAlphaInput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaInput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateInsertFunctionInstanceAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateInsertFunctionInstanceAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateInsertFunctionInstanceAlphaInput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateInsertFunctionInstanceAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateInsertFunctionInstanceAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * UpdateInsertFunctionInstanceAlphaInput - */ - public static UpdateInsertFunctionInstanceAlphaInput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaInput.class); - } - - /** - * Convert an instance of UpdateInsertFunctionInstanceAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java deleted file mode 100644 index 30658358..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Returns the updated insert Function instance. */ -@ApiModel(description = "Returns the updated insert Function instance.") -public class UpdateInsertFunctionInstanceAlphaOutput { - public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; - - @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) - private InsertFunctionInstance1 insertFunctionInstance; - - public UpdateInsertFunctionInstanceAlphaOutput() {} - - public UpdateInsertFunctionInstanceAlphaOutput insertFunctionInstance( - InsertFunctionInstance1 insertFunctionInstance) { - - this.insertFunctionInstance = insertFunctionInstance; - return this; - } - - /** - * Get insertFunctionInstance - * - * @return insertFunctionInstance - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public InsertFunctionInstance1 getInsertFunctionInstance() { - return insertFunctionInstance; - } - - public void setInsertFunctionInstance(InsertFunctionInstance1 insertFunctionInstance) { - this.insertFunctionInstance = insertFunctionInstance; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateInsertFunctionInstanceAlphaOutput updateInsertFunctionInstanceAlphaOutput = - (UpdateInsertFunctionInstanceAlphaOutput) o; - return Objects.equals( - this.insertFunctionInstance, - updateInsertFunctionInstanceAlphaOutput.insertFunctionInstance); - } - - @Override - public int hashCode() { - return Objects.hash(insertFunctionInstance); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateInsertFunctionInstanceAlphaOutput {\n"); - sb.append(" insertFunctionInstance: ") - .append(toIndentedString(insertFunctionInstance)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("insertFunctionInstance"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("insertFunctionInstance"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to - * UpdateInsertFunctionInstanceAlphaOutput - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " UpdateInsertFunctionInstanceAlphaOutput is not found in the" - + " empty JSON string", - UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!UpdateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateInsertFunctionInstanceAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateInsertFunctionInstanceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateInsertFunctionInstanceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateInsertFunctionInstanceAlphaOutput read(JsonReader in) - throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateInsertFunctionInstanceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateInsertFunctionInstanceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * UpdateInsertFunctionInstanceAlphaOutput - */ - public static UpdateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaOutput.class); - } - - /** - * Convert an instance of UpdateInsertFunctionInstanceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 31104406a113888eec226340eb80f28241afd8bd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 6 Sep 2023 21:19:45 +0000 Subject: [PATCH 150/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e29322b6. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 60 ++ .../segment/publicapi/api/AudiencesApi.java | 921 +++++++++++++++++ .../publicapi/api/ComputedTraitsApi.java | 939 ++++++++++++++++++ .../segment/publicapi/models/Audience.java | 546 ++++++++++ .../publicapi/models/AudienceSummary.java | 547 ++++++++++ .../publicapi/models/ComputedTrait.java | 546 ++++++++++ .../models/ComputedTraitSummary.java | 547 ++++++++++ .../models/GetAudience200Response.java | 191 ++++ .../models/GetAudienceAlphaOutput.java | 204 ++++ .../models/GetComputedTrait200Response.java | 192 ++++ .../models/GetComputedTraitAlphaOutput.java | 205 ++++ ...tMessagingSubscriptionSuccessResponse.java | 4 + .../models/GetSubscriptionRequest.java | 4 + .../models/ListAudiences200Response.java | 192 ++++ .../models/ListAudiencesAlphaOutput.java | 253 +++++ .../models/ListComputedTraits200Response.java | 197 ++++ .../models/ListComputedTraitsAlphaOutput.java | 259 +++++ .../models/MessageSubscriptionResponse.java | 4 + .../models/MessagesSubscriptionRequest.java | 4 + .../RemoveAudienceFromSpace200Response.java | 199 ++++ .../RemoveAudienceFromSpaceAlphaOutput.java | 264 +++++ ...moveComputedTraitFromSpace200Response.java | 204 ++++ ...moveComputedTraitFromSpaceAlphaOutput.java | 268 +++++ .../UpdateAudienceForSpace200Response.java | 198 ++++ .../UpdateAudienceForSpaceAlphaOutput.java | 211 ++++ .../models/UpdateAudienceForSpaceInput.java | 205 ++++ ...pdateComputedTraitForSpace200Response.java | 202 ++++ ...UpdateComputedTraitForSpaceAlphaInput.java | 214 ++++ ...pdateComputedTraitForSpaceAlphaOutput.java | 215 ++++ 32 files changed, 8001 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/api/AudiencesApi.java create mode 100644 src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java create mode 100644 src/main/java/com/segment/publicapi/models/Audience.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummary.java create mode 100644 src/main/java/com/segment/publicapi/models/ComputedTrait.java create mode 100644 src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiences200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java diff --git a/README.md b/README.md index 42760f97..6ecc4cc9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 36.1.0 +Latest API and SDK version: 36.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 36.1.0 + 36.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:36.1.0" + implementation "com.segment.publicapi:segment-publicapi:36.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-36.1.0.jar` +* `target/segment-publicapi-36.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index feb2c500..b925423e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 36.1.0 + 36.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 0ac40979..1d2f0beb 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -124,7 +124,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 36.1.0 (Java)"); + setUserAgent("Public API SDK 36.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 32b26d4f..d8c6ae66 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -164,6 +164,10 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Audience.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -179,6 +183,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ComputedTrait.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ComputedTraitSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -541,6 +549,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouseV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudience200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetComputedTrait200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetComputedTraitAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetConnectionStateFromWarehouse200Response .CustomTypeAdapterFactory()); @@ -752,12 +770,24 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiences200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEventsV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListComputedTraits200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListComputedTraitsAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListConnectedDestinationsFromSource200Response .CustomTypeAdapterFactory()); @@ -1052,6 +1082,18 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveAudienceFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveAudienceFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveComputedTraitFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestination200Response .CustomTypeAdapterFactory()); @@ -1283,6 +1325,24 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateAudienceForSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateAudienceForSpaceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateAudienceForSpaceInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateComputedTraitForSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java new file mode 100644 index 00000000..f4e92d61 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -0,0 +1,921 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.ListAudiences200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; +import com.segment.publicapi.models.UpdateAudienceForSpace200Response; +import com.segment.publicapi.models.UpdateAudienceForSpaceInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AudiencesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AudiencesApi() { + this(Configuration.getDefaultApiClient()); + } + + public AudiencesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getAudience + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudienceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling getAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getAudience(Async)"); + } + + okhttp3.Call localVarCall = getAudienceCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return GetAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudience200Response getAudience(String spaceId, String id) throws ApiException { + ApiResponse localVarResp = getAudienceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<GetAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getAudienceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 100 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceAsync( + String spaceId, String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listAudiences + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudiencesCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAudiencesValidateBeforeCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listAudiences(Async)"); + } + + okhttp3.Call localVarCall = listAudiencesCall(spaceId, pagination, _callback); + return localVarCall; + } + + /** + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending email to friends@segment.com. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please + * reach out to your customer success manager for more information. The rate limit for this + * endpoint is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ListAudiences200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listAudiencesWithHttpInfo(spaceId, pagination); + return localVarResp.getData(); + } + + /** + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending email to friends@segment.com. • In order to successfully call + * this endpoint, the specified Workspace needs to have the Audience feature enabled. Please + * reach out to your customer success manager for more information. The rate limit for this + * endpoint is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ApiResponse<ListAudiences200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listAudiencesWithHttpInfo( + String spaceId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 25 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudiencesAsync( + String spaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removeAudienceFromSpace + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeAudienceFromSpaceCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeAudienceFromSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " removeAudienceFromSpace(Async)"); + } + + okhttp3.Call localVarCall = removeAudienceFromSpaceCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return RemoveAudienceFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveAudienceFromSpace200Response removeAudienceFromSpace(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + removeAudienceFromSpaceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Remove Audience from Space Deletes an Audience by id and spaceId. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Deleted` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<RemoveAudienceFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse removeAudienceFromSpaceWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = removeAudienceFromSpaceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Audience from Space (asynchronously) Deletes an Audience by id and spaceId. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Audience + * Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint + * is 20 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeAudienceFromSpaceAsync( + String spaceId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeAudienceFromSpaceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateAudienceForSpace + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateAudienceForSpaceCall( + String spaceId, + String id, + UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateAudienceForSpaceInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( + String spaceId, + String id, + UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateAudienceForSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " updateAudienceForSpace(Async)"); + } + + // verify the required parameter 'updateAudienceForSpaceInput' is set + if (updateAudienceForSpaceInput == null) { + throw new ApiException( + "Missing the required parameter 'updateAudienceForSpaceInput' when calling" + + " updateAudienceForSpace(Async)"); + } + + okhttp3.Call localVarCall = + updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceInput, _callback); + return localVarCall; + } + + /** + * Update Audience for Space Updates the enabled status for an audience • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Modified` event in the [audit + * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be + * locked from future edits until the changes have been incorporated. You can find more + * information [in the Segment + * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @return UpdateAudienceForSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateAudienceForSpace200Response updateAudienceForSpace( + String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) + throws ApiException { + ApiResponse localVarResp = + updateAudienceForSpaceWithHttpInfo(spaceId, id, updateAudienceForSpaceInput); + return localVarResp.getData(); + } + + /** + * Update Audience for Space Updates the enabled status for an audience • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Audience Modified` event in the [audit + * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be + * locked from future edits until the changes have been incorporated. You can find more + * information [in the Segment + * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @return ApiResponse<UpdateAudienceForSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse updateAudienceForSpaceWithHttpInfo( + String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) + throws ApiException { + okhttp3.Call localVarCall = + updateAudienceForSpaceValidateBeforeCall( + spaceId, id, updateAudienceForSpaceInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Audience for Space (asynchronously) Updates the enabled status for an audience • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Audience + * Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is + * updated, the Audience will be locked from future edits until the changes have been + * incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param updateAudienceForSpaceInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateAudienceForSpaceAsync( + String spaceId, + String id, + UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateAudienceForSpaceValidateBeforeCall( + spaceId, id, updateAudienceForSpaceInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java new file mode 100644 index 00000000..7909ad29 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -0,0 +1,939 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.GetComputedTrait200Response; +import com.segment.publicapi.models.ListComputedTraits200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RemoveComputedTraitFromSpace200Response; +import com.segment.publicapi.models.UpdateComputedTraitForSpace200Response; +import com.segment.publicapi.models.UpdateComputedTraitForSpaceAlphaInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ComputedTraitsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ComputedTraitsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ComputedTraitsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getComputedTrait + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getComputedTraitCall(String spaceId, String id, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getComputedTraitValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getComputedTrait(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getComputedTrait(Async)"); + } + + okhttp3.Call localVarCall = getComputedTraitCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Computed + * Trait feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return GetComputedTrait200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetComputedTrait200Response getComputedTrait(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + getComputedTraitWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Get Computed Trait Returns the Computed Trait by id and spaceId • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Computed + * Trait feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<GetComputedTrait200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getComputedTraitWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = getComputedTraitValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Computed Trait (asynchronously) Returns the Computed Trait by id and spaceId • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Trait feature enabled. Please reach out to your customer success + * manager for more information. The rate limit for this endpoint is 100 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getComputedTraitAsync( + String spaceId, String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getComputedTraitValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listComputedTraits + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listComputedTraitsCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listComputedTraitsValidateBeforeCall( + String spaceId, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listComputedTraits(Async)"); + } + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listComputedTraits(Async)"); + } + + okhttp3.Call localVarCall = listComputedTraitsCall(spaceId, pagination, _callback); + return localVarCall; + } + + /** + * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Computed Trait + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 25 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ListComputedTraits200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListComputedTraits200Response listComputedTraits( + String spaceId, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listComputedTraitsWithHttpInfo(spaceId, pagination); + return localVarResp.getData(); + } + + /** + * List Computed Traits Returns Computed Traits by spaceId. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Computed Trait + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 25 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @return ApiResponse<ListComputedTraits200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listComputedTraitsWithHttpInfo( + String spaceId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listComputedTraitsValidateBeforeCall(spaceId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Computed Traits (asynchronously) Returns Computed Traits by spaceId. • This endpoint is + * in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Computed Trait feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 25 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param pagination Information about the pagination of this response. This parameter exists in + * alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listComputedTraitsAsync( + String spaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listComputedTraitsValidateBeforeCall(spaceId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removeComputedTraitFromSpace + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeComputedTraitFromSpaceCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeComputedTraitFromSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " removeComputedTraitFromSpace(Async)"); + } + + okhttp3.Call localVarCall = removeComputedTraitFromSpaceCall(spaceId, id, _callback); + return localVarCall; + } + + /** + * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Computed Trait feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Computed Trait Deleted` + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return RemoveComputedTraitFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace( + String spaceId, String id) throws ApiException { + ApiResponse localVarResp = + removeComputedTraitFromSpaceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Remove Computed Trait from Space Deletes a Computed Trait by id and spaceId. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending email to friends@segment.com. + * • In order to successfully call this endpoint, the specified Workspace needs to have the + * Computed Trait feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Computed Trait Deleted` + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 20 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<RemoveComputedTraitFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + removeComputedTraitFromSpaceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = + removeComputedTraitFromSpaceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Computed Trait from Space (asynchronously) Deletes a Computed Trait by id and spaceId. + * • This endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Trait feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Deleted` event in the [audit trail](/tag/Audit-Trail). The rate limit for this + * endpoint is 20 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeComputedTraitFromSpaceAsync( + String spaceId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeComputedTraitFromSpaceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateComputedTraitForSpace + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateComputedTraitForSpaceCall( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateComputedTraitForSpaceAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/computed-traits/{id}" + .replaceAll( + "\\{" + "spaceId" + "\\}", + localVarApiClient.escapeString(spaceId.toString())) + .replaceAll( + "\\{" + "id" + "\\}", + localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateComputedTraitForSpace(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " updateComputedTraitForSpace(Async)"); + } + + // verify the required parameter 'updateComputedTraitForSpaceAlphaInput' is set + if (updateComputedTraitForSpaceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateComputedTraitForSpaceAlphaInput' when" + + " calling updateComputedTraitForSpace(Async)"); + } + + okhttp3.Call localVarCall = + updateComputedTraitForSpaceCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); + return localVarCall; + } + + /** + * Update Computed Trait for Space Updates the enabled status for a computed trait. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Trait feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a + * Computed Trait is updated, the Computed Trait will be locked from future edits until the + * changes have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @return UpdateComputedTraitForSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateComputedTraitForSpaceWithHttpInfo( + spaceId, id, updateComputedTraitForSpaceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Computed Trait for Space Updates the enabled status for a computed trait. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Trait feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a + * Computed Trait is updated, the Computed Trait will be locked from future edits until the + * changes have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @return ApiResponse<UpdateComputedTraitForSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateComputedTraitForSpaceWithHttpInfo( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateComputedTraitForSpaceValidateBeforeCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Computed Trait for Space (asynchronously) Updates the enabled status for a computed + * trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending email + * to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer + * success manager for more information. • When called, this endpoint may generate the + * `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that + * when a Computed Trait is updated, the Computed Trait will be locked from future edits until + * the changes have been incorporated. You can find more information [in the Segment + * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param updateComputedTraitForSpaceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateComputedTraitForSpaceAsync( + String spaceId, + String id, + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateComputedTraitForSpaceValidateBeforeCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/Audience.java b/src/main/java/com/segment/publicapi/models/Audience.java new file mode 100644 index 00000000..2b085c47 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Audience.java @@ -0,0 +1,546 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The audience summary output. */ +@ApiModel(description = "The audience summary output.") +public class Audience { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public Audience() {} + + public Audience id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Audience id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Audience spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the audience.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public Audience name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the audience.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Audience description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the audience.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Audience key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the audience.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public Audience enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Audience createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the audience.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Audience updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the audience.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public Audience createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was created.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Audience updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was last updated.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Audience audience = (Audience) o; + return Objects.equals(this.id, audience.id) + && Objects.equals(this.spaceId, audience.spaceId) + && Objects.equals(this.name, audience.name) + && Objects.equals(this.description, audience.description) + && Objects.equals(this.key, audience.key) + && Objects.equals(this.enabled, audience.enabled) + && Objects.equals(this.createdBy, audience.createdBy) + && Objects.equals(this.updatedBy, audience.updatedBy) + && Objects.equals(this.createdAt, audience.createdAt) + && Objects.equals(this.updatedAt, audience.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Audience {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Audience + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Audience.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Audience is not found in the empty" + + " JSON string", + Audience.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Audience.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Audience`" + + " properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Audience.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Audience.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Audience' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Audience.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Audience value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Audience read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Audience given an JSON string + * + * @param jsonString JSON string + * @return An instance of Audience + * @throws IOException if the JSON string is invalid with respect to Audience + */ + public static Audience fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Audience.class); + } + + /** + * Convert an instance of Audience to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java new file mode 100644 index 00000000..cb21bf50 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -0,0 +1,547 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines an Audience. */ +@ApiModel(description = "Defines an Audience.") +public class AudienceSummary { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public AudienceSummary() {} + + public AudienceSummary id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Audience id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummary spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the audience.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummary name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the audience.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummary description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the audience.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummary key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the audience.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummary enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummary createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the audience.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummary updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the audience.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummary createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was created.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummary updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Date the audience was last updated.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummary audienceSummary = (AudienceSummary) o; + return Objects.equals(this.id, audienceSummary.id) + && Objects.equals(this.spaceId, audienceSummary.spaceId) + && Objects.equals(this.name, audienceSummary.name) + && Objects.equals(this.description, audienceSummary.description) + && Objects.equals(this.key, audienceSummary.key) + && Objects.equals(this.enabled, audienceSummary.enabled) + && Objects.equals(this.createdBy, audienceSummary.createdBy) + && Objects.equals(this.updatedBy, audienceSummary.updatedBy) + && Objects.equals(this.createdAt, audienceSummary.createdAt) + && Objects.equals(this.updatedAt, audienceSummary.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AudienceSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AudienceSummary.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSummary is not found in the" + + " empty JSON string", + AudienceSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AudienceSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummary` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSummary.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSummary.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSummary value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummary + * @throws IOException if the JSON string is invalid with respect to AudienceSummary + */ + public static AudienceSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSummary.class); + } + + /** + * Convert an instance of AudienceSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTrait.java b/src/main/java/com/segment/publicapi/models/ComputedTrait.java new file mode 100644 index 00000000..71624541 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ComputedTrait.java @@ -0,0 +1,546 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The computed trait summary output. */ +@ApiModel(description = "The computed trait summary output.") +public class ComputedTrait { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public ComputedTrait() {} + + public ComputedTrait id(String id) { + + this.id = id; + return this; + } + + /** + * Computed trait id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Computed trait id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ComputedTrait spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the computed trait. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the computed trait.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ComputedTrait name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the computed trait. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the computed trait.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ComputedTrait description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the computed trait. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the computed trait.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ComputedTrait key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the computed trait. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the computed trait.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ComputedTrait enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the computed trait. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ComputedTrait createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the computed trait. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the computed trait.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public ComputedTrait updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the computed trait. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public ComputedTrait createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of the computed trait's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public ComputedTrait updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of the computed trait's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComputedTrait computedTrait = (ComputedTrait) o; + return Objects.equals(this.id, computedTrait.id) + && Objects.equals(this.spaceId, computedTrait.spaceId) + && Objects.equals(this.name, computedTrait.name) + && Objects.equals(this.description, computedTrait.description) + && Objects.equals(this.key, computedTrait.key) + && Objects.equals(this.enabled, computedTrait.enabled) + && Objects.equals(this.createdBy, computedTrait.createdBy) + && Objects.equals(this.updatedBy, computedTrait.updatedBy) + && Objects.equals(this.createdAt, computedTrait.createdAt) + && Objects.equals(this.updatedAt, computedTrait.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComputedTrait {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ComputedTrait + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ComputedTrait.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ComputedTrait is not found in the" + + " empty JSON string", + ComputedTrait.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ComputedTrait.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ComputedTrait` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComputedTrait.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComputedTrait.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComputedTrait' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ComputedTrait.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ComputedTrait value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ComputedTrait read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ComputedTrait given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComputedTrait + * @throws IOException if the JSON string is invalid with respect to ComputedTrait + */ + public static ComputedTrait fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComputedTrait.class); + } + + /** + * Convert an instance of ComputedTrait to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java new file mode 100644 index 00000000..e330303e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -0,0 +1,547 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Defines a Computed trait. */ +@ApiModel(description = "Defines a Computed trait.") +public class ComputedTraitSummary { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public ComputedTraitSummary() {} + + public ComputedTraitSummary id(String id) { + + this.id = id; + return this; + } + + /** + * Computed trait id. + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Computed trait id.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ComputedTraitSummary spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the computed trait. + * + * @return spaceId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Space id for the computed trait.") + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public ComputedTraitSummary name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the computed trait. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Name of the computed trait.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ComputedTraitSummary description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the computed trait. + * + * @return description + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Description of the computed trait.") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ComputedTraitSummary key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the computed trait. + * + * @return key + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Key for the computed trait.") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public ComputedTraitSummary enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the computed trait. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ComputedTraitSummary createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the computed trait. + * + * @return createdBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who created the computed trait.") + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public ComputedTraitSummary updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the computed trait. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public ComputedTraitSummary createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of the computed trait's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public ComputedTraitSummary updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of the computed trait's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComputedTraitSummary computedTraitSummary = (ComputedTraitSummary) o; + return Objects.equals(this.id, computedTraitSummary.id) + && Objects.equals(this.spaceId, computedTraitSummary.spaceId) + && Objects.equals(this.name, computedTraitSummary.name) + && Objects.equals(this.description, computedTraitSummary.description) + && Objects.equals(this.key, computedTraitSummary.key) + && Objects.equals(this.enabled, computedTraitSummary.enabled) + && Objects.equals(this.createdBy, computedTraitSummary.createdBy) + && Objects.equals(this.updatedBy, computedTraitSummary.updatedBy) + && Objects.equals(this.createdAt, computedTraitSummary.createdAt) + && Objects.equals(this.updatedAt, computedTraitSummary.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComputedTraitSummary {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ComputedTraitSummary + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ComputedTraitSummary.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ComputedTraitSummary is not found in" + + " the empty JSON string", + ComputedTraitSummary.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ComputedTraitSummary.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ComputedTraitSummary` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComputedTraitSummary.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComputedTraitSummary.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComputedTraitSummary' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ComputedTraitSummary.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ComputedTraitSummary value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ComputedTraitSummary read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ComputedTraitSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComputedTraitSummary + * @throws IOException if the JSON string is invalid with respect to ComputedTraitSummary + */ + public static ComputedTraitSummary fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComputedTraitSummary.class); + } + + /** + * Convert an instance of ComputedTraitSummary to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java new file mode 100644 index 00000000..fb719310 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java @@ -0,0 +1,191 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetAudience200Response */ +public class GetAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetAudienceAlphaOutput data; + + public GetAudience200Response() {} + + public GetAudience200Response data(GetAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetAudienceAlphaOutput getData() { + return data; + } + + public void setData(GetAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudience200Response getAudience200Response = (GetAudience200Response) o; + return Objects.equals(this.data, getAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAudience200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudience200Response is not found in" + + " the empty JSON string", + GetAudience200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudience200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudience200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudience200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudience200Response + * @throws IOException if the JSON string is invalid with respect to GetAudience200Response + */ + public static GetAudience200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudience200Response.class); + } + + /** + * Convert an instance of GetAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java new file mode 100644 index 00000000..425598b3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Audience output for update. */ +@ApiModel(description = "Audience output for update.") +public class GetAudienceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private Audience audience; + + public GetAudienceAlphaOutput() {} + + public GetAudienceAlphaOutput audience(Audience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * + * @return audience + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Audience getAudience() { + return audience; + } + + public void setAudience(Audience audience) { + this.audience = audience; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceAlphaOutput getAudienceAlphaOutput = (GetAudienceAlphaOutput) o; + return Objects.equals(this.audience, getAudienceAlphaOutput.audience); + } + + @Override + public int hashCode() { + return Objects.hash(audience); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceAlphaOutput {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audience"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audience"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAudienceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudienceAlphaOutput is not found in" + + " the empty JSON string", + GetAudienceAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAudienceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAudienceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudienceAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetAudienceAlphaOutput + */ + public static GetAudienceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudienceAlphaOutput.class); + } + + /** + * Convert an instance of GetAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java new file mode 100644 index 00000000..e66b7d4c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java @@ -0,0 +1,192 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** GetComputedTrait200Response */ +public class GetComputedTrait200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetComputedTraitAlphaOutput data; + + public GetComputedTrait200Response() {} + + public GetComputedTrait200Response data(GetComputedTraitAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public GetComputedTraitAlphaOutput getData() { + return data; + } + + public void setData(GetComputedTraitAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetComputedTrait200Response getComputedTrait200Response = (GetComputedTrait200Response) o; + return Objects.equals(this.data, getComputedTrait200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetComputedTrait200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetComputedTrait200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetComputedTrait200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetComputedTrait200Response is not" + + " found in the empty JSON string", + GetComputedTrait200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetComputedTrait200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetComputedTrait200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetComputedTrait200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetComputedTrait200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetComputedTrait200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetComputedTrait200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetComputedTrait200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetComputedTrait200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetComputedTrait200Response + * @throws IOException if the JSON string is invalid with respect to GetComputedTrait200Response + */ + public static GetComputedTrait200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetComputedTrait200Response.class); + } + + /** + * Convert an instance of GetComputedTrait200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java new file mode 100644 index 00000000..2940b617 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Computed Trait output for get and update. */ +@ApiModel(description = "Computed Trait output for get and update.") +public class GetComputedTraitAlphaOutput { + public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; + + @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) + private ComputedTrait computedTrait; + + public GetComputedTraitAlphaOutput() {} + + public GetComputedTraitAlphaOutput computedTrait(ComputedTrait computedTrait) { + + this.computedTrait = computedTrait; + return this; + } + + /** + * Get computedTrait + * + * @return computedTrait + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ComputedTrait getComputedTrait() { + return computedTrait; + } + + public void setComputedTrait(ComputedTrait computedTrait) { + this.computedTrait = computedTrait; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetComputedTraitAlphaOutput getComputedTraitAlphaOutput = (GetComputedTraitAlphaOutput) o; + return Objects.equals(this.computedTrait, getComputedTraitAlphaOutput.computedTrait); + } + + @Override + public int hashCode() { + return Objects.hash(computedTrait); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetComputedTraitAlphaOutput {\n"); + sb.append(" computedTrait: ").append(toIndentedString(computedTrait)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("computedTrait"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("computedTrait"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetComputedTraitAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetComputedTraitAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetComputedTraitAlphaOutput is not" + + " found in the empty JSON string", + GetComputedTraitAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetComputedTraitAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetComputedTraitAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetComputedTraitAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetComputedTraitAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetComputedTraitAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetComputedTraitAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetComputedTraitAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetComputedTraitAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetComputedTraitAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetComputedTraitAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetComputedTraitAlphaOutput + */ + public static GetComputedTraitAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetComputedTraitAlphaOutput.class); + } + + /** + * Convert an instance of GetComputedTraitAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index ac6945b9..05ac64d3 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -43,8 +43,12 @@ public class GetMessagingSubscriptionSuccessResponse { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 26dfd8bc..7fdeb2c9 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -40,8 +40,12 @@ public class GetSubscriptionRequest { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java new file mode 100644 index 00000000..984032ac --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java @@ -0,0 +1,192 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListAudiences200Response */ +public class ListAudiences200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListAudiencesAlphaOutput data; + + public ListAudiences200Response() {} + + public ListAudiences200Response data(ListAudiencesAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListAudiencesAlphaOutput getData() { + return data; + } + + public void setData(ListAudiencesAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiences200Response listAudiences200Response = (ListAudiences200Response) o; + return Objects.equals(this.data, listAudiences200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiences200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListAudiences200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListAudiences200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiences200Response is not found" + + " in the empty JSON string", + ListAudiences200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListAudiences200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiences200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiences200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiences200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudiences200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiences200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiences200Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiences200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiences200Response + * @throws IOException if the JSON string is invalid with respect to ListAudiences200Response + */ + public static ListAudiences200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiences200Response.class); + } + + /** + * Convert an instance of ListAudiences200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java new file mode 100644 index 00000000..590af909 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -0,0 +1,253 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** List audiences endpoint output. */ +@ApiModel(description = "List audiences endpoint output.") +public class ListAudiencesAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; + + @SerializedName(SERIALIZED_NAME_AUDIENCES) + private List audiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListAudiencesAlphaOutput() {} + + public ListAudiencesAlphaOutput audiences(List audiences) { + + this.audiences = audiences; + return this; + } + + public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { + this.audiences.add(audiencesItem); + return this; + } + + /** + * A list of audience summary results. + * + * @return audiences + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of audience summary results.") + public List getAudiences() { + return audiences; + } + + public void setAudiences(List audiences) { + this.audiences = audiences; + } + + public ListAudiencesAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesAlphaOutput listAudiencesAlphaOutput = (ListAudiencesAlphaOutput) o; + return Objects.equals(this.audiences, listAudiencesAlphaOutput.audiences) + && Objects.equals(this.pagination, listAudiencesAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(audiences, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesAlphaOutput {\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiences"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiences"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListAudiencesAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListAudiencesAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesAlphaOutput is not found" + + " in the empty JSON string", + ListAudiencesAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListAudiencesAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("audiences").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audiences` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audiences").toString())); + } + + JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudiencesAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesAlphaOutput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesAlphaOutput + * @throws IOException if the JSON string is invalid with respect to ListAudiencesAlphaOutput + */ + public static ListAudiencesAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesAlphaOutput.class); + } + + /** + * Convert an instance of ListAudiencesAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java b/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java new file mode 100644 index 00000000..936cbc5d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListComputedTraits200Response.java @@ -0,0 +1,197 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListComputedTraits200Response */ +public class ListComputedTraits200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListComputedTraitsAlphaOutput data; + + public ListComputedTraits200Response() {} + + public ListComputedTraits200Response data(ListComputedTraitsAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListComputedTraitsAlphaOutput getData() { + return data; + } + + public void setData(ListComputedTraitsAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListComputedTraits200Response listComputedTraits200Response = + (ListComputedTraits200Response) o; + return Objects.equals(this.data, listComputedTraits200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListComputedTraits200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListComputedTraits200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListComputedTraits200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListComputedTraits200Response is not" + + " found in the empty JSON string", + ListComputedTraits200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListComputedTraits200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListComputedTraits200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListComputedTraits200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListComputedTraits200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListComputedTraits200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListComputedTraits200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListComputedTraits200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListComputedTraits200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListComputedTraits200Response + * @throws IOException if the JSON string is invalid with respect to + * ListComputedTraits200Response + */ + public static ListComputedTraits200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListComputedTraits200Response.class); + } + + /** + * Convert an instance of ListComputedTraits200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java new file mode 100644 index 00000000..17eec196 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListComputedTraitsAlphaOutput.java @@ -0,0 +1,259 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** List computed traits endpoint output. */ +@ApiModel(description = "List computed traits endpoint output.") +public class ListComputedTraitsAlphaOutput { + public static final String SERIALIZED_NAME_COMPUTED_TRAITS = "computedTraits"; + + @SerializedName(SERIALIZED_NAME_COMPUTED_TRAITS) + private List computedTraits = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListComputedTraitsAlphaOutput() {} + + public ListComputedTraitsAlphaOutput computedTraits(List computedTraits) { + + this.computedTraits = computedTraits; + return this; + } + + public ListComputedTraitsAlphaOutput addComputedTraitsItem( + ComputedTraitSummary computedTraitsItem) { + this.computedTraits.add(computedTraitsItem); + return this; + } + + /** + * A list of computed trait summary results. + * + * @return computedTraits + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "A list of computed trait summary results.") + public List getComputedTraits() { + return computedTraits; + } + + public void setComputedTraits(List computedTraits) { + this.computedTraits = computedTraits; + } + + public ListComputedTraitsAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListComputedTraitsAlphaOutput listComputedTraitsAlphaOutput = + (ListComputedTraitsAlphaOutput) o; + return Objects.equals(this.computedTraits, listComputedTraitsAlphaOutput.computedTraits) + && Objects.equals(this.pagination, listComputedTraitsAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(computedTraits, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListComputedTraitsAlphaOutput {\n"); + sb.append(" computedTraits: ").append(toIndentedString(computedTraits)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("computedTraits"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("computedTraits"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListComputedTraitsAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListComputedTraitsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListComputedTraitsAlphaOutput is not" + + " found in the empty JSON string", + ListComputedTraitsAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListComputedTraitsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListComputedTraitsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListComputedTraitsAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("computedTraits").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `computedTraits` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("computedTraits").toString())); + } + + JsonArray jsonArraycomputedTraits = jsonObj.getAsJsonArray("computedTraits"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListComputedTraitsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListComputedTraitsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListComputedTraitsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListComputedTraitsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListComputedTraitsAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListComputedTraitsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListComputedTraitsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListComputedTraitsAlphaOutput + */ + public static ListComputedTraitsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListComputedTraitsAlphaOutput.class); + } + + /** + * Convert an instance of ListComputedTraitsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java index 4c937f19..56c8c90d 100644 --- a/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java +++ b/src/main/java/com/segment/publicapi/models/MessageSubscriptionResponse.java @@ -43,8 +43,12 @@ public class MessageSubscriptionResponse { /** Type is communication medium used. Either SMS, EMAIL or WHATSAPP. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java index 99cf361a..b01616f2 100644 --- a/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/MessagesSubscriptionRequest.java @@ -43,8 +43,12 @@ public class MessagesSubscriptionRequest { /** Type is communication medium used. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + ANDROID_PUSH("ANDROID_PUSH"), + EMAIL("EMAIL"), + IOS_PUSH("IOS_PUSH"), + SMS("SMS"), WHATSAPP("WHATSAPP"); diff --git a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java new file mode 100644 index 00000000..fc93f5a8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpace200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RemoveAudienceFromSpace200Response */ +public class RemoveAudienceFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveAudienceFromSpaceAlphaOutput data; + + public RemoveAudienceFromSpace200Response() {} + + public RemoveAudienceFromSpace200Response data(RemoveAudienceFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RemoveAudienceFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveAudienceFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveAudienceFromSpace200Response removeAudienceFromSpace200Response = + (RemoveAudienceFromSpace200Response) o; + return Objects.equals(this.data, removeAudienceFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveAudienceFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveAudienceFromSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveAudienceFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveAudienceFromSpace200Response is" + + " not found in the empty JSON string", + RemoveAudienceFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveAudienceFromSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveAudienceFromSpace200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveAudienceFromSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveAudienceFromSpace200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveAudienceFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveAudienceFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveAudienceFromSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveAudienceFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveAudienceFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveAudienceFromSpace200Response + */ + public static RemoveAudienceFromSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveAudienceFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java new file mode 100644 index 00000000..9b77ee03 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveAudienceFromSpaceAlphaOutput.java @@ -0,0 +1,264 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete audience endpoint output. */ +@ApiModel(description = "Delete audience endpoint output.") +public class RemoveAudienceFromSpaceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveAudienceFromSpaceAlphaOutput() {} + + public RemoveAudienceFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveAudienceFromSpaceAlphaOutput removeAudienceFromSpaceAlphaOutput = + (RemoveAudienceFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeAudienceFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveAudienceFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveAudienceFromSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveAudienceFromSpaceAlphaOutput is" + + " not found in the empty JSON string", + RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveAudienceFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveAudienceFromSpaceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveAudienceFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveAudienceFromSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveAudienceFromSpaceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveAudienceFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveAudienceFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveAudienceFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveAudienceFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveAudienceFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveAudienceFromSpaceAlphaOutput + */ + public static RemoveAudienceFromSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveAudienceFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveAudienceFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java new file mode 100644 index 00000000..c75ef599 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpace200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** RemoveComputedTraitFromSpace200Response */ +public class RemoveComputedTraitFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveComputedTraitFromSpaceAlphaOutput data; + + public RemoveComputedTraitFromSpace200Response() {} + + public RemoveComputedTraitFromSpace200Response data( + RemoveComputedTraitFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public RemoveComputedTraitFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveComputedTraitFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveComputedTraitFromSpace200Response removeComputedTraitFromSpace200Response = + (RemoveComputedTraitFromSpace200Response) o; + return Objects.equals(this.data, removeComputedTraitFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveComputedTraitFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveComputedTraitFromSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveComputedTraitFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveComputedTraitFromSpace200Response is not found in the" + + " empty JSON string", + RemoveComputedTraitFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveComputedTraitFromSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveComputedTraitFromSpace200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveComputedTraitFromSpace200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'RemoveComputedTraitFromSpace200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveComputedTraitFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveComputedTraitFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveComputedTraitFromSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveComputedTraitFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveComputedTraitFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveComputedTraitFromSpace200Response + */ + public static RemoveComputedTraitFromSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveComputedTraitFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveComputedTraitFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java new file mode 100644 index 00000000..10af6e84 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveComputedTraitFromSpaceAlphaOutput.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete computed trait endpoint output. */ +@ApiModel(description = "Delete computed trait endpoint output.") +public class RemoveComputedTraitFromSpaceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveComputedTraitFromSpaceAlphaOutput() {} + + public RemoveComputedTraitFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveComputedTraitFromSpaceAlphaOutput removeComputedTraitFromSpaceAlphaOutput = + (RemoveComputedTraitFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeComputedTraitFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveComputedTraitFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * RemoveComputedTraitFromSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveComputedTraitFromSpaceAlphaOutput is not found in the" + + " empty JSON string", + RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveComputedTraitFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveComputedTraitFromSpaceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveComputedTraitFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveComputedTraitFromSpaceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'RemoveComputedTraitFromSpaceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveComputedTraitFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveComputedTraitFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveComputedTraitFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveComputedTraitFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveComputedTraitFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveComputedTraitFromSpaceAlphaOutput + */ + public static RemoveComputedTraitFromSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveComputedTraitFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveComputedTraitFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java new file mode 100644 index 00000000..e9820fd9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpace200Response.java @@ -0,0 +1,198 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateAudienceForSpace200Response */ +public class UpdateAudienceForSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateAudienceForSpaceAlphaOutput data; + + public UpdateAudienceForSpace200Response() {} + + public UpdateAudienceForSpace200Response data(UpdateAudienceForSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateAudienceForSpaceAlphaOutput getData() { + return data; + } + + public void setData(UpdateAudienceForSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAudienceForSpace200Response updateAudienceForSpace200Response = + (UpdateAudienceForSpace200Response) o; + return Objects.equals(this.data, updateAudienceForSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAudienceForSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateAudienceForSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateAudienceForSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateAudienceForSpace200Response is" + + " not found in the empty JSON string", + UpdateAudienceForSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateAudienceForSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateAudienceForSpace200Response` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAudienceForSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpace200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateAudienceForSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAudienceForSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAudienceForSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAudienceForSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAudienceForSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateAudienceForSpace200Response + */ + public static UpdateAudienceForSpace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpace200Response.class); + } + + /** + * Convert an instance of UpdateAudienceForSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java new file mode 100644 index 00000000..0ad08cf1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaOutput.java @@ -0,0 +1,211 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Audience output for get. */ +@ApiModel(description = "Audience output for get.") +public class UpdateAudienceForSpaceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private Audience audience; + + public UpdateAudienceForSpaceAlphaOutput() {} + + public UpdateAudienceForSpaceAlphaOutput audience(Audience audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * + * @return audience + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Audience getAudience() { + return audience; + } + + public void setAudience(Audience audience) { + this.audience = audience; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAudienceForSpaceAlphaOutput updateAudienceForSpaceAlphaOutput = + (UpdateAudienceForSpaceAlphaOutput) o; + return Objects.equals(this.audience, updateAudienceForSpaceAlphaOutput.audience); + } + + @Override + public int hashCode() { + return Objects.hash(audience); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAudienceForSpaceAlphaOutput {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audience"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audience"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateAudienceForSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateAudienceForSpaceAlphaOutput is" + + " not found in the empty JSON string", + UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateAudienceForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateAudienceForSpaceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateAudienceForSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAudienceForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpaceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateAudienceForSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAudienceForSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAudienceForSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAudienceForSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAudienceForSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateAudienceForSpaceAlphaOutput + */ + public static UpdateAudienceForSpaceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateAudienceForSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java new file mode 100644 index 00000000..9a42b1f4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Input to update an audience. */ +@ApiModel(description = "Input to update an audience.") +public class UpdateAudienceForSpaceInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public UpdateAudienceForSpaceInput() {} + + public UpdateAudienceForSpaceInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAudienceForSpaceInput updateAudienceForSpaceInput = (UpdateAudienceForSpaceInput) o; + return Objects.equals(this.enabled, updateAudienceForSpaceInput.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAudienceForSpaceInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdateAudienceForSpaceInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateAudienceForSpaceInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateAudienceForSpaceInput is not" + + " found in the empty JSON string", + UpdateAudienceForSpaceInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateAudienceForSpaceInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateAudienceForSpaceInput` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateAudienceForSpaceInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateAudienceForSpaceInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpaceInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateAudienceForSpaceInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateAudienceForSpaceInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateAudienceForSpaceInput read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAudienceForSpaceInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAudienceForSpaceInput + * @throws IOException if the JSON string is invalid with respect to UpdateAudienceForSpaceInput + */ + public static UpdateAudienceForSpaceInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceInput.class); + } + + /** + * Convert an instance of UpdateAudienceForSpaceInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java new file mode 100644 index 00000000..dbe239a2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpace200Response.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateComputedTraitForSpace200Response */ +public class UpdateComputedTraitForSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateComputedTraitForSpaceAlphaOutput data; + + public UpdateComputedTraitForSpace200Response() {} + + public UpdateComputedTraitForSpace200Response data( + UpdateComputedTraitForSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateComputedTraitForSpaceAlphaOutput getData() { + return data; + } + + public void setData(UpdateComputedTraitForSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComputedTraitForSpace200Response updateComputedTraitForSpace200Response = + (UpdateComputedTraitForSpace200Response) o; + return Objects.equals(this.data, updateComputedTraitForSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComputedTraitForSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateComputedTraitForSpace200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateComputedTraitForSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateComputedTraitForSpace200Response" + + " is not found in the empty JSON string", + UpdateComputedTraitForSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateComputedTraitForSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateComputedTraitForSpace200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComputedTraitForSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComputedTraitForSpace200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateComputedTraitForSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateComputedTraitForSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateComputedTraitForSpace200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComputedTraitForSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComputedTraitForSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateComputedTraitForSpace200Response + */ + public static UpdateComputedTraitForSpace200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpace200Response.class); + } + + /** + * Convert an instance of UpdateComputedTraitForSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java new file mode 100644 index 00000000..5556639e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaInput.java @@ -0,0 +1,214 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Input to update a computed trait. */ +@ApiModel(description = "Input to update a computed trait.") +public class UpdateComputedTraitForSpaceAlphaInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public UpdateComputedTraitForSpaceAlphaInput() {} + + public UpdateComputedTraitForSpaceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the computed trait. + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput = + (UpdateComputedTraitForSpaceAlphaInput) o; + return Objects.equals(this.enabled, updateComputedTraitForSpaceAlphaInput.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComputedTraitForSpaceAlphaInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateComputedTraitForSpaceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateComputedTraitForSpaceAlphaInput" + + " is not found in the empty JSON string", + UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateComputedTraitForSpaceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateComputedTraitForSpaceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateComputedTraitForSpaceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComputedTraitForSpaceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComputedTraitForSpaceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateComputedTraitForSpaceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateComputedTraitForSpaceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateComputedTraitForSpaceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComputedTraitForSpaceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComputedTraitForSpaceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateComputedTraitForSpaceAlphaInput + */ + public static UpdateComputedTraitForSpaceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpaceAlphaInput.class); + } + + /** + * Convert an instance of UpdateComputedTraitForSpaceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java new file mode 100644 index 00000000..e779fe28 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateComputedTraitForSpaceAlphaOutput.java @@ -0,0 +1,215 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Computed Trait output for get and update. */ +@ApiModel(description = "Computed Trait output for get and update.") +public class UpdateComputedTraitForSpaceAlphaOutput { + public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; + + @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) + private ComputedTrait computedTrait; + + public UpdateComputedTraitForSpaceAlphaOutput() {} + + public UpdateComputedTraitForSpaceAlphaOutput computedTrait(ComputedTrait computedTrait) { + + this.computedTrait = computedTrait; + return this; + } + + /** + * Get computedTrait + * + * @return computedTrait + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public ComputedTrait getComputedTrait() { + return computedTrait; + } + + public void setComputedTrait(ComputedTrait computedTrait) { + this.computedTrait = computedTrait; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateComputedTraitForSpaceAlphaOutput updateComputedTraitForSpaceAlphaOutput = + (UpdateComputedTraitForSpaceAlphaOutput) o; + return Objects.equals( + this.computedTrait, updateComputedTraitForSpaceAlphaOutput.computedTrait); + } + + @Override + public int hashCode() { + return Objects.hash(computedTrait); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateComputedTraitForSpaceAlphaOutput {\n"); + sb.append(" computedTrait: ").append(toIndentedString(computedTrait)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("computedTrait"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("computedTrait"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateComputedTraitForSpaceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateComputedTraitForSpaceAlphaOutput" + + " is not found in the empty JSON string", + UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateComputedTraitForSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateComputedTraitForSpaceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateComputedTraitForSpaceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateComputedTraitForSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateComputedTraitForSpaceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateComputedTraitForSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateComputedTraitForSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateComputedTraitForSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateComputedTraitForSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateComputedTraitForSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateComputedTraitForSpaceAlphaOutput + */ + public static UpdateComputedTraitForSpaceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateComputedTraitForSpaceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateComputedTraitForSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From d9a1ea31ca348163c98eb0fcaacd4f31af3d04ca Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 3 Oct 2023 17:31:24 +0000 Subject: [PATCH 151/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@916a4e78. From 189ead374a3161cef193a9505ff1ad04c09918bd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 18 Oct 2023 02:23:23 +0000 Subject: [PATCH 152/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@90e0ba62. --- src/main/java/com/segment/publicapi/JSON.java | 40 + .../segment/publicapi/api/FunctionsApi.java | 922 ++++++++++++++++-- .../publicapi/api/TrackingPlansApi.java | 6 +- .../segment/publicapi/api/WarehousesApi.java | 6 +- ...eateInsertFunctionInstance200Response.java | 204 ++++ ...reateInsertFunctionInstanceAlphaInput.java | 372 +++++++ ...eateInsertFunctionInstanceAlphaOutput.java | 221 +++++ ...leteInsertFunctionInstance200Response.java | 204 ++++ ...leteInsertFunctionInstanceAlphaOutput.java | 268 +++++ .../models/InsertFunctionInstance.java | 510 ++++++++++ .../models/InsertFunctionInstance1.java | 512 ++++++++++ .../models/InsertFunctionInstanceAlpha.java | 510 ++++++++++ ...istInsertFunctionInstances200Response.java | 202 ++++ ...istInsertFunctionInstancesAlphaOutput.java | 267 +++++ .../ReplaceRulesInTrackingPlanV1Input.java | 10 +- .../segment/publicapi/models/RuleInputV1.java | 363 +++++++ ...dateInsertFunctionInstance200Response.java | 204 ++++ ...pdateInsertFunctionInstanceAlphaInput.java | 293 ++++++ ...dateInsertFunctionInstanceAlphaOutput.java | 221 +++++ .../publicapi/models/UpsertRuleV1.java | 116 +-- 20 files changed, 5250 insertions(+), 201 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java create mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java create mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RuleInputV1.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index d8c6ae66..2fae8286 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -247,6 +247,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateFunctionV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateInvites200Response .CustomTypeAdapterFactory()); @@ -371,6 +380,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteFunctionV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteInvites200Response .CustomTypeAdapterFactory()); @@ -756,6 +771,14 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstance1 + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.InsertFunctionInstanceAlpha + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.IntegrationOptionBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -850,6 +873,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionsV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInsertFunctionInstances200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListInsertFunctionInstancesAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListInvites200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1231,6 +1260,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ReverseEtlModel1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1371,6 +1402,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateGroupSubscriptionStatusResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstance200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateProfilesWarehouseForSpaceWarehouse200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index 7ffa3443..f7b41130 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -22,16 +22,22 @@ import com.segment.publicapi.models.CreateFunction200Response; import com.segment.publicapi.models.CreateFunctionDeployment200Response; import com.segment.publicapi.models.CreateFunctionV1Input; +import com.segment.publicapi.models.CreateInsertFunctionInstance200Response; +import com.segment.publicapi.models.CreateInsertFunctionInstanceAlphaInput; import com.segment.publicapi.models.DeleteFunction200Response; +import com.segment.publicapi.models.DeleteInsertFunctionInstance200Response; import com.segment.publicapi.models.GetFunction200Response; import com.segment.publicapi.models.GetFunctionVersion200Response; import com.segment.publicapi.models.ListFunctionVersions200Response; import com.segment.publicapi.models.ListFunctions200Response; +import com.segment.publicapi.models.ListInsertFunctionInstances200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RestoreFunctionVersion200Response; import com.segment.publicapi.models.RestoreFunctionVersionAlphaInput; import com.segment.publicapi.models.UpdateFunction200Response; import com.segment.publicapi.models.UpdateFunctionV1Input; +import com.segment.publicapi.models.UpdateInsertFunctionInstance200Response; +import com.segment.publicapi.models.UpdateInsertFunctionInstanceAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -428,6 +434,189 @@ public okhttp3.Call createFunctionDeploymentAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for createInsertFunctionInstance + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createInsertFunctionInstanceCall( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createInsertFunctionInstanceAlphaInput; + + // create path and map variables + String localVarPath = "/insert-function-instances"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createInsertFunctionInstanceValidateBeforeCall( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'createInsertFunctionInstanceAlphaInput' is set + if (createInsertFunctionInstanceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createInsertFunctionInstanceAlphaInput' when" + + " calling createInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = + createInsertFunctionInstanceCall(createInsertFunctionInstanceAlphaInput, _callback); + return localVarCall; + } + + /** + * Create Insert Function Instance Creates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @return CreateInsertFunctionInstance200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateInsertFunctionInstance200Response createInsertFunctionInstance( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createInsertFunctionInstanceWithHttpInfo(createInsertFunctionInstanceAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Insert Function Instance Creates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @return ApiResponse<CreateInsertFunctionInstance200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + createInsertFunctionInstanceWithHttpInfo( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createInsertFunctionInstanceValidateBeforeCall( + createInsertFunctionInstanceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Insert Function Instance (asynchronously) Creates an insert Function instance + * connected to the given Destination. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param createInsertFunctionInstanceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createInsertFunctionInstanceAsync( + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createInsertFunctionInstanceValidateBeforeCall( + createInsertFunctionInstanceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for deleteFunction * @@ -600,6 +789,180 @@ public okhttp3.Call deleteFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for deleteInsertFunctionInstance + * + * @param instanceId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteInsertFunctionInstanceCall( + String instanceId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/insert-function-instances/{instanceId}" + .replaceAll( + "\\{" + "instanceId" + "\\}", + localVarApiClient.escapeString(instanceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteInsertFunctionInstanceValidateBeforeCall( + String instanceId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + "Missing the required parameter 'instanceId' when calling" + + " deleteInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = deleteInsertFunctionInstanceCall(instanceId, _callback); + return localVarCall; + } + + /** + * Delete Insert Function Instance Deletes an insert Function instance. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @return DeleteInsertFunctionInstance200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance(String instanceId) + throws ApiException { + ApiResponse localVarResp = + deleteInsertFunctionInstanceWithHttpInfo(instanceId); + return localVarResp.getData(); + } + + /** + * Delete Insert Function Instance Deletes an insert Function instance. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @return ApiResponse<DeleteInsertFunctionInstance200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + deleteInsertFunctionInstanceWithHttpInfo(String instanceId) throws ApiException { + okhttp3.Call localVarCall = + deleteInsertFunctionInstanceValidateBeforeCall(instanceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Insert Function Instance (asynchronously) Deletes an insert Function instance. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param instanceId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteInsertFunctionInstanceAsync( + String instanceId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + deleteInsertFunctionInstanceValidateBeforeCall(instanceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getFunction * @@ -1091,13 +1454,211 @@ public ListFunctionVersions200Response listFunctionVersions( } /** - * List Function Versions Lists versions for a Function in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Function Versions Lists versions for a Function in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @return ApiResponse<ListFunctionVersions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse listFunctionVersionsWithHttpInfo( + String functionId, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Functions + * feature enabled. Please reach out to your customer success manager for more information. + * + * @param functionId (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionVersionsAsync( + String functionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listFunctions + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFunctionsCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/functions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + if (resourceType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("resourceType", resourceType)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1+json", + "application/json", + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFunctionsValidateBeforeCall( + PaginationInput pagination, String resourceType, final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'pagination' is set + if (pagination == null) { + throw new ApiException( + "Missing the required parameter 'pagination' when calling" + + " listFunctions(Async)"); + } + + // verify the required parameter 'resourceType' is set + if (resourceType == null) { + throw new ApiException( + "Missing the required parameter 'resourceType' when calling" + + " listFunctions(Async)"); + } + + okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); + return localVarCall; + } + + /** + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ListFunctions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) + throws ApiException { + ApiResponse localVarResp = + listFunctionsWithHttpInfo(pagination, resourceType); + return localVarResp.getData(); + } + + /** + * List Functions Lists all Functions in a Workspace. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach + * out to your customer success manager for more information. * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) - * @return ApiResponse<ListFunctionVersions200Response> + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) + * @return ApiResponse<ListFunctions200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1109,21 +1670,21 @@ public ListFunctionVersions200Response listFunctionVersions( * 429 Too many requests - * */ - public ApiResponse listFunctionVersionsWithHttpInfo( - String functionId, PaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse listFunctionsWithHttpInfo( + PaginationInput pagination, String resourceType) throws ApiException { + okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Function Versions (asynchronously) Lists versions for a Function in a Workspace. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Functions - * feature enabled. Please reach out to your customer success manager for more information. + * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Functions feature + * enabled. Please reach out to your customer success manager for more information. * - * @param functionId (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param pagination Pagination parameters. This parameter exists in v1. (required) + * @param resourceType The Function type. Config API note: equal to `type`. This + * parameter exists in v1. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1137,24 +1698,24 @@ public ApiResponse listFunctionVersionsWithHttp * 429 Too many requests - * */ - public okhttp3.Call listFunctionVersionsAsync( - String functionId, + public okhttp3.Call listFunctionsAsync( PaginationInput pagination, - final ApiCallback _callback) + String resourceType, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionVersionsValidateBeforeCall(functionId, pagination, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listFunctionsValidateBeforeCall(pagination, resourceType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listFunctions + * Build call for listInsertFunctionInstances * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1167,8 +1728,8 @@ public okhttp3.Call listFunctionVersionsAsync( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) + public okhttp3.Call listInsertFunctionInstancesCall( + PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1186,7 +1747,7 @@ public okhttp3.Call listFunctionsCall( Object localVarPostBody = null; // create path and map variables - String localVarPath = "/functions"; + String localVarPath = "/insert-function-instances"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1198,16 +1759,12 @@ public okhttp3.Call listFunctionsCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } - if (resourceType != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("resourceType", resourceType)); + if (functionId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("functionId", functionId)); } final String[] localVarAccepts = { - "application/vnd.segment.v1+json", - "application/json", - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json" + "application/vnd.segment.v1alpha+json", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1238,37 +1795,39 @@ public okhttp3.Call listFunctionsCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listFunctionsValidateBeforeCall( - PaginationInput pagination, String resourceType, final ApiCallback _callback) + private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( + PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling" - + " listFunctions(Async)"); + + " listInsertFunctionInstances(Async)"); } - // verify the required parameter 'resourceType' is set - if (resourceType == null) { + // verify the required parameter 'functionId' is set + if (functionId == null) { throw new ApiException( - "Missing the required parameter 'resourceType' when calling" - + " listFunctions(Async)"); + "Missing the required parameter 'functionId' when calling" + + " listInsertFunctionInstances(Async)"); } - okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); + okhttp3.Call localVarCall = + listInsertFunctionInstancesCall(pagination, functionId, _callback); return localVarCall; } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Insert Function Instances Lists all insert Function instances connected to the given + * insert Function. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ListFunctions200Response + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) + * @return ListInsertFunctionInstances200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1280,22 +1839,23 @@ private okhttp3.Call listFunctionsValidateBeforeCall( * 429 Too many requests - * */ - public ListFunctions200Response listFunctions(PaginationInput pagination, String resourceType) - throws ApiException { - ApiResponse localVarResp = - listFunctionsWithHttpInfo(pagination, resourceType); + public ListInsertFunctionInstances200Response listInsertFunctionInstances( + PaginationInput pagination, String functionId) throws ApiException { + ApiResponse localVarResp = + listInsertFunctionInstancesWithHttpInfo(pagination, functionId); return localVarResp.getData(); } /** - * List Functions Lists all Functions in a Workspace. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Functions feature enabled. Please reach - * out to your customer success manager for more information. + * List Insert Function Instances Lists all insert Function instances connected to the given + * insert Function. • In order to successfully call this endpoint, the specified Workspace needs + * to have the Functions feature enabled. Please reach out to your customer success manager for + * more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) - * @return ApiResponse<ListFunctions200Response> + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) + * @return ApiResponse<ListInsertFunctionInstances200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1307,21 +1867,25 @@ public ListFunctions200Response listFunctions(PaginationInput pagination, String * 429 Too many requests - * */ - public ApiResponse listFunctionsWithHttpInfo( - PaginationInput pagination, String resourceType) throws ApiException { - okhttp3.Call localVarCall = listFunctionsValidateBeforeCall(pagination, resourceType, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse + listInsertFunctionInstancesWithHttpInfo(PaginationInput pagination, String functionId) + throws ApiException { + okhttp3.Call localVarCall = + listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Functions (asynchronously) Lists all Functions in a Workspace. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Functions feature - * enabled. Please reach out to your customer success manager for more information. + * List Insert Function Instances (asynchronously) Lists all insert Function instances connected + * to the given insert Function. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Functions feature enabled. Please reach out to your customer + * success manager for more information. * - * @param pagination Pagination parameters. This parameter exists in v1. (required) - * @param resourceType The Function type. Config API note: equal to `type`. This - * parameter exists in v1. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (required) + * @param functionId The insert Function class id to lookup. This parameter exists in alpha. + * (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1335,15 +1899,16 @@ public ApiResponse listFunctionsWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call listFunctionsAsync( + public okhttp3.Call listInsertFunctionInstancesAsync( PaginationInput pagination, - String resourceType, - final ApiCallback _callback) + String functionId, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFunctionsValidateBeforeCall(pagination, resourceType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + listInsertFunctionInstancesValidateBeforeCall(pagination, functionId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1744,4 +2309,209 @@ public okhttp3.Call updateFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for updateInsertFunctionInstance + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateInsertFunctionInstanceCall( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateInsertFunctionInstanceAlphaInput; + + // create path and map variables + String localVarPath = + "/insert-function-instances/{instanceId}" + .replaceAll( + "\\{" + "instanceId" + "\\}", + localVarApiClient.escapeString(instanceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateInsertFunctionInstanceValidateBeforeCall( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + // verify the required parameter 'instanceId' is set + if (instanceId == null) { + throw new ApiException( + "Missing the required parameter 'instanceId' when calling" + + " updateInsertFunctionInstance(Async)"); + } + + // verify the required parameter 'updateInsertFunctionInstanceAlphaInput' is set + if (updateInsertFunctionInstanceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateInsertFunctionInstanceAlphaInput' when" + + " calling updateInsertFunctionInstance(Async)"); + } + + okhttp3.Call localVarCall = + updateInsertFunctionInstanceCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); + return localVarCall; + } + + /** + * Update Insert Function Instance Updates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @return UpdateInsertFunctionInstance200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateInsertFunctionInstance200Response updateInsertFunctionInstance( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateInsertFunctionInstanceWithHttpInfo( + instanceId, updateInsertFunctionInstanceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Insert Function Instance Updates an insert Function instance connected to the given + * Destination. • In order to successfully call this endpoint, the specified Workspace needs to + * have the Functions feature enabled. Please reach out to your customer success manager for + * more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @return ApiResponse<UpdateInsertFunctionInstance200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateInsertFunctionInstanceWithHttpInfo( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateInsertFunctionInstanceValidateBeforeCall( + instanceId, updateInsertFunctionInstanceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Insert Function Instance (asynchronously) Updates an insert Function instance + * connected to the given Destination. • In order to successfully call this endpoint, the + * specified Workspace needs to have the Functions feature enabled. Please reach out to your + * customer success manager for more information. + * + * @param instanceId (required) + * @param updateInsertFunctionInstanceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateInsertFunctionInstanceAsync( + String instanceId, + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateInsertFunctionInstanceValidateBeforeCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index ad4b6567..ac9f86f0 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -926,7 +926,7 @@ private okhttp3.Call listRulesFromTrackingPlanValidateBeforeCall( * List Rules from Tracking Plan Lists Tracking Plan rules. • In order to successfully call this * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach * out to your customer success manager for more information. The rate limit for this endpoint - * is 20 requests per minute, which is lower than the default due to access pattern + * is 200 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -956,7 +956,7 @@ public ListRulesFromTrackingPlan200Response listRulesFromTrackingPlan( * List Rules from Tracking Plan Lists Tracking Plan rules. • In order to successfully call this * endpoint, the specified Workspace needs to have the Protocols feature enabled. Please reach * out to your customer success manager for more information. The rate limit for this endpoint - * is 20 requests per minute, which is lower than the default due to access pattern + * is 200 requests per minute, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -988,7 +988,7 @@ public ApiResponse listRulesFromTrackingPl * List Rules from Tracking Plan (asynchronously) Lists Tracking Plan rules. • In order to * successfully call this endpoint, the specified Workspace needs to have the Protocols feature * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 20 requests per minute, which is lower than the default due to + * limit for this endpoint is 200 requests per minute, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index 9db9c77a..4d8ffa53 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -900,7 +900,7 @@ private okhttp3.Call getConnectionStateFromWarehouseValidateBeforeCall( /** * Get Connection State from Warehouse Verifies the state of Warehouse connection settings. The - * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * rate limit for this endpoint is 200 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -927,7 +927,7 @@ public GetConnectionStateFromWarehouse200Response getConnectionStateFromWarehous /** * Get Connection State from Warehouse Verifies the state of Warehouse connection settings. The - * rate limit for this endpoint is 20 requests per minute, which is lower than the default due + * rate limit for this endpoint is 200 requests per minute, which is lower than the default due * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -956,7 +956,7 @@ public GetConnectionStateFromWarehouse200Response getConnectionStateFromWarehous /** * Get Connection State from Warehouse (asynchronously) Verifies the state of Warehouse - * connection settings. The rate limit for this endpoint is 20 requests per minute, which is + * connection settings. The rate limit for this endpoint is 200 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java new file mode 100644 index 00000000..1cc532a5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** CreateInsertFunctionInstance200Response */ +public class CreateInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateInsertFunctionInstanceAlphaOutput data; + + public CreateInsertFunctionInstance200Response() {} + + public CreateInsertFunctionInstance200Response data( + CreateInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public CreateInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(CreateInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstance200Response createInsertFunctionInstance200Response = + (CreateInsertFunctionInstance200Response) o; + return Objects.equals(this.data, createInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + CreateInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstance200Response + */ + public static CreateInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java new file mode 100644 index 00000000..c41b9d84 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java @@ -0,0 +1,372 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Creates an insert Function instance. */ +@ApiModel(description = "Creates an insert Function instance.") +public class CreateInsertFunctionInstanceAlphaInput { + public static final String SERIALIZED_NAME_FUNCTION_ID = "functionId"; + + @SerializedName(SERIALIZED_NAME_FUNCTION_ID) + private String functionId; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public CreateInsertFunctionInstanceAlphaInput() {} + + public CreateInsertFunctionInstanceAlphaInput functionId(String functionId) { + + this.functionId = functionId; + return this; + } + + /** + * Insert Function id to which this instance is associated. + * + * @return functionId + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Insert Function id to which this instance is associated.") + public String getFunctionId() { + return functionId; + } + + public void setFunctionId(String functionId) { + this.functionId = functionId; + } + + public CreateInsertFunctionInstanceAlphaInput integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * The Source or Destination id to be connected. + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The Source or Destination id to be connected.") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public CreateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether this insert Function instance should be enabled for the Destination. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this insert Function instance should be enabled for the Destination.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateInsertFunctionInstanceAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * Defines the display name of the insert Function instance. + * + * @return name + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = "Defines the display name of the insert Function instance.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateInsertFunctionInstanceAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + public CreateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * An object that contains settings for this insert Function instance based on the settings + * present in the insert Function class. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for this insert Function instance based on" + + " the settings present in the insert Function class.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput = + (CreateInsertFunctionInstanceAlphaInput) o; + return Objects.equals(this.functionId, createInsertFunctionInstanceAlphaInput.functionId) + && Objects.equals( + this.integrationId, createInsertFunctionInstanceAlphaInput.integrationId) + && Objects.equals(this.enabled, createInsertFunctionInstanceAlphaInput.enabled) + && Objects.equals(this.name, createInsertFunctionInstanceAlphaInput.name) + && Objects.equals(this.settings, createInsertFunctionInstanceAlphaInput.settings); + } + + @Override + public int hashCode() { + return Objects.hash(functionId, integrationId, enabled, name, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstanceAlphaInput {\n"); + sb.append(" functionId: ").append(toIndentedString(functionId)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("functionId"); + openapiFields.add("integrationId"); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("functionId"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstanceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateInsertFunctionInstanceAlphaInput" + + " is not found in the empty JSON string", + CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstanceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("functionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `functionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("functionId").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstanceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstanceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstanceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstanceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstanceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstanceAlphaInput + */ + public static CreateInsertFunctionInstanceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaInput.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstanceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..19d37394 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Creates an insert Function instance. */ +@ApiModel(description = "Creates an insert Function instance.") +public class CreateInsertFunctionInstanceAlphaOutput { + public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; + + @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) + private InsertFunctionInstance insertFunctionInstance; + + public CreateInsertFunctionInstanceAlphaOutput() {} + + public CreateInsertFunctionInstanceAlphaOutput insertFunctionInstance( + InsertFunctionInstance insertFunctionInstance) { + + this.insertFunctionInstance = insertFunctionInstance; + return this; + } + + /** + * Get insertFunctionInstance + * + * @return insertFunctionInstance + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public InsertFunctionInstance getInsertFunctionInstance() { + return insertFunctionInstance; + } + + public void setInsertFunctionInstance(InsertFunctionInstance insertFunctionInstance) { + this.insertFunctionInstance = insertFunctionInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInsertFunctionInstanceAlphaOutput createInsertFunctionInstanceAlphaOutput = + (CreateInsertFunctionInstanceAlphaOutput) o; + return Objects.equals( + this.insertFunctionInstance, + createInsertFunctionInstanceAlphaOutput.insertFunctionInstance); + } + + @Override + public int hashCode() { + return Objects.hash(insertFunctionInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" insertFunctionInstance: ") + .append(toIndentedString(insertFunctionInstance)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("insertFunctionInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("insertFunctionInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * CreateInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CreateInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CreateInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateInsertFunctionInstanceAlphaOutput + */ + public static CreateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of CreateInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java new file mode 100644 index 00000000..00630b51 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** DeleteInsertFunctionInstance200Response */ +public class DeleteInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteInsertFunctionInstanceAlphaOutput data; + + public DeleteInsertFunctionInstance200Response() {} + + public DeleteInsertFunctionInstance200Response data( + DeleteInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public DeleteInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(DeleteInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInsertFunctionInstance200Response deleteInsertFunctionInstance200Response = + (DeleteInsertFunctionInstance200Response) o; + return Objects.equals(this.data, deleteInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DeleteInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + DeleteInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DeleteInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DeleteInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * DeleteInsertFunctionInstance200Response + */ + public static DeleteInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of DeleteInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..99baa644 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Delete an insert Function instance. */ +@ApiModel(description = "Delete an insert Function instance.") +public class DeleteInsertFunctionInstanceAlphaOutput { + /** The status of the operation. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public DeleteInsertFunctionInstanceAlphaOutput() {} + + public DeleteInsertFunctionInstanceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the operation. + * + * @return status + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The status of the operation.") + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteInsertFunctionInstanceAlphaOutput deleteInsertFunctionInstanceAlphaOutput = + (DeleteInsertFunctionInstanceAlphaOutput) o; + return Objects.equals(this.status, deleteInsertFunctionInstanceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * DeleteInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DeleteInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'DeleteInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeleteInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DeleteInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * DeleteInsertFunctionInstanceAlphaOutput + */ + public static DeleteInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of DeleteInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java new file mode 100644 index 00000000..3c0cadf9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The created instance. */ +@ApiModel(description = "The created instance.") +public class InsertFunctionInstance { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstance() {} + + public InsertFunctionInstance id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstance name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstance integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstance classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstance enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstance createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstance updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstance settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstance putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstance encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstance putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstance insertFunctionInstance = (InsertFunctionInstance) o; + return Objects.equals(this.id, insertFunctionInstance.id) + && Objects.equals(this.name, insertFunctionInstance.name) + && Objects.equals(this.integrationId, insertFunctionInstance.integrationId) + && Objects.equals(this.classId, insertFunctionInstance.classId) + && Objects.equals(this.enabled, insertFunctionInstance.enabled) + && Objects.equals(this.createdAt, insertFunctionInstance.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstance.updatedAt) + && Objects.equals(this.settings, insertFunctionInstance.settings) + && Objects.equals(this.encryptedSettings, insertFunctionInstance.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstance {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstance.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstance is not found in" + + " the empty JSON string", + InsertFunctionInstance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstance` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstance value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstance given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstance + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance + */ + public static InsertFunctionInstance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstance.class); + } + + /** + * Convert an instance of InsertFunctionInstance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java new file mode 100644 index 00000000..88b17c35 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java @@ -0,0 +1,512 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** The updated instance. */ +@ApiModel(description = "The updated instance.") +public class InsertFunctionInstance1 { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstance1() {} + + public InsertFunctionInstance1 id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstance1 name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstance1 integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstance1 classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstance1 enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstance1 createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstance1 updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstance1 settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstance1 putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstance1 encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstance1 putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstance1 insertFunctionInstance1 = (InsertFunctionInstance1) o; + return Objects.equals(this.id, insertFunctionInstance1.id) + && Objects.equals(this.name, insertFunctionInstance1.name) + && Objects.equals(this.integrationId, insertFunctionInstance1.integrationId) + && Objects.equals(this.classId, insertFunctionInstance1.classId) + && Objects.equals(this.enabled, insertFunctionInstance1.enabled) + && Objects.equals(this.createdAt, insertFunctionInstance1.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstance1.updatedAt) + && Objects.equals(this.settings, insertFunctionInstance1.settings) + && Objects.equals( + this.encryptedSettings, insertFunctionInstance1.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstance1 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstance1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstance1 is not found" + + " in the empty JSON string", + InsertFunctionInstance1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstance1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstance1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstance1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstance1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstance1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstance1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstance1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstance1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstance1 + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance1 + */ + public static InsertFunctionInstance1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstance1.class); + } + + /** + * Convert an instance of InsertFunctionInstance1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java new file mode 100644 index 00000000..f64bb2d2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java @@ -0,0 +1,510 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** InsertFunctionInstanceAlpha */ +public class InsertFunctionInstanceAlpha { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_CLASS_ID = "classId"; + + @SerializedName(SERIALIZED_NAME_CLASS_ID) + private String classId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; + + @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) + private Map encryptedSettings = new HashMap<>(); + + public InsertFunctionInstanceAlpha() {} + + public InsertFunctionInstanceAlpha id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public InsertFunctionInstanceAlpha name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InsertFunctionInstanceAlpha integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * Get integrationId + * + * @return integrationId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public InsertFunctionInstanceAlpha classId(String classId) { + + this.classId = classId; + return this; + } + + /** + * Get classId + * + * @return classId + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public InsertFunctionInstanceAlpha enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InsertFunctionInstanceAlpha createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public InsertFunctionInstanceAlpha updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public InsertFunctionInstanceAlpha settings(Map settings) { + + this.settings = settings; + return this; + } + + public InsertFunctionInstanceAlpha putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * Get settings + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + public InsertFunctionInstanceAlpha encryptedSettings(Map encryptedSettings) { + + this.encryptedSettings = encryptedSettings; + return this; + } + + public InsertFunctionInstanceAlpha putEncryptedSettingsItem( + String key, Object encryptedSettingsItem) { + this.encryptedSettings.put(key, encryptedSettingsItem); + return this; + } + + /** + * Get encryptedSettings + * + * @return encryptedSettings + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Map getEncryptedSettings() { + return encryptedSettings; + } + + public void setEncryptedSettings(Map encryptedSettings) { + this.encryptedSettings = encryptedSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsertFunctionInstanceAlpha insertFunctionInstanceAlpha = (InsertFunctionInstanceAlpha) o; + return Objects.equals(this.id, insertFunctionInstanceAlpha.id) + && Objects.equals(this.name, insertFunctionInstanceAlpha.name) + && Objects.equals(this.integrationId, insertFunctionInstanceAlpha.integrationId) + && Objects.equals(this.classId, insertFunctionInstanceAlpha.classId) + && Objects.equals(this.enabled, insertFunctionInstanceAlpha.enabled) + && Objects.equals(this.createdAt, insertFunctionInstanceAlpha.createdAt) + && Objects.equals(this.updatedAt, insertFunctionInstanceAlpha.updatedAt) + && Objects.equals(this.settings, insertFunctionInstanceAlpha.settings) + && Objects.equals( + this.encryptedSettings, insertFunctionInstanceAlpha.encryptedSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + name, + integrationId, + classId, + enabled, + createdAt, + updatedAt, + settings, + encryptedSettings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsertFunctionInstanceAlpha {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" encryptedSettings: ") + .append(toIndentedString(encryptedSettings)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("integrationId"); + openapiFields.add("classId"); + openapiFields.add("enabled"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("settings"); + openapiFields.add("encryptedSettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("classId"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + openapiRequiredFields.add("settings"); + openapiRequiredFields.add("encryptedSettings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstanceAlpha + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InsertFunctionInstanceAlpha.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in InsertFunctionInstanceAlpha is not" + + " found in the empty JSON string", + InsertFunctionInstanceAlpha.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InsertFunctionInstanceAlpha.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `InsertFunctionInstanceAlpha` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InsertFunctionInstanceAlpha.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("classId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `classId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("classId").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InsertFunctionInstanceAlpha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsertFunctionInstanceAlpha' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstanceAlpha.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, InsertFunctionInstanceAlpha value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InsertFunctionInstanceAlpha read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of InsertFunctionInstanceAlpha given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsertFunctionInstanceAlpha + * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstanceAlpha + */ + public static InsertFunctionInstanceAlpha fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsertFunctionInstanceAlpha.class); + } + + /** + * Convert an instance of InsertFunctionInstanceAlpha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java new file mode 100644 index 00000000..3ef99e9a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstances200Response.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** ListInsertFunctionInstances200Response */ +public class ListInsertFunctionInstances200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListInsertFunctionInstancesAlphaOutput data; + + public ListInsertFunctionInstances200Response() {} + + public ListInsertFunctionInstances200Response data( + ListInsertFunctionInstancesAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public ListInsertFunctionInstancesAlphaOutput getData() { + return data; + } + + public void setData(ListInsertFunctionInstancesAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInsertFunctionInstances200Response listInsertFunctionInstances200Response = + (ListInsertFunctionInstances200Response) o; + return Objects.equals(this.data, listInsertFunctionInstances200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInsertFunctionInstances200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListInsertFunctionInstances200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListInsertFunctionInstances200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListInsertFunctionInstances200Response" + + " is not found in the empty JSON string", + ListInsertFunctionInstances200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListInsertFunctionInstances200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListInsertFunctionInstances200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListInsertFunctionInstances200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInsertFunctionInstances200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListInsertFunctionInstances200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListInsertFunctionInstances200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListInsertFunctionInstances200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListInsertFunctionInstances200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInsertFunctionInstances200Response + * @throws IOException if the JSON string is invalid with respect to + * ListInsertFunctionInstances200Response + */ + public static ListInsertFunctionInstances200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstances200Response.class); + } + + /** + * Convert an instance of ListInsertFunctionInstances200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java new file mode 100644 index 00000000..2dfba5f1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListInsertFunctionInstancesAlphaOutput.java @@ -0,0 +1,267 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns a list of insert Function instances connected to the insert Function. */ +@ApiModel( + description = + "Returns a list of insert Function instances connected to the insert Function.") +public class ListInsertFunctionInstancesAlphaOutput { + public static final String SERIALIZED_NAME_INSTANCES = "instances"; + + @SerializedName(SERIALIZED_NAME_INSTANCES) + private List instances = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private Pagination pagination; + + public ListInsertFunctionInstancesAlphaOutput() {} + + public ListInsertFunctionInstancesAlphaOutput instances( + List instances) { + + this.instances = instances; + return this; + } + + public ListInsertFunctionInstancesAlphaOutput addInstancesItem( + InsertFunctionInstanceAlpha instancesItem) { + this.instances.add(instancesItem); + return this; + } + + /** + * All insert Function instances found. + * + * @return instances + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "All insert Function instances found.") + public List getInstances() { + return instances; + } + + public void setInstances(List instances) { + this.instances = instances; + } + + public ListInsertFunctionInstancesAlphaOutput pagination(Pagination pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInsertFunctionInstancesAlphaOutput listInsertFunctionInstancesAlphaOutput = + (ListInsertFunctionInstancesAlphaOutput) o; + return Objects.equals(this.instances, listInsertFunctionInstancesAlphaOutput.instances) + && Objects.equals( + this.pagination, listInsertFunctionInstancesAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(instances, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInsertFunctionInstancesAlphaOutput {\n"); + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instances"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instances"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * ListInsertFunctionInstancesAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListInsertFunctionInstancesAlphaOutput" + + " is not found in the empty JSON string", + ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListInsertFunctionInstancesAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListInsertFunctionInstancesAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListInsertFunctionInstancesAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("instances").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `instances` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("instances").toString())); + } + + JsonArray jsonArrayinstances = jsonObj.getAsJsonArray("instances"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListInsertFunctionInstancesAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListInsertFunctionInstancesAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListInsertFunctionInstancesAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListInsertFunctionInstancesAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListInsertFunctionInstancesAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListInsertFunctionInstancesAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListInsertFunctionInstancesAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListInsertFunctionInstancesAlphaOutput + */ + public static ListInsertFunctionInstancesAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListInsertFunctionInstancesAlphaOutput.class); + } + + /** + * Convert an instance of ListInsertFunctionInstancesAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java index bb09a9dd..3d04c6b9 100644 --- a/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/ReplaceRulesInTrackingPlanV1Input.java @@ -39,17 +39,17 @@ public class ReplaceRulesInTrackingPlanV1Input { public static final String SERIALIZED_NAME_RULES = "rules"; @SerializedName(SERIALIZED_NAME_RULES) - private List rules = new ArrayList<>(); + private List rules = new ArrayList<>(); public ReplaceRulesInTrackingPlanV1Input() {} - public ReplaceRulesInTrackingPlanV1Input rules(List rules) { + public ReplaceRulesInTrackingPlanV1Input rules(List rules) { this.rules = rules; return this; } - public ReplaceRulesInTrackingPlanV1Input addRulesItem(RuleV1 rulesItem) { + public ReplaceRulesInTrackingPlanV1Input addRulesItem(RuleInputV1 rulesItem) { this.rules.add(rulesItem); return this; } @@ -61,11 +61,11 @@ public ReplaceRulesInTrackingPlanV1Input addRulesItem(RuleV1 rulesItem) { */ @javax.annotation.Nonnull @ApiModelProperty(required = true, value = "Rules to replace.") - public List getRules() { + public List getRules() { return rules; } - public void setRules(List rules) { + public void setRules(List rules) { this.rules = rules; } diff --git a/src/main/java/com/segment/publicapi/models/RuleInputV1.java b/src/main/java/com/segment/publicapi/models/RuleInputV1.java new file mode 100644 index 00000000..188d2b37 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RuleInputV1.java @@ -0,0 +1,363 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Represents a rule to add to a Tracking Plan. */ +@ApiModel(description = "Represents a rule to add to a Tracking Plan.") +public class RuleInputV1 { + /** The type for this Tracking Plan rule. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + COMMON("COMMON"), + + GROUP("GROUP"), + + IDENTIFY("IDENTIFY"), + + PAGE("PAGE"), + + SCREEN("SCREEN"), + + TRACK("TRACK"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_JSON_SCHEMA = "jsonSchema"; + + @SerializedName(SERIALIZED_NAME_JSON_SCHEMA) + private Object jsonSchema = null; + + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; + + public RuleInputV1() {} + + public RuleInputV1 type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type for this Tracking Plan rule. + * + * @return type + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "The type for this Tracking Plan rule.") + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public RuleInputV1 key(String key) { + + this.key = key; + return this; + } + + /** + * Key to this rule (free-form string like 'Button clicked'). + * + * @return key + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Key to this rule (free-form string like 'Button clicked').") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public RuleInputV1 jsonSchema(Object jsonSchema) { + + this.jsonSchema = jsonSchema; + return this; + } + + /** + * JSON Schema of this rule. + * + * @return jsonSchema + */ + @javax.annotation.Nullable + @ApiModelProperty(required = true, value = "JSON Schema of this rule.") + public Object getJsonSchema() { + return jsonSchema; + } + + public void setJsonSchema(Object jsonSchema) { + this.jsonSchema = jsonSchema; + } + + public RuleInputV1 version(BigDecimal version) { + + this.version = version; + return this; + } + + /** + * Version of this rule. + * + * @return version + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "Version of this rule.") + public BigDecimal getVersion() { + return version; + } + + public void setVersion(BigDecimal version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RuleInputV1 ruleInputV1 = (RuleInputV1) o; + return Objects.equals(this.type, ruleInputV1.type) + && Objects.equals(this.key, ruleInputV1.key) + && Objects.equals(this.jsonSchema, ruleInputV1.jsonSchema) + && Objects.equals(this.version, ruleInputV1.version); + } + + @Override + public int hashCode() { + return Objects.hash(type, key, jsonSchema, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RuleInputV1 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("key"); + openapiFields.add("jsonSchema"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("jsonSchema"); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RuleInputV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RuleInputV1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RuleInputV1 is not found in the empty" + + " JSON string", + RuleInputV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RuleInputV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RuleInputV1` properties. JSON: %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RuleInputV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) + && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RuleInputV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RuleInputV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RuleInputV1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RuleInputV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RuleInputV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RuleInputV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of RuleInputV1 + * @throws IOException if the JSON string is invalid with respect to RuleInputV1 + */ + public static RuleInputV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RuleInputV1.class); + } + + /** + * Convert an instance of RuleInputV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java new file mode 100644 index 00000000..013bb044 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstance200Response.java @@ -0,0 +1,204 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** UpdateInsertFunctionInstance200Response */ +public class UpdateInsertFunctionInstance200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateInsertFunctionInstanceAlphaOutput data; + + public UpdateInsertFunctionInstance200Response() {} + + public UpdateInsertFunctionInstance200Response data( + UpdateInsertFunctionInstanceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + public UpdateInsertFunctionInstanceAlphaOutput getData() { + return data; + } + + public void setData(UpdateInsertFunctionInstanceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstance200Response updateInsertFunctionInstance200Response = + (UpdateInsertFunctionInstance200Response) o; + return Objects.equals(this.data, updateInsertFunctionInstance200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstance200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstance200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstance200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateInsertFunctionInstance200Response is not found in the" + + " empty JSON string", + UpdateInsertFunctionInstance200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstance200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstance200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstance200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstance200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstance200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstance200Response read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstance200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstance200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstance200Response + */ + public static UpdateInsertFunctionInstance200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstance200Response.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstance200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java new file mode 100644 index 00000000..4b1e6365 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaInput.java @@ -0,0 +1,293 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Updates an insert Function instance. */ +@ApiModel(description = "Updates an insert Function instance.") +public class UpdateInsertFunctionInstanceAlphaInput { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private Map settings = new HashMap<>(); + + public UpdateInsertFunctionInstanceAlphaInput() {} + + public UpdateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether this insert Function instance should be enabled for the Destination. + * + * @return enabled + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = "Whether this insert Function instance should be enabled for the Destination.") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateInsertFunctionInstanceAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * Defines the display name of the insert Function instance. + * + * @return name + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Defines the display name of the insert Function instance.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateInsertFunctionInstanceAlphaInput settings(Map settings) { + + this.settings = settings; + return this; + } + + public UpdateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + this.settings.put(key, settingsItem); + return this; + } + + /** + * An object that contains settings for this insert Function instance based on the settings + * present in the insert Function class. + * + * @return settings + */ + @javax.annotation.Nonnull + @ApiModelProperty( + required = true, + value = + "An object that contains settings for this insert Function instance based on" + + " the settings present in the insert Function class.") + public Map getSettings() { + return settings; + } + + public void setSettings(Map settings) { + this.settings = settings; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput = + (UpdateInsertFunctionInstanceAlphaInput) o; + return Objects.equals(this.enabled, updateInsertFunctionInstanceAlphaInput.enabled) + && Objects.equals(this.name, updateInsertFunctionInstanceAlphaInput.name) + && Objects.equals(this.settings, updateInsertFunctionInstanceAlphaInput.settings); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, name, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstanceAlphaInput {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + openapiFields.add("name"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("settings"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstanceAlphaInput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateInsertFunctionInstanceAlphaInput" + + " is not found in the empty JSON string", + UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstanceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstanceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstanceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstanceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstanceAlphaInput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstanceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstanceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstanceAlphaInput + */ + public static UpdateInsertFunctionInstanceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaInput.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstanceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java new file mode 100644 index 00000000..30658358 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateInsertFunctionInstanceAlphaOutput.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; + +/** Returns the updated insert Function instance. */ +@ApiModel(description = "Returns the updated insert Function instance.") +public class UpdateInsertFunctionInstanceAlphaOutput { + public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; + + @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) + private InsertFunctionInstance1 insertFunctionInstance; + + public UpdateInsertFunctionInstanceAlphaOutput() {} + + public UpdateInsertFunctionInstanceAlphaOutput insertFunctionInstance( + InsertFunctionInstance1 insertFunctionInstance) { + + this.insertFunctionInstance = insertFunctionInstance; + return this; + } + + /** + * Get insertFunctionInstance + * + * @return insertFunctionInstance + */ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + public InsertFunctionInstance1 getInsertFunctionInstance() { + return insertFunctionInstance; + } + + public void setInsertFunctionInstance(InsertFunctionInstance1 insertFunctionInstance) { + this.insertFunctionInstance = insertFunctionInstance; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInsertFunctionInstanceAlphaOutput updateInsertFunctionInstanceAlphaOutput = + (UpdateInsertFunctionInstanceAlphaOutput) o; + return Objects.equals( + this.insertFunctionInstance, + updateInsertFunctionInstanceAlphaOutput.insertFunctionInstance); + } + + @Override + public int hashCode() { + return Objects.hash(insertFunctionInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInsertFunctionInstanceAlphaOutput {\n"); + sb.append(" insertFunctionInstance: ") + .append(toIndentedString(insertFunctionInstance)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("insertFunctionInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("insertFunctionInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to + * UpdateInsertFunctionInstanceAlphaOutput + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateInsertFunctionInstanceAlphaOutput is not found in the" + + " empty JSON string", + UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateInsertFunctionInstanceAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateInsertFunctionInstanceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateInsertFunctionInstanceAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateInsertFunctionInstanceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateInsertFunctionInstanceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateInsertFunctionInstanceAlphaOutput read(JsonReader in) + throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInsertFunctionInstanceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInsertFunctionInstanceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateInsertFunctionInstanceAlphaOutput + */ + public static UpdateInsertFunctionInstanceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInsertFunctionInstanceAlphaOutput.class); + } + + /** + * Convert an instance of UpdateInsertFunctionInstanceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java index a1bcdf85..0bd03fbb 100644 --- a/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java +++ b/src/main/java/com/segment/publicapi/models/UpsertRuleV1.java @@ -112,21 +112,6 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_VERSION) private BigDecimal version; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_DEPRECATED_AT = "deprecatedAt"; - - @SerializedName(SERIALIZED_NAME_DEPRECATED_AT) - private String deprecatedAt; - public UpsertRuleV1() {} public UpsertRuleV1 newKey(String newKey) { @@ -234,69 +219,6 @@ public void setVersion(BigDecimal version) { this.version = version; } - public UpsertRuleV1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this rule's creation. - * - * @return createdAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The timestamp of this rule's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public UpsertRuleV1 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this rule's last change. - * - * @return updatedAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The timestamp of this rule's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public UpsertRuleV1 deprecatedAt(String deprecatedAt) { - - this.deprecatedAt = deprecatedAt; - return this; - } - - /** - * The timestamp of this rule's deprecation. - * - * @return deprecatedAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The timestamp of this rule's deprecation.") - public String getDeprecatedAt() { - return deprecatedAt; - } - - public void setDeprecatedAt(String deprecatedAt) { - this.deprecatedAt = deprecatedAt; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -310,16 +232,12 @@ public boolean equals(Object o) { && Objects.equals(this.type, upsertRuleV1.type) && Objects.equals(this.key, upsertRuleV1.key) && Objects.equals(this.jsonSchema, upsertRuleV1.jsonSchema) - && Objects.equals(this.version, upsertRuleV1.version) - && Objects.equals(this.createdAt, upsertRuleV1.createdAt) - && Objects.equals(this.updatedAt, upsertRuleV1.updatedAt) - && Objects.equals(this.deprecatedAt, upsertRuleV1.deprecatedAt); + && Objects.equals(this.version, upsertRuleV1.version); } @Override public int hashCode() { - return Objects.hash( - newKey, type, key, jsonSchema, version, createdAt, updatedAt, deprecatedAt); + return Objects.hash(newKey, type, key, jsonSchema, version); } @Override @@ -331,9 +249,6 @@ public String toString() { sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" deprecatedAt: ").append(toIndentedString(deprecatedAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -360,9 +275,6 @@ private String toIndentedString(Object o) { openapiFields.add("key"); openapiFields.add("jsonSchema"); openapiFields.add("version"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("deprecatedAt"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -433,30 +345,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " got `%s`", jsonObj.get("key").toString())); } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) - && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) - && !jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - if ((jsonObj.get("deprecatedAt") != null && !jsonObj.get("deprecatedAt").isJsonNull()) - && !jsonObj.get("deprecatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `deprecatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("deprecatedAt").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 78c26e41fb2d9c956caf5ca86cf4d1fc476449f2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 18 Oct 2023 05:34:08 +0000 Subject: [PATCH 153/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2137a34c. From 978233d595c89f58102883bf7317aa8a436ccf32 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 18 Oct 2023 22:32:59 +0000 Subject: [PATCH 154/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@14f771e4. From 2099972949ba06cff2d31f4601d209d2049e62b9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 25 Oct 2023 21:04:57 +0000 Subject: [PATCH 155/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a2c24bff. --- README.md | 10 +- pom.xml | 6 +- .../com/segment/publicapi/ApiCallback.java | 1 - .../java/com/segment/publicapi/ApiClient.java | 3 +- .../com/segment/publicapi/ApiException.java | 8 +- .../com/segment/publicapi/ApiResponse.java | 1 - .../com/segment/publicapi/Configuration.java | 2 + .../publicapi/GzipRequestInterceptor.java | 1 - src/main/java/com/segment/publicapi/JSON.java | 144 --- .../publicapi/ProgressRequestBody.java | 1 - .../publicapi/ProgressResponseBody.java | 1 - .../publicapi/ServerConfiguration.java | 3 +- .../com/segment/publicapi/ServerVariable.java | 1 - .../com/segment/publicapi/StringUtil.java | 1 - .../segment/publicapi/api/ApiCallsApi.java | 14 +- .../segment/publicapi/api/AudiencesApi.java | 52 +- .../segment/publicapi/api/AuditTrailApi.java | 9 +- .../com/segment/publicapi/api/CatalogApi.java | 48 +- .../publicapi/api/ComputedTraitsApi.java | 54 +- .../api/DeletionAndSuppressionApi.java | 74 +- .../publicapi/api/DestinationFiltersApi.java | 74 +- .../publicapi/api/DestinationsApi.java | 123 +- .../publicapi/api/EdgeFunctionsApi.java | 40 +- .../com/segment/publicapi/api/EventsApi.java | 27 +- .../segment/publicapi/api/FunctionsApi.java | 120 +- .../segment/publicapi/api/IamGroupsApi.java | 116 +- .../segment/publicapi/api/IamRolesApi.java | 6 +- .../segment/publicapi/api/IamUsersApi.java | 69 +- .../com/segment/publicapi/api/LabelsApi.java | 25 +- .../publicapi/api/MonthlyTrackedUsersApi.java | 12 +- .../publicapi/api/ProfilesSyncApi.java | 94 +- .../segment/publicapi/api/ReverseEtlApi.java | 42 +- .../publicapi/api/SelectiveSyncApi.java | 77 +- .../com/segment/publicapi/api/SourcesApi.java | 104 +- .../com/segment/publicapi/api/SpacesApi.java | 34 +- .../com/segment/publicapi/api/TestingApi.java | 21 +- .../publicapi/api/TrackingPlansApi.java | 121 +- .../publicapi/api/TransformationsApi.java | 42 +- .../segment/publicapi/api/WarehousesApi.java | 98 +- .../segment/publicapi/api/WorkspacesApi.java | 6 +- .../segment/publicapi/auth/ApiKeyAuth.java | 1 - .../publicapi/auth/Authentication.java | 1 - .../segment/publicapi/auth/HttpBasicAuth.java | 1 - .../publicapi/auth/HttpBearerAuth.java | 1 - .../publicapi/models/APICallSnapshotV1.java | 41 +- .../models/AbstractOpenApiSchema.java | 4 +- .../publicapi/models/AccessPermissionV1.java | 50 +- ...ctionFromSourceToWarehouse200Response.java | 34 +- ...nnectionFromSourceToWarehouseV1Output.java | 38 +- .../models/AddLabelsToSource200Response.java | 34 +- .../models/AddLabelsToSource200Response1.java | 34 +- .../models/AddLabelsToSourceAlphaInput.java | 45 +- .../models/AddLabelsToSourceAlphaOutput.java | 44 +- .../models/AddLabelsToSourceV1Input.java | 44 +- .../models/AddLabelsToSourceV1Output.java | 44 +- .../AddPermissionsToUser200Response.java | 34 +- .../AddPermissionsToUserGroup200Response.java | 34 +- .../AddPermissionsToUserGroupV1Input.java | 44 +- .../AddPermissionsToUserGroupV1Output.java | 46 +- .../models/AddPermissionsToUserV1Input.java | 45 +- .../models/AddPermissionsToUserV1Output.java | 44 +- .../AddSourceToTrackingPlan200Response.java | 34 +- .../AddSourceToTrackingPlanV1Input.java | 40 +- .../AddSourceToTrackingPlanV1Output.java | 36 +- .../AddUsersToUserGroup200Response.java | 34 +- .../models/AddUsersToUserGroupV1Input.java | 41 +- .../models/AddUsersToUserGroupV1Output.java | 47 +- .../AdvancedWarehouseSyncScheduleV1Input.java | 47 +- ...AdvancedWarehouseSyncScheduleV1Output.java | 41 +- .../publicapi/models/AllowedLabelBeta.java | 38 +- .../segment/publicapi/models/Audience.java | 546 --------- .../publicapi/models/AudienceSummary.java | 45 +- .../publicapi/models/AuditEventV1.java | 44 +- ...agingSubscriptionsForSpace200Response.java | 35 +- ...sagingSubscriptionsForSpaceAlphaInput.java | 46 +- ...agingSubscriptionsForSpaceAlphaOutput.java | 82 +- .../publicapi/models/BreakdownBeta.java | 37 +- .../models/CommonSourceSettingsV1.java | 70 +- .../publicapi/models/ComputedTrait.java | 546 --------- .../models/ComputedTraitSummary.java | 45 +- .../com/segment/publicapi/models/Contact.java | 39 +- ...reateCloudSourceRegulation200Response.java | 34 +- .../CreateCloudSourceRegulationV1Input.java | 48 +- .../CreateCloudSourceRegulationV1Output.java | 36 +- .../models/CreateDestination200Response.java | 34 +- ...ateDestinationSubscription200Response.java | 34 +- ...eateDestinationSubscriptionAlphaInput.java | 83 +- ...ateDestinationSubscriptionAlphaOutput.java | 38 +- .../models/CreateDestinationV1Input.java | 56 +- .../models/CreateDestinationV1Output.java | 46 +- .../CreateEdgeFunctions200Response.java | 34 +- .../models/CreateEdgeFunctionsAlphaInput.java | 38 +- .../CreateEdgeFunctionsAlphaOutput.java | 46 +- ...CreateFilterForDestination200Response.java | 34 +- .../CreateFilterForDestinationV1Input.java | 51 +- .../CreateFilterForDestinationV1Output.java | 46 +- .../models/CreateFunction200Response.java | 34 +- .../CreateFunctionDeployment200Response.java | 34 +- .../CreateFunctionDeploymentV1Output.java | 38 +- .../models/CreateFunctionV1Input.java | 55 +- .../models/CreateFunctionV1Output.java | 46 +- ...eateInsertFunctionInstance200Response.java | 34 +- ...reateInsertFunctionInstanceAlphaInput.java | 51 +- ...eateInsertFunctionInstanceAlphaOutput.java | 46 +- .../models/CreateInvites200Response.java | 34 +- .../models/CreateInvitesV1Input.java | 44 +- .../models/CreateInvitesV1Output.java | 39 +- .../models/CreateLabel200Response.java | 34 +- .../publicapi/models/CreateLabelV1Input.java | 46 +- .../publicapi/models/CreateLabelV1Output.java | 46 +- .../CreateProfilesWarehouse200Response.java | 34 +- .../CreateProfilesWarehouseAlphaInput.java | 75 +- .../CreateProfilesWarehouseAlphaOutput.java | 46 +- .../CreateReverseEtlModel200Response.java | 34 +- .../models/CreateReverseEtlModelInput.java | 85 +- .../models/CreateReverseEtlModelOutput.java | 39 +- .../models/CreateSource200Response.java | 34 +- .../models/CreateSource200Response1.java | 34 +- .../models/CreateSourceAlphaInput.java | 86 +- .../models/CreateSourceAlphaOutput.java | 46 +- .../CreateSourceRegulation200Response.java | 34 +- .../models/CreateSourceRegulationV1Input.java | 45 +- .../CreateSourceRegulationV1Output.java | 36 +- .../publicapi/models/CreateSourceV1Input.java | 85 +- .../models/CreateSourceV1Output.java | 46 +- .../models/CreateTrackingPlan200Response.java | 34 +- .../models/CreateTrackingPlanV1Input.java | 40 +- .../models/CreateTrackingPlanV1Output.java | 46 +- .../CreateTransformation200Response.java | 34 +- .../models/CreateTransformationBetaInput.java | 77 +- .../CreateTransformationBetaOutput.java | 46 +- .../models/CreateTransformationV1Input.java | 91 +- .../models/CreateTransformationV1Output.java | 46 +- .../models/CreateUserGroup200Response.java | 34 +- .../models/CreateUserGroupV1Input.java | 39 +- .../models/CreateUserGroupV1Output.java | 46 +- ...reateValidationInWarehouse200Response.java | 34 +- .../CreateValidationInWarehouseV1Input.java | 57 +- .../CreateValidationInWarehouseV1Output.java | 41 +- .../models/CreateWarehouse200Response.java | 34 +- .../models/CreateWarehouseV1Input.java | 71 +- .../models/CreateWarehouseV1Output.java | 46 +- .../CreateWorkspaceRegulation200Response.java | 34 +- .../CreateWorkspaceRegulationV1Input.java | 47 +- .../CreateWorkspaceRegulationV1Output.java | 36 +- .../models/DeleteDestination200Response.java | 34 +- .../models/DeleteDestinationV1Output.java | 36 +- .../models/DeleteFunction200Response.java | 34 +- .../models/DeleteFunctionV1Output.java | 36 +- ...leteInsertFunctionInstance200Response.java | 34 +- ...leteInsertFunctionInstanceAlphaOutput.java | 36 +- .../models/DeleteInvites200Response.java | 34 +- .../models/DeleteInvitesV1Output.java | 36 +- .../models/DeleteLabel200Response.java | 34 +- .../models/DeleteLabel200Response1.java | 34 +- .../models/DeleteLabelAlphaOutput.java | 36 +- .../publicapi/models/DeleteLabelV1Output.java | 36 +- .../models/DeleteRegulation200Response.java | 35 +- .../models/DeleteRegulationV1Output.java | 36 +- .../DeleteReverseEtlModel200Response.java | 34 +- .../models/DeleteReverseEtlModelOutput.java | 37 +- .../models/DeleteSource200Response.java | 34 +- .../models/DeleteSource200Response1.java | 34 +- .../models/DeleteSourceAlphaOutput.java | 36 +- .../models/DeleteSourceV1Output.java | 36 +- .../models/DeleteTrackingPlan200Response.java | 34 +- .../models/DeleteTrackingPlanV1Output.java | 36 +- .../DeleteTransformation200Response.java | 34 +- .../models/DeleteTransformationBetaInput.java | 36 +- .../DeleteTransformationBetaOutput.java | 36 +- .../models/DeleteTransformationV1Output.java | 36 +- .../models/DeleteUserGroup200Response.java | 34 +- .../models/DeleteUserGroupV1Output.java | 38 +- .../models/DeleteUsers200Response.java | 34 +- .../publicapi/models/DeleteUsersV1Output.java | 38 +- .../models/DeleteWarehouse200Response.java | 34 +- .../models/DeleteWarehouseV1Output.java | 36 +- .../models/DeliveryMetricsSummary.java | 303 ----- .../models/DeliveryMetricsSummaryBeta.java | 50 +- .../segment/publicapi/models/Destination.java | 402 ------- .../publicapi/models/Destination1.java | 402 ------- .../publicapi/models/Destination2.java | 402 ------- .../models/DestinationFilterActionV1.java | 51 +- .../publicapi/models/DestinationFilterV1.java | 57 +- .../publicapi/models/DestinationMetadata.java | 1062 ---------------- .../DestinationMetadataActionFieldV1.java | 65 +- .../models/DestinationMetadataActionV1.java | 66 +- .../DestinationMetadataComponentV1.java | 40 +- .../models/DestinationMetadataFeaturesV1.java | 43 +- .../models/DestinationMetadataMethodsV1.java | 36 +- .../DestinationMetadataPlatformsV1.java | 34 +- ...stinationMetadataSubscriptionPresetV1.java | 48 +- .../models/DestinationMetadataV1.java | 168 +-- .../publicapi/models/DestinationStatusV1.java | 40 +- .../models/DestinationSubscription.java | 75 +- .../DestinationSubscriptionUpdateInput.java | 71 +- .../publicapi/models/DestinationV1.java | 74 +- .../DisableEdgeFunctions200Response.java | 34 +- .../DisableEdgeFunctionsAlphaOutput.java | 46 +- .../publicapi/models/Echo200Response.java | 34 +- .../publicapi/models/Echo200Response1.java | 34 +- .../publicapi/models/EchoAlphaOutput.java | 44 +- .../publicapi/models/EchoV1Output.java | 44 +- .../publicapi/models/EdgeFunctions.java | 393 ------ .../publicapi/models/EdgeFunctions1.java | 393 ------ .../publicapi/models/EdgeFunctionsAlpha.java | 45 +- .../publicapi/models/EventSourceV1.java | 38 +- .../models/FQLDefinedPropertyV1.java | 35 +- .../com/segment/publicapi/models/Filter.java | 272 ----- .../com/segment/publicapi/models/Filter1.java | 561 --------- .../com/segment/publicapi/models/Filter2.java | 561 --------- .../com/segment/publicapi/models/Filter3.java | 561 --------- .../segment/publicapi/models/Function.java | 53 +- .../segment/publicapi/models/Function1.java | 766 ------------ .../segment/publicapi/models/Function2.java | 766 ------------ .../publicapi/models/FunctionDeployment.java | 36 +- .../publicapi/models/FunctionSettingV1.java | 41 +- .../segment/publicapi/models/FunctionV1.java | 53 +- ...eUploadURLForEdgeFunctions200Response.java | 34 +- ...eUploadURLForEdgeFunctionsAlphaOutput.java | 40 +- ...dSyncScheduleFromWarehouse200Response.java | 34 +- ...ncedSyncScheduleFromWarehouseV1Output.java | 52 +- .../models/GetAudience200Response.java | 34 +- .../models/GetAudienceAlphaOutput.java | 46 +- .../models/GetComputedTrait200Response.java | 35 +- .../models/GetComputedTraitAlphaOutput.java | 47 +- ...nnectionStateFromWarehouse200Response.java | 34 +- ...tConnectionStateFromWarehouseV1Output.java | 41 +- ...ailyPerSourceAPICallsUsage200Response.java | 34 +- ...etDailyPerSourceAPICallsUsageV1Output.java | 58 +- .../GetDailyPerSourceMTUUsage200Response.java | 34 +- .../GetDailyPerSourceMTUUsageV1Output.java | 55 +- ...ailyWorkspaceAPICallsUsage200Response.java | 34 +- ...etDailyWorkspaceAPICallsUsageV1Output.java | 57 +- .../GetDailyWorkspaceMTUUsage200Response.java | 34 +- .../GetDailyWorkspaceMTUUsageV1Output.java | 55 +- .../models/GetDestination200Response.java | 34 +- .../GetDestinationMetadata200Response.java | 34 +- .../GetDestinationMetadataV1Output.java | 46 +- .../models/GetDestinationV1Output.java | 46 +- .../GetDestinationsCatalog200Response.java | 34 +- .../GetDestinationsCatalogV1Output.java | 59 +- ...tEventsVolumeFromWorkspace200Response.java | 34 +- .../GetEventsVolumeFromWorkspaceV1Output.java | 77 +- .../GetEventsVolumeFromWorkspaceV1Query.java | 101 +- .../GetFilterInDestination200Response.java | 34 +- .../GetFilterInDestinationV1Output.java | 46 +- .../models/GetFunction200Response.java | 34 +- .../publicapi/models/GetFunctionV1Output.java | 38 +- .../models/GetFunctionVersion200Response.java | 34 +- .../models/GetFunctionVersionAlphaOutput.java | 38 +- ...GetLatestFromEdgeFunctions200Response.java | 34 +- ...GetLatestFromEdgeFunctionsAlphaOutput.java | 46 +- ...tMessagingSubscriptionFailureResponse.java | 46 +- ...tMessagingSubscriptionSuccessResponse.java | 49 +- .../models/GetRegulation200Response.java | 34 +- .../models/GetRegulationV1Output.java | 38 +- .../models/GetReverseEtlModel200Response.java | 34 +- .../models/GetReverseEtlModelOutput.java | 46 +- .../models/GetSource200Response.java | 34 +- .../models/GetSource200Response1.java | 34 +- .../models/GetSourceAlphaOutput.java | 87 +- .../models/GetSourceMetadata200Response.java | 34 +- .../models/GetSourceMetadataV1Output.java | 46 +- .../publicapi/models/GetSourceV1Output.java | 46 +- .../models/GetSourcesCatalog200Response.java | 34 +- .../models/GetSourcesCatalogV1Output.java | 57 +- .../publicapi/models/GetSpace200Response.java | 34 +- .../publicapi/models/GetSpaceAlphaOutput.java | 38 +- ...ubscriptionFromDestination200Response.java | 34 +- ...ubscriptionFromDestinationAlphaOutput.java | 47 +- .../models/GetSubscriptionRequest.java | 35 +- .../models/GetTrackingPlan200Response.java | 34 +- .../models/GetTrackingPlanV1Output.java | 46 +- .../models/GetTransformation200Response.java | 34 +- .../models/GetTransformationBetaInput.java | 36 +- .../models/GetTransformationBetaOutput.java | 47 +- .../models/GetTransformationV1Output.java | 46 +- .../publicapi/models/GetUser200Response.java | 34 +- .../models/GetUserGroup200Response.java | 34 +- .../models/GetUserGroupV1Output.java | 46 +- .../publicapi/models/GetUserV1Output.java | 46 +- .../models/GetWarehouse200Response.java | 34 +- .../GetWarehouseMetadata200Response.java | 34 +- .../models/GetWarehouseMetadataV1Output.java | 46 +- .../models/GetWarehouseV1Output.java | 46 +- .../GetWarehousesCatalog200Response.java | 34 +- .../models/GetWarehousesCatalogV1Output.java | 59 +- .../models/GetWorkspace200Response.java | 34 +- .../models/GetWorkspaceV1Output.java | 46 +- .../com/segment/publicapi/models/Group.java | 333 ----- .../models/GroupSourceSettingsV1.java | 41 +- .../models/GroupSubscriptionStatus.java | 37 +- .../GroupSubscriptionStatusResponse.java | 39 +- .../publicapi/models/HandleWebhookInput.java | 39 +- .../publicapi/models/HandleWebhookOutput.java | 37 +- .../segment/publicapi/models/Identify.java | 333 ----- .../models/IdentifySourceSettingsV1.java | 41 +- .../com/segment/publicapi/models/Input.java | 314 ----- .../models/InsertFunctionInstance.java | 510 -------- .../models/InsertFunctionInstance1.java | 512 -------- .../models/InsertFunctionInstanceAlpha.java | 48 +- .../models/IntegrationOptionBeta.java | 54 +- .../publicapi/models/InvitePermissionV1.java | 54 +- .../segment/publicapi/models/InviteV1.java | 47 +- .../com/segment/publicapi/models/Label.java | 284 ----- .../com/segment/publicapi/models/Label1.java | 284 ----- .../segment/publicapi/models/LabelAlpha.java | 47 +- .../com/segment/publicapi/models/LabelV1.java | 47 +- .../models/ListAudiences200Response.java | 34 +- .../models/ListAudiencesAlphaOutput.java | 55 +- .../models/ListAuditEvents200Response.java | 34 +- .../models/ListAuditEventsV1Output.java | 57 +- .../models/ListComputedTraits200Response.java | 34 +- .../models/ListComputedTraitsAlphaOutput.java | 55 +- ...ctedDestinationsFromSource200Response.java | 34 +- ...tedDestinationsFromSource200Response1.java | 34 +- ...ctedDestinationsFromSourceAlphaOutput.java | 57 +- ...nnectedDestinationsFromSourceV1Output.java | 57 +- ...nectedSourcesFromWarehouse200Response.java | 34 +- ...ConnectedSourcesFromWarehouseV1Output.java | 57 +- ...nectedWarehousesFromSource200Response.java | 34 +- ...ectedWarehousesFromSource200Response1.java | 34 +- ...nectedWarehousesFromSourceAlphaOutput.java | 57 +- ...ConnectedWarehousesFromSourceV1Output.java | 57 +- ...ricsSummaryFromDestination200Response.java | 35 +- ...tricsSummaryFromDestinationBetaOutput.java | 46 +- .../models/ListDestinations200Response.java | 35 +- .../models/ListDestinationsV1Output.java | 57 +- ...ListFiltersFromDestination200Response.java | 34 +- .../ListFiltersFromDestinationV1Output.java | 57 +- .../publicapi/models/ListFunctionItemV1.java | 39 +- .../ListFunctionVersions200Response.java | 34 +- .../ListFunctionVersionsAlphaOutput.java | 55 +- .../models/ListFunctions200Response.java | 34 +- .../models/ListFunctionsV1Output.java | 55 +- ...istInsertFunctionInstances200Response.java | 34 +- ...istInsertFunctionInstancesAlphaOutput.java | 57 +- .../models/ListInvites200Response.java | 34 +- .../ListInvitesFromUserGroup200Response.java | 34 +- .../ListInvitesFromUserGroupV1Output.java | 50 +- .../publicapi/models/ListInvitesV1Output.java | 50 +- .../models/ListLabels200Response.java | 34 +- .../models/ListLabels200Response1.java | 34 +- .../models/ListLabelsAlphaOutput.java | 44 +- .../publicapi/models/ListLabelsV1Output.java | 44 +- ...stProfilesWarehouseInSpace200Response.java | 34 +- ...stProfilesWarehouseInSpaceAlphaOutput.java | 57 +- .../ListRegulationsFromSource200Response.java | 34 +- .../ListRegulationsFromSourceV1Output.java | 46 +- .../ListReverseEtlModels200Response.java | 34 +- .../models/ListReverseEtlModelsOutput.java | 55 +- .../models/ListRoles200Response.java | 34 +- .../publicapi/models/ListRolesV1Output.java | 55 +- .../ListRulesFromTrackingPlan200Response.java | 34 +- .../ListRulesFromTrackingPlanV1Output.java | 55 +- ...ListSchemaSettingsInSource200Response.java | 34 +- .../ListSchemaSettingsInSourceV1Output.java | 49 +- ...yncsFromWarehouseAndSource200Response.java | 35 +- ...veSyncsFromWarehouseAndSourceV1Output.java | 60 +- ...SyncsFromWarehouseAndSpace200Response.java | 35 +- ...SyncsFromWarehouseAndSpaceAlphaOutput.java | 62 +- .../models/ListSources200Response.java | 34 +- .../models/ListSources200Response1.java | 34 +- .../models/ListSourcesAlphaOutput.java | 55 +- ...istSourcesFromTrackingPlan200Response.java | 34 +- .../ListSourcesFromTrackingPlanV1Output.java | 57 +- .../publicapi/models/ListSourcesV1Output.java | 55 +- ...bscriptionsFromDestination200Response.java | 34 +- ...bscriptionsFromDestinationAlphaOutput.java | 57 +- .../models/ListSuppressions200Response.java | 35 +- .../models/ListSuppressionsV1Output.java | 59 +- .../ListSyncsFromWarehouse200Response.java | 34 +- ...yncsFromWarehouseAndSource200Response.java | 34 +- ...stSyncsFromWarehouseAndSourceV1Output.java | 62 +- .../ListSyncsFromWarehouseV1Output.java | 57 +- .../models/ListTrackingPlans200Response.java | 34 +- .../models/ListTrackingPlansV1Output.java | 55 +- .../ListTransformations200Response.java | 34 +- .../models/ListTransformationsBetaInput.java | 46 +- .../models/ListTransformationsBetaOutput.java | 55 +- .../models/ListTransformationsV1Output.java | 56 +- .../models/ListUserGroups200Response.java | 34 +- .../ListUserGroupsFromUser200Response.java | 34 +- .../ListUserGroupsFromUserV1Output.java | 55 +- .../models/ListUserGroupsV1Output.java | 55 +- .../models/ListUsers200Response.java | 34 +- .../ListUsersFromUserGroup200Response.java | 34 +- .../ListUsersFromUserGroupV1Output.java | 55 +- .../publicapi/models/ListUsersV1Output.java | 55 +- .../models/ListWarehouses200Response.java | 34 +- .../models/ListWarehousesV1Output.java | 55 +- .../ListWorkspaceRegulations200Response.java | 34 +- .../ListWorkspaceRegulationsV1Output.java | 57 +- .../com/segment/publicapi/models/Logos.java | 302 ----- .../com/segment/publicapi/models/Logos1.java | 302 ----- .../com/segment/publicapi/models/Logos2.java | 302 ----- .../segment/publicapi/models/LogosBeta.java | 38 +- .../models/MessageSubscriptionResponse.java | 58 +- .../MessageSubscriptionResponseError.java | 35 +- .../models/MessagesSubscriptionRequest.java | 46 +- .../segment/publicapi/models/Metadata.java | 1067 ----------------- .../segment/publicapi/models/Metadata1.java | 399 ------ .../segment/publicapi/models/Metadata2.java | 499 -------- .../segment/publicapi/models/MetricBeta.java | 46 +- .../publicapi/models/MinimalUserGroupV1.java | 37 +- .../publicapi/models/MinimalUserV1.java | 40 +- .../publicapi/models/MtuSnapshotV1.java | 58 +- .../segment/publicapi/models/Pagination.java | 348 ------ .../segment/publicapi/models/Pagination1.java | 249 ---- .../publicapi/models/PaginationInput.java | 47 +- .../publicapi/models/PaginationOutput.java | 57 +- .../publicapi/models/PermissionInputV1.java | 45 +- .../models/PermissionResourceV1.java | 51 +- .../publicapi/models/PermissionV1.java | 61 +- .../PreviewDestinationFilter200Response.java | 34 +- .../models/PreviewDestinationFilterV1.java | 59 +- .../PreviewDestinationFilterV1Input.java | 52 +- .../PreviewDestinationFilterV1Output.java | 42 +- .../publicapi/models/ProfilesWarehouse.java | 419 ------- .../publicapi/models/ProfilesWarehouse1.java | 419 ------- .../models/ProfilesWarehouseAlpha.java | 78 +- .../publicapi/models/PropertyRenameBeta.java | 35 +- .../publicapi/models/PropertyRenameV1.java | 35 +- .../PropertyValueTransformationBeta.java | 40 +- .../models/PropertyValueTransformationV1.java | 40 +- .../com/segment/publicapi/models/Query.java | 669 ----------- .../segment/publicapi/models/Regulation.java | 55 +- .../models/RegulationListEntryV1.java | 42 +- .../RemoveAudienceFromSpace200Response.java | 34 +- .../RemoveAudienceFromSpaceAlphaOutput.java | 36 +- ...moveComputedTraitFromSpace200Response.java | 34 +- ...moveComputedTraitFromSpaceAlphaOutput.java | 36 +- ...emoveFilterFromDestination200Response.java | 34 +- .../RemoveFilterFromDestinationV1Output.java | 36 +- ...ProfilesWarehouseFromSpace200Response.java | 34 +- ...ProfilesWarehouseFromSpaceAlphaOutput.java | 36 +- .../publicapi/models/RemoveRuleV1.java | 38 +- ...emoveRulesFromTrackingPlan200Response.java | 34 +- .../RemoveRulesFromTrackingPlanV1Output.java | 36 +- ...rceConnectionFromWarehouse200Response.java | 34 +- ...SourceConnectionFromWarehouseV1Output.java | 38 +- ...moveSourceFromTrackingPlan200Response.java | 34 +- .../RemoveSourceFromTrackingPlanV1Output.java | 36 +- ...ubscriptionFromDestination200Response.java | 34 +- ...ubscriptionFromDestinationAlphaOutput.java | 36 +- .../RemoveUsersFromUserGroup200Response.java | 34 +- .../RemoveUsersFromUserGroupV1Output.java | 38 +- ...edSyncScheduleForWarehouse200Response.java | 35 +- ...vancedSyncScheduleForWarehouseV1Input.java | 52 +- ...ancedSyncScheduleForWarehouseV1Output.java | 52 +- .../ReplaceLabelsInSource200Response.java | 34 +- .../ReplaceLabelsInSource200Response1.java | 34 +- .../ReplaceLabelsInSourceAlphaInput.java | 44 +- .../ReplaceLabelsInSourceAlphaOutput.java | 44 +- .../models/ReplaceLabelsInSourceV1Input.java | 44 +- .../models/ReplaceLabelsInSourceV1Output.java | 44 +- ...agingSubscriptionsInSpaces200Response.java | 35 +- ...sagingSubscriptionsInSpacesAlphaInput.java | 44 +- ...agingSubscriptionsInSpacesAlphaOutput.java | 67 +- .../ReplacePermissionsForUser200Response.java | 34 +- ...acePermissionsForUserGroup200Response.java | 34 +- ...ReplacePermissionsForUserGroupV1Input.java | 44 +- ...eplacePermissionsForUserGroupV1Output.java | 44 +- .../ReplacePermissionsForUserV1Input.java | 44 +- .../ReplacePermissionsForUserV1Output.java | 44 +- ...ReplaceRulesInTrackingPlan200Response.java | 34 +- .../ReplaceRulesInTrackingPlanV1Input.java | 44 +- .../ReplaceRulesInTrackingPlanV1Output.java | 36 +- .../ReplaceUsersInUserGroup200Response.java | 34 +- .../ReplaceUsersInUserGroupV1Input.java | 41 +- .../ReplaceUsersInUserGroupV1Output.java | 46 +- .../publicapi/models/RequestError.java | 43 +- .../models/RequestErrorEnvelope.java | 44 +- .../segment/publicapi/models/ResourceV1.java | 37 +- .../RestoreFunctionVersion200Response.java | 34 +- .../RestoreFunctionVersionAlphaInput.java | 36 +- .../RestoreFunctionVersionAlphaOutput.java | 46 +- .../publicapi/models/ReverseEtlModel.java | 89 +- .../publicapi/models/ReverseEtlModel1.java | 532 -------- .../com/segment/publicapi/models/RoleV1.java | 38 +- .../segment/publicapi/models/RuleInputV1.java | 39 +- .../com/segment/publicapi/models/RuleV1.java | 42 +- .../segment/publicapi/models/Schedule.java | 256 ---- .../segment/publicapi/models/Schedule1.java | 260 ---- .../segment/publicapi/models/Schedule2.java | 253 ---- .../segment/publicapi/models/Settings.java | 333 ----- .../segment/publicapi/models/Settings1.java | 333 ----- .../com/segment/publicapi/models/Source.java | 284 ----- .../com/segment/publicapi/models/Source1.java | 541 --------- .../com/segment/publicapi/models/Source2.java | 541 --------- .../com/segment/publicapi/models/Source3.java | 541 --------- .../com/segment/publicapi/models/Source4.java | 541 --------- .../com/segment/publicapi/models/Source5.java | 541 --------- .../com/segment/publicapi/models/Source6.java | 541 --------- .../models/SourceAPICallSnapshotV1.java | 42 +- .../segment/publicapi/models/SourceAlpha.java | 116 +- .../models/SourceEventVolumeDatapointV1.java | 48 +- .../publicapi/models/SourceEventVolumeV1.java | 67 +- .../publicapi/models/SourceMetadata.java | 493 -------- .../publicapi/models/SourceMetadataV1.java | 79 +- .../models/SourceSettingsOutputV1.java | 72 +- .../segment/publicapi/models/SourceV1.java | 116 +- .../com/segment/publicapi/models/Space.java | 38 +- .../models/SpaceWarehouseSchemaOverride.java | 48 +- .../SpaceWarehouseSelectiveSyncItemAlpha.java | 50 +- .../publicapi/models/StreamStatusV1.java | 48 +- .../publicapi/models/Subscription.java | 504 -------- .../publicapi/models/SupportedFeatures.java | 469 -------- .../publicapi/models/SupportedMethods.java | 311 ----- .../publicapi/models/SupportedPlatforms.java | 257 ---- .../publicapi/models/SuppressedInner.java | 38 +- .../publicapi/models/SyncNoticeV1.java | 40 +- .../com/segment/publicapi/models/SyncV1.java | 65 +- .../com/segment/publicapi/models/Track.java | 411 ------- .../models/TrackSourceSettingsV1.java | 49 +- .../publicapi/models/TrackingPlan.java | 496 -------- .../publicapi/models/TrackingPlan1.java | 496 -------- .../publicapi/models/TrackingPlanV1.java | 51 +- .../publicapi/models/Transformation.java | 569 --------- .../publicapi/models/Transformation1.java | 570 --------- .../publicapi/models/Transformation2.java | 570 --------- .../publicapi/models/Transformation3.java | 629 ---------- .../publicapi/models/Transformation4.java | 629 ---------- .../publicapi/models/Transformation5.java | 629 ---------- .../publicapi/models/TransformationBeta.java | 74 +- .../publicapi/models/TransformationV1.java | 86 +- .../UpdateAudienceForSpace200Response.java | 34 +- .../UpdateAudienceForSpaceAlphaOutput.java | 46 +- .../models/UpdateAudienceForSpaceInput.java | 37 +- ...pdateComputedTraitForSpace200Response.java | 34 +- ...UpdateComputedTraitForSpaceAlphaInput.java | 36 +- ...pdateComputedTraitForSpaceAlphaOutput.java | 47 +- .../models/UpdateDestination200Response.java | 34 +- .../models/UpdateDestinationV1Input.java | 42 +- .../models/UpdateDestinationV1Output.java | 46 +- ...UpdateFilterForDestination200Response.java | 34 +- .../UpdateFilterForDestinationV1Input.java | 44 +- .../UpdateFilterForDestinationV1Output.java | 46 +- .../models/UpdateFunction200Response.java | 34 +- .../models/UpdateFunctionV1Input.java | 44 +- .../models/UpdateFunctionV1Output.java | 46 +- ...UpdateGroupSubscriptionStatusResponse.java | 38 +- ...dateInsertFunctionInstance200Response.java | 34 +- ...pdateInsertFunctionInstanceAlphaInput.java | 45 +- ...dateInsertFunctionInstanceAlphaOutput.java | 46 +- ...WarehouseForSpaceWarehouse200Response.java | 35 +- ...sWarehouseForSpaceWarehouseAlphaInput.java | 76 +- ...WarehouseForSpaceWarehouseAlphaOutput.java | 46 +- .../UpdateReverseEtlModel200Response.java | 34 +- .../models/UpdateReverseEtlModelInput.java | 89 +- .../models/UpdateReverseEtlModelOutput.java | 39 +- .../UpdateRulesInTrackingPlan200Response.java | 34 +- .../UpdateRulesInTrackingPlanV1Input.java | 44 +- .../UpdateRulesInTrackingPlanV1Output.java | 36 +- ...dateSchemaSettingsInSource200Response.java | 34 +- .../UpdateSchemaSettingsInSourceV1Input.java | 72 +- .../UpdateSchemaSettingsInSourceV1Output.java | 51 +- ...eSelectiveSyncForWarehouse200Response.java | 34 +- ...veSyncForWarehouseAndSpace200Response.java | 35 +- ...iveSyncForWarehouseAndSpaceAlphaInput.java | 46 +- ...veSyncForWarehouseAndSpaceAlphaOutput.java | 36 +- ...pdateSelectiveSyncForWarehouseV1Input.java | 46 +- ...dateSelectiveSyncForWarehouseV1Output.java | 40 +- .../models/UpdateSource200Response.java | 34 +- .../models/UpdateSource200Response1.java | 34 +- .../models/UpdateSourceAlphaInput.java | 87 +- .../models/UpdateSourceAlphaOutput.java | 46 +- .../publicapi/models/UpdateSourceV1Input.java | 87 +- .../models/UpdateSourceV1Output.java | 46 +- ...SubscriptionForDestination200Response.java | 34 +- ...eSubscriptionForDestinationAlphaInput.java | 47 +- ...SubscriptionForDestinationAlphaOutput.java | 47 +- .../models/UpdateTrackingPlan200Response.java | 34 +- .../models/UpdateTrackingPlanV1Input.java | 33 +- .../models/UpdateTrackingPlanV1Output.java | 36 +- .../UpdateTransformation200Response.java | 34 +- .../models/UpdateTransformationBetaInput.java | 73 +- .../UpdateTransformationBetaOutput.java | 46 +- .../models/UpdateTransformationV1Input.java | 82 +- .../models/UpdateTransformationV1Output.java | 46 +- .../models/UpdateUserGroup200Response.java | 34 +- .../models/UpdateUserGroupV1Input.java | 36 +- .../models/UpdateUserGroupV1Output.java | 46 +- .../models/UpdateWarehouse200Response.java | 34 +- .../models/UpdateWarehouseV1Input.java | 70 +- .../models/UpdateWarehouseV1Output.java | 46 +- .../publicapi/models/UpsertRuleV1.java | 38 +- .../com/segment/publicapi/models/User.java | 339 ------ .../segment/publicapi/models/UserGroup.java | 331 ----- .../segment/publicapi/models/UserGroup1.java | 331 ----- .../segment/publicapi/models/UserGroup2.java | 331 ----- .../segment/publicapi/models/UserGroup3.java | 331 ----- .../segment/publicapi/models/UserGroupV1.java | 47 +- .../com/segment/publicapi/models/UserV1.java | 49 +- .../models/UsersPerSourceSnapshotV1.java | 60 +- .../com/segment/publicapi/models/Version.java | 44 +- .../segment/publicapi/models/Version1.java | 424 ------- .../segment/publicapi/models/Warehouse.java | 344 ------ .../segment/publicapi/models/Warehouse1.java | 344 ------ .../segment/publicapi/models/Warehouse2.java | 344 ------ .../models/WarehouseAdvancedSyncV1.java | 39 +- .../publicapi/models/WarehouseMetadata.java | 400 ------ .../publicapi/models/WarehouseMetadataV1.java | 59 +- .../models/WarehouseSelectiveSyncItemV1.java | 48 +- .../models/WarehouseSyncOverrideV1.java | 42 +- .../segment/publicapi/models/WarehouseV1.java | 76 +- .../segment/publicapi/models/Workspace.java | 284 ----- .../segment/publicapi/models/WorkspaceV1.java | 38 +- .../segment/publicapi/api/EchoApiTest.java | 1 - 610 files changed, 11051 insertions(+), 44450 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/Audience.java delete mode 100644 src/main/java/com/segment/publicapi/models/ComputedTrait.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java delete mode 100644 src/main/java/com/segment/publicapi/models/Destination.java delete mode 100644 src/main/java/com/segment/publicapi/models/Destination1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Destination2.java delete mode 100644 src/main/java/com/segment/publicapi/models/DestinationMetadata.java delete mode 100644 src/main/java/com/segment/publicapi/models/EdgeFunctions.java delete mode 100644 src/main/java/com/segment/publicapi/models/EdgeFunctions1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Filter.java delete mode 100644 src/main/java/com/segment/publicapi/models/Filter1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Filter2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Filter3.java delete mode 100644 src/main/java/com/segment/publicapi/models/Function1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Function2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Group.java delete mode 100644 src/main/java/com/segment/publicapi/models/Identify.java delete mode 100644 src/main/java/com/segment/publicapi/models/Input.java delete mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java delete mode 100644 src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Label.java delete mode 100644 src/main/java/com/segment/publicapi/models/Label1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Logos.java delete mode 100644 src/main/java/com/segment/publicapi/models/Logos1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Logos2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Metadata.java delete mode 100644 src/main/java/com/segment/publicapi/models/Metadata1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Metadata2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Pagination.java delete mode 100644 src/main/java/com/segment/publicapi/models/Pagination1.java delete mode 100644 src/main/java/com/segment/publicapi/models/ProfilesWarehouse.java delete mode 100644 src/main/java/com/segment/publicapi/models/ProfilesWarehouse1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Query.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlModel1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Schedule.java delete mode 100644 src/main/java/com/segment/publicapi/models/Schedule1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Schedule2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Settings.java delete mode 100644 src/main/java/com/segment/publicapi/models/Settings1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source3.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source4.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source5.java delete mode 100644 src/main/java/com/segment/publicapi/models/Source6.java delete mode 100644 src/main/java/com/segment/publicapi/models/SourceMetadata.java delete mode 100644 src/main/java/com/segment/publicapi/models/Subscription.java delete mode 100644 src/main/java/com/segment/publicapi/models/SupportedFeatures.java delete mode 100644 src/main/java/com/segment/publicapi/models/SupportedMethods.java delete mode 100644 src/main/java/com/segment/publicapi/models/SupportedPlatforms.java delete mode 100644 src/main/java/com/segment/publicapi/models/Track.java delete mode 100644 src/main/java/com/segment/publicapi/models/TrackingPlan.java delete mode 100644 src/main/java/com/segment/publicapi/models/TrackingPlan1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation2.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation3.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation4.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transformation5.java delete mode 100644 src/main/java/com/segment/publicapi/models/User.java delete mode 100644 src/main/java/com/segment/publicapi/models/UserGroup.java delete mode 100644 src/main/java/com/segment/publicapi/models/UserGroup1.java delete mode 100644 src/main/java/com/segment/publicapi/models/UserGroup2.java delete mode 100644 src/main/java/com/segment/publicapi/models/UserGroup3.java delete mode 100644 src/main/java/com/segment/publicapi/models/Version1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Warehouse.java delete mode 100644 src/main/java/com/segment/publicapi/models/Warehouse1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Warehouse2.java delete mode 100644 src/main/java/com/segment/publicapi/models/WarehouseMetadata.java delete mode 100644 src/main/java/com/segment/publicapi/models/Workspace.java diff --git a/README.md b/README.md index 6ecc4cc9..867274d6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 36.2.0 +Latest API and SDK version: 36.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 36.2.0 + 36.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:36.2.0" + implementation "com.segment.publicapi:segment-publicapi:36.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-36.2.0.jar` +* `target/segment-publicapi-36.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! @@ -87,7 +87,7 @@ public class Example { ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); String period = "2021-02-01"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in v1. - PaginationInput pagination = new HashMap(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. + PaginationInput pagination = new PaginationInput(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. // Make an API call without Pagination try { diff --git a/pom.xml b/pom.xml index b925423e..5fe3ca74 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 36.2.0 + 36.3.0 https://segment.com/docs/api/public-api/ Segment Public API @@ -226,7 +226,7 @@ - 1.15.0 + 1.18.0 true @@ -366,6 +366,6 @@ 2.1.1 1.1.1 UTF-8 - 2.27.2 + 2.40.0 diff --git a/src/main/java/com/segment/publicapi/ApiCallback.java b/src/main/java/com/segment/publicapi/ApiCallback.java index db3c5648..cb1f988c 100644 --- a/src/main/java/com/segment/publicapi/ApiCallback.java +++ b/src/main/java/com/segment/publicapi/ApiCallback.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.util.List; import java.util.Map; diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 1d2f0beb..c6650bfb 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import com.segment.publicapi.auth.ApiKeyAuth; import com.segment.publicapi.auth.Authentication; import com.segment.publicapi.auth.HttpBasicAuth; @@ -124,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 36.2.0 (Java)"); + setUserAgent("Public API SDK 36.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/ApiException.java b/src/main/java/com/segment/publicapi/ApiException.java index 3957eb2d..eeacf735 100644 --- a/src/main/java/com/segment/publicapi/ApiException.java +++ b/src/main/java/com/segment/publicapi/ApiException.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.util.List; import java.util.Map; @@ -104,7 +103,12 @@ public ApiException( * @param responseBody the response body */ public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this( + "Response Code: " + code + " Response Body: " + responseBody, + (Throwable) null, + code, + responseHeaders, + responseBody); } /** diff --git a/src/main/java/com/segment/publicapi/ApiResponse.java b/src/main/java/com/segment/publicapi/ApiResponse.java index 00009055..f2da2ac8 100644 --- a/src/main/java/com/segment/publicapi/ApiResponse.java +++ b/src/main/java/com/segment/publicapi/ApiResponse.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.util.List; import java.util.Map; diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ccfab24f..20bbf64d 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,6 +12,8 @@ package com.segment.publicapi; public class Configuration { + public static final String VERSION = "36.3.0"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java index 299cc535..657dfa59 100644 --- a/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java +++ b/src/main/java/com/segment/publicapi/GzipRequestInterceptor.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.io.IOException; import okhttp3.*; import okio.Buffer; diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 2fae8286..82218497 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; @@ -164,8 +163,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Audience.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -183,8 +180,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ComputedTrait.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ComputedTraitSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -457,24 +452,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteWarehouseV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeliveryMetricsSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryMetricsSummaryBeta .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Destination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Destination1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Destination2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationFilterActionV1 .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationFilterV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DestinationMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationMetadataActionFieldV1 .CustomTypeAdapterFactory()); @@ -522,30 +507,14 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EchoAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EdgeFunctions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EdgeFunctions1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Filter1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Filter2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Filter3.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Function.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Function1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Function2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -750,8 +719,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetWorkspaceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Group.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GroupSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -764,18 +731,9 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.HandleWebhookInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.HandleWebhookOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Identify.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.IdentifySourceSettingsV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Input.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.InsertFunctionInstance.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.InsertFunctionInstance1 - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.InsertFunctionInstanceAlpha .CustomTypeAdapterFactory()); @@ -785,10 +743,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.InvitePermissionV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.InviteV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Label.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Label1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1032,12 +986,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListWorkspaceRegulationsV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Logos.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Logos1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Logos2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LogosBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1049,12 +997,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.MessagesSubscriptionRequest .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Metadata.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Metadata1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Metadata2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.MetricBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1063,10 +1005,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.MinimalUserV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.MtuSnapshotV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Pagination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Pagination1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1089,10 +1027,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilterV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ProfilesWarehouse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ProfilesWarehouse1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ProfilesWarehouseAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1105,8 +1039,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Query.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1256,38 +1188,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseEtlModel1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Schedule.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Schedule1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Schedule2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Settings.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Settings1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source4.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source5.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Source6.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); @@ -1298,8 +1204,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceEventVolumeV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.SourceMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceMetadataV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1316,42 +1220,16 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Subscription.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.SupportedFeatures.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.SupportedMethods.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.SupportedPlatforms.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SuppressedInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SyncNoticeV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SyncV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Track.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TrackSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TrackingPlan.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TrackingPlan1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TrackingPlanV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation3.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation4.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transformation5.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1531,16 +1409,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpsertRuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.User.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UserGroup.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UserGroup1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UserGroup2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UserGroup3.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UserGroupV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1550,19 +1418,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Version.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Version1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Warehouse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Warehouse1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Warehouse2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.WarehouseAdvancedSyncV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.WarehouseMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.WarehouseMetadataV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1573,8 +1431,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.WarehouseV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Workspace.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.WorkspaceV1.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); diff --git a/src/main/java/com/segment/publicapi/ProgressRequestBody.java b/src/main/java/com/segment/publicapi/ProgressRequestBody.java index 23559aa2..b8d01658 100644 --- a/src/main/java/com/segment/publicapi/ProgressRequestBody.java +++ b/src/main/java/com/segment/publicapi/ProgressRequestBody.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.io.IOException; import okhttp3.MediaType; import okhttp3.RequestBody; diff --git a/src/main/java/com/segment/publicapi/ProgressResponseBody.java b/src/main/java/com/segment/publicapi/ProgressResponseBody.java index 046276c6..74a488e6 100644 --- a/src/main/java/com/segment/publicapi/ProgressResponseBody.java +++ b/src/main/java/com/segment/publicapi/ProgressResponseBody.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.io.IOException; import okhttp3.MediaType; import okhttp3.ResponseBody; diff --git a/src/main/java/com/segment/publicapi/ServerConfiguration.java b/src/main/java/com/segment/publicapi/ServerConfiguration.java index 743d66b7..33dcb234 100644 --- a/src/main/java/com/segment/publicapi/ServerConfiguration.java +++ b/src/main/java/com/segment/publicapi/ServerConfiguration.java @@ -1,6 +1,5 @@ package com.segment.publicapi; - import java.util.Map; /** Representing a Server configuration. */ @@ -49,7 +48,7 @@ public String URL(Map variables) { + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/src/main/java/com/segment/publicapi/ServerVariable.java b/src/main/java/com/segment/publicapi/ServerVariable.java index b630232f..4335b8b0 100644 --- a/src/main/java/com/segment/publicapi/ServerVariable.java +++ b/src/main/java/com/segment/publicapi/ServerVariable.java @@ -1,6 +1,5 @@ package com.segment.publicapi; - import java.util.HashSet; /** Representing a Server Variable for server URL template substitution. */ diff --git a/src/main/java/com/segment/publicapi/StringUtil.java b/src/main/java/com/segment/publicapi/StringUtil.java index 5bbb1bf5..d9ecccc2 100644 --- a/src/main/java/com/segment/publicapi/StringUtil.java +++ b/src/main/java/com/segment/publicapi/StringUtil.java @@ -11,7 +11,6 @@ package com.segment.publicapi; - import java.util.Collection; import java.util.Iterator; diff --git a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java index 07b2e8a4..c3c432c1 100644 --- a/src/main/java/com/segment/publicapi/api/ApiCallsApi.java +++ b/src/main/java/com/segment/publicapi/api/ApiCallsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -131,7 +130,6 @@ public okhttp3.Call getDailyPerSourceAPICallsUsageCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -157,7 +155,6 @@ public okhttp3.Call getDailyPerSourceAPICallsUsageCall( private okhttp3.Call getDailyPerSourceAPICallsUsageValidateBeforeCall( String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'period' is set if (period == null) { throw new ApiException( @@ -172,9 +169,7 @@ private okhttp3.Call getDailyPerSourceAPICallsUsageValidateBeforeCall( + " getDailyPerSourceAPICallsUsage(Async)"); } - okhttp3.Call localVarCall = - getDailyPerSourceAPICallsUsageCall(period, pagination, _callback); - return localVarCall; + return getDailyPerSourceAPICallsUsageCall(period, pagination, _callback); } /** @@ -268,6 +263,7 @@ public okhttp3.Call getDailyPerSourceAPICallsUsageAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getDailyWorkspaceAPICallsUsage * @@ -334,7 +330,6 @@ public okhttp3.Call getDailyWorkspaceAPICallsUsageCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -360,7 +355,6 @@ public okhttp3.Call getDailyWorkspaceAPICallsUsageCall( private okhttp3.Call getDailyWorkspaceAPICallsUsageValidateBeforeCall( String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'period' is set if (period == null) { throw new ApiException( @@ -375,9 +369,7 @@ private okhttp3.Call getDailyWorkspaceAPICallsUsageValidateBeforeCall( + " getDailyWorkspaceAPICallsUsage(Async)"); } - okhttp3.Call localVarCall = - getDailyWorkspaceAPICallsUsageCall(period, pagination, _callback); - return localVarCall; + return getDailyWorkspaceAPICallsUsageCall(period, pagination, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index f4e92d61..791bef52 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -105,12 +104,10 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback // create path and map variables String localVarPath = "/spaces/{spaceId}/audiences/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -127,7 +124,6 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -152,7 +148,6 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call getAudienceValidateBeforeCall( String spaceId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -165,8 +160,7 @@ private okhttp3.Call getAudienceValidateBeforeCall( "Missing the required parameter 'id' when calling getAudience(Async)"); } - okhttp3.Call localVarCall = getAudienceCall(spaceId, id, _callback); - return localVarCall; + return getAudienceCall(spaceId, id, _callback); } /** @@ -263,6 +257,7 @@ public okhttp3.Call getAudienceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listAudiences * @@ -302,8 +297,8 @@ public okhttp3.Call listAudiencesCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/audiences" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -325,7 +320,6 @@ public okhttp3.Call listAudiencesCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -351,7 +345,6 @@ public okhttp3.Call listAudiencesCall( private okhttp3.Call listAudiencesValidateBeforeCall( String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -365,8 +358,7 @@ private okhttp3.Call listAudiencesValidateBeforeCall( + " listAudiences(Async)"); } - okhttp3.Call localVarCall = listAudiencesCall(spaceId, pagination, _callback); - return localVarCall; + return listAudiencesCall(spaceId, pagination, _callback); } /** @@ -470,6 +462,7 @@ public okhttp3.Call listAudiencesAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeAudienceFromSpace * @@ -507,12 +500,10 @@ public okhttp3.Call removeAudienceFromSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/audiences/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -529,7 +520,6 @@ public okhttp3.Call removeAudienceFromSpaceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -554,7 +544,6 @@ public okhttp3.Call removeAudienceFromSpaceCall( @SuppressWarnings("rawtypes") private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( String spaceId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -569,8 +558,7 @@ private okhttp3.Call removeAudienceFromSpaceValidateBeforeCall( + " removeAudienceFromSpace(Async)"); } - okhttp3.Call localVarCall = removeAudienceFromSpaceCall(spaceId, id, _callback); - return localVarCall; + return removeAudienceFromSpaceCall(spaceId, id, _callback); } /** @@ -676,6 +664,7 @@ public okhttp3.Call removeAudienceFromSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateAudienceForSpace * @@ -718,12 +707,10 @@ public okhttp3.Call updateAudienceForSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/audiences/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -768,7 +755,6 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( UpdateAudienceForSpaceInput updateAudienceForSpaceInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -790,9 +776,7 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( + " updateAudienceForSpace(Async)"); } - okhttp3.Call localVarCall = - updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceInput, _callback); - return localVarCall; + return updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java index 2ae48890..668feef5 100644 --- a/src/main/java/com/segment/publicapi/api/AuditTrailApi.java +++ b/src/main/java/com/segment/publicapi/api/AuditTrailApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -154,7 +153,6 @@ public okhttp3.Call listAuditEventsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -185,7 +183,6 @@ private okhttp3.Call listAuditEventsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -193,10 +190,8 @@ private okhttp3.Call listAuditEventsValidateBeforeCall( + " listAuditEvents(Async)"); } - okhttp3.Call localVarCall = - listAuditEventsCall( - startTime, endTime, resourceId, resourceType, pagination, _callback); - return localVarCall; + return listAuditEventsCall( + startTime, endTime, resourceId, resourceType, pagination, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/CatalogApi.java b/src/main/java/com/segment/publicapi/api/CatalogApi.java index 3420f385..8d1dc475 100644 --- a/src/main/java/com/segment/publicapi/api/CatalogApi.java +++ b/src/main/java/com/segment/publicapi/api/CatalogApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -105,8 +104,8 @@ public okhttp3.Call getDestinationMetadataCall( // create path and map variables String localVarPath = "/catalog/destinations/{destinationMetadataId}" - .replaceAll( - "\\{" + "destinationMetadataId" + "\\}", + .replace( + "{" + "destinationMetadataId" + "}", localVarApiClient.escapeString(destinationMetadataId.toString())); List localVarQueryParams = new ArrayList(); @@ -127,7 +126,6 @@ public okhttp3.Call getDestinationMetadataCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -152,7 +150,6 @@ public okhttp3.Call getDestinationMetadataCall( @SuppressWarnings("rawtypes") private okhttp3.Call getDestinationMetadataValidateBeforeCall( String destinationMetadataId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationMetadataId' is set if (destinationMetadataId == null) { throw new ApiException( @@ -160,8 +157,7 @@ private okhttp3.Call getDestinationMetadataValidateBeforeCall( + " getDestinationMetadata(Async)"); } - okhttp3.Call localVarCall = getDestinationMetadataCall(destinationMetadataId, _callback); - return localVarCall; + return getDestinationMetadataCall(destinationMetadataId, _callback); } /** @@ -239,6 +235,7 @@ public okhttp3.Call getDestinationMetadataAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getDestinationsCatalog * @@ -298,7 +295,6 @@ public okhttp3.Call getDestinationsCatalogCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -323,7 +319,6 @@ public okhttp3.Call getDestinationsCatalogCall( @SuppressWarnings("rawtypes") private okhttp3.Call getDestinationsCatalogValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -331,8 +326,7 @@ private okhttp3.Call getDestinationsCatalogValidateBeforeCall( + " getDestinationsCatalog(Async)"); } - okhttp3.Call localVarCall = getDestinationsCatalogCall(pagination, _callback); - return localVarCall; + return getDestinationsCatalogCall(pagination, _callback); } /** @@ -412,6 +406,7 @@ public okhttp3.Call getDestinationsCatalogAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getSourceMetadata * @@ -448,8 +443,8 @@ public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCall // create path and map variables String localVarPath = "/catalog/sources/{sourceMetadataId}" - .replaceAll( - "\\{" + "sourceMetadataId" + "\\}", + .replace( + "{" + "sourceMetadataId" + "}", localVarApiClient.escapeString(sourceMetadataId.toString())); List localVarQueryParams = new ArrayList(); @@ -470,7 +465,6 @@ public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCall } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -495,7 +489,6 @@ public okhttp3.Call getSourceMetadataCall(String sourceMetadataId, final ApiCall @SuppressWarnings("rawtypes") private okhttp3.Call getSourceMetadataValidateBeforeCall( String sourceMetadataId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceMetadataId' is set if (sourceMetadataId == null) { throw new ApiException( @@ -503,8 +496,7 @@ private okhttp3.Call getSourceMetadataValidateBeforeCall( + " getSourceMetadata(Async)"); } - okhttp3.Call localVarCall = getSourceMetadataCall(sourceMetadataId, _callback); - return localVarCall; + return getSourceMetadataCall(sourceMetadataId, _callback); } /** @@ -580,6 +572,7 @@ public okhttp3.Call getSourceMetadataAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getSourcesCatalog * @@ -638,7 +631,6 @@ public okhttp3.Call getSourcesCatalogCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -663,7 +655,6 @@ public okhttp3.Call getSourcesCatalogCall( @SuppressWarnings("rawtypes") private okhttp3.Call getSourcesCatalogValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -671,8 +662,7 @@ private okhttp3.Call getSourcesCatalogValidateBeforeCall( + " getSourcesCatalog(Async)"); } - okhttp3.Call localVarCall = getSourcesCatalogCall(pagination, _callback); - return localVarCall; + return getSourcesCatalogCall(pagination, _callback); } /** @@ -748,6 +738,7 @@ public okhttp3.Call getSourcesCatalogAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getWarehouseMetadata * @@ -784,8 +775,8 @@ public okhttp3.Call getWarehouseMetadataCall( // create path and map variables String localVarPath = "/catalog/warehouses/{warehouseMetadataId}" - .replaceAll( - "\\{" + "warehouseMetadataId" + "\\}", + .replace( + "{" + "warehouseMetadataId" + "}", localVarApiClient.escapeString(warehouseMetadataId.toString())); List localVarQueryParams = new ArrayList(); @@ -806,7 +797,6 @@ public okhttp3.Call getWarehouseMetadataCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -831,7 +821,6 @@ public okhttp3.Call getWarehouseMetadataCall( @SuppressWarnings("rawtypes") private okhttp3.Call getWarehouseMetadataValidateBeforeCall( String warehouseMetadataId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseMetadataId' is set if (warehouseMetadataId == null) { throw new ApiException( @@ -839,8 +828,7 @@ private okhttp3.Call getWarehouseMetadataValidateBeforeCall( + " getWarehouseMetadata(Async)"); } - okhttp3.Call localVarCall = getWarehouseMetadataCall(warehouseMetadataId, _callback); - return localVarCall; + return getWarehouseMetadataCall(warehouseMetadataId, _callback); } /** @@ -918,6 +906,7 @@ public okhttp3.Call getWarehouseMetadataAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getWarehousesCatalog * @@ -977,7 +966,6 @@ public okhttp3.Call getWarehousesCatalogCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1002,7 +990,6 @@ public okhttp3.Call getWarehousesCatalogCall( @SuppressWarnings("rawtypes") private okhttp3.Call getWarehousesCatalogValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1010,8 +997,7 @@ private okhttp3.Call getWarehousesCatalogValidateBeforeCall( + " getWarehousesCatalog(Async)"); } - okhttp3.Call localVarCall = getWarehousesCatalogCall(pagination, _callback); - return localVarCall; + return getWarehousesCatalogCall(pagination, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java index 7909ad29..9cef2557 100644 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -105,12 +104,10 @@ public okhttp3.Call getComputedTraitCall(String spaceId, String id, final ApiCal // create path and map variables String localVarPath = "/spaces/{spaceId}/computed-traits/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -127,7 +124,6 @@ public okhttp3.Call getComputedTraitCall(String spaceId, String id, final ApiCal } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -152,7 +148,6 @@ public okhttp3.Call getComputedTraitCall(String spaceId, String id, final ApiCal @SuppressWarnings("rawtypes") private okhttp3.Call getComputedTraitValidateBeforeCall( String spaceId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -166,8 +161,7 @@ private okhttp3.Call getComputedTraitValidateBeforeCall( "Missing the required parameter 'id' when calling getComputedTrait(Async)"); } - okhttp3.Call localVarCall = getComputedTraitCall(spaceId, id, _callback); - return localVarCall; + return getComputedTraitCall(spaceId, id, _callback); } /** @@ -266,6 +260,7 @@ public okhttp3.Call getComputedTraitAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listComputedTraits * @@ -305,8 +300,8 @@ public okhttp3.Call listComputedTraitsCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/computed-traits" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -328,7 +323,6 @@ public okhttp3.Call listComputedTraitsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -354,7 +348,6 @@ public okhttp3.Call listComputedTraitsCall( private okhttp3.Call listComputedTraitsValidateBeforeCall( String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -369,8 +362,7 @@ private okhttp3.Call listComputedTraitsValidateBeforeCall( + " listComputedTraits(Async)"); } - okhttp3.Call localVarCall = listComputedTraitsCall(spaceId, pagination, _callback); - return localVarCall; + return listComputedTraitsCall(spaceId, pagination, _callback); } /** @@ -475,6 +467,7 @@ public okhttp3.Call listComputedTraitsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeComputedTraitFromSpace * @@ -512,12 +505,10 @@ public okhttp3.Call removeComputedTraitFromSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/computed-traits/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -534,7 +525,6 @@ public okhttp3.Call removeComputedTraitFromSpaceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -559,7 +549,6 @@ public okhttp3.Call removeComputedTraitFromSpaceCall( @SuppressWarnings("rawtypes") private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( String spaceId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -574,8 +563,7 @@ private okhttp3.Call removeComputedTraitFromSpaceValidateBeforeCall( + " removeComputedTraitFromSpace(Async)"); } - okhttp3.Call localVarCall = removeComputedTraitFromSpaceCall(spaceId, id, _callback); - return localVarCall; + return removeComputedTraitFromSpaceCall(spaceId, id, _callback); } /** @@ -685,6 +673,7 @@ public okhttp3.Call removeComputedTraitFromSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateComputedTraitForSpace * @@ -727,12 +716,10 @@ public okhttp3.Call updateComputedTraitForSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/computed-traits/{id}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -777,7 +764,6 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( UpdateComputedTraitForSpaceAlphaInput updateComputedTraitForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -799,10 +785,8 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( + " calling updateComputedTraitForSpace(Async)"); } - okhttp3.Call localVarCall = - updateComputedTraitForSpaceCall( - spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); - return localVarCall; + return updateComputedTraitForSpaceCall( + spaceId, id, updateComputedTraitForSpaceAlphaInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index f6965605..67ffae85 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -114,8 +113,8 @@ public okhttp3.Call createCloudSourceRegulationCall( // create path and map variables String localVarPath = "/regulations/cloudsources/{sourceId}" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -167,7 +166,6 @@ private okhttp3.Call createCloudSourceRegulationValidateBeforeCall( CreateCloudSourceRegulationV1Input createCloudSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -182,10 +180,8 @@ private okhttp3.Call createCloudSourceRegulationValidateBeforeCall( + " calling createCloudSourceRegulation(Async)"); } - okhttp3.Call localVarCall = - createCloudSourceRegulationCall( - sourceId, createCloudSourceRegulationV1Input, _callback); - return localVarCall; + return createCloudSourceRegulationCall( + sourceId, createCloudSourceRegulationV1Input, _callback); } /** @@ -279,6 +275,7 @@ public okhttp3.Call createCloudSourceRegulationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createSourceRegulation * @@ -319,8 +316,8 @@ public okhttp3.Call createSourceRegulationCall( // create path and map variables String localVarPath = "/regulations/sources/{sourceId}" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -372,7 +369,6 @@ private okhttp3.Call createSourceRegulationValidateBeforeCall( CreateSourceRegulationV1Input createSourceRegulationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -387,9 +383,7 @@ private okhttp3.Call createSourceRegulationValidateBeforeCall( + " createSourceRegulation(Async)"); } - okhttp3.Call localVarCall = - createSourceRegulationCall(sourceId, createSourceRegulationV1Input, _callback); - return localVarCall; + return createSourceRegulationCall(sourceId, createSourceRegulationV1Input, _callback); } /** @@ -484,6 +478,7 @@ public okhttp3.Call createSourceRegulationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createWorkspaceRegulation * @@ -570,7 +565,6 @@ private okhttp3.Call createWorkspaceRegulationValidateBeforeCall( CreateWorkspaceRegulationV1Input createWorkspaceRegulationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createWorkspaceRegulationV1Input' is set if (createWorkspaceRegulationV1Input == null) { throw new ApiException( @@ -578,9 +572,7 @@ private okhttp3.Call createWorkspaceRegulationValidateBeforeCall( + " createWorkspaceRegulation(Async)"); } - okhttp3.Call localVarCall = - createWorkspaceRegulationCall(createWorkspaceRegulationV1Input, _callback); - return localVarCall; + return createWorkspaceRegulationCall(createWorkspaceRegulationV1Input, _callback); } /** @@ -670,6 +662,7 @@ public okhttp3.Call createWorkspaceRegulationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteRegulation * @@ -706,8 +699,8 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c // create path and map variables String localVarPath = "/regulations/{regulateId}" - .replaceAll( - "\\{" + "regulateId" + "\\}", + .replace( + "{" + "regulateId" + "}", localVarApiClient.escapeString(regulateId.toString())); List localVarQueryParams = new ArrayList(); @@ -728,7 +721,6 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -753,7 +745,6 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'regulateId' is set if (regulateId == null) { throw new ApiException( @@ -761,8 +752,7 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( + " deleteRegulation(Async)"); } - okhttp3.Call localVarCall = deleteRegulationCall(regulateId, _callback); - return localVarCall; + return deleteRegulationCall(regulateId, _callback); } /** @@ -842,6 +832,7 @@ public okhttp3.Call deleteRegulationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getRegulation * @@ -878,8 +869,8 @@ public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _call // create path and map variables String localVarPath = "/regulations/{regulateId}" - .replaceAll( - "\\{" + "regulateId" + "\\}", + .replace( + "{" + "regulateId" + "}", localVarApiClient.escapeString(regulateId.toString())); List localVarQueryParams = new ArrayList(); @@ -900,7 +891,6 @@ public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _call } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -925,7 +915,6 @@ public okhttp3.Call getRegulationCall(String regulateId, final ApiCallback _call @SuppressWarnings("rawtypes") private okhttp3.Call getRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'regulateId' is set if (regulateId == null) { throw new ApiException( @@ -933,8 +922,7 @@ private okhttp3.Call getRegulationValidateBeforeCall( + " getRegulation(Async)"); } - okhttp3.Call localVarCall = getRegulationCall(regulateId, _callback); - return localVarCall; + return getRegulationCall(regulateId, _callback); } /** @@ -1010,6 +998,7 @@ public okhttp3.Call getRegulationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listRegulationsFromSource * @@ -1056,8 +1045,8 @@ public okhttp3.Call listRegulationsFromSourceCall( // create path and map variables String localVarPath = "/regulations/sources/{sourceId}" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -1091,7 +1080,6 @@ public okhttp3.Call listRegulationsFromSourceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1121,7 +1109,6 @@ private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -1136,10 +1123,8 @@ private okhttp3.Call listRegulationsFromSourceValidateBeforeCall( + " listRegulationsFromSource(Async)"); } - okhttp3.Call localVarCall = - listRegulationsFromSourceCall( - sourceId, status, regulationTypes, pagination, _callback); - return localVarCall; + return listRegulationsFromSourceCall( + sourceId, status, regulationTypes, pagination, _callback); } /** @@ -1248,6 +1233,7 @@ public okhttp3.Call listRegulationsFromSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSuppressions * @@ -1306,7 +1292,6 @@ public okhttp3.Call listSuppressionsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1331,7 +1316,6 @@ public okhttp3.Call listSuppressionsCall( @SuppressWarnings("rawtypes") private okhttp3.Call listSuppressionsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1339,8 +1323,7 @@ private okhttp3.Call listSuppressionsValidateBeforeCall( + " listSuppressions(Async)"); } - okhttp3.Call localVarCall = listSuppressionsCall(pagination, _callback); - return localVarCall; + return listSuppressionsCall(pagination, _callback); } /** @@ -1415,6 +1398,7 @@ public okhttp3.Call listSuppressionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listWorkspaceRegulations * @@ -1490,7 +1474,6 @@ public okhttp3.Call listWorkspaceRegulationsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1519,7 +1502,6 @@ private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1527,9 +1509,7 @@ private okhttp3.Call listWorkspaceRegulationsValidateBeforeCall( + " listWorkspaceRegulations(Async)"); } - okhttp3.Call localVarCall = - listWorkspaceRegulationsCall(status, regulationTypes, pagination, _callback); - return localVarCall; + return listWorkspaceRegulationsCall(status, regulationTypes, pagination, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java index b984711b..94f7f88f 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationFiltersApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -112,8 +111,8 @@ public okhttp3.Call createFilterForDestinationCall( // create path and map variables String localVarPath = "/destination/{destinationId}/filters" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -165,7 +164,6 @@ private okhttp3.Call createFilterForDestinationValidateBeforeCall( CreateFilterForDestinationV1Input createFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -180,10 +178,8 @@ private okhttp3.Call createFilterForDestinationValidateBeforeCall( + " calling createFilterForDestination(Async)"); } - okhttp3.Call localVarCall = - createFilterForDestinationCall( - destinationId, createFilterForDestinationV1Input, _callback); - return localVarCall; + return createFilterForDestinationCall( + destinationId, createFilterForDestinationV1Input, _callback); } /** @@ -281,6 +277,7 @@ public okhttp3.Call createFilterForDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getFilterInDestination * @@ -319,11 +316,11 @@ public okhttp3.Call getFilterInDestinationCall( // create path and map variables String localVarPath = "/destination/{destinationId}/filters/{filterId}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll( - "\\{" + "filterId" + "\\}", + .replace( + "{" + "filterId" + "}", localVarApiClient.escapeString(filterId.toString())); List localVarQueryParams = new ArrayList(); @@ -344,7 +341,6 @@ public okhttp3.Call getFilterInDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -370,7 +366,6 @@ public okhttp3.Call getFilterInDestinationCall( private okhttp3.Call getFilterInDestinationValidateBeforeCall( String destinationId, String filterId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -385,8 +380,7 @@ private okhttp3.Call getFilterInDestinationValidateBeforeCall( + " getFilterInDestination(Async)"); } - okhttp3.Call localVarCall = getFilterInDestinationCall(destinationId, filterId, _callback); - return localVarCall; + return getFilterInDestinationCall(destinationId, filterId, _callback); } /** @@ -468,6 +462,7 @@ public okhttp3.Call getFilterInDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listFiltersFromDestination * @@ -506,8 +501,8 @@ public okhttp3.Call listFiltersFromDestinationCall( // create path and map variables String localVarPath = "/destination/{destinationId}/filters" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -532,7 +527,6 @@ public okhttp3.Call listFiltersFromDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -558,7 +552,6 @@ public okhttp3.Call listFiltersFromDestinationCall( private okhttp3.Call listFiltersFromDestinationValidateBeforeCall( String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -573,9 +566,7 @@ private okhttp3.Call listFiltersFromDestinationValidateBeforeCall( + " listFiltersFromDestination(Async)"); } - okhttp3.Call localVarCall = - listFiltersFromDestinationCall(destinationId, pagination, _callback); - return localVarCall; + return listFiltersFromDestinationCall(destinationId, pagination, _callback); } /** @@ -660,6 +651,7 @@ public okhttp3.Call listFiltersFromDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for previewDestinationFilter * @@ -746,7 +738,6 @@ private okhttp3.Call previewDestinationFilterValidateBeforeCall( PreviewDestinationFilterV1Input previewDestinationFilterV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'previewDestinationFilterV1Input' is set if (previewDestinationFilterV1Input == null) { throw new ApiException( @@ -754,9 +745,7 @@ private okhttp3.Call previewDestinationFilterValidateBeforeCall( + " previewDestinationFilter(Async)"); } - okhttp3.Call localVarCall = - previewDestinationFilterCall(previewDestinationFilterV1Input, _callback); - return localVarCall; + return previewDestinationFilterCall(previewDestinationFilterV1Input, _callback); } /** @@ -838,6 +827,7 @@ public okhttp3.Call previewDestinationFilterAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeFilterFromDestination * @@ -876,11 +866,11 @@ public okhttp3.Call removeFilterFromDestinationCall( // create path and map variables String localVarPath = "/destination/{destinationId}/filters/{filterId}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll( - "\\{" + "filterId" + "\\}", + .replace( + "{" + "filterId" + "}", localVarApiClient.escapeString(filterId.toString())); List localVarQueryParams = new ArrayList(); @@ -901,7 +891,6 @@ public okhttp3.Call removeFilterFromDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -927,7 +916,6 @@ public okhttp3.Call removeFilterFromDestinationCall( private okhttp3.Call removeFilterFromDestinationValidateBeforeCall( String destinationId, String filterId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -942,9 +930,7 @@ private okhttp3.Call removeFilterFromDestinationValidateBeforeCall( + " removeFilterFromDestination(Async)"); } - okhttp3.Call localVarCall = - removeFilterFromDestinationCall(destinationId, filterId, _callback); - return localVarCall; + return removeFilterFromDestinationCall(destinationId, filterId, _callback); } /** @@ -1035,6 +1021,7 @@ public okhttp3.Call removeFilterFromDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateFilterForDestination * @@ -1077,11 +1064,11 @@ public okhttp3.Call updateFilterForDestinationCall( // create path and map variables String localVarPath = "/destination/{destinationId}/filters/{filterId}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll( - "\\{" + "filterId" + "\\}", + .replace( + "{" + "filterId" + "}", localVarApiClient.escapeString(filterId.toString())); List localVarQueryParams = new ArrayList(); @@ -1134,7 +1121,6 @@ private okhttp3.Call updateFilterForDestinationValidateBeforeCall( UpdateFilterForDestinationV1Input updateFilterForDestinationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -1156,10 +1142,8 @@ private okhttp3.Call updateFilterForDestinationValidateBeforeCall( + " calling updateFilterForDestination(Async)"); } - okhttp3.Call localVarCall = - updateFilterForDestinationCall( - destinationId, filterId, updateFilterForDestinationV1Input, _callback); - return localVarCall; + return updateFilterForDestinationCall( + destinationId, filterId, updateFilterForDestinationV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index 8ed769f3..2b7a93a2 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -162,7 +161,6 @@ public okhttp3.Call createDestinationCall( private okhttp3.Call createDestinationValidateBeforeCall( CreateDestinationV1Input createDestinationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createDestinationV1Input' is set if (createDestinationV1Input == null) { throw new ApiException( @@ -170,8 +168,7 @@ private okhttp3.Call createDestinationValidateBeforeCall( + " createDestination(Async)"); } - okhttp3.Call localVarCall = createDestinationCall(createDestinationV1Input, _callback); - return localVarCall; + return createDestinationCall(createDestinationV1Input, _callback); } /** @@ -253,6 +250,7 @@ public okhttp3.Call createDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createDestinationSubscription * @@ -293,8 +291,8 @@ public okhttp3.Call createDestinationSubscriptionCall( // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -339,7 +337,6 @@ private okhttp3.Call createDestinationSubscriptionValidateBeforeCall( CreateDestinationSubscriptionAlphaInput createDestinationSubscriptionAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -354,10 +351,8 @@ private okhttp3.Call createDestinationSubscriptionValidateBeforeCall( + " calling createDestinationSubscription(Async)"); } - okhttp3.Call localVarCall = - createDestinationSubscriptionCall( - destinationId, createDestinationSubscriptionAlphaInput, _callback); - return localVarCall; + return createDestinationSubscriptionCall( + destinationId, createDestinationSubscriptionAlphaInput, _callback); } /** @@ -461,6 +456,7 @@ public okhttp3.Call createDestinationSubscriptionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteDestination * @@ -497,8 +493,8 @@ public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallbac // create path and map variables String localVarPath = "/destinations/{destinationId}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -519,7 +515,6 @@ public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallbac } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -544,7 +539,6 @@ public okhttp3.Call deleteDestinationCall(String destinationId, final ApiCallbac @SuppressWarnings("rawtypes") private okhttp3.Call deleteDestinationValidateBeforeCall( String destinationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -552,8 +546,7 @@ private okhttp3.Call deleteDestinationValidateBeforeCall( + " deleteDestination(Async)"); } - okhttp3.Call localVarCall = deleteDestinationCall(destinationId, _callback); - return localVarCall; + return deleteDestinationCall(destinationId, _callback); } /** @@ -634,6 +627,7 @@ public okhttp3.Call deleteDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getDestination * @@ -670,8 +664,8 @@ public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _ // create path and map variables String localVarPath = "/destinations/{destinationId}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -692,7 +686,6 @@ public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _ } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -717,7 +710,6 @@ public okhttp3.Call getDestinationCall(String destinationId, final ApiCallback _ @SuppressWarnings("rawtypes") private okhttp3.Call getDestinationValidateBeforeCall( String destinationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -725,8 +717,7 @@ private okhttp3.Call getDestinationValidateBeforeCall( + " getDestination(Async)"); } - okhttp3.Call localVarCall = getDestinationCall(destinationId, _callback); - return localVarCall; + return getDestinationCall(destinationId, _callback); } /** @@ -803,6 +794,7 @@ public okhttp3.Call getDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getSubscriptionFromDestination * @@ -840,12 +832,10 @@ public okhttp3.Call getSubscriptionFromDestinationCall( // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -862,7 +852,6 @@ public okhttp3.Call getSubscriptionFromDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -887,7 +876,6 @@ public okhttp3.Call getSubscriptionFromDestinationCall( @SuppressWarnings("rawtypes") private okhttp3.Call getSubscriptionFromDestinationValidateBeforeCall( String destinationId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -902,9 +890,7 @@ private okhttp3.Call getSubscriptionFromDestinationValidateBeforeCall( + " getSubscriptionFromDestination(Async)"); } - okhttp3.Call localVarCall = - getSubscriptionFromDestinationCall(destinationId, id, _callback); - return localVarCall; + return getSubscriptionFromDestinationCall(destinationId, id, _callback); } /** @@ -1001,6 +987,7 @@ public okhttp3.Call getSubscriptionFromDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listDeliveryMetricsSummaryFromDestination * @@ -1053,8 +1040,8 @@ public okhttp3.Call listDeliveryMetricsSummaryFromDestinationCall( // create path and map variables String localVarPath = "/destinations/{destinationId}/delivery-metrics" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -1091,7 +1078,6 @@ public okhttp3.Call listDeliveryMetricsSummaryFromDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1122,7 +1108,6 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall String granularity, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -1137,10 +1122,8 @@ private okhttp3.Call listDeliveryMetricsSummaryFromDestinationValidateBeforeCall + " listDeliveryMetricsSummaryFromDestination(Async)"); } - okhttp3.Call localVarCall = - listDeliveryMetricsSummaryFromDestinationCall( - destinationId, sourceId, startTime, endTime, granularity, _callback); - return localVarCall; + return listDeliveryMetricsSummaryFromDestinationCall( + destinationId, sourceId, startTime, endTime, granularity, _callback); } /** @@ -1293,6 +1276,7 @@ public okhttp3.Call listDeliveryMetricsSummaryFromDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listDestinations * @@ -1352,7 +1336,6 @@ public okhttp3.Call listDestinationsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1377,7 +1360,6 @@ public okhttp3.Call listDestinationsCall( @SuppressWarnings("rawtypes") private okhttp3.Call listDestinationsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1385,8 +1367,7 @@ private okhttp3.Call listDestinationsValidateBeforeCall( + " listDestinations(Async)"); } - okhttp3.Call localVarCall = listDestinationsCall(pagination, _callback); - return localVarCall; + return listDestinationsCall(pagination, _callback); } /** @@ -1464,6 +1445,7 @@ public okhttp3.Call listDestinationsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSubscriptionsFromDestination * @@ -1502,8 +1484,8 @@ public okhttp3.Call listSubscriptionsFromDestinationCall( // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -1525,7 +1507,6 @@ public okhttp3.Call listSubscriptionsFromDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1551,7 +1532,6 @@ public okhttp3.Call listSubscriptionsFromDestinationCall( private okhttp3.Call listSubscriptionsFromDestinationValidateBeforeCall( String destinationId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -1566,9 +1546,7 @@ private okhttp3.Call listSubscriptionsFromDestinationValidateBeforeCall( + " listSubscriptionsFromDestination(Async)"); } - okhttp3.Call localVarCall = - listSubscriptionsFromDestinationCall(destinationId, pagination, _callback); - return localVarCall; + return listSubscriptionsFromDestinationCall(destinationId, pagination, _callback); } /** @@ -1666,6 +1644,7 @@ public okhttp3.Call listSubscriptionsFromDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeSubscriptionFromDestination * @@ -1703,12 +1682,10 @@ public okhttp3.Call removeSubscriptionFromDestinationCall( // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1725,7 +1702,6 @@ public okhttp3.Call removeSubscriptionFromDestinationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1750,7 +1726,6 @@ public okhttp3.Call removeSubscriptionFromDestinationCall( @SuppressWarnings("rawtypes") private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall( String destinationId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -1765,9 +1740,7 @@ private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall( + " removeSubscriptionFromDestination(Async)"); } - okhttp3.Call localVarCall = - removeSubscriptionFromDestinationCall(destinationId, id, _callback); - return localVarCall; + return removeSubscriptionFromDestinationCall(destinationId, id, _callback); } /** @@ -1864,6 +1837,7 @@ public okhttp3.Call removeSubscriptionFromDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateDestination * @@ -1904,8 +1878,8 @@ public okhttp3.Call updateDestinationCall( // create path and map variables String localVarPath = "/destinations/{destinationId}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())); List localVarQueryParams = new ArrayList(); @@ -1957,7 +1931,6 @@ private okhttp3.Call updateDestinationValidateBeforeCall( UpdateDestinationV1Input updateDestinationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -1972,9 +1945,7 @@ private okhttp3.Call updateDestinationValidateBeforeCall( + " updateDestination(Async)"); } - okhttp3.Call localVarCall = - updateDestinationCall(destinationId, updateDestinationV1Input, _callback); - return localVarCall; + return updateDestinationCall(destinationId, updateDestinationV1Input, _callback); } /** @@ -2078,6 +2049,7 @@ public okhttp3.Call updateDestinationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateSubscriptionForDestination * @@ -2120,12 +2092,10 @@ public okhttp3.Call updateSubscriptionForDestinationCall( // create path and map variables String localVarPath = "/destinations/{destinationId}/subscriptions/{id}" - .replaceAll( - "\\{" + "destinationId" + "\\}", + .replace( + "{" + "destinationId" + "}", localVarApiClient.escapeString(destinationId.toString())) - .replaceAll( - "\\{" + "id" + "\\}", - localVarApiClient.escapeString(id.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -2170,7 +2140,6 @@ private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall( UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'destinationId' is set if (destinationId == null) { throw new ApiException( @@ -2192,10 +2161,8 @@ private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall( + " when calling updateSubscriptionForDestination(Async)"); } - okhttp3.Call localVarCall = - updateSubscriptionForDestinationCall( - destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); - return localVarCall; + return updateSubscriptionForDestinationCall( + destinationId, id, updateSubscriptionForDestinationAlphaInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java index 6dc4f864..7a05a54b 100644 --- a/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/EdgeFunctionsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -107,8 +106,8 @@ public okhttp3.Call createEdgeFunctionsCall( // create path and map variables String localVarPath = "/sources/{sourceId}/edge-functions" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -153,7 +152,6 @@ private okhttp3.Call createEdgeFunctionsValidateBeforeCall( CreateEdgeFunctionsAlphaInput createEdgeFunctionsAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -168,9 +166,7 @@ private okhttp3.Call createEdgeFunctionsValidateBeforeCall( + " createEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = - createEdgeFunctionsCall(sourceId, createEdgeFunctionsAlphaInput, _callback); - return localVarCall; + return createEdgeFunctionsCall(sourceId, createEdgeFunctionsAlphaInput, _callback); } /** @@ -268,6 +264,7 @@ public okhttp3.Call createEdgeFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for disableEdgeFunctions * @@ -304,8 +301,8 @@ public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback // create path and map variables String localVarPath = "/sources/{sourceId}/edge-functions/disable" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -323,7 +320,6 @@ public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -348,7 +344,6 @@ public okhttp3.Call disableEdgeFunctionsCall(String sourceId, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call disableEdgeFunctionsValidateBeforeCall( String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -356,8 +351,7 @@ private okhttp3.Call disableEdgeFunctionsValidateBeforeCall( + " disableEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = disableEdgeFunctionsCall(sourceId, _callback); - return localVarCall; + return disableEdgeFunctionsCall(sourceId, _callback); } /** @@ -444,6 +438,7 @@ public okhttp3.Call disableEdgeFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for generateUploadURLForEdgeFunctions * @@ -480,8 +475,8 @@ public okhttp3.Call generateUploadURLForEdgeFunctionsCall( // create path and map variables String localVarPath = "/sources/{sourceId}/edge-functions/upload-url" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -499,7 +494,6 @@ public okhttp3.Call generateUploadURLForEdgeFunctionsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -524,7 +518,6 @@ public okhttp3.Call generateUploadURLForEdgeFunctionsCall( @SuppressWarnings("rawtypes") private okhttp3.Call generateUploadURLForEdgeFunctionsValidateBeforeCall( String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -532,8 +525,7 @@ private okhttp3.Call generateUploadURLForEdgeFunctionsValidateBeforeCall( + " generateUploadURLForEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = generateUploadURLForEdgeFunctionsCall(sourceId, _callback); - return localVarCall; + return generateUploadURLForEdgeFunctionsCall(sourceId, _callback); } /** @@ -625,6 +617,7 @@ public okhttp3.Call generateUploadURLForEdgeFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getLatestFromEdgeFunctions * @@ -661,8 +654,8 @@ public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCal // create path and map variables String localVarPath = "/sources/{sourceId}/edge-functions/latest" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -680,7 +673,6 @@ public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCal } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -705,7 +697,6 @@ public okhttp3.Call getLatestFromEdgeFunctionsCall(String sourceId, final ApiCal @SuppressWarnings("rawtypes") private okhttp3.Call getLatestFromEdgeFunctionsValidateBeforeCall( String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -713,8 +704,7 @@ private okhttp3.Call getLatestFromEdgeFunctionsValidateBeforeCall( + " getLatestFromEdgeFunctions(Async)"); } - okhttp3.Call localVarCall = getLatestFromEdgeFunctionsCall(sourceId, _callback); - return localVarCall; + return getLatestFromEdgeFunctionsCall(sourceId, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/EventsApi.java b/src/main/java/com/segment/publicapi/api/EventsApi.java index daeccfc1..4d932b7a 100644 --- a/src/main/java/com/segment/publicapi/api/EventsApi.java +++ b/src/main/java/com/segment/publicapi/api/EventsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -190,7 +189,6 @@ public okhttp3.Call getEventsVolumeFromWorkspaceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -225,7 +223,6 @@ private okhttp3.Call getEventsVolumeFromWorkspaceValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set if (granularity == null) { throw new ApiException( @@ -247,19 +244,17 @@ private okhttp3.Call getEventsVolumeFromWorkspaceValidateBeforeCall( + " getEventsVolumeFromWorkspace(Async)"); } - okhttp3.Call localVarCall = - getEventsVolumeFromWorkspaceCall( - granularity, - startTime, - endTime, - groupBy, - sourceId, - eventName, - eventType, - appVersion, - pagination, - _callback); - return localVarCall; + return getEventsVolumeFromWorkspaceCall( + granularity, + startTime, + endTime, + groupBy, + sourceId, + eventName, + eventType, + appVersion, + pagination, + _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/FunctionsApi.java b/src/main/java/com/segment/publicapi/api/FunctionsApi.java index f7b41130..de562514 100644 --- a/src/main/java/com/segment/publicapi/api/FunctionsApi.java +++ b/src/main/java/com/segment/publicapi/api/FunctionsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -165,7 +164,6 @@ public okhttp3.Call createFunctionCall( private okhttp3.Call createFunctionValidateBeforeCall( CreateFunctionV1Input createFunctionV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createFunctionV1Input' is set if (createFunctionV1Input == null) { throw new ApiException( @@ -173,8 +171,7 @@ private okhttp3.Call createFunctionValidateBeforeCall( + " createFunction(Async)"); } - okhttp3.Call localVarCall = createFunctionCall(createFunctionV1Input, _callback); - return localVarCall; + return createFunctionCall(createFunctionV1Input, _callback); } /** @@ -257,6 +254,7 @@ public okhttp3.Call createFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createFunctionDeployment * @@ -293,8 +291,8 @@ public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCal // create path and map variables String localVarPath = "/functions/{functionId}/deploy" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -315,7 +313,6 @@ public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCal } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -340,7 +337,6 @@ public okhttp3.Call createFunctionDeploymentCall(String functionId, final ApiCal @SuppressWarnings("rawtypes") private okhttp3.Call createFunctionDeploymentValidateBeforeCall( String functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( @@ -348,8 +344,7 @@ private okhttp3.Call createFunctionDeploymentValidateBeforeCall( + " createFunctionDeployment(Async)"); } - okhttp3.Call localVarCall = createFunctionDeploymentCall(functionId, _callback); - return localVarCall; + return createFunctionDeploymentCall(functionId, _callback); } /** @@ -434,6 +429,7 @@ public okhttp3.Call createFunctionDeploymentAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createInsertFunctionInstance * @@ -513,7 +509,6 @@ private okhttp3.Call createInsertFunctionInstanceValidateBeforeCall( CreateInsertFunctionInstanceAlphaInput createInsertFunctionInstanceAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createInsertFunctionInstanceAlphaInput' is set if (createInsertFunctionInstanceAlphaInput == null) { throw new ApiException( @@ -521,9 +516,7 @@ private okhttp3.Call createInsertFunctionInstanceValidateBeforeCall( + " calling createInsertFunctionInstance(Async)"); } - okhttp3.Call localVarCall = - createInsertFunctionInstanceCall(createInsertFunctionInstanceAlphaInput, _callback); - return localVarCall; + return createInsertFunctionInstanceCall(createInsertFunctionInstanceAlphaInput, _callback); } /** @@ -617,6 +610,7 @@ public okhttp3.Call createInsertFunctionInstanceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteFunction * @@ -653,8 +647,8 @@ public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _cal // create path and map variables String localVarPath = "/functions/{functionId}" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -675,7 +669,6 @@ public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _cal } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -700,7 +693,6 @@ public okhttp3.Call deleteFunctionCall(String functionId, final ApiCallback _cal @SuppressWarnings("rawtypes") private okhttp3.Call deleteFunctionValidateBeforeCall( String functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( @@ -708,8 +700,7 @@ private okhttp3.Call deleteFunctionValidateBeforeCall( + " deleteFunction(Async)"); } - okhttp3.Call localVarCall = deleteFunctionCall(functionId, _callback); - return localVarCall; + return deleteFunctionCall(functionId, _callback); } /** @@ -789,6 +780,7 @@ public okhttp3.Call deleteFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteInsertFunctionInstance * @@ -825,8 +817,8 @@ public okhttp3.Call deleteInsertFunctionInstanceCall( // create path and map variables String localVarPath = "/insert-function-instances/{instanceId}" - .replaceAll( - "\\{" + "instanceId" + "\\}", + .replace( + "{" + "instanceId" + "}", localVarApiClient.escapeString(instanceId.toString())); List localVarQueryParams = new ArrayList(); @@ -844,7 +836,6 @@ public okhttp3.Call deleteInsertFunctionInstanceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -869,7 +860,6 @@ public okhttp3.Call deleteInsertFunctionInstanceCall( @SuppressWarnings("rawtypes") private okhttp3.Call deleteInsertFunctionInstanceValidateBeforeCall( String instanceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'instanceId' is set if (instanceId == null) { throw new ApiException( @@ -877,8 +867,7 @@ private okhttp3.Call deleteInsertFunctionInstanceValidateBeforeCall( + " deleteInsertFunctionInstance(Async)"); } - okhttp3.Call localVarCall = deleteInsertFunctionInstanceCall(instanceId, _callback); - return localVarCall; + return deleteInsertFunctionInstanceCall(instanceId, _callback); } /** @@ -963,6 +952,7 @@ public okhttp3.Call deleteInsertFunctionInstanceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getFunction * @@ -999,8 +989,8 @@ public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callba // create path and map variables String localVarPath = "/functions/{functionId}" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1021,7 +1011,6 @@ public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callba } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1046,15 +1035,13 @@ public okhttp3.Call getFunctionCall(String functionId, final ApiCallback _callba @SuppressWarnings("rawtypes") private okhttp3.Call getFunctionValidateBeforeCall( String functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( "Missing the required parameter 'functionId' when calling getFunction(Async)"); } - okhttp3.Call localVarCall = getFunctionCall(functionId, _callback); - return localVarCall; + return getFunctionCall(functionId, _callback); } /** @@ -1133,6 +1120,7 @@ public okhttp3.Call getFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getFunctionVersion * @@ -1170,11 +1158,11 @@ public okhttp3.Call getFunctionVersionCall( // create path and map variables String localVarPath = "/functions/{functionId}/versions/{versionId}" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())) - .replaceAll( - "\\{" + "versionId" + "\\}", + .replace( + "{" + "versionId" + "}", localVarApiClient.escapeString(versionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1192,7 +1180,6 @@ public okhttp3.Call getFunctionVersionCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1217,7 +1204,6 @@ public okhttp3.Call getFunctionVersionCall( @SuppressWarnings("rawtypes") private okhttp3.Call getFunctionVersionValidateBeforeCall( String functionId, String versionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( @@ -1232,8 +1218,7 @@ private okhttp3.Call getFunctionVersionValidateBeforeCall( + " getFunctionVersion(Async)"); } - okhttp3.Call localVarCall = getFunctionVersionCall(functionId, versionId, _callback); - return localVarCall; + return getFunctionVersionCall(functionId, versionId, _callback); } /** @@ -1321,6 +1306,7 @@ public okhttp3.Call getFunctionVersionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listFunctionVersions * @@ -1359,8 +1345,8 @@ public okhttp3.Call listFunctionVersionsCall( // create path and map variables String localVarPath = "/functions/{functionId}/versions" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1382,7 +1368,6 @@ public okhttp3.Call listFunctionVersionsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1408,7 +1393,6 @@ public okhttp3.Call listFunctionVersionsCall( private okhttp3.Call listFunctionVersionsValidateBeforeCall( String functionId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( @@ -1423,8 +1407,7 @@ private okhttp3.Call listFunctionVersionsValidateBeforeCall( + " listFunctionVersions(Async)"); } - okhttp3.Call localVarCall = listFunctionVersionsCall(functionId, pagination, _callback); - return localVarCall; + return listFunctionVersionsCall(functionId, pagination, _callback); } /** @@ -1512,6 +1495,7 @@ public okhttp3.Call listFunctionVersionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listFunctions * @@ -1578,7 +1562,6 @@ public okhttp3.Call listFunctionsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1604,7 +1587,6 @@ public okhttp3.Call listFunctionsCall( private okhttp3.Call listFunctionsValidateBeforeCall( PaginationInput pagination, String resourceType, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1619,8 +1601,7 @@ private okhttp3.Call listFunctionsValidateBeforeCall( + " listFunctions(Async)"); } - okhttp3.Call localVarCall = listFunctionsCall(pagination, resourceType, _callback); - return localVarCall; + return listFunctionsCall(pagination, resourceType, _callback); } /** @@ -1710,6 +1691,7 @@ public okhttp3.Call listFunctionsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listInsertFunctionInstances * @@ -1772,7 +1754,6 @@ public okhttp3.Call listInsertFunctionInstancesCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1798,7 +1779,6 @@ public okhttp3.Call listInsertFunctionInstancesCall( private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( PaginationInput pagination, String functionId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1813,9 +1793,7 @@ private okhttp3.Call listInsertFunctionInstancesValidateBeforeCall( + " listInsertFunctionInstances(Async)"); } - okhttp3.Call localVarCall = - listInsertFunctionInstancesCall(pagination, functionId, _callback); - return localVarCall; + return listInsertFunctionInstancesCall(pagination, functionId, _callback); } /** @@ -1912,6 +1890,7 @@ public okhttp3.Call listInsertFunctionInstancesAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for restoreFunctionVersion * @@ -1952,8 +1931,8 @@ public okhttp3.Call restoreFunctionVersionCall( // create path and map variables String localVarPath = "/functions/{functionId}/versions" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -1998,7 +1977,6 @@ private okhttp3.Call restoreFunctionVersionValidateBeforeCall( RestoreFunctionVersionAlphaInput restoreFunctionVersionAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( @@ -2013,9 +1991,7 @@ private okhttp3.Call restoreFunctionVersionValidateBeforeCall( + " restoreFunctionVersion(Async)"); } - okhttp3.Call localVarCall = - restoreFunctionVersionCall(functionId, restoreFunctionVersionAlphaInput, _callback); - return localVarCall; + return restoreFunctionVersionCall(functionId, restoreFunctionVersionAlphaInput, _callback); } /** @@ -2108,6 +2084,7 @@ public okhttp3.Call restoreFunctionVersionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateFunction * @@ -2148,8 +2125,8 @@ public okhttp3.Call updateFunctionCall( // create path and map variables String localVarPath = "/functions/{functionId}" - .replaceAll( - "\\{" + "functionId" + "\\}", + .replace( + "{" + "functionId" + "}", localVarApiClient.escapeString(functionId.toString())); List localVarQueryParams = new ArrayList(); @@ -2201,7 +2178,6 @@ private okhttp3.Call updateFunctionValidateBeforeCall( UpdateFunctionV1Input updateFunctionV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'functionId' is set if (functionId == null) { throw new ApiException( @@ -2216,9 +2192,7 @@ private okhttp3.Call updateFunctionValidateBeforeCall( + " updateFunction(Async)"); } - okhttp3.Call localVarCall = - updateFunctionCall(functionId, updateFunctionV1Input, _callback); - return localVarCall; + return updateFunctionCall(functionId, updateFunctionV1Input, _callback); } /** @@ -2309,6 +2283,7 @@ public okhttp3.Call updateFunctionAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateInsertFunctionInstance * @@ -2349,8 +2324,8 @@ public okhttp3.Call updateInsertFunctionInstanceCall( // create path and map variables String localVarPath = "/insert-function-instances/{instanceId}" - .replaceAll( - "\\{" + "instanceId" + "\\}", + .replace( + "{" + "instanceId" + "}", localVarApiClient.escapeString(instanceId.toString())); List localVarQueryParams = new ArrayList(); @@ -2395,7 +2370,6 @@ private okhttp3.Call updateInsertFunctionInstanceValidateBeforeCall( UpdateInsertFunctionInstanceAlphaInput updateInsertFunctionInstanceAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'instanceId' is set if (instanceId == null) { throw new ApiException( @@ -2410,10 +2384,8 @@ private okhttp3.Call updateInsertFunctionInstanceValidateBeforeCall( + " calling updateInsertFunctionInstance(Async)"); } - okhttp3.Call localVarCall = - updateInsertFunctionInstanceCall( - instanceId, updateInsertFunctionInstanceAlphaInput, _callback); - return localVarCall; + return updateInsertFunctionInstanceCall( + instanceId, updateInsertFunctionInstanceAlphaInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java index 34c639f8..9ca778bc 100644 --- a/src/main/java/com/segment/publicapi/api/IamGroupsApi.java +++ b/src/main/java/com/segment/publicapi/api/IamGroupsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -121,8 +120,8 @@ public okhttp3.Call addPermissionsToUserGroupCall( // create path and map variables String localVarPath = "/groups/{userGroupId}/permissions" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -174,7 +173,6 @@ private okhttp3.Call addPermissionsToUserGroupValidateBeforeCall( AddPermissionsToUserGroupV1Input addPermissionsToUserGroupV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -189,10 +187,8 @@ private okhttp3.Call addPermissionsToUserGroupValidateBeforeCall( + " addPermissionsToUserGroup(Async)"); } - okhttp3.Call localVarCall = - addPermissionsToUserGroupCall( - userGroupId, addPermissionsToUserGroupV1Input, _callback); - return localVarCall; + return addPermissionsToUserGroupCall( + userGroupId, addPermissionsToUserGroupV1Input, _callback); } /** @@ -299,6 +295,7 @@ public okhttp3.Call addPermissionsToUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for addUsersToUserGroup * @@ -339,8 +336,8 @@ public okhttp3.Call addUsersToUserGroupCall( // create path and map variables String localVarPath = "/groups/{userGroupId}/users" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -392,7 +389,6 @@ private okhttp3.Call addUsersToUserGroupValidateBeforeCall( AddUsersToUserGroupV1Input addUsersToUserGroupV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -407,9 +403,7 @@ private okhttp3.Call addUsersToUserGroupValidateBeforeCall( + " addUsersToUserGroup(Async)"); } - okhttp3.Call localVarCall = - addUsersToUserGroupCall(userGroupId, addUsersToUserGroupV1Input, _callback); - return localVarCall; + return addUsersToUserGroupCall(userGroupId, addUsersToUserGroupV1Input, _callback); } /** @@ -511,6 +505,7 @@ public okhttp3.Call addUsersToUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createUserGroup * @@ -595,7 +590,6 @@ public okhttp3.Call createUserGroupCall( private okhttp3.Call createUserGroupValidateBeforeCall( CreateUserGroupV1Input createUserGroupV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createUserGroupV1Input' is set if (createUserGroupV1Input == null) { throw new ApiException( @@ -603,8 +597,7 @@ private okhttp3.Call createUserGroupValidateBeforeCall( + " createUserGroup(Async)"); } - okhttp3.Call localVarCall = createUserGroupCall(createUserGroupV1Input, _callback); - return localVarCall; + return createUserGroupCall(createUserGroupV1Input, _callback); } /** @@ -696,6 +689,7 @@ public okhttp3.Call createUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteUserGroup * @@ -732,8 +726,8 @@ public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _c // create path and map variables String localVarPath = "/groups/{userGroupId}" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -754,7 +748,6 @@ public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _c } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -779,7 +772,6 @@ public okhttp3.Call deleteUserGroupCall(String userGroupId, final ApiCallback _c @SuppressWarnings("rawtypes") private okhttp3.Call deleteUserGroupValidateBeforeCall( String userGroupId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -787,8 +779,7 @@ private okhttp3.Call deleteUserGroupValidateBeforeCall( + " deleteUserGroup(Async)"); } - okhttp3.Call localVarCall = deleteUserGroupCall(userGroupId, _callback); - return localVarCall; + return deleteUserGroupCall(userGroupId, _callback); } /** @@ -877,6 +868,7 @@ public okhttp3.Call deleteUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getUserGroup * @@ -913,8 +905,8 @@ public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _call // create path and map variables String localVarPath = "/groups/{userGroupId}" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -935,7 +927,6 @@ public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _call } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -960,7 +951,6 @@ public okhttp3.Call getUserGroupCall(String userGroupId, final ApiCallback _call @SuppressWarnings("rawtypes") private okhttp3.Call getUserGroupValidateBeforeCall( String userGroupId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -968,8 +958,7 @@ private okhttp3.Call getUserGroupValidateBeforeCall( + " getUserGroup(Async)"); } - okhttp3.Call localVarCall = getUserGroupCall(userGroupId, _callback); - return localVarCall; + return getUserGroupCall(userGroupId, _callback); } /** @@ -1042,6 +1031,7 @@ public okhttp3.Call getUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listInvitesFromUserGroup * @@ -1081,8 +1071,8 @@ public okhttp3.Call listInvitesFromUserGroupCall( // create path and map variables String localVarPath = "/groups/{userGroupId}/invites" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -1107,7 +1097,6 @@ public okhttp3.Call listInvitesFromUserGroupCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1133,7 +1122,6 @@ public okhttp3.Call listInvitesFromUserGroupCall( private okhttp3.Call listInvitesFromUserGroupValidateBeforeCall( String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -1148,9 +1136,7 @@ private okhttp3.Call listInvitesFromUserGroupValidateBeforeCall( + " listInvitesFromUserGroup(Async)"); } - okhttp3.Call localVarCall = - listInvitesFromUserGroupCall(userGroupId, pagination, _callback); - return localVarCall; + return listInvitesFromUserGroupCall(userGroupId, pagination, _callback); } /** @@ -1235,6 +1221,7 @@ public okhttp3.Call listInvitesFromUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listUserGroups * @@ -1293,7 +1280,6 @@ public okhttp3.Call listUserGroupsCall(PaginationInput pagination, final ApiCall } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1318,7 +1304,6 @@ public okhttp3.Call listUserGroupsCall(PaginationInput pagination, final ApiCall @SuppressWarnings("rawtypes") private okhttp3.Call listUserGroupsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1326,8 +1311,7 @@ private okhttp3.Call listUserGroupsValidateBeforeCall( + " listUserGroups(Async)"); } - okhttp3.Call localVarCall = listUserGroupsCall(pagination, _callback); - return localVarCall; + return listUserGroupsCall(pagination, _callback); } /** @@ -1402,6 +1386,7 @@ public okhttp3.Call listUserGroupsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listUsersFromUserGroup * @@ -1440,8 +1425,8 @@ public okhttp3.Call listUsersFromUserGroupCall( // create path and map variables String localVarPath = "/groups/{userGroupId}/users" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -1466,7 +1451,6 @@ public okhttp3.Call listUsersFromUserGroupCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1492,7 +1476,6 @@ public okhttp3.Call listUsersFromUserGroupCall( private okhttp3.Call listUsersFromUserGroupValidateBeforeCall( String userGroupId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -1507,8 +1490,7 @@ private okhttp3.Call listUsersFromUserGroupValidateBeforeCall( + " listUsersFromUserGroup(Async)"); } - okhttp3.Call localVarCall = listUsersFromUserGroupCall(userGroupId, pagination, _callback); - return localVarCall; + return listUsersFromUserGroupCall(userGroupId, pagination, _callback); } /** @@ -1590,6 +1572,7 @@ public okhttp3.Call listUsersFromUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeUsersFromUserGroup * @@ -1629,8 +1612,8 @@ public okhttp3.Call removeUsersFromUserGroupCall( // create path and map variables String localVarPath = "/group/{userGroupId}/users" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -1656,7 +1639,6 @@ public okhttp3.Call removeUsersFromUserGroupCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1682,7 +1664,6 @@ public okhttp3.Call removeUsersFromUserGroupCall( private okhttp3.Call removeUsersFromUserGroupValidateBeforeCall( String userGroupId, List emails, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -1697,8 +1678,7 @@ private okhttp3.Call removeUsersFromUserGroupValidateBeforeCall( + " removeUsersFromUserGroup(Async)"); } - okhttp3.Call localVarCall = removeUsersFromUserGroupCall(userGroupId, emails, _callback); - return localVarCall; + return removeUsersFromUserGroupCall(userGroupId, emails, _callback); } /** @@ -1801,6 +1781,7 @@ public okhttp3.Call removeUsersFromUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replacePermissionsForUserGroup * @@ -1841,8 +1822,8 @@ public okhttp3.Call replacePermissionsForUserGroupCall( // create path and map variables String localVarPath = "/groups/{userGroupId}/permissions" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -1894,7 +1875,6 @@ private okhttp3.Call replacePermissionsForUserGroupValidateBeforeCall( ReplacePermissionsForUserGroupV1Input replacePermissionsForUserGroupV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -1909,10 +1889,8 @@ private okhttp3.Call replacePermissionsForUserGroupValidateBeforeCall( + " calling replacePermissionsForUserGroup(Async)"); } - okhttp3.Call localVarCall = - replacePermissionsForUserGroupCall( - userGroupId, replacePermissionsForUserGroupV1Input, _callback); - return localVarCall; + return replacePermissionsForUserGroupCall( + userGroupId, replacePermissionsForUserGroupV1Input, _callback); } /** @@ -2019,6 +1997,7 @@ public okhttp3.Call replacePermissionsForUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replaceUsersInUserGroup * @@ -2059,8 +2038,8 @@ public okhttp3.Call replaceUsersInUserGroupCall( // create path and map variables String localVarPath = "/group/{userGroupId}/users" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -2112,7 +2091,6 @@ private okhttp3.Call replaceUsersInUserGroupValidateBeforeCall( ReplaceUsersInUserGroupV1Input replaceUsersInUserGroupV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -2127,9 +2105,7 @@ private okhttp3.Call replaceUsersInUserGroupValidateBeforeCall( + " replaceUsersInUserGroup(Async)"); } - okhttp3.Call localVarCall = - replaceUsersInUserGroupCall(userGroupId, replaceUsersInUserGroupV1Input, _callback); - return localVarCall; + return replaceUsersInUserGroupCall(userGroupId, replaceUsersInUserGroupV1Input, _callback); } /** @@ -2233,6 +2209,7 @@ public okhttp3.Call replaceUsersInUserGroupAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateUserGroup * @@ -2273,8 +2250,8 @@ public okhttp3.Call updateUserGroupCall( // create path and map variables String localVarPath = "/groups/{userGroupId}" - .replaceAll( - "\\{" + "userGroupId" + "\\}", + .replace( + "{" + "userGroupId" + "}", localVarApiClient.escapeString(userGroupId.toString())); List localVarQueryParams = new ArrayList(); @@ -2326,7 +2303,6 @@ private okhttp3.Call updateUserGroupValidateBeforeCall( UpdateUserGroupV1Input updateUserGroupV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userGroupId' is set if (userGroupId == null) { throw new ApiException( @@ -2341,9 +2317,7 @@ private okhttp3.Call updateUserGroupValidateBeforeCall( + " updateUserGroup(Async)"); } - okhttp3.Call localVarCall = - updateUserGroupCall(userGroupId, updateUserGroupV1Input, _callback); - return localVarCall; + return updateUserGroupCall(userGroupId, updateUserGroupV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/IamRolesApi.java b/src/main/java/com/segment/publicapi/api/IamRolesApi.java index 49aeda33..7a0327d6 100644 --- a/src/main/java/com/segment/publicapi/api/IamRolesApi.java +++ b/src/main/java/com/segment/publicapi/api/IamRolesApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -122,7 +121,6 @@ public okhttp3.Call listRolesCall(PaginationInput pagination, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -147,15 +145,13 @@ public okhttp3.Call listRolesCall(PaginationInput pagination, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call listRolesValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling listRoles(Async)"); } - okhttp3.Call localVarCall = listRolesCall(pagination, _callback); - return localVarCall; + return listRolesCall(pagination, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/IamUsersApi.java b/src/main/java/com/segment/publicapi/api/IamUsersApi.java index 0029bb08..ee4221d1 100644 --- a/src/main/java/com/segment/publicapi/api/IamUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/IamUsersApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -115,8 +114,8 @@ public okhttp3.Call addPermissionsToUserCall( // create path and map variables String localVarPath = "/users/{userId}/permissions" - .replaceAll( - "\\{" + "userId" + "\\}", + .replace( + "{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); @@ -168,7 +167,6 @@ private okhttp3.Call addPermissionsToUserValidateBeforeCall( AddPermissionsToUserV1Input addPermissionsToUserV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException( @@ -183,9 +181,7 @@ private okhttp3.Call addPermissionsToUserValidateBeforeCall( + " addPermissionsToUser(Async)"); } - okhttp3.Call localVarCall = - addPermissionsToUserCall(userId, addPermissionsToUserV1Input, _callback); - return localVarCall; + return addPermissionsToUserCall(userId, addPermissionsToUserV1Input, _callback); } /** @@ -286,6 +282,7 @@ public okhttp3.Call addPermissionsToUserAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createInvites * @@ -370,7 +367,6 @@ public okhttp3.Call createInvitesCall( private okhttp3.Call createInvitesValidateBeforeCall( CreateInvitesV1Input createInvitesV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createInvitesV1Input' is set if (createInvitesV1Input == null) { throw new ApiException( @@ -378,8 +374,7 @@ private okhttp3.Call createInvitesValidateBeforeCall( + " createInvites(Async)"); } - okhttp3.Call localVarCall = createInvitesCall(createInvitesV1Input, _callback); - return localVarCall; + return createInvitesCall(createInvitesV1Input, _callback); } /** @@ -474,6 +469,7 @@ public okhttp3.Call createInvitesAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteInvites * @@ -534,7 +530,6 @@ public okhttp3.Call deleteInvitesCall(List emails, final ApiCallback _ca } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -559,15 +554,13 @@ public okhttp3.Call deleteInvitesCall(List emails, final ApiCallback _ca @SuppressWarnings("rawtypes") private okhttp3.Call deleteInvitesValidateBeforeCall( List emails, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emails' is set if (emails == null) { throw new ApiException( "Missing the required parameter 'emails' when calling deleteInvites(Async)"); } - okhttp3.Call localVarCall = deleteInvitesCall(emails, _callback); - return localVarCall; + return deleteInvitesCall(emails, _callback); } /** @@ -659,6 +652,7 @@ public okhttp3.Call deleteInvitesAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteUsers * @@ -718,7 +712,6 @@ public okhttp3.Call deleteUsersCall(List userIds, final ApiCallback _cal } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -743,15 +736,13 @@ public okhttp3.Call deleteUsersCall(List userIds, final ApiCallback _cal @SuppressWarnings("rawtypes") private okhttp3.Call deleteUsersValidateBeforeCall( List userIds, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userIds' is set if (userIds == null) { throw new ApiException( "Missing the required parameter 'userIds' when calling deleteUsers(Async)"); } - okhttp3.Call localVarCall = deleteUsersCall(userIds, _callback); - return localVarCall; + return deleteUsersCall(userIds, _callback); } /** @@ -839,6 +830,7 @@ public okhttp3.Call deleteUsersAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getUser * @@ -875,8 +867,8 @@ public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) // create path and map variables String localVarPath = "/users/{userId}" - .replaceAll( - "\\{" + "userId" + "\\}", + .replace( + "{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); @@ -897,7 +889,6 @@ public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -922,15 +913,13 @@ public okhttp3.Call getUserCall(String userId, final ApiCallback _callback) @SuppressWarnings("rawtypes") private okhttp3.Call getUserValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException( "Missing the required parameter 'userId' when calling getUser(Async)"); } - okhttp3.Call localVarCall = getUserCall(userId, _callback); - return localVarCall; + return getUserCall(userId, _callback); } /** @@ -1001,6 +990,7 @@ public okhttp3.Call getUserAsync(String userId, final ApiCallback localVarQueryParams = new ArrayList(); @@ -1232,7 +1220,6 @@ public okhttp3.Call listUserGroupsFromUserCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1258,7 +1245,6 @@ public okhttp3.Call listUserGroupsFromUserCall( private okhttp3.Call listUserGroupsFromUserValidateBeforeCall( String userId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException( @@ -1273,8 +1259,7 @@ private okhttp3.Call listUserGroupsFromUserValidateBeforeCall( + " listUserGroupsFromUser(Async)"); } - okhttp3.Call localVarCall = listUserGroupsFromUserCall(userId, pagination, _callback); - return localVarCall; + return listUserGroupsFromUserCall(userId, pagination, _callback); } /** @@ -1356,6 +1341,7 @@ public okhttp3.Call listUserGroupsFromUserAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listUsers * @@ -1414,7 +1400,6 @@ public okhttp3.Call listUsersCall(PaginationInput pagination, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1439,15 +1424,13 @@ public okhttp3.Call listUsersCall(PaginationInput pagination, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call listUsersValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling listUsers(Async)"); } - okhttp3.Call localVarCall = listUsersCall(pagination, _callback); - return localVarCall; + return listUsersCall(pagination, _callback); } /** @@ -1520,6 +1503,7 @@ public okhttp3.Call listUsersAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replacePermissionsForUser * @@ -1560,8 +1544,8 @@ public okhttp3.Call replacePermissionsForUserCall( // create path and map variables String localVarPath = "/users/{userId}/permissions" - .replaceAll( - "\\{" + "userId" + "\\}", + .replace( + "{" + "userId" + "}", localVarApiClient.escapeString(userId.toString())); List localVarQueryParams = new ArrayList(); @@ -1613,7 +1597,6 @@ private okhttp3.Call replacePermissionsForUserValidateBeforeCall( ReplacePermissionsForUserV1Input replacePermissionsForUserV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException( @@ -1628,9 +1611,7 @@ private okhttp3.Call replacePermissionsForUserValidateBeforeCall( + " replacePermissionsForUser(Async)"); } - okhttp3.Call localVarCall = - replacePermissionsForUserCall(userId, replacePermissionsForUserV1Input, _callback); - return localVarCall; + return replacePermissionsForUserCall(userId, replacePermissionsForUserV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/LabelsApi.java b/src/main/java/com/segment/publicapi/api/LabelsApi.java index 10e9ebe8..e9ae9d8f 100644 --- a/src/main/java/com/segment/publicapi/api/LabelsApi.java +++ b/src/main/java/com/segment/publicapi/api/LabelsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -150,7 +149,6 @@ public okhttp3.Call createLabelCall( private okhttp3.Call createLabelValidateBeforeCall( CreateLabelV1Input createLabelV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createLabelV1Input' is set if (createLabelV1Input == null) { throw new ApiException( @@ -158,8 +156,7 @@ private okhttp3.Call createLabelValidateBeforeCall( + " createLabel(Async)"); } - okhttp3.Call localVarCall = createLabelCall(createLabelV1Input, _callback); - return localVarCall; + return createLabelCall(createLabelV1Input, _callback); } /** @@ -250,6 +247,7 @@ public okhttp3.Call createLabelAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteLabel * @@ -287,11 +285,9 @@ public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback // create path and map variables String localVarPath = "/labels/{key}/{value}" - .replaceAll( - "\\{" + "key" + "\\}", - localVarApiClient.escapeString(key.toString())) - .replaceAll( - "\\{" + "value" + "\\}", + .replace("{" + "key" + "}", localVarApiClient.escapeString(key.toString())) + .replace( + "{" + "value" + "}", localVarApiClient.escapeString(value.toString())); List localVarQueryParams = new ArrayList(); @@ -312,7 +308,6 @@ public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -337,7 +332,6 @@ public okhttp3.Call deleteLabelCall(String key, String value, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call deleteLabelValidateBeforeCall( String key, String value, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'key' is set if (key == null) { throw new ApiException( @@ -350,8 +344,7 @@ private okhttp3.Call deleteLabelValidateBeforeCall( "Missing the required parameter 'value' when calling deleteLabel(Async)"); } - okhttp3.Call localVarCall = deleteLabelCall(key, value, _callback); - return localVarCall; + return deleteLabelCall(key, value, _callback); } /** @@ -442,6 +435,7 @@ public okhttp3.Call deleteLabelAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listLabels * @@ -494,7 +488,6 @@ public okhttp3.Call listLabelsCall(final ApiCallback _callback) throws ApiExcept } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -519,9 +512,7 @@ public okhttp3.Call listLabelsCall(final ApiCallback _callback) throws ApiExcept @SuppressWarnings("rawtypes") private okhttp3.Call listLabelsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = listLabelsCall(_callback); - return localVarCall; + return listLabelsCall(_callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java index 882dbfea..a1b22d94 100644 --- a/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java +++ b/src/main/java/com/segment/publicapi/api/MonthlyTrackedUsersApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -131,7 +130,6 @@ public okhttp3.Call getDailyPerSourceMTUUsageCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -157,7 +155,6 @@ public okhttp3.Call getDailyPerSourceMTUUsageCall( private okhttp3.Call getDailyPerSourceMTUUsageValidateBeforeCall( String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'period' is set if (period == null) { throw new ApiException( @@ -172,8 +169,7 @@ private okhttp3.Call getDailyPerSourceMTUUsageValidateBeforeCall( + " getDailyPerSourceMTUUsage(Async)"); } - okhttp3.Call localVarCall = getDailyPerSourceMTUUsageCall(period, pagination, _callback); - return localVarCall; + return getDailyPerSourceMTUUsageCall(period, pagination, _callback); } /** @@ -266,6 +262,7 @@ public okhttp3.Call getDailyPerSourceMTUUsageAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getDailyWorkspaceMTUUsage * @@ -332,7 +329,6 @@ public okhttp3.Call getDailyWorkspaceMTUUsageCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -358,7 +354,6 @@ public okhttp3.Call getDailyWorkspaceMTUUsageCall( private okhttp3.Call getDailyWorkspaceMTUUsageValidateBeforeCall( String period, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'period' is set if (period == null) { throw new ApiException( @@ -373,8 +368,7 @@ private okhttp3.Call getDailyWorkspaceMTUUsageValidateBeforeCall( + " getDailyWorkspaceMTUUsage(Async)"); } - okhttp3.Call localVarCall = getDailyWorkspaceMTUUsageCall(period, pagination, _callback); - return localVarCall; + return getDailyWorkspaceMTUUsageCall(period, pagination, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java index 8f83fdac..f7c4f9d9 100644 --- a/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/ProfilesSyncApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -112,8 +111,8 @@ public okhttp3.Call createProfilesWarehouseCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/profiles-warehouses" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -158,7 +157,6 @@ private okhttp3.Call createProfilesWarehouseValidateBeforeCall( CreateProfilesWarehouseAlphaInput createProfilesWarehouseAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -173,9 +171,7 @@ private okhttp3.Call createProfilesWarehouseValidateBeforeCall( + " calling createProfilesWarehouse(Async)"); } - okhttp3.Call localVarCall = - createProfilesWarehouseCall(spaceId, createProfilesWarehouseAlphaInput, _callback); - return localVarCall; + return createProfilesWarehouseCall(spaceId, createProfilesWarehouseAlphaInput, _callback); } /** @@ -267,6 +263,7 @@ public okhttp3.Call createProfilesWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listProfilesWarehouseInSpace * @@ -306,8 +303,8 @@ public okhttp3.Call listProfilesWarehouseInSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/profiles-warehouses" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -329,7 +326,6 @@ public okhttp3.Call listProfilesWarehouseInSpaceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -355,7 +351,6 @@ public okhttp3.Call listProfilesWarehouseInSpaceCall( private okhttp3.Call listProfilesWarehouseInSpaceValidateBeforeCall( String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -363,9 +358,7 @@ private okhttp3.Call listProfilesWarehouseInSpaceValidateBeforeCall( + " listProfilesWarehouseInSpace(Async)"); } - okhttp3.Call localVarCall = - listProfilesWarehouseInSpaceCall(spaceId, pagination, _callback); - return localVarCall; + return listProfilesWarehouseInSpaceCall(spaceId, pagination, _callback); } /** @@ -459,6 +452,7 @@ public okhttp3.Call listProfilesWarehouseInSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSelectiveSyncsFromWarehouseAndSpace * @@ -502,11 +496,11 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -528,7 +522,6 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -557,7 +550,6 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -579,10 +571,8 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceValidateBeforeCall( + " listSelectiveSyncsFromWarehouseAndSpace(Async)"); } - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSpaceCall( - spaceId, warehouseId, pagination, _callback); - return localVarCall; + return listSelectiveSyncsFromWarehouseAndSpaceCall( + spaceId, warehouseId, pagination, _callback); } /** @@ -683,6 +673,7 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeProfilesWarehouseFromSpace * @@ -720,11 +711,11 @@ public okhttp3.Call removeProfilesWarehouseFromSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/profiles-warehouses/{warehouseId}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -742,7 +733,6 @@ public okhttp3.Call removeProfilesWarehouseFromSpaceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -767,7 +757,6 @@ public okhttp3.Call removeProfilesWarehouseFromSpaceCall( @SuppressWarnings("rawtypes") private okhttp3.Call removeProfilesWarehouseFromSpaceValidateBeforeCall( String spaceId, String warehouseId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -782,9 +771,7 @@ private okhttp3.Call removeProfilesWarehouseFromSpaceValidateBeforeCall( + " removeProfilesWarehouseFromSpace(Async)"); } - okhttp3.Call localVarCall = - removeProfilesWarehouseFromSpaceCall(spaceId, warehouseId, _callback); - return localVarCall; + return removeProfilesWarehouseFromSpaceCall(spaceId, warehouseId, _callback); } /** @@ -875,6 +862,7 @@ public okhttp3.Call removeProfilesWarehouseFromSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateProfilesWarehouseForSpaceWarehouse * @@ -918,11 +906,11 @@ public okhttp3.Call updateProfilesWarehouseForSpaceWarehouseCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/profiles-warehouses/{warehouseId}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -969,7 +957,6 @@ private okhttp3.Call updateProfilesWarehouseForSpaceWarehouseValidateBeforeCall( updateProfilesWarehouseForSpaceWarehouseAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -992,13 +979,11 @@ private okhttp3.Call updateProfilesWarehouseForSpaceWarehouseValidateBeforeCall( + " updateProfilesWarehouseForSpaceWarehouse(Async)"); } - okhttp3.Call localVarCall = - updateProfilesWarehouseForSpaceWarehouseCall( - spaceId, - warehouseId, - updateProfilesWarehouseForSpaceWarehouseAlphaInput, - _callback); - return localVarCall; + return updateProfilesWarehouseForSpaceWarehouseCall( + spaceId, + warehouseId, + updateProfilesWarehouseForSpaceWarehouseAlphaInput, + _callback); } /** @@ -1112,6 +1097,7 @@ public okhttp3.Call updateProfilesWarehouseForSpaceWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateSelectiveSyncForWarehouseAndSpace * @@ -1155,11 +1141,11 @@ public okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/profiles-warehouses/{warehouseId}/selective-syncs" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -1206,7 +1192,6 @@ private okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( updateSelectiveSyncForWarehouseAndSpaceAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -1229,13 +1214,8 @@ private okhttp3.Call updateSelectiveSyncForWarehouseAndSpaceValidateBeforeCall( + " updateSelectiveSyncForWarehouseAndSpace(Async)"); } - okhttp3.Call localVarCall = - updateSelectiveSyncForWarehouseAndSpaceCall( - spaceId, - warehouseId, - updateSelectiveSyncForWarehouseAndSpaceAlphaInput, - _callback); - return localVarCall; + return updateSelectiveSyncForWarehouseAndSpaceCall( + spaceId, warehouseId, updateSelectiveSyncForWarehouseAndSpaceAlphaInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index fe5aa548..abed2854 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -147,7 +146,6 @@ public okhttp3.Call createReverseEtlModelCall( private okhttp3.Call createReverseEtlModelValidateBeforeCall( CreateReverseEtlModelInput createReverseEtlModelInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createReverseEtlModelInput' is set if (createReverseEtlModelInput == null) { throw new ApiException( @@ -155,9 +153,7 @@ private okhttp3.Call createReverseEtlModelValidateBeforeCall( + " createReverseEtlModel(Async)"); } - okhttp3.Call localVarCall = - createReverseEtlModelCall(createReverseEtlModelInput, _callback); - return localVarCall; + return createReverseEtlModelCall(createReverseEtlModelInput, _callback); } /** @@ -239,6 +235,7 @@ public okhttp3.Call createReverseEtlModelAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteReverseEtlModel * @@ -275,8 +272,8 @@ public okhttp3.Call deleteReverseEtlModelCall(String modelId, final ApiCallback // create path and map variables String localVarPath = "/reverse-etl-models/{modelId}" - .replaceAll( - "\\{" + "modelId" + "\\}", + .replace( + "{" + "modelId" + "}", localVarApiClient.escapeString(modelId.toString())); List localVarQueryParams = new ArrayList(); @@ -294,7 +291,6 @@ public okhttp3.Call deleteReverseEtlModelCall(String modelId, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -319,7 +315,6 @@ public okhttp3.Call deleteReverseEtlModelCall(String modelId, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call deleteReverseEtlModelValidateBeforeCall( String modelId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'modelId' is set if (modelId == null) { throw new ApiException( @@ -327,8 +322,7 @@ private okhttp3.Call deleteReverseEtlModelValidateBeforeCall( + " deleteReverseEtlModel(Async)"); } - okhttp3.Call localVarCall = deleteReverseEtlModelCall(modelId, _callback); - return localVarCall; + return deleteReverseEtlModelCall(modelId, _callback); } /** @@ -407,6 +401,7 @@ public okhttp3.Call deleteReverseEtlModelAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getReverseEtlModel * @@ -443,8 +438,8 @@ public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _ca // create path and map variables String localVarPath = "/reverse-etl-models/{modelId}" - .replaceAll( - "\\{" + "modelId" + "\\}", + .replace( + "{" + "modelId" + "}", localVarApiClient.escapeString(modelId.toString())); List localVarQueryParams = new ArrayList(); @@ -462,7 +457,6 @@ public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _ca } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -487,7 +481,6 @@ public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _ca @SuppressWarnings("rawtypes") private okhttp3.Call getReverseEtlModelValidateBeforeCall( String modelId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'modelId' is set if (modelId == null) { throw new ApiException( @@ -495,8 +488,7 @@ private okhttp3.Call getReverseEtlModelValidateBeforeCall( + " getReverseEtlModel(Async)"); } - okhttp3.Call localVarCall = getReverseEtlModelCall(modelId, _callback); - return localVarCall; + return getReverseEtlModelCall(modelId, _callback); } /** @@ -570,6 +562,7 @@ public okhttp3.Call getReverseEtlModelAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listReverseEtlModels * @@ -626,7 +619,6 @@ public okhttp3.Call listReverseEtlModelsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -651,7 +643,6 @@ public okhttp3.Call listReverseEtlModelsCall( @SuppressWarnings("rawtypes") private okhttp3.Call listReverseEtlModelsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -659,8 +650,7 @@ private okhttp3.Call listReverseEtlModelsValidateBeforeCall( + " listReverseEtlModels(Async)"); } - okhttp3.Call localVarCall = listReverseEtlModelsCall(pagination, _callback); - return localVarCall; + return listReverseEtlModelsCall(pagination, _callback); } /** @@ -739,6 +729,7 @@ public okhttp3.Call listReverseEtlModelsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateReverseEtlModel * @@ -779,8 +770,8 @@ public okhttp3.Call updateReverseEtlModelCall( // create path and map variables String localVarPath = "/reverse-etl-models/{modelId}" - .replaceAll( - "\\{" + "modelId" + "\\}", + .replace( + "{" + "modelId" + "}", localVarApiClient.escapeString(modelId.toString())); List localVarQueryParams = new ArrayList(); @@ -825,7 +816,6 @@ private okhttp3.Call updateReverseEtlModelValidateBeforeCall( UpdateReverseEtlModelInput updateReverseEtlModelInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'modelId' is set if (modelId == null) { throw new ApiException( @@ -840,9 +830,7 @@ private okhttp3.Call updateReverseEtlModelValidateBeforeCall( + " updateReverseEtlModel(Async)"); } - okhttp3.Call localVarCall = - updateReverseEtlModelCall(modelId, updateReverseEtlModelInput, _callback); - return localVarCall; + return updateReverseEtlModelCall(modelId, updateReverseEtlModelInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java index 7b7ee5b6..4738e486 100644 --- a/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java +++ b/src/main/java/com/segment/publicapi/api/SelectiveSyncApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -107,8 +106,8 @@ public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/advanced-sync-schedule" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -129,7 +128,6 @@ public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -154,7 +152,6 @@ public okhttp3.Call getAdvancedSyncScheduleFromWarehouseCall( @SuppressWarnings("rawtypes") private okhttp3.Call getAdvancedSyncScheduleFromWarehouseValidateBeforeCall( String warehouseId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -162,9 +159,7 @@ private okhttp3.Call getAdvancedSyncScheduleFromWarehouseValidateBeforeCall( + " getAdvancedSyncScheduleFromWarehouse(Async)"); } - okhttp3.Call localVarCall = - getAdvancedSyncScheduleFromWarehouseCall(warehouseId, _callback); - return localVarCall; + return getAdvancedSyncScheduleFromWarehouseCall(warehouseId, _callback); } /** @@ -257,6 +252,7 @@ public okhttp3.Call getAdvancedSyncScheduleFromWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSelectiveSyncsFromWarehouseAndSource * @@ -299,11 +295,11 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -328,7 +324,6 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -357,7 +352,6 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -379,10 +373,8 @@ private okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceValidateBeforeCall( + " listSelectiveSyncsFromWarehouseAndSource(Async)"); } - okhttp3.Call localVarCall = - listSelectiveSyncsFromWarehouseAndSourceCall( - warehouseId, sourceId, pagination, _callback); - return localVarCall; + return listSelectiveSyncsFromWarehouseAndSourceCall( + warehouseId, sourceId, pagination, _callback); } /** @@ -489,6 +481,7 @@ public okhttp3.Call listSelectiveSyncsFromWarehouseAndSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSyncsFromWarehouse * @@ -527,8 +520,8 @@ public okhttp3.Call listSyncsFromWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/syncs" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -553,7 +546,6 @@ public okhttp3.Call listSyncsFromWarehouseCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -579,7 +571,6 @@ public okhttp3.Call listSyncsFromWarehouseCall( private okhttp3.Call listSyncsFromWarehouseValidateBeforeCall( String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -594,8 +585,7 @@ private okhttp3.Call listSyncsFromWarehouseValidateBeforeCall( + " listSyncsFromWarehouse(Async)"); } - okhttp3.Call localVarCall = listSyncsFromWarehouseCall(warehouseId, pagination, _callback); - return localVarCall; + return listSyncsFromWarehouseCall(warehouseId, pagination, _callback); } /** @@ -689,6 +679,7 @@ public okhttp3.Call listSyncsFromWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSyncsFromWarehouseAndSource * @@ -731,11 +722,11 @@ public okhttp3.Call listSyncsFromWarehouseAndSourceCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -760,7 +751,6 @@ public okhttp3.Call listSyncsFromWarehouseAndSourceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -789,7 +779,6 @@ private okhttp3.Call listSyncsFromWarehouseAndSourceValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -811,9 +800,7 @@ private okhttp3.Call listSyncsFromWarehouseAndSourceValidateBeforeCall( + " listSyncsFromWarehouseAndSource(Async)"); } - okhttp3.Call localVarCall = - listSyncsFromWarehouseAndSourceCall(warehouseId, sourceId, pagination, _callback); - return localVarCall; + return listSyncsFromWarehouseAndSourceCall(warehouseId, sourceId, pagination, _callback); } /** @@ -917,6 +904,7 @@ public okhttp3.Call listSyncsFromWarehouseAndSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replaceAdvancedSyncScheduleForWarehouse * @@ -958,8 +946,8 @@ public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/advanced-sync-schedule" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -1012,7 +1000,6 @@ private okhttp3.Call replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall( replaceAdvancedSyncScheduleForWarehouseV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -1028,10 +1015,8 @@ private okhttp3.Call replaceAdvancedSyncScheduleForWarehouseValidateBeforeCall( + " replaceAdvancedSyncScheduleForWarehouse(Async)"); } - okhttp3.Call localVarCall = - replaceAdvancedSyncScheduleForWarehouseCall( - warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, _callback); - return localVarCall; + return replaceAdvancedSyncScheduleForWarehouseCall( + warehouseId, replaceAdvancedSyncScheduleForWarehouseV1Input, _callback); } /** @@ -1140,6 +1125,7 @@ public okhttp3.Call replaceAdvancedSyncScheduleForWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateSelectiveSyncForWarehouse * @@ -1180,8 +1166,8 @@ public okhttp3.Call updateSelectiveSyncForWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/selective-sync" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -1233,7 +1219,6 @@ private okhttp3.Call updateSelectiveSyncForWarehouseValidateBeforeCall( UpdateSelectiveSyncForWarehouseV1Input updateSelectiveSyncForWarehouseV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -1248,10 +1233,8 @@ private okhttp3.Call updateSelectiveSyncForWarehouseValidateBeforeCall( + " calling updateSelectiveSyncForWarehouse(Async)"); } - okhttp3.Call localVarCall = - updateSelectiveSyncForWarehouseCall( - warehouseId, updateSelectiveSyncForWarehouseV1Input, _callback); - return localVarCall; + return updateSelectiveSyncForWarehouseCall( + warehouseId, updateSelectiveSyncForWarehouseV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/SourcesApi.java b/src/main/java/com/segment/publicapi/api/SourcesApi.java index d7ac8128..4fa402b1 100644 --- a/src/main/java/com/segment/publicapi/api/SourcesApi.java +++ b/src/main/java/com/segment/publicapi/api/SourcesApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -119,8 +118,8 @@ public okhttp3.Call addLabelsToSourceCall( // create path and map variables String localVarPath = "/sources/{sourceId}/labels" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -172,7 +171,6 @@ private okhttp3.Call addLabelsToSourceValidateBeforeCall( AddLabelsToSourceV1Input addLabelsToSourceV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -187,9 +185,7 @@ private okhttp3.Call addLabelsToSourceValidateBeforeCall( + " addLabelsToSource(Async)"); } - okhttp3.Call localVarCall = - addLabelsToSourceCall(sourceId, addLabelsToSourceV1Input, _callback); - return localVarCall; + return addLabelsToSourceCall(sourceId, addLabelsToSourceV1Input, _callback); } /** @@ -277,6 +273,7 @@ public okhttp3.Call addLabelsToSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createSource * @@ -361,7 +358,6 @@ public okhttp3.Call createSourceCall( private okhttp3.Call createSourceValidateBeforeCall( CreateSourceV1Input createSourceV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createSourceV1Input' is set if (createSourceV1Input == null) { throw new ApiException( @@ -369,8 +365,7 @@ private okhttp3.Call createSourceValidateBeforeCall( + " createSource(Async)"); } - okhttp3.Call localVarCall = createSourceCall(createSourceV1Input, _callback); - return localVarCall; + return createSourceCall(createSourceV1Input, _callback); } /** @@ -449,6 +444,7 @@ public okhttp3.Call createSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteSource * @@ -485,8 +481,8 @@ public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callbac // create path and map variables String localVarPath = "/sources/{sourceId}" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -507,7 +503,6 @@ public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callbac } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -532,15 +527,13 @@ public okhttp3.Call deleteSourceCall(String sourceId, final ApiCallback _callbac @SuppressWarnings("rawtypes") private okhttp3.Call deleteSourceValidateBeforeCall( String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( "Missing the required parameter 'sourceId' when calling deleteSource(Async)"); } - okhttp3.Call localVarCall = deleteSourceCall(sourceId, _callback); - return localVarCall; + return deleteSourceCall(sourceId, _callback); } /** @@ -616,6 +609,7 @@ public okhttp3.Call deleteSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getSource * @@ -652,8 +646,8 @@ public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) // create path and map variables String localVarPath = "/sources/{sourceId}" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -674,7 +668,6 @@ public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -699,15 +692,13 @@ public okhttp3.Call getSourceCall(String sourceId, final ApiCallback _callback) @SuppressWarnings("rawtypes") private okhttp3.Call getSourceValidateBeforeCall(String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( "Missing the required parameter 'sourceId' when calling getSource(Async)"); } - okhttp3.Call localVarCall = getSourceCall(sourceId, _callback); - return localVarCall; + return getSourceCall(sourceId, _callback); } /** @@ -780,6 +771,7 @@ public okhttp3.Call getSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listConnectedDestinationsFromSource * @@ -819,8 +811,8 @@ public okhttp3.Call listConnectedDestinationsFromSourceCall( // create path and map variables String localVarPath = "/sources/{sourceId}/connected-destinations" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -845,7 +837,6 @@ public okhttp3.Call listConnectedDestinationsFromSourceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -871,7 +862,6 @@ public okhttp3.Call listConnectedDestinationsFromSourceCall( private okhttp3.Call listConnectedDestinationsFromSourceValidateBeforeCall( String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -886,9 +876,7 @@ private okhttp3.Call listConnectedDestinationsFromSourceValidateBeforeCall( + " listConnectedDestinationsFromSource(Async)"); } - okhttp3.Call localVarCall = - listConnectedDestinationsFromSourceCall(sourceId, pagination, _callback); - return localVarCall; + return listConnectedDestinationsFromSourceCall(sourceId, pagination, _callback); } /** @@ -978,6 +966,7 @@ public okhttp3.Call listConnectedDestinationsFromSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listConnectedWarehousesFromSource * @@ -1017,8 +1006,8 @@ public okhttp3.Call listConnectedWarehousesFromSourceCall( // create path and map variables String localVarPath = "/sources/{sourceId}/connected-warehouses" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -1043,7 +1032,6 @@ public okhttp3.Call listConnectedWarehousesFromSourceCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1069,7 +1057,6 @@ public okhttp3.Call listConnectedWarehousesFromSourceCall( private okhttp3.Call listConnectedWarehousesFromSourceValidateBeforeCall( String sourceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -1084,9 +1071,7 @@ private okhttp3.Call listConnectedWarehousesFromSourceValidateBeforeCall( + " listConnectedWarehousesFromSource(Async)"); } - okhttp3.Call localVarCall = - listConnectedWarehousesFromSourceCall(sourceId, pagination, _callback); - return localVarCall; + return listConnectedWarehousesFromSourceCall(sourceId, pagination, _callback); } /** @@ -1176,6 +1161,7 @@ public okhttp3.Call listConnectedWarehousesFromSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSchemaSettingsInSource * @@ -1212,8 +1198,8 @@ public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCal // create path and map variables String localVarPath = "/sources/{sourceId}/settings" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -1234,7 +1220,6 @@ public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCal } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1259,7 +1244,6 @@ public okhttp3.Call listSchemaSettingsInSourceCall(String sourceId, final ApiCal @SuppressWarnings("rawtypes") private okhttp3.Call listSchemaSettingsInSourceValidateBeforeCall( String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -1267,8 +1251,7 @@ private okhttp3.Call listSchemaSettingsInSourceValidateBeforeCall( + " listSchemaSettingsInSource(Async)"); } - okhttp3.Call localVarCall = listSchemaSettingsInSourceCall(sourceId, _callback); - return localVarCall; + return listSchemaSettingsInSourceCall(sourceId, _callback); } /** @@ -1352,6 +1335,7 @@ public okhttp3.Call listSchemaSettingsInSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSources * @@ -1411,7 +1395,6 @@ public okhttp3.Call listSourcesCall(PaginationInput pagination, final ApiCallbac } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1436,15 +1419,13 @@ public okhttp3.Call listSourcesCall(PaginationInput pagination, final ApiCallbac @SuppressWarnings("rawtypes") private okhttp3.Call listSourcesValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( "Missing the required parameter 'pagination' when calling listSources(Async)"); } - okhttp3.Call localVarCall = listSourcesCall(pagination, _callback); - return localVarCall; + return listSourcesCall(pagination, _callback); } /** @@ -1520,6 +1501,7 @@ public okhttp3.Call listSourcesAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replaceLabelsInSource * @@ -1560,8 +1542,8 @@ public okhttp3.Call replaceLabelsInSourceCall( // create path and map variables String localVarPath = "/sources/{sourceId}/labels" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -1613,7 +1595,6 @@ private okhttp3.Call replaceLabelsInSourceValidateBeforeCall( ReplaceLabelsInSourceV1Input replaceLabelsInSourceV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -1628,9 +1609,7 @@ private okhttp3.Call replaceLabelsInSourceValidateBeforeCall( + " replaceLabelsInSource(Async)"); } - okhttp3.Call localVarCall = - replaceLabelsInSourceCall(sourceId, replaceLabelsInSourceV1Input, _callback); - return localVarCall; + return replaceLabelsInSourceCall(sourceId, replaceLabelsInSourceV1Input, _callback); } /** @@ -1716,6 +1695,7 @@ public okhttp3.Call replaceLabelsInSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateSchemaSettingsInSource * @@ -1756,8 +1736,8 @@ public okhttp3.Call updateSchemaSettingsInSourceCall( // create path and map variables String localVarPath = "/sources/{sourceId}/settings" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -1809,7 +1789,6 @@ private okhttp3.Call updateSchemaSettingsInSourceValidateBeforeCall( UpdateSchemaSettingsInSourceV1Input updateSchemaSettingsInSourceV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -1824,10 +1803,8 @@ private okhttp3.Call updateSchemaSettingsInSourceValidateBeforeCall( + " calling updateSchemaSettingsInSource(Async)"); } - okhttp3.Call localVarCall = - updateSchemaSettingsInSourceCall( - sourceId, updateSchemaSettingsInSourceV1Input, _callback); - return localVarCall; + return updateSchemaSettingsInSourceCall( + sourceId, updateSchemaSettingsInSourceV1Input, _callback); } /** @@ -1925,6 +1902,7 @@ public okhttp3.Call updateSchemaSettingsInSourceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateSource * @@ -1963,8 +1941,8 @@ public okhttp3.Call updateSourceCall( // create path and map variables String localVarPath = "/sources/{sourceId}" - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -2014,7 +1992,6 @@ public okhttp3.Call updateSourceCall( private okhttp3.Call updateSourceValidateBeforeCall( String sourceId, UpdateSourceV1Input updateSourceV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sourceId' is set if (sourceId == null) { throw new ApiException( @@ -2028,8 +2005,7 @@ private okhttp3.Call updateSourceValidateBeforeCall( + " updateSource(Async)"); } - okhttp3.Call localVarCall = updateSourceCall(sourceId, updateSourceV1Input, _callback); - return localVarCall; + return updateSourceCall(sourceId, updateSourceV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 687470a9..11895a7f 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -108,8 +107,8 @@ public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/messaging-subscriptions/batch" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -155,7 +154,6 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( batchQueryMessagingSubscriptionsForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -171,10 +169,8 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( + " batchQueryMessagingSubscriptionsForSpace(Async)"); } - okhttp3.Call localVarCall = - batchQueryMessagingSubscriptionsForSpaceCall( - spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback); - return localVarCall; + return batchQueryMessagingSubscriptionsForSpaceCall( + spaceId, batchQueryMessagingSubscriptionsForSpaceAlphaInput, _callback); } /** @@ -282,6 +278,7 @@ public okhttp3.Call batchQueryMessagingSubscriptionsForSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getSpace * @@ -318,8 +315,8 @@ public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) // create path and map variables String localVarPath = "/spaces/{spaceId}" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -337,7 +334,6 @@ public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -362,15 +358,13 @@ public okhttp3.Call getSpaceCall(String spaceId, final ApiCallback _callback) @SuppressWarnings("rawtypes") private okhttp3.Call getSpaceValidateBeforeCall(String spaceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( "Missing the required parameter 'spaceId' when calling getSpace(Async)"); } - okhttp3.Call localVarCall = getSpaceCall(spaceId, _callback); - return localVarCall; + return getSpaceCall(spaceId, _callback); } /** @@ -451,6 +445,7 @@ public okhttp3.Call getSpaceAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replaceMessagingSubscriptionsInSpaces * @@ -492,8 +487,8 @@ public okhttp3.Call replaceMessagingSubscriptionsInSpacesCall( // create path and map variables String localVarPath = "/spaces/{spaceId}/messaging-subscriptions" - .replaceAll( - "\\{" + "spaceId" + "\\}", + .replace( + "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); @@ -539,7 +534,6 @@ private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall( replaceMessagingSubscriptionsInSpacesAlphaInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -555,10 +549,8 @@ private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall( + " replaceMessagingSubscriptionsInSpaces(Async)"); } - okhttp3.Call localVarCall = - replaceMessagingSubscriptionsInSpacesCall( - spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback); - return localVarCall; + return replaceMessagingSubscriptionsInSpacesCall( + spaceId, replaceMessagingSubscriptionsInSpacesAlphaInput, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/TestingApi.java b/src/main/java/com/segment/publicapi/api/TestingApi.java index cf623c60..d2deb0ec 100644 --- a/src/main/java/com/segment/publicapi/api/TestingApi.java +++ b/src/main/java/com/segment/publicapi/api/TestingApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -167,7 +166,6 @@ public okhttp3.Call echoCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -199,23 +197,20 @@ private okhttp3.Call echoValidateBeforeCall( BigDecimal statusCode, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'message' is set if (message == null) { throw new ApiException( "Missing the required parameter 'message' when calling echo(Async)"); } - okhttp3.Call localVarCall = - echoCall( - message, - delay, - triggerError, - triggerMultipleErrors, - triggerUnexpectedError, - statusCode, - _callback); - return localVarCall; + return echoCall( + message, + delay, + triggerError, + triggerMultipleErrors, + triggerUnexpectedError, + statusCode, + _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java index ac9f86f0..f6b6d35b 100644 --- a/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java +++ b/src/main/java/com/segment/publicapi/api/TrackingPlansApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -121,8 +120,8 @@ public okhttp3.Call addSourceToTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/sources" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -174,7 +173,6 @@ private okhttp3.Call addSourceToTrackingPlanValidateBeforeCall( AddSourceToTrackingPlanV1Input addSourceToTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -189,10 +187,8 @@ private okhttp3.Call addSourceToTrackingPlanValidateBeforeCall( + " addSourceToTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - addSourceToTrackingPlanCall( - trackingPlanId, addSourceToTrackingPlanV1Input, _callback); - return localVarCall; + return addSourceToTrackingPlanCall( + trackingPlanId, addSourceToTrackingPlanV1Input, _callback); } /** @@ -290,6 +286,7 @@ public okhttp3.Call addSourceToTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createTrackingPlan * @@ -374,7 +371,6 @@ public okhttp3.Call createTrackingPlanCall( private okhttp3.Call createTrackingPlanValidateBeforeCall( CreateTrackingPlanV1Input createTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTrackingPlanV1Input' is set if (createTrackingPlanV1Input == null) { throw new ApiException( @@ -382,8 +378,7 @@ private okhttp3.Call createTrackingPlanValidateBeforeCall( + " createTrackingPlan(Async)"); } - okhttp3.Call localVarCall = createTrackingPlanCall(createTrackingPlanV1Input, _callback); - return localVarCall; + return createTrackingPlanCall(createTrackingPlanV1Input, _callback); } /** @@ -467,6 +462,7 @@ public okhttp3.Call createTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteTrackingPlan * @@ -503,8 +499,8 @@ public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallb // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -525,7 +521,6 @@ public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallb } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -550,7 +545,6 @@ public okhttp3.Call deleteTrackingPlanCall(String trackingPlanId, final ApiCallb @SuppressWarnings("rawtypes") private okhttp3.Call deleteTrackingPlanValidateBeforeCall( String trackingPlanId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -558,8 +552,7 @@ private okhttp3.Call deleteTrackingPlanValidateBeforeCall( + " deleteTrackingPlan(Async)"); } - okhttp3.Call localVarCall = deleteTrackingPlanCall(trackingPlanId, _callback); - return localVarCall; + return deleteTrackingPlanCall(trackingPlanId, _callback); } /** @@ -640,6 +633,7 @@ public okhttp3.Call deleteTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getTrackingPlan * @@ -676,8 +670,8 @@ public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -698,7 +692,6 @@ public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -723,7 +716,6 @@ public okhttp3.Call getTrackingPlanCall(String trackingPlanId, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call getTrackingPlanValidateBeforeCall( String trackingPlanId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -731,8 +723,7 @@ private okhttp3.Call getTrackingPlanValidateBeforeCall( + " getTrackingPlan(Async)"); } - okhttp3.Call localVarCall = getTrackingPlanCall(trackingPlanId, _callback); - return localVarCall; + return getTrackingPlanCall(trackingPlanId, _callback); } /** @@ -812,6 +803,7 @@ public okhttp3.Call getTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listRulesFromTrackingPlan * @@ -850,8 +842,8 @@ public okhttp3.Call listRulesFromTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -876,7 +868,6 @@ public okhttp3.Call listRulesFromTrackingPlanCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -902,7 +893,6 @@ public okhttp3.Call listRulesFromTrackingPlanCall( private okhttp3.Call listRulesFromTrackingPlanValidateBeforeCall( String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -917,9 +907,7 @@ private okhttp3.Call listRulesFromTrackingPlanValidateBeforeCall( + " listRulesFromTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - listRulesFromTrackingPlanCall(trackingPlanId, pagination, _callback); - return localVarCall; + return listRulesFromTrackingPlanCall(trackingPlanId, pagination, _callback); } /** @@ -1021,6 +1009,7 @@ public okhttp3.Call listRulesFromTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listSourcesFromTrackingPlan * @@ -1059,8 +1048,8 @@ public okhttp3.Call listSourcesFromTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/sources" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -1085,7 +1074,6 @@ public okhttp3.Call listSourcesFromTrackingPlanCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1111,7 +1099,6 @@ public okhttp3.Call listSourcesFromTrackingPlanCall( private okhttp3.Call listSourcesFromTrackingPlanValidateBeforeCall( String trackingPlanId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -1126,9 +1113,7 @@ private okhttp3.Call listSourcesFromTrackingPlanValidateBeforeCall( + " listSourcesFromTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - listSourcesFromTrackingPlanCall(trackingPlanId, pagination, _callback); - return localVarCall; + return listSourcesFromTrackingPlanCall(trackingPlanId, pagination, _callback); } /** @@ -1226,6 +1211,7 @@ public okhttp3.Call listSourcesFromTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listTrackingPlans * @@ -1291,7 +1277,6 @@ public okhttp3.Call listTrackingPlansCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1317,7 +1302,6 @@ public okhttp3.Call listTrackingPlansCall( private okhttp3.Call listTrackingPlansValidateBeforeCall( String type, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1325,8 +1309,7 @@ private okhttp3.Call listTrackingPlansValidateBeforeCall( + " listTrackingPlans(Async)"); } - okhttp3.Call localVarCall = listTrackingPlansCall(type, pagination, _callback); - return localVarCall; + return listTrackingPlansCall(type, pagination, _callback); } /** @@ -1416,6 +1399,7 @@ public okhttp3.Call listTrackingPlansAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeRulesFromTrackingPlan * @@ -1454,8 +1438,8 @@ public okhttp3.Call removeRulesFromTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -1481,7 +1465,6 @@ public okhttp3.Call removeRulesFromTrackingPlanCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1507,7 +1490,6 @@ public okhttp3.Call removeRulesFromTrackingPlanCall( private okhttp3.Call removeRulesFromTrackingPlanValidateBeforeCall( String trackingPlanId, List rules, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -1522,9 +1504,7 @@ private okhttp3.Call removeRulesFromTrackingPlanValidateBeforeCall( + " removeRulesFromTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - removeRulesFromTrackingPlanCall(trackingPlanId, rules, _callback); - return localVarCall; + return removeRulesFromTrackingPlanCall(trackingPlanId, rules, _callback); } /** @@ -1615,6 +1595,7 @@ public okhttp3.Call removeRulesFromTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeSourceFromTrackingPlan * @@ -1654,8 +1635,8 @@ public okhttp3.Call removeSourceFromTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/sources" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -1680,7 +1661,6 @@ public okhttp3.Call removeSourceFromTrackingPlanCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1706,7 +1686,6 @@ public okhttp3.Call removeSourceFromTrackingPlanCall( private okhttp3.Call removeSourceFromTrackingPlanValidateBeforeCall( String trackingPlanId, String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -1721,9 +1700,7 @@ private okhttp3.Call removeSourceFromTrackingPlanValidateBeforeCall( + " removeSourceFromTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - removeSourceFromTrackingPlanCall(trackingPlanId, sourceId, _callback); - return localVarCall; + return removeSourceFromTrackingPlanCall(trackingPlanId, sourceId, _callback); } /** @@ -1823,6 +1800,7 @@ public okhttp3.Call removeSourceFromTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for replaceRulesInTrackingPlan * @@ -1863,8 +1841,8 @@ public okhttp3.Call replaceRulesInTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -1916,7 +1894,6 @@ private okhttp3.Call replaceRulesInTrackingPlanValidateBeforeCall( ReplaceRulesInTrackingPlanV1Input replaceRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -1931,10 +1908,8 @@ private okhttp3.Call replaceRulesInTrackingPlanValidateBeforeCall( + " calling replaceRulesInTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - replaceRulesInTrackingPlanCall( - trackingPlanId, replaceRulesInTrackingPlanV1Input, _callback); - return localVarCall; + return replaceRulesInTrackingPlanCall( + trackingPlanId, replaceRulesInTrackingPlanV1Input, _callback); } /** @@ -2032,6 +2007,7 @@ public okhttp3.Call replaceRulesInTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateRulesInTrackingPlan * @@ -2072,8 +2048,8 @@ public okhttp3.Call updateRulesInTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}/rules" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -2125,7 +2101,6 @@ private okhttp3.Call updateRulesInTrackingPlanValidateBeforeCall( UpdateRulesInTrackingPlanV1Input updateRulesInTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -2140,10 +2115,8 @@ private okhttp3.Call updateRulesInTrackingPlanValidateBeforeCall( + " updateRulesInTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - updateRulesInTrackingPlanCall( - trackingPlanId, updateRulesInTrackingPlanV1Input, _callback); - return localVarCall; + return updateRulesInTrackingPlanCall( + trackingPlanId, updateRulesInTrackingPlanV1Input, _callback); } /** @@ -2240,6 +2213,7 @@ public okhttp3.Call updateRulesInTrackingPlanAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateTrackingPlan * @@ -2280,8 +2254,8 @@ public okhttp3.Call updateTrackingPlanCall( // create path and map variables String localVarPath = "/tracking-plans/{trackingPlanId}" - .replaceAll( - "\\{" + "trackingPlanId" + "\\}", + .replace( + "{" + "trackingPlanId" + "}", localVarApiClient.escapeString(trackingPlanId.toString())); List localVarQueryParams = new ArrayList(); @@ -2333,7 +2307,6 @@ private okhttp3.Call updateTrackingPlanValidateBeforeCall( UpdateTrackingPlanV1Input updateTrackingPlanV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'trackingPlanId' is set if (trackingPlanId == null) { throw new ApiException( @@ -2348,9 +2321,7 @@ private okhttp3.Call updateTrackingPlanValidateBeforeCall( + " updateTrackingPlan(Async)"); } - okhttp3.Call localVarCall = - updateTrackingPlanCall(trackingPlanId, updateTrackingPlanV1Input, _callback); - return localVarCall; + return updateTrackingPlanCall(trackingPlanId, updateTrackingPlanV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/TransformationsApi.java b/src/main/java/com/segment/publicapi/api/TransformationsApi.java index e7b4a01b..c7daba51 100644 --- a/src/main/java/com/segment/publicapi/api/TransformationsApi.java +++ b/src/main/java/com/segment/publicapi/api/TransformationsApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -154,7 +153,6 @@ public okhttp3.Call createTransformationCall( private okhttp3.Call createTransformationValidateBeforeCall( CreateTransformationV1Input createTransformationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createTransformationV1Input' is set if (createTransformationV1Input == null) { throw new ApiException( @@ -162,9 +160,7 @@ private okhttp3.Call createTransformationValidateBeforeCall( + " createTransformation(Async)"); } - okhttp3.Call localVarCall = - createTransformationCall(createTransformationV1Input, _callback); - return localVarCall; + return createTransformationCall(createTransformationV1Input, _callback); } /** @@ -252,6 +248,7 @@ public okhttp3.Call createTransformationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteTransformation * @@ -288,8 +285,8 @@ public okhttp3.Call deleteTransformationCall( // create path and map variables String localVarPath = "/transformations/{transformationId}" - .replaceAll( - "\\{" + "transformationId" + "\\}", + .replace( + "{" + "transformationId" + "}", localVarApiClient.escapeString(transformationId.toString())); List localVarQueryParams = new ArrayList(); @@ -310,7 +307,6 @@ public okhttp3.Call deleteTransformationCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -335,7 +331,6 @@ public okhttp3.Call deleteTransformationCall( @SuppressWarnings("rawtypes") private okhttp3.Call deleteTransformationValidateBeforeCall( String transformationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'transformationId' is set if (transformationId == null) { throw new ApiException( @@ -343,8 +338,7 @@ private okhttp3.Call deleteTransformationValidateBeforeCall( + " deleteTransformation(Async)"); } - okhttp3.Call localVarCall = deleteTransformationCall(transformationId, _callback); - return localVarCall; + return deleteTransformationCall(transformationId, _callback); } /** @@ -430,6 +424,7 @@ public okhttp3.Call deleteTransformationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getTransformation * @@ -466,8 +461,8 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall // create path and map variables String localVarPath = "/transformations/{transformationId}" - .replaceAll( - "\\{" + "transformationId" + "\\}", + .replace( + "{" + "transformationId" + "}", localVarApiClient.escapeString(transformationId.toString())); List localVarQueryParams = new ArrayList(); @@ -488,7 +483,6 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -513,7 +507,6 @@ public okhttp3.Call getTransformationCall(String transformationId, final ApiCall @SuppressWarnings("rawtypes") private okhttp3.Call getTransformationValidateBeforeCall( String transformationId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'transformationId' is set if (transformationId == null) { throw new ApiException( @@ -521,8 +514,7 @@ private okhttp3.Call getTransformationValidateBeforeCall( + " getTransformation(Async)"); } - okhttp3.Call localVarCall = getTransformationCall(transformationId, _callback); - return localVarCall; + return getTransformationCall(transformationId, _callback); } /** @@ -604,6 +596,7 @@ public okhttp3.Call getTransformationAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listTransformations * @@ -662,7 +655,6 @@ public okhttp3.Call listTransformationsCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -687,7 +679,6 @@ public okhttp3.Call listTransformationsCall( @SuppressWarnings("rawtypes") private okhttp3.Call listTransformationsValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -695,8 +686,7 @@ private okhttp3.Call listTransformationsValidateBeforeCall( + " listTransformations(Async)"); } - okhttp3.Call localVarCall = listTransformationsCall(pagination, _callback); - return localVarCall; + return listTransformationsCall(pagination, _callback); } /** @@ -777,6 +767,7 @@ public okhttp3.Call listTransformationsAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateTransformation * @@ -817,8 +808,8 @@ public okhttp3.Call updateTransformationCall( // create path and map variables String localVarPath = "/transformations/{transformationId}" - .replaceAll( - "\\{" + "transformationId" + "\\}", + .replace( + "{" + "transformationId" + "}", localVarApiClient.escapeString(transformationId.toString())); List localVarQueryParams = new ArrayList(); @@ -870,7 +861,6 @@ private okhttp3.Call updateTransformationValidateBeforeCall( UpdateTransformationV1Input updateTransformationV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'transformationId' is set if (transformationId == null) { throw new ApiException( @@ -885,9 +875,7 @@ private okhttp3.Call updateTransformationValidateBeforeCall( + " updateTransformation(Async)"); } - okhttp3.Call localVarCall = - updateTransformationCall(transformationId, updateTransformationV1Input, _callback); - return localVarCall; + return updateTransformationCall(transformationId, updateTransformationV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/WarehousesApi.java b/src/main/java/com/segment/publicapi/api/WarehousesApi.java index 4d8ffa53..b89a64e1 100644 --- a/src/main/java/com/segment/publicapi/api/WarehousesApi.java +++ b/src/main/java/com/segment/publicapi/api/WarehousesApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -113,11 +112,11 @@ public okhttp3.Call addConnectionFromSourceToWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -138,7 +137,6 @@ public okhttp3.Call addConnectionFromSourceToWarehouseCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -163,7 +161,6 @@ public okhttp3.Call addConnectionFromSourceToWarehouseCall( @SuppressWarnings("rawtypes") private okhttp3.Call addConnectionFromSourceToWarehouseValidateBeforeCall( String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -178,9 +175,7 @@ private okhttp3.Call addConnectionFromSourceToWarehouseValidateBeforeCall( + " addConnectionFromSourceToWarehouse(Async)"); } - okhttp3.Call localVarCall = - addConnectionFromSourceToWarehouseCall(warehouseId, sourceId, _callback); - return localVarCall; + return addConnectionFromSourceToWarehouseCall(warehouseId, sourceId, _callback); } /** @@ -272,6 +267,7 @@ public okhttp3.Call addConnectionFromSourceToWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createValidationInWarehouse * @@ -358,7 +354,6 @@ private okhttp3.Call createValidationInWarehouseValidateBeforeCall( CreateValidationInWarehouseV1Input createValidationInWarehouseV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createValidationInWarehouseV1Input' is set if (createValidationInWarehouseV1Input == null) { throw new ApiException( @@ -366,9 +361,7 @@ private okhttp3.Call createValidationInWarehouseValidateBeforeCall( + " calling createValidationInWarehouse(Async)"); } - okhttp3.Call localVarCall = - createValidationInWarehouseCall(createValidationInWarehouseV1Input, _callback); - return localVarCall; + return createValidationInWarehouseCall(createValidationInWarehouseV1Input, _callback); } /** @@ -459,6 +452,7 @@ public okhttp3.Call createValidationInWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for createWarehouse * @@ -543,7 +537,6 @@ public okhttp3.Call createWarehouseCall( private okhttp3.Call createWarehouseValidateBeforeCall( CreateWarehouseV1Input createWarehouseV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createWarehouseV1Input' is set if (createWarehouseV1Input == null) { throw new ApiException( @@ -551,8 +544,7 @@ private okhttp3.Call createWarehouseValidateBeforeCall( + " createWarehouse(Async)"); } - okhttp3.Call localVarCall = createWarehouseCall(createWarehouseV1Input, _callback); - return localVarCall; + return createWarehouseCall(createWarehouseV1Input, _callback); } /** @@ -633,6 +625,7 @@ public okhttp3.Call createWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for deleteWarehouse * @@ -669,8 +662,8 @@ public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _c // create path and map variables String localVarPath = "/warehouses/{warehouseId}" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -691,7 +684,6 @@ public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _c } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -716,7 +708,6 @@ public okhttp3.Call deleteWarehouseCall(String warehouseId, final ApiCallback _c @SuppressWarnings("rawtypes") private okhttp3.Call deleteWarehouseValidateBeforeCall( String warehouseId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -724,8 +715,7 @@ private okhttp3.Call deleteWarehouseValidateBeforeCall( + " deleteWarehouse(Async)"); } - okhttp3.Call localVarCall = deleteWarehouseCall(warehouseId, _callback); - return localVarCall; + return deleteWarehouseCall(warehouseId, _callback); } /** @@ -803,6 +793,7 @@ public okhttp3.Call deleteWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getConnectionStateFromWarehouse * @@ -839,8 +830,8 @@ public okhttp3.Call getConnectionStateFromWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/connection-state" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -861,7 +852,6 @@ public okhttp3.Call getConnectionStateFromWarehouseCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -886,7 +876,6 @@ public okhttp3.Call getConnectionStateFromWarehouseCall( @SuppressWarnings("rawtypes") private okhttp3.Call getConnectionStateFromWarehouseValidateBeforeCall( String warehouseId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -894,8 +883,7 @@ private okhttp3.Call getConnectionStateFromWarehouseValidateBeforeCall( + " getConnectionStateFromWarehouse(Async)"); } - okhttp3.Call localVarCall = getConnectionStateFromWarehouseCall(warehouseId, _callback); - return localVarCall; + return getConnectionStateFromWarehouseCall(warehouseId, _callback); } /** @@ -987,6 +975,7 @@ public okhttp3.Call getConnectionStateFromWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for getWarehouse * @@ -1023,8 +1012,8 @@ public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _call // create path and map variables String localVarPath = "/warehouses/{warehouseId}" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -1045,7 +1034,6 @@ public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _call } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1070,7 +1058,6 @@ public okhttp3.Call getWarehouseCall(String warehouseId, final ApiCallback _call @SuppressWarnings("rawtypes") private okhttp3.Call getWarehouseValidateBeforeCall( String warehouseId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -1078,8 +1065,7 @@ private okhttp3.Call getWarehouseValidateBeforeCall( + " getWarehouse(Async)"); } - okhttp3.Call localVarCall = getWarehouseCall(warehouseId, _callback); - return localVarCall; + return getWarehouseCall(warehouseId, _callback); } /** @@ -1152,6 +1138,7 @@ public okhttp3.Call getWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listConnectedSourcesFromWarehouse * @@ -1190,8 +1177,8 @@ public okhttp3.Call listConnectedSourcesFromWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/connected-sources" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -1216,7 +1203,6 @@ public okhttp3.Call listConnectedSourcesFromWarehouseCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1242,7 +1228,6 @@ public okhttp3.Call listConnectedSourcesFromWarehouseCall( private okhttp3.Call listConnectedSourcesFromWarehouseValidateBeforeCall( String warehouseId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -1257,9 +1242,7 @@ private okhttp3.Call listConnectedSourcesFromWarehouseValidateBeforeCall( + " listConnectedSourcesFromWarehouse(Async)"); } - okhttp3.Call localVarCall = - listConnectedSourcesFromWarehouseCall(warehouseId, pagination, _callback); - return localVarCall; + return listConnectedSourcesFromWarehouseCall(warehouseId, pagination, _callback); } /** @@ -1348,6 +1331,7 @@ public okhttp3.Call listConnectedSourcesFromWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for listWarehouses * @@ -1406,7 +1390,6 @@ public okhttp3.Call listWarehousesCall(PaginationInput pagination, final ApiCall } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1431,7 +1414,6 @@ public okhttp3.Call listWarehousesCall(PaginationInput pagination, final ApiCall @SuppressWarnings("rawtypes") private okhttp3.Call listWarehousesValidateBeforeCall( PaginationInput pagination, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'pagination' is set if (pagination == null) { throw new ApiException( @@ -1439,8 +1421,7 @@ private okhttp3.Call listWarehousesValidateBeforeCall( + " listWarehouses(Async)"); } - okhttp3.Call localVarCall = listWarehousesCall(pagination, _callback); - return localVarCall; + return listWarehousesCall(pagination, _callback); } /** @@ -1515,6 +1496,7 @@ public okhttp3.Call listWarehousesAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for removeSourceConnectionFromWarehouse * @@ -1552,11 +1534,11 @@ public okhttp3.Call removeSourceConnectionFromWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}/connected-sources/{sourceId}" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())) - .replaceAll( - "\\{" + "sourceId" + "\\}", + .replace( + "{" + "sourceId" + "}", localVarApiClient.escapeString(sourceId.toString())); List localVarQueryParams = new ArrayList(); @@ -1577,7 +1559,6 @@ public okhttp3.Call removeSourceConnectionFromWarehouseCall( } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1602,7 +1583,6 @@ public okhttp3.Call removeSourceConnectionFromWarehouseCall( @SuppressWarnings("rawtypes") private okhttp3.Call removeSourceConnectionFromWarehouseValidateBeforeCall( String warehouseId, String sourceId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -1617,9 +1597,7 @@ private okhttp3.Call removeSourceConnectionFromWarehouseValidateBeforeCall( + " removeSourceConnectionFromWarehouse(Async)"); } - okhttp3.Call localVarCall = - removeSourceConnectionFromWarehouseCall(warehouseId, sourceId, _callback); - return localVarCall; + return removeSourceConnectionFromWarehouseCall(warehouseId, sourceId, _callback); } /** @@ -1706,6 +1684,7 @@ public okhttp3.Call removeSourceConnectionFromWarehouseAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** * Build call for updateWarehouse * @@ -1746,8 +1725,8 @@ public okhttp3.Call updateWarehouseCall( // create path and map variables String localVarPath = "/warehouses/{warehouseId}" - .replaceAll( - "\\{" + "warehouseId" + "\\}", + .replace( + "{" + "warehouseId" + "}", localVarApiClient.escapeString(warehouseId.toString())); List localVarQueryParams = new ArrayList(); @@ -1799,7 +1778,6 @@ private okhttp3.Call updateWarehouseValidateBeforeCall( UpdateWarehouseV1Input updateWarehouseV1Input, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'warehouseId' is set if (warehouseId == null) { throw new ApiException( @@ -1814,9 +1792,7 @@ private okhttp3.Call updateWarehouseValidateBeforeCall( + " updateWarehouse(Async)"); } - okhttp3.Call localVarCall = - updateWarehouseCall(warehouseId, updateWarehouseV1Input, _callback); - return localVarCall; + return updateWarehouseCall(warehouseId, updateWarehouseV1Input, _callback); } /** diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index 88cc0252..c4a0dc0c 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -11,7 +11,6 @@ package com.segment.publicapi.api; - import com.google.gson.reflect.TypeToken; import com.segment.publicapi.ApiCallback; import com.segment.publicapi.ApiClient; @@ -115,7 +114,6 @@ public okhttp3.Call getWorkspaceCall(final ApiCallback _callback) throws ApiExce } final String[] localVarContentTypes = {}; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -140,9 +138,7 @@ public okhttp3.Call getWorkspaceCall(final ApiCallback _callback) throws ApiExce @SuppressWarnings("rawtypes") private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getWorkspaceCall(_callback); - return localVarCall; + return getWorkspaceCall(_callback); } /** diff --git a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java index 6372e883..e55ea17c 100644 --- a/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java +++ b/src/main/java/com/segment/publicapi/auth/ApiKeyAuth.java @@ -11,7 +11,6 @@ package com.segment.publicapi.auth; - import com.segment.publicapi.ApiException; import com.segment.publicapi.Pair; import java.net.URI; diff --git a/src/main/java/com/segment/publicapi/auth/Authentication.java b/src/main/java/com/segment/publicapi/auth/Authentication.java index 34b1e2a0..29dcd339 100644 --- a/src/main/java/com/segment/publicapi/auth/Authentication.java +++ b/src/main/java/com/segment/publicapi/auth/Authentication.java @@ -11,7 +11,6 @@ package com.segment.publicapi.auth; - import com.segment.publicapi.ApiException; import com.segment.publicapi.Pair; import java.net.URI; diff --git a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java index 5937daea..d0c1cc61 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBasicAuth.java @@ -11,7 +11,6 @@ package com.segment.publicapi.auth; - import com.segment.publicapi.ApiException; import com.segment.publicapi.Pair; import java.net.URI; diff --git a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java index 8283d8d5..60799dea 100644 --- a/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java +++ b/src/main/java/com/segment/publicapi/auth/HttpBearerAuth.java @@ -11,7 +11,6 @@ package com.segment.publicapi.auth; - import com.segment.publicapi.ApiException; import com.segment.publicapi.Pair; import java.net.URI; diff --git a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java index 71c11dfb..92744319 100644 --- a/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java +++ b/src/main/java/com/segment/publicapi/models/APICallSnapshotV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** A snapshot of the number of API calls for a given Workspace. */ -@ApiModel(description = "A snapshot of the number of API calls for a given Workspace.") public class APICallSnapshotV1 { public static final String SERIALIZED_NAME_API_CALLS = "apiCalls"; @@ -57,9 +53,6 @@ public APICallSnapshotV1 apiCalls(String apiCalls) { * @return apiCalls */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A bigint of the number of API calls in this snapshot.") public String getApiCalls() { return apiCalls; } @@ -80,9 +73,6 @@ public APICallSnapshotV1 timestamp(String timestamp) { * @return timestamp */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Timestamp of this snapshot within the billing cycle in the ISO-8601 format.") public String getTimestamp() { return timestamp; } @@ -146,15 +136,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to APICallSnapshotV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to APICallSnapshotV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!APICallSnapshotV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in APICallSnapshotV1 is not found in the" @@ -163,27 +153,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!APICallSnapshotV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `APICallSnapshotV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : APICallSnapshotV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("apiCalls").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -222,9 +213,9 @@ public void write(JsonWriter out, APICallSnapshotV1 value) @Override public APICallSnapshotV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java index 3fd41e26..0adab642 100644 --- a/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java +++ b/src/main/java/com/segment/publicapi/models/AbstractOpenApiSchema.java @@ -11,10 +11,8 @@ package com.segment.publicapi.models; - import java.util.Map; import java.util.Objects; -import javax.ws.rs.core.GenericType; // import com.fasterxml.jackson.annotation.JsonValue; @@ -40,7 +38,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java index c69bf1da..817211d9 100644 --- a/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/AccessPermissionV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** A permission governing access to a resource. */ -@ApiModel(description = "A permission governing access to a resource.") public class AccessPermissionV1 { public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; @@ -65,9 +61,6 @@ public AccessPermissionV1 roleId(String roleId) { * @return roleId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the role that applies to this permission.") public String getRoleId() { return roleId; } @@ -88,9 +81,6 @@ public AccessPermissionV1 roleName(String roleName) { * @return roleName */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The name of the role that applies to this permission.") public String getRoleName() { return roleName; } @@ -106,6 +96,9 @@ public AccessPermissionV1 resources(List resources) { } public AccessPermissionV1 addResourcesItem(PermissionResourceV1 resourcesItem) { + if (this.resources == null) { + this.resources = new ArrayList<>(); + } this.resources.add(resourcesItem); return this; } @@ -116,7 +109,6 @@ public AccessPermissionV1 addResourcesItem(PermissionResourceV1 resourcesItem) { * @return resources */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The resources included with this permission.") public List getResources() { return resources; } @@ -184,15 +176,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AccessPermissionV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AccessPermissionV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AccessPermissionV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AccessPermissionV1 is not found in the" @@ -201,27 +193,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AccessPermissionV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AccessPermissionV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AccessPermissionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("roleId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -246,6 +239,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayresources = jsonObj.getAsJsonArray("resources"); + // validate the required field `resources` (array) + for (int i = 0; i < jsonArrayresources.size(); i++) { + PermissionResourceV1.validateJsonElement(jsonArrayresources.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -270,9 +268,9 @@ public void write(JsonWriter out, AccessPermissionV1 value) @Override public AccessPermissionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java index 4aa990b8..6d5b5ee6 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public AddConnectionFromSourceToWarehouse200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddConnectionFromSourceToWarehouseV1Output getData() { return data; } @@ -112,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddConnectionFromSourceToWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddConnectionFromSourceToWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -132,9 +129,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddConnectionFromSourceToWarehouse200Response.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -142,9 +139,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `AddConnectionFromSourceToWarehouse200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddConnectionFromSourceToWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +177,9 @@ public void write( @Override public AddConnectionFromSourceToWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java index 2ad0ea0c..040a4f9e 100644 --- a/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddConnectionFromSourceToWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Response indicating whether the connection was successful. */ -@ApiModel(description = "Response indicating whether the connection was successful.") public class AddConnectionFromSourceToWarehouseV1Output { /** The status of the connection between the Source and Warehouse. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -99,9 +95,6 @@ public AddConnectionFromSourceToWarehouseV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The status of the connection between the Source and Warehouse.") public StatusEnum getStatus() { return status; } @@ -162,16 +155,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddConnectionFromSourceToWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -182,9 +175,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddConnectionFromSourceToWarehouseV1Output.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -192,20 +185,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `AddConnectionFromSourceToWarehouseV1Output` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddConnectionFromSourceToWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -242,9 +236,9 @@ public void write( @Override public AddConnectionFromSourceToWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java index 16a66188..62e28839 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public AddLabelsToSource200Response data(AddLabelsToSourceV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddLabelsToSourceV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddLabelsToSource200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddLabelsToSource200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddLabelsToSource200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddLabelsToSource200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddLabelsToSource200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddLabelsToSourceV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -165,9 +167,9 @@ public void write(JsonWriter out, AddLabelsToSource200Response value) @Override public AddLabelsToSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java index 2df1ce49..9988253b 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSource200Response1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public AddLabelsToSource200Response1 data(AddLabelsToSourceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddLabelsToSourceAlphaOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddLabelsToSource200Response1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddLabelsToSource200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddLabelsToSource200Response1 is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddLabelsToSource200Response1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddLabelsToSource200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddLabelsToSourceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, AddLabelsToSource200Response1 value) @Override public AddLabelsToSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java index 3a8d626a..51b0db2b 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Applies an existing label to an existing Source. */ -@ApiModel(description = "Applies an existing label to an existing Source.") public class AddLabelsToSourceAlphaInput { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -50,6 +46,9 @@ public AddLabelsToSourceAlphaInput labels(List labels) { } public AddLabelsToSourceAlphaInput addLabelsItem(LabelAlpha labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } this.labels.add(labelsItem); return this; } @@ -60,7 +59,6 @@ public AddLabelsToSourceAlphaInput addLabelsItem(LabelAlpha labelsItem) { * @return labels */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The labels to associate with a Source.") public List getLabels() { return labels; } @@ -120,15 +118,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceAlphaInput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddLabelsToSourceAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddLabelsToSourceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddLabelsToSourceAlphaInput is not" @@ -137,27 +136,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddLabelsToSourceAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddLabelsToSourceAlphaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddLabelsToSourceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("labels").isJsonArray()) { throw new IllegalArgumentException( @@ -168,6 +168,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + // validate the required field `labels` (array) + for (int i = 0; i < jsonArraylabels.size(); i++) { + LabelAlpha.validateJsonElement(jsonArraylabels.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -193,9 +198,9 @@ public void write(JsonWriter out, AddLabelsToSourceAlphaInput value) @Override public AddLabelsToSourceAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java index c23c2328..d049531d 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Applies an existing label to an existing Source. */ -@ApiModel(description = "Applies an existing label to an existing Source.") public class AddLabelsToSourceAlphaOutput { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -50,6 +46,9 @@ public AddLabelsToSourceAlphaOutput labels(List labels) { } public AddLabelsToSourceAlphaOutput addLabelsItem(LabelAlpha labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } this.labels.add(labelsItem); return this; } @@ -60,7 +59,6 @@ public AddLabelsToSourceAlphaOutput addLabelsItem(LabelAlpha labelsItem) { * @return labels */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All labels applied to the Source.") public List getLabels() { return labels; } @@ -121,16 +119,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddLabelsToSourceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddLabelsToSourceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddLabelsToSourceAlphaOutput is not" @@ -139,27 +137,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddLabelsToSourceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddLabelsToSourceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddLabelsToSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("labels").isJsonArray()) { throw new IllegalArgumentException( @@ -170,6 +169,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + // validate the required field `labels` (array) + for (int i = 0; i < jsonArraylabels.size(); i++) { + LabelAlpha.validateJsonElement(jsonArraylabels.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -196,9 +200,9 @@ public void write(JsonWriter out, AddLabelsToSourceAlphaOutput value) @Override public AddLabelsToSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java index f703ed61..ac72996e 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Applies an existing label to an existing Source. */ -@ApiModel(description = "Applies an existing label to an existing Source.") public class AddLabelsToSourceV1Input { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -50,6 +46,9 @@ public AddLabelsToSourceV1Input labels(List labels) { } public AddLabelsToSourceV1Input addLabelsItem(LabelV1 labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } this.labels.add(labelsItem); return this; } @@ -60,7 +59,6 @@ public AddLabelsToSourceV1Input addLabelsItem(LabelV1 labelsItem) { * @return labels */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The labels to associate with a Source.") public List getLabels() { return labels; } @@ -120,15 +118,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddLabelsToSourceV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddLabelsToSourceV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddLabelsToSourceV1Input is not found" @@ -137,27 +135,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddLabelsToSourceV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddLabelsToSourceV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddLabelsToSourceV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("labels").isJsonArray()) { throw new IllegalArgumentException( @@ -168,6 +167,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + // validate the required field `labels` (array) + for (int i = 0; i < jsonArraylabels.size(); i++) { + LabelV1.validateJsonElement(jsonArraylabels.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -193,9 +197,9 @@ public void write(JsonWriter out, AddLabelsToSourceV1Input value) @Override public AddLabelsToSourceV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java index 43d77c84..6aa10311 100644 --- a/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddLabelsToSourceV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Applies an existing label to an existing Source. */ -@ApiModel(description = "Applies an existing label to an existing Source.") public class AddLabelsToSourceV1Output { public static final String SERIALIZED_NAME_LABELS = "labels"; @@ -50,6 +46,9 @@ public AddLabelsToSourceV1Output labels(List labels) { } public AddLabelsToSourceV1Output addLabelsItem(LabelV1 labelsItem) { + if (this.labels == null) { + this.labels = new ArrayList<>(); + } this.labels.add(labelsItem); return this; } @@ -60,7 +59,6 @@ public AddLabelsToSourceV1Output addLabelsItem(LabelV1 labelsItem) { * @return labels */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "All labels applied to the Source.") public List getLabels() { return labels; } @@ -120,15 +118,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddLabelsToSourceV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddLabelsToSourceV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddLabelsToSourceV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddLabelsToSourceV1Output is not found" @@ -137,27 +135,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddLabelsToSourceV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddLabelsToSourceV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddLabelsToSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("labels").isJsonArray()) { throw new IllegalArgumentException( @@ -168,6 +167,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraylabels = jsonObj.getAsJsonArray("labels"); + // validate the required field `labels` (array) + for (int i = 0; i < jsonArraylabels.size(); i++) { + LabelV1.validateJsonElement(jsonArraylabels.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -193,9 +197,9 @@ public void write(JsonWriter out, AddLabelsToSourceV1Output value) @Override public AddLabelsToSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java index 3bc9125b..1a6612b7 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUser200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public AddPermissionsToUser200Response data(AddPermissionsToUserV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddPermissionsToUserV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddPermissionsToUser200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddPermissionsToUser200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddPermissionsToUser200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddPermissionsToUser200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddPermissionsToUser200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddPermissionsToUserV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, AddPermissionsToUser200Response value) @Override public AddPermissionsToUser200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java index 5cf1b40d..d3ed1500 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroup200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public AddPermissionsToUserGroup200Response data(AddPermissionsToUserGroupV1Outp * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddPermissionsToUserGroupV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddPermissionsToUserGroup200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddPermissionsToUserGroup200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddPermissionsToUserGroup200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddPermissionsToUserGroup200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddPermissionsToUserGroup200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddPermissionsToUserGroupV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public AddPermissionsToUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java index fdac5947..79cb7ef0 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Adds a list of permissions to a user group. */ -@ApiModel(description = "Adds a list of permissions to a user group.") public class AddPermissionsToUserGroupV1Input { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -50,6 +46,9 @@ public AddPermissionsToUserGroupV1Input permissions(List perm } public AddPermissionsToUserGroupV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } this.permissions.add(permissionsItem); return this; } @@ -60,7 +59,6 @@ public AddPermissionsToUserGroupV1Input addPermissionsItem(PermissionInputV1 per * @return permissions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The permissions to add.") public List getPermissions() { return permissions; } @@ -121,16 +119,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddPermissionsToUserGroupV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddPermissionsToUserGroupV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddPermissionsToUserGroupV1Input is" @@ -139,27 +137,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddPermissionsToUserGroupV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddPermissionsToUserGroupV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddPermissionsToUserGroupV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("permissions").isJsonArray()) { throw new IllegalArgumentException( @@ -170,6 +169,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + // validate the required field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + PermissionInputV1.validateJsonElement(jsonArraypermissions.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -197,9 +201,9 @@ public void write(JsonWriter out, AddPermissionsToUserGroupV1Input value) @Override public AddPermissionsToUserGroupV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java index c0d998d3..6b615543 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserGroupV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the group's permissions, including the added permissions. */ -@ApiModel(description = "Returns the group's permissions, including the added permissions.") public class AddPermissionsToUserGroupV1Output { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -51,6 +47,9 @@ public AddPermissionsToUserGroupV1Output permissions(List pe public AddPermissionsToUserGroupV1Output addPermissionsItem( AccessPermissionV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } this.permissions.add(permissionsItem); return this; } @@ -61,9 +60,6 @@ public AddPermissionsToUserGroupV1Output addPermissionsItem( * @return permissions */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The updated set of permissions assigned to the user group.") public List getPermissions() { return permissions; } @@ -124,16 +120,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddPermissionsToUserGroupV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddPermissionsToUserGroupV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddPermissionsToUserGroupV1Output is" @@ -143,27 +139,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddPermissionsToUserGroupV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddPermissionsToUserGroupV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddPermissionsToUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("permissions").isJsonArray()) { throw new IllegalArgumentException( @@ -174,6 +171,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + // validate the required field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + AccessPermissionV1.validateJsonElement(jsonArraypermissions.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -201,9 +203,9 @@ public void write(JsonWriter out, AddPermissionsToUserGroupV1Output value) @Override public AddPermissionsToUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java index 63b3cb63..69987234 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Adds a list of permissions to a user. */ -@ApiModel(description = "Adds a list of permissions to a user.") public class AddPermissionsToUserV1Input { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -50,6 +46,9 @@ public AddPermissionsToUserV1Input permissions(List permissio } public AddPermissionsToUserV1Input addPermissionsItem(PermissionInputV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } this.permissions.add(permissionsItem); return this; } @@ -60,7 +59,6 @@ public AddPermissionsToUserV1Input addPermissionsItem(PermissionInputV1 permissi * @return permissions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The permissions to add.") public List getPermissions() { return permissions; } @@ -120,15 +118,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddPermissionsToUserV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddPermissionsToUserV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddPermissionsToUserV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddPermissionsToUserV1Input is not" @@ -137,27 +136,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddPermissionsToUserV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddPermissionsToUserV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddPermissionsToUserV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("permissions").isJsonArray()) { throw new IllegalArgumentException( @@ -168,6 +168,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + // validate the required field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + PermissionInputV1.validateJsonElement(jsonArraypermissions.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -193,9 +198,9 @@ public void write(JsonWriter out, AddPermissionsToUserV1Input value) @Override public AddPermissionsToUserV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java index d56acb1a..624264db 100644 --- a/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddPermissionsToUserV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the user's permissions, including the added permissions. */ -@ApiModel(description = "Returns the user's permissions, including the added permissions.") public class AddPermissionsToUserV1Output { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @@ -50,6 +46,9 @@ public AddPermissionsToUserV1Output permissions(List permiss } public AddPermissionsToUserV1Output addPermissionsItem(AccessPermissionV1 permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } this.permissions.add(permissionsItem); return this; } @@ -60,7 +59,6 @@ public AddPermissionsToUserV1Output addPermissionsItem(AccessPermissionV1 permis * @return permissions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new permissions.") public List getPermissions() { return permissions; } @@ -121,16 +119,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddPermissionsToUserV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddPermissionsToUserV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddPermissionsToUserV1Output is not" @@ -139,27 +137,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddPermissionsToUserV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddPermissionsToUserV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddPermissionsToUserV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("permissions").isJsonArray()) { throw new IllegalArgumentException( @@ -170,6 +169,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("permissions"); + // validate the required field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + AccessPermissionV1.validateJsonElement(jsonArraypermissions.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -196,9 +200,9 @@ public void write(JsonWriter out, AddPermissionsToUserV1Output value) @Override public AddPermissionsToUserV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java index 218be362..8a7b4ad2 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlan200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public AddSourceToTrackingPlan200Response data(AddSourceToTrackingPlanV1Output d * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddSourceToTrackingPlanV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddSourceToTrackingPlan200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddSourceToTrackingPlan200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddSourceToTrackingPlan200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddSourceToTrackingPlan200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddSourceToTrackingPlan200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddSourceToTrackingPlanV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, AddSourceToTrackingPlan200Response value) @Override public AddSourceToTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java index 796f4c16..eb2b8596 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Connects a Source to a Tracking Plan. */ -@ApiModel(description = "Connects a Source to a Tracking Plan.") public class AddSourceToTrackingPlanV1Input { public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @@ -53,11 +49,6 @@ public AddSourceToTrackingPlanV1Input sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of the Source associated with the Tracking Plan. Config API note:" - + " analogous to `sourceName`.") public String getSourceId() { return sourceId; } @@ -118,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddSourceToTrackingPlanV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddSourceToTrackingPlanV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddSourceToTrackingPlanV1Input is not" @@ -136,27 +127,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddSourceToTrackingPlanV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddSourceToTrackingPlanV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddSourceToTrackingPlanV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -191,9 +183,9 @@ public void write(JsonWriter out, AddSourceToTrackingPlanV1Input value) @Override public AddSourceToTrackingPlanV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java index a124522d..cb3b8fbb 100644 --- a/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddSourceToTrackingPlanV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Connects a Source to a Tracking Plan. */ -@ApiModel(description = "Connects a Source to a Tracking Plan.") public class AddSourceToTrackingPlanV1Output { /** The operation status. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public AddSourceToTrackingPlanV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") public StatusEnum getStatus() { return status; } @@ -158,16 +153,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddSourceToTrackingPlanV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddSourceToTrackingPlanV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddSourceToTrackingPlanV1Output is not" @@ -176,27 +171,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddSourceToTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddSourceToTrackingPlanV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddSourceToTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -231,9 +227,9 @@ public void write(JsonWriter out, AddSourceToTrackingPlanV1Output value) @Override public AddSourceToTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java index 0d0a8aa4..4b95e09d 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroup200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public AddUsersToUserGroup200Response data(AddUsersToUserGroupV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public AddUsersToUserGroupV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AddUsersToUserGroup200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddUsersToUserGroup200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddUsersToUserGroup200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddUsersToUserGroup200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddUsersToUserGroup200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddUsersToUserGroupV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, AddUsersToUserGroup200Response value) @Override public AddUsersToUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java index 44f875d0..e8d93a3f 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,18 +21,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Adds a list of users and invites to a user group. */ -@ApiModel(description = "Adds a list of users and invites to a user group.") public class AddUsersToUserGroupV1Input { public static final String SERIALIZED_NAME_EMAILS = "emails"; @@ -49,6 +45,9 @@ public AddUsersToUserGroupV1Input emails(List emails) { } public AddUsersToUserGroupV1Input addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } this.emails.add(emailsItem); return this; } @@ -59,9 +58,6 @@ public AddUsersToUserGroupV1Input addEmailsItem(String emailsItem) { * @return emails */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The email addresses of the users and invites to add.") public List getEmails() { return emails; } @@ -121,15 +117,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroupV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddUsersToUserGroupV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddUsersToUserGroupV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddUsersToUserGroupV1Input is not" @@ -138,27 +134,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddUsersToUserGroupV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddUsersToUserGroupV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddUsersToUserGroupV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the required json array is present if (jsonObj.get("emails") == null) { throw new IllegalArgumentException( @@ -196,9 +193,9 @@ public void write(JsonWriter out, AddUsersToUserGroupV1Input value) @Override public AddUsersToUserGroupV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java index 22ac54e6..6e1bcc5d 100644 --- a/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AddUsersToUserGroupV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the updated user group. */ -@ApiModel(description = "Returns the updated user group.") public class AddUsersToUserGroupV1Output { public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; @SerializedName(SERIALIZED_NAME_USER_GROUP) - private UserGroup1 userGroup; + private UserGroupV1 userGroup; public AddUsersToUserGroupV1Output() {} - public AddUsersToUserGroupV1Output userGroup(UserGroup1 userGroup) { + public AddUsersToUserGroupV1Output userGroup(UserGroupV1 userGroup) { this.userGroup = userGroup; return this; @@ -52,12 +48,11 @@ public AddUsersToUserGroupV1Output userGroup(UserGroup1 userGroup) { * @return userGroup */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public UserGroup1 getUserGroup() { + public UserGroupV1 getUserGroup() { return userGroup; } - public void setUserGroup(UserGroup1 userGroup) { + public void setUserGroup(UserGroupV1 userGroup) { this.userGroup = userGroup; } @@ -112,15 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AddUsersToUserGroupV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddUsersToUserGroupV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AddUsersToUserGroupV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AddUsersToUserGroupV1Output is not" @@ -129,27 +125,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AddUsersToUserGroupV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AddUsersToUserGroupV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AddUsersToUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `userGroup` + UserGroupV1.validateJsonElement(jsonObj.get("userGroup")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +174,9 @@ public void write(JsonWriter out, AddUsersToUserGroupV1Output value) @Override public AddUsersToUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java index 40854f1b..db519752 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines the advanced sync schedule for a Warehouse. */ -@ApiModel(description = "Defines the advanced sync schedule for a Warehouse.") public class AdvancedWarehouseSyncScheduleV1Input { public static final String SERIALIZED_NAME_TIMES = "times"; @@ -55,6 +51,9 @@ public AdvancedWarehouseSyncScheduleV1Input times(List } public AdvancedWarehouseSyncScheduleV1Input addTimesItem(WarehouseAdvancedSyncV1 timesItem) { + if (this.times == null) { + this.times = new ArrayList<>(); + } this.times.add(timesItem); return this; } @@ -65,9 +64,6 @@ public AdvancedWarehouseSyncScheduleV1Input addTimesItem(WarehouseAdvancedSyncV1 * @return times */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A list that contains the times when syncs should occur.") public List getTimes() { return times; } @@ -88,7 +84,6 @@ public AdvancedWarehouseSyncScheduleV1Input timezone(String timezone) { * @return timezone */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A TZ-database timezone for this sync schedule.") public String getTimezone() { return timezone; } @@ -153,16 +148,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AdvancedWarehouseSyncScheduleV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AdvancedWarehouseSyncScheduleV1Input" @@ -172,28 +167,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AdvancedWarehouseSyncScheduleV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AdvancedWarehouseSyncScheduleV1Input` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AdvancedWarehouseSyncScheduleV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("times").isJsonArray()) { throw new IllegalArgumentException( @@ -204,6 +200,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraytimes = jsonObj.getAsJsonArray("times"); + // validate the required field `times` (array) + for (int i = 0; i < jsonArraytimes.size(); i++) { + WarehouseAdvancedSyncV1.validateJsonElement(jsonArraytimes.get(i)); + } + ; if (!jsonObj.get("timezone").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -239,9 +240,9 @@ public void write( @Override public AdvancedWarehouseSyncScheduleV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java index 447d6bd0..d118ddac 100644 --- a/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java +++ b/src/main/java/com/segment/publicapi/models/AdvancedWarehouseSyncScheduleV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,23 +22,20 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines the advanced sync schedule for a Warehouse. */ -@ApiModel(description = "Defines the advanced sync schedule for a Warehouse.") public class AdvancedWarehouseSyncScheduleV1Output { public static final String SERIALIZED_NAME_TIMES = "times"; @SerializedName(SERIALIZED_NAME_TIMES) - private List times = null; + private List times; public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; @@ -68,7 +64,6 @@ public AdvancedWarehouseSyncScheduleV1Output addTimesItem(WarehouseAdvancedSyncV * @return times */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list that contains the times when syncs should occur.") public List getTimes() { return times; } @@ -89,7 +84,6 @@ public AdvancedWarehouseSyncScheduleV1Output timezone(String timezone) { * @return timezone */ @javax.annotation.Nullable - @ApiModelProperty(value = "A TZ-database timezone for this sync schedule.") public String getTimezone() { return timezone; } @@ -152,16 +146,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * AdvancedWarehouseSyncScheduleV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AdvancedWarehouseSyncScheduleV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AdvancedWarehouseSyncScheduleV1Output" @@ -171,18 +165,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AdvancedWarehouseSyncScheduleV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AdvancedWarehouseSyncScheduleV1Output` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (jsonObj.get("times") != null && !jsonObj.get("times").isJsonNull()) { JsonArray jsonArraytimes = jsonObj.getAsJsonArray("times"); if (jsonArraytimes != null) { @@ -194,6 +189,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("times").toString())); } + + // validate the optional field `times` (array) + for (int i = 0; i < jsonArraytimes.size(); i++) { + WarehouseAdvancedSyncV1.validateJsonElement(jsonArraytimes.get(i)); + } + ; } } if ((jsonObj.get("timezone") != null && !jsonObj.get("timezone").isJsonNull()) @@ -232,9 +233,9 @@ public void write( @Override public AdvancedWarehouseSyncScheduleV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java index 54a2513e..027124c3 100644 --- a/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java +++ b/src/main/java/com/segment/publicapi/models/AllowedLabelBeta.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines a label that you may apply to resources within a Workspace. */ -@ApiModel(description = "Defines a label that you may apply to resources within a Workspace.") public class AllowedLabelBeta { public static final String SERIALIZED_NAME_KEY = "key"; @@ -62,7 +58,6 @@ public AllowedLabelBeta key(String key) { * @return key */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The key identifier for this label.") public String getKey() { return key; } @@ -83,7 +78,6 @@ public AllowedLabelBeta value(String value) { * @return value */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value of this label.") public String getValue() { return value; } @@ -104,7 +98,6 @@ public AllowedLabelBeta description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "A description of what this label represents.") public String getDescription() { return description; } @@ -171,15 +164,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AllowedLabelBeta + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AllowedLabelBeta */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AllowedLabelBeta.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AllowedLabelBeta is not found in the" @@ -188,27 +181,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AllowedLabelBeta.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AllowedLabelBeta` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AllowedLabelBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("key").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -255,9 +249,9 @@ public void write(JsonWriter out, AllowedLabelBeta value) @Override public AllowedLabelBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Audience.java b/src/main/java/com/segment/publicapi/models/Audience.java deleted file mode 100644 index 2b085c47..00000000 --- a/src/main/java/com/segment/publicapi/models/Audience.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The audience summary output. */ -@ApiModel(description = "The audience summary output.") -public class Audience { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public Audience() {} - - public Audience id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Audience id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Audience spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the audience.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public Audience name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the audience.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Audience description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the audience.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Audience key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the audience.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Audience enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Audience createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the audience.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Audience updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the audience.") - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public Audience createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was created.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Audience updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was last updated.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Audience audience = (Audience) o; - return Objects.equals(this.id, audience.id) - && Objects.equals(this.spaceId, audience.spaceId) - && Objects.equals(this.name, audience.name) - && Objects.equals(this.description, audience.description) - && Objects.equals(this.key, audience.key) - && Objects.equals(this.enabled, audience.enabled) - && Objects.equals(this.createdBy, audience.createdBy) - && Objects.equals(this.updatedBy, audience.updatedBy) - && Objects.equals(this.createdAt, audience.createdAt) - && Objects.equals(this.updatedAt, audience.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Audience {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Audience - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Audience.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Audience is not found in the empty" - + " JSON string", - Audience.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Audience.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Audience`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Audience.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Audience.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Audience' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Audience.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Audience value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Audience read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Audience given an JSON string - * - * @param jsonString JSON string - * @return An instance of Audience - * @throws IOException if the JSON string is invalid with respect to Audience - */ - public static Audience fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Audience.class); - } - - /** - * Convert an instance of Audience to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index cb21bf50..a4d1fbc3 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines an Audience. */ -@ApiModel(description = "Defines an Audience.") public class AudienceSummary { public static final String SERIALIZED_NAME_ID = "id"; @@ -97,7 +93,6 @@ public AudienceSummary id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Audience id.") public String getId() { return id; } @@ -118,7 +113,6 @@ public AudienceSummary spaceId(String spaceId) { * @return spaceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the audience.") public String getSpaceId() { return spaceId; } @@ -139,7 +133,6 @@ public AudienceSummary name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the audience.") public String getName() { return name; } @@ -160,7 +153,6 @@ public AudienceSummary description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the audience.") public String getDescription() { return description; } @@ -181,7 +173,6 @@ public AudienceSummary key(String key) { * @return key */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the audience.") public String getKey() { return key; } @@ -202,7 +193,6 @@ public AudienceSummary enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the audience.") public Boolean getEnabled() { return enabled; } @@ -223,7 +213,6 @@ public AudienceSummary createdBy(String createdBy) { * @return createdBy */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the audience.") public String getCreatedBy() { return createdBy; } @@ -244,7 +233,6 @@ public AudienceSummary updatedBy(String updatedBy) { * @return updatedBy */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the audience.") public String getUpdatedBy() { return updatedBy; } @@ -265,7 +253,6 @@ public AudienceSummary createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was created.") public String getCreatedAt() { return createdAt; } @@ -286,7 +273,6 @@ public AudienceSummary updatedAt(String updatedAt) { * @return updatedAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Date the audience was last updated.") public String getUpdatedAt() { return updatedAt; } @@ -392,15 +378,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AudienceSummary + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSummary */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AudienceSummary.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AudienceSummary is not found in the" @@ -409,27 +395,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AudienceSummary.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AudienceSummary` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AudienceSummary.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -517,9 +504,9 @@ public void write(JsonWriter out, AudienceSummary value) @Override public AudienceSummary read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/AuditEventV1.java b/src/main/java/com/segment/publicapi/models/AuditEventV1.java index b18b34c2..7ccd2503 100644 --- a/src/main/java/com/segment/publicapi/models/AuditEventV1.java +++ b/src/main/java/com/segment/publicapi/models/AuditEventV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents an Audit Trail event. */ -@ApiModel(description = "Represents an Audit Trail event.") public class AuditEventV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -82,7 +78,6 @@ public AuditEventV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Unique identifier for this audit trail event.") public String getId() { return id; } @@ -103,7 +98,6 @@ public AuditEventV1 timestamp(String timestamp) { * @return timestamp */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this event in ISO-8601 format.") public String getTimestamp() { return timestamp; } @@ -124,7 +118,6 @@ public AuditEventV1 type(String type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this event.") public String getType() { return type; } @@ -145,7 +138,6 @@ public AuditEventV1 actor(String actor) { * @return actor */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The user or API token that triggered this event.") public String getActor() { return actor; } @@ -166,9 +158,6 @@ public AuditEventV1 resourceId(String resourceId) { * @return resourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The identifier of the resource affected by this event.") public String getResourceId() { return resourceId; } @@ -189,7 +178,6 @@ public AuditEventV1 resourceType(String resourceType) { * @return resourceType */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The kind of resource affected by this event.") public String getResourceType() { return resourceType; } @@ -210,7 +198,6 @@ public AuditEventV1 resourceName(String resourceName) { * @return resourceName */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the resource affected by this event.") public String getResourceName() { return resourceName; } @@ -294,15 +281,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to AuditEventV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuditEventV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!AuditEventV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in AuditEventV1 is not found in the empty" @@ -311,27 +298,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!AuditEventV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `AuditEventV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : AuditEventV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -404,9 +392,9 @@ public void write(JsonWriter out, AuditEventV1 value) throws IOException { @Override public AuditEventV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java index 41432dec..2e768a1b 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpace200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public BatchQueryMessagingSubscriptionsForSpace200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput getData() { return data; } @@ -112,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * BatchQueryMessagingSubscriptionsForSpace200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!BatchQueryMessagingSubscriptionsForSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -133,9 +130,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!BatchQueryMessagingSubscriptionsForSpace200Response.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -143,9 +140,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `BatchQueryMessagingSubscriptionsForSpace200Response`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.validateJsonElement( + jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -179,9 +182,9 @@ public void write( @Override public BatchQueryMessagingSubscriptionsForSpace200Response read( JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java index a2bf8420..fbbbbdd6 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Batch get request. */ -@ApiModel(description = "Batch get request.") public class BatchQueryMessagingSubscriptionsForSpaceAlphaInput { public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions"; @@ -52,6 +48,9 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaInput subscriptions( public BatchQueryMessagingSubscriptionsForSpaceAlphaInput addSubscriptionsItem( GetSubscriptionRequest subscriptionsItem) { + if (this.subscriptions == null) { + this.subscriptions = new ArrayList<>(); + } this.subscriptions.add(subscriptionsItem); return this; } @@ -62,9 +61,6 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaInput addSubscriptionsItem( * @return subscriptions */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A list of subscriptions to retrieve subscription status.") public List getSubscriptions() { return subscriptions; } @@ -128,16 +124,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * BatchQueryMessagingSubscriptionsForSpaceAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -149,9 +145,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -159,20 +155,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `BatchQueryMessagingSubscriptionsForSpaceAlphaInput`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BatchQueryMessagingSubscriptionsForSpaceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("subscriptions").isJsonArray()) { throw new IllegalArgumentException( @@ -183,6 +180,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraysubscriptions = jsonObj.getAsJsonArray("subscriptions"); + // validate the required field `subscriptions` (array) + for (int i = 0; i < jsonArraysubscriptions.size(); i++) { + GetSubscriptionRequest.validateJsonElement(jsonArraysubscriptions.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -216,9 +218,9 @@ public void write( @Override public BatchQueryMessagingSubscriptionsForSpaceAlphaInput read( JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java index 88a61351..43bfebe2 100644 --- a/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Batch get response. */ -@ApiModel(description = "Batch get response.") public class BatchQueryMessagingSubscriptionsForSpaceAlphaOutput { public static final String SERIALIZED_NAME_SUCCESSES = "successes"; @@ -54,7 +50,7 @@ public class BatchQueryMessagingSubscriptionsForSpaceAlphaOutput { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput() {} @@ -67,6 +63,9 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput successes( public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addSuccessesItem( GetMessagingSubscriptionSuccessResponse successesItem) { + if (this.successes == null) { + this.successes = new ArrayList<>(); + } this.successes.add(successesItem); return this; } @@ -77,7 +76,6 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addSuccessesItem( * @return successes */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array of successful subscription status.") public List getSuccesses() { return successes; } @@ -95,6 +93,9 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput failures( public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addFailuresItem( GetMessagingSubscriptionFailureResponse failuresItem) { + if (this.failures == null) { + this.failures = new ArrayList<>(); + } this.failures.add(failuresItem); return this; } @@ -105,9 +106,6 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addFailuresItem( * @return failures */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Validation errors due to invalid types or email/phone numbers.") public List getFailures() { return failures; } @@ -125,6 +123,9 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput errors( public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addErrorsItem( MessageSubscriptionResponseError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } this.errors.add(errorsItem); return this; } @@ -135,11 +136,6 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput addErrorsItem( * @return errors */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "General errors when making the request such as invalid payload or wrong http" - + " method errors.") public List getErrors() { return errors; } @@ -148,7 +144,8 @@ public void setErrors(List errors) { this.errors = errors; } - public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput pagination(Pagination pagination) { + public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput pagination( + PaginationOutput pagination) { this.pagination = pagination; return this; @@ -160,12 +157,11 @@ public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput pagination(Pagination * @return pagination */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -239,16 +235,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * BatchQueryMessagingSubscriptionsForSpaceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -260,9 +256,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -270,20 +266,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `BatchQueryMessagingSubscriptionsForSpaceAlphaOutput`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BatchQueryMessagingSubscriptionsForSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("successes").isJsonArray()) { throw new IllegalArgumentException( @@ -294,6 +291,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraysuccesses = jsonObj.getAsJsonArray("successes"); + // validate the required field `successes` (array) + for (int i = 0; i < jsonArraysuccesses.size(); i++) { + GetMessagingSubscriptionSuccessResponse.validateJsonElement(jsonArraysuccesses.get(i)); + } + ; // ensure the json data is an array if (!jsonObj.get("failures").isJsonArray()) { throw new IllegalArgumentException( @@ -304,6 +306,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayfailures = jsonObj.getAsJsonArray("failures"); + // validate the required field `failures` (array) + for (int i = 0; i < jsonArrayfailures.size(); i++) { + GetMessagingSubscriptionFailureResponse.validateJsonElement(jsonArrayfailures.get(i)); + } + ; // ensure the json data is an array if (!jsonObj.get("errors").isJsonArray()) { throw new IllegalArgumentException( @@ -314,6 +321,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + MessageSubscriptionResponseError.validateJsonElement(jsonArrayerrors.get(i)); + } + ; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -347,9 +363,9 @@ public void write( @Override public BatchQueryMessagingSubscriptionsForSpaceAlphaOutput read( JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java index 0cfb4fb4..f281e03d 100644 --- a/src/main/java/com/segment/publicapi/models/BreakdownBeta.java +++ b/src/main/java/com/segment/publicapi/models/BreakdownBeta.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The breakdown of a metric. */ -@ApiModel(description = "The breakdown of a metric.") public class BreakdownBeta { public static final String SERIALIZED_NAME_METRIC_NAME = "metricName"; @@ -58,7 +54,6 @@ public BreakdownBeta metricName(String metricName) { * @return metricName */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the metric.") public String getMetricName() { return metricName; } @@ -79,7 +74,6 @@ public BreakdownBeta value(BigDecimal value) { * @return value */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Number of occurrences of the metric.") public BigDecimal getValue() { return value; } @@ -143,15 +137,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to BreakdownBeta + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BreakdownBeta */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!BreakdownBeta.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in BreakdownBeta is not found in the" @@ -160,27 +154,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!BreakdownBeta.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `BreakdownBeta` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : BreakdownBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("metricName").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -211,9 +206,9 @@ public void write(JsonWriter out, BreakdownBeta value) throws IOException { @Override public BreakdownBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java index 82e71b3d..11899966 100644 --- a/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/CommonSourceSettingsV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -34,17 +32,17 @@ public class CommonSourceSettingsV1 { public static final String SERIALIZED_NAME_TRACK = "track"; @SerializedName(SERIALIZED_NAME_TRACK) - private Track track; + private TrackSourceSettingsV1 track; public static final String SERIALIZED_NAME_IDENTIFY = "identify"; @SerializedName(SERIALIZED_NAME_IDENTIFY) - private Identify identify; + private IdentifySourceSettingsV1 identify; public static final String SERIALIZED_NAME_GROUP = "group"; @SerializedName(SERIALIZED_NAME_GROUP) - private Group group; + private GroupSourceSettingsV1 group; public static final String SERIALIZED_NAME_FORWARDING_VIOLATIONS_TO = "forwardingViolationsTo"; @@ -59,7 +57,7 @@ public class CommonSourceSettingsV1 { public CommonSourceSettingsV1() {} - public CommonSourceSettingsV1 track(Track track) { + public CommonSourceSettingsV1 track(TrackSourceSettingsV1 track) { this.track = track; return this; @@ -71,16 +69,15 @@ public CommonSourceSettingsV1 track(Track track) { * @return track */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Track getTrack() { + public TrackSourceSettingsV1 getTrack() { return track; } - public void setTrack(Track track) { + public void setTrack(TrackSourceSettingsV1 track) { this.track = track; } - public CommonSourceSettingsV1 identify(Identify identify) { + public CommonSourceSettingsV1 identify(IdentifySourceSettingsV1 identify) { this.identify = identify; return this; @@ -92,16 +89,15 @@ public CommonSourceSettingsV1 identify(Identify identify) { * @return identify */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Identify getIdentify() { + public IdentifySourceSettingsV1 getIdentify() { return identify; } - public void setIdentify(Identify identify) { + public void setIdentify(IdentifySourceSettingsV1 identify) { this.identify = identify; } - public CommonSourceSettingsV1 group(Group group) { + public CommonSourceSettingsV1 group(GroupSourceSettingsV1 group) { this.group = group; return this; @@ -113,12 +109,11 @@ public CommonSourceSettingsV1 group(Group group) { * @return group */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Group getGroup() { + public GroupSourceSettingsV1 getGroup() { return group; } - public void setGroup(Group group) { + public void setGroup(GroupSourceSettingsV1 group) { this.group = group; } @@ -134,7 +129,6 @@ public CommonSourceSettingsV1 forwardingViolationsTo(String forwardingViolations * @return forwardingViolationsTo */ @javax.annotation.Nullable - @ApiModelProperty(value = "SourceId to forward violations to.") public String getForwardingViolationsTo() { return forwardingViolationsTo; } @@ -155,7 +149,6 @@ public CommonSourceSettingsV1 forwardingBlockedEventsTo(String forwardingBlocked * @return forwardingBlockedEventsTo */ @javax.annotation.Nullable - @ApiModelProperty(value = "SourceId to forward blocked events to.") public String getForwardingBlockedEventsTo() { return forwardingBlockedEventsTo; } @@ -234,15 +227,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CommonSourceSettingsV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommonSourceSettingsV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CommonSourceSettingsV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CommonSourceSettingsV1 is not found in" @@ -251,17 +244,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CommonSourceSettingsV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CommonSourceSettingsV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `track` + if (jsonObj.get("track") != null && !jsonObj.get("track").isJsonNull()) { + TrackSourceSettingsV1.validateJsonElement(jsonObj.get("track")); + } + // validate the optional field `identify` + if (jsonObj.get("identify") != null && !jsonObj.get("identify").isJsonNull()) { + IdentifySourceSettingsV1.validateJsonElement(jsonObj.get("identify")); + } + // validate the optional field `group` + if (jsonObj.get("group") != null && !jsonObj.get("group").isJsonNull()) { + GroupSourceSettingsV1.validateJsonElement(jsonObj.get("group")); + } if ((jsonObj.get("forwardingViolationsTo") != null && !jsonObj.get("forwardingViolationsTo").isJsonNull()) && !jsonObj.get("forwardingViolationsTo").isJsonPrimitive()) { @@ -304,9 +310,9 @@ public void write(JsonWriter out, CommonSourceSettingsV1 value) @Override public CommonSourceSettingsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/ComputedTrait.java b/src/main/java/com/segment/publicapi/models/ComputedTrait.java deleted file mode 100644 index 71624541..00000000 --- a/src/main/java/com/segment/publicapi/models/ComputedTrait.java +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The computed trait summary output. */ -@ApiModel(description = "The computed trait summary output.") -public class ComputedTrait { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public ComputedTrait() {} - - public ComputedTrait id(String id) { - - this.id = id; - return this; - } - - /** - * Computed trait id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Computed trait id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ComputedTrait spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the computed trait. - * - * @return spaceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the computed trait.") - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public ComputedTrait name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the computed trait. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the computed trait.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ComputedTrait description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the computed trait. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the computed trait.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public ComputedTrait key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the computed trait. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the computed trait.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public ComputedTrait enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the computed trait. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ComputedTrait createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the computed trait. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the computed trait.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public ComputedTrait updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the computed trait. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public ComputedTrait createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of the computed trait's creation. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public ComputedTrait updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of the computed trait's last change. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComputedTrait computedTrait = (ComputedTrait) o; - return Objects.equals(this.id, computedTrait.id) - && Objects.equals(this.spaceId, computedTrait.spaceId) - && Objects.equals(this.name, computedTrait.name) - && Objects.equals(this.description, computedTrait.description) - && Objects.equals(this.key, computedTrait.key) - && Objects.equals(this.enabled, computedTrait.enabled) - && Objects.equals(this.createdBy, computedTrait.createdBy) - && Objects.equals(this.updatedBy, computedTrait.updatedBy) - && Objects.equals(this.createdAt, computedTrait.createdAt) - && Objects.equals(this.updatedAt, computedTrait.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ComputedTrait {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ComputedTrait - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!ComputedTrait.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ComputedTrait is not found in the" - + " empty JSON string", - ComputedTrait.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ComputedTrait.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ComputedTrait` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ComputedTrait.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ComputedTrait.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ComputedTrait' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ComputedTrait.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ComputedTrait value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ComputedTrait read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ComputedTrait given an JSON string - * - * @param jsonString JSON string - * @return An instance of ComputedTrait - * @throws IOException if the JSON string is invalid with respect to ComputedTrait - */ - public static ComputedTrait fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ComputedTrait.class); - } - - /** - * Convert an instance of ComputedTrait to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index e330303e..04b76775 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines a Computed trait. */ -@ApiModel(description = "Defines a Computed trait.") public class ComputedTraitSummary { public static final String SERIALIZED_NAME_ID = "id"; @@ -97,7 +93,6 @@ public ComputedTraitSummary id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Computed trait id.") public String getId() { return id; } @@ -118,7 +113,6 @@ public ComputedTraitSummary spaceId(String spaceId) { * @return spaceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Space id for the computed trait.") public String getSpaceId() { return spaceId; } @@ -139,7 +133,6 @@ public ComputedTraitSummary name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the computed trait.") public String getName() { return name; } @@ -160,7 +153,6 @@ public ComputedTraitSummary description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Description of the computed trait.") public String getDescription() { return description; } @@ -181,7 +173,6 @@ public ComputedTraitSummary key(String key) { * @return key */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key for the computed trait.") public String getKey() { return key; } @@ -202,7 +193,6 @@ public ComputedTraitSummary enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Enabled/disabled status for the computed trait.") public Boolean getEnabled() { return enabled; } @@ -223,7 +213,6 @@ public ComputedTraitSummary createdBy(String createdBy) { * @return createdBy */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who created the computed trait.") public String getCreatedBy() { return createdBy; } @@ -244,7 +233,6 @@ public ComputedTraitSummary updatedBy(String updatedBy) { * @return updatedBy */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "User id who last updated the computed trait.") public String getUpdatedBy() { return updatedBy; } @@ -265,7 +253,6 @@ public ComputedTraitSummary createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's creation.") public String getCreatedAt() { return createdAt; } @@ -286,7 +273,6 @@ public ComputedTraitSummary updatedAt(String updatedAt) { * @return updatedAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of the computed trait's last change.") public String getUpdatedAt() { return updatedAt; } @@ -392,15 +378,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ComputedTraitSummary + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ComputedTraitSummary */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!ComputedTraitSummary.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in ComputedTraitSummary is not found in" @@ -409,27 +395,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!ComputedTraitSummary.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `ComputedTraitSummary` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : ComputedTraitSummary.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -517,9 +504,9 @@ public void write(JsonWriter out, ComputedTraitSummary value) @Override public ComputedTraitSummary read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Contact.java b/src/main/java/com/segment/publicapi/models/Contact.java index 6280dda3..0fa802d8 100644 --- a/src/main/java/com/segment/publicapi/models/Contact.java +++ b/src/main/java/com/segment/publicapi/models/Contact.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The contact info for Integration Owners. */ -@ApiModel(description = "The contact info for Integration Owners.") public class Contact { public static final String SERIALIZED_NAME_NAME = "name"; @@ -67,7 +63,6 @@ public Contact name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "Name of this contact.") public String getName() { return name; } @@ -88,7 +83,6 @@ public Contact email(String email) { * @return email */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Email of this contact.") public String getEmail() { return email; } @@ -109,7 +103,6 @@ public Contact role(String role) { * @return role */ @javax.annotation.Nullable - @ApiModelProperty(value = "Role of this contact.") public String getRole() { return role; } @@ -130,7 +123,6 @@ public Contact isPrimary(Boolean isPrimary) { * @return isPrimary */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a primary contact.") public Boolean getIsPrimary() { return isPrimary; } @@ -199,15 +191,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Contact + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Contact */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!Contact.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in Contact is not found in the empty JSON" @@ -216,27 +208,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Contact.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the `Contact`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : Contact.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -283,9 +276,9 @@ public void write(JsonWriter out, Contact value) throws IOException { @Override public Contact read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java index 715fc67d..c6dabfcf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateCloudSourceRegulation200Response data(CreateCloudSourceRegulationV1 * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateCloudSourceRegulationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateCloudSourceRegulation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateCloudSourceRegulation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateCloudSourceRegulation200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateCloudSourceRegulation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateCloudSourceRegulation200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateCloudSourceRegulationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public CreateCloudSourceRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java index 64fe6808..a78702da 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input to create a Cloud Source-scoped regulation. */ -@ApiModel(description = "The input to create a Cloud Source-scoped regulation.") public class CreateCloudSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) @@ -166,7 +162,6 @@ public CreateCloudSourceRegulationV1Input regulationType(RegulationTypeEnum regu * @return regulationType */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The regulation type to create.") public RegulationTypeEnum getRegulationType() { return regulationType; } @@ -187,9 +182,6 @@ public CreateCloudSourceRegulationV1Input subjectType(SubjectTypeEnum subjectTyp * @return subjectType */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The subject type. Must be `objectId` for Cloud Sources.") public SubjectTypeEnum getSubjectType() { return subjectType; } @@ -205,6 +197,9 @@ public CreateCloudSourceRegulationV1Input subjectIds(List subjectIds) { } public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { + if (this.subjectIds == null) { + this.subjectIds = new ArrayList<>(); + } this.subjectIds.add(subjectIdsItem); return this; } @@ -216,11 +211,6 @@ public CreateCloudSourceRegulationV1Input addSubjectIdsItem(String subjectIdsIte * @return subjectIds */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The list of `userId` or `objectId` values of the subjects to regulate. Config" - + " API note: equal to `parent` but allows an array.") public List getSubjectIds() { return subjectIds; } @@ -241,7 +231,6 @@ public CreateCloudSourceRegulationV1Input collection(String collection) { * @return collection */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Cloud Source collection to regulate.") public String getCollection() { return collection; } @@ -315,16 +304,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateCloudSourceRegulationV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateCloudSourceRegulationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateCloudSourceRegulationV1Input is" @@ -334,27 +323,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateCloudSourceRegulationV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateCloudSourceRegulationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateCloudSourceRegulationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("regulationType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -415,9 +405,9 @@ public void write(JsonWriter out, CreateCloudSourceRegulationV1Input value) @Override public CreateCloudSourceRegulationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java index b6c44c50..f272a640 100644 --- a/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateCloudSourceRegulationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of a create Cloud Source regulation call. */ -@ApiModel(description = "The output of a create Cloud Source regulation call.") public class CreateCloudSourceRegulationV1Output { public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; @@ -52,7 +48,6 @@ public CreateCloudSourceRegulationV1Output regulateId(String regulateId) { * @return regulateId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the created regulation.") public String getRegulateId() { return regulateId; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateCloudSourceRegulationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateCloudSourceRegulationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateCloudSourceRegulationV1Output is" @@ -132,27 +127,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateCloudSourceRegulationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateCloudSourceRegulationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateCloudSourceRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("regulateId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -187,9 +183,9 @@ public void write(JsonWriter out, CreateCloudSourceRegulationV1Output value) @Override public CreateCloudSourceRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java index daa6ee08..b0b74587 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestination200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateDestination200Response data(CreateDestinationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateDestinationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateDestination200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateDestination200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateDestination200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateDestination200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateDestination200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateDestinationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -165,9 +167,9 @@ public void write(JsonWriter out, CreateDestination200Response value) @Override public CreateDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java index 8c13d1ad..115a2229 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscription200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public CreateDestinationSubscription200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateDestinationSubscriptionAlphaOutput getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateDestinationSubscription200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateDestinationSubscription200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,18 +128,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateDestinationSubscription200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateDestinationSubscription200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateDestinationSubscriptionAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -172,9 +174,9 @@ public void write( @Override public CreateDestinationSubscription200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java index b494f567..15829204 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,19 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** The basic input parameters for creating a Destination subscription. */ -@ApiModel(description = "The basic input parameters for creating a Destination subscription.") public class CreateDestinationSubscriptionAlphaInput { public static final String SERIALIZED_NAME_NAME = "name"; @@ -59,7 +53,7 @@ public class CreateDestinationSubscriptionAlphaInput { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public static final String SERIALIZED_NAME_MODEL_ID = "modelId"; @@ -80,7 +74,6 @@ public CreateDestinationSubscriptionAlphaInput name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A user-defined name for the subscription.") public String getName() { return name; } @@ -101,9 +94,6 @@ public CreateDestinationSubscriptionAlphaInput actionId(String actionId) { * @return actionId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The associated action id the subscription should trigger.") public String getActionId() { return actionId; } @@ -124,7 +114,6 @@ public CreateDestinationSubscriptionAlphaInput trigger(String trigger) { * @return trigger */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The FQL statement.") public String getTrigger() { return trigger; } @@ -145,7 +134,6 @@ public CreateDestinationSubscriptionAlphaInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Is the subscription enabled.") public Boolean getEnabled() { return enabled; } @@ -154,24 +142,32 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public CreateDestinationSubscriptionAlphaInput settings(Map settings) { + public CreateDestinationSubscriptionAlphaInput settings(Map settings) { this.settings = settings; return this; } + public CreateDestinationSubscriptionAlphaInput putSettingsItem( + String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * The fields used for configuring this action. + * Represents settings used to configure an action subscription. * * @return settings */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields used for configuring this action.") - public Map getSettings() { + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -187,10 +183,6 @@ public CreateDestinationSubscriptionAlphaInput modelId(String modelId) { * @return modelId */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "When creating a Reverse ETL connection, indicates the Model being used to" - + " extract data.") public String getModelId() { return modelId; } @@ -217,27 +209,11 @@ public boolean equals(Object o) { && Objects.equals(this.modelId, createDestinationSubscriptionAlphaInput.modelId); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(name, actionId, trigger, enabled, settings, modelId); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -285,16 +261,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateDestinationSubscriptionAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateDestinationSubscriptionAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -305,28 +281,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateDestinationSubscriptionAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateDestinationSubscriptionAlphaInput` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateDestinationSubscriptionAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -385,9 +362,9 @@ public void write( @Override public CreateDestinationSubscriptionAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java index a1aebc9c..fb96df89 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationSubscriptionAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a newly created Destination subscription. */ -@ApiModel(description = "Returns a newly created Destination subscription.") public class CreateDestinationSubscriptionAlphaOutput { public static final String SERIALIZED_NAME_DESTINATION_SUBSCRIPTION = "destinationSubscription"; @@ -53,7 +49,6 @@ public CreateDestinationSubscriptionAlphaOutput destinationSubscription( * @return destinationSubscription */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public DestinationSubscription getDestinationSubscription() { return destinationSubscription; } @@ -118,16 +113,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateDestinationSubscriptionAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -138,29 +133,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateDestinationSubscriptionAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateDestinationSubscriptionAlphaOutput` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateDestinationSubscriptionAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `destinationSubscription` + DestinationSubscription.validateJsonElement(jsonObj.get("destinationSubscription")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -190,9 +188,9 @@ public void write( @Override public CreateDestinationSubscriptionAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java index 97115eb2..05924763 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,18 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Creates a new Destination. */ -@ApiModel(description = "Creates a new Destination.") public class CreateDestinationV1Input { public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @@ -75,11 +70,6 @@ public CreateDestinationV1Input sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of the Source to connect to this Destination instance. Config API" - + " note: analogous to `parent`.") public String getSourceId() { return sourceId; } @@ -100,9 +90,6 @@ public CreateDestinationV1Input metadataId(String metadataId) { * @return metadataId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the metadata to link to the new Destination.") public String getMetadataId() { return metadataId; } @@ -123,7 +110,6 @@ public CreateDestinationV1Input enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination should receive data.") public Boolean getEnabled() { return enabled; } @@ -145,10 +131,6 @@ public CreateDestinationV1Input name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Defines the display name of the Destination. Config API note: equal to" - + " `displayName`.") public String getName() { return name; } @@ -164,6 +146,9 @@ public CreateDestinationV1Input settings(Map settings) { } public CreateDestinationV1Input putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } this.settings.put(key, settingsItem); return this; } @@ -176,12 +161,6 @@ public CreateDestinationV1Input putSettingsItem(String key, Object settingsItem) * @return settings */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "An object that contains settings for the Destination based on the \"required\"" - + " and \"advanced\" settings present in the Destination metadata. Config" - + " API note: equal to `config`.") public Map getSettings() { return settings; } @@ -255,15 +234,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateDestinationV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateDestinationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateDestinationV1Input is not found" @@ -272,27 +251,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateDestinationV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateDestinationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateDestinationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -340,9 +320,9 @@ public void write(JsonWriter out, CreateDestinationV1Input value) @Override public CreateDestinationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java index c91dc3ae..4554ec19 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateDestinationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Creates a new Destination. */ -@ApiModel(description = "Creates a new Destination.") public class CreateDestinationV1Output { public static final String SERIALIZED_NAME_DESTINATION = "destination"; @SerializedName(SERIALIZED_NAME_DESTINATION) - private Destination2 destination; + private DestinationV1 destination; public CreateDestinationV1Output() {} - public CreateDestinationV1Output destination(Destination2 destination) { + public CreateDestinationV1Output destination(DestinationV1 destination) { this.destination = destination; return this; @@ -52,12 +48,11 @@ public CreateDestinationV1Output destination(Destination2 destination) { * @return destination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Destination2 getDestination() { + public DestinationV1 getDestination() { return destination; } - public void setDestination(Destination2 destination) { + public void setDestination(DestinationV1 destination) { this.destination = destination; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateDestinationV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateDestinationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateDestinationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateDestinationV1Output is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateDestinationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateDestinationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `destination` + DestinationV1.validateJsonElement(jsonObj.get("destination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, CreateDestinationV1Output value) @Override public CreateDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java index 34705ffe..97a7e912 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctions200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateEdgeFunctions200Response data(CreateEdgeFunctionsAlphaOutput data) * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateEdgeFunctionsAlphaOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateEdgeFunctions200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateEdgeFunctions200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateEdgeFunctions200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateEdgeFunctions200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateEdgeFunctionsAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, CreateEdgeFunctions200Response value) @Override public CreateEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java index 973ce203..d7956395 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Input for CreateEdgeFunctions. */ -@ApiModel(description = "Input for CreateEdgeFunctions.") public class CreateEdgeFunctionsAlphaInput { public static final String SERIALIZED_NAME_UPLOAD_U_R_L = "uploadURL"; @@ -52,9 +48,6 @@ public CreateEdgeFunctionsAlphaInput uploadURL(String uploadURL) { * @return uploadURL */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Source associated with this Edge Function.") public String getUploadURL() { return uploadURL; } @@ -115,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateEdgeFunctionsAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateEdgeFunctionsAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateEdgeFunctionsAlphaInput is not" @@ -133,27 +126,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateEdgeFunctionsAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateEdgeFunctionsAlphaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateEdgeFunctionsAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("uploadURL").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -188,9 +182,9 @@ public void write(JsonWriter out, CreateEdgeFunctionsAlphaInput value) @Override public CreateEdgeFunctionsAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java index 10e0cd9f..287419d2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateEdgeFunctionsAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Output for CreateEdgeFunctions. */ -@ApiModel(description = "Output for CreateEdgeFunctions.") public class CreateEdgeFunctionsAlphaOutput { public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) - private EdgeFunctions edgeFunctions; + private EdgeFunctionsAlpha edgeFunctions; public CreateEdgeFunctionsAlphaOutput() {} - public CreateEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions edgeFunctions) { + public CreateEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctionsAlpha edgeFunctions) { this.edgeFunctions = edgeFunctions; return this; @@ -52,12 +48,11 @@ public CreateEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions edgeFunctions) * @return edgeFunctions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public EdgeFunctions getEdgeFunctions() { + public EdgeFunctionsAlpha getEdgeFunctions() { return edgeFunctions; } - public void setEdgeFunctions(EdgeFunctions edgeFunctions) { + public void setEdgeFunctions(EdgeFunctionsAlpha edgeFunctions) { this.edgeFunctions = edgeFunctions; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateEdgeFunctionsAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateEdgeFunctionsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateEdgeFunctionsAlphaOutput is not" @@ -131,27 +126,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateEdgeFunctionsAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `edgeFunctions` + EdgeFunctionsAlpha.validateJsonElement(jsonObj.get("edgeFunctions")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -179,9 +177,9 @@ public void write(JsonWriter out, CreateEdgeFunctionsAlphaOutput value) @Override public CreateEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java index 13ee2c71..a2277425 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestination200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateFilterForDestination200Response data(CreateFilterForDestinationV1Ou * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateFilterForDestinationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateFilterForDestination200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFilterForDestination200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFilterForDestination200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFilterForDestination200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFilterForDestination200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateFilterForDestinationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public CreateFilterForDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java index aed74fe5..eab7a3e1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Input for CreateDestinationFilterV1. */ -@ApiModel(description = "Input for CreateDestinationFilterV1.") public class CreateFilterForDestinationV1Input { public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @@ -80,7 +76,6 @@ public CreateFilterForDestinationV1Input sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") public String getSourceId() { return sourceId; } @@ -101,7 +96,6 @@ public CreateFilterForDestinationV1Input _if(String _if) { * @return _if */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The filter's condition.") public String getIf() { return _if; } @@ -117,6 +111,9 @@ public CreateFilterForDestinationV1Input actions(List } public CreateFilterForDestinationV1Input addActionsItem(DestinationFilterActionV1 actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } this.actions.add(actionsItem); return this; } @@ -127,7 +124,6 @@ public CreateFilterForDestinationV1Input addActionsItem(DestinationFilterActionV * @return actions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Actions for the Destination filter.") public List getActions() { return actions; } @@ -148,7 +144,6 @@ public CreateFilterForDestinationV1Input title(String title) { * @return title */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The title of the filter.") public String getTitle() { return title; } @@ -169,7 +164,6 @@ public CreateFilterForDestinationV1Input description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "The description of the filter.") public String getDescription() { return description; } @@ -190,9 +184,6 @@ public CreateFilterForDestinationV1Input enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "When set to true, the Destination filter is active.") public Boolean getEnabled() { return enabled; } @@ -272,16 +263,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateFilterForDestinationV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFilterForDestinationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFilterForDestinationV1Input is" @@ -291,27 +282,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFilterForDestinationV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFilterForDestinationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateFilterForDestinationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -336,6 +328,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + // validate the required field `actions` (array) + for (int i = 0; i < jsonArrayactions.size(); i++) { + DestinationFilterActionV1.validateJsonElement(jsonArrayactions.get(i)); + } + ; if (!jsonObj.get("title").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -378,9 +375,9 @@ public void write(JsonWriter out, CreateFilterForDestinationV1Input value) @Override public CreateFilterForDestinationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java index ed49daa7..139e4a86 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForDestinationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Output for CreateDestinationFiltersV1. */ -@ApiModel(description = "Output for CreateDestinationFiltersV1.") public class CreateFilterForDestinationV1Output { public static final String SERIALIZED_NAME_FILTER = "filter"; @SerializedName(SERIALIZED_NAME_FILTER) - private Filter2 filter; + private DestinationFilterV1 filter; public CreateFilterForDestinationV1Output() {} - public CreateFilterForDestinationV1Output filter(Filter2 filter) { + public CreateFilterForDestinationV1Output filter(DestinationFilterV1 filter) { this.filter = filter; return this; @@ -52,12 +48,11 @@ public CreateFilterForDestinationV1Output filter(Filter2 filter) { * @return filter */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Filter2 getFilter() { + public DestinationFilterV1 getFilter() { return filter; } - public void setFilter(Filter2 filter) { + public void setFilter(DestinationFilterV1 filter) { this.filter = filter; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateFilterForDestinationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFilterForDestinationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFilterForDestinationV1Output is" @@ -132,27 +127,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFilterForDestinationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFilterForDestinationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateFilterForDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `filter` + DestinationFilterV1.validateJsonElement(jsonObj.get("filter")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -180,9 +178,9 @@ public void write(JsonWriter out, CreateFilterForDestinationV1Output value) @Override public CreateFilterForDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java index dc517738..6e0eb501 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunction200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateFunction200Response data(CreateFunctionV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateFunctionV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunction200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateFunction200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFunction200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFunction200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFunction200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFunction200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateFunctionV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, CreateFunction200Response value) @Override public CreateFunction200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java index 74089c12..d8cec1a4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeployment200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateFunctionDeployment200Response data(CreateFunctionDeploymentV1Output * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateFunctionDeploymentV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateFunctionDeployment200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFunctionDeployment200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFunctionDeployment200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFunctionDeployment200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFunctionDeployment200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateFunctionDeploymentV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, CreateFunctionDeployment200Response value) @Override public CreateFunctionDeployment200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java index 09c5e0ad..09fc0438 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionDeploymentV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Updates the deployment for a Source Function instance. */ -@ApiModel(description = "Updates the deployment for a Source Function instance.") public class CreateFunctionDeploymentV1Output { public static final String SERIALIZED_NAME_FUNCTION_DEPLOYMENT = "functionDeployment"; @@ -53,7 +49,6 @@ public CreateFunctionDeploymentV1Output functionDeployment( * @return functionDeployment */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public FunctionDeployment getFunctionDeployment() { return functionDeployment; } @@ -117,16 +112,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateFunctionDeploymentV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFunctionDeploymentV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFunctionDeploymentV1Output is" @@ -135,27 +130,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFunctionDeploymentV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFunctionDeploymentV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateFunctionDeploymentV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `functionDeployment` + FunctionDeployment.validateJsonElement(jsonObj.get("functionDeployment")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -183,9 +181,9 @@ public void write(JsonWriter out, CreateFunctionDeploymentV1Output value) @Override public CreateFunctionDeploymentV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index afd5bf38..8ce751b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,18 +23,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Creates a Function. */ -@ApiModel(description = "Creates a Function.") public class CreateFunctionV1Input { public static final String SERIALIZED_NAME_CODE = "code"; @@ -45,7 +41,7 @@ public class CreateFunctionV1Input { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + private List settings; public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -129,7 +125,6 @@ public CreateFunctionV1Input code(String code) { * @return code */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Function code.") public String getCode() { return code; } @@ -158,7 +153,6 @@ public CreateFunctionV1Input addSettingsItem(FunctionSettingV1 settingsItem) { * @return settings */ @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") public List getSettings() { return settings; } @@ -180,11 +174,6 @@ public CreateFunctionV1Input displayName(String displayName) { * @return displayName */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "A display name for this Function. Note that Destination Functions append the" - + " Workspace to the display name.") public String getDisplayName() { return displayName; } @@ -205,7 +194,6 @@ public CreateFunctionV1Input logoUrl(String logoUrl) { * @return logoUrl */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") public String getLogoUrl() { return logoUrl; } @@ -226,9 +214,6 @@ public CreateFunctionV1Input resourceType(ResourceTypeEnum resourceType) { * @return resourceType */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Function type. Config API note: equal to `type`.") public ResourceTypeEnum getResourceType() { return resourceType; } @@ -249,7 +234,6 @@ public CreateFunctionV1Input description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") public String getDescription() { return description; } @@ -326,15 +310,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunctionV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateFunctionV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFunctionV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFunctionV1Input is not found in" @@ -343,27 +327,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFunctionV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFunctionV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateFunctionV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("code").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -382,6 +367,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("settings").toString())); } + + // validate the optional field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + FunctionSettingV1.validateJsonElement(jsonArraysettings.get(i)); + } + ; } } if (!jsonObj.get("displayName").isJsonPrimitive()) { @@ -438,9 +429,9 @@ public void write(JsonWriter out, CreateFunctionV1Input value) @Override public CreateFunctionV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java index 8499d551..8e9cdcef 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Create a Function. */ -@ApiModel(description = "Create a Function.") public class CreateFunctionV1Output { public static final String SERIALIZED_NAME_FUNCTION = "function"; @SerializedName(SERIALIZED_NAME_FUNCTION) - private Function1 function; + private FunctionV1 function; public CreateFunctionV1Output() {} - public CreateFunctionV1Output function(Function1 function) { + public CreateFunctionV1Output function(FunctionV1 function) { this.function = function; return this; @@ -52,12 +48,11 @@ public CreateFunctionV1Output function(Function1 function) { * @return function */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Function1 getFunction() { + public FunctionV1 getFunction() { return function; } - public void setFunction(Function1 function) { + public void setFunction(FunctionV1 function) { this.function = function; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateFunctionV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateFunctionV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateFunctionV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateFunctionV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateFunctionV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateFunctionV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateFunctionV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `function` + FunctionV1.validateJsonElement(jsonObj.get("function")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, CreateFunctionV1Output value) @Override public CreateFunctionV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java index 1cc532a5..afc4196e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstance200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public CreateInsertFunctionInstance200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateInsertFunctionInstanceAlphaOutput getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateInsertFunctionInstance200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateInsertFunctionInstance200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,18 +128,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateInsertFunctionInstance200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateInsertFunctionInstanceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -172,9 +174,9 @@ public void write( @Override public CreateInsertFunctionInstance200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java index c41b9d84..bb87ee76 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,18 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Creates an insert Function instance. */ -@ApiModel(description = "Creates an insert Function instance.") public class CreateInsertFunctionInstanceAlphaInput { public static final String SERIALIZED_NAME_FUNCTION_ID = "functionId"; @@ -74,9 +69,6 @@ public CreateInsertFunctionInstanceAlphaInput functionId(String functionId) { * @return functionId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Insert Function id to which this instance is associated.") public String getFunctionId() { return functionId; } @@ -97,7 +89,6 @@ public CreateInsertFunctionInstanceAlphaInput integrationId(String integrationId * @return integrationId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source or Destination id to be connected.") public String getIntegrationId() { return integrationId; } @@ -118,8 +109,6 @@ public CreateInsertFunctionInstanceAlphaInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nullable - @ApiModelProperty( - value = "Whether this insert Function instance should be enabled for the Destination.") public Boolean getEnabled() { return enabled; } @@ -140,9 +129,6 @@ public CreateInsertFunctionInstanceAlphaInput name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Defines the display name of the insert Function instance.") public String getName() { return name; } @@ -158,6 +144,9 @@ public CreateInsertFunctionInstanceAlphaInput settings(Map setti } public CreateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } this.settings.put(key, settingsItem); return this; } @@ -169,11 +158,6 @@ public CreateInsertFunctionInstanceAlphaInput putSettingsItem(String key, Object * @return settings */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "An object that contains settings for this insert Function instance based on" - + " the settings present in the insert Function class.") public Map getSettings() { return settings; } @@ -250,16 +234,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateInsertFunctionInstanceAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateInsertFunctionInstanceAlphaInput" @@ -269,28 +253,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateInsertFunctionInstanceAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateInsertFunctionInstanceAlphaInput` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateInsertFunctionInstanceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("functionId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -340,9 +325,9 @@ public void write( @Override public CreateInsertFunctionInstanceAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java index 19d37394..40766a76 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,26 +21,23 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Creates an insert Function instance. */ -@ApiModel(description = "Creates an insert Function instance.") public class CreateInsertFunctionInstanceAlphaOutput { public static final String SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE = "insertFunctionInstance"; @SerializedName(SERIALIZED_NAME_INSERT_FUNCTION_INSTANCE) - private InsertFunctionInstance insertFunctionInstance; + private InsertFunctionInstanceAlpha insertFunctionInstance; public CreateInsertFunctionInstanceAlphaOutput() {} public CreateInsertFunctionInstanceAlphaOutput insertFunctionInstance( - InsertFunctionInstance insertFunctionInstance) { + InsertFunctionInstanceAlpha insertFunctionInstance) { this.insertFunctionInstance = insertFunctionInstance; return this; @@ -53,12 +49,11 @@ public CreateInsertFunctionInstanceAlphaOutput insertFunctionInstance( * @return insertFunctionInstance */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public InsertFunctionInstance getInsertFunctionInstance() { + public InsertFunctionInstanceAlpha getInsertFunctionInstance() { return insertFunctionInstance; } - public void setInsertFunctionInstance(InsertFunctionInstance insertFunctionInstance) { + public void setInsertFunctionInstance(InsertFunctionInstanceAlpha insertFunctionInstance) { this.insertFunctionInstance = insertFunctionInstance; } @@ -118,16 +113,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateInsertFunctionInstanceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -138,28 +133,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateInsertFunctionInstanceAlphaOutput` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `insertFunctionInstance` + InsertFunctionInstanceAlpha.validateJsonElement(jsonObj.get("insertFunctionInstance")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -189,9 +187,9 @@ public void write( @Override public CreateInsertFunctionInstanceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java index 35dec0b5..8dd37235 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvites200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateInvites200Response data(CreateInvitesV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateInvitesV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateInvites200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateInvites200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateInvites200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateInvites200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateInvites200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateInvites200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateInvitesV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, CreateInvites200Response value) @Override public CreateInvites200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java index a73beefd..4152a1f6 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Invites a user to a Workspace with specified permissions. */ -@ApiModel(description = "Invites a user to a Workspace with specified permissions.") public class CreateInvitesV1Input { public static final String SERIALIZED_NAME_INVITES = "invites"; @@ -50,6 +46,9 @@ public CreateInvitesV1Input invites(List invites) { } public CreateInvitesV1Input addInvitesItem(InviteV1 invitesItem) { + if (this.invites == null) { + this.invites = new ArrayList<>(); + } this.invites.add(invitesItem); return this; } @@ -60,7 +59,6 @@ public CreateInvitesV1Input addInvitesItem(InviteV1 invitesItem) { * @return invites */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of invites.") public List getInvites() { return invites; } @@ -120,15 +118,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateInvitesV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateInvitesV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateInvitesV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateInvitesV1Input is not found in" @@ -137,27 +135,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateInvitesV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateInvitesV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateInvitesV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("invites").isJsonArray()) { throw new IllegalArgumentException( @@ -168,6 +167,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayinvites = jsonObj.getAsJsonArray("invites"); + // validate the required field `invites` (array) + for (int i = 0; i < jsonArrayinvites.size(); i++) { + InviteV1.validateJsonElement(jsonArrayinvites.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -192,9 +196,9 @@ public void write(JsonWriter out, CreateInvitesV1Input value) @Override public CreateInvitesV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java index 72d1571d..f644ee06 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateInvitesV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,18 +21,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the emails of the invited users. */ -@ApiModel(description = "Returns the emails of the invited users.") public class CreateInvitesV1Output { public static final String SERIALIZED_NAME_EMAILS = "emails"; @@ -49,6 +45,9 @@ public CreateInvitesV1Output emails(List emails) { } public CreateInvitesV1Output addEmailsItem(String emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } this.emails.add(emailsItem); return this; } @@ -59,7 +58,6 @@ public CreateInvitesV1Output addEmailsItem(String emailsItem) { * @return emails */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of emails invited to the Workspace.") public List getEmails() { return emails; } @@ -119,15 +117,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateInvitesV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateInvitesV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateInvitesV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateInvitesV1Output is not found in" @@ -136,27 +134,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateInvitesV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateInvitesV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateInvitesV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the required json array is present if (jsonObj.get("emails") == null) { throw new IllegalArgumentException( @@ -193,9 +192,9 @@ public void write(JsonWriter out, CreateInvitesV1Output value) @Override public CreateInvitesV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java index 938c3747..73386137 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabel200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateLabel200Response data(CreateLabelV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateLabelV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabel200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateLabel200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateLabel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateLabel200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateLabel200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateLabel200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateLabelV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, CreateLabel200Response value) @Override public CreateLabel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java index 569efc86..b3e7f537 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Creates a new label in the current Workspace. */ -@ApiModel(description = "Creates a new label in the current Workspace.") public class CreateLabelV1Input { public static final String SERIALIZED_NAME_LABEL = "label"; @SerializedName(SERIALIZED_NAME_LABEL) - private Label label; + private LabelV1 label; public CreateLabelV1Input() {} - public CreateLabelV1Input label(Label label) { + public CreateLabelV1Input label(LabelV1 label) { this.label = label; return this; @@ -52,12 +48,11 @@ public CreateLabelV1Input label(Label label) { * @return label */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Label getLabel() { + public LabelV1 getLabel() { return label; } - public void setLabel(Label label) { + public void setLabel(LabelV1 label) { this.label = label; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateLabelV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateLabelV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateLabelV1Input is not found in the" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateLabelV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateLabelV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateLabelV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `label` + LabelV1.validateJsonElement(jsonObj.get("label")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, CreateLabelV1Input value) @Override public CreateLabelV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java index 40af0108..a67e0fa2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateLabelV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Result of creating a new label in the current Workspace. */ -@ApiModel(description = "Result of creating a new label in the current Workspace.") public class CreateLabelV1Output { public static final String SERIALIZED_NAME_LABEL = "label"; @SerializedName(SERIALIZED_NAME_LABEL) - private Label1 label; + private LabelV1 label; public CreateLabelV1Output() {} - public CreateLabelV1Output label(Label1 label) { + public CreateLabelV1Output label(LabelV1 label) { this.label = label; return this; @@ -52,12 +48,11 @@ public CreateLabelV1Output label(Label1 label) { * @return label */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Label1 getLabel() { + public LabelV1 getLabel() { return label; } - public void setLabel(Label1 label) { + public void setLabel(LabelV1 label) { this.label = label; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateLabelV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateLabelV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateLabelV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateLabelV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateLabelV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateLabelV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateLabelV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `label` + LabelV1.validateJsonElement(jsonObj.get("label")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, CreateLabelV1Output value) @Override public CreateLabelV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java index 2667dfd6..3afd7128 100644 --- a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateProfilesWarehouse200Response data(CreateProfilesWarehouseAlphaOutpu * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateProfilesWarehouseAlphaOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateProfilesWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateProfilesWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateProfilesWarehouse200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateProfilesWarehouse200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateProfilesWarehouse200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateProfilesWarehouseAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, CreateProfilesWarehouse200Response value) @Override public CreateProfilesWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java index 4cf6bf23..20e083b5 100644 --- a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Create a new Profiles Warehouse based on a set of parameters. */ -@ApiModel(description = "Create a new Profiles Warehouse based on a set of parameters.") public class CreateProfilesWarehouseAlphaInput { public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; @@ -52,7 +48,7 @@ public class CreateProfilesWarehouseAlphaInput { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public static final String SERIALIZED_NAME_SCHEMA_NAME = "schemaName"; @@ -73,7 +69,6 @@ public CreateProfilesWarehouseAlphaInput metadataId(String metadataId) { * @return metadataId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Warehouse metadata to use.") public String getMetadataId() { return metadataId; } @@ -94,7 +89,6 @@ public CreateProfilesWarehouseAlphaInput name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional human-readable name for this Warehouse.") public String getName() { return name; } @@ -115,7 +109,6 @@ public CreateProfilesWarehouseAlphaInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow this Warehouse to receive data. Defaults to true.") public Boolean getEnabled() { return enabled; } @@ -124,36 +117,31 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public CreateProfilesWarehouseAlphaInput settings(Map settings) { + public CreateProfilesWarehouseAlphaInput settings(Map settings) { this.settings = settings; return this; } + public CreateProfilesWarehouseAlphaInput putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * A key-value object that contains instance-specific settings for a Warehouse. Different kinds - * of Warehouses require different settings. The required and optional settings for a Warehouse - * are described in the `options` object of the associated Warehouse metadata. You can - * find the full list of Warehouse metadata and related settings information in the - * `/catalog/warehouses` endpoint. + * A key-value object that contains instance-specific Warehouse settings. * * @return settings */ - @javax.annotation.Nullable - @ApiModelProperty( - required = true, - value = - "A key-value object that contains instance-specific settings for a Warehouse. " - + " Different kinds of Warehouses require different settings. The required" - + " and optional settings for a Warehouse are described in the `options`" - + " object of the associated Warehouse metadata. You can find the full" - + " list of Warehouse metadata and related settings information in the" - + " `/catalog/warehouses` endpoint.") - public Map getSettings() { + @javax.annotation.Nonnull + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -170,10 +158,6 @@ public CreateProfilesWarehouseAlphaInput schemaName(String schemaName) { * @return schemaName */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The custom schema name that Segment uses on the Warehouse side. The space slug" - + " value is default otherwise.") public String getSchemaName() { return schemaName; } @@ -247,16 +231,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateProfilesWarehouseAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateProfilesWarehouseAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateProfilesWarehouseAlphaInput is" @@ -266,27 +250,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateProfilesWarehouseAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateProfilesWarehouseAlphaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateProfilesWarehouseAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("metadataId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -337,9 +322,9 @@ public void write(JsonWriter out, CreateProfilesWarehouseAlphaInput value) @Override public CreateProfilesWarehouseAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java index 091c8b74..8c320414 100644 --- a/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateProfilesWarehouseAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,26 +21,23 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the newly created Warehouse. */ -@ApiModel(description = "Returns the newly created Warehouse.") public class CreateProfilesWarehouseAlphaOutput { public static final String SERIALIZED_NAME_PROFILES_WAREHOUSE = "profilesWarehouse"; @SerializedName(SERIALIZED_NAME_PROFILES_WAREHOUSE) - private ProfilesWarehouse profilesWarehouse; + private ProfilesWarehouseAlpha profilesWarehouse; public CreateProfilesWarehouseAlphaOutput() {} public CreateProfilesWarehouseAlphaOutput profilesWarehouse( - ProfilesWarehouse profilesWarehouse) { + ProfilesWarehouseAlpha profilesWarehouse) { this.profilesWarehouse = profilesWarehouse; return this; @@ -53,12 +49,11 @@ public CreateProfilesWarehouseAlphaOutput profilesWarehouse( * @return profilesWarehouse */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public ProfilesWarehouse getProfilesWarehouse() { + public ProfilesWarehouseAlpha getProfilesWarehouse() { return profilesWarehouse; } - public void setProfilesWarehouse(ProfilesWarehouse profilesWarehouse) { + public void setProfilesWarehouse(ProfilesWarehouseAlpha profilesWarehouse) { this.profilesWarehouse = profilesWarehouse; } @@ -117,16 +112,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateProfilesWarehouseAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateProfilesWarehouseAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateProfilesWarehouseAlphaOutput is" @@ -136,27 +131,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateProfilesWarehouseAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateProfilesWarehouseAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateProfilesWarehouseAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `profilesWarehouse` + ProfilesWarehouseAlpha.validateJsonElement(jsonObj.get("profilesWarehouse")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -184,9 +182,9 @@ public void write(JsonWriter out, CreateProfilesWarehouseAlphaOutput value) @Override public CreateProfilesWarehouseAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java index bd19f9f2..e2058531 100644 --- a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModel200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateReverseEtlModel200Response data(CreateReverseEtlModelOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateReverseEtlModelOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateReverseEtlModel200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateReverseEtlModel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateReverseEtlModel200Response is" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateReverseEtlModel200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateReverseEtlModelOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, CreateReverseEtlModel200Response value) @Override public CreateReverseEtlModel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java index 4870da01..50e3b39a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,17 +22,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Defines how to create a new Model. */ -@ApiModel(description = "Defines how to create a new Model.") public class CreateReverseEtlModelInput { public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @@ -114,7 +110,7 @@ public ScheduleStrategyEnum read(final JsonReader jsonReader) throws IOException public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) - private Map scheduleConfig; + private Map scheduleConfig; public static final String SERIALIZED_NAME_QUERY = "query"; @@ -140,7 +136,6 @@ public CreateReverseEtlModelInput sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Indicates which Source to attach this model to.") public String getSourceId() { return sourceId; } @@ -161,7 +156,6 @@ public CreateReverseEtlModelInput name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A short, human-readable description of the Model.") public String getName() { return name; } @@ -182,9 +176,6 @@ public CreateReverseEtlModelInput description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A longer, more descriptive explanation of the Model.") public String getDescription() { return description; } @@ -206,12 +197,6 @@ public CreateReverseEtlModelInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Indicates whether the Model should have syncs enabled. When disabled, no syncs" - + " will be triggered, regardless of the enabled status of the attached" - + " destinations/subscriptions.") public Boolean getEnabled() { return enabled; } @@ -233,11 +218,6 @@ public CreateReverseEtlModelInput scheduleStrategy(ScheduleStrategyEnum schedule * @return scheduleStrategy */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Determines the strategy used for triggering syncs, which will be used in" - + " conjunction with scheduleConfig.") public ScheduleStrategyEnum getScheduleStrategy() { return scheduleStrategy; } @@ -246,26 +226,32 @@ public void setScheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { this.scheduleStrategy = scheduleStrategy; } - public CreateReverseEtlModelInput scheduleConfig(Map scheduleConfig) { + public CreateReverseEtlModelInput scheduleConfig(Map scheduleConfig) { this.scheduleConfig = scheduleConfig; return this; } + public CreateReverseEtlModelInput putScheduleConfigItem(String key, Object scheduleConfigItem) { + if (this.scheduleConfig == null) { + this.scheduleConfig = new HashMap<>(); + } + this.scheduleConfig.put(key, scheduleConfigItem); + return this; + } + /** - * Depending on the chosen strategy, configures the schedule for this model. + * Defines a configuration object used for scheduling, which can vary depending on the + * configured strategy, but must always be an object with at least 1 level of keys. * * @return scheduleConfig */ - @javax.annotation.Nullable - @ApiModelProperty( - required = true, - value = "Depending on the chosen strategy, configures the schedule for this model.") - public Map getScheduleConfig() { + @javax.annotation.Nonnull + public Map getScheduleConfig() { return scheduleConfig; } - public void setScheduleConfig(Map scheduleConfig) { + public void setScheduleConfig(Map scheduleConfig) { this.scheduleConfig = scheduleConfig; } @@ -281,11 +267,6 @@ public CreateReverseEtlModelInput query(String query) { * @return query */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The SQL query that will be executed to extract data from the connected" - + " Source.") public String getQuery() { return query; } @@ -307,11 +288,6 @@ public CreateReverseEtlModelInput queryIdentifierColumn(String queryIdentifierCo * @return queryIdentifierColumn */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Indicates the column named in `query` that should be used to uniquely identify" - + " the extracted records.") public String getQueryIdentifierColumn() { return queryIdentifierColumn; } @@ -412,15 +388,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateReverseEtlModelInput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateReverseEtlModelInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateReverseEtlModelInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateReverseEtlModelInput is not" @@ -429,27 +405,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateReverseEtlModelInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateReverseEtlModelInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateReverseEtlModelInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -517,9 +494,9 @@ public void write(JsonWriter out, CreateReverseEtlModelInput value) @Override public CreateReverseEtlModelInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java index 9b2b8f2d..aa23e990 100644 --- a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines the results of creating a Model. */ -@ApiModel(description = "Defines the results of creating a Model.") public class CreateReverseEtlModelOutput { public static final String SERIALIZED_NAME_REVERSE_ETL_MODEL = "reverseEtlModel"; @@ -52,7 +48,6 @@ public CreateReverseEtlModelOutput reverseEtlModel(ReverseEtlModel reverseEtlMod * @return reverseEtlModel */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public ReverseEtlModel getReverseEtlModel() { return reverseEtlModel; } @@ -112,15 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateReverseEtlModelOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateReverseEtlModelOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateReverseEtlModelOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateReverseEtlModelOutput is not" @@ -129,27 +125,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateReverseEtlModelOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateReverseEtlModelOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `reverseEtlModel` + ReverseEtlModel.validateJsonElement(jsonObj.get("reverseEtlModel")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +174,9 @@ public void write(JsonWriter out, CreateReverseEtlModelOutput value) @Override public CreateReverseEtlModelOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java index d9a27ae2..448111fe 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateSource200Response data(CreateSourceV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateSourceV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSource200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSource200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSource200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSource200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSource200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSource200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateSourceV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, CreateSource200Response value) @Override public CreateSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java index 8af37cbb..54e20f93 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/CreateSource200Response1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateSource200Response1 data(CreateSourceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateSourceAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSource200Response1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSource200Response1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSource200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSource200Response1 is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSource200Response1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSource200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateSourceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, CreateSource200Response1 value) @Override public CreateSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java index 079c3b67..74c3143e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,19 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** Create a new Source based on a set of parameters. */ -@ApiModel(description = "Create a new Source based on a set of parameters.") public class CreateSourceAlphaInput { public static final String SERIALIZED_NAME_SLUG = "slug"; @@ -59,7 +53,7 @@ public class CreateSourceAlphaInput { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public CreateSourceAlphaInput() {} @@ -75,9 +69,6 @@ public CreateSourceAlphaInput slug(String slug) { * @return slug */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The slug by which to identify the Source in the Segment app.") public String getSlug() { return slug; } @@ -98,9 +89,6 @@ public CreateSourceAlphaInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Enable to allow this Source to send data. Defaults to true.") public Boolean getEnabled() { return enabled; } @@ -121,7 +109,6 @@ public CreateSourceAlphaInput name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional human-readable name for this Source.") public String getName() { return name; } @@ -143,11 +130,6 @@ public CreateSourceAlphaInput metadataId(String metadataId) { * @return metadataId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of the Source metadata from which this instance of the Source derives. " - + " All Source metadata is available under `/catalog/sources`.") public String getMetadataId() { return metadataId; } @@ -156,25 +138,32 @@ public void setMetadataId(String metadataId) { this.metadataId = metadataId; } - public CreateSourceAlphaInput settings(Map settings) { + public CreateSourceAlphaInput settings(Map settings) { this.settings = settings; return this; } + public CreateSourceAlphaInput putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * A key-value object that contains instance-specific settings for the Source. + * A key-value object that contains instance-specific settings for a Source. The + * `options` field in the Source metadata defines the schema of this object. * * @return settings */ @javax.annotation.Nullable - @ApiModelProperty( - value = "A key-value object that contains instance-specific settings for the Source.") - public Map getSettings() { + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -194,27 +183,11 @@ public boolean equals(Object o) { && Objects.equals(this.settings, createSourceAlphaInput.settings); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(slug, enabled, name, metadataId, settings); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -259,15 +232,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceAlphaInput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSourceAlphaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceAlphaInput is not found in" @@ -276,27 +249,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceAlphaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSourceAlphaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("slug").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -343,9 +317,9 @@ public void write(JsonWriter out, CreateSourceAlphaInput value) @Override public CreateSourceAlphaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java index 5615bb4b..9c5e1527 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the newly Source. */ -@ApiModel(description = "Returns the newly Source.") public class CreateSourceAlphaOutput { public static final String SERIALIZED_NAME_SOURCE = "source"; @SerializedName(SERIALIZED_NAME_SOURCE) - private Source2 source; + private SourceAlpha source; public CreateSourceAlphaOutput() {} - public CreateSourceAlphaOutput source(Source2 source) { + public CreateSourceAlphaOutput source(SourceAlpha source) { this.source = source; return this; @@ -52,12 +48,11 @@ public CreateSourceAlphaOutput source(Source2 source) { * @return source */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Source2 getSource() { + public SourceAlpha getSource() { return source; } - public void setSource(Source2 source) { + public void setSource(SourceAlpha source) { this.source = source; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSourceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceAlphaOutput is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `source` + SourceAlpha.validateJsonElement(jsonObj.get("source")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, CreateSourceAlphaOutput value) @Override public CreateSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java index 53577e8b..29c4b895 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateSourceRegulation200Response data(CreateSourceRegulationV1Output dat * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateSourceRegulationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateSourceRegulation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceRegulation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceRegulation200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceRegulation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceRegulation200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateSourceRegulationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, CreateSourceRegulation200Response value) @Override public CreateSourceRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 753518b7..60d5db78 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input to create a Source-scoped regulation. */ -@ApiModel(description = "The input to create a Source-scoped regulation.") public class CreateSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) @@ -161,7 +157,6 @@ public CreateSourceRegulationV1Input regulationType(RegulationTypeEnum regulatio * @return regulationType */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The regulation type to create.") public RegulationTypeEnum getRegulationType() { return regulationType; } @@ -182,7 +177,6 @@ public CreateSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { * @return subjectType */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The subject type.") public SubjectTypeEnum getSubjectType() { return subjectType; } @@ -198,6 +192,9 @@ public CreateSourceRegulationV1Input subjectIds(List subjectIds) { } public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { + if (this.subjectIds == null) { + this.subjectIds = new ArrayList<>(); + } this.subjectIds.add(subjectIdsItem); return this; } @@ -209,11 +206,6 @@ public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { * @return subjectIds */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The list of `userId` or `objectId` values of the subjects to regulate. Config" - + " API note: equal to `parent` but allows an array.") public List getSubjectIds() { return subjectIds; } @@ -282,16 +274,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateSourceRegulationV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceRegulationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceRegulationV1Input is not" @@ -300,27 +292,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceRegulationV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceRegulationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSourceRegulationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("regulationType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -374,9 +367,9 @@ public void write(JsonWriter out, CreateSourceRegulationV1Input value) @Override public CreateSourceRegulationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java index ddc99706..121571cf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of a create Source regulation call. */ -@ApiModel(description = "The output of a create Source regulation call.") public class CreateSourceRegulationV1Output { public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; @@ -52,7 +48,6 @@ public CreateSourceRegulationV1Output regulateId(String regulateId) { * @return regulateId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the created regulation.") public String getRegulateId() { return regulateId; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateSourceRegulationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceRegulationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceRegulationV1Output is not" @@ -131,27 +126,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceRegulationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceRegulationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSourceRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("regulateId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -186,9 +182,9 @@ public void write(JsonWriter out, CreateSourceRegulationV1Output value) @Override public CreateSourceRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index f97aa16a..356ed52d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,19 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** Create a new Source based on a set of parameters. */ -@ApiModel(description = "Create a new Source based on a set of parameters.") public class CreateSourceV1Input { public static final String SERIALIZED_NAME_SLUG = "slug"; @@ -54,7 +48,7 @@ public class CreateSourceV1Input { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public CreateSourceV1Input() {} @@ -70,9 +64,6 @@ public CreateSourceV1Input slug(String slug) { * @return slug */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The slug by which to identify the Source in the Segment app.") public String getSlug() { return slug; } @@ -93,9 +84,6 @@ public CreateSourceV1Input enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Enable to allow this Source to send data. Defaults to true.") public Boolean getEnabled() { return enabled; } @@ -117,11 +105,6 @@ public CreateSourceV1Input metadataId(String metadataId) { * @return metadataId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of the Source metadata from which this instance of the Source derives. " - + " All Source metadata is available under `/catalog/sources`.") public String getMetadataId() { return metadataId; } @@ -130,25 +113,32 @@ public void setMetadataId(String metadataId) { this.metadataId = metadataId; } - public CreateSourceV1Input settings(Map settings) { + public CreateSourceV1Input settings(Map settings) { this.settings = settings; return this; } + public CreateSourceV1Input putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * A key-value object that contains instance-specific settings for the Source. + * A key-value object that contains instance-specific settings for a Source. The + * `options` field in the Source metadata defines the schema of this object. * * @return settings */ @javax.annotation.Nullable - @ApiModelProperty( - value = "A key-value object that contains instance-specific settings for the Source.") - public Map getSettings() { + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -167,27 +157,11 @@ public boolean equals(Object o) { && Objects.equals(this.settings, createSourceV1Input.settings); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(slug, enabled, metadataId, settings); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -230,15 +204,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSourceV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceV1Input is not found in" @@ -247,27 +221,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSourceV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("slug").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -306,9 +281,9 @@ public void write(JsonWriter out, CreateSourceV1Input value) @Override public CreateSourceV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java index 289c41e8..bd937135 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a newly created Source. */ -@ApiModel(description = "Returns a newly created Source.") public class CreateSourceV1Output { public static final String SERIALIZED_NAME_SOURCE = "source"; @SerializedName(SERIALIZED_NAME_SOURCE) - private Source5 source; + private SourceV1 source; public CreateSourceV1Output() {} - public CreateSourceV1Output source(Source5 source) { + public CreateSourceV1Output source(SourceV1 source) { this.source = source; return this; @@ -52,12 +48,11 @@ public CreateSourceV1Output source(Source5 source) { * @return source */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Source5 getSource() { + public SourceV1 getSource() { return source; } - public void setSource(Source5 source) { + public void setSource(SourceV1 source) { this.source = source; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateSourceV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSourceV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateSourceV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateSourceV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateSourceV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateSourceV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `source` + SourceV1.validateJsonElement(jsonObj.get("source")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, CreateSourceV1Output value) @Override public CreateSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java index 32b68deb..c3a88907 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlan200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateTrackingPlan200Response data(CreateTrackingPlanV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateTrackingPlanV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateTrackingPlan200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTrackingPlan200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTrackingPlan200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTrackingPlan200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTrackingPlan200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateTrackingPlanV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, CreateTrackingPlan200Response value) @Override public CreateTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java index ed37e3f6..c87b1feb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Creates a Tracking Plan in the Workspace. */ -@ApiModel(description = "Creates a Tracking Plan in the Workspace.") public class CreateTrackingPlanV1Input { public static final String SERIALIZED_NAME_NAME = "name"; @@ -115,9 +111,6 @@ public CreateTrackingPlanV1Input name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Tracking Plan's name. Config API note: equal to `displayName`.") public String getName() { return name; } @@ -138,7 +131,6 @@ public CreateTrackingPlanV1Input description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "The Tracking Plan's description.") public String getDescription() { return description; } @@ -159,7 +151,6 @@ public CreateTrackingPlanV1Input type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Tracking Plan's type.") public TypeEnum getType() { return type; } @@ -226,15 +217,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlanV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateTrackingPlanV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTrackingPlanV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTrackingPlanV1Input is not found" @@ -243,27 +234,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTrackingPlanV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTrackingPlanV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateTrackingPlanV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -311,9 +303,9 @@ public void write(JsonWriter out, CreateTrackingPlanV1Input value) @Override public CreateTrackingPlanV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java index ed4840d6..d0bb83f3 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTrackingPlanV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Result of a CreateTrackingPlan call. */ -@ApiModel(description = "Result of a CreateTrackingPlan call.") public class CreateTrackingPlanV1Output { public static final String SERIALIZED_NAME_TRACKING_PLAN = "trackingPlan"; @SerializedName(SERIALIZED_NAME_TRACKING_PLAN) - private TrackingPlan1 trackingPlan; + private TrackingPlanV1 trackingPlan; public CreateTrackingPlanV1Output() {} - public CreateTrackingPlanV1Output trackingPlan(TrackingPlan1 trackingPlan) { + public CreateTrackingPlanV1Output trackingPlan(TrackingPlanV1 trackingPlan) { this.trackingPlan = trackingPlan; return this; @@ -52,12 +48,11 @@ public CreateTrackingPlanV1Output trackingPlan(TrackingPlan1 trackingPlan) { * @return trackingPlan */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public TrackingPlan1 getTrackingPlan() { + public TrackingPlanV1 getTrackingPlan() { return trackingPlan; } - public void setTrackingPlan(TrackingPlan1 trackingPlan) { + public void setTrackingPlan(TrackingPlanV1 trackingPlan) { this.trackingPlan = trackingPlan; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTrackingPlanV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateTrackingPlanV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTrackingPlanV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTrackingPlanV1Output is not" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTrackingPlanV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `trackingPlan` + TrackingPlanV1.validateJsonElement(jsonObj.get("trackingPlan")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, CreateTrackingPlanV1Output value) @Override public CreateTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java index 09fbf5fa..77794da3 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateTransformation200Response data(CreateTransformationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateTransformationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateTransformation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTransformation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTransformation200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTransformation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTransformation200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateTransformationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, CreateTransformation200Response value) @Override public CreateTransformation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java index 998e2f7b..813c93e8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input to create a Transformation. */ -@ApiModel(description = "The input to create a Transformation.") public class CreateTransformationBetaInput { public static final String SERIALIZED_NAME_NAME = "name"; @@ -69,13 +65,13 @@ public class CreateTransformationBetaInput { public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; + private List propertyRenames; public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; + private List propertyValueTransformations; public CreateTransformationBetaInput() {} @@ -91,7 +87,6 @@ public CreateTransformationBetaInput name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") public String getName() { return name; } @@ -112,9 +107,6 @@ public CreateTransformationBetaInput sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source to be associated with the Transformation.") public String getSourceId() { return sourceId; } @@ -135,10 +127,6 @@ public CreateTransformationBetaInput destinationMetadataId(String destinationMet * @return destinationMetadataId */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The optional Destination metadata id to be associated with the" - + " Transformation.") public String getDestinationMetadataId() { return destinationMetadataId; } @@ -159,7 +147,6 @@ public CreateTransformationBetaInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") public Boolean getEnabled() { return enabled; } @@ -184,13 +171,6 @@ public CreateTransformationBetaInput _if(String _if) { * @return _if */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") public String getIf() { return _if; } @@ -211,10 +191,6 @@ public CreateTransformationBetaInput newEventName(String newEventName) { * @return newEventName */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") public String getNewEventName() { return newEventName; } @@ -244,7 +220,6 @@ public CreateTransformationBetaInput addPropertyRenamesItem( * @return propertyRenames */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") public List getPropertyRenames() { return propertyRenames; } @@ -276,10 +251,6 @@ public CreateTransformationBetaInput addPropertyValueTransformationsItem( * @return propertyValueTransformations */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") public List getPropertyValueTransformations() { return propertyValueTransformations; } @@ -382,16 +353,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateTransformationBetaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTransformationBetaInput is not" @@ -400,27 +371,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTransformationBetaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -471,6 +443,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " JSON string but got `%s`", jsonObj.get("propertyRenames").toString())); } + + // validate the optional field `propertyRenames` (array) + for (int i = 0; i < jsonArraypropertyRenames.size(); i++) { + PropertyRenameBeta.validateJsonElement(jsonArraypropertyRenames.get(i)); + } + ; } } if (jsonObj.get("propertyValueTransformations") != null @@ -486,6 +464,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); } + + // validate the optional field `propertyValueTransformations` (array) + for (int i = 0; i < jsonArraypropertyValueTransformations.size(); i++) { + PropertyValueTransformationBeta.validateJsonElement( + jsonArraypropertyValueTransformations.get(i)); + } + ; } } } @@ -515,9 +500,9 @@ public void write(JsonWriter out, CreateTransformationBetaInput value) @Override public CreateTransformationBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java index f0a448c0..60f3c737 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationBetaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of a created Transformation. */ -@ApiModel(description = "The output of a created Transformation.") public class CreateTransformationBetaOutput { public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation2 transformation; + private TransformationBeta transformation; public CreateTransformationBetaOutput() {} - public CreateTransformationBetaOutput transformation(Transformation2 transformation) { + public CreateTransformationBetaOutput transformation(TransformationBeta transformation) { this.transformation = transformation; return this; @@ -52,12 +48,11 @@ public CreateTransformationBetaOutput transformation(Transformation2 transformat * @return transformation */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation2 getTransformation() { + public TransformationBeta getTransformation() { return transformation; } - public void setTransformation(Transformation2 transformation) { + public void setTransformation(TransformationBeta transformation) { this.transformation = transformation; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateTransformationBetaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTransformationBetaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTransformationBetaOutput is not" @@ -131,27 +126,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTransformationBetaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTransformationBetaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateTransformationBetaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `transformation` + TransformationBeta.validateJsonElement(jsonObj.get("transformation")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -179,9 +177,9 @@ public void write(JsonWriter out, CreateTransformationBetaOutput value) @Override public CreateTransformationBetaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index 54cac2cf..176439e0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input to create a Transformation. */ -@ApiModel(description = "The input to create a Transformation.") public class CreateTransformationV1Input { public static final String SERIALIZED_NAME_NAME = "name"; @@ -69,18 +65,18 @@ public class CreateTransformationV1Input { public static final String SERIALIZED_NAME_PROPERTY_RENAMES = "propertyRenames"; @SerializedName(SERIALIZED_NAME_PROPERTY_RENAMES) - private List propertyRenames = null; + private List propertyRenames; public static final String SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS = "propertyValueTransformations"; @SerializedName(SERIALIZED_NAME_PROPERTY_VALUE_TRANSFORMATIONS) - private List propertyValueTransformations = null; + private List propertyValueTransformations; public static final String SERIALIZED_NAME_FQL_DEFINED_PROPERTIES = "fqlDefinedProperties"; @SerializedName(SERIALIZED_NAME_FQL_DEFINED_PROPERTIES) - private List fqlDefinedProperties = null; + private List fqlDefinedProperties; public CreateTransformationV1Input() {} @@ -96,7 +92,6 @@ public CreateTransformationV1Input name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Transformation.") public String getName() { return name; } @@ -117,9 +112,6 @@ public CreateTransformationV1Input sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source to be associated with the Transformation.") public String getSourceId() { return sourceId; } @@ -140,10 +132,6 @@ public CreateTransformationV1Input destinationMetadataId(String destinationMetad * @return destinationMetadataId */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The optional Destination metadata id to be associated with the" - + " Transformation.") public String getDestinationMetadataId() { return destinationMetadataId; } @@ -164,7 +152,6 @@ public CreateTransformationV1Input enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "If the Transformation should be enabled.") public Boolean getEnabled() { return enabled; } @@ -189,13 +176,6 @@ public CreateTransformationV1Input _if(String _if) { * @return _if */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "If statement ([FQL](https://segment.com/docs/config-api/fql/)) to match" - + " events. For standard event matchers, use the following: Track -\\>" - + " \"event='\\'\" Identify -\\> \"type='identify'\" Group" - + " -\\> \"type='group'\"") public String getIf() { return _if; } @@ -216,10 +196,6 @@ public CreateTransformationV1Input newEventName(String newEventName) { * @return newEventName */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional new event name for renaming events. Works only for 'track' event" - + " type.") public String getNewEventName() { return newEventName; } @@ -249,7 +225,6 @@ public CreateTransformationV1Input addPropertyRenamesItem( * @return propertyRenames */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional array for renaming properties collected by your events.") public List getPropertyRenames() { return propertyRenames; } @@ -281,10 +256,6 @@ public CreateTransformationV1Input addPropertyValueTransformationsItem( * @return propertyValueTransformations */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for transforming properties and values collected by your" - + " events. Limited to 10 properties.") public List getPropertyValueTransformations() { return propertyValueTransformations; } @@ -317,11 +288,6 @@ public CreateTransformationV1Input addFqlDefinedPropertiesItem( * @return fqlDefinedProperties */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Optional array for defining new properties in" - + " [FQL](https://segment.com/docs/config-api/fql/). Currently limited to 1" - + " property.") public List getFqlDefinedProperties() { return fqlDefinedProperties; } @@ -429,15 +395,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateTransformationV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateTransformationV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTransformationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTransformationV1Input is not" @@ -446,27 +413,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTransformationV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTransformationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateTransformationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -517,6 +485,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " JSON string but got `%s`", jsonObj.get("propertyRenames").toString())); } + + // validate the optional field `propertyRenames` (array) + for (int i = 0; i < jsonArraypropertyRenames.size(); i++) { + PropertyRenameV1.validateJsonElement(jsonArraypropertyRenames.get(i)); + } + ; } } if (jsonObj.get("propertyValueTransformations") != null @@ -532,6 +506,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " array in the JSON string but got `%s`", jsonObj.get("propertyValueTransformations").toString())); } + + // validate the optional field `propertyValueTransformations` (array) + for (int i = 0; i < jsonArraypropertyValueTransformations.size(); i++) { + PropertyValueTransformationV1.validateJsonElement( + jsonArraypropertyValueTransformations.get(i)); + } + ; } } if (jsonObj.get("fqlDefinedProperties") != null @@ -547,6 +528,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " the JSON string but got `%s`", jsonObj.get("fqlDefinedProperties").toString())); } + + // validate the optional field `fqlDefinedProperties` (array) + for (int i = 0; i < jsonArrayfqlDefinedProperties.size(); i++) { + FQLDefinedPropertyV1.validateJsonElement(jsonArrayfqlDefinedProperties.get(i)); + } + ; } } } @@ -574,9 +561,9 @@ public void write(JsonWriter out, CreateTransformationV1Input value) @Override public CreateTransformationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java index a604790d..95364c3f 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of a created Transformation. */ -@ApiModel(description = "The output of a created Transformation.") public class CreateTransformationV1Output { public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation5 transformation; + private TransformationV1 transformation; public CreateTransformationV1Output() {} - public CreateTransformationV1Output transformation(Transformation5 transformation) { + public CreateTransformationV1Output transformation(TransformationV1 transformation) { this.transformation = transformation; return this; @@ -52,12 +48,11 @@ public CreateTransformationV1Output transformation(Transformation5 transformatio * @return transformation */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation5 getTransformation() { + public TransformationV1 getTransformation() { return transformation; } - public void setTransformation(Transformation5 transformation) { + public void setTransformation(TransformationV1 transformation) { this.transformation = transformation; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateTransformationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateTransformationV1Output is not" @@ -131,27 +126,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateTransformationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `transformation` + TransformationV1.validateJsonElement(jsonObj.get("transformation")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -178,9 +176,9 @@ public void write(JsonWriter out, CreateTransformationV1Output value) @Override public CreateTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java index bf6b8915..6f36bcbb 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroup200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateUserGroup200Response data(CreateUserGroupV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateUserGroupV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateUserGroup200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateUserGroup200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateUserGroup200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateUserGroup200Response is not" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateUserGroup200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateUserGroup200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateUserGroupV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, CreateUserGroup200Response value) @Override public CreateUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java index 4ab3946d..0e3046a0 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,19 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Creates a user group, used to bundle permissions for its members, within a Workspace. */ -@ApiModel( - description = - "Creates a user group, used to bundle permissions for its members, within a" - + " Workspace.") public class CreateUserGroupV1Input { public static final String SERIALIZED_NAME_NAME = "name"; @@ -55,7 +48,6 @@ public CreateUserGroupV1Input name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the user group to create.") public String getName() { return name; } @@ -115,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateUserGroupV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateUserGroupV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateUserGroupV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateUserGroupV1Input is not found in" @@ -132,27 +124,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateUserGroupV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateUserGroupV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateUserGroupV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -184,9 +177,9 @@ public void write(JsonWriter out, CreateUserGroupV1Input value) @Override public CreateUserGroupV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java index 49cc207c..4d955da9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateUserGroupV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the newly created user group. */ -@ApiModel(description = "Returns the newly created user group.") public class CreateUserGroupV1Output { public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; @SerializedName(SERIALIZED_NAME_USER_GROUP) - private UserGroup userGroup; + private UserGroupV1 userGroup; public CreateUserGroupV1Output() {} - public CreateUserGroupV1Output userGroup(UserGroup userGroup) { + public CreateUserGroupV1Output userGroup(UserGroupV1 userGroup) { this.userGroup = userGroup; return this; @@ -52,12 +48,11 @@ public CreateUserGroupV1Output userGroup(UserGroup userGroup) { * @return userGroup */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public UserGroup getUserGroup() { + public UserGroupV1 getUserGroup() { return userGroup; } - public void setUserGroup(UserGroup userGroup) { + public void setUserGroup(UserGroupV1 userGroup) { this.userGroup = userGroup; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateUserGroupV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateUserGroupV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateUserGroupV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateUserGroupV1Output is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateUserGroupV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateUserGroupV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `userGroup` + UserGroupV1.validateJsonElement(jsonObj.get("userGroup")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, CreateUserGroupV1Output value) @Override public CreateUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java index 3e90d7de..28fb2845 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateValidationInWarehouse200Response data(CreateValidationInWarehouseV1 * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateValidationInWarehouseV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateValidationInWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateValidationInWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateValidationInWarehouse200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateValidationInWarehouse200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateValidationInWarehouse200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateValidationInWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public CreateValidationInWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java index d33b85a9..abdc9c87 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Verifies a set of Warehouse credentials by attempting to connect to it. */ -@ApiModel(description = "Verifies a set of Warehouse credentials by attempting to connect to it.") public class CreateValidationInWarehouseV1Input { public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; @@ -42,7 +38,7 @@ public class CreateValidationInWarehouseV1Input { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public CreateValidationInWarehouseV1Input() {} @@ -58,7 +54,6 @@ public CreateValidationInWarehouseV1Input metadataId(String metadataId) { * @return metadataId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Warehouse metadata type.") public String getMetadataId() { return metadataId; } @@ -67,24 +62,31 @@ public void setMetadataId(String metadataId) { this.metadataId = metadataId; } - public CreateValidationInWarehouseV1Input settings(Map settings) { + public CreateValidationInWarehouseV1Input settings(Map settings) { this.settings = settings; return this; } + public CreateValidationInWarehouseV1Input putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * The settings to check. + * A key-value object that contains instance-specific Warehouse settings. * * @return settings */ - @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "The settings to check.") - public Map getSettings() { + @javax.annotation.Nonnull + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -144,16 +146,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateValidationInWarehouseV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateValidationInWarehouseV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateValidationInWarehouseV1Input is" @@ -163,27 +165,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateValidationInWarehouseV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateValidationInWarehouseV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateValidationInWarehouseV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("metadataId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -218,9 +221,9 @@ public void write(JsonWriter out, CreateValidationInWarehouseV1Input value) @Override public CreateValidationInWarehouseV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java index 25d6304f..4c5ba05e 100644 --- a/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateValidationInWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,19 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a Warehouse connection settings after an attempt to connect to it. */ -@ApiModel( - description = - "Returns the status of a Warehouse connection settings after an attempt to connect" - + " to it.") public class CreateValidationInWarehouseV1Output { /** Represents the status for the current connection settings. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -102,9 +95,6 @@ public CreateValidationInWarehouseV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Represents the status for the current connection settings.") public StatusEnum getStatus() { return status; } @@ -165,16 +155,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateValidationInWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateValidationInWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateValidationInWarehouseV1Output is" @@ -184,27 +174,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateValidationInWarehouseV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateValidationInWarehouseV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateValidationInWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -239,9 +230,9 @@ public void write(JsonWriter out, CreateValidationInWarehouseV1Output value) @Override public CreateValidationInWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java index 42f07a8a..e1d6f72b 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateWarehouse200Response data(CreateWarehouseV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateWarehouseV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWarehouse200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateWarehouse200Response is not" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateWarehouse200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateWarehouse200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, CreateWarehouse200Response value) @Override public CreateWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index 114151a0..b66784c1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Create a new Warehouse based on a set of parameters. */ -@ApiModel(description = "Create a new Warehouse based on a set of parameters.") public class CreateWarehouseV1Input { public static final String SERIALIZED_NAME_METADATA_ID = "metadataId"; @@ -52,7 +48,7 @@ public class CreateWarehouseV1Input { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public CreateWarehouseV1Input() {} @@ -68,7 +64,6 @@ public CreateWarehouseV1Input metadataId(String metadataId) { * @return metadataId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Warehouse metadata to use.") public String getMetadataId() { return metadataId; } @@ -89,7 +84,6 @@ public CreateWarehouseV1Input name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional human-readable name for this Warehouse.") public String getName() { return name; } @@ -110,7 +104,6 @@ public CreateWarehouseV1Input enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nullable - @ApiModelProperty(value = "Enable to allow this Warehouse to receive data. Defaults to true.") public Boolean getEnabled() { return enabled; } @@ -119,36 +112,31 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public CreateWarehouseV1Input settings(Map settings) { + public CreateWarehouseV1Input settings(Map settings) { this.settings = settings; return this; } + public CreateWarehouseV1Input putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * A key-value object that contains instance-specific settings for a Warehouse. Different kinds - * of Warehouses require different settings. The required and optional settings for a Warehouse - * are described in the `options` object of the associated Warehouse metadata. You can - * find the full list of Warehouse metadata and related settings information in the - * `/catalog/warehouses` endpoint. + * A key-value object that contains instance-specific Warehouse settings. * * @return settings */ - @javax.annotation.Nullable - @ApiModelProperty( - required = true, - value = - "A key-value object that contains instance-specific settings for a Warehouse. " - + " Different kinds of Warehouses require different settings. The required" - + " and optional settings for a Warehouse are described in the `options`" - + " object of the associated Warehouse metadata. You can find the full" - + " list of Warehouse metadata and related settings information in the" - + " `/catalog/warehouses` endpoint.") - public Map getSettings() { + @javax.annotation.Nonnull + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -213,15 +201,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWarehouseV1Input + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateWarehouseV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateWarehouseV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateWarehouseV1Input is not found in" @@ -230,27 +218,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateWarehouseV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateWarehouseV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateWarehouseV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("metadataId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -290,9 +279,9 @@ public void write(JsonWriter out, CreateWarehouseV1Input value) @Override public CreateWarehouseV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java index fde81683..fc2eeba1 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the newly created Warehouse. */ -@ApiModel(description = "Returns the newly created Warehouse.") public class CreateWarehouseV1Output { public static final String SERIALIZED_NAME_WAREHOUSE = "warehouse"; @SerializedName(SERIALIZED_NAME_WAREHOUSE) - private Warehouse1 warehouse; + private WarehouseV1 warehouse; public CreateWarehouseV1Output() {} - public CreateWarehouseV1Output warehouse(Warehouse1 warehouse) { + public CreateWarehouseV1Output warehouse(WarehouseV1 warehouse) { this.warehouse = warehouse; return this; @@ -52,12 +48,11 @@ public CreateWarehouseV1Output warehouse(Warehouse1 warehouse) { * @return warehouse */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Warehouse1 getWarehouse() { + public WarehouseV1 getWarehouse() { return warehouse; } - public void setWarehouse(Warehouse1 warehouse) { + public void setWarehouse(WarehouseV1 warehouse) { this.warehouse = warehouse; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CreateWarehouseV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateWarehouseV1Output is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateWarehouseV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateWarehouseV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `warehouse` + WarehouseV1.validateJsonElement(jsonObj.get("warehouse")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, CreateWarehouseV1Output value) @Override public CreateWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java index 5796f9c4..a0d1faa2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public CreateWorkspaceRegulation200Response data(CreateWorkspaceRegulationV1Outp * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public CreateWorkspaceRegulationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateWorkspaceRegulation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateWorkspaceRegulation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateWorkspaceRegulation200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateWorkspaceRegulation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateWorkspaceRegulation200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateWorkspaceRegulationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public CreateWorkspaceRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index 5692ae18..460c81ca 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input to create a Workspace regulation. */ -@ApiModel(description = "The input to create a Workspace regulation.") public class CreateWorkspaceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) @@ -163,7 +159,6 @@ public CreateWorkspaceRegulationV1Input regulationType(RegulationTypeEnum regula * @return regulationType */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The regulation type to create.") public RegulationTypeEnum getRegulationType() { return regulationType; } @@ -184,9 +179,6 @@ public CreateWorkspaceRegulationV1Input subjectType(SubjectTypeEnum subjectType) * @return subjectType */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The subject type. Use `objectId` for Cloud Source regulations.") public SubjectTypeEnum getSubjectType() { return subjectType; } @@ -202,6 +194,9 @@ public CreateWorkspaceRegulationV1Input subjectIds(List subjectIds) { } public CreateWorkspaceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { + if (this.subjectIds == null) { + this.subjectIds = new ArrayList<>(); + } this.subjectIds.add(subjectIdsItem); return this; } @@ -213,11 +208,6 @@ public CreateWorkspaceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) * @return subjectIds */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The list of `userId` or `objectId` values of the subjects to regulate. Config" - + " API note: equal to `parent` but allows an array.") public List getSubjectIds() { return subjectIds; } @@ -286,16 +276,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateWorkspaceRegulationV1Input */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateWorkspaceRegulationV1Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateWorkspaceRegulationV1Input is" @@ -304,27 +294,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateWorkspaceRegulationV1Input.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateWorkspaceRegulationV1Input` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateWorkspaceRegulationV1Input.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("regulationType").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -378,9 +369,9 @@ public void write(JsonWriter out, CreateWorkspaceRegulationV1Input value) @Override public CreateWorkspaceRegulationV1Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java index c3029deb..43d66795 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of a create Workspace regulation call. */ -@ApiModel(description = "The output of a create Workspace regulation call.") public class CreateWorkspaceRegulationV1Output { public static final String SERIALIZED_NAME_REGULATE_ID = "regulateId"; @@ -52,7 +48,6 @@ public CreateWorkspaceRegulationV1Output regulateId(String regulateId) { * @return regulateId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the created regulation.") public String getRegulateId() { return regulateId; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * CreateWorkspaceRegulationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!CreateWorkspaceRegulationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in CreateWorkspaceRegulationV1Output is" @@ -132,27 +127,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!CreateWorkspaceRegulationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `CreateWorkspaceRegulationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : CreateWorkspaceRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("regulateId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -187,9 +183,9 @@ public void write(JsonWriter out, CreateWorkspaceRegulationV1Output value) @Override public CreateWorkspaceRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java index dae26210..6e29dfa7 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestination200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteDestination200Response data(DeleteDestinationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteDestinationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteDestination200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteDestination200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteDestination200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteDestination200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteDestination200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteDestinationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -165,9 +167,9 @@ public void write(JsonWriter out, DeleteDestination200Response value) @Override public DeleteDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java index beed4187..e3e975e1 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteDestinationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a Destination deletion. */ -@ApiModel(description = "Returns the status of a Destination deletion.") public class DeleteDestinationV1Output { /** The status of the Warehouse deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteDestinationV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteDestinationV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteDestinationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteDestinationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteDestinationV1Output is not found" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteDestinationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteDestinationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -227,9 +223,9 @@ public void write(JsonWriter out, DeleteDestinationV1Output value) @Override public DeleteDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java index 8b391862..06aab391 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunction200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteFunction200Response data(DeleteFunctionV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteFunctionV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteFunction200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteFunction200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteFunction200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteFunction200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteFunction200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteFunction200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteFunctionV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteFunction200Response value) @Override public DeleteFunction200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java index 1699c4c3..6e585176 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteFunctionV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Delete a single Function. */ -@ApiModel(description = "Delete a single Function.") public class DeleteFunctionV1Output { /** The status of the operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteFunctionV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteFunctionV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteFunctionV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteFunctionV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteFunctionV1Output is not found in" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteFunctionV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteFunctionV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteFunctionV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -226,9 +222,9 @@ public void write(JsonWriter out, DeleteFunctionV1Output value) @Override public DeleteFunctionV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java index 00630b51..7455a99d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstance200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public DeleteInsertFunctionInstance200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteInsertFunctionInstanceAlphaOutput getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteInsertFunctionInstance200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteInsertFunctionInstance200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,18 +128,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteInsertFunctionInstance200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteInsertFunctionInstance200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteInsertFunctionInstanceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -172,9 +174,9 @@ public void write( @Override public DeleteInsertFunctionInstance200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java index 99baa644..ba280f19 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInsertFunctionInstanceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Delete an insert Function instance. */ -@ApiModel(description = "Delete an insert Function instance.") public class DeleteInsertFunctionInstanceAlphaOutput { /** The status of the operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteInsertFunctionInstanceAlphaOutput status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") public StatusEnum getStatus() { return status; } @@ -158,16 +153,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteInsertFunctionInstanceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -178,28 +173,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteInsertFunctionInstanceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteInsertFunctionInstanceAlphaOutput` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteInsertFunctionInstanceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -236,9 +232,9 @@ public void write( @Override public DeleteInsertFunctionInstanceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java index 7fd77240..e2d48616 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvites200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteInvites200Response data(DeleteInvitesV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteInvitesV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteInvites200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteInvites200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteInvites200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteInvites200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteInvites200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteInvites200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteInvitesV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteInvites200Response value) @Override public DeleteInvites200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java index b7cea68f..628ddd76 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteInvitesV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of the removal operation. */ -@ApiModel(description = "Returns the status of the removal operation.") public class DeleteInvitesV1Output { /** The status of the invite deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteInvitesV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the invite deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteInvitesV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteInvitesV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteInvitesV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteInvitesV1Output is not found in" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteInvitesV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteInvitesV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteInvitesV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -226,9 +222,9 @@ public void write(JsonWriter out, DeleteInvitesV1Output value) @Override public DeleteInvitesV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java index d7ee648c..795ac931 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteLabel200Response data(DeleteLabelV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteLabelV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabel200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteLabel200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteLabel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteLabel200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteLabel200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteLabel200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteLabelV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, DeleteLabel200Response value) @Override public DeleteLabel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java index b15bcbd3..d62b34e1 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabel200Response1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteLabel200Response1 data(DeleteLabelAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteLabelAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabel200Response1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteLabel200Response1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteLabel200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteLabel200Response1 is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteLabel200Response1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteLabel200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteLabelAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteLabel200Response1 value) @Override public DeleteLabel200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java index b3fd978d..68c165ed 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a label deletion. */ -@ApiModel(description = "Returns the status of a label deletion.") public class DeleteLabelAlphaOutput { /** The status of the label deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteLabelAlphaOutput status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the label deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabelAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteLabelAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteLabelAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteLabelAlphaOutput is not found in" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteLabelAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteLabelAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteLabelAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -226,9 +222,9 @@ public void write(JsonWriter out, DeleteLabelAlphaOutput value) @Override public DeleteLabelAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java index 9dd7d052..bdc1d1db 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteLabelV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a label deletion. */ -@ApiModel(description = "Returns the status of a label deletion.") public class DeleteLabelV1Output { /** The status of the label deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteLabelV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the label deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteLabelV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteLabelV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteLabelV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteLabelV1Output is not found in" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteLabelV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteLabelV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteLabelV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -226,9 +222,9 @@ public void write(JsonWriter out, DeleteLabelV1Output value) @Override public DeleteLabelV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java index d4d8d54c..7d940dc9 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteRegulation200Response data(DeleteRegulationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteRegulationV1Output getData() { return data; } @@ -109,15 +106,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteRegulation200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DeleteRegulation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteRegulation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteRegulation200Response is not" @@ -126,17 +124,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteRegulation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteRegulation200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteRegulationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +165,9 @@ public void write(JsonWriter out, DeleteRegulation200Response value) @Override public DeleteRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java index 132a2b46..8c2b4538 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteRegulationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of the delete regulation call. */ -@ApiModel(description = "The output of the delete regulation call.") public class DeleteRegulationV1Output { /** The status of the deletion call. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteRegulationV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the deletion call.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteRegulationV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteRegulationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteRegulationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteRegulationV1Output is not found" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteRegulationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteRegulationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -227,9 +223,9 @@ public void write(JsonWriter out, DeleteRegulationV1Output value) @Override public DeleteRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java index 0b802205..2def1a17 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModel200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteReverseEtlModel200Response data(DeleteReverseEtlModelOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteReverseEtlModelOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteReverseEtlModel200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteReverseEtlModel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteReverseEtlModel200Response is" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteReverseEtlModel200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteReverseEtlModelOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, DeleteReverseEtlModel200Response value) @Override public DeleteReverseEtlModel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java index 4bc34a18..02495490 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteReverseEtlModelOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines the result of getting a Model. */ -@ApiModel(description = "Defines the result of getting a Model.") public class DeleteReverseEtlModelOutput { /** The result of the deletion. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteReverseEtlModelOutput status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The result of the deletion.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteReverseEtlModelOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DeleteReverseEtlModelOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteReverseEtlModelOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteReverseEtlModelOutput is not" @@ -174,27 +170,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteReverseEtlModelOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteReverseEtlModelOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -227,9 +224,9 @@ public void write(JsonWriter out, DeleteReverseEtlModelOutput value) @Override public DeleteReverseEtlModelOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java index b4d0408d..82b91195 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteSource200Response data(DeleteSourceV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteSourceV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSource200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteSource200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteSource200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteSource200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteSource200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteSource200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteSourceV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteSource200Response value) @Override public DeleteSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java index aaa42bf6..dfdfb32b 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSource200Response1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteSource200Response1 data(DeleteSourceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteSourceAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSource200Response1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteSource200Response1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteSource200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteSource200Response1 is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteSource200Response1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteSource200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteSourceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteSource200Response1 value) @Override public DeleteSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java index f1fe0e84..2ce667fd 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a Source deletion. */ -@ApiModel(description = "Returns the status of a Source deletion.") public class DeleteSourceAlphaOutput { /** The status of the Source deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteSourceAlphaOutput status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Source deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSourceAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteSourceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteSourceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteSourceAlphaOutput is not found" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteSourceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteSourceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -227,9 +223,9 @@ public void write(JsonWriter out, DeleteSourceAlphaOutput value) @Override public DeleteSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java index 48ef8de7..884c4f2f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteSourceV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a Source deletion. */ -@ApiModel(description = "Returns the status of a Source deletion.") public class DeleteSourceV1Output { /** The status of the Source deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteSourceV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Source deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteSourceV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteSourceV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteSourceV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteSourceV1Output is not found in" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteSourceV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteSourceV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -226,9 +222,9 @@ public void write(JsonWriter out, DeleteSourceV1Output value) @Override public DeleteSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java index 8ef1d630..27ca9bb1 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlan200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteTrackingPlan200Response data(DeleteTrackingPlanV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteTrackingPlanV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteTrackingPlan200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteTrackingPlan200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteTrackingPlan200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteTrackingPlan200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteTrackingPlan200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteTrackingPlanV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, DeleteTrackingPlan200Response value) @Override public DeleteTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java index acf621c8..7387ff9f 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTrackingPlanV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Result of a DeleteTrackingPlan call. */ -@ApiModel(description = "Result of a DeleteTrackingPlan call.") public class DeleteTrackingPlanV1Output { /** The operation status. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteTrackingPlanV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteTrackingPlanV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteTrackingPlanV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteTrackingPlanV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteTrackingPlanV1Output is not" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteTrackingPlanV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -227,9 +223,9 @@ public void write(JsonWriter out, DeleteTrackingPlanV1Output value) @Override public DeleteTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java index cbd4a7ab..c679099d 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteTransformation200Response data(DeleteTransformationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteTransformationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteTransformation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteTransformation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteTransformation200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteTransformation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteTransformation200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteTransformationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, DeleteTransformation200Response value) @Override public DeleteTransformation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java index ca8b1fef..6bf7f501 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input of delete Transformation. */ -@ApiModel(description = "The input of delete Transformation.") public class DeleteTransformationBetaInput { public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; @@ -52,7 +48,6 @@ public DeleteTransformationBetaInput transformationId(String transformationId) { * @return transformationId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Transformation id.") public String getTransformationId() { return transformationId; } @@ -114,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteTransformationBetaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteTransformationBetaInput is not" @@ -132,27 +127,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteTransformationBetaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("transformationId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -187,9 +183,9 @@ public void write(JsonWriter out, DeleteTransformationBetaInput value) @Override public DeleteTransformationBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java index 68b39cfe..7c39362b 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationBetaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of delete Transformation. */ -@ApiModel(description = "The output of delete Transformation.") public class DeleteTransformationBetaOutput { /** The operation status. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteTransformationBetaOutput status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") public StatusEnum getStatus() { return status; } @@ -158,16 +153,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteTransformationBetaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteTransformationBetaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteTransformationBetaOutput is not" @@ -176,27 +171,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteTransformationBetaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteTransformationBetaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteTransformationBetaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -231,9 +227,9 @@ public void write(JsonWriter out, DeleteTransformationBetaOutput value) @Override public DeleteTransformationBetaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java index 083b4b8b..633b7312 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteTransformationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of delete Transformation. */ -@ApiModel(description = "The output of delete Transformation.") public class DeleteTransformationV1Output { /** The operation status. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteTransformationV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The operation status.") public StatusEnum getStatus() { return status; } @@ -158,16 +153,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DeleteTransformationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteTransformationV1Output is not" @@ -176,27 +171,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteTransformationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -230,9 +226,9 @@ public void write(JsonWriter out, DeleteTransformationV1Output value) @Override public DeleteTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java index f785970f..d62006a8 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroup200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteUserGroup200Response data(DeleteUserGroupV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteUserGroupV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUserGroup200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteUserGroup200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteUserGroup200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteUserGroup200Response is not" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteUserGroup200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteUserGroup200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteUserGroupV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteUserGroup200Response value) @Override public DeleteUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java index 32270d94..03fc4ba2 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUserGroupV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of the completed deletion operation. */ -@ApiModel(description = "Returns the status of the completed deletion operation.") public class DeleteUserGroupV1Output { /** A flag indicating the status of a successful deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,9 +93,6 @@ public DeleteUserGroupV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A flag indicating the status of a successful deletion operation.") public StatusEnum getStatus() { return status; } @@ -159,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUserGroupV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteUserGroupV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteUserGroupV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteUserGroupV1Output is not found" @@ -176,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteUserGroupV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteUserGroupV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -229,9 +223,9 @@ public void write(JsonWriter out, DeleteUserGroupV1Output value) @Override public DeleteUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java index 7c765184..a9748903 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsers200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteUsers200Response data(DeleteUsersV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteUsersV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUsers200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteUsers200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteUsers200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteUsers200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteUsers200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteUsers200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteUsersV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, DeleteUsers200Response value) @Override public DeleteUsers200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java index 8c742d42..5c4313d3 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteUsersV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of the removal operation. */ -@ApiModel(description = "Returns the status of the removal operation.") public class DeleteUsersV1Output { /** A flag that indicates the status of a successful deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,9 +93,6 @@ public DeleteUsersV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A flag that indicates the status of a successful deletion operation.") public StatusEnum getStatus() { return status; } @@ -159,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteUsersV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteUsersV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteUsersV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteUsersV1Output is not found in" @@ -176,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteUsersV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteUsersV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteUsersV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -228,9 +222,9 @@ public void write(JsonWriter out, DeleteUsersV1Output value) @Override public DeleteUsersV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java index 000932c5..c15551e9 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DeleteWarehouse200Response data(DeleteWarehouseV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DeleteWarehouseV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteWarehouse200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteWarehouse200Response is not" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteWarehouse200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteWarehouse200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, DeleteWarehouse200Response value) @Override public DeleteWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java index 73f7ddf4..e8cffa72 100644 --- a/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/DeleteWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a Warehouse deletion. */ -@ApiModel(description = "Returns the status of a Warehouse deletion.") public class DeleteWarehouseV1Output { /** The status of the Warehouse deletion operation. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public DeleteWarehouseV1Output status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the Warehouse deletion operation.") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeleteWarehouseV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeleteWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeleteWarehouseV1Output is not found" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeleteWarehouseV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeleteWarehouseV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeleteWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -227,9 +223,9 @@ public void write(JsonWriter out, DeleteWarehouseV1Output value) @Override public DeleteWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java deleted file mode 100644 index 6a8b6a28..00000000 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummary.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The delivery metrics summary returned. */ -@ApiModel(description = "The delivery metrics summary returned.") -public class DeliveryMetricsSummary { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_METADATA_ID = "destinationMetadataId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA_ID) - private String destinationMetadataId; - - public static final String SERIALIZED_NAME_METRICS = "metrics"; - - @SerializedName(SERIALIZED_NAME_METRICS) - private List metrics = new ArrayList<>(); - - public DeliveryMetricsSummary() {} - - public DeliveryMetricsSummary sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source id. Config API note: analogous to `parent`. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source id. Config API note: analogous to `parent`.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public DeliveryMetricsSummary destinationMetadataId(String destinationMetadataId) { - - this.destinationMetadataId = destinationMetadataId; - return this; - } - - /** - * The Destination metadata id. - * - * @return destinationMetadataId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Destination metadata id.") - public String getDestinationMetadataId() { - return destinationMetadataId; - } - - public void setDestinationMetadataId(String destinationMetadataId) { - this.destinationMetadataId = destinationMetadataId; - } - - public DeliveryMetricsSummary metrics(List metrics) { - - this.metrics = metrics; - return this; - } - - public DeliveryMetricsSummary addMetricsItem(MetricBeta metricsItem) { - this.metrics.add(metricsItem); - return this; - } - - /** - * The summary of event delivery metrics for the requested Destination. - * - * @return metrics - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The summary of event delivery metrics for the requested Destination.") - public List getMetrics() { - return metrics; - } - - public void setMetrics(List metrics) { - this.metrics = metrics; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeliveryMetricsSummary deliveryMetricsSummary = (DeliveryMetricsSummary) o; - return Objects.equals(this.sourceId, deliveryMetricsSummary.sourceId) - && Objects.equals( - this.destinationMetadataId, deliveryMetricsSummary.destinationMetadataId) - && Objects.equals(this.metrics, deliveryMetricsSummary.metrics); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId, destinationMetadataId, metrics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeliveryMetricsSummary {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationMetadataId: ") - .append(toIndentedString(destinationMetadataId)) - .append("\n"); - sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - openapiFields.add("destinationMetadataId"); - openapiFields.add("metrics"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationMetadataId"); - openapiRequiredFields.add("metrics"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeliveryMetricsSummary - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DeliveryMetricsSummary.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DeliveryMetricsSummary is not found in" - + " the empty JSON string", - DeliveryMetricsSummary.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DeliveryMetricsSummary.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeliveryMetricsSummary` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DeliveryMetricsSummary.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationMetadataId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationMetadataId` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("destinationMetadataId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("metrics").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `metrics` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("metrics").toString())); - } - - JsonArray jsonArraymetrics = jsonObj.getAsJsonArray("metrics"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeliveryMetricsSummary.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeliveryMetricsSummary' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DeliveryMetricsSummary.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DeliveryMetricsSummary value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeliveryMetricsSummary read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeliveryMetricsSummary given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeliveryMetricsSummary - * @throws IOException if the JSON string is invalid with respect to DeliveryMetricsSummary - */ - public static DeliveryMetricsSummary fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeliveryMetricsSummary.class); - } - - /** - * Convert an instance of DeliveryMetricsSummary to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java index b1189d62..df35e7df 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryMetricsSummaryBeta.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines the summary of delivery metrics for a Destination. */ -@ApiModel(description = "Defines the summary of delivery metrics for a Destination.") public class DeliveryMetricsSummaryBeta { public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @@ -65,9 +61,6 @@ public DeliveryMetricsSummaryBeta sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The Source id. Config API note: analogous to `parent`.") public String getSourceId() { return sourceId; } @@ -88,7 +81,6 @@ public DeliveryMetricsSummaryBeta destinationMetadataId(String destinationMetada * @return destinationMetadataId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Destination metadata id.") public String getDestinationMetadataId() { return destinationMetadataId; } @@ -104,6 +96,9 @@ public DeliveryMetricsSummaryBeta metrics(List metrics) { } public DeliveryMetricsSummaryBeta addMetricsItem(MetricBeta metricsItem) { + if (this.metrics == null) { + this.metrics = new ArrayList<>(); + } this.metrics.add(metricsItem); return this; } @@ -114,9 +109,6 @@ public DeliveryMetricsSummaryBeta addMetricsItem(MetricBeta metricsItem) { * @return metrics */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The summary of event delivery metrics for the requested Destination.") public List getMetrics() { return metrics; } @@ -188,15 +180,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DeliveryMetricsSummaryBeta + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeliveryMetricsSummaryBeta */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DeliveryMetricsSummaryBeta.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DeliveryMetricsSummaryBeta is not" @@ -205,27 +197,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DeliveryMetricsSummaryBeta.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DeliveryMetricsSummaryBeta` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DeliveryMetricsSummaryBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -250,6 +243,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraymetrics = jsonObj.getAsJsonArray("metrics"); + // validate the required field `metrics` (array) + for (int i = 0; i < jsonArraymetrics.size(); i++) { + MetricBeta.validateJsonElement(jsonArraymetrics.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -275,9 +273,9 @@ public void write(JsonWriter out, DeliveryMetricsSummaryBeta value) @Override public DeliveryMetricsSummaryBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java deleted file mode 100644 index 05b4e882..00000000 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The Destination looked up. */ -@ApiModel(description = "The Destination looked up.") -public class Destination { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public Destination() {} - - public Destination id(String id) { - - this.id = id; - return this; - } - - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to - * `name`. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The unique identifier of this instance of a Destination. Config API note:" - + " analogous to `name`.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Destination name(String name) { - - this.name = name; - return this; - } - - /** - * The name of this instance of a Destination. Config API note: equal to - * `displayName`. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The name of this instance of a Destination. Config API note: equal to" - + " `displayName`.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Destination enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether this instance of a Destination receives data. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether this instance of a Destination receives data.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Destination metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Metadata getMetadata() { - return metadata; - } - - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } - - public Destination sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to - * `parent`. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of a Source connected to this instance of a Destination. Config API" - + " note: analogous to `parent`.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Destination settings(Map settings) { - - this.settings = settings; - return this; - } - - public Destination putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * The collection of settings associated with a Destination. Config API note: equal to - * `config`. - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The collection of settings associated with a Destination. Config API note:" - + " equal to `config`.") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Destination destination = (Destination) o; - return Objects.equals(this.id, destination.id) - && Objects.equals(this.name, destination.name) - && Objects.equals(this.enabled, destination.enabled) - && Objects.equals(this.metadata, destination.metadata) - && Objects.equals(this.sourceId, destination.sourceId) - && Objects.equals(this.settings, destination.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Destination - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Destination.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Destination is not found in the empty" - + " JSON string", - Destination.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Destination.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Destination` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Destination.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Destination given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination - * @throws IOException if the JSON string is invalid with respect to Destination - */ - public static Destination fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination.class); - } - - /** - * Convert an instance of Destination to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Destination1.java b/src/main/java/com/segment/publicapi/models/Destination1.java deleted file mode 100644 index 13fa3a1d..00000000 --- a/src/main/java/com/segment/publicapi/models/Destination1.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The updated Destination. */ -@ApiModel(description = "The updated Destination.") -public class Destination1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public Destination1() {} - - public Destination1 id(String id) { - - this.id = id; - return this; - } - - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to - * `name`. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The unique identifier of this instance of a Destination. Config API note:" - + " analogous to `name`.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Destination1 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of this instance of a Destination. Config API note: equal to - * `displayName`. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The name of this instance of a Destination. Config API note: equal to" - + " `displayName`.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Destination1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether this instance of a Destination receives data. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether this instance of a Destination receives data.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Destination1 metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Metadata getMetadata() { - return metadata; - } - - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } - - public Destination1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to - * `parent`. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of a Source connected to this instance of a Destination. Config API" - + " note: analogous to `parent`.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Destination1 settings(Map settings) { - - this.settings = settings; - return this; - } - - public Destination1 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * The collection of settings associated with a Destination. Config API note: equal to - * `config`. - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The collection of settings associated with a Destination. Config API note:" - + " equal to `config`.") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Destination1 destination1 = (Destination1) o; - return Objects.equals(this.id, destination1.id) - && Objects.equals(this.name, destination1.name) - && Objects.equals(this.enabled, destination1.enabled) - && Objects.equals(this.metadata, destination1.metadata) - && Objects.equals(this.sourceId, destination1.sourceId) - && Objects.equals(this.settings, destination1.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Destination1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Destination1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Destination1 is not found in the empty" - + " JSON string", - Destination1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Destination1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Destination1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Destination1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Destination1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination1 - * @throws IOException if the JSON string is invalid with respect to Destination1 - */ - public static Destination1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination1.class); - } - - /** - * Convert an instance of Destination1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Destination2.java b/src/main/java/com/segment/publicapi/models/Destination2.java deleted file mode 100644 index d38d901c..00000000 --- a/src/main/java/com/segment/publicapi/models/Destination2.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The created Destination. */ -@ApiModel(description = "The created Destination.") -public class Destination2 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - - @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public Destination2() {} - - public Destination2 id(String id) { - - this.id = id; - return this; - } - - /** - * The unique identifier of this instance of a Destination. Config API note: analogous to - * `name`. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The unique identifier of this instance of a Destination. Config API note:" - + " analogous to `name`.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Destination2 name(String name) { - - this.name = name; - return this; - } - - /** - * The name of this instance of a Destination. Config API note: equal to - * `displayName`. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The name of this instance of a Destination. Config API note: equal to" - + " `displayName`.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Destination2 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether this instance of a Destination receives data. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether this instance of a Destination receives data.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Destination2 metadata(Metadata metadata) { - - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * - * @return metadata - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Metadata getMetadata() { - return metadata; - } - - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } - - public Destination2 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The id of a Source connected to this instance of a Destination. Config API note: analogous to - * `parent`. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of a Source connected to this instance of a Destination. Config API" - + " note: analogous to `parent`.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Destination2 settings(Map settings) { - - this.settings = settings; - return this; - } - - public Destination2 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * The collection of settings associated with a Destination. Config API note: equal to - * `config`. - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The collection of settings associated with a Destination. Config API note:" - + " equal to `config`.") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Destination2 destination2 = (Destination2) o; - return Objects.equals(this.id, destination2.id) - && Objects.equals(this.name, destination2.name) - && Objects.equals(this.enabled, destination2.enabled) - && Objects.equals(this.metadata, destination2.metadata) - && Objects.equals(this.sourceId, destination2.sourceId) - && Objects.equals(this.settings, destination2.settings); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, enabled, metadata, sourceId, settings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("enabled"); - openapiFields.add("metadata"); - openapiFields.add("sourceId"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("metadata"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("settings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Destination2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Destination2.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Destination2 is not found in the empty" - + " JSON string", - Destination2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Destination2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Destination2` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Destination2.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Destination2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination2 - * @throws IOException if the JSON string is invalid with respect to Destination2 - */ - public static Destination2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination2.class); - } - - /** - * Convert an instance of Destination2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java index 9b9555da..5f1797dc 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterActionV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,19 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Represents a Destination filter action. */ -@ApiModel(description = "Represents a Destination filter action.") public class DestinationFilterActionV1 { /** The kind of Transformation to apply to any matched properties. */ @JsonAdapter(TypeEnum.Adapter.class) @@ -95,7 +90,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_FIELDS = "fields"; @SerializedName(SERIALIZED_NAME_FIELDS) - private Map fields = null; + private Map fields = new HashMap<>(); public static final String SERIALIZED_NAME_PERCENT = "percent"; @@ -121,9 +116,6 @@ public DestinationFilterActionV1 type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The kind of Transformation to apply to any matched properties.") public TypeEnum getType() { return type; } @@ -153,10 +145,6 @@ public DestinationFilterActionV1 putFieldsItem(String key, Object fieldsItem) { * @return fields */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "A dictionary of paths to object keys that this filter applies to. The" - + " literal string '' represents the top level of the object.") public Map getFields() { return fields; } @@ -178,10 +166,6 @@ public DestinationFilterActionV1 percent(BigDecimal percent) { * @return percent */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "A decimal between 0 and 1 used for 'sample' type events and influences the" - + " likelihood of sampling to occur.") public BigDecimal getPercent() { return percent; } @@ -203,10 +187,6 @@ public DestinationFilterActionV1 path(String path) { * @return path */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The JSON path to a property within a payload object from which Segment" - + " generates a deterministic sampling rate.") public String getPath() { return path; } @@ -275,15 +255,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationFilterActionV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationFilterActionV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationFilterActionV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationFilterActionV1 is not found" @@ -292,27 +272,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationFilterActionV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationFilterActionV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationFilterActionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -353,9 +334,9 @@ public void write(JsonWriter out, DestinationFilterActionV1 value) @Override public DestinationFilterActionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java index f27aaff2..bc9ac470 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationFilterV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents a Destination filter. */ -@ApiModel(description = "Represents a Destination filter.") public class DestinationFilterV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -100,7 +96,6 @@ public DestinationFilterV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") public String getId() { return id; } @@ -121,7 +116,6 @@ public DestinationFilterV1 sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") public String getSourceId() { return sourceId; } @@ -142,9 +136,6 @@ public DestinationFilterV1 destinationId(String destinationId) { * @return destinationId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Destination associated with this filter.") public String getDestinationId() { return destinationId; } @@ -165,9 +156,6 @@ public DestinationFilterV1 _if(String _if) { * @return _if */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A condition that defines whether to apply this filter to a payload.") public String getIf() { return _if; } @@ -183,6 +171,9 @@ public DestinationFilterV1 actions(List actions) { } public DestinationFilterV1 addActionsItem(DestinationFilterActionV1 actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } this.actions.add(actionsItem); return this; } @@ -193,7 +184,6 @@ public DestinationFilterV1 addActionsItem(DestinationFilterActionV1 actionsItem) * @return actions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") public List getActions() { return actions; } @@ -214,7 +204,6 @@ public DestinationFilterV1 title(String title) { * @return title */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") public String getTitle() { return title; } @@ -235,7 +224,6 @@ public DestinationFilterV1 description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") public String getDescription() { return description; } @@ -256,7 +244,6 @@ public DestinationFilterV1 enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") public Boolean getEnabled() { return enabled; } @@ -277,7 +264,6 @@ public DestinationFilterV1 createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") public String getCreatedAt() { return createdAt; } @@ -298,7 +284,6 @@ public DestinationFilterV1 updatedAt(String updatedAt) { * @return updatedAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") public String getUpdatedAt() { return updatedAt; } @@ -403,15 +388,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationFilterV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationFilterV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationFilterV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationFilterV1 is not found in" @@ -420,27 +405,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationFilterV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationFilterV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationFilterV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -479,6 +465,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + // validate the required field `actions` (array) + for (int i = 0; i < jsonArrayactions.size(); i++) { + DestinationFilterActionV1.validateJsonElement(jsonArrayactions.get(i)); + } + ; if (!jsonObj.get("title").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -532,9 +523,9 @@ public void write(JsonWriter out, DestinationFilterV1 value) @Override public DestinationFilterV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java b/src/main/java/com/segment/publicapi/models/DestinationMetadata.java deleted file mode 100644 index 6c681b63..00000000 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadata.java +++ /dev/null @@ -1,1062 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The catalog item matched by id. */ -@ApiModel(description = "The catalog item matched by id.") -public class DestinationMetadata { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_SLUG = "slug"; - - @SerializedName(SERIALIZED_NAME_SLUG) - private String slug; - - public static final String SERIALIZED_NAME_LOGOS = "logos"; - - @SerializedName(SERIALIZED_NAME_LOGOS) - private Logos logos; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private List options = new ArrayList<>(); - - /** Support status of the Destination. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - DEPRECATED("DEPRECATED"), - - PRIVATE_BETA("PRIVATE_BETA"), - - PRIVATE_BUILDING("PRIVATE_BUILDING"), - - PRIVATE_SUBMITTED("PRIVATE_SUBMITTED"), - - PUBLIC("PUBLIC"), - - PUBLIC_BETA("PUBLIC_BETA"), - - UNAVAILABLE("UNAVAILABLE"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_PREVIOUS_NAMES = "previousNames"; - - @SerializedName(SERIALIZED_NAME_PREVIOUS_NAMES) - private List previousNames = new ArrayList<>(); - - public static final String SERIALIZED_NAME_CATEGORIES = "categories"; - - @SerializedName(SERIALIZED_NAME_CATEGORIES) - private List categories = new ArrayList<>(); - - public static final String SERIALIZED_NAME_WEBSITE = "website"; - - @SerializedName(SERIALIZED_NAME_WEBSITE) - private String website; - - public static final String SERIALIZED_NAME_COMPONENTS = "components"; - - @SerializedName(SERIALIZED_NAME_COMPONENTS) - private List components = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SUPPORTED_FEATURES = "supportedFeatures"; - - @SerializedName(SERIALIZED_NAME_SUPPORTED_FEATURES) - private SupportedFeatures supportedFeatures; - - public static final String SERIALIZED_NAME_SUPPORTED_METHODS = "supportedMethods"; - - @SerializedName(SERIALIZED_NAME_SUPPORTED_METHODS) - private SupportedMethods supportedMethods; - - public static final String SERIALIZED_NAME_SUPPORTED_PLATFORMS = "supportedPlatforms"; - - @SerializedName(SERIALIZED_NAME_SUPPORTED_PLATFORMS) - private SupportedPlatforms supportedPlatforms; - - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PRESETS = "presets"; - - @SerializedName(SERIALIZED_NAME_PRESETS) - private List presets = new ArrayList<>(); - - public static final String SERIALIZED_NAME_CONTACTS = "contacts"; - - @SerializedName(SERIALIZED_NAME_CONTACTS) - private List contacts = null; - - public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; - - @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) - private Boolean partnerOwned; - - public static final String SERIALIZED_NAME_SUPPORTED_REGIONS = "supportedRegions"; - - @SerializedName(SERIALIZED_NAME_SUPPORTED_REGIONS) - private List supportedRegions = null; - - public static final String SERIALIZED_NAME_REGION_ENDPOINTS = "regionEndpoints"; - - @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) - private List regionEndpoints = null; - - public DestinationMetadata() {} - - public DestinationMetadata id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the Destination metadata. Config API note: analogous to `name`. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Destination metadata. Config API note: analogous to `name`.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public DestinationMetadata name(String name) { - - this.name = name; - return this; - } - - /** - * The user-friendly name of the Destination. Config API note: equal to `displayName`. - * - * @return name - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The user-friendly name of the Destination. Config API note: equal to" - + " `displayName`.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public DestinationMetadata description(String description) { - - this.description = description; - return this; - } - - /** - * The description of the Destination. - * - * @return description - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The description of the Destination.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public DestinationMetadata slug(String slug) { - - this.slug = slug; - return this; - } - - /** - * The slug used to identify the Destination in the Segment app. - * - * @return slug - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The slug used to identify the Destination in the Segment app.") - public String getSlug() { - return slug; - } - - public void setSlug(String slug) { - this.slug = slug; - } - - public DestinationMetadata logos(Logos logos) { - - this.logos = logos; - return this; - } - - /** - * Get logos - * - * @return logos - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Logos getLogos() { - return logos; - } - - public void setLogos(Logos logos) { - this.logos = logos; - } - - public DestinationMetadata options(List options) { - - this.options = options; - return this; - } - - public DestinationMetadata addOptionsItem(IntegrationOptionBeta optionsItem) { - this.options.add(optionsItem); - return this; - } - - /** - * Options configured for the Destination. - * - * @return options - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Options configured for the Destination.") - public List getOptions() { - return options; - } - - public void setOptions(List options) { - this.options = options; - } - - public DestinationMetadata status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Support status of the Destination. - * - * @return status - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Support status of the Destination.") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public DestinationMetadata previousNames(List previousNames) { - - this.previousNames = previousNames; - return this; - } - - public DestinationMetadata addPreviousNamesItem(String previousNamesItem) { - this.previousNames.add(previousNamesItem); - return this; - } - - /** - * A list of names previously used by the Destination. - * - * @return previousNames - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A list of names previously used by the Destination.") - public List getPreviousNames() { - return previousNames; - } - - public void setPreviousNames(List previousNames) { - this.previousNames = previousNames; - } - - public DestinationMetadata categories(List categories) { - - this.categories = categories; - return this; - } - - public DestinationMetadata addCategoriesItem(String categoriesItem) { - this.categories.add(categoriesItem); - return this; - } - - /** - * A list of categories with which the Destination is associated. - * - * @return categories - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A list of categories with which the Destination is associated.") - public List getCategories() { - return categories; - } - - public void setCategories(List categories) { - this.categories = categories; - } - - public DestinationMetadata website(String website) { - - this.website = website; - return this; - } - - /** - * A website URL for this Destination. - * - * @return website - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A website URL for this Destination.") - public String getWebsite() { - return website; - } - - public void setWebsite(String website) { - this.website = website; - } - - public DestinationMetadata components(List components) { - - this.components = components; - return this; - } - - public DestinationMetadata addComponentsItem(DestinationMetadataComponentV1 componentsItem) { - this.components.add(componentsItem); - return this; - } - - /** - * A list of components this Destination provides. - * - * @return components - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of components this Destination provides.") - public List getComponents() { - return components; - } - - public void setComponents(List components) { - this.components = components; - } - - public DestinationMetadata supportedFeatures(SupportedFeatures supportedFeatures) { - - this.supportedFeatures = supportedFeatures; - return this; - } - - /** - * Get supportedFeatures - * - * @return supportedFeatures - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SupportedFeatures getSupportedFeatures() { - return supportedFeatures; - } - - public void setSupportedFeatures(SupportedFeatures supportedFeatures) { - this.supportedFeatures = supportedFeatures; - } - - public DestinationMetadata supportedMethods(SupportedMethods supportedMethods) { - - this.supportedMethods = supportedMethods; - return this; - } - - /** - * Get supportedMethods - * - * @return supportedMethods - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SupportedMethods getSupportedMethods() { - return supportedMethods; - } - - public void setSupportedMethods(SupportedMethods supportedMethods) { - this.supportedMethods = supportedMethods; - } - - public DestinationMetadata supportedPlatforms(SupportedPlatforms supportedPlatforms) { - - this.supportedPlatforms = supportedPlatforms; - return this; - } - - /** - * Get supportedPlatforms - * - * @return supportedPlatforms - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SupportedPlatforms getSupportedPlatforms() { - return supportedPlatforms; - } - - public void setSupportedPlatforms(SupportedPlatforms supportedPlatforms) { - this.supportedPlatforms = supportedPlatforms; - } - - public DestinationMetadata actions(List actions) { - - this.actions = actions; - return this; - } - - public DestinationMetadata addActionsItem(DestinationMetadataActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } - - /** - * Actions available for the Destination. - * - * @return actions - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Actions available for the Destination.") - public List getActions() { - return actions; - } - - public void setActions(List actions) { - this.actions = actions; - } - - public DestinationMetadata presets(List presets) { - - this.presets = presets; - return this; - } - - public DestinationMetadata addPresetsItem(DestinationMetadataSubscriptionPresetV1 presetsItem) { - this.presets.add(presetsItem); - return this; - } - - /** - * Predefined Destination subscriptions that can optionally be applied when connecting a new - * instance of the Destination. - * - * @return presets - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Predefined Destination subscriptions that can optionally be applied when" - + " connecting a new instance of the Destination.") - public List getPresets() { - return presets; - } - - public void setPresets(List presets) { - this.presets = presets; - } - - public DestinationMetadata contacts(List contacts) { - - this.contacts = contacts; - return this; - } - - public DestinationMetadata addContactsItem(Contact contactsItem) { - if (this.contacts == null) { - this.contacts = new ArrayList<>(); - } - this.contacts.add(contactsItem); - return this; - } - - /** - * Contact info for Integration Owners. - * - * @return contacts - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contact info for Integration Owners.") - public List getContacts() { - return contacts; - } - - public void setContacts(List contacts) { - this.contacts = contacts; - } - - public DestinationMetadata partnerOwned(Boolean partnerOwned) { - - this.partnerOwned = partnerOwned; - return this; - } - - /** - * Partner Owned flag. - * - * @return partnerOwned - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Partner Owned flag.") - public Boolean getPartnerOwned() { - return partnerOwned; - } - - public void setPartnerOwned(Boolean partnerOwned) { - this.partnerOwned = partnerOwned; - } - - public DestinationMetadata supportedRegions(List supportedRegions) { - - this.supportedRegions = supportedRegions; - return this; - } - - public DestinationMetadata addSupportedRegionsItem(String supportedRegionsItem) { - if (this.supportedRegions == null) { - this.supportedRegions = new ArrayList<>(); - } - this.supportedRegions.add(supportedRegionsItem); - return this; - } - - /** - * A list of supported regions for this Destination. - * - * @return supportedRegions - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of supported regions for this Destination.") - public List getSupportedRegions() { - return supportedRegions; - } - - public void setSupportedRegions(List supportedRegions) { - this.supportedRegions = supportedRegions; - } - - public DestinationMetadata regionEndpoints(List regionEndpoints) { - - this.regionEndpoints = regionEndpoints; - return this; - } - - public DestinationMetadata addRegionEndpointsItem(String regionEndpointsItem) { - if (this.regionEndpoints == null) { - this.regionEndpoints = new ArrayList<>(); - } - this.regionEndpoints.add(regionEndpointsItem); - return this; - } - - /** - * The list of regional endpoints for this Destination. - * - * @return regionEndpoints - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of regional endpoints for this Destination.") - public List getRegionEndpoints() { - return regionEndpoints; - } - - public void setRegionEndpoints(List regionEndpoints) { - this.regionEndpoints = regionEndpoints; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationMetadata destinationMetadata = (DestinationMetadata) o; - return Objects.equals(this.id, destinationMetadata.id) - && Objects.equals(this.name, destinationMetadata.name) - && Objects.equals(this.description, destinationMetadata.description) - && Objects.equals(this.slug, destinationMetadata.slug) - && Objects.equals(this.logos, destinationMetadata.logos) - && Objects.equals(this.options, destinationMetadata.options) - && Objects.equals(this.status, destinationMetadata.status) - && Objects.equals(this.previousNames, destinationMetadata.previousNames) - && Objects.equals(this.categories, destinationMetadata.categories) - && Objects.equals(this.website, destinationMetadata.website) - && Objects.equals(this.components, destinationMetadata.components) - && Objects.equals(this.supportedFeatures, destinationMetadata.supportedFeatures) - && Objects.equals(this.supportedMethods, destinationMetadata.supportedMethods) - && Objects.equals(this.supportedPlatforms, destinationMetadata.supportedPlatforms) - && Objects.equals(this.actions, destinationMetadata.actions) - && Objects.equals(this.presets, destinationMetadata.presets) - && Objects.equals(this.contacts, destinationMetadata.contacts) - && Objects.equals(this.partnerOwned, destinationMetadata.partnerOwned) - && Objects.equals(this.supportedRegions, destinationMetadata.supportedRegions) - && Objects.equals(this.regionEndpoints, destinationMetadata.regionEndpoints); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - description, - slug, - logos, - options, - status, - previousNames, - categories, - website, - components, - supportedFeatures, - supportedMethods, - supportedPlatforms, - actions, - presets, - contacts, - partnerOwned, - supportedRegions, - regionEndpoints); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationMetadata {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); - sb.append(" logos: ").append(toIndentedString(logos)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" previousNames: ").append(toIndentedString(previousNames)).append("\n"); - sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); - sb.append(" website: ").append(toIndentedString(website)).append("\n"); - sb.append(" components: ").append(toIndentedString(components)).append("\n"); - sb.append(" supportedFeatures: ") - .append(toIndentedString(supportedFeatures)) - .append("\n"); - sb.append(" supportedMethods: ").append(toIndentedString(supportedMethods)).append("\n"); - sb.append(" supportedPlatforms: ") - .append(toIndentedString(supportedPlatforms)) - .append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" presets: ").append(toIndentedString(presets)).append("\n"); - sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); - sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); - sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); - sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("slug"); - openapiFields.add("logos"); - openapiFields.add("options"); - openapiFields.add("status"); - openapiFields.add("previousNames"); - openapiFields.add("categories"); - openapiFields.add("website"); - openapiFields.add("components"); - openapiFields.add("supportedFeatures"); - openapiFields.add("supportedMethods"); - openapiFields.add("supportedPlatforms"); - openapiFields.add("actions"); - openapiFields.add("presets"); - openapiFields.add("contacts"); - openapiFields.add("partnerOwned"); - openapiFields.add("supportedRegions"); - openapiFields.add("regionEndpoints"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("slug"); - openapiRequiredFields.add("logos"); - openapiRequiredFields.add("options"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("previousNames"); - openapiRequiredFields.add("categories"); - openapiRequiredFields.add("website"); - openapiRequiredFields.add("components"); - openapiRequiredFields.add("supportedFeatures"); - openapiRequiredFields.add("supportedMethods"); - openapiRequiredFields.add("supportedPlatforms"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("presets"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadata - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!DestinationMetadata.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DestinationMetadata is not found in" - + " the empty JSON string", - DestinationMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!DestinationMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DestinationMetadata` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationMetadata.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("slug").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `slug` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("slug").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("options").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `options` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("options").toString())); - } - - JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - // ensure the required json array is present - if (jsonObj.get("previousNames") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("previousNames").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `previousNames` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("previousNames").toString())); - } - // ensure the required json array is present - if (jsonObj.get("categories") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("categories").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `categories` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("categories").toString())); - } - if (!jsonObj.get("website").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `website` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("website").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("components").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `components` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("components").toString())); - } - - JsonArray jsonArraycomponents = jsonObj.getAsJsonArray("components"); - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `actions` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - // ensure the json data is an array - if (!jsonObj.get("presets").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `presets` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("presets").toString())); - } - - JsonArray jsonArraypresets = jsonObj.getAsJsonArray("presets"); - if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull()) { - JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts"); - if (jsonArraycontacts != null) { - // ensure the json data is an array - if (!jsonObj.get("contacts").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `contacts` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("contacts").toString())); - } - } - } - // ensure the optional json data is an array if present - if (jsonObj.get("supportedRegions") != null - && !jsonObj.get("supportedRegions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `supportedRegions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("supportedRegions").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("regionEndpoints") != null - && !jsonObj.get("regionEndpoints").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `regionEndpoints` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("regionEndpoints").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DestinationMetadata.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationMetadata value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationMetadata read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationMetadata - * @throws IOException if the JSON string is invalid with respect to DestinationMetadata - */ - public static DestinationMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationMetadata.class); - } - - /** - * Convert an instance of DestinationMetadata to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index ff882290..a22f558b 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,19 +22,16 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; /** Represents a field used in configuring an action. */ -@ApiModel(description = "Represents a field used in configuring an action.") public class DestinationMetadataActionFieldV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -176,7 +172,6 @@ public DestinationMetadataActionFieldV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The primary key of the field.") public String getId() { return id; } @@ -198,11 +193,6 @@ public DestinationMetadataActionFieldV1 sortOrder(BigDecimal sortOrder) { * @return sortOrder */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The order this particular field is (used in the UI for displaying the fields" - + " in a specified order).") public BigDecimal getSortOrder() { return sortOrder; } @@ -224,11 +214,6 @@ public DestinationMetadataActionFieldV1 fieldKey(String fieldKey) { * @return fieldKey */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "A unique machine-readable key for the field. Should ideally match the expected" - + " key in the action\\'s API request.") public String getFieldKey() { return fieldKey; } @@ -249,7 +234,6 @@ public DestinationMetadataActionFieldV1 label(String label) { * @return label */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable label for this value.") public String getLabel() { return label; } @@ -270,7 +254,6 @@ public DestinationMetadataActionFieldV1 type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The data type for this value.") public TypeEnum getType() { return type; } @@ -291,9 +274,6 @@ public DestinationMetadataActionFieldV1 description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A human-readable description of this value. You can use Markdown.") public String getDescription() { return description; } @@ -314,7 +294,6 @@ public DestinationMetadataActionFieldV1 placeholder(String placeholder) { * @return placeholder */ @javax.annotation.Nullable - @ApiModelProperty(value = "An example value displayed but not saved.") public String getPlaceholder() { return placeholder; } @@ -335,7 +314,6 @@ public DestinationMetadataActionFieldV1 defaultValue(Object defaultValue) { * @return defaultValue */ @javax.annotation.Nullable - @ApiModelProperty(value = "A default value that is saved the first time an action is created.") public Object getDefaultValue() { return defaultValue; } @@ -356,7 +334,6 @@ public DestinationMetadataActionFieldV1 required(Boolean required) { * @return required */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field is required.") public Boolean getRequired() { return required; } @@ -377,9 +354,6 @@ public DestinationMetadataActionFieldV1 multiple(Boolean multiple) { * @return multiple */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether a user can provide multiples of this field.") public Boolean getMultiple() { return multiple; } @@ -400,8 +374,6 @@ public DestinationMetadataActionFieldV1 choices(Object choices) { * @return choices */ @javax.annotation.Nullable - @ApiModelProperty( - value = "A list of machine-readable value/label pairs to populate a static dropdown.") public Object getChoices() { return choices; } @@ -423,11 +395,6 @@ public DestinationMetadataActionFieldV1 dynamic(Boolean dynamic) { * @return dynamic */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Whether this field should execute a dynamic request to fetch choices to" - + " populate a dropdown. When true, `choices` is ignored.") public Boolean getDynamic() { return dynamic; } @@ -448,7 +415,6 @@ public DestinationMetadataActionFieldV1 allowNull(Boolean allowNull) { * @return allowNull */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field allows null values.") public Boolean getAllowNull() { return allowNull; } @@ -583,16 +549,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationMetadataActionFieldV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataActionFieldV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataActionFieldV1 is" @@ -601,27 +567,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataActionFieldV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataActionFieldV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationMetadataActionFieldV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -692,9 +659,9 @@ public void write(JsonWriter out, DestinationMetadataActionFieldV1 value) @Override public DestinationMetadataActionFieldV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java index 140737ad..71da6d04 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,21 +23,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents an Action, a building block of behavior that can be performed by the Destination. */ -@ApiModel( - description = - "Represents an Action, a building block of behavior that can be performed by the" - + " Destination.") public class DestinationMetadataActionV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -142,7 +135,6 @@ public DestinationMetadataActionV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The primary key of the action.") public String getId() { return id; } @@ -163,9 +155,6 @@ public DestinationMetadataActionV1 slug(String slug) { * @return slug */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A machine-readable key unique to the action definition.") public String getSlug() { return slug; } @@ -186,7 +175,6 @@ public DestinationMetadataActionV1 name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A human-readable name for the action.") public String getName() { return name; } @@ -207,9 +195,6 @@ public DestinationMetadataActionV1 description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A human-readable description of the action. May include Markdown.") public String getDescription() { return description; } @@ -230,7 +215,6 @@ public DestinationMetadataActionV1 platform(PlatformEnum platform) { * @return platform */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The platform on which this action runs.") public PlatformEnum getPlatform() { return platform; } @@ -251,7 +235,6 @@ public DestinationMetadataActionV1 hidden(Boolean hidden) { * @return hidden */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether the action should be hidden.") public Boolean getHidden() { return hidden; } @@ -272,9 +255,6 @@ public DestinationMetadataActionV1 defaultTrigger(String defaultTrigger) { * @return defaultTrigger */ @javax.annotation.Nullable - @ApiModelProperty( - required = true, - value = "The default value used as the trigger when connecting this action.") public String getDefaultTrigger() { return defaultTrigger; } @@ -290,6 +270,9 @@ public DestinationMetadataActionV1 fields(List } public DestinationMetadataActionV1 addFieldsItem(DestinationMetadataActionFieldV1 fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } this.fields.add(fieldsItem); return this; } @@ -300,9 +283,6 @@ public DestinationMetadataActionV1 addFieldsItem(DestinationMetadataActionFieldV * @return fields */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The fields expected in order to perform the action.") public List getFields() { return fields; } @@ -390,15 +370,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataActionV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DestinationMetadataActionV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataActionV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataActionV1 is not" @@ -407,27 +388,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataActionV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataActionV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationMetadataActionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -463,7 +445,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("platform").toString())); } - if (!jsonObj.get("defaultTrigger").isJsonPrimitive()) { + if ((jsonObj.get("defaultTrigger") != null && !jsonObj.get("defaultTrigger").isJsonNull()) + && !jsonObj.get("defaultTrigger").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `defaultTrigger` to be a primitive type in the JSON" @@ -480,6 +463,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + // validate the required field `fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + DestinationMetadataActionFieldV1.validateJsonElement(jsonArrayfields.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -505,9 +493,9 @@ public void write(JsonWriter out, DestinationMetadataActionV1 value) @Override public DestinationMetadataActionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java index 3ee7b033..6a42ce12 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataComponentV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents a component this Destination provides. */ -@ApiModel(description = "Represents a component this Destination provides.") public class DestinationMetadataComponentV1 { /** The component type. */ @JsonAdapter(TypeEnum.Adapter.class) @@ -159,7 +155,6 @@ public DestinationMetadataComponentV1 type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The component type.") public TypeEnum getType() { return type; } @@ -180,9 +175,6 @@ public DestinationMetadataComponentV1 code(String code) { * @return code */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Link to the repository hosting the code for this component.") public String getCode() { return code; } @@ -203,7 +195,6 @@ public DestinationMetadataComponentV1 owner(OwnerEnum owner) { * @return owner */ @javax.annotation.Nullable - @ApiModelProperty(value = "The owner of this component. Either 'SEGMENT' or 'PARTNER'.") public OwnerEnum getOwner() { return owner; } @@ -271,16 +262,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationMetadataComponentV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataComponentV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataComponentV1 is not" @@ -289,27 +280,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataComponentV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataComponentV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationMetadataComponentV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -359,9 +351,9 @@ public void write(JsonWriter out, DestinationMetadataComponentV1 value) @Override public DestinationMetadataComponentV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java index d7e0e31b..c31d0706 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataFeaturesV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents features that a given Destination supports. */ -@ApiModel(description = "Represents features that a given Destination supports.") public class DestinationMetadataFeaturesV1 { /** * This Destination's support level for cloud mode instances. The values '0' and @@ -186,10 +182,6 @@ public DestinationMetadataFeaturesV1 cloudModeInstances( * @return cloudModeInstances */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "This Destination's support level for cloud mode instances. The values '0' and" - + " 'NONE', and '1' and 'SINGLE' are equivalent.") public CloudModeInstancesEnum getCloudModeInstances() { return cloudModeInstances; } @@ -213,11 +205,6 @@ public DestinationMetadataFeaturesV1 deviceModeInstances( * @return deviceModeInstances */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "This Destination's support level for device mode instances. Support for" - + " multiple device mode instances is currently not planned. The values '0'" - + " and 'NONE', and '1' and 'SINGLE' are equivalent.") public DeviceModeInstancesEnum getDeviceModeInstances() { return deviceModeInstances; } @@ -238,7 +225,6 @@ public DestinationMetadataFeaturesV1 replay(Boolean replay) { * @return replay */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports replays.") public Boolean getReplay() { return replay; } @@ -259,7 +245,6 @@ public DestinationMetadataFeaturesV1 browserUnbundling(Boolean browserUnbundling * @return browserUnbundling */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports browser unbundling.") public Boolean getBrowserUnbundling() { return browserUnbundling; } @@ -280,7 +265,6 @@ public DestinationMetadataFeaturesV1 browserUnbundlingPublic(Boolean browserUnbu * @return browserUnbundlingPublic */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports public browser unbundling.") public Boolean getBrowserUnbundlingPublic() { return browserUnbundlingPublic; } @@ -370,16 +354,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationMetadataFeaturesV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataFeaturesV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataFeaturesV1 is not" @@ -388,17 +372,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataFeaturesV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataFeaturesV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("cloudModeInstances") != null && !jsonObj.get("cloudModeInstances").isJsonNull()) && !jsonObj.get("cloudModeInstances").isJsonPrimitive()) { @@ -444,9 +429,9 @@ public void write(JsonWriter out, DestinationMetadataFeaturesV1 value) @Override public DestinationMetadataFeaturesV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java index d9db7c1f..c3ff0e9a 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataMethodsV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents methods that a given Destination supports. */ -@ApiModel(description = "Represents methods that a given Destination supports.") public class DestinationMetadataMethodsV1 { public static final String SERIALIZED_NAME_PAGEVIEW = "pageview"; @@ -72,7 +68,6 @@ public DestinationMetadataMethodsV1 pageview(Boolean pageview) { * @return pageview */ @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `pageview` method.") public Boolean getPageview() { return pageview; } @@ -93,7 +88,6 @@ public DestinationMetadataMethodsV1 identify(Boolean identify) { * @return identify */ @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `identify` method.") public Boolean getIdentify() { return identify; } @@ -114,7 +108,6 @@ public DestinationMetadataMethodsV1 alias(Boolean alias) { * @return alias */ @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `alias` method.") public Boolean getAlias() { return alias; } @@ -135,7 +128,6 @@ public DestinationMetadataMethodsV1 track(Boolean track) { * @return track */ @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `track` method.") public Boolean getTrack() { return track; } @@ -156,7 +148,6 @@ public DestinationMetadataMethodsV1 group(Boolean group) { * @return group */ @javax.annotation.Nullable - @ApiModelProperty(value = "Identifies if the Destination supports the `group` method.") public Boolean getGroup() { return group; } @@ -228,16 +219,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationMetadataMethodsV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataMethodsV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataMethodsV1 is not" @@ -246,17 +237,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataMethodsV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataMethodsV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -283,9 +275,9 @@ public void write(JsonWriter out, DestinationMetadataMethodsV1 value) @Override public DestinationMetadataMethodsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index ae0311d7..8bd6cd8a 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents platforms that a given Destination supports. */ -@ApiModel(description = "Represents platforms that a given Destination supports.") public class DestinationMetadataPlatformsV1 { public static final String SERIALIZED_NAME_BROWSER = "browser"; @@ -62,7 +58,6 @@ public DestinationMetadataPlatformsV1 browser(Boolean browser) { * @return browser */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports browser events.") public Boolean getBrowser() { return browser; } @@ -83,7 +78,6 @@ public DestinationMetadataPlatformsV1 server(Boolean server) { * @return server */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports server events.") public Boolean getServer() { return server; } @@ -104,7 +98,6 @@ public DestinationMetadataPlatformsV1 mobile(Boolean mobile) { * @return mobile */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this Destination supports mobile events.") public Boolean getMobile() { return mobile; } @@ -170,16 +163,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationMetadataPlatformsV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataPlatformsV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataPlatformsV1 is not" @@ -188,17 +181,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataPlatformsV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataPlatformsV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -226,9 +220,9 @@ public void write(JsonWriter out, DestinationMetadataPlatformsV1 value) @Override public DestinationMetadataPlatformsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java index 0ecd0dc4..997a62ea 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataSubscriptionPresetV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,18 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Represents a set of defaults for a Destination subscription. */ -@ApiModel(description = "Represents a set of defaults for a Destination subscription.") public class DestinationMetadataSubscriptionPresetV1 { public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; @@ -69,9 +64,6 @@ public DestinationMetadataSubscriptionPresetV1 actionId(String actionId) { * @return actionId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The unique identifier for the Destination Action to trigger.") public String getActionId() { return actionId; } @@ -92,7 +84,6 @@ public DestinationMetadataSubscriptionPresetV1 name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the subscription.") public String getName() { return name; } @@ -108,6 +99,9 @@ public DestinationMetadataSubscriptionPresetV1 fields(Map fields } public DestinationMetadataSubscriptionPresetV1 putFieldsItem(String key, Object fieldsItem) { + if (this.fields == null) { + this.fields = new HashMap<>(); + } this.fields.put(key, fieldsItem); return this; } @@ -118,7 +112,6 @@ public DestinationMetadataSubscriptionPresetV1 putFieldsItem(String key, Object * @return fields */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The default settings for action fields.") public Map getFields() { return fields; } @@ -141,12 +134,6 @@ public DestinationMetadataSubscriptionPresetV1 trigger(String trigger) { * @return trigger */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "FQL string that describes what events should trigger an action. See" - + " https://segment.com/docs/config-api/fql/ for more information regarding" - + " Segment's Filter Query Language (FQL).") public String getTrigger() { return trigger; } @@ -219,16 +206,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationMetadataSubscriptionPresetV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataSubscriptionPresetV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -239,28 +226,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataSubscriptionPresetV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataSubscriptionPresetV1` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationMetadataSubscriptionPresetV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("actionId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -311,9 +299,9 @@ public void write( @Override public DestinationMetadataSubscriptionPresetV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index d46e17ac..2b2071cf 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,13 +23,11 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -38,10 +35,6 @@ * Represents a Destination within Segment. A Destination is a target for Segment to forward data * to, and represents a tool or storage Destination. */ -@ApiModel( - description = - "Represents a Destination within Segment. A Destination is a target for Segment to" - + " forward data to, and represents a tool or storage Destination.") public class DestinationMetadataV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -66,7 +59,7 @@ public class DestinationMetadataV1 { public static final String SERIALIZED_NAME_LOGOS = "logos"; @SerializedName(SERIALIZED_NAME_LOGOS) - private Logos logos; + private LogosBeta logos; public static final String SERIALIZED_NAME_OPTIONS = "options"; @@ -157,17 +150,17 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SUPPORTED_FEATURES = "supportedFeatures"; @SerializedName(SERIALIZED_NAME_SUPPORTED_FEATURES) - private SupportedFeatures supportedFeatures; + private DestinationMetadataFeaturesV1 supportedFeatures; public static final String SERIALIZED_NAME_SUPPORTED_METHODS = "supportedMethods"; @SerializedName(SERIALIZED_NAME_SUPPORTED_METHODS) - private SupportedMethods supportedMethods; + private DestinationMetadataMethodsV1 supportedMethods; public static final String SERIALIZED_NAME_SUPPORTED_PLATFORMS = "supportedPlatforms"; @SerializedName(SERIALIZED_NAME_SUPPORTED_PLATFORMS) - private SupportedPlatforms supportedPlatforms; + private DestinationMetadataPlatformsV1 supportedPlatforms; public static final String SERIALIZED_NAME_ACTIONS = "actions"; @@ -182,7 +175,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_CONTACTS = "contacts"; @SerializedName(SERIALIZED_NAME_CONTACTS) - private List contacts = null; + private List contacts; public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; @@ -192,12 +185,12 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SUPPORTED_REGIONS = "supportedRegions"; @SerializedName(SERIALIZED_NAME_SUPPORTED_REGIONS) - private List supportedRegions = null; + private List supportedRegions; public static final String SERIALIZED_NAME_REGION_ENDPOINTS = "regionEndpoints"; @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) - private List regionEndpoints = null; + private List regionEndpoints; public DestinationMetadataV1() {} @@ -213,9 +206,6 @@ public DestinationMetadataV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Destination metadata. Config API note: analogous to `name`.") public String getId() { return id; } @@ -236,11 +226,6 @@ public DestinationMetadataV1 name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The user-friendly name of the Destination. Config API note: equal to" - + " `displayName`.") public String getName() { return name; } @@ -261,7 +246,6 @@ public DestinationMetadataV1 description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The description of the Destination.") public String getDescription() { return description; } @@ -282,9 +266,6 @@ public DestinationMetadataV1 slug(String slug) { * @return slug */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The slug used to identify the Destination in the Segment app.") public String getSlug() { return slug; } @@ -293,7 +274,7 @@ public void setSlug(String slug) { this.slug = slug; } - public DestinationMetadataV1 logos(Logos logos) { + public DestinationMetadataV1 logos(LogosBeta logos) { this.logos = logos; return this; @@ -305,12 +286,11 @@ public DestinationMetadataV1 logos(Logos logos) { * @return logos */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Logos getLogos() { + public LogosBeta getLogos() { return logos; } - public void setLogos(Logos logos) { + public void setLogos(LogosBeta logos) { this.logos = logos; } @@ -321,6 +301,9 @@ public DestinationMetadataV1 options(List options) { } public DestinationMetadataV1 addOptionsItem(IntegrationOptionBeta optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } this.options.add(optionsItem); return this; } @@ -331,7 +314,6 @@ public DestinationMetadataV1 addOptionsItem(IntegrationOptionBeta optionsItem) { * @return options */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Options configured for the Destination.") public List getOptions() { return options; } @@ -352,7 +334,6 @@ public DestinationMetadataV1 status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Support status of the Destination.") public StatusEnum getStatus() { return status; } @@ -368,6 +349,9 @@ public DestinationMetadataV1 previousNames(List previousNames) { } public DestinationMetadataV1 addPreviousNamesItem(String previousNamesItem) { + if (this.previousNames == null) { + this.previousNames = new ArrayList<>(); + } this.previousNames.add(previousNamesItem); return this; } @@ -378,9 +362,6 @@ public DestinationMetadataV1 addPreviousNamesItem(String previousNamesItem) { * @return previousNames */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A list of names previously used by the Destination.") public List getPreviousNames() { return previousNames; } @@ -396,6 +377,9 @@ public DestinationMetadataV1 categories(List categories) { } public DestinationMetadataV1 addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } this.categories.add(categoriesItem); return this; } @@ -406,9 +390,6 @@ public DestinationMetadataV1 addCategoriesItem(String categoriesItem) { * @return categories */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A list of categories with which the Destination is associated.") public List getCategories() { return categories; } @@ -429,7 +410,6 @@ public DestinationMetadataV1 website(String website) { * @return website */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A website URL for this Destination.") public String getWebsite() { return website; } @@ -445,6 +425,9 @@ public DestinationMetadataV1 components(List com } public DestinationMetadataV1 addComponentsItem(DestinationMetadataComponentV1 componentsItem) { + if (this.components == null) { + this.components = new ArrayList<>(); + } this.components.add(componentsItem); return this; } @@ -455,7 +438,6 @@ public DestinationMetadataV1 addComponentsItem(DestinationMetadataComponentV1 co * @return components */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of components this Destination provides.") public List getComponents() { return components; } @@ -464,7 +446,8 @@ public void setComponents(List components) { this.components = components; } - public DestinationMetadataV1 supportedFeatures(SupportedFeatures supportedFeatures) { + public DestinationMetadataV1 supportedFeatures( + DestinationMetadataFeaturesV1 supportedFeatures) { this.supportedFeatures = supportedFeatures; return this; @@ -476,16 +459,15 @@ public DestinationMetadataV1 supportedFeatures(SupportedFeatures supportedFeatur * @return supportedFeatures */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SupportedFeatures getSupportedFeatures() { + public DestinationMetadataFeaturesV1 getSupportedFeatures() { return supportedFeatures; } - public void setSupportedFeatures(SupportedFeatures supportedFeatures) { + public void setSupportedFeatures(DestinationMetadataFeaturesV1 supportedFeatures) { this.supportedFeatures = supportedFeatures; } - public DestinationMetadataV1 supportedMethods(SupportedMethods supportedMethods) { + public DestinationMetadataV1 supportedMethods(DestinationMetadataMethodsV1 supportedMethods) { this.supportedMethods = supportedMethods; return this; @@ -497,16 +479,16 @@ public DestinationMetadataV1 supportedMethods(SupportedMethods supportedMethods) * @return supportedMethods */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SupportedMethods getSupportedMethods() { + public DestinationMetadataMethodsV1 getSupportedMethods() { return supportedMethods; } - public void setSupportedMethods(SupportedMethods supportedMethods) { + public void setSupportedMethods(DestinationMetadataMethodsV1 supportedMethods) { this.supportedMethods = supportedMethods; } - public DestinationMetadataV1 supportedPlatforms(SupportedPlatforms supportedPlatforms) { + public DestinationMetadataV1 supportedPlatforms( + DestinationMetadataPlatformsV1 supportedPlatforms) { this.supportedPlatforms = supportedPlatforms; return this; @@ -518,12 +500,11 @@ public DestinationMetadataV1 supportedPlatforms(SupportedPlatforms supportedPlat * @return supportedPlatforms */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SupportedPlatforms getSupportedPlatforms() { + public DestinationMetadataPlatformsV1 getSupportedPlatforms() { return supportedPlatforms; } - public void setSupportedPlatforms(SupportedPlatforms supportedPlatforms) { + public void setSupportedPlatforms(DestinationMetadataPlatformsV1 supportedPlatforms) { this.supportedPlatforms = supportedPlatforms; } @@ -534,6 +515,9 @@ public DestinationMetadataV1 actions(List actions) } public DestinationMetadataV1 addActionsItem(DestinationMetadataActionV1 actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } this.actions.add(actionsItem); return this; } @@ -544,7 +528,6 @@ public DestinationMetadataV1 addActionsItem(DestinationMetadataActionV1 actionsI * @return actions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Actions available for the Destination.") public List getActions() { return actions; } @@ -561,6 +544,9 @@ public DestinationMetadataV1 presets(List(); + } this.presets.add(presetsItem); return this; } @@ -572,11 +558,6 @@ public DestinationMetadataV1 addPresetsItem( * @return presets */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Predefined Destination subscriptions that can optionally be applied when" - + " connecting a new instance of the Destination.") public List getPresets() { return presets; } @@ -605,7 +586,6 @@ public DestinationMetadataV1 addContactsItem(Contact contactsItem) { * @return contacts */ @javax.annotation.Nullable - @ApiModelProperty(value = "Contact info for Integration Owners.") public List getContacts() { return contacts; } @@ -626,7 +606,6 @@ public DestinationMetadataV1 partnerOwned(Boolean partnerOwned) { * @return partnerOwned */ @javax.annotation.Nullable - @ApiModelProperty(value = "Partner Owned flag.") public Boolean getPartnerOwned() { return partnerOwned; } @@ -655,7 +634,6 @@ public DestinationMetadataV1 addSupportedRegionsItem(String supportedRegionsItem * @return supportedRegions */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of supported regions for this Destination.") public List getSupportedRegions() { return supportedRegions; } @@ -684,7 +662,6 @@ public DestinationMetadataV1 addRegionEndpointsItem(String regionEndpointsItem) * @return regionEndpoints */ @javax.annotation.Nullable - @ApiModelProperty(value = "The list of regional endpoints for this Destination.") public List getRegionEndpoints() { return regionEndpoints; } @@ -840,15 +817,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationMetadataV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationMetadataV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationMetadataV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationMetadataV1 is not found in" @@ -857,27 +834,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationMetadataV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationMetadataV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationMetadataV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -906,6 +884,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("slug").toString())); } + // validate the required field `logos` + LogosBeta.validateJsonElement(jsonObj.get("logos")); // ensure the json data is an array if (!jsonObj.get("options").isJsonArray()) { throw new IllegalArgumentException( @@ -916,6 +896,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("options"); + // validate the required field `options` (array) + for (int i = 0; i < jsonArrayoptions.size(); i++) { + IntegrationOptionBeta.validateJsonElement(jsonArrayoptions.get(i)); + } + ; if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -964,6 +949,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraycomponents = jsonObj.getAsJsonArray("components"); + // validate the required field `components` (array) + for (int i = 0; i < jsonArraycomponents.size(); i++) { + DestinationMetadataComponentV1.validateJsonElement(jsonArraycomponents.get(i)); + } + ; + // validate the required field `supportedFeatures` + DestinationMetadataFeaturesV1.validateJsonElement(jsonObj.get("supportedFeatures")); + // validate the required field `supportedMethods` + DestinationMetadataMethodsV1.validateJsonElement(jsonObj.get("supportedMethods")); + // validate the required field `supportedPlatforms` + DestinationMetadataPlatformsV1.validateJsonElement(jsonObj.get("supportedPlatforms")); // ensure the json data is an array if (!jsonObj.get("actions").isJsonArray()) { throw new IllegalArgumentException( @@ -974,6 +970,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); + // validate the required field `actions` (array) + for (int i = 0; i < jsonArrayactions.size(); i++) { + DestinationMetadataActionV1.validateJsonElement(jsonArrayactions.get(i)); + } + ; // ensure the json data is an array if (!jsonObj.get("presets").isJsonArray()) { throw new IllegalArgumentException( @@ -984,6 +985,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraypresets = jsonObj.getAsJsonArray("presets"); + // validate the required field `presets` (array) + for (int i = 0; i < jsonArraypresets.size(); i++) { + DestinationMetadataSubscriptionPresetV1.validateJsonElement(jsonArraypresets.get(i)); + } + ; if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull()) { JsonArray jsonArraycontacts = jsonObj.getAsJsonArray("contacts"); if (jsonArraycontacts != null) { @@ -995,10 +1001,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("contacts").toString())); } + + // validate the optional field `contacts` (array) + for (int i = 0; i < jsonArraycontacts.size(); i++) { + Contact.validateJsonElement(jsonArraycontacts.get(i)); + } + ; } } // ensure the optional json data is an array if present if (jsonObj.get("supportedRegions") != null + && !jsonObj.get("supportedRegions").isJsonNull() && !jsonObj.get("supportedRegions").isJsonArray()) { throw new IllegalArgumentException( String.format( @@ -1008,6 +1021,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the optional json data is an array if present if (jsonObj.get("regionEndpoints") != null + && !jsonObj.get("regionEndpoints").isJsonNull() && !jsonObj.get("regionEndpoints").isJsonArray()) { throw new IllegalArgumentException( String.format( @@ -1039,9 +1053,9 @@ public void write(JsonWriter out, DestinationMetadataV1 value) @Override public DestinationMetadataV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index c62376c8..ad592d08 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** DestinationStatus represents status of each Destination in a stream. */ -@ApiModel(description = "DestinationStatus represents status of each Destination in a stream.") public class DestinationStatusV1 { public static final String SERIALIZED_NAME_NAME = "name"; @@ -129,7 +125,6 @@ public DestinationStatusV1 name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getName() { return name; } @@ -150,7 +145,6 @@ public DestinationStatusV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getId() { return id; } @@ -171,7 +165,6 @@ public DestinationStatusV1 status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public StatusEnum getStatus() { return status; } @@ -192,7 +185,6 @@ public DestinationStatusV1 errString(String errString) { * @return errString */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getErrString() { return errString; } @@ -213,7 +205,6 @@ public DestinationStatusV1 finishedAt(String finishedAt) { * @return finishedAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getFinishedAt() { return finishedAt; } @@ -289,15 +280,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationStatusV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationStatusV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationStatusV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationStatusV1 is not found in" @@ -306,27 +297,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationStatusV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationStatusV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationStatusV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -386,9 +378,9 @@ public void write(JsonWriter out, DestinationStatusV1 value) @Override public DestinationStatusV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index bd09251c..85fa7871 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -/** The Destination subscription. */ -@ApiModel(description = "The Destination subscription.") +/** DestinationSubscription */ public class DestinationSubscription { public static final String SERIALIZED_NAME_ID = "id"; @@ -67,7 +63,7 @@ public class DestinationSubscription { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public static final String SERIALIZED_NAME_TRIGGER = "trigger"; @@ -93,7 +89,6 @@ public DestinationSubscription id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique identifier for the subscription.") public String getId() { return id; } @@ -114,7 +109,6 @@ public DestinationSubscription name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the subscription.") public String getName() { return name; } @@ -135,9 +129,6 @@ public DestinationSubscription actionId(String actionId) { * @return actionId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The unique identifier for the Destination action to trigger.") public String getActionId() { return actionId; } @@ -158,9 +149,6 @@ public DestinationSubscription actionSlug(String actionSlug) { * @return actionSlug */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The URL-friendly key for the associated Destination action.") public String getActionSlug() { return actionSlug; } @@ -181,7 +169,6 @@ public DestinationSubscription destinationId(String destinationId) { * @return destinationId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The associated Destination instance id.") public String getDestinationId() { return destinationId; } @@ -202,7 +189,6 @@ public DestinationSubscription enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Is the subscription enabled.") public Boolean getEnabled() { return enabled; } @@ -211,24 +197,31 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public DestinationSubscription settings(Map settings) { + public DestinationSubscription settings(Map settings) { this.settings = settings; return this; } + public DestinationSubscription putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * The customer settings for action fields. + * Represents settings used to configure an action subscription. * * @return settings */ - @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "The customer settings for action fields.") - public Map getSettings() { + @javax.annotation.Nonnull + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -244,9 +237,6 @@ public DestinationSubscription trigger(String trigger) { * @return trigger */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "FQL string that describes what events should trigger a Destination action.") public String getTrigger() { return trigger; } @@ -268,10 +258,6 @@ public DestinationSubscription modelId(String modelId) { * @return modelId */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The unique identifier for the linked ReverseETLModel, if this part of a" - + " Reverse ETL connection.") public String getModelId() { return modelId; } @@ -363,15 +349,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationSubscription + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationSubscription */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationSubscription.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationSubscription is not found" @@ -380,27 +366,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationSubscription.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationSubscription` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationSubscription.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -476,9 +463,9 @@ public void write(JsonWriter out, DestinationSubscription value) @Override public DestinationSubscription read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 79c4df32..2685fc9b 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,19 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** The input parameters for updating a Destination subscription. */ -@ApiModel(description = "The input parameters for updating a Destination subscription.") public class DestinationSubscriptionUpdateInput { public static final String SERIALIZED_NAME_NAME = "name"; @@ -54,7 +48,7 @@ public class DestinationSubscriptionUpdateInput { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; + private Map settings; public DestinationSubscriptionUpdateInput() {} @@ -70,7 +64,6 @@ public DestinationSubscriptionUpdateInput name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "The user-defined name for the subscription.") public String getName() { return name; } @@ -91,7 +84,6 @@ public DestinationSubscriptionUpdateInput trigger(String trigger) { * @return trigger */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fql statement.") public String getTrigger() { return trigger; } @@ -112,7 +104,6 @@ public DestinationSubscriptionUpdateInput enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nullable - @ApiModelProperty(value = "Is the subscription enabled.") public Boolean getEnabled() { return enabled; } @@ -121,24 +112,31 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public DestinationSubscriptionUpdateInput settings(Map settings) { + public DestinationSubscriptionUpdateInput settings(Map settings) { this.settings = settings; return this; } + public DestinationSubscriptionUpdateInput putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } + this.settings.put(key, settingsItem); + return this; + } + /** - * The fields used for configuring this action. + * Represents settings used to configure an action subscription. * * @return settings */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields used for configuring this action.") - public Map getSettings() { + public Map getSettings() { return settings; } - public void setSettings(Map settings) { + public void setSettings(Map settings) { this.settings = settings; } @@ -158,27 +156,11 @@ public boolean equals(Object o) { && Objects.equals(this.settings, destinationSubscriptionUpdateInput.settings); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash(name, trigger, enabled, settings); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -218,16 +200,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DestinationSubscriptionUpdateInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationSubscriptionUpdateInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationSubscriptionUpdateInput is" @@ -237,17 +219,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationSubscriptionUpdateInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationSubscriptionUpdateInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -291,9 +274,9 @@ public void write(JsonWriter out, DestinationSubscriptionUpdateInput value) @Override public DestinationSubscriptionUpdateInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DestinationV1.java b/src/main/java/com/segment/publicapi/models/DestinationV1.java index 5c9cbadc..08439dd5 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,13 +21,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; @@ -37,11 +33,6 @@ * the Destination object in Config API, with the following fields omitted: - catalogId - createTime * - updateTime - connectionMode. */ -@ApiModel( - description = - "Business tools or apps that you can connect to the data flowing through Segment. " - + " This is equal to the Destination object in Config API, with the following" - + " fields omitted: - catalogId - createTime - updateTime - connectionMode.") public class DestinationV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -61,7 +52,7 @@ public class DestinationV1 { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) - private Metadata metadata; + private DestinationMetadataV1 metadata; public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @@ -88,11 +79,6 @@ public DestinationV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The unique identifier of this instance of a Destination. Config API note:" - + " analogous to `name`.") public String getId() { return id; } @@ -114,10 +100,6 @@ public DestinationV1 name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The name of this instance of a Destination. Config API note: equal to" - + " `displayName`.") public String getName() { return name; } @@ -138,9 +120,6 @@ public DestinationV1 enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether this instance of a Destination receives data.") public Boolean getEnabled() { return enabled; } @@ -149,7 +128,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public DestinationV1 metadata(Metadata metadata) { + public DestinationV1 metadata(DestinationMetadataV1 metadata) { this.metadata = metadata; return this; @@ -161,12 +140,11 @@ public DestinationV1 metadata(Metadata metadata) { * @return metadata */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Metadata getMetadata() { + public DestinationMetadataV1 getMetadata() { return metadata; } - public void setMetadata(Metadata metadata) { + public void setMetadata(DestinationMetadataV1 metadata) { this.metadata = metadata; } @@ -183,11 +161,6 @@ public DestinationV1 sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The id of a Source connected to this instance of a Destination. Config API" - + " note: analogous to `parent`.") public String getSourceId() { return sourceId; } @@ -203,6 +176,9 @@ public DestinationV1 settings(Map settings) { } public DestinationV1 putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } this.settings.put(key, settingsItem); return this; } @@ -214,11 +190,6 @@ public DestinationV1 putSettingsItem(String key, Object settingsItem) { * @return settings */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The collection of settings associated with a Destination. Config API note:" - + " equal to `config`.") public Map getSettings() { return settings; } @@ -297,15 +268,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to DestinationV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DestinationV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DestinationV1 is not found in the" @@ -314,27 +285,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DestinationV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DestinationV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DestinationV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -350,6 +322,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("name").toString())); } + // validate the required field `metadata` + DestinationMetadataV1.validateJsonElement(jsonObj.get("metadata")); if (!jsonObj.get("sourceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -380,9 +354,9 @@ public void write(JsonWriter out, DestinationV1 value) throws IOException { @Override public DestinationV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java index 35941304..3b7ed1be 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctions200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public DisableEdgeFunctions200Response data(DisableEdgeFunctionsAlphaOutput data * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public DisableEdgeFunctionsAlphaOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DisableEdgeFunctions200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DisableEdgeFunctions200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DisableEdgeFunctions200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DisableEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DisableEdgeFunctions200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DisableEdgeFunctionsAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, DisableEdgeFunctions200Response value) @Override public DisableEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java index 47feb531..7c4681ae 100644 --- a/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/DisableEdgeFunctionsAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Output for DisableEdgeFunctions. */ -@ApiModel(description = "Output for DisableEdgeFunctions.") public class DisableEdgeFunctionsAlphaOutput { public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) - private EdgeFunctions1 edgeFunctions; + private EdgeFunctionsAlpha edgeFunctions; public DisableEdgeFunctionsAlphaOutput() {} - public DisableEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunctions) { + public DisableEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctionsAlpha edgeFunctions) { this.edgeFunctions = edgeFunctions; return this; @@ -52,12 +48,11 @@ public DisableEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunction * @return edgeFunctions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public EdgeFunctions1 getEdgeFunctions() { + public EdgeFunctionsAlpha getEdgeFunctions() { return edgeFunctions; } - public void setEdgeFunctions(EdgeFunctions1 edgeFunctions) { + public void setEdgeFunctions(EdgeFunctionsAlpha edgeFunctions) { this.edgeFunctions = edgeFunctions; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * DisableEdgeFunctionsAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!DisableEdgeFunctionsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in DisableEdgeFunctionsAlphaOutput is not" @@ -131,27 +126,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!DisableEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `DisableEdgeFunctionsAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : DisableEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `edgeFunctions` + EdgeFunctionsAlpha.validateJsonElement(jsonObj.get("edgeFunctions")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -179,9 +177,9 @@ public void write(JsonWriter out, DisableEdgeFunctionsAlphaOutput value) @Override public DisableEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response.java b/src/main/java/com/segment/publicapi/models/Echo200Response.java index 9ede64cf..a1ec817c 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public Echo200Response data(EchoV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public EchoV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Echo200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Echo200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!Echo200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in Echo200Response is not found in the" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Echo200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `Echo200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + EchoV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, Echo200Response value) @Override public Echo200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Echo200Response1.java b/src/main/java/com/segment/publicapi/models/Echo200Response1.java index f52588e1..a5f04a7f 100644 --- a/src/main/java/com/segment/publicapi/models/Echo200Response1.java +++ b/src/main/java/com/segment/publicapi/models/Echo200Response1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public Echo200Response1 data(EchoAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public EchoAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Echo200Response1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Echo200Response1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!Echo200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in Echo200Response1 is not found in the" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Echo200Response1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `Echo200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + EchoAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, Echo200Response1 value) @Override public Echo200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java index 41a57d7b..5cc56151 100644 --- a/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/EchoAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,18 +22,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Echo response. */ -@ApiModel(description = "Echo response.") public class EchoAlphaOutput { /** * The HTTP method used for this round-trip. Currently, this endpoint supports only @@ -115,11 +110,6 @@ public EchoAlphaOutput method(MethodEnum method) { * @return method */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The HTTP method used for this round-trip. Currently, this endpoint supports" - + " only `get` and `post` methods.") public MethodEnum getMethod() { return method; } @@ -140,7 +130,6 @@ public EchoAlphaOutput message(String message) { * @return message */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The string passed in the `message` input field.") public String getMessage() { return message; } @@ -156,6 +145,9 @@ public EchoAlphaOutput headers(Map headers) { } public EchoAlphaOutput putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } this.headers.put(key, headersItem); return this; } @@ -166,7 +158,6 @@ public EchoAlphaOutput putHeadersItem(String key, Object headersItem) { * @return headers */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The request's HTTP headers.") public Map getHeaders() { return headers; } @@ -234,15 +225,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EchoAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EchoAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!EchoAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in EchoAlphaOutput is not found in the" @@ -251,27 +242,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!EchoAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `EchoAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : EchoAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("method").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -310,9 +302,9 @@ public void write(JsonWriter out, EchoAlphaOutput value) @Override public EchoAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/EchoV1Output.java b/src/main/java/com/segment/publicapi/models/EchoV1Output.java index 5f1aa64a..d18f2864 100644 --- a/src/main/java/com/segment/publicapi/models/EchoV1Output.java +++ b/src/main/java/com/segment/publicapi/models/EchoV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,18 +22,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; /** Echo response. */ -@ApiModel(description = "Echo response.") public class EchoV1Output { /** * The HTTP method used for this round-trip. Currently, this endpoint supports only @@ -115,11 +110,6 @@ public EchoV1Output method(MethodEnum method) { * @return method */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The HTTP method used for this round-trip. Currently, this endpoint supports" - + " only `get` and `post` methods.") public MethodEnum getMethod() { return method; } @@ -140,7 +130,6 @@ public EchoV1Output message(String message) { * @return message */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The string passed in the `message` input field.") public String getMessage() { return message; } @@ -156,6 +145,9 @@ public EchoV1Output headers(Map headers) { } public EchoV1Output putHeadersItem(String key, Object headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } this.headers.put(key, headersItem); return this; } @@ -166,7 +158,6 @@ public EchoV1Output putHeadersItem(String key, Object headersItem) { * @return headers */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The request's HTTP headers.") public Map getHeaders() { return headers; } @@ -234,15 +225,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EchoV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EchoV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!EchoV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in EchoV1Output is not found in the empty" @@ -251,27 +242,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!EchoV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `EchoV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : EchoV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("method").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -309,9 +301,9 @@ public void write(JsonWriter out, EchoV1Output value) throws IOException { @Override public EchoV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions.java deleted file mode 100644 index 338033ac..00000000 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The created Edge Function. */ -@ApiModel(description = "The created Edge Function.") -public class EdgeFunctions { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; - - @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) - private String downloadURL; - - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; - - public EdgeFunctions() {} - - public EdgeFunctions id(String id) { - - this.id = id; - return this; - } - - /** - * The Edge Function id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Edge Function id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public EdgeFunctions sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source id. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public EdgeFunctions createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Creation date. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creation date.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public EdgeFunctions createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * Creating user's id. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creating user's id.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public EdgeFunctions downloadURL(String downloadURL) { - - this.downloadURL = downloadURL; - return this; - } - - /** - * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. - * - * @return downloadURL - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") - public String getDownloadURL() { - return downloadURL; - } - - public void setDownloadURL(String downloadURL) { - this.downloadURL = downloadURL; - } - - public EdgeFunctions version(BigDecimal version) { - - this.version = version; - return this; - } - - /** - * Revision number associated with the latest Edge Function. - * - * @return version - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Revision number associated with the latest Edge Function.") - public BigDecimal getVersion() { - return version; - } - - public void setVersion(BigDecimal version) { - this.version = version; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeFunctions edgeFunctions = (EdgeFunctions) o; - return Objects.equals(this.id, edgeFunctions.id) - && Objects.equals(this.sourceId, edgeFunctions.sourceId) - && Objects.equals(this.createdAt, edgeFunctions.createdAt) - && Objects.equals(this.createdBy, edgeFunctions.createdBy) - && Objects.equals(this.downloadURL, edgeFunctions.downloadURL) - && Objects.equals(this.version, edgeFunctions.version); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeFunctions {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("downloadURL"); - openapiFields.add("version"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("downloadURL"); - openapiRequiredFields.add("version"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EdgeFunctions - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EdgeFunctions.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EdgeFunctions is not found in the" - + " empty JSON string", - EdgeFunctions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EdgeFunctions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EdgeFunctions` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EdgeFunctions.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("downloadURL").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `downloadURL` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("downloadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EdgeFunctions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EdgeFunctions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctions.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EdgeFunctions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EdgeFunctions read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EdgeFunctions given an JSON string - * - * @param jsonString JSON string - * @return An instance of EdgeFunctions - * @throws IOException if the JSON string is invalid with respect to EdgeFunctions - */ - public static EdgeFunctions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EdgeFunctions.class); - } - - /** - * Convert an instance of EdgeFunctions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java b/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java deleted file mode 100644 index 9816c2c9..00000000 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctions1.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The latest version of Edge Function bundle. */ -@ApiModel(description = "The latest version of Edge Function bundle.") -public class EdgeFunctions1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_DOWNLOAD_U_R_L = "downloadURL"; - - @SerializedName(SERIALIZED_NAME_DOWNLOAD_U_R_L) - private String downloadURL; - - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; - - public EdgeFunctions1() {} - - public EdgeFunctions1 id(String id) { - - this.id = id; - return this; - } - - /** - * The Edge Function id. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Edge Function id.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public EdgeFunctions1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source id. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public EdgeFunctions1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Creation date. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creation date.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public EdgeFunctions1 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * Creating user's id. - * - * @return createdBy - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creating user's id.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public EdgeFunctions1 downloadURL(String downloadURL) { - - this.downloadURL = downloadURL; - return this; - } - - /** - * The CDN URL that can be used to fetch your latest EdgeFunctions bundle. - * - * @return downloadURL - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") - public String getDownloadURL() { - return downloadURL; - } - - public void setDownloadURL(String downloadURL) { - this.downloadURL = downloadURL; - } - - public EdgeFunctions1 version(BigDecimal version) { - - this.version = version; - return this; - } - - /** - * Revision number associated with the latest Edge Function. - * - * @return version - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Revision number associated with the latest Edge Function.") - public BigDecimal getVersion() { - return version; - } - - public void setVersion(BigDecimal version) { - this.version = version; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EdgeFunctions1 edgeFunctions1 = (EdgeFunctions1) o; - return Objects.equals(this.id, edgeFunctions1.id) - && Objects.equals(this.sourceId, edgeFunctions1.sourceId) - && Objects.equals(this.createdAt, edgeFunctions1.createdAt) - && Objects.equals(this.createdBy, edgeFunctions1.createdBy) - && Objects.equals(this.downloadURL, edgeFunctions1.downloadURL) - && Objects.equals(this.version, edgeFunctions1.version); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, createdAt, createdBy, downloadURL, version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EdgeFunctions1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" downloadURL: ").append(toIndentedString(downloadURL)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("downloadURL"); - openapiFields.add("version"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("downloadURL"); - openapiRequiredFields.add("version"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EdgeFunctions1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!EdgeFunctions1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EdgeFunctions1 is not found in the" - + " empty JSON string", - EdgeFunctions1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!EdgeFunctions1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EdgeFunctions1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EdgeFunctions1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("downloadURL").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `downloadURL` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("downloadURL").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EdgeFunctions1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EdgeFunctions1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EdgeFunctions1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EdgeFunctions1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EdgeFunctions1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EdgeFunctions1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of EdgeFunctions1 - * @throws IOException if the JSON string is invalid with respect to EdgeFunctions1 - */ - public static EdgeFunctions1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EdgeFunctions1.class); - } - - /** - * Convert an instance of EdgeFunctions1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java index 38106812..64d8bee1 100644 --- a/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java +++ b/src/main/java/com/segment/publicapi/models/EdgeFunctionsAlpha.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents an Edge Function bundle. */ -@ApiModel(description = "Represents an Edge Function bundle.") public class EdgeFunctionsAlpha { public static final String SERIALIZED_NAME_ID = "id"; @@ -78,7 +74,6 @@ public EdgeFunctionsAlpha id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Edge Function id.") public String getId() { return id; } @@ -99,7 +94,6 @@ public EdgeFunctionsAlpha sourceId(String sourceId) { * @return sourceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Source id.") public String getSourceId() { return sourceId; } @@ -120,7 +114,6 @@ public EdgeFunctionsAlpha createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creation date.") public String getCreatedAt() { return createdAt; } @@ -141,7 +134,6 @@ public EdgeFunctionsAlpha createdBy(String createdBy) { * @return createdBy */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Creating user's id.") public String getCreatedBy() { return createdBy; } @@ -162,9 +154,6 @@ public EdgeFunctionsAlpha downloadURL(String downloadURL) { * @return downloadURL */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The CDN URL that can be used to fetch your latest EdgeFunctions bundle.") public String getDownloadURL() { return downloadURL; } @@ -185,9 +174,6 @@ public EdgeFunctionsAlpha version(BigDecimal version) { * @return version */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Revision number associated with the latest Edge Function.") public BigDecimal getVersion() { return version; } @@ -267,15 +253,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EdgeFunctionsAlpha + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EdgeFunctionsAlpha */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!EdgeFunctionsAlpha.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in EdgeFunctionsAlpha is not found in the" @@ -284,27 +270,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!EdgeFunctionsAlpha.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `EdgeFunctionsAlpha` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : EdgeFunctionsAlpha.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -364,9 +351,9 @@ public void write(JsonWriter out, EdgeFunctionsAlpha value) @Override public EdgeFunctionsAlpha read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/EventSourceV1.java b/src/main/java/com/segment/publicapi/models/EventSourceV1.java index a09f5ee3..9d9db41e 100644 --- a/src/main/java/com/segment/publicapi/models/EventSourceV1.java +++ b/src/main/java/com/segment/publicapi/models/EventSourceV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Source represents a Segment Source. */ -@ApiModel(description = "Source represents a Segment Source.") public class EventSourceV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -62,7 +58,6 @@ public EventSourceV1 id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source where the events came from.") public String getId() { return id; } @@ -83,7 +78,6 @@ public EventSourceV1 name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Source, if applicable.") public String getName() { return name; } @@ -104,7 +98,6 @@ public EventSourceV1 slug(String slug) { * @return slug */ @javax.annotation.Nullable - @ApiModelProperty(value = "The slug of the Source, if applicable.") public String getSlug() { return slug; } @@ -170,15 +163,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to EventSourceV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventSourceV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!EventSourceV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in EventSourceV1 is not found in the" @@ -187,27 +180,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!EventSourceV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `EventSourceV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : EventSourceV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -254,9 +248,9 @@ public void write(JsonWriter out, EventSourceV1 value) throws IOException { @Override public EventSourceV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java b/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java index 8cca0cab..909bbdb8 100644 --- a/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java +++ b/src/main/java/com/segment/publicapi/models/FQLDefinedPropertyV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -55,7 +53,6 @@ public FQLDefinedPropertyV1 fql(String fql) { * @return fql */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The FQL expression used to compute the property.") public String getFql() { return fql; } @@ -76,7 +73,6 @@ public FQLDefinedPropertyV1 propertyName(String propertyName) { * @return propertyName */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The new property name.") public String getPropertyName() { return propertyName; } @@ -140,15 +136,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FQLDefinedPropertyV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FQLDefinedPropertyV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!FQLDefinedPropertyV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in FQLDefinedPropertyV1 is not found in" @@ -157,27 +153,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!FQLDefinedPropertyV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `FQLDefinedPropertyV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : FQLDefinedPropertyV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("fql").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -216,9 +213,9 @@ public void write(JsonWriter out, FQLDefinedPropertyV1 value) @Override public FQLDefinedPropertyV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java deleted file mode 100644 index 7bdd81cf..00000000 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The filter to preview. */ -@ApiModel(description = "The filter to preview.") -public class Filter { - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); - - public Filter() {} - - public Filter _if(String _if) { - - this._if = _if; - return this; - } - - /** - * A FQL statement which determines if the provided filter's actions will apply to the - * provided JSON payload. The literal string \"all\" will result in this filter to all - * events. For guidance on using FQL, see the Segment documentation site. - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "A FQL statement which determines if the provided filter's actions will apply" - + " to the provided JSON payload. The literal string \"all\" will result in" - + " this filter to all events. For guidance on using FQL, see the Segment" - + " documentation site.") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Filter actions(List actions) { - - this.actions = actions; - return this; - } - - public Filter addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } - - /** - * The filtering action to take on events that match the \"if\" statement. Action - * types must be one of: \"drop\", \"allow_properties\", - * \"drop_properties\" or \"sample\". - * - * @return actions - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The filtering action to take on events that match the \"if\" statement. Action" - + " types must be one of: \"drop\", \"allow_properties\"," - + " \"drop_properties\" or \"sample\".") - public List getActions() { - return actions; - } - - public void setActions(List actions) { - this.actions = actions; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter filter = (Filter) o; - return Objects.equals(this._if, filter._if) && Objects.equals(this.actions, filter.actions); - } - - @Override - public int hashCode() { - return Objects.hash(_if, actions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter {\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("if"); - openapiFields.add("actions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Filter is not found in the empty JSON" - + " string", - Filter.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Filter`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `actions` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Filter.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Filter given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter - * @throws IOException if the JSON string is invalid with respect to Filter - */ - public static Filter fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter.class); - } - - /** - * Convert an instance of Filter to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Filter1.java b/src/main/java/com/segment/publicapi/models/Filter1.java deleted file mode 100644 index d5668ad5..00000000 --- a/src/main/java/com/segment/publicapi/models/Filter1.java +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The requested Destination filter. */ -@ApiModel(description = "The requested Destination filter.") -public class Filter1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TITLE = "title"; - - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public Filter1() {} - - public Filter1 id(String id) { - - this.id = id; - return this; - } - - /** - * The unique id of this filter. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Filter1 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The id of the Source associated with this filter. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Filter1 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } - - /** - * The id of the Destination associated with this filter. - * - * @return destinationId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Destination associated with this filter.") - public String getDestinationId() { - return destinationId; - } - - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } - - public Filter1 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * A condition that defines whether to apply this filter to a payload. - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A condition that defines whether to apply this filter to a payload.") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Filter1 actions(List actions) { - - this.actions = actions; - return this; - } - - public Filter1 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } - - /** - * A list of actions this filter performs. - * - * @return actions - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") - public List getActions() { - return actions; - } - - public void setActions(List actions) { - this.actions = actions; - } - - public Filter1 title(String title) { - - this.title = title; - return this; - } - - /** - * A title for this filter. - * - * @return title - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Filter1 description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this filter. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Filter1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Filter1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Filter1 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter1 filter1 = (Filter1) o; - return Objects.equals(this.id, filter1.id) - && Objects.equals(this.sourceId, filter1.sourceId) - && Objects.equals(this.destinationId, filter1.destinationId) - && Objects.equals(this._if, filter1._if) - && Objects.equals(this.actions, filter1.actions) - && Objects.equals(this.title, filter1.title) - && Objects.equals(this.description, filter1.description) - && Objects.equals(this.enabled, filter1.enabled) - && Objects.equals(this.createdAt, filter1.createdAt) - && Objects.equals(this.updatedAt, filter1.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - sourceId, - destinationId, - _if, - actions, - title, - description, - enabled, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Filter1 is not found in the empty JSON" - + " string", - Filter1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Filter1`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `actions` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `title` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Filter1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Filter1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter1 - * @throws IOException if the JSON string is invalid with respect to Filter1 - */ - public static Filter1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter1.class); - } - - /** - * Convert an instance of Filter1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Filter2.java b/src/main/java/com/segment/publicapi/models/Filter2.java deleted file mode 100644 index 1fd399cc..00000000 --- a/src/main/java/com/segment/publicapi/models/Filter2.java +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The newly created Destination filter. */ -@ApiModel(description = "The newly created Destination filter.") -public class Filter2 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TITLE = "title"; - - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public Filter2() {} - - public Filter2 id(String id) { - - this.id = id; - return this; - } - - /** - * The unique id of this filter. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Filter2 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The id of the Source associated with this filter. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Filter2 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } - - /** - * The id of the Destination associated with this filter. - * - * @return destinationId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Destination associated with this filter.") - public String getDestinationId() { - return destinationId; - } - - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } - - public Filter2 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * A condition that defines whether to apply this filter to a payload. - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A condition that defines whether to apply this filter to a payload.") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Filter2 actions(List actions) { - - this.actions = actions; - return this; - } - - public Filter2 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } - - /** - * A list of actions this filter performs. - * - * @return actions - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") - public List getActions() { - return actions; - } - - public void setActions(List actions) { - this.actions = actions; - } - - public Filter2 title(String title) { - - this.title = title; - return this; - } - - /** - * A title for this filter. - * - * @return title - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Filter2 description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this filter. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Filter2 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Filter2 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Filter2 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter2 filter2 = (Filter2) o; - return Objects.equals(this.id, filter2.id) - && Objects.equals(this.sourceId, filter2.sourceId) - && Objects.equals(this.destinationId, filter2.destinationId) - && Objects.equals(this._if, filter2._if) - && Objects.equals(this.actions, filter2.actions) - && Objects.equals(this.title, filter2.title) - && Objects.equals(this.description, filter2.description) - && Objects.equals(this.enabled, filter2.enabled) - && Objects.equals(this.createdAt, filter2.createdAt) - && Objects.equals(this.updatedAt, filter2.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - sourceId, - destinationId, - _if, - actions, - title, - description, - enabled, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter2.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Filter2 is not found in the empty JSON" - + " string", - Filter2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Filter2`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter2.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `actions` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `title` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Filter2.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Filter2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter2 - * @throws IOException if the JSON string is invalid with respect to Filter2 - */ - public static Filter2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter2.class); - } - - /** - * Convert an instance of Filter2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Filter3.java b/src/main/java/com/segment/publicapi/models/Filter3.java deleted file mode 100644 index 79d03d6d..00000000 --- a/src/main/java/com/segment/publicapi/models/Filter3.java +++ /dev/null @@ -1,561 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The updated Destination filter. */ -@ApiModel(description = "The updated Destination filter.") -public class Filter3 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; - - public static final String SERIALIZED_NAME_IF = "if"; - - @SerializedName(SERIALIZED_NAME_IF) - private String _if; - - public static final String SERIALIZED_NAME_ACTIONS = "actions"; - - @SerializedName(SERIALIZED_NAME_ACTIONS) - private List actions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TITLE = "title"; - - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public Filter3() {} - - public Filter3 id(String id) { - - this.id = id; - return this; - } - - /** - * The unique id of this filter. - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique id of this filter.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Filter3 sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The id of the Source associated with this filter. - * - * @return sourceId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the Source associated with this filter.") - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public Filter3 destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } - - /** - * The id of the Destination associated with this filter. - * - * @return destinationId - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The id of the Destination associated with this filter.") - public String getDestinationId() { - return destinationId; - } - - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } - - public Filter3 _if(String _if) { - - this._if = _if; - return this; - } - - /** - * A condition that defines whether to apply this filter to a payload. - * - * @return _if - */ - @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "A condition that defines whether to apply this filter to a payload.") - public String getIf() { - return _if; - } - - public void setIf(String _if) { - this._if = _if; - } - - public Filter3 actions(List actions) { - - this.actions = actions; - return this; - } - - public Filter3 addActionsItem(DestinationFilterActionV1 actionsItem) { - this.actions.add(actionsItem); - return this; - } - - /** - * A list of actions this filter performs. - * - * @return actions - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A list of actions this filter performs.") - public List getActions() { - return actions; - } - - public void setActions(List actions) { - this.actions = actions; - } - - public Filter3 title(String title) { - - this.title = title; - return this; - } - - /** - * A title for this filter. - * - * @return title - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A title for this filter.") - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public Filter3 description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this filter. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this filter.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Filter3 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * When set to true, this filter is active. - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When set to true, this filter is active.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Filter3 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The timestamp of this filter's creation. - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's creation.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Filter3 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * The timestamp of this filter's last change. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The timestamp of this filter's last change.") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Filter3 filter3 = (Filter3) o; - return Objects.equals(this.id, filter3.id) - && Objects.equals(this.sourceId, filter3.sourceId) - && Objects.equals(this.destinationId, filter3.destinationId) - && Objects.equals(this._if, filter3._if) - && Objects.equals(this.actions, filter3.actions) - && Objects.equals(this.title, filter3.title) - && Objects.equals(this.description, filter3.description) - && Objects.equals(this.enabled, filter3.enabled) - && Objects.equals(this.createdAt, filter3.createdAt) - && Objects.equals(this.updatedAt, filter3.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - sourceId, - destinationId, - _if, - actions, - title, - description, - enabled, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Filter3 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("destinationId"); - openapiFields.add("if"); - openapiFields.add("actions"); - openapiFields.add("title"); - openapiFields.add("description"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("sourceId"); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("if"); - openapiRequiredFields.add("actions"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Filter3 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Filter3.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Filter3 is not found in the empty JSON" - + " string", - Filter3.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Filter3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Filter3`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Filter3.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("destinationId").toString())); - } - if (!jsonObj.get("if").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `if` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("if").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("actions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `actions` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("actions").toString())); - } - - JsonArray jsonArrayactions = jsonObj.getAsJsonArray("actions"); - if (!jsonObj.get("title").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `title` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("title").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Filter3.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Filter3' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Filter3.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Filter3 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Filter3 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Filter3 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Filter3 - * @throws IOException if the JSON string is invalid with respect to Filter3 - */ - public static Filter3 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Filter3.class); - } - - /** - * Convert an instance of Filter3 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index 73f8cc11..12d7c2a2 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,21 +23,18 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; /** A Function object. */ -@ApiModel(description = "A Function object.") public class Function { public static final String SERIALIZED_NAME_ID = "id"; @@ -121,7 +117,7 @@ public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + private List settings; public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -172,7 +168,6 @@ public Function id(String id) { * @return id */ @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") public String getId() { return id; } @@ -193,7 +188,6 @@ public Function resourceType(ResourceTypeEnum resourceType) { * @return resourceType */ @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") public ResourceTypeEnum getResourceType() { return resourceType; } @@ -214,7 +208,6 @@ public Function createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") public String getCreatedAt() { return createdAt; } @@ -235,7 +228,6 @@ public Function createdBy(String createdBy) { * @return createdBy */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") public String getCreatedBy() { return createdBy; } @@ -256,7 +248,6 @@ public Function code(String code) { * @return code */ @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") public String getCode() { return code; } @@ -277,7 +268,6 @@ public Function deployedAt(String deployedAt) { * @return deployedAt */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") public String getDeployedAt() { return deployedAt; } @@ -306,7 +296,6 @@ public Function addSettingsItem(FunctionSettingV1 settingsItem) { * @return settings */ @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") public List getSettings() { return settings; } @@ -327,7 +316,6 @@ public Function displayName(String displayName) { * @return displayName */ @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") public String getDisplayName() { return displayName; } @@ -348,7 +336,6 @@ public Function description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") public String getDescription() { return description; } @@ -369,7 +356,6 @@ public Function logoUrl(String logoUrl) { * @return logoUrl */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") public String getLogoUrl() { return logoUrl; } @@ -390,7 +376,6 @@ public Function previewWebhookUrl(String previewWebhookUrl) { * @return previewWebhookUrl */ @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") public String getPreviewWebhookUrl() { return previewWebhookUrl; } @@ -411,7 +396,6 @@ public Function batchMaxCount(BigDecimal batchMaxCount) { * @return batchMaxCount */ @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") public BigDecimal getBatchMaxCount() { return batchMaxCount; } @@ -432,7 +416,6 @@ public Function catalogId(String catalogId) { * @return catalogId */ @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") public String getCatalogId() { return catalogId; } @@ -453,7 +436,6 @@ public Function isLatestVersion(Boolean isLatestVersion) { * @return isLatestVersion */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") public Boolean getIsLatestVersion() { return isLatestVersion; } @@ -583,15 +565,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Function + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Function */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!Function.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in Function is not found in the empty" @@ -600,17 +582,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!Function.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the `Function`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -670,6 +653,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("settings").toString())); } + + // validate the optional field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + FunctionSettingV1.validateJsonElement(jsonArraysettings.get(i)); + } + ; } } if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) @@ -736,9 +725,9 @@ public void write(JsonWriter out, Function value) throws IOException { @Override public Function read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Function1.java b/src/main/java/com/segment/publicapi/models/Function1.java deleted file mode 100644 index fc7ffe8c..00000000 --- a/src/main/java/com/segment/publicapi/models/Function1.java +++ /dev/null @@ -1,766 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** A Function object. */ -@ApiModel(description = "A Function object.") -public class Function1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The Function type. Config API note: equal to `type`. */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - INSERT_DESTINATION("INSERT_DESTINATION"), - - SOURCE("SOURCE"); - - private String value; - - ResourceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_CODE = "code"; - - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; - - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; - - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; - - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; - - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; - - public Function1() {} - - public Function1 id(String id) { - - this.id = id; - return this; - } - - /** - * An identifier for this Function. - * - * @return id - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Function1 resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } - - /** - * The Function type. Config API note: equal to `type`. - * - * @return resourceType - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") - public ResourceTypeEnum getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } - - public Function1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The time this Function was created. - * - * @return createdAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Function1 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * The id of the user who created this Function. - * - * @return createdBy - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Function1 code(String code) { - - this.code = code; - return this; - } - - /** - * The Function code. - * - * @return code - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Function1 deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } - - /** - * The time of this Function's last deployment. - * - * @return deployedAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") - public String getDeployedAt() { - return deployedAt; - } - - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } - - public Function1 settings(List settings) { - - this.settings = settings; - return this; - } - - public Function1 addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); - } - this.settings.add(settingsItem); - return this; - } - - /** - * The list of settings for this Function. - * - * @return settings - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") - public List getSettings() { - return settings; - } - - public void setSettings(List settings) { - this.settings = settings; - } - - public Function1 displayName(String displayName) { - - this.displayName = displayName; - return this; - } - - /** - * A display name for this Function. - * - * @return displayName - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public Function1 description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this Function. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Function1 logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } - - /** - * The URL of the logo for this Function. - * - * @return logoUrl - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") - public String getLogoUrl() { - return logoUrl; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public Function1 previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } - - /** - * The preview webhook URL for this Function. - * - * @return previewWebhookUrl - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } - - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } - - public Function1 batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } - - /** - * The max count of the batch for this Function. - * - * @return batchMaxCount - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - public Function1 catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * - * @return catalogId - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") - public String getCatalogId() { - return catalogId; - } - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - public Function1 isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * - * @return isLatestVersion - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function1 function1 = (Function1) o; - return Objects.equals(this.id, function1.id) - && Objects.equals(this.resourceType, function1.resourceType) - && Objects.equals(this.createdAt, function1.createdAt) - && Objects.equals(this.createdBy, function1.createdBy) - && Objects.equals(this.code, function1.code) - && Objects.equals(this.deployedAt, function1.deployedAt) - && Objects.equals(this.settings, function1.settings) - && Objects.equals(this.displayName, function1.displayName) - && Objects.equals(this.description, function1.description) - && Objects.equals(this.logoUrl, function1.logoUrl) - && Objects.equals(this.previewWebhookUrl, function1.previewWebhookUrl) - && Objects.equals(this.batchMaxCount, function1.batchMaxCount) - && Objects.equals(this.catalogId, function1.catalogId) - && Objects.equals(this.isLatestVersion, function1.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - resourceType, - createdAt, - createdBy, - code, - deployedAt, - settings, - displayName, - description, - logoUrl, - previewWebhookUrl, - batchMaxCount, - catalogId, - isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ") - .append(toIndentedString(previewWebhookUrl)) - .append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Function1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Function1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Function1 is not found in the empty" - + " JSON string", - Function1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Function1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Function1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) - && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `resourceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) - && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) - && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) - && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `code` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) - && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `deployedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `settings` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("settings").toString())); - } - } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) - && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `displayName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) - && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `logoUrl` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null - && !jsonObj.get("previewWebhookUrl").isJsonNull()) - && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `previewWebhookUrl` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) - && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `catalogId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Function1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Function1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Function1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function1 - * @throws IOException if the JSON string is invalid with respect to Function1 - */ - public static Function1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function1.class); - } - - /** - * Convert an instance of Function1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Function2.java b/src/main/java/com/segment/publicapi/models/Function2.java deleted file mode 100644 index 296df480..00000000 --- a/src/main/java/com/segment/publicapi/models/Function2.java +++ /dev/null @@ -1,766 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** The updated Function object. */ -@ApiModel(description = "The updated Function object.") -public class Function2 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The Function type. Config API note: equal to `type`. */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - INSERT_DESTINATION("INSERT_DESTINATION"), - - SOURCE("SOURCE"); - - private String value; - - ResourceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_CODE = "code"; - - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; - - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; - - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; - - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; - - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; - - public Function2() {} - - public Function2 id(String id) { - - this.id = id; - return this; - } - - /** - * An identifier for this Function. - * - * @return id - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Function2 resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } - - /** - * The Function type. Config API note: equal to `type`. - * - * @return resourceType - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") - public ResourceTypeEnum getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } - - public Function2 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The time this Function was created. - * - * @return createdAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Function2 createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * The id of the user who created this Function. - * - * @return createdBy - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Function2 code(String code) { - - this.code = code; - return this; - } - - /** - * The Function code. - * - * @return code - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Function2 deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } - - /** - * The time of this Function's last deployment. - * - * @return deployedAt - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") - public String getDeployedAt() { - return deployedAt; - } - - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } - - public Function2 settings(List settings) { - - this.settings = settings; - return this; - } - - public Function2 addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); - } - this.settings.add(settingsItem); - return this; - } - - /** - * The list of settings for this Function. - * - * @return settings - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") - public List getSettings() { - return settings; - } - - public void setSettings(List settings) { - this.settings = settings; - } - - public Function2 displayName(String displayName) { - - this.displayName = displayName; - return this; - } - - /** - * A display name for this Function. - * - * @return displayName - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public Function2 description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this Function. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Function2 logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } - - /** - * The URL of the logo for this Function. - * - * @return logoUrl - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") - public String getLogoUrl() { - return logoUrl; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public Function2 previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } - - /** - * The preview webhook URL for this Function. - * - * @return previewWebhookUrl - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } - - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } - - public Function2 batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } - - /** - * The max count of the batch for this Function. - * - * @return batchMaxCount - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - public Function2 catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * - * @return catalogId - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") - public String getCatalogId() { - return catalogId; - } - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - public Function2 isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * - * @return isLatestVersion - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function2 function2 = (Function2) o; - return Objects.equals(this.id, function2.id) - && Objects.equals(this.resourceType, function2.resourceType) - && Objects.equals(this.createdAt, function2.createdAt) - && Objects.equals(this.createdBy, function2.createdBy) - && Objects.equals(this.code, function2.code) - && Objects.equals(this.deployedAt, function2.deployedAt) - && Objects.equals(this.settings, function2.settings) - && Objects.equals(this.displayName, function2.displayName) - && Objects.equals(this.description, function2.description) - && Objects.equals(this.logoUrl, function2.logoUrl) - && Objects.equals(this.previewWebhookUrl, function2.previewWebhookUrl) - && Objects.equals(this.batchMaxCount, function2.batchMaxCount) - && Objects.equals(this.catalogId, function2.catalogId) - && Objects.equals(this.isLatestVersion, function2.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - resourceType, - createdAt, - createdBy, - code, - deployedAt, - settings, - displayName, - description, - logoUrl, - previewWebhookUrl, - batchMaxCount, - catalogId, - isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ") - .append(toIndentedString(previewWebhookUrl)) - .append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Function2 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Function2.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Function2 is not found in the empty" - + " JSON string", - Function2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Function2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Function2` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) - && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `resourceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) - && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) - && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) - && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `code` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) - && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `deployedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `settings` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("settings").toString())); - } - } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) - && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `displayName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) - && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `logoUrl` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null - && !jsonObj.get("previewWebhookUrl").isJsonNull()) - && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `previewWebhookUrl` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) - && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `catalogId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Function2.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Function2 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function2 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Function2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function2 - * @throws IOException if the JSON string is invalid with respect to Function2 - */ - public static Function2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function2.class); - } - - /** - * Convert an instance of Function2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java index 332de392..213a24ba 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionDeployment.java +++ b/src/main/java/com/segment/publicapi/models/FunctionDeployment.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,16 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The status of the operation. */ -@ApiModel(description = "The status of the operation.") public class FunctionDeployment { /** Gets or Sets status */ @JsonAdapter(StatusEnum.Adapter.class) @@ -97,7 +93,6 @@ public FunctionDeployment status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public StatusEnum getStatus() { return status; } @@ -157,15 +152,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FunctionDeployment + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FunctionDeployment */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!FunctionDeployment.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in FunctionDeployment is not found in the" @@ -174,27 +169,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!FunctionDeployment.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `FunctionDeployment` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : FunctionDeployment.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -226,9 +222,9 @@ public void write(JsonWriter out, FunctionDeployment value) @Override public FunctionDeployment read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java index 8cc0c7d4..1a58f9ea 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionSettingV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,10 +22,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -126,7 +124,6 @@ public FunctionSettingV1 name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this Function Setting.") public String getName() { return name; } @@ -147,7 +144,6 @@ public FunctionSettingV1 label(String label) { * @return label */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The label for this Function Setting.") public String getLabel() { return label; } @@ -168,7 +164,6 @@ public FunctionSettingV1 description(String description) { * @return description */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A description of this Function Setting.") public String getDescription() { return description; } @@ -189,7 +184,6 @@ public FunctionSettingV1 type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Function Setting.") public TypeEnum getType() { return type; } @@ -210,7 +204,6 @@ public FunctionSettingV1 required(Boolean required) { * @return required */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this Function Setting is required.") public Boolean getRequired() { return required; } @@ -231,9 +224,6 @@ public FunctionSettingV1 sensitive(Boolean sensitive) { * @return sensitive */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether this Function Setting contains sensitive information.") public Boolean getSensitive() { return sensitive; } @@ -313,15 +303,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FunctionSettingV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FunctionSettingV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!FunctionSettingV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in FunctionSettingV1 is not found in the" @@ -330,27 +320,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!FunctionSettingV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `FunctionSettingV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : FunctionSettingV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -403,9 +394,9 @@ public void write(JsonWriter out, FunctionSettingV1 value) @Override public FunctionSettingV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index 57a9b7bc..7afbfac9 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,21 +23,18 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; /** Represents a Function. */ -@ApiModel(description = "Represents a Function.") public class FunctionV1 { public static final String SERIALIZED_NAME_ID = "id"; @@ -121,7 +117,7 @@ public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings = null; + private List settings; public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @@ -172,7 +168,6 @@ public FunctionV1 id(String id) { * @return id */ @javax.annotation.Nullable - @ApiModelProperty(value = "An identifier for this Function.") public String getId() { return id; } @@ -193,7 +188,6 @@ public FunctionV1 resourceType(ResourceTypeEnum resourceType) { * @return resourceType */ @javax.annotation.Nullable - @ApiModelProperty(value = "The Function type. Config API note: equal to `type`.") public ResourceTypeEnum getResourceType() { return resourceType; } @@ -214,7 +208,6 @@ public FunctionV1 createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time this Function was created.") public String getCreatedAt() { return createdAt; } @@ -235,7 +228,6 @@ public FunctionV1 createdBy(String createdBy) { * @return createdBy */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the user who created this Function.") public String getCreatedBy() { return createdBy; } @@ -256,7 +248,6 @@ public FunctionV1 code(String code) { * @return code */ @javax.annotation.Nullable - @ApiModelProperty(value = "The Function code.") public String getCode() { return code; } @@ -277,7 +268,6 @@ public FunctionV1 deployedAt(String deployedAt) { * @return deployedAt */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time of this Function's last deployment.") public String getDeployedAt() { return deployedAt; } @@ -306,7 +296,6 @@ public FunctionV1 addSettingsItem(FunctionSettingV1 settingsItem) { * @return settings */ @javax.annotation.Nullable - @ApiModelProperty(value = "The list of settings for this Function.") public List getSettings() { return settings; } @@ -327,7 +316,6 @@ public FunctionV1 displayName(String displayName) { * @return displayName */ @javax.annotation.Nullable - @ApiModelProperty(value = "A display name for this Function.") public String getDisplayName() { return displayName; } @@ -348,7 +336,6 @@ public FunctionV1 description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "A description for this Function.") public String getDescription() { return description; } @@ -369,7 +356,6 @@ public FunctionV1 logoUrl(String logoUrl) { * @return logoUrl */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL of the logo for this Function.") public String getLogoUrl() { return logoUrl; } @@ -390,7 +376,6 @@ public FunctionV1 previewWebhookUrl(String previewWebhookUrl) { * @return previewWebhookUrl */ @javax.annotation.Nullable - @ApiModelProperty(value = "The preview webhook URL for this Function.") public String getPreviewWebhookUrl() { return previewWebhookUrl; } @@ -411,7 +396,6 @@ public FunctionV1 batchMaxCount(BigDecimal batchMaxCount) { * @return batchMaxCount */ @javax.annotation.Nullable - @ApiModelProperty(value = "The max count of the batch for this Function.") public BigDecimal getBatchMaxCount() { return batchMaxCount; } @@ -432,7 +416,6 @@ public FunctionV1 catalogId(String catalogId) { * @return catalogId */ @javax.annotation.Nullable - @ApiModelProperty(value = "The catalog id of this Function.") public String getCatalogId() { return catalogId; } @@ -453,7 +436,6 @@ public FunctionV1 isLatestVersion(Boolean isLatestVersion) { * @return isLatestVersion */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether the deployment of this Function is the latest version.") public Boolean getIsLatestVersion() { return isLatestVersion; } @@ -583,15 +565,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to FunctionV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FunctionV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!FunctionV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in FunctionV1 is not found in the empty" @@ -600,17 +582,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!FunctionV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `FunctionV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -670,6 +653,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("settings").toString())); } + + // validate the optional field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + FunctionSettingV1.validateJsonElement(jsonArraysettings.get(i)); + } + ; } } if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) @@ -736,9 +725,9 @@ public void write(JsonWriter out, FunctionV1 value) throws IOException { @Override public FunctionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java index 2895f2e6..3f2b1428 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctions200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public GenerateUploadURLForEdgeFunctions200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GenerateUploadURLForEdgeFunctionsAlphaOutput getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GenerateUploadURLForEdgeFunctions200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GenerateUploadURLForEdgeFunctions200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,9 +128,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GenerateUploadURLForEdgeFunctions200Response.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -141,9 +138,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `GenerateUploadURLForEdgeFunctions200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GenerateUploadURLForEdgeFunctionsAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +176,9 @@ public void write( @Override public GenerateUploadURLForEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java index d95c3415..c6a0b3d6 100644 --- a/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GenerateUploadURLForEdgeFunctionsAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Output for GenerateSignedUrl. */ -@ApiModel(description = "Output for GenerateSignedUrl.") public class GenerateUploadURLForEdgeFunctionsAlphaOutput { public static final String SERIALIZED_NAME_UPLOAD_U_R_L = "uploadURL"; @@ -52,11 +48,6 @@ public GenerateUploadURLForEdgeFunctionsAlphaOutput uploadURL(String uploadURL) * @return uploadURL */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "A temporary URL that can be used to upload your Edge Functions bundle. Expires" - + " in 15 minutes.") public String getUploadURL() { return uploadURL; } @@ -118,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GenerateUploadURLForEdgeFunctionsAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -138,9 +129,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -148,20 +139,21 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `GenerateUploadURLForEdgeFunctionsAlphaOutput` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GenerateUploadURLForEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("uploadURL").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -199,9 +191,9 @@ public void write( @Override public GenerateUploadURLForEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java index 06b67556..d8703f24 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public GetAdvancedSyncScheduleFromWarehouse200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetAdvancedSyncScheduleFromWarehouseV1Output getData() { return data; } @@ -112,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetAdvancedSyncScheduleFromWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetAdvancedSyncScheduleFromWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -133,9 +130,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetAdvancedSyncScheduleFromWarehouse200Response.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -143,9 +140,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `GetAdvancedSyncScheduleFromWarehouse200Response`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAdvancedSyncScheduleFromWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -177,9 +179,9 @@ public void write( @Override public GetAdvancedSyncScheduleFromWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java index 3b5ae269..975eb4d2 100644 --- a/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetAdvancedSyncScheduleFromWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the advanced sync schedule for a Warehouse. */ -@ApiModel(description = "Returns the advanced sync schedule for a Warehouse.") public class GetAdvancedSyncScheduleFromWarehouseV1Output { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @@ -41,7 +37,7 @@ public class GetAdvancedSyncScheduleFromWarehouseV1Output { public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; @SerializedName(SERIALIZED_NAME_SCHEDULE) - private Schedule schedule; + private AdvancedWarehouseSyncScheduleV1Output schedule; public GetAdvancedSyncScheduleFromWarehouseV1Output() {} @@ -57,9 +53,6 @@ public GetAdvancedSyncScheduleFromWarehouseV1Output enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Indicates if an advanced sync schedule is enabled for this Warehouse.") public Boolean getEnabled() { return enabled; } @@ -68,7 +61,8 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public GetAdvancedSyncScheduleFromWarehouseV1Output schedule(Schedule schedule) { + public GetAdvancedSyncScheduleFromWarehouseV1Output schedule( + AdvancedWarehouseSyncScheduleV1Output schedule) { this.schedule = schedule; return this; @@ -80,12 +74,11 @@ public GetAdvancedSyncScheduleFromWarehouseV1Output schedule(Schedule schedule) * @return schedule */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Schedule getSchedule() { + public AdvancedWarehouseSyncScheduleV1Output getSchedule() { return schedule; } - public void setSchedule(Schedule schedule) { + public void setSchedule(AdvancedWarehouseSyncScheduleV1Output schedule) { this.schedule = schedule; } @@ -145,16 +138,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetAdvancedSyncScheduleFromWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -165,9 +158,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetAdvancedSyncScheduleFromWarehouseV1Output.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -175,20 +168,25 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `GetAdvancedSyncScheduleFromWarehouseV1Output` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetAdvancedSyncScheduleFromWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `schedule` + if (jsonObj.get("schedule") != null && !jsonObj.get("schedule").isJsonNull()) { + AdvancedWarehouseSyncScheduleV1Output.validateJsonElement(jsonObj.get("schedule")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -219,9 +217,9 @@ public void write( @Override public GetAdvancedSyncScheduleFromWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java index fb719310..3da9de43 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetAudience200Response data(GetAudienceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetAudienceAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetAudience200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetAudience200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetAudience200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetAudience200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetAudience200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetAudience200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAudienceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, GetAudience200Response value) @Override public GetAudience200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 425598b3..39d7a1cc 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Audience output for update. */ -@ApiModel(description = "Audience output for update.") public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private Audience audience; + private AudienceSummary audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(Audience audience) { + public GetAudienceAlphaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -52,12 +48,11 @@ public GetAudienceAlphaOutput audience(Audience audience) { * @return audience */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Audience getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(Audience audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetAudienceAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetAudienceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetAudienceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetAudienceAlphaOutput is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetAudienceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetAudienceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetAudienceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audience` + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetAudienceAlphaOutput value) @Override public GetAudienceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java index e66b7d4c..7444d45a 100644 --- a/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetComputedTrait200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetComputedTrait200Response data(GetComputedTraitAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetComputedTraitAlphaOutput getData() { return data; } @@ -109,15 +106,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetComputedTrait200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetComputedTrait200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetComputedTrait200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetComputedTrait200Response is not" @@ -126,17 +124,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetComputedTrait200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetComputedTrait200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetComputedTraitAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +165,9 @@ public void write(JsonWriter out, GetComputedTrait200Response value) @Override public GetComputedTrait200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java index 2940b617..78d2e5ae 100644 --- a/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetComputedTraitAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Computed Trait output for get and update. */ -@ApiModel(description = "Computed Trait output for get and update.") public class GetComputedTraitAlphaOutput { public static final String SERIALIZED_NAME_COMPUTED_TRAIT = "computedTrait"; @SerializedName(SERIALIZED_NAME_COMPUTED_TRAIT) - private ComputedTrait computedTrait; + private ComputedTraitSummary computedTrait; public GetComputedTraitAlphaOutput() {} - public GetComputedTraitAlphaOutput computedTrait(ComputedTrait computedTrait) { + public GetComputedTraitAlphaOutput computedTrait(ComputedTraitSummary computedTrait) { this.computedTrait = computedTrait; return this; @@ -52,12 +48,11 @@ public GetComputedTraitAlphaOutput computedTrait(ComputedTrait computedTrait) { * @return computedTrait */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public ComputedTrait getComputedTrait() { + public ComputedTraitSummary getComputedTrait() { return computedTrait; } - public void setComputedTrait(ComputedTrait computedTrait) { + public void setComputedTrait(ComputedTraitSummary computedTrait) { this.computedTrait = computedTrait; } @@ -112,15 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetComputedTraitAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetComputedTraitAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetComputedTraitAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetComputedTraitAlphaOutput is not" @@ -129,27 +125,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetComputedTraitAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetComputedTraitAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetComputedTraitAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `computedTrait` + ComputedTraitSummary.validateJsonElement(jsonObj.get("computedTrait")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +174,9 @@ public void write(JsonWriter out, GetComputedTraitAlphaOutput value) @Override public GetComputedTraitAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java index de27e86d..7e3e1625 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public GetConnectionStateFromWarehouse200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetConnectionStateFromWarehouseV1Output getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetConnectionStateFromWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetConnectionStateFromWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,9 +128,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetConnectionStateFromWarehouse200Response.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( @@ -141,9 +138,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { "The field `%s` in the JSON string is not defined in the" + " `GetConnectionStateFromWarehouse200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetConnectionStateFromWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -173,9 +175,9 @@ public void write( @Override public GetConnectionStateFromWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java index 375eb53b..d75679e6 100644 --- a/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetConnectionStateFromWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,19 +22,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the status of a Warehouse connection settings after an attempt to connect to it. */ -@ApiModel( - description = - "Returns the status of a Warehouse connection settings after an attempt to connect" - + " to it.") public class GetConnectionStateFromWarehouseV1Output { /** Represents the status for the current connection settings. */ @JsonAdapter(ConnectionStateEnum.Adapter.class) @@ -103,9 +96,6 @@ public GetConnectionStateFromWarehouseV1Output connectionState( * @return connectionState */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Represents the status for the current connection settings.") public ConnectionStateEnum getConnectionState() { return connectionState; } @@ -167,16 +157,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetConnectionStateFromWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetConnectionStateFromWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -187,28 +177,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetConnectionStateFromWarehouseV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetConnectionStateFromWarehouseV1Output` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetConnectionStateFromWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("connectionState").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -245,9 +236,9 @@ public void write( @Override public GetConnectionStateFromWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java index 8b95688c..862ea102 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsage200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public GetDailyPerSourceAPICallsUsage200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDailyPerSourceAPICallsUsageV1Output getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyPerSourceAPICallsUsage200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyPerSourceAPICallsUsage200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,18 +128,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyPerSourceAPICallsUsage200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyPerSourceAPICallsUsage200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDailyPerSourceAPICallsUsageV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -172,9 +174,9 @@ public void write( @Override public GetDailyPerSourceAPICallsUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java index bfe0632a..c2646498 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceAPICallsUsageV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of daily aggregations of Source level API calls counts. */ -@ApiModel(description = "Returns a list of daily aggregations of Source level API calls counts.") public class GetDailyPerSourceAPICallsUsageV1Output { public static final String SERIALIZED_NAME_DAILY_PER_SOURCE_A_P_I_CALLS_USAGE = "dailyPerSourceAPICallsUsage"; @@ -45,7 +41,7 @@ public class GetDailyPerSourceAPICallsUsageV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetDailyPerSourceAPICallsUsageV1Output() {} @@ -58,6 +54,9 @@ public GetDailyPerSourceAPICallsUsageV1Output dailyPerSourceAPICallsUsage( public GetDailyPerSourceAPICallsUsageV1Output addDailyPerSourceAPICallsUsageItem( SourceAPICallSnapshotV1 dailyPerSourceAPICallsUsageItem) { + if (this.dailyPerSourceAPICallsUsage == null) { + this.dailyPerSourceAPICallsUsage = new ArrayList<>(); + } this.dailyPerSourceAPICallsUsage.add(dailyPerSourceAPICallsUsageItem); return this; } @@ -68,9 +67,6 @@ public GetDailyPerSourceAPICallsUsageV1Output addDailyPerSourceAPICallsUsageItem * @return dailyPerSourceAPICallsUsage */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The list of daily per Source API calls count aggregates.") public List getDailyPerSourceAPICallsUsage() { return dailyPerSourceAPICallsUsage; } @@ -80,7 +76,7 @@ public void setDailyPerSourceAPICallsUsage( this.dailyPerSourceAPICallsUsage = dailyPerSourceAPICallsUsage; } - public GetDailyPerSourceAPICallsUsageV1Output pagination(Pagination pagination) { + public GetDailyPerSourceAPICallsUsageV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -92,12 +88,11 @@ public GetDailyPerSourceAPICallsUsageV1Output pagination(Pagination pagination) * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -162,16 +157,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyPerSourceAPICallsUsageV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDailyPerSourceAPICallsUsageV1Output" @@ -181,28 +176,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyPerSourceAPICallsUsageV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyPerSourceAPICallsUsageV1Output` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDailyPerSourceAPICallsUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("dailyPerSourceAPICallsUsage").isJsonArray()) { throw new IllegalArgumentException( @@ -214,6 +210,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArraydailyPerSourceAPICallsUsage = jsonObj.getAsJsonArray("dailyPerSourceAPICallsUsage"); + // validate the required field `dailyPerSourceAPICallsUsage` (array) + for (int i = 0; i < jsonArraydailyPerSourceAPICallsUsage.size(); i++) { + SourceAPICallSnapshotV1.validateJsonElement( + jsonArraydailyPerSourceAPICallsUsage.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -242,9 +246,9 @@ public void write( @Override public GetDailyPerSourceAPICallsUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java index 7a2d4c51..8ed93685 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsage200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetDailyPerSourceMTUUsage200Response data(GetDailyPerSourceMTUUsageV1Outp * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDailyPerSourceMTUUsageV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyPerSourceMTUUsage200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyPerSourceMTUUsage200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDailyPerSourceMTUUsage200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyPerSourceMTUUsage200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyPerSourceMTUUsage200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDailyPerSourceMTUUsageV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public GetDailyPerSourceMTUUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java index 6165cdb1..9cd02320 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyPerSourceMTUUsageV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of daily aggregations of Source level MTU counts. */ -@ApiModel(description = "Returns a list of daily aggregations of Source level MTU counts.") public class GetDailyPerSourceMTUUsageV1Output { public static final String SERIALIZED_NAME_DAILY_PER_SOURCE_M_T_U_USAGE = "dailyPerSourceMTUUsage"; @@ -45,7 +41,7 @@ public class GetDailyPerSourceMTUUsageV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetDailyPerSourceMTUUsageV1Output() {} @@ -58,6 +54,9 @@ public GetDailyPerSourceMTUUsageV1Output dailyPerSourceMTUUsage( public GetDailyPerSourceMTUUsageV1Output addDailyPerSourceMTUUsageItem( UsersPerSourceSnapshotV1 dailyPerSourceMTUUsageItem) { + if (this.dailyPerSourceMTUUsage == null) { + this.dailyPerSourceMTUUsage = new ArrayList<>(); + } this.dailyPerSourceMTUUsage.add(dailyPerSourceMTUUsageItem); return this; } @@ -68,7 +67,6 @@ public GetDailyPerSourceMTUUsageV1Output addDailyPerSourceMTUUsageItem( * @return dailyPerSourceMTUUsage */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of daily per Source MTU count aggregates.") public List getDailyPerSourceMTUUsage() { return dailyPerSourceMTUUsage; } @@ -77,7 +75,7 @@ public void setDailyPerSourceMTUUsage(List dailyPerSou this.dailyPerSourceMTUUsage = dailyPerSourceMTUUsage; } - public GetDailyPerSourceMTUUsageV1Output pagination(Pagination pagination) { + public GetDailyPerSourceMTUUsageV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -89,12 +87,11 @@ public GetDailyPerSourceMTUUsageV1Output pagination(Pagination pagination) { * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -158,16 +155,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyPerSourceMTUUsageV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDailyPerSourceMTUUsageV1Output is" @@ -177,27 +174,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyPerSourceMTUUsageV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyPerSourceMTUUsageV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDailyPerSourceMTUUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("dailyPerSourceMTUUsage").isJsonArray()) { throw new IllegalArgumentException( @@ -209,6 +207,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArraydailyPerSourceMTUUsage = jsonObj.getAsJsonArray("dailyPerSourceMTUUsage"); + // validate the required field `dailyPerSourceMTUUsage` (array) + for (int i = 0; i < jsonArraydailyPerSourceMTUUsage.size(); i++) { + UsersPerSourceSnapshotV1.validateJsonElement(jsonArraydailyPerSourceMTUUsage.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -236,9 +241,9 @@ public void write(JsonWriter out, GetDailyPerSourceMTUUsageV1Output value) @Override public GetDailyPerSourceMTUUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java index 2a03891a..6ef5d080 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsage200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public GetDailyWorkspaceAPICallsUsage200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDailyWorkspaceAPICallsUsageV1Output getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyWorkspaceAPICallsUsage200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyWorkspaceAPICallsUsage200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,18 +128,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyWorkspaceAPICallsUsage200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyWorkspaceAPICallsUsage200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDailyWorkspaceAPICallsUsageV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -172,9 +174,9 @@ public void write( @Override public GetDailyWorkspaceAPICallsUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java index 0a330153..015a403b 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceAPICallsUsageV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of daily aggregations of Workspace MTU counts. */ -@ApiModel(description = "Returns a list of daily aggregations of Workspace MTU counts.") public class GetDailyWorkspaceAPICallsUsageV1Output { public static final String SERIALIZED_NAME_DAILY_WORKSPACE_A_P_I_CALLS_USAGE = "dailyWorkspaceAPICallsUsage"; @@ -45,7 +41,7 @@ public class GetDailyWorkspaceAPICallsUsageV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetDailyWorkspaceAPICallsUsageV1Output() {} @@ -58,6 +54,9 @@ public GetDailyWorkspaceAPICallsUsageV1Output dailyWorkspaceAPICallsUsage( public GetDailyWorkspaceAPICallsUsageV1Output addDailyWorkspaceAPICallsUsageItem( APICallSnapshotV1 dailyWorkspaceAPICallsUsageItem) { + if (this.dailyWorkspaceAPICallsUsage == null) { + this.dailyWorkspaceAPICallsUsage = new ArrayList<>(); + } this.dailyWorkspaceAPICallsUsage.add(dailyWorkspaceAPICallsUsageItem); return this; } @@ -68,9 +67,6 @@ public GetDailyWorkspaceAPICallsUsageV1Output addDailyWorkspaceAPICallsUsageItem * @return dailyWorkspaceAPICallsUsage */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The list of daily Workspace API calls count aggregates.") public List getDailyWorkspaceAPICallsUsage() { return dailyWorkspaceAPICallsUsage; } @@ -80,7 +76,7 @@ public void setDailyWorkspaceAPICallsUsage( this.dailyWorkspaceAPICallsUsage = dailyWorkspaceAPICallsUsage; } - public GetDailyWorkspaceAPICallsUsageV1Output pagination(Pagination pagination) { + public GetDailyWorkspaceAPICallsUsageV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -92,12 +88,11 @@ public GetDailyWorkspaceAPICallsUsageV1Output pagination(Pagination pagination) * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -162,16 +157,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyWorkspaceAPICallsUsageV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDailyWorkspaceAPICallsUsageV1Output" @@ -181,28 +176,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyWorkspaceAPICallsUsageV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyWorkspaceAPICallsUsageV1Output` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDailyWorkspaceAPICallsUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("dailyWorkspaceAPICallsUsage").isJsonArray()) { throw new IllegalArgumentException( @@ -214,6 +210,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArraydailyWorkspaceAPICallsUsage = jsonObj.getAsJsonArray("dailyWorkspaceAPICallsUsage"); + // validate the required field `dailyWorkspaceAPICallsUsage` (array) + for (int i = 0; i < jsonArraydailyWorkspaceAPICallsUsage.size(); i++) { + APICallSnapshotV1.validateJsonElement(jsonArraydailyWorkspaceAPICallsUsage.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -242,9 +245,9 @@ public void write( @Override public GetDailyWorkspaceAPICallsUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java index 17ca7e58..6516f5de 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsage200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetDailyWorkspaceMTUUsage200Response data(GetDailyWorkspaceMTUUsageV1Outp * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDailyWorkspaceMTUUsageV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyWorkspaceMTUUsage200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyWorkspaceMTUUsage200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDailyWorkspaceMTUUsage200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyWorkspaceMTUUsage200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyWorkspaceMTUUsage200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDailyWorkspaceMTUUsageV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public GetDailyWorkspaceMTUUsage200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java index 134e3b03..3aa8620c 100644 --- a/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDailyWorkspaceMTUUsageV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of daily aggregations of Workspace MTU counts. */ -@ApiModel(description = "Returns a list of daily aggregations of Workspace MTU counts.") public class GetDailyWorkspaceMTUUsageV1Output { public static final String SERIALIZED_NAME_DAILY_WORKSPACE_M_T_U_USAGE = "dailyWorkspaceMTUUsage"; @@ -45,7 +41,7 @@ public class GetDailyWorkspaceMTUUsageV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetDailyWorkspaceMTUUsageV1Output() {} @@ -58,6 +54,9 @@ public GetDailyWorkspaceMTUUsageV1Output dailyWorkspaceMTUUsage( public GetDailyWorkspaceMTUUsageV1Output addDailyWorkspaceMTUUsageItem( MtuSnapshotV1 dailyWorkspaceMTUUsageItem) { + if (this.dailyWorkspaceMTUUsage == null) { + this.dailyWorkspaceMTUUsage = new ArrayList<>(); + } this.dailyWorkspaceMTUUsage.add(dailyWorkspaceMTUUsageItem); return this; } @@ -68,7 +67,6 @@ public GetDailyWorkspaceMTUUsageV1Output addDailyWorkspaceMTUUsageItem( * @return dailyWorkspaceMTUUsage */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The list of daily Workspace MTU count aggregates.") public List getDailyWorkspaceMTUUsage() { return dailyWorkspaceMTUUsage; } @@ -77,7 +75,7 @@ public void setDailyWorkspaceMTUUsage(List dailyWorkspaceMTUUsage this.dailyWorkspaceMTUUsage = dailyWorkspaceMTUUsage; } - public GetDailyWorkspaceMTUUsageV1Output pagination(Pagination pagination) { + public GetDailyWorkspaceMTUUsageV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -89,12 +87,11 @@ public GetDailyWorkspaceMTUUsageV1Output pagination(Pagination pagination) { * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -158,16 +155,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDailyWorkspaceMTUUsageV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDailyWorkspaceMTUUsageV1Output is" @@ -177,27 +174,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDailyWorkspaceMTUUsageV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDailyWorkspaceMTUUsageV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDailyWorkspaceMTUUsageV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("dailyWorkspaceMTUUsage").isJsonArray()) { throw new IllegalArgumentException( @@ -209,6 +207,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { JsonArray jsonArraydailyWorkspaceMTUUsage = jsonObj.getAsJsonArray("dailyWorkspaceMTUUsage"); + // validate the required field `dailyWorkspaceMTUUsage` (array) + for (int i = 0; i < jsonArraydailyWorkspaceMTUUsage.size(); i++) { + MtuSnapshotV1.validateJsonElement(jsonArraydailyWorkspaceMTUUsage.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -236,9 +241,9 @@ public void write(JsonWriter out, GetDailyWorkspaceMTUUsageV1Output value) @Override public GetDailyWorkspaceMTUUsageV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java index 3c7a9f62..ef280676 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestination200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetDestination200Response data(GetDestinationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDestinationV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestination200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetDestination200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDestination200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDestination200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDestination200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDestination200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDestinationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, GetDestination200Response value) @Override public GetDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java index 3e367243..4a969ff9 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadata200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetDestinationMetadata200Response data(GetDestinationMetadataV1Output dat * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDestinationMetadataV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDestinationMetadata200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDestinationMetadata200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDestinationMetadata200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDestinationMetadata200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDestinationMetadata200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDestinationMetadataV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, GetDestinationMetadata200Response value) @Override public GetDestinationMetadata200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java index 05203813..6bc88da2 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationMetadataV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,26 +21,23 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a Destination catalog item. */ -@ApiModel(description = "Returns a Destination catalog item.") public class GetDestinationMetadataV1Output { public static final String SERIALIZED_NAME_DESTINATION_METADATA = "destinationMetadata"; @SerializedName(SERIALIZED_NAME_DESTINATION_METADATA) - private DestinationMetadata destinationMetadata; + private DestinationMetadataV1 destinationMetadata; public GetDestinationMetadataV1Output() {} public GetDestinationMetadataV1Output destinationMetadata( - DestinationMetadata destinationMetadata) { + DestinationMetadataV1 destinationMetadata) { this.destinationMetadata = destinationMetadata; return this; @@ -53,12 +49,11 @@ public GetDestinationMetadataV1Output destinationMetadata( * @return destinationMetadata */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public DestinationMetadata getDestinationMetadata() { + public DestinationMetadataV1 getDestinationMetadata() { return destinationMetadata; } - public void setDestinationMetadata(DestinationMetadata destinationMetadata) { + public void setDestinationMetadata(DestinationMetadataV1 destinationMetadata) { this.destinationMetadata = destinationMetadata; } @@ -117,16 +112,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDestinationMetadataV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDestinationMetadataV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDestinationMetadataV1Output is not" @@ -135,27 +130,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDestinationMetadataV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDestinationMetadataV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDestinationMetadataV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `destinationMetadata` + DestinationMetadataV1.validateJsonElement(jsonObj.get("destinationMetadata")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -183,9 +181,9 @@ public void write(JsonWriter out, GetDestinationMetadataV1Output value) @Override public GetDestinationMetadataV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java index 310066ce..9f490d43 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a single Destination by its id. */ -@ApiModel(description = "Returns a single Destination by its id.") public class GetDestinationV1Output { public static final String SERIALIZED_NAME_DESTINATION = "destination"; @SerializedName(SERIALIZED_NAME_DESTINATION) - private Destination destination; + private DestinationV1 destination; public GetDestinationV1Output() {} - public GetDestinationV1Output destination(Destination destination) { + public GetDestinationV1Output destination(DestinationV1 destination) { this.destination = destination; return this; @@ -52,12 +48,11 @@ public GetDestinationV1Output destination(Destination destination) { * @return destination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Destination getDestination() { + public DestinationV1 getDestination() { return destination; } - public void setDestination(Destination destination) { + public void setDestination(DestinationV1 destination) { this.destination = destination; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetDestinationV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetDestinationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDestinationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDestinationV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDestinationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDestinationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `destination` + DestinationV1.validateJsonElement(jsonObj.get("destination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetDestinationV1Output value) @Override public GetDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java index c434bd56..df62a2e3 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalog200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetDestinationsCatalog200Response data(GetDestinationsCatalogV1Output dat * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetDestinationsCatalogV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDestinationsCatalog200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDestinationsCatalog200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDestinationsCatalog200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDestinationsCatalog200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDestinationsCatalog200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetDestinationsCatalogV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, GetDestinationsCatalog200Response value) @Override public GetDestinationsCatalog200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java index 788d04fc..0a48727d 100644 --- a/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetDestinationsCatalogV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,20 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of all Destination catalog items contained within a given page. */ -@ApiModel( - description = - "Returns a list of all Destination catalog items contained within a given page.") public class GetDestinationsCatalogV1Output { public static final String SERIALIZED_NAME_DESTINATIONS_CATALOG = "destinationsCatalog"; @@ -46,7 +40,7 @@ public class GetDestinationsCatalogV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetDestinationsCatalogV1Output() {} @@ -59,6 +53,9 @@ public GetDestinationsCatalogV1Output destinationsCatalog( public GetDestinationsCatalogV1Output addDestinationsCatalogItem( DestinationMetadataV1 destinationsCatalogItem) { + if (this.destinationsCatalog == null) { + this.destinationsCatalog = new ArrayList<>(); + } this.destinationsCatalog.add(destinationsCatalogItem); return this; } @@ -69,9 +66,6 @@ public GetDestinationsCatalogV1Output addDestinationsCatalogItem( * @return destinationsCatalog */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "All Destination catalog items contained within the requested page.") public List getDestinationsCatalog() { return destinationsCatalog; } @@ -80,7 +74,7 @@ public void setDestinationsCatalog(List destinationsCatal this.destinationsCatalog = destinationsCatalog; } - public GetDestinationsCatalogV1Output pagination(Pagination pagination) { + public GetDestinationsCatalogV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -92,12 +86,11 @@ public GetDestinationsCatalogV1Output pagination(Pagination pagination) { * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -161,16 +154,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetDestinationsCatalogV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetDestinationsCatalogV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetDestinationsCatalogV1Output is not" @@ -179,27 +172,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetDestinationsCatalogV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetDestinationsCatalogV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetDestinationsCatalogV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("destinationsCatalog").isJsonArray()) { throw new IllegalArgumentException( @@ -210,6 +204,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraydestinationsCatalog = jsonObj.getAsJsonArray("destinationsCatalog"); + // validate the required field `destinationsCatalog` (array) + for (int i = 0; i < jsonArraydestinationsCatalog.size(); i++) { + DestinationMetadataV1.validateJsonElement(jsonArraydestinationsCatalog.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -237,9 +238,9 @@ public void write(JsonWriter out, GetDestinationsCatalogV1Output value) @Override public GetDestinationsCatalogV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java index 5aa6c994..f346ef8d 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspace200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetEventsVolumeFromWorkspace200Response data(GetEventsVolumeFromWorkspace * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetEventsVolumeFromWorkspaceV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetEventsVolumeFromWorkspace200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetEventsVolumeFromWorkspace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -130,18 +127,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetEventsVolumeFromWorkspace200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetEventsVolumeFromWorkspace200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetEventsVolumeFromWorkspaceV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -171,9 +173,9 @@ public void write( @Override public GetEventsVolumeFromWorkspace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java index 20ee1334..69d5a9f1 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,21 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** GetEventsVolumeFromWorkspaceV1Output represents the results given the input query. */ -@ApiModel( - description = - "GetEventsVolumeFromWorkspaceV1Output represents the results given the input" - + " query.") public class GetEventsVolumeFromWorkspaceV1Output { public static final String SERIALIZED_NAME_PATH = "path"; @@ -47,7 +40,7 @@ public class GetEventsVolumeFromWorkspaceV1Output { public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) - private Query query; + private GetEventsVolumeFromWorkspaceV1Query query; public static final String SERIALIZED_NAME_RESULT = "result"; @@ -57,7 +50,7 @@ public class GetEventsVolumeFromWorkspaceV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetEventsVolumeFromWorkspaceV1Output() {} @@ -73,7 +66,6 @@ public GetEventsVolumeFromWorkspaceV1Output path(String path) { * @return path */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Observability event volume path.") public String getPath() { return path; } @@ -82,7 +74,7 @@ public void setPath(String path) { this.path = path; } - public GetEventsVolumeFromWorkspaceV1Output query(Query query) { + public GetEventsVolumeFromWorkspaceV1Output query(GetEventsVolumeFromWorkspaceV1Query query) { this.query = query; return this; @@ -94,12 +86,11 @@ public GetEventsVolumeFromWorkspaceV1Output query(Query query) { * @return query */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Query getQuery() { + public GetEventsVolumeFromWorkspaceV1Query getQuery() { return query; } - public void setQuery(Query query) { + public void setQuery(GetEventsVolumeFromWorkspaceV1Query query) { this.query = query; } @@ -110,6 +101,9 @@ public GetEventsVolumeFromWorkspaceV1Output result(List res } public GetEventsVolumeFromWorkspaceV1Output addResultItem(SourceEventVolumeV1 resultItem) { + if (this.result == null) { + this.result = new ArrayList<>(); + } this.result.add(resultItem); return this; } @@ -122,12 +116,6 @@ public GetEventsVolumeFromWorkspaceV1Output addResultItem(SourceEventVolumeV1 re * @return result */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "The resultant list of series broken down by the dimensions requested over the" - + " time frame requested and ordered by the total count of events in all" - + " series. Note: The limit of entries returned is 5000.") public List getResult() { return result; } @@ -136,7 +124,7 @@ public void setResult(List result) { this.result = result; } - public GetEventsVolumeFromWorkspaceV1Output pagination(Pagination pagination) { + public GetEventsVolumeFromWorkspaceV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -148,12 +136,11 @@ public GetEventsVolumeFromWorkspaceV1Output pagination(Pagination pagination) { * @return pagination */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -220,16 +207,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetEventsVolumeFromWorkspaceV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetEventsVolumeFromWorkspaceV1Output" @@ -239,28 +226,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetEventsVolumeFromWorkspaceV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetEventsVolumeFromWorkspaceV1Output` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetEventsVolumeFromWorkspaceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("path").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -268,6 +256,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("path").toString())); } + // validate the required field `query` + GetEventsVolumeFromWorkspaceV1Query.validateJsonElement(jsonObj.get("query")); // ensure the json data is an array if (!jsonObj.get("result").isJsonArray()) { throw new IllegalArgumentException( @@ -278,6 +268,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayresult = jsonObj.getAsJsonArray("result"); + // validate the required field `result` (array) + for (int i = 0; i < jsonArrayresult.size(); i++) { + SourceEventVolumeV1.validateJsonElement(jsonArrayresult.get(i)); + } + ; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -306,9 +305,9 @@ public void write( @Override public GetEventsVolumeFromWorkspaceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java index aa3b33fa..839b6689 100644 --- a/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java +++ b/src/main/java/com/segment/publicapi/models/GetEventsVolumeFromWorkspaceV1Query.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,19 +22,16 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** GetEventVolumeOutputQuery represents the input query sent to output. */ -@ApiModel(description = "GetEventVolumeOutputQuery represents the input query sent to output.") public class GetEventsVolumeFromWorkspaceV1Query { public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; @@ -108,27 +104,27 @@ public GranularityEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_GROUP_BY = "groupBy"; @SerializedName(SERIALIZED_NAME_GROUP_BY) - private List groupBy = null; + private List groupBy; public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private List sourceId = null; + private List sourceId; public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; @SerializedName(SERIALIZED_NAME_EVENT_NAME) - private List eventName = null; + private List eventName; public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) - private List eventType = null; + private List eventType; public static final String SERIALIZED_NAME_APP_VERSION = "appVersion"; @SerializedName(SERIALIZED_NAME_APP_VERSION) - private List appVersion = null; + private List appVersion; public static final String SERIALIZED_NAME_LIMIT = "limit"; @@ -149,7 +145,6 @@ public GetEventsVolumeFromWorkspaceV1Query workspaceId(String workspaceId) { * @return workspaceId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Workspace being requested.") public String getWorkspaceId() { return workspaceId; } @@ -170,9 +165,6 @@ public GetEventsVolumeFromWorkspaceV1Query granularity(GranularityEnum granulari * @return granularity */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Granularity corresponds to the requested bucket granularity.") public GranularityEnum getGranularity() { return granularity; } @@ -194,11 +186,6 @@ public GetEventsVolumeFromWorkspaceV1Query startTime(String startTime) { * @return startTime */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "StartTime is the ISO8601 formatted timestamp corresponding to the beginning of" - + " the requested time frame, inclusive.") public String getStartTime() { return startTime; } @@ -220,11 +207,6 @@ public GetEventsVolumeFromWorkspaceV1Query endTime(String endTime) { * @return endTime */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "EndTime is the ISO8601 formatted timestamp corresponding to the end of the" - + " requested time frame, noninclusive.") public String getEndTime() { return endTime; } @@ -254,11 +236,6 @@ public GetEventsVolumeFromWorkspaceV1Query addGroupByItem(String groupByItem) { * @return groupBy */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "GroupBy is a comma-delimited list of strings representing the dimensions to" - + " group the result by. The current options are: `eventName` or" - + " `eventType`.") public List getGroupBy() { return groupBy; } @@ -287,10 +264,6 @@ public GetEventsVolumeFromWorkspaceV1Query addSourceIdItem(String sourceIdItem) * @return sourceId */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "List of strings which allow you to restrict the result to just the given" - + " Sources.") public List getSourceId() { return sourceId; } @@ -320,10 +293,6 @@ public GetEventsVolumeFromWorkspaceV1Query addEventNameItem(String eventNameItem * @return eventName */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "EventName is a list of strings which allow you to restrict the result to just" - + " the given event names.") public List getEventName() { return eventName; } @@ -353,10 +322,6 @@ public GetEventsVolumeFromWorkspaceV1Query addEventTypeItem(String eventTypeItem * @return eventType */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "EventType is a list of strings which allow you to restrict the result to just" - + " the given event types.") public List getEventType() { return eventType; } @@ -386,10 +351,6 @@ public GetEventsVolumeFromWorkspaceV1Query addAppVersionItem(String appVersionIt * @return appVersion */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "AppVersion is a list of strings which allow you to restrict the result to just" - + " the given application versions.") public List getAppVersion() { return appVersion; } @@ -410,7 +371,6 @@ public GetEventsVolumeFromWorkspaceV1Query limit(BigDecimal limit) { * @return limit */ @javax.annotation.Nullable - @ApiModelProperty(value = "Limit is the total number of items in the result.") public BigDecimal getLimit() { return limit; } @@ -511,16 +471,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetEventsVolumeFromWorkspaceV1Query */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetEventsVolumeFromWorkspaceV1Query is" @@ -530,27 +490,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetEventsVolumeFromWorkspaceV1Query.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetEventsVolumeFromWorkspaceV1Query` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetEventsVolumeFromWorkspaceV1Query.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("workspaceId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -580,7 +541,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { jsonObj.get("endTime").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("groupBy") != null && !jsonObj.get("groupBy").isJsonArray()) { + if (jsonObj.get("groupBy") != null + && !jsonObj.get("groupBy").isJsonNull() + && !jsonObj.get("groupBy").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `groupBy` to be an array in the JSON string but got" @@ -588,7 +551,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { jsonObj.get("groupBy").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonArray()) { + if (jsonObj.get("sourceId") != null + && !jsonObj.get("sourceId").isJsonNull() + && !jsonObj.get("sourceId").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `sourceId` to be an array in the JSON string but" @@ -596,7 +561,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { jsonObj.get("sourceId").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("eventName") != null && !jsonObj.get("eventName").isJsonArray()) { + if (jsonObj.get("eventName") != null + && !jsonObj.get("eventName").isJsonNull() + && !jsonObj.get("eventName").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `eventName` to be an array in the JSON string but" @@ -604,7 +571,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { jsonObj.get("eventName").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("eventType") != null && !jsonObj.get("eventType").isJsonArray()) { + if (jsonObj.get("eventType") != null + && !jsonObj.get("eventType").isJsonNull() + && !jsonObj.get("eventType").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `eventType` to be an array in the JSON string but" @@ -612,7 +581,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { jsonObj.get("eventType").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonArray()) { + if (jsonObj.get("appVersion") != null + && !jsonObj.get("appVersion").isJsonNull() + && !jsonObj.get("appVersion").isJsonArray()) { throw new IllegalArgumentException( String.format( "Expected the field `appVersion` to be an array in the JSON string but" @@ -646,9 +617,9 @@ public void write(JsonWriter out, GetEventsVolumeFromWorkspaceV1Query value) @Override public GetEventsVolumeFromWorkspaceV1Query read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java index 87bfa0da..62adf463 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestination200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetFilterInDestination200Response data(GetFilterInDestinationV1Output dat * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetFilterInDestinationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetFilterInDestination200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetFilterInDestination200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetFilterInDestination200Response is" @@ -129,17 +126,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetFilterInDestination200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetFilterInDestination200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetFilterInDestinationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -167,9 +169,9 @@ public void write(JsonWriter out, GetFilterInDestination200Response value) @Override public GetFilterInDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java index 026b969b..3e24073e 100644 --- a/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFilterInDestinationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Output for GetDestinationFiltersV1. */ -@ApiModel(description = "Output for GetDestinationFiltersV1.") public class GetFilterInDestinationV1Output { public static final String SERIALIZED_NAME_FILTER = "filter"; @SerializedName(SERIALIZED_NAME_FILTER) - private Filter1 filter; + private DestinationFilterV1 filter; public GetFilterInDestinationV1Output() {} - public GetFilterInDestinationV1Output filter(Filter1 filter) { + public GetFilterInDestinationV1Output filter(DestinationFilterV1 filter) { this.filter = filter; return this; @@ -52,12 +48,11 @@ public GetFilterInDestinationV1Output filter(Filter1 filter) { * @return filter */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Filter1 getFilter() { + public DestinationFilterV1 getFilter() { return filter; } - public void setFilter(Filter1 filter) { + public void setFilter(DestinationFilterV1 filter) { this.filter = filter; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetFilterInDestinationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetFilterInDestinationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetFilterInDestinationV1Output is not" @@ -131,27 +126,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetFilterInDestinationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetFilterInDestinationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetFilterInDestinationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `filter` + DestinationFilterV1.validateJsonElement(jsonObj.get("filter")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -179,9 +177,9 @@ public void write(JsonWriter out, GetFilterInDestinationV1Output value) @Override public GetFilterInDestinationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java index 544dac87..613e907d 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunction200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunction200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetFunction200Response data(GetFunctionV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetFunctionV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetFunction200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetFunction200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetFunction200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetFunction200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetFunction200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetFunction200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetFunctionV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, GetFunction200Response value) @Override public GetFunction200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 77863757..7eb76e51 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Gets a single Function. */ -@ApiModel(description = "Gets a single Function.") public class GetFunctionV1Output { public static final String SERIALIZED_NAME_FUNCTION = "function"; @@ -52,7 +48,6 @@ public GetFunctionV1Output function(Function function) { * @return function */ @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "") public Function getFunction() { return function; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetFunctionV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetFunctionV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetFunctionV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetFunctionV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetFunctionV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetFunctionV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetFunctionV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `function` + Function.validateJsonElement(jsonObj.get("function")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetFunctionV1Output value) @Override public GetFunctionV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java b/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java index ed8f0f9a..e95497d6 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionVersion200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetFunctionVersion200Response data(GetFunctionVersionAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetFunctionVersionAlphaOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetFunctionVersion200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetFunctionVersion200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetFunctionVersion200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetFunctionVersion200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetFunctionVersion200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetFunctionVersionAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, GetFunctionVersion200Response value) @Override public GetFunctionVersion200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java index 343881ca..95eda8db 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionVersionAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Get Function version output. */ -@ApiModel(description = "Get Function version output.") public class GetFunctionVersionAlphaOutput { public static final String SERIALIZED_NAME_VERSION = "version"; @@ -52,7 +48,6 @@ public GetFunctionVersionAlphaOutput version(Version version) { * @return version */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public Version getVersion() { return version; } @@ -113,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetFunctionVersionAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetFunctionVersionAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetFunctionVersionAlphaOutput is not" @@ -131,27 +126,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetFunctionVersionAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetFunctionVersionAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetFunctionVersionAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `version` + Version.validateJsonElement(jsonObj.get("version")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -179,9 +177,9 @@ public void write(JsonWriter out, GetFunctionVersionAlphaOutput value) @Override public GetFunctionVersionAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java index d4af1202..0922882b 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctions200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetLatestFromEdgeFunctions200Response data(GetLatestFromEdgeFunctionsAlph * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetLatestFromEdgeFunctionsAlphaOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetLatestFromEdgeFunctions200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetLatestFromEdgeFunctions200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetLatestFromEdgeFunctions200Response" @@ -129,18 +126,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetLatestFromEdgeFunctions200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetLatestFromEdgeFunctions200Response` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetLatestFromEdgeFunctionsAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -169,9 +171,9 @@ public void write( @Override public GetLatestFromEdgeFunctions200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java index 214cfe31..7dd7c62b 100644 --- a/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetLatestFromEdgeFunctionsAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Output for GetLatestFromEdgeFunctions. */ -@ApiModel(description = "Output for GetLatestFromEdgeFunctions.") public class GetLatestFromEdgeFunctionsAlphaOutput { public static final String SERIALIZED_NAME_EDGE_FUNCTIONS = "edgeFunctions"; @SerializedName(SERIALIZED_NAME_EDGE_FUNCTIONS) - private EdgeFunctions1 edgeFunctions; + private EdgeFunctionsAlpha edgeFunctions; public GetLatestFromEdgeFunctionsAlphaOutput() {} - public GetLatestFromEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFunctions) { + public GetLatestFromEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctionsAlpha edgeFunctions) { this.edgeFunctions = edgeFunctions; return this; @@ -52,12 +48,11 @@ public GetLatestFromEdgeFunctionsAlphaOutput edgeFunctions(EdgeFunctions1 edgeFu * @return edgeFunctions */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public EdgeFunctions1 getEdgeFunctions() { + public EdgeFunctionsAlpha getEdgeFunctions() { return edgeFunctions; } - public void setEdgeFunctions(EdgeFunctions1 edgeFunctions) { + public void setEdgeFunctions(EdgeFunctionsAlpha edgeFunctions) { this.edgeFunctions = edgeFunctions; } @@ -114,16 +109,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetLatestFromEdgeFunctionsAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetLatestFromEdgeFunctionsAlphaOutput" @@ -133,28 +128,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetLatestFromEdgeFunctionsAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetLatestFromEdgeFunctionsAlphaOutput` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetLatestFromEdgeFunctionsAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `edgeFunctions` + EdgeFunctionsAlpha.validateJsonElement(jsonObj.get("edgeFunctions")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -183,9 +181,9 @@ public void write( @Override public GetLatestFromEdgeFunctionsAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java index 56bd4447..daf72ec8 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionFailureResponse.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,12 +22,11 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -63,7 +61,6 @@ public GetMessagingSubscriptionFailureResponse key(String key) { * @return key */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key is the phone number or email.") public String getKey() { return key; } @@ -84,9 +81,6 @@ public GetMessagingSubscriptionFailureResponse type(String type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "This will be the exact type as given in the request.") public String getType() { return type; } @@ -104,6 +98,9 @@ public GetMessagingSubscriptionFailureResponse errors( public GetMessagingSubscriptionFailureResponse addErrorsItem( MessageSubscriptionResponseError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } this.errors.add(errorsItem); return this; } @@ -114,7 +111,6 @@ public GetMessagingSubscriptionFailureResponse addErrorsItem( * @return errors */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Per key errors, such as validation errors.") public List getErrors() { return errors; } @@ -183,16 +179,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetMessagingSubscriptionFailureResponse */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetMessagingSubscriptionFailureResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -203,28 +199,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetMessagingSubscriptionFailureResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetMessagingSubscriptionFailureResponse` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetMessagingSubscriptionFailureResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("key").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -249,6 +246,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); + // validate the required field `errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + MessageSubscriptionResponseError.validateJsonElement(jsonArrayerrors.get(i)); + } + ; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -278,9 +280,9 @@ public void write( @Override public GetMessagingSubscriptionFailureResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java index 05ac64d3..4e690191 100644 --- a/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java +++ b/src/main/java/com/segment/publicapi/models/GetMessagingSubscriptionSuccessResponse.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -24,12 +23,11 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -156,7 +154,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_GROUPS = "groups"; @SerializedName(SERIALIZED_NAME_GROUPS) - private List groups = null; + private List groups; public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; @@ -177,7 +175,6 @@ public GetMessagingSubscriptionSuccessResponse key(String key) { * @return key */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key is the phone number or email.") public String getKey() { return key; } @@ -198,7 +195,6 @@ public GetMessagingSubscriptionSuccessResponse type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type is communication medium used.") public TypeEnum getType() { return type; } @@ -220,10 +216,6 @@ public GetMessagingSubscriptionSuccessResponse status(StatusEnum status) { * @return status */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The user subscribed, unsubscribed, or on initial status. This is absent if the" - + " phone number or email is not found.") public StatusEnum getStatus() { return status; } @@ -254,7 +246,6 @@ public GetMessagingSubscriptionSuccessResponse addGroupsItem( * @return groups */ @javax.annotation.Nullable - @ApiModelProperty(value = "Optional subscription groups.") public List getGroups() { return groups; } @@ -275,7 +266,6 @@ public GetMessagingSubscriptionSuccessResponse updatedAt(String updatedAt) { * @return updatedAt */ @javax.annotation.Nullable - @ApiModelProperty(value = "The timestamp of this subscription status's last change.") public String getUpdatedAt() { return updatedAt; } @@ -350,16 +340,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetMessagingSubscriptionSuccessResponse */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetMessagingSubscriptionSuccessResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -370,28 +360,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetMessagingSubscriptionSuccessResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetMessagingSubscriptionSuccessResponse` properties. JSON:" + " %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetMessagingSubscriptionSuccessResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("key").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -425,6 +416,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("groups").toString())); } + + // validate the optional field `groups` (array) + for (int i = 0; i < jsonArraygroups.size(); i++) { + GroupSubscriptionStatusResponse.validateJsonElement(jsonArraygroups.get(i)); + } + ; } } if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) @@ -464,9 +461,9 @@ public void write( @Override public GetMessagingSubscriptionSuccessResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java index fdeed139..1fda983a 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetRegulation200Response data(GetRegulationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetRegulationV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetRegulation200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetRegulation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetRegulation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetRegulation200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetRegulation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetRegulation200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetRegulationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, GetRegulation200Response value) @Override public GetRegulation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java index 273b74bf..80c12e82 100644 --- a/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetRegulationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The regulate request returned. */ -@ApiModel(description = "The regulate request returned.") public class GetRegulationV1Output { public static final String SERIALIZED_NAME_REGULATION = "regulation"; @@ -52,7 +48,6 @@ public GetRegulationV1Output regulation(Regulation regulation) { * @return regulation */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public Regulation getRegulation() { return regulation; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetRegulationV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetRegulationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetRegulationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetRegulationV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetRegulationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetRegulationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetRegulationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `regulation` + Regulation.validateJsonElement(jsonObj.get("regulation")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetRegulationV1Output value) @Override public GetRegulationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java b/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java index 02b6574f..f0bb19f5 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetReverseEtlModel200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetReverseEtlModel200Response data(GetReverseEtlModelOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetReverseEtlModelOutput getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetReverseEtlModel200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetReverseEtlModel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetReverseEtlModel200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetReverseEtlModel200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetReverseEtlModel200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetReverseEtlModelOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, GetReverseEtlModel200Response value) @Override public GetReverseEtlModel200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java b/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java index 578dc5c7..f176634c 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetReverseEtlModelOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines the result of getting a Model. */ -@ApiModel(description = "Defines the result of getting a Model.") public class GetReverseEtlModelOutput { public static final String SERIALIZED_NAME_REVERSE_ETL_MODEL = "reverseEtlModel"; @SerializedName(SERIALIZED_NAME_REVERSE_ETL_MODEL) - private ReverseEtlModel1 reverseEtlModel; + private ReverseEtlModel reverseEtlModel; public GetReverseEtlModelOutput() {} - public GetReverseEtlModelOutput reverseEtlModel(ReverseEtlModel1 reverseEtlModel) { + public GetReverseEtlModelOutput reverseEtlModel(ReverseEtlModel reverseEtlModel) { this.reverseEtlModel = reverseEtlModel; return this; @@ -52,12 +48,11 @@ public GetReverseEtlModelOutput reverseEtlModel(ReverseEtlModel1 reverseEtlModel * @return reverseEtlModel */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public ReverseEtlModel1 getReverseEtlModel() { + public ReverseEtlModel getReverseEtlModel() { return reverseEtlModel; } - public void setReverseEtlModel(ReverseEtlModel1 reverseEtlModel) { + public void setReverseEtlModel(ReverseEtlModel reverseEtlModel) { this.reverseEtlModel = reverseEtlModel; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetReverseEtlModelOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetReverseEtlModelOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetReverseEtlModelOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetReverseEtlModelOutput is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetReverseEtlModelOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetReverseEtlModelOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetReverseEtlModelOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `reverseEtlModel` + ReverseEtlModel.validateJsonElement(jsonObj.get("reverseEtlModel")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, GetReverseEtlModelOutput value) @Override public GetReverseEtlModelOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response.java b/src/main/java/com/segment/publicapi/models/GetSource200Response.java index 60e095a6..76bcbc88 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetSource200Response data(GetSourceV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetSourceV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSource200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSource200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSource200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSource200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSource200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSource200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetSourceV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, GetSource200Response value) @Override public GetSource200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java index 2f7373d1..6dea3514 100644 --- a/src/main/java/com/segment/publicapi/models/GetSource200Response1.java +++ b/src/main/java/com/segment/publicapi/models/GetSource200Response1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetSource200Response1 data(GetSourceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetSourceAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSource200Response1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSource200Response1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSource200Response1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSource200Response1 is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSource200Response1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSource200Response1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetSourceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, GetSource200Response1 value) @Override public GetSource200Response1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java index 6dd120ea..cafff03c 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,27 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a Source. */ -@ApiModel(description = "Returns a Source.") public class GetSourceAlphaOutput { public static final String SERIALIZED_NAME_SOURCE = "source"; @SerializedName(SERIALIZED_NAME_SOURCE) - private Source1 source; + private SourceAlpha source; + + public static final String SERIALIZED_NAME_TRACKING_PLAN_ID = "trackingPlanId"; + + @SerializedName(SERIALIZED_NAME_TRACKING_PLAN_ID) + private String trackingPlanId; public GetSourceAlphaOutput() {} - public GetSourceAlphaOutput source(Source1 source) { + public GetSourceAlphaOutput source(SourceAlpha source) { this.source = source; return this; @@ -52,15 +53,34 @@ public GetSourceAlphaOutput source(Source1 source) { * @return source */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Source1 getSource() { + public SourceAlpha getSource() { return source; } - public void setSource(Source1 source) { + public void setSource(SourceAlpha source) { this.source = source; } + public GetSourceAlphaOutput trackingPlanId(String trackingPlanId) { + + this.trackingPlanId = trackingPlanId; + return this; + } + + /** + * The id of the Tracking Plan connected to the Source. + * + * @return trackingPlanId + */ + @javax.annotation.Nullable + public String getTrackingPlanId() { + return trackingPlanId; + } + + public void setTrackingPlanId(String trackingPlanId) { + this.trackingPlanId = trackingPlanId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -70,12 +90,13 @@ public boolean equals(Object o) { return false; } GetSourceAlphaOutput getSourceAlphaOutput = (GetSourceAlphaOutput) o; - return Objects.equals(this.source, getSourceAlphaOutput.source); + return Objects.equals(this.source, getSourceAlphaOutput.source) + && Objects.equals(this.trackingPlanId, getSourceAlphaOutput.trackingPlanId); } @Override public int hashCode() { - return Objects.hash(source); + return Objects.hash(source, trackingPlanId); } @Override @@ -83,6 +104,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GetSourceAlphaOutput {\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" trackingPlanId: ").append(toIndentedString(trackingPlanId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -105,22 +127,24 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("source"); + openapiFields.add("trackingPlanId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("source"); + openapiRequiredFields.add("trackingPlanId"); } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSourceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSourceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSourceAlphaOutput is not found in" @@ -129,27 +153,38 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSourceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSourceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSourceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `source` + SourceAlpha.validateJsonElement(jsonObj.get("source")); + if ((jsonObj.get("trackingPlanId") != null && !jsonObj.get("trackingPlanId").isJsonNull()) + && !jsonObj.get("trackingPlanId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `trackingPlanId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("trackingPlanId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +209,9 @@ public void write(JsonWriter out, GetSourceAlphaOutput value) @Override public GetSourceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java index 2b8118fe..ba20324a 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadata200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetSourceMetadata200Response data(GetSourceMetadataV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetSourceMetadataV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetSourceMetadata200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSourceMetadata200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSourceMetadata200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSourceMetadata200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSourceMetadata200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetSourceMetadataV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -165,9 +167,9 @@ public void write(JsonWriter out, GetSourceMetadata200Response value) @Override public GetSourceMetadata200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java index 9476806e..c2b92441 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceMetadataV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the Source catalog item looked up by id. */ -@ApiModel(description = "Returns the Source catalog item looked up by id.") public class GetSourceMetadataV1Output { public static final String SERIALIZED_NAME_SOURCE_METADATA = "sourceMetadata"; @SerializedName(SERIALIZED_NAME_SOURCE_METADATA) - private SourceMetadata sourceMetadata; + private SourceMetadataV1 sourceMetadata; public GetSourceMetadataV1Output() {} - public GetSourceMetadataV1Output sourceMetadata(SourceMetadata sourceMetadata) { + public GetSourceMetadataV1Output sourceMetadata(SourceMetadataV1 sourceMetadata) { this.sourceMetadata = sourceMetadata; return this; @@ -52,12 +48,11 @@ public GetSourceMetadataV1Output sourceMetadata(SourceMetadata sourceMetadata) { * @return sourceMetadata */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public SourceMetadata getSourceMetadata() { + public SourceMetadataV1 getSourceMetadata() { return sourceMetadata; } - public void setSourceMetadata(SourceMetadata sourceMetadata) { + public void setSourceMetadata(SourceMetadataV1 sourceMetadata) { this.sourceMetadata = sourceMetadata; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceMetadataV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSourceMetadataV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSourceMetadataV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSourceMetadataV1Output is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSourceMetadataV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSourceMetadataV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSourceMetadataV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `sourceMetadata` + SourceMetadataV1.validateJsonElement(jsonObj.get("sourceMetadata")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, GetSourceMetadataV1Output value) @Override public GetSourceMetadataV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java index 5755a188..33bf8ecd 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourceV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a Source. */ -@ApiModel(description = "Returns a Source.") public class GetSourceV1Output { public static final String SERIALIZED_NAME_SOURCE = "source"; @SerializedName(SERIALIZED_NAME_SOURCE) - private Source4 source; + private SourceV1 source; public GetSourceV1Output() {} - public GetSourceV1Output source(Source4 source) { + public GetSourceV1Output source(SourceV1 source) { this.source = source; return this; @@ -52,12 +48,11 @@ public GetSourceV1Output source(Source4 source) { * @return source */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Source4 getSource() { + public SourceV1 getSource() { return source; } - public void setSource(Source4 source) { + public void setSource(SourceV1 source) { this.source = source; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourceV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSourceV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSourceV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSourceV1Output is not found in the" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSourceV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSourceV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSourceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `source` + SourceV1.validateJsonElement(jsonObj.get("source")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetSourceV1Output value) @Override public GetSourceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java index 545b763c..edf451b8 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalog200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetSourcesCatalog200Response data(GetSourcesCatalogV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetSourcesCatalogV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetSourcesCatalog200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSourcesCatalog200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSourcesCatalog200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSourcesCatalog200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSourcesCatalog200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetSourcesCatalogV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -165,9 +167,9 @@ public void write(JsonWriter out, GetSourcesCatalog200Response value) @Override public GetSourcesCatalog200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java index f79c0853..b91e211f 100644 --- a/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetSourcesCatalogV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of all Source catalog items contained within a given page. */ -@ApiModel(description = "Returns a list of all Source catalog items contained within a given page.") public class GetSourcesCatalogV1Output { public static final String SERIALIZED_NAME_SOURCES_CATALOG = "sourcesCatalog"; @@ -44,7 +40,7 @@ public class GetSourcesCatalogV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetSourcesCatalogV1Output() {} @@ -55,6 +51,9 @@ public GetSourcesCatalogV1Output sourcesCatalog(List sourcesCa } public GetSourcesCatalogV1Output addSourcesCatalogItem(SourceMetadataV1 sourcesCatalogItem) { + if (this.sourcesCatalog == null) { + this.sourcesCatalog = new ArrayList<>(); + } this.sourcesCatalog.add(sourcesCatalogItem); return this; } @@ -65,9 +64,6 @@ public GetSourcesCatalogV1Output addSourcesCatalogItem(SourceMetadataV1 sourcesC * @return sourcesCatalog */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "All Source catalog items contained within the requested page.") public List getSourcesCatalog() { return sourcesCatalog; } @@ -76,7 +72,7 @@ public void setSourcesCatalog(List sourcesCatalog) { this.sourcesCatalog = sourcesCatalog; } - public GetSourcesCatalogV1Output pagination(Pagination pagination) { + public GetSourcesCatalogV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -88,12 +84,11 @@ public GetSourcesCatalogV1Output pagination(Pagination pagination) { * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -152,15 +147,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSourcesCatalogV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSourcesCatalogV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSourcesCatalogV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSourcesCatalogV1Output is not found" @@ -169,27 +164,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSourcesCatalogV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSourcesCatalogV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSourcesCatalogV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("sourcesCatalog").isJsonArray()) { throw new IllegalArgumentException( @@ -200,6 +196,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraysourcesCatalog = jsonObj.getAsJsonArray("sourcesCatalog"); + // validate the required field `sourcesCatalog` (array) + for (int i = 0; i < jsonArraysourcesCatalog.size(); i++) { + SourceMetadataV1.validateJsonElement(jsonArraysourcesCatalog.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -225,9 +228,9 @@ public void write(JsonWriter out, GetSourcesCatalogV1Output value) @Override public GetSourcesCatalogV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java index 48da4cb4..6737ad29 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSpace200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetSpace200Response data(GetSpaceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetSpaceAlphaOutput getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSpace200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSpace200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSpace200Response is not found in" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSpace200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSpace200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetSpaceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, GetSpace200Response value) @Override public GetSpace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java index 1fb9ef76..0ed03ea2 100644 --- a/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSpaceAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Response for the getSpaceById endpoint. */ -@ApiModel(description = "Response for the getSpaceById endpoint.") public class GetSpaceAlphaOutput { public static final String SERIALIZED_NAME_SPACE = "space"; @@ -52,7 +48,6 @@ public GetSpaceAlphaOutput space(Space space) { * @return space */ @javax.annotation.Nullable - @ApiModelProperty(required = true, value = "") public Space getSpace() { return space; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSpaceAlphaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSpaceAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSpaceAlphaOutput is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSpaceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSpaceAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `space` + Space.validateJsonElement(jsonObj.get("space")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetSpaceAlphaOutput value) @Override public GetSpaceAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java index 5acade54..300a6899 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestination200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -51,7 +49,6 @@ public GetSubscriptionFromDestination200Response data( * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetSubscriptionFromDestinationAlphaOutput getData() { return data; } @@ -111,16 +108,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetSubscriptionFromDestination200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSubscriptionFromDestination200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -131,18 +128,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSubscriptionFromDestination200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSubscriptionFromDestination200Response` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetSubscriptionFromDestinationAlphaOutput.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -172,9 +174,9 @@ public void write( @Override public GetSubscriptionFromDestination200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java index 5f90146a..11f05dd2 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionFromDestinationAlphaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,23 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a subscription for a given subscription id. */ -@ApiModel(description = "Returns a subscription for a given subscription id.") public class GetSubscriptionFromDestinationAlphaOutput { public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription"; @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) - private Subscription subscription; + private DestinationSubscription subscription; public GetSubscriptionFromDestinationAlphaOutput() {} - public GetSubscriptionFromDestinationAlphaOutput subscription(Subscription subscription) { + public GetSubscriptionFromDestinationAlphaOutput subscription( + DestinationSubscription subscription) { this.subscription = subscription; return this; @@ -52,12 +49,11 @@ public GetSubscriptionFromDestinationAlphaOutput subscription(Subscription subsc * @return subscription */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Subscription getSubscription() { + public DestinationSubscription getSubscription() { return subscription; } - public void setSubscription(Subscription subscription) { + public void setSubscription(DestinationSubscription subscription) { this.subscription = subscription; } @@ -114,16 +110,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetSubscriptionFromDestinationAlphaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" @@ -134,29 +130,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSubscriptionFromDestinationAlphaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSubscriptionFromDestinationAlphaOutput` properties." + " JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSubscriptionFromDestinationAlphaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `subscription` + DestinationSubscription.validateJsonElement(jsonObj.get("subscription")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -186,9 +185,9 @@ public void write( @Override public GetSubscriptionFromDestinationAlphaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java index 7fdeb2c9..56a3c528 100644 --- a/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java +++ b/src/main/java/com/segment/publicapi/models/GetSubscriptionRequest.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,10 +22,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -108,7 +106,6 @@ public GetSubscriptionRequest key(String key) { * @return key */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Key is the phone number or email.") public String getKey() { return key; } @@ -129,7 +126,6 @@ public GetSubscriptionRequest type(TypeEnum type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type is communication medium used.") public TypeEnum getType() { return type; } @@ -193,15 +189,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetSubscriptionRequest + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetSubscriptionRequest */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetSubscriptionRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetSubscriptionRequest is not found in" @@ -210,27 +206,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetSubscriptionRequest.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetSubscriptionRequest` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetSubscriptionRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("key").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -269,9 +266,9 @@ public void write(JsonWriter out, GetSubscriptionRequest value) @Override public GetSubscriptionRequest read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java index 63a56dac..6384876c 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlan200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetTrackingPlan200Response data(GetTrackingPlanV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetTrackingPlanV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTrackingPlan200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetTrackingPlan200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetTrackingPlan200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetTrackingPlan200Response is not" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetTrackingPlan200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetTrackingPlan200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetTrackingPlanV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, GetTrackingPlan200Response value) @Override public GetTrackingPlan200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java index ef7b3edc..b7c3e363 100644 --- a/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTrackingPlanV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Gets a single Tracking Plan. */ -@ApiModel(description = "Gets a single Tracking Plan.") public class GetTrackingPlanV1Output { public static final String SERIALIZED_NAME_TRACKING_PLAN = "trackingPlan"; @SerializedName(SERIALIZED_NAME_TRACKING_PLAN) - private TrackingPlan trackingPlan; + private TrackingPlanV1 trackingPlan; public GetTrackingPlanV1Output() {} - public GetTrackingPlanV1Output trackingPlan(TrackingPlan trackingPlan) { + public GetTrackingPlanV1Output trackingPlan(TrackingPlanV1 trackingPlan) { this.trackingPlan = trackingPlan; return this; @@ -52,12 +48,11 @@ public GetTrackingPlanV1Output trackingPlan(TrackingPlan trackingPlan) { * @return trackingPlan */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public TrackingPlan getTrackingPlan() { + public TrackingPlanV1 getTrackingPlan() { return trackingPlan; } - public void setTrackingPlan(TrackingPlan trackingPlan) { + public void setTrackingPlan(TrackingPlanV1 trackingPlan) { this.trackingPlan = trackingPlan; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTrackingPlanV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetTrackingPlanV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetTrackingPlanV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetTrackingPlanV1Output is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetTrackingPlanV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetTrackingPlanV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetTrackingPlanV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `trackingPlan` + TrackingPlanV1.validateJsonElement(jsonObj.get("trackingPlan")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, GetTrackingPlanV1Output value) @Override public GetTrackingPlanV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java index 937d1985..4938abde 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformation200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetTransformation200Response data(GetTransformationV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetTransformationV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetTransformation200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetTransformation200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetTransformation200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetTransformation200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetTransformation200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetTransformationV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -165,9 +167,9 @@ public void write(JsonWriter out, GetTransformation200Response value) @Override public GetTransformation200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java index adc11270..018d10aa 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The input of Transformation retrieval. */ -@ApiModel(description = "The input of Transformation retrieval.") public class GetTransformationBetaInput { public static final String SERIALIZED_NAME_TRANSFORMATION_ID = "transformationId"; @@ -52,7 +48,6 @@ public GetTransformationBetaInput transformationId(String transformationId) { * @return transformationId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Transformation id.") public String getTransformationId() { return transformationId; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaInput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetTransformationBetaInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetTransformationBetaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetTransformationBetaInput is not" @@ -129,27 +124,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetTransformationBetaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetTransformationBetaInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetTransformationBetaInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("transformationId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -182,9 +178,9 @@ public void write(JsonWriter out, GetTransformationBetaInput value) @Override public GetTransformationBetaInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java index 3942ce53..39840664 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationBetaOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of Transformation retrieval. */ -@ApiModel(description = "The output of Transformation retrieval.") public class GetTransformationBetaOutput { public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation transformation; + private TransformationBeta transformation; public GetTransformationBetaOutput() {} - public GetTransformationBetaOutput transformation(Transformation transformation) { + public GetTransformationBetaOutput transformation(TransformationBeta transformation) { this.transformation = transformation; return this; @@ -52,12 +48,11 @@ public GetTransformationBetaOutput transformation(Transformation transformation) * @return transformation */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation getTransformation() { + public TransformationBeta getTransformation() { return transformation; } - public void setTransformation(Transformation transformation) { + public void setTransformation(TransformationBeta transformation) { this.transformation = transformation; } @@ -112,15 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationBetaOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetTransformationBetaOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetTransformationBetaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetTransformationBetaOutput is not" @@ -129,27 +125,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetTransformationBetaOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetTransformationBetaOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetTransformationBetaOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `transformation` + TransformationBeta.validateJsonElement(jsonObj.get("transformation")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +174,9 @@ public void write(JsonWriter out, GetTransformationBetaOutput value) @Override public GetTransformationBetaOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java index 2990e109..63e3cc2e 100644 --- a/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetTransformationV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** The output of Transformation retrieval. */ -@ApiModel(description = "The output of Transformation retrieval.") public class GetTransformationV1Output { public static final String SERIALIZED_NAME_TRANSFORMATION = "transformation"; @SerializedName(SERIALIZED_NAME_TRANSFORMATION) - private Transformation3 transformation; + private TransformationV1 transformation; public GetTransformationV1Output() {} - public GetTransformationV1Output transformation(Transformation3 transformation) { + public GetTransformationV1Output transformation(TransformationV1 transformation) { this.transformation = transformation; return this; @@ -52,12 +48,11 @@ public GetTransformationV1Output transformation(Transformation3 transformation) * @return transformation */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Transformation3 getTransformation() { + public TransformationV1 getTransformation() { return transformation; } - public void setTransformation(Transformation3 transformation) { + public void setTransformation(TransformationV1 transformation) { this.transformation = transformation; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetTransformationV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetTransformationV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetTransformationV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetTransformationV1Output is not found" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetTransformationV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetTransformationV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetTransformationV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `transformation` + TransformationV1.validateJsonElement(jsonObj.get("transformation")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -175,9 +173,9 @@ public void write(JsonWriter out, GetTransformationV1Output value) @Override public GetTransformationV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetUser200Response.java b/src/main/java/com/segment/publicapi/models/GetUser200Response.java index aa7889e1..562a4dea 100644 --- a/src/main/java/com/segment/publicapi/models/GetUser200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUser200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetUser200Response data(GetUserV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetUserV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUser200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetUser200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetUser200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetUser200Response is not found in the" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetUser200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetUser200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetUserV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -161,9 +163,9 @@ public void write(JsonWriter out, GetUser200Response value) @Override public GetUser200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java index a415949b..37313713 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroup200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetUserGroup200Response data(GetUserGroupV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetUserGroupV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUserGroup200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetUserGroup200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetUserGroup200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetUserGroup200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetUserGroup200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetUserGroup200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetUserGroupV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, GetUserGroup200Response value) @Override public GetUserGroup200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java index 10bc83f3..836a82f1 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserGroupV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a user group with the given id. */ -@ApiModel(description = "Returns a user group with the given id.") public class GetUserGroupV1Output { public static final String SERIALIZED_NAME_USER_GROUP = "userGroup"; @SerializedName(SERIALIZED_NAME_USER_GROUP) - private UserGroup2 userGroup; + private UserGroupV1 userGroup; public GetUserGroupV1Output() {} - public GetUserGroupV1Output userGroup(UserGroup2 userGroup) { + public GetUserGroupV1Output userGroup(UserGroupV1 userGroup) { this.userGroup = userGroup; return this; @@ -52,12 +48,11 @@ public GetUserGroupV1Output userGroup(UserGroup2 userGroup) { * @return userGroup */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public UserGroup2 getUserGroup() { + public UserGroupV1 getUserGroup() { return userGroup; } - public void setUserGroup(UserGroup2 userGroup) { + public void setUserGroup(UserGroupV1 userGroup) { this.userGroup = userGroup; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUserGroupV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetUserGroupV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetUserGroupV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetUserGroupV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetUserGroupV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetUserGroupV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetUserGroupV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `userGroup` + UserGroupV1.validateJsonElement(jsonObj.get("userGroup")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetUserGroupV1Output value) @Override public GetUserGroupV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java index 87b89574..158f9f77 100644 --- a/src/main/java/com/segment/publicapi/models/GetUserV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetUserV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns the user. */ -@ApiModel(description = "Returns the user.") public class GetUserV1Output { public static final String SERIALIZED_NAME_USER = "user"; @SerializedName(SERIALIZED_NAME_USER) - private User user; + private UserV1 user; public GetUserV1Output() {} - public GetUserV1Output user(User user) { + public GetUserV1Output user(UserV1 user) { this.user = user; return this; @@ -52,12 +48,11 @@ public GetUserV1Output user(User user) { * @return user */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public User getUser() { + public UserV1 getUser() { return user; } - public void setUser(User user) { + public void setUser(UserV1 user) { this.user = user; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetUserV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetUserV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetUserV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetUserV1Output is not found in the" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetUserV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetUserV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetUserV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `user` + UserV1.validateJsonElement(jsonObj.get("user")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetUserV1Output value) @Override public GetUserV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java index 24163ca3..7d817e1c 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouse200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetWarehouse200Response data(GetWarehouseV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetWarehouseV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehouse200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetWarehouse200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWarehouse200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWarehouse200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWarehouse200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWarehouse200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetWarehouseV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, GetWarehouse200Response value) @Override public GetWarehouse200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java index d745308a..99e69060 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadata200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetWarehouseMetadata200Response data(GetWarehouseMetadataV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetWarehouseMetadataV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetWarehouseMetadata200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWarehouseMetadata200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWarehouseMetadata200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWarehouseMetadata200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWarehouseMetadata200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetWarehouseMetadataV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, GetWarehouseMetadata200Response value) @Override public GetWarehouseMetadata200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java index 1303fd6a..8518c7d8 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseMetadataV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a Warehouse catalog item looked up by id. */ -@ApiModel(description = "Returns a Warehouse catalog item looked up by id.") public class GetWarehouseMetadataV1Output { public static final String SERIALIZED_NAME_WAREHOUSE_METADATA = "warehouseMetadata"; @SerializedName(SERIALIZED_NAME_WAREHOUSE_METADATA) - private WarehouseMetadata warehouseMetadata; + private WarehouseMetadataV1 warehouseMetadata; public GetWarehouseMetadataV1Output() {} - public GetWarehouseMetadataV1Output warehouseMetadata(WarehouseMetadata warehouseMetadata) { + public GetWarehouseMetadataV1Output warehouseMetadata(WarehouseMetadataV1 warehouseMetadata) { this.warehouseMetadata = warehouseMetadata; return this; @@ -52,12 +48,11 @@ public GetWarehouseMetadataV1Output warehouseMetadata(WarehouseMetadata warehous * @return warehouseMetadata */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public WarehouseMetadata getWarehouseMetadata() { + public WarehouseMetadataV1 getWarehouseMetadata() { return warehouseMetadata; } - public void setWarehouseMetadata(WarehouseMetadata warehouseMetadata) { + public void setWarehouseMetadata(WarehouseMetadataV1 warehouseMetadata) { this.warehouseMetadata = warehouseMetadata; } @@ -116,16 +111,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetWarehouseMetadataV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWarehouseMetadataV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWarehouseMetadataV1Output is not" @@ -134,27 +129,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWarehouseMetadataV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWarehouseMetadataV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetWarehouseMetadataV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `warehouseMetadata` + WarehouseMetadataV1.validateJsonElement(jsonObj.get("warehouseMetadata")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -181,9 +179,9 @@ public void write(JsonWriter out, GetWarehouseMetadataV1Output value) @Override public GetWarehouseMetadataV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java index fa31bb42..b7b336df 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehouseV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a Warehouse. */ -@ApiModel(description = "Returns a Warehouse.") public class GetWarehouseV1Output { public static final String SERIALIZED_NAME_WAREHOUSE = "warehouse"; @SerializedName(SERIALIZED_NAME_WAREHOUSE) - private Warehouse warehouse; + private WarehouseV1 warehouse; public GetWarehouseV1Output() {} - public GetWarehouseV1Output warehouse(Warehouse warehouse) { + public GetWarehouseV1Output warehouse(WarehouseV1 warehouse) { this.warehouse = warehouse; return this; @@ -52,12 +48,11 @@ public GetWarehouseV1Output warehouse(Warehouse warehouse) { * @return warehouse */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Warehouse getWarehouse() { + public WarehouseV1 getWarehouse() { return warehouse; } - public void setWarehouse(Warehouse warehouse) { + public void setWarehouse(WarehouseV1 warehouse) { this.warehouse = warehouse; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWarehouseV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetWarehouseV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWarehouseV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWarehouseV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWarehouseV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWarehouseV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetWarehouseV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `warehouse` + WarehouseV1.validateJsonElement(jsonObj.get("warehouse")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetWarehouseV1Output value) @Override public GetWarehouseV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java index 2a54a775..406f90e6 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalog200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetWarehousesCatalog200Response data(GetWarehousesCatalogV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetWarehousesCatalogV1Output getData() { return data; } @@ -110,16 +107,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetWarehousesCatalog200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWarehousesCatalog200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWarehousesCatalog200Response is not" @@ -128,17 +125,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWarehousesCatalog200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWarehousesCatalog200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetWarehousesCatalogV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -166,9 +168,9 @@ public void write(JsonWriter out, GetWarehousesCatalog200Response value) @Override public GetWarehousesCatalog200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java index 43a289b7..f1e4f3aa 100644 --- a/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWarehousesCatalogV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,20 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Returns a list of all Warehouse catalog items contained within a given page. */ -@ApiModel( - description = - "Returns a list of all Warehouse catalog items contained within a given page.") public class GetWarehousesCatalogV1Output { public static final String SERIALIZED_NAME_WAREHOUSES_CATALOG = "warehousesCatalog"; @@ -46,7 +40,7 @@ public class GetWarehousesCatalogV1Output { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) - private Pagination pagination; + private PaginationOutput pagination; public GetWarehousesCatalogV1Output() {} @@ -59,6 +53,9 @@ public GetWarehousesCatalogV1Output warehousesCatalog( public GetWarehousesCatalogV1Output addWarehousesCatalogItem( WarehouseMetadataV1 warehousesCatalogItem) { + if (this.warehousesCatalog == null) { + this.warehousesCatalog = new ArrayList<>(); + } this.warehousesCatalog.add(warehousesCatalogItem); return this; } @@ -69,9 +66,6 @@ public GetWarehousesCatalogV1Output addWarehousesCatalogItem( * @return warehousesCatalog */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "All Warehouse catalog items contained within the requested page.") public List getWarehousesCatalog() { return warehousesCatalog; } @@ -80,7 +74,7 @@ public void setWarehousesCatalog(List warehousesCatalog) { this.warehousesCatalog = warehousesCatalog; } - public GetWarehousesCatalogV1Output pagination(Pagination pagination) { + public GetWarehousesCatalogV1Output pagination(PaginationOutput pagination) { this.pagination = pagination; return this; @@ -92,12 +86,11 @@ public GetWarehousesCatalogV1Output pagination(Pagination pagination) { * @return pagination */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Pagination getPagination() { + public PaginationOutput getPagination() { return pagination; } - public void setPagination(Pagination pagination) { + public void setPagination(PaginationOutput pagination) { this.pagination = pagination; } @@ -160,16 +153,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GetWarehousesCatalogV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWarehousesCatalogV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWarehousesCatalogV1Output is not" @@ -178,27 +171,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWarehousesCatalogV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWarehousesCatalogV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetWarehousesCatalogV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array if (!jsonObj.get("warehousesCatalog").isJsonArray()) { throw new IllegalArgumentException( @@ -209,6 +203,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } JsonArray jsonArraywarehousesCatalog = jsonObj.getAsJsonArray("warehousesCatalog"); + // validate the required field `warehousesCatalog` (array) + for (int i = 0; i < jsonArraywarehousesCatalog.size(); i++) { + WarehouseMetadataV1.validateJsonElement(jsonArraywarehousesCatalog.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -235,9 +236,9 @@ public void write(JsonWriter out, GetWarehousesCatalogV1Output value) @Override public GetWarehousesCatalogV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java index e00436bf..5d723608 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspace200Response.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,10 +21,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -50,7 +48,6 @@ public GetWorkspace200Response data(GetWorkspaceV1Output data) { * @return data */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public GetWorkspaceV1Output getData() { return data; } @@ -109,15 +106,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWorkspace200Response + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetWorkspace200Response */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWorkspace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWorkspace200Response is not found" @@ -126,17 +123,22 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWorkspace200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWorkspace200Response` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetWorkspaceV1Output.validateJsonElement(jsonObj.get("data")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -162,9 +164,9 @@ public void write(JsonWriter out, GetWorkspace200Response value) @Override public GetWorkspace200Response read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java index e93b81cb..ff5045f9 100644 --- a/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetWorkspaceV1Output.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,25 +21,22 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Represents the output of loading the Workspace. */ -@ApiModel(description = "Represents the output of loading the Workspace.") public class GetWorkspaceV1Output { public static final String SERIALIZED_NAME_WORKSPACE = "workspace"; @SerializedName(SERIALIZED_NAME_WORKSPACE) - private Workspace workspace; + private WorkspaceV1 workspace; public GetWorkspaceV1Output() {} - public GetWorkspaceV1Output workspace(Workspace workspace) { + public GetWorkspaceV1Output workspace(WorkspaceV1 workspace) { this.workspace = workspace; return this; @@ -52,12 +48,11 @@ public GetWorkspaceV1Output workspace(Workspace workspace) { * @return workspace */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Workspace getWorkspace() { + public WorkspaceV1 getWorkspace() { return workspace; } - public void setWorkspace(Workspace workspace) { + public void setWorkspace(WorkspaceV1 workspace) { this.workspace = workspace; } @@ -112,15 +107,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GetWorkspaceV1Output + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetWorkspaceV1Output */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GetWorkspaceV1Output.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GetWorkspaceV1Output is not found in" @@ -129,27 +124,30 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GetWorkspaceV1Output.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GetWorkspaceV1Output` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GetWorkspaceV1Output.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `workspace` + WorkspaceV1.validateJsonElement(jsonObj.get("workspace")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -174,9 +172,9 @@ public void write(JsonWriter out, GetWorkspaceV1Output value) @Override public GetWorkspaceV1Output read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Group.java b/src/main/java/com/segment/publicapi/models/Group.java deleted file mode 100644 index 6093019f..00000000 --- a/src/main/java/com/segment/publicapi/models/Group.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Group settings. */ -@ApiModel(description = "Group settings.") -public class Group { - public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - - @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) - private Boolean allowUnplannedTraits; - - public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = - "allowTraitsOnViolations"; - - @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) - private Boolean allowTraitsOnViolations; - - /** - * The common group event on violations. Config API note: equal to - * `commonGroupEventOnViolations`. - */ - @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) - public enum CommonEventOnViolationsEnum { - ALLOW("ALLOW"), - - BLOCK("BLOCK"), - - OMIT_TRAITS("OMIT_TRAITS"); - - private String value; - - CommonEventOnViolationsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CommonEventOnViolationsEnum fromValue(String value) { - for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write( - final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CommonEventOnViolationsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return CommonEventOnViolationsEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = - "commonEventOnViolations"; - - @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) - private CommonEventOnViolationsEnum commonEventOnViolations; - - public Group() {} - - public Group allowUnplannedTraits(Boolean allowUnplannedTraits) { - - this.allowUnplannedTraits = allowUnplannedTraits; - return this; - } - - /** - * Enable to allow unplanned group traits. Config API note: equal to - * `allowUnplannedGroupTraits`. - * - * @return allowUnplannedTraits - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow unplanned group traits. Config API note: equal to" - + " `allowUnplannedGroupTraits`.") - public Boolean getAllowUnplannedTraits() { - return allowUnplannedTraits; - } - - public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { - this.allowUnplannedTraits = allowUnplannedTraits; - } - - public Group allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - - this.allowTraitsOnViolations = allowTraitsOnViolations; - return this; - } - - /** - * Enable to allow group traits on violations. Config API note: equal to - * `allowGroupTraitsOnViolations`. - * - * @return allowTraitsOnViolations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow group traits on violations. Config API note: equal to" - + " `allowGroupTraitsOnViolations`.") - public Boolean getAllowTraitsOnViolations() { - return allowTraitsOnViolations; - } - - public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { - this.allowTraitsOnViolations = allowTraitsOnViolations; - } - - public Group commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - - this.commonEventOnViolations = commonEventOnViolations; - return this; - } - - /** - * The common group event on violations. Config API note: equal to - * `commonGroupEventOnViolations`. - * - * @return commonEventOnViolations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The common group event on violations. Config API note: equal to" - + " `commonGroupEventOnViolations`.") - public CommonEventOnViolationsEnum getCommonEventOnViolations() { - return commonEventOnViolations; - } - - public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - this.commonEventOnViolations = commonEventOnViolations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Group group = (Group) o; - return Objects.equals(this.allowUnplannedTraits, group.allowUnplannedTraits) - && Objects.equals(this.allowTraitsOnViolations, group.allowTraitsOnViolations) - && Objects.equals(this.commonEventOnViolations, group.commonEventOnViolations); - } - - @Override - public int hashCode() { - return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Group {\n"); - sb.append(" allowUnplannedTraits: ") - .append(toIndentedString(allowUnplannedTraits)) - .append("\n"); - sb.append(" allowTraitsOnViolations: ") - .append(toIndentedString(allowTraitsOnViolations)) - .append("\n"); - sb.append(" commonEventOnViolations: ") - .append(toIndentedString(commonEventOnViolations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowUnplannedTraits"); - openapiFields.add("allowTraitsOnViolations"); - openapiFields.add("commonEventOnViolations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Group - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Group.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Group is not found in the empty JSON" - + " string", - Group.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Group.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Group`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("commonEventOnViolations") != null - && !jsonObj.get("commonEventOnViolations").isJsonNull()) - && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `commonEventOnViolations` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("commonEventOnViolations").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Group.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Group' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Group.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Group value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Group read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Group given an JSON string - * - * @param jsonString JSON string - * @return An instance of Group - * @throws IOException if the JSON string is invalid with respect to Group - */ - public static Group fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Group.class); - } - - /** - * Convert an instance of Group to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java index bf7ff2e9..fd8bbf47 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/GroupSourceSettingsV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,10 +22,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -117,10 +115,6 @@ public GroupSourceSettingsV1 allowUnplannedTraits(Boolean allowUnplannedTraits) * @return allowUnplannedTraits */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow unplanned group traits. Config API note: equal to" - + " `allowUnplannedGroupTraits`.") public Boolean getAllowUnplannedTraits() { return allowUnplannedTraits; } @@ -142,10 +136,6 @@ public GroupSourceSettingsV1 allowTraitsOnViolations(Boolean allowTraitsOnViolat * @return allowTraitsOnViolations */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow group traits on violations. Config API note: equal to" - + " `allowGroupTraitsOnViolations`.") public Boolean getAllowTraitsOnViolations() { return allowTraitsOnViolations; } @@ -168,10 +158,6 @@ public GroupSourceSettingsV1 commonEventOnViolations( * @return commonEventOnViolations */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The common group event on violations. Config API note: equal to" - + " `commonGroupEventOnViolations`.") public CommonEventOnViolationsEnum getCommonEventOnViolations() { return commonEventOnViolations; } @@ -245,15 +231,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupSourceSettingsV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupSourceSettingsV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GroupSourceSettingsV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GroupSourceSettingsV1 is not found in" @@ -262,17 +248,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GroupSourceSettingsV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GroupSourceSettingsV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("commonEventOnViolations") != null && !jsonObj.get("commonEventOnViolations").isJsonNull()) && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { @@ -306,9 +293,9 @@ public void write(JsonWriter out, GroupSourceSettingsV1 value) @Override public GroupSourceSettingsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java index ca2ae006..2daf7606 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java +++ b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatus.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,10 +22,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -104,7 +102,6 @@ public GroupSubscriptionStatus name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the group.") public String getName() { return name; } @@ -125,9 +122,6 @@ public GroupSubscriptionStatus status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The user subscribed, unsubscribed, or on initial status.") public StatusEnum getStatus() { return status; } @@ -191,15 +185,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to GroupSubscriptionStatus + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupSubscriptionStatus */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GroupSubscriptionStatus.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GroupSubscriptionStatus is not found" @@ -208,27 +202,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GroupSubscriptionStatus.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GroupSubscriptionStatus` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GroupSubscriptionStatus.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -268,9 +263,9 @@ public void write(JsonWriter out, GroupSubscriptionStatus value) @Override public GroupSubscriptionStatus read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java index 98f49a5d..29e21aee 100644 --- a/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java +++ b/src/main/java/com/segment/publicapi/models/GroupSubscriptionStatusResponse.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,10 +22,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -114,7 +112,6 @@ public GroupSubscriptionStatusResponse name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the group.") public String getName() { return name; } @@ -135,9 +132,6 @@ public GroupSubscriptionStatusResponse status(StatusEnum status) { * @return status */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The user subscribed, unsubscribed, or on initial status.") public StatusEnum getStatus() { return status; } @@ -158,7 +152,6 @@ public GroupSubscriptionStatusResponse id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The group id.") public String getId() { return id; } @@ -179,7 +172,6 @@ public GroupSubscriptionStatusResponse updatedAt(String updatedAt) { * @return updatedAt */ @javax.annotation.Nullable - @ApiModelProperty(value = "The timestamp of this subscription status's last change.") public String getUpdatedAt() { return updatedAt; } @@ -251,16 +243,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to * GroupSubscriptionStatusResponse */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!GroupSubscriptionStatusResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in GroupSubscriptionStatusResponse is not" @@ -269,27 +261,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!GroupSubscriptionStatusResponse.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `GroupSubscriptionStatusResponse` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : GroupSubscriptionStatusResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -346,9 +339,9 @@ public void write(JsonWriter out, GroupSubscriptionStatusResponse value) @Override public GroupSubscriptionStatusResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java b/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java index b3d3119d..3522ab1a 100644 --- a/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java +++ b/src/main/java/com/segment/publicapi/models/HandleWebhookInput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,16 +21,13 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Function webhook input. */ -@ApiModel(description = "Function webhook input.") public class HandleWebhookInput { public static final String SERIALIZED_NAME_W = "w"; @@ -67,7 +63,6 @@ public HandleWebhookInput w(String w) { * @return w */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Workspace id.") public String getW() { return w; } @@ -88,7 +83,6 @@ public HandleWebhookInput n(String n) { * @return n */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The webhook nonce.") public String getN() { return n; } @@ -109,7 +103,6 @@ public HandleWebhookInput t(String t) { * @return t */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The webhook timestamp.") public String getT() { return t; } @@ -130,7 +123,6 @@ public HandleWebhookInput s(String s) { * @return s */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The webhook signature.") public String getS() { return s; } @@ -202,15 +194,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HandleWebhookInput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HandleWebhookInput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!HandleWebhookInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in HandleWebhookInput is not found in the" @@ -219,27 +211,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HandleWebhookInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `HandleWebhookInput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HandleWebhookInput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("w").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -292,9 +285,9 @@ public void write(JsonWriter out, HandleWebhookInput value) @Override public HandleWebhookInput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java b/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java index 286b3a15..60a79564 100644 --- a/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java +++ b/src/main/java/com/segment/publicapi/models/HandleWebhookOutput.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,17 +21,14 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Function webhook output status. */ -@ApiModel(description = "Function webhook output status.") public class HandleWebhookOutput { public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode"; @@ -58,7 +54,6 @@ public HandleWebhookOutput statusCode(BigDecimal statusCode) { * @return statusCode */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The http status code.") public BigDecimal getStatusCode() { return statusCode; } @@ -79,7 +74,6 @@ public HandleWebhookOutput success(Boolean success) { * @return success */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The status of the operation.") public Boolean getSuccess() { return success; } @@ -143,15 +137,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to HandleWebhookOutput + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HandleWebhookOutput */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!HandleWebhookOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in HandleWebhookOutput is not found in" @@ -160,27 +154,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!HandleWebhookOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `HandleWebhookOutput` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : HandleWebhookOutput.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -205,9 +200,9 @@ public void write(JsonWriter out, HandleWebhookOutput value) @Override public HandleWebhookOutput read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Identify.java b/src/main/java/com/segment/publicapi/models/Identify.java deleted file mode 100644 index 38f4e9f3..00000000 --- a/src/main/java/com/segment/publicapi/models/Identify.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** Identify settings. */ -@ApiModel(description = "Identify settings.") -public class Identify { - public static final String SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS = "allowUnplannedTraits"; - - @SerializedName(SERIALIZED_NAME_ALLOW_UNPLANNED_TRAITS) - private Boolean allowUnplannedTraits; - - public static final String SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS = - "allowTraitsOnViolations"; - - @SerializedName(SERIALIZED_NAME_ALLOW_TRAITS_ON_VIOLATIONS) - private Boolean allowTraitsOnViolations; - - /** - * The common identify event on violations. Config API note: equal to - * `commonIdentifyEventOnViolations`. - */ - @JsonAdapter(CommonEventOnViolationsEnum.Adapter.class) - public enum CommonEventOnViolationsEnum { - ALLOW("ALLOW"), - - BLOCK("BLOCK"), - - OMIT_TRAITS("OMIT_TRAITS"); - - private String value; - - CommonEventOnViolationsEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CommonEventOnViolationsEnum fromValue(String value) { - for (CommonEventOnViolationsEnum b : CommonEventOnViolationsEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write( - final JsonWriter jsonWriter, final CommonEventOnViolationsEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CommonEventOnViolationsEnum read(final JsonReader jsonReader) - throws IOException { - String value = jsonReader.nextString(); - return CommonEventOnViolationsEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS = - "commonEventOnViolations"; - - @SerializedName(SERIALIZED_NAME_COMMON_EVENT_ON_VIOLATIONS) - private CommonEventOnViolationsEnum commonEventOnViolations; - - public Identify() {} - - public Identify allowUnplannedTraits(Boolean allowUnplannedTraits) { - - this.allowUnplannedTraits = allowUnplannedTraits; - return this; - } - - /** - * Enable to allow unplanned identify traits. Config API note: equal to - * `allowUnplannedIdentifyTraits`. - * - * @return allowUnplannedTraits - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow unplanned identify traits. Config API note: equal to" - + " `allowUnplannedIdentifyTraits`.") - public Boolean getAllowUnplannedTraits() { - return allowUnplannedTraits; - } - - public void setAllowUnplannedTraits(Boolean allowUnplannedTraits) { - this.allowUnplannedTraits = allowUnplannedTraits; - } - - public Identify allowTraitsOnViolations(Boolean allowTraitsOnViolations) { - - this.allowTraitsOnViolations = allowTraitsOnViolations; - return this; - } - - /** - * Enable to allow identify traits on violations. Config API note: equal to - * `allowIdentifyTraitsOnViolations`. - * - * @return allowTraitsOnViolations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow identify traits on violations. Config API note: equal to" - + " `allowIdentifyTraitsOnViolations`.") - public Boolean getAllowTraitsOnViolations() { - return allowTraitsOnViolations; - } - - public void setAllowTraitsOnViolations(Boolean allowTraitsOnViolations) { - this.allowTraitsOnViolations = allowTraitsOnViolations; - } - - public Identify commonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - - this.commonEventOnViolations = commonEventOnViolations; - return this; - } - - /** - * The common identify event on violations. Config API note: equal to - * `commonIdentifyEventOnViolations`. - * - * @return commonEventOnViolations - */ - @javax.annotation.Nullable - @ApiModelProperty( - value = - "The common identify event on violations. Config API note: equal to" - + " `commonIdentifyEventOnViolations`.") - public CommonEventOnViolationsEnum getCommonEventOnViolations() { - return commonEventOnViolations; - } - - public void setCommonEventOnViolations(CommonEventOnViolationsEnum commonEventOnViolations) { - this.commonEventOnViolations = commonEventOnViolations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Identify identify = (Identify) o; - return Objects.equals(this.allowUnplannedTraits, identify.allowUnplannedTraits) - && Objects.equals(this.allowTraitsOnViolations, identify.allowTraitsOnViolations) - && Objects.equals(this.commonEventOnViolations, identify.commonEventOnViolations); - } - - @Override - public int hashCode() { - return Objects.hash(allowUnplannedTraits, allowTraitsOnViolations, commonEventOnViolations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Identify {\n"); - sb.append(" allowUnplannedTraits: ") - .append(toIndentedString(allowUnplannedTraits)) - .append("\n"); - sb.append(" allowTraitsOnViolations: ") - .append(toIndentedString(allowTraitsOnViolations)) - .append("\n"); - sb.append(" commonEventOnViolations: ") - .append(toIndentedString(commonEventOnViolations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("allowUnplannedTraits"); - openapiFields.add("allowTraitsOnViolations"); - openapiFields.add("commonEventOnViolations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Identify - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Identify.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Identify is not found in the empty" - + " JSON string", - Identify.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Identify.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Identify`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("commonEventOnViolations") != null - && !jsonObj.get("commonEventOnViolations").isJsonNull()) - && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `commonEventOnViolations` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("commonEventOnViolations").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Identify.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Identify' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Identify.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Identify value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Identify read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Identify given an JSON string - * - * @param jsonString JSON string - * @return An instance of Identify - * @throws IOException if the JSON string is invalid with respect to Identify - */ - public static Identify fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Identify.class); - } - - /** - * Convert an instance of Identify to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java index 6de6972c..fee26d09 100644 --- a/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java +++ b/src/main/java/com/segment/publicapi/models/IdentifySourceSettingsV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -23,10 +22,9 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; @@ -117,10 +115,6 @@ public IdentifySourceSettingsV1 allowUnplannedTraits(Boolean allowUnplannedTrait * @return allowUnplannedTraits */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow unplanned identify traits. Config API note: equal to" - + " `allowUnplannedIdentifyTraits`.") public Boolean getAllowUnplannedTraits() { return allowUnplannedTraits; } @@ -142,10 +136,6 @@ public IdentifySourceSettingsV1 allowTraitsOnViolations(Boolean allowTraitsOnVio * @return allowTraitsOnViolations */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "Enable to allow identify traits on violations. Config API note: equal to" - + " `allowIdentifyTraitsOnViolations`.") public Boolean getAllowTraitsOnViolations() { return allowTraitsOnViolations; } @@ -168,10 +158,6 @@ public IdentifySourceSettingsV1 commonEventOnViolations( * @return commonEventOnViolations */ @javax.annotation.Nullable - @ApiModelProperty( - value = - "The common identify event on violations. Config API note: equal to" - + " `commonIdentifyEventOnViolations`.") public CommonEventOnViolationsEnum getCommonEventOnViolations() { return commonEventOnViolations; } @@ -247,15 +233,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to IdentifySourceSettingsV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IdentifySourceSettingsV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!IdentifySourceSettingsV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in IdentifySourceSettingsV1 is not found" @@ -264,17 +250,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!IdentifySourceSettingsV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `IdentifySourceSettingsV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if ((jsonObj.get("commonEventOnViolations") != null && !jsonObj.get("commonEventOnViolations").isJsonNull()) && !jsonObj.get("commonEventOnViolations").isJsonPrimitive()) { @@ -309,9 +296,9 @@ public void write(JsonWriter out, IdentifySourceSettingsV1 value) @Override public IdentifySourceSettingsV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Input.java b/src/main/java/com/segment/publicapi/models/Input.java deleted file mode 100644 index 74f70753..00000000 --- a/src/main/java/com/segment/publicapi/models/Input.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** A set of valid Destination input params required for updating. */ -@ApiModel(description = "A set of valid Destination input params required for updating.") -public class Input { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_TRIGGER = "trigger"; - - @SerializedName(SERIALIZED_NAME_TRIGGER) - private String trigger; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings; - - public Input() {} - - public Input name(String name) { - - this.name = name; - return this; - } - - /** - * The user-defined name for the subscription. - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The user-defined name for the subscription.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Input trigger(String trigger) { - - this.trigger = trigger; - return this; - } - - /** - * The fql statement. - * - * @return trigger - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fql statement.") - public String getTrigger() { - return trigger; - } - - public void setTrigger(String trigger) { - this.trigger = trigger; - } - - public Input enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Is the subscription enabled. - * - * @return enabled - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "Is the subscription enabled.") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public Input settings(Map settings) { - - this.settings = settings; - return this; - } - - /** - * The fields used for configuring this action. - * - * @return settings - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "The fields used for configuring this action.") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Input input = (Input) o; - return Objects.equals(this.name, input.name) - && Objects.equals(this.trigger, input.trigger) - && Objects.equals(this.enabled, input.enabled) - && Objects.equals(this.settings, input.settings); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(name, trigger, enabled, settings); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Input {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("trigger"); - openapiFields.add("enabled"); - openapiFields.add("settings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Input - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Input.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Input is not found in the empty JSON" - + " string", - Input.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Input.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Input`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("trigger") != null && !jsonObj.get("trigger").isJsonNull()) - && !jsonObj.get("trigger").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `trigger` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("trigger").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Input.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Input' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Input.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Input value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Input read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Input given an JSON string - * - * @param jsonString JSON string - * @return An instance of Input - * @throws IOException if the JSON string is invalid with respect to Input - */ - public static Input fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Input.class); - } - - /** - * Convert an instance of Input to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java deleted file mode 100644 index 3c0cadf9..00000000 --- a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The created instance. */ -@ApiModel(description = "The created instance.") -public class InsertFunctionInstance { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private String integrationId; - - public static final String SERIALIZED_NAME_CLASS_ID = "classId"; - - @SerializedName(SERIALIZED_NAME_CLASS_ID) - private String classId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; - - @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) - private Map encryptedSettings = new HashMap<>(); - - public InsertFunctionInstance() {} - - public InsertFunctionInstance id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public InsertFunctionInstance name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InsertFunctionInstance integrationId(String integrationId) { - - this.integrationId = integrationId; - return this; - } - - /** - * Get integrationId - * - * @return integrationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(String integrationId) { - this.integrationId = integrationId; - } - - public InsertFunctionInstance classId(String classId) { - - this.classId = classId; - return this; - } - - /** - * Get classId - * - * @return classId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public InsertFunctionInstance enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public InsertFunctionInstance createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public InsertFunctionInstance updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public InsertFunctionInstance settings(Map settings) { - - this.settings = settings; - return this; - } - - public InsertFunctionInstance putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * Get settings - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - public InsertFunctionInstance encryptedSettings(Map encryptedSettings) { - - this.encryptedSettings = encryptedSettings; - return this; - } - - public InsertFunctionInstance putEncryptedSettingsItem( - String key, Object encryptedSettingsItem) { - this.encryptedSettings.put(key, encryptedSettingsItem); - return this; - } - - /** - * Get encryptedSettings - * - * @return encryptedSettings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getEncryptedSettings() { - return encryptedSettings; - } - - public void setEncryptedSettings(Map encryptedSettings) { - this.encryptedSettings = encryptedSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InsertFunctionInstance insertFunctionInstance = (InsertFunctionInstance) o; - return Objects.equals(this.id, insertFunctionInstance.id) - && Objects.equals(this.name, insertFunctionInstance.name) - && Objects.equals(this.integrationId, insertFunctionInstance.integrationId) - && Objects.equals(this.classId, insertFunctionInstance.classId) - && Objects.equals(this.enabled, insertFunctionInstance.enabled) - && Objects.equals(this.createdAt, insertFunctionInstance.createdAt) - && Objects.equals(this.updatedAt, insertFunctionInstance.updatedAt) - && Objects.equals(this.settings, insertFunctionInstance.settings) - && Objects.equals(this.encryptedSettings, insertFunctionInstance.encryptedSettings); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - integrationId, - classId, - enabled, - createdAt, - updatedAt, - settings, - encryptedSettings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InsertFunctionInstance {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" encryptedSettings: ") - .append(toIndentedString(encryptedSettings)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("integrationId"); - openapiFields.add("classId"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("settings"); - openapiFields.add("encryptedSettings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("integrationId"); - openapiRequiredFields.add("classId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - openapiRequiredFields.add("settings"); - openapiRequiredFields.add("encryptedSettings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InsertFunctionInstance.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InsertFunctionInstance is not found in" - + " the empty JSON string", - InsertFunctionInstance.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InsertFunctionInstance.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InsertFunctionInstance` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InsertFunctionInstance.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `integrationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("integrationId").toString())); - } - if (!jsonObj.get("classId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `classId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("classId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InsertFunctionInstance.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InsertFunctionInstance' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InsertFunctionInstance value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InsertFunctionInstance read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InsertFunctionInstance given an JSON string - * - * @param jsonString JSON string - * @return An instance of InsertFunctionInstance - * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance - */ - public static InsertFunctionInstance fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InsertFunctionInstance.class); - } - - /** - * Convert an instance of InsertFunctionInstance to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java deleted file mode 100644 index 88b17c35..00000000 --- a/src/main/java/com/segment/publicapi/models/InsertFunctionInstance1.java +++ /dev/null @@ -1,512 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The updated instance. */ -@ApiModel(description = "The updated instance.") -public class InsertFunctionInstance1 { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; - - @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) - private String integrationId; - - public static final String SERIALIZED_NAME_CLASS_ID = "classId"; - - @SerializedName(SERIALIZED_NAME_CLASS_ID) - private String classId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private Map settings = new HashMap<>(); - - public static final String SERIALIZED_NAME_ENCRYPTED_SETTINGS = "encryptedSettings"; - - @SerializedName(SERIALIZED_NAME_ENCRYPTED_SETTINGS) - private Map encryptedSettings = new HashMap<>(); - - public InsertFunctionInstance1() {} - - public InsertFunctionInstance1 id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public InsertFunctionInstance1 name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InsertFunctionInstance1 integrationId(String integrationId) { - - this.integrationId = integrationId; - return this; - } - - /** - * Get integrationId - * - * @return integrationId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(String integrationId) { - this.integrationId = integrationId; - } - - public InsertFunctionInstance1 classId(String classId) { - - this.classId = classId; - return this; - } - - /** - * Get classId - * - * @return classId - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public InsertFunctionInstance1 enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public InsertFunctionInstance1 createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public InsertFunctionInstance1 updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public InsertFunctionInstance1 settings(Map settings) { - - this.settings = settings; - return this; - } - - public InsertFunctionInstance1 putSettingsItem(String key, Object settingsItem) { - this.settings.put(key, settingsItem); - return this; - } - - /** - * Get settings - * - * @return settings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getSettings() { - return settings; - } - - public void setSettings(Map settings) { - this.settings = settings; - } - - public InsertFunctionInstance1 encryptedSettings(Map encryptedSettings) { - - this.encryptedSettings = encryptedSettings; - return this; - } - - public InsertFunctionInstance1 putEncryptedSettingsItem( - String key, Object encryptedSettingsItem) { - this.encryptedSettings.put(key, encryptedSettingsItem); - return this; - } - - /** - * Get encryptedSettings - * - * @return encryptedSettings - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") - public Map getEncryptedSettings() { - return encryptedSettings; - } - - public void setEncryptedSettings(Map encryptedSettings) { - this.encryptedSettings = encryptedSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InsertFunctionInstance1 insertFunctionInstance1 = (InsertFunctionInstance1) o; - return Objects.equals(this.id, insertFunctionInstance1.id) - && Objects.equals(this.name, insertFunctionInstance1.name) - && Objects.equals(this.integrationId, insertFunctionInstance1.integrationId) - && Objects.equals(this.classId, insertFunctionInstance1.classId) - && Objects.equals(this.enabled, insertFunctionInstance1.enabled) - && Objects.equals(this.createdAt, insertFunctionInstance1.createdAt) - && Objects.equals(this.updatedAt, insertFunctionInstance1.updatedAt) - && Objects.equals(this.settings, insertFunctionInstance1.settings) - && Objects.equals( - this.encryptedSettings, insertFunctionInstance1.encryptedSettings); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - name, - integrationId, - classId, - enabled, - createdAt, - updatedAt, - settings, - encryptedSettings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InsertFunctionInstance1 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); - sb.append(" classId: ").append(toIndentedString(classId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" encryptedSettings: ") - .append(toIndentedString(encryptedSettings)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("name"); - openapiFields.add("integrationId"); - openapiFields.add("classId"); - openapiFields.add("enabled"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("settings"); - openapiFields.add("encryptedSettings"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("integrationId"); - openapiRequiredFields.add("classId"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - openapiRequiredFields.add("settings"); - openapiRequiredFields.add("encryptedSettings"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstance1 - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!InsertFunctionInstance1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in InsertFunctionInstance1 is not found" - + " in the empty JSON string", - InsertFunctionInstance1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InsertFunctionInstance1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `InsertFunctionInstance1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InsertFunctionInstance1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("integrationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `integrationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("integrationId").toString())); - } - if (!jsonObj.get("classId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `classId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("classId").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InsertFunctionInstance1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InsertFunctionInstance1' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(InsertFunctionInstance1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, InsertFunctionInstance1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InsertFunctionInstance1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - }.nullSafe(); - } - } - - /** - * Create an instance of InsertFunctionInstance1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of InsertFunctionInstance1 - * @throws IOException if the JSON string is invalid with respect to InsertFunctionInstance1 - */ - public static InsertFunctionInstance1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InsertFunctionInstance1.class); - } - - /** - * Convert an instance of InsertFunctionInstance1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java index f64bb2d2..ab7f23eb 100644 --- a/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java +++ b/src/main/java/com/segment/publicapi/models/InsertFunctionInstanceAlpha.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,12 +21,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Objects; import java.util.Set; @@ -92,7 +89,6 @@ public InsertFunctionInstanceAlpha id(String id) { * @return id */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getId() { return id; } @@ -113,7 +109,6 @@ public InsertFunctionInstanceAlpha name(String name) { * @return name */ @javax.annotation.Nullable - @ApiModelProperty(value = "") public String getName() { return name; } @@ -134,7 +129,6 @@ public InsertFunctionInstanceAlpha integrationId(String integrationId) { * @return integrationId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getIntegrationId() { return integrationId; } @@ -155,7 +149,6 @@ public InsertFunctionInstanceAlpha classId(String classId) { * @return classId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getClassId() { return classId; } @@ -176,7 +169,6 @@ public InsertFunctionInstanceAlpha enabled(Boolean enabled) { * @return enabled */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public Boolean getEnabled() { return enabled; } @@ -197,7 +189,6 @@ public InsertFunctionInstanceAlpha createdAt(String createdAt) { * @return createdAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getCreatedAt() { return createdAt; } @@ -218,7 +209,6 @@ public InsertFunctionInstanceAlpha updatedAt(String updatedAt) { * @return updatedAt */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public String getUpdatedAt() { return updatedAt; } @@ -234,6 +224,9 @@ public InsertFunctionInstanceAlpha settings(Map settings) { } public InsertFunctionInstanceAlpha putSettingsItem(String key, Object settingsItem) { + if (this.settings == null) { + this.settings = new HashMap<>(); + } this.settings.put(key, settingsItem); return this; } @@ -244,7 +237,6 @@ public InsertFunctionInstanceAlpha putSettingsItem(String key, Object settingsIt * @return settings */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public Map getSettings() { return settings; } @@ -261,6 +253,9 @@ public InsertFunctionInstanceAlpha encryptedSettings(Map encrypt public InsertFunctionInstanceAlpha putEncryptedSettingsItem( String key, Object encryptedSettingsItem) { + if (this.encryptedSettings == null) { + this.encryptedSettings = new HashMap<>(); + } this.encryptedSettings.put(key, encryptedSettingsItem); return this; } @@ -271,7 +266,6 @@ public InsertFunctionInstanceAlpha putEncryptedSettingsItem( * @return encryptedSettings */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") public Map getEncryptedSettings() { return encryptedSettings; } @@ -374,15 +368,16 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InsertFunctionInstanceAlpha + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * InsertFunctionInstanceAlpha */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!InsertFunctionInstanceAlpha.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in InsertFunctionInstanceAlpha is not" @@ -391,27 +386,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!InsertFunctionInstanceAlpha.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `InsertFunctionInstanceAlpha` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InsertFunctionInstanceAlpha.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -480,9 +476,9 @@ public void write(JsonWriter out, InsertFunctionInstanceAlpha value) @Override public InsertFunctionInstanceAlpha read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java index d3408ee1..b5b3cc12 100644 --- a/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java +++ b/src/main/java/com/segment/publicapi/models/IntegrationOptionBeta.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -22,12 +21,10 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.Arrays; import java.util.HashSet; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; import org.openapitools.jackson.nullable.JsonNullable; @@ -36,10 +33,6 @@ * Describes an Integration option field required to set up a Segment Integration such as Sources, * Destinations, or warehouses. */ -@ApiModel( - description = - "Describes an Integration option field required to set up a Segment Integration" - + " such as Sources, Destinations, or warehouses.") public class IntegrationOptionBeta { public static final String SERIALIZED_NAME_NAME = "name"; @@ -85,9 +78,6 @@ public IntegrationOptionBeta name(String name) { * @return name */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The name identifying this option in the context of a Segment Integration.") public String getName() { return name; } @@ -110,13 +100,6 @@ public IntegrationOptionBeta type(String type) { * @return type */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = - "Defines the type for this option in the schema. Types are most commonly" - + " strings, but may also represent other primitive types, such as" - + " booleans, and numbers, as well as complex types, such as objects and" - + " arrays.") public String getType() { return type; } @@ -137,9 +120,6 @@ public IntegrationOptionBeta required(Boolean required) { * @return required */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "Whether this is a required option when setting up the Integration.") public Boolean getRequired() { return required; } @@ -160,7 +140,6 @@ public IntegrationOptionBeta description(String description) { * @return description */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional short text description of the field.") public String getDescription() { return description; } @@ -181,7 +160,6 @@ public IntegrationOptionBeta defaultValue(Object defaultValue) { * @return defaultValue */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional default value for the field.") public Object getDefaultValue() { return defaultValue; } @@ -202,7 +180,6 @@ public IntegrationOptionBeta label(String label) { * @return label */ @javax.annotation.Nullable - @ApiModelProperty(value = "An optional label for this field.") public String getLabel() { return label; } @@ -295,15 +272,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to IntegrationOptionBeta + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IntegrationOptionBeta */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!IntegrationOptionBeta.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in IntegrationOptionBeta is not found in" @@ -312,27 +289,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!IntegrationOptionBeta.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `IntegrationOptionBeta` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : IntegrationOptionBeta.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -387,9 +365,9 @@ public void write(JsonWriter out, IntegrationOptionBeta value) @Override public IntegrationOptionBeta read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java index 47eb64e6..1b9fb57e 100644 --- a/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java +++ b/src/main/java/com/segment/publicapi/models/InvitePermissionV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines a permission to apply to the user in an invite. */ -@ApiModel(description = "Defines a permission to apply to the user in an invite.") public class InvitePermissionV1 { public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; @@ -44,12 +40,12 @@ public class InvitePermissionV1 { public static final String SERIALIZED_NAME_RESOURCES = "resources"; @SerializedName(SERIALIZED_NAME_RESOURCES) - private List resources = null; + private List resources; public static final String SERIALIZED_NAME_LABELS = "labels"; @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = null; + private List labels; public InvitePermissionV1() {} @@ -65,7 +61,6 @@ public InvitePermissionV1 roleId(String roleId) { * @return roleId */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The id of the role.") public String getRoleId() { return roleId; } @@ -94,7 +89,6 @@ public InvitePermissionV1 addResourcesItem(ResourceV1 resourcesItem) { * @return resources */ @javax.annotation.Nullable - @ApiModelProperty(value = "The resources to grant the invited users access to.") public List getResources() { return resources; } @@ -123,7 +117,6 @@ public InvitePermissionV1 addLabelsItem(AllowedLabelBeta labelsItem) { * @return labels */ @javax.annotation.Nullable - @ApiModelProperty(value = "The labels that determine which resources to grant users access to.") public List getLabels() { return labels; } @@ -189,15 +182,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvitePermissionV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InvitePermissionV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!InvitePermissionV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in InvitePermissionV1 is not found in the" @@ -206,27 +199,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!InvitePermissionV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" + " `InvitePermissionV1` properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InvitePermissionV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("roleId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -245,6 +239,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("resources").toString())); } + + // validate the optional field `resources` (array) + for (int i = 0; i < jsonArrayresources.size(); i++) { + ResourceV1.validateJsonElement(jsonArrayresources.get(i)); + } + ; } } if (jsonObj.get("labels") != null && !jsonObj.get("labels").isJsonNull()) { @@ -258,6 +258,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " but got `%s`", jsonObj.get("labels").toString())); } + + // validate the optional field `labels` (array) + for (int i = 0; i < jsonArraylabels.size(); i++) { + AllowedLabelBeta.validateJsonElement(jsonArraylabels.get(i)); + } + ; } } } @@ -284,9 +290,9 @@ public void write(JsonWriter out, InvitePermissionV1 value) @Override public InvitePermissionV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/InviteV1.java b/src/main/java/com/segment/publicapi/models/InviteV1.java index 8d7493f8..0cfca05b 100644 --- a/src/main/java/com/segment/publicapi/models/InviteV1.java +++ b/src/main/java/com/segment/publicapi/models/InviteV1.java @@ -11,7 +11,6 @@ package com.segment.publicapi.models; - import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -23,18 +22,15 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import java.util.Map.Entry; +import java.util.Map; import java.util.Objects; import java.util.Set; /** Defines an invitation to join a Workspace. */ -@ApiModel(description = "Defines an invitation to join a Workspace.") public class InviteV1 { public static final String SERIALIZED_NAME_EMAIL = "email"; @@ -44,7 +40,7 @@ public class InviteV1 { public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; @SerializedName(SERIALIZED_NAME_PERMISSIONS) - private List permissions = null; + private List permissions; public InviteV1() {} @@ -60,9 +56,6 @@ public InviteV1 email(String email) { * @return email */ @javax.annotation.Nonnull - @ApiModelProperty( - required = true, - value = "The invited user's email to attach the permissions to.") public String getEmail() { return email; } @@ -91,7 +84,6 @@ public InviteV1 addPermissionsItem(InvitePermissionV1 permissionsItem) { * @return permissions */ @javax.annotation.Nullable - @ApiModelProperty(value = "The permissions to attach to the invited user.") public List getPermissions() { return permissions; } @@ -154,15 +146,15 @@ private String toIndentedString(Object o) { } /** - * Validates the JSON Object and throws an exception if issues found + * Validates the JSON Element and throws an exception if issues found * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InviteV1 + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InviteV1 */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { if (!InviteV1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null + .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in InviteV1 is not found in the empty" @@ -171,27 +163,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } } - Set> entries = jsonObj.entrySet(); + Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields - for (Entry entry : entries) { + for (Map.Entry entry : entries) { if (!InviteV1.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the `InviteV1`" + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); + entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : InviteV1.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); + requiredField, jsonElement.toString())); } } + JsonObject jsonObj = jsonElement.getAsJsonObject(); if (!jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -210,6 +203,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { + " string but got `%s`", jsonObj.get("permissions").toString())); } + + // validate the optional field `permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + InvitePermissionV1.validateJsonElement(jsonArraypermissions.get(i)); + } + ; } } } @@ -235,9 +234,9 @@ public void write(JsonWriter out, InviteV1 value) throws IOException { @Override public InviteV1 read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); } }.nullSafe(); } diff --git a/src/main/java/com/segment/publicapi/models/Label.java b/src/main/java/com/segment/publicapi/models/Label.java deleted file mode 100644 index a583029f..00000000 --- a/src/main/java/com/segment/publicapi/models/Label.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; - -/** The new label to create in the Workspace. */ -@ApiModel(description = "The new label to create in the Workspace.") -public class Label { - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_VALUE = "value"; - - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public Label() {} - - public Label key(String key) { - - this.key = key; - return this; - } - - /** - * The key that represents the name of this label. - * - * @return key - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The key that represents the name of this label.") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Label value(String value) { - - this.value = value; - return this; - } - - /** - * The value associated with the key of this label. - * - * @return value - */ - @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value associated with the key of this label.") - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public Label description(String description) { - - this.description = description; - return this; - } - - /** - * An optional description of the purpose of this label. - * - * @return description - */ - @javax.annotation.Nullable - @ApiModelProperty(value = "An optional description of the purpose of this label.") - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Label label = (Label) o; - return Objects.equals(this.key, label.key) - && Objects.equals(this.value, label.value) - && Objects.equals(this.description, label.description); - } - - @Override - public int hashCode() { - return Objects.hash(key, value, description); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Label {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("value"); - openapiFields.add("description"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("value"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Label - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!Label.openapiRequiredFields - .isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Label is not found in the empty JSON" - + " string", - Label.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Label.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Label`" - + " properties. JSON: %s", - entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Label.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - if (!jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `value` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("value").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Label.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Label' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + /** + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReverseEtlScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" + + " schemas: ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of ReverseEtlScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlScheduleConfig + * @throws IOException if the JSON string is invalid with respect to ReverseEtlScheduleConfig + */ + public static ReverseEtlScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java new file mode 100644 index 00000000..977d3b2c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -0,0 +1,295 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Defines a configuration object used for scheduling, which can vary depending on the configured + * strategy. + */ +public class ReverseEtlScheduleDefinition { + /** Strategy supports three modes: Periodic, Specific Days, or Manual. */ + @JsonAdapter(StrategyEnum.Adapter.class) + public enum StrategyEnum { + MANUAL("MANUAL"), + + PERIODIC("PERIODIC"), + + SPECIFIC_DAYS("SPECIFIC_DAYS"); + + private String value; + + StrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrategyEnum fromValue(String value) { + for (StrategyEnum b : StrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + + @SerializedName(SERIALIZED_NAME_STRATEGY) + private StrategyEnum strategy; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + private ReverseEtlScheduleConfig config; + + public ReverseEtlScheduleDefinition() {} + + public ReverseEtlScheduleDefinition strategy(StrategyEnum strategy) { + + this.strategy = strategy; + return this; + } + + /** + * Strategy supports three modes: Periodic, Specific Days, or Manual. + * + * @return strategy + */ + @javax.annotation.Nonnull + public StrategyEnum getStrategy() { + return strategy; + } + + public void setStrategy(StrategyEnum strategy) { + this.strategy = strategy; + } + + public ReverseEtlScheduleDefinition config(ReverseEtlScheduleConfig config) { + + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nonnull + public ReverseEtlScheduleConfig getConfig() { + return config; + } + + public void setConfig(ReverseEtlScheduleConfig config) { + this.config = config; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlScheduleDefinition reverseEtlScheduleDefinition = + (ReverseEtlScheduleDefinition) o; + return Objects.equals(this.strategy, reverseEtlScheduleDefinition.strategy) + && Objects.equals(this.config, reverseEtlScheduleDefinition.config); + } + + @Override + public int hashCode() { + return Objects.hash(strategy, config); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlScheduleDefinition {\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("strategy"); + openapiFields.add("config"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("strategy"); + openapiRequiredFields.add("config"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlScheduleDefinition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlScheduleDefinition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlScheduleDefinition is not" + + " found in the empty JSON string", + ReverseEtlScheduleDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlScheduleDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlScheduleDefinition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlScheduleDefinition.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `strategy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("strategy").toString())); + } + // validate the required field `config` + ReverseEtlScheduleConfig.validateJsonElement(jsonObj.get("config")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlScheduleDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlScheduleDefinition' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlScheduleDefinition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlScheduleDefinition value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlScheduleDefinition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlScheduleDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlScheduleDefinition + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlScheduleDefinition + */ + public static ReverseEtlScheduleDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlScheduleDefinition.class); + } + + /** + * Convert an instance of ReverseEtlScheduleDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java new file mode 100644 index 00000000..0641b8a3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java @@ -0,0 +1,321 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Definition for specific day and time schedule. Days is list of numbered day of the week and hours + * is a list of hour of the day. The corresponding Timezone is also input as string. + */ +public class ReverseEtlSpecificTimeScheduleConfig { + public static final String SERIALIZED_NAME_DAYS = "days"; + + @SerializedName(SERIALIZED_NAME_DAYS) + private List days = new ArrayList<>(); + + public static final String SERIALIZED_NAME_HOURS = "hours"; + + @SerializedName(SERIALIZED_NAME_HOURS) + private List hours = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; + + public ReverseEtlSpecificTimeScheduleConfig() {} + + public ReverseEtlSpecificTimeScheduleConfig days(List days) { + + this.days = days; + return this; + } + + public ReverseEtlSpecificTimeScheduleConfig addDaysItem(BigDecimal daysItem) { + if (this.days == null) { + this.days = new ArrayList<>(); + } + this.days.add(daysItem); + return this; + } + + /** + * Days of the week. + * + * @return days + */ + @javax.annotation.Nonnull + public List getDays() { + return days; + } + + public void setDays(List days) { + this.days = days; + } + + public ReverseEtlSpecificTimeScheduleConfig hours(List hours) { + + this.hours = hours; + return this; + } + + public ReverseEtlSpecificTimeScheduleConfig addHoursItem(BigDecimal hoursItem) { + if (this.hours == null) { + this.hours = new ArrayList<>(); + } + this.hours.add(hoursItem); + return this; + } + + /** + * Hours of the day. + * + * @return hours + */ + @javax.annotation.Nonnull + public List getHours() { + return hours; + } + + public void setHours(List hours) { + this.hours = hours; + } + + public ReverseEtlSpecificTimeScheduleConfig timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Timezone for the specified times. + * + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlSpecificTimeScheduleConfig reverseEtlSpecificTimeScheduleConfig = + (ReverseEtlSpecificTimeScheduleConfig) o; + return Objects.equals(this.days, reverseEtlSpecificTimeScheduleConfig.days) + && Objects.equals(this.hours, reverseEtlSpecificTimeScheduleConfig.hours) + && Objects.equals(this.timezone, reverseEtlSpecificTimeScheduleConfig.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(days, hours, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlSpecificTimeScheduleConfig {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" hours: ").append(toIndentedString(hours)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("days"); + openapiFields.add("hours"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("days"); + openapiRequiredFields.add("hours"); + openapiRequiredFields.add("timezone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlSpecificTimeScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlSpecificTimeScheduleConfig" + + " is not found in the empty JSON string", + ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlSpecificTimeScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlSpecificTimeScheduleConfig` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("days") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("days").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `days` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("days").toString())); + } + // ensure the required json array is present + if (jsonObj.get("hours") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("hours").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `hours` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("hours").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlSpecificTimeScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlSpecificTimeScheduleConfig' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ReverseEtlSpecificTimeScheduleConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlSpecificTimeScheduleConfig read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlSpecificTimeScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlSpecificTimeScheduleConfig + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlSpecificTimeScheduleConfig + */ + public static ReverseEtlSpecificTimeScheduleConfig fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlSpecificTimeScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlSpecificTimeScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java new file mode 100644 index 00000000..1e23a36d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Depending on the chosen strategy, configures the schedule for this model. */ +public class ScheduleConfig { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public ScheduleConfig() {} + + public ScheduleConfig interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Duration is specified as a string, eg: 15m, 3h25m30s. + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleConfig scheduleConfig = (ScheduleConfig) o; + return Objects.equals(this.interval, scheduleConfig.interval); + } + + @Override + public int hashCode() { + return Objects.hash(interval); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleConfig {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ScheduleConfig is not found in the" + + " empty JSON string", + ScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScheduleConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ScheduleConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScheduleConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScheduleConfig + * @throws IOException if the JSON string is invalid with respect to ScheduleConfig + */ + public static ScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScheduleConfig.class); + } + + /** + * Convert an instance of ScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 650a0a4cf014fa5d0c4f23092fb039baad06d164 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 2 Jul 2024 23:35:39 +0000 Subject: [PATCH 294/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d9ed50af. From 127c572b5c99a7a76d800cd6d1b4380a546a75be Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 3 Jul 2024 00:06:49 +0000 Subject: [PATCH 295/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d111258b. From 43db292b7096c9f20b183f1cb80019a22e83f458 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 3 Jul 2024 17:37:26 +0000 Subject: [PATCH 296/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7296bdc1. --- docs/FunctionsApi.md | 2 +- src/main/java/com/segment/publicapi/JSON.java | 14 - .../models/CreateFunctionV1Input.java | 2 - .../models/DestinationSubscription.java | 62 +--- .../segment/publicapi/models/Function.java | 2 - .../segment/publicapi/models/FunctionV1.java | 2 - .../publicapi/models/ListFunctionItemV1.java | 2 - .../publicapi/models/ReverseEtlModel.java | 42 +-- .../ReverseEtlPeriodicScheduleConfig.java | 213 ------------ .../models/ReverseEtlScheduleConfig.java | 305 ----------------- .../models/ReverseEtlScheduleDefinition.java | 295 ---------------- .../ReverseEtlSpecificTimeScheduleConfig.java | 321 ------------------ .../publicapi/models/ScheduleConfig.java | 206 ----------- 13 files changed, 18 insertions(+), 1450 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java delete mode 100644 src/main/java/com/segment/publicapi/models/ScheduleConfig.java diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index b35be929..15a621a8 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | ### Return type diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index fa692bc1..28018fcb 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1287,26 +1287,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ReverseETLSyncOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseEtlPeriodicScheduleConfig - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseEtlScheduleConfig - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseEtlScheduleDefinition - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseEtlSpecificTimeScheduleConfig - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ScheduleConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 2d938849..8ce751b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,8 +60,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 1db32a50..85fa7871 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -22,13 +22,11 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** DestinationSubscription */ public class DestinationSubscription { @@ -77,11 +75,6 @@ public class DestinationSubscription { @SerializedName(SERIALIZED_NAME_MODEL_ID) private String modelId; - public static final String SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE = "reverseETLSchedule"; - - @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE) - private Object reverseETLSchedule; - public DestinationSubscription() {} public DestinationSubscription id(String id) { @@ -273,26 +266,6 @@ public void setModelId(String modelId) { this.modelId = modelId; } - public DestinationSubscription reverseETLSchedule(Object reverseETLSchedule) { - - this.reverseETLSchedule = reverseETLSchedule; - return this; - } - - /** - * The schedule for the Reverse ETL subscription. - * - * @return reverseETLSchedule - */ - @javax.annotation.Nullable - public Object getReverseETLSchedule() { - return reverseETLSchedule; - } - - public void setReverseETLSchedule(Object reverseETLSchedule) { - this.reverseETLSchedule = reverseETLSchedule; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -310,40 +283,13 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, destinationSubscription.enabled) && Objects.equals(this.settings, destinationSubscription.settings) && Objects.equals(this.trigger, destinationSubscription.trigger) - && Objects.equals(this.modelId, destinationSubscription.modelId) - && Objects.equals( - this.reverseETLSchedule, destinationSubscription.reverseETLSchedule); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); + && Objects.equals(this.modelId, destinationSubscription.modelId); } @Override public int hashCode() { return Objects.hash( - id, - name, - actionId, - actionSlug, - destinationId, - enabled, - settings, - trigger, - modelId, - reverseETLSchedule); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + id, name, actionId, actionSlug, destinationId, enabled, settings, trigger, modelId); } @Override @@ -359,9 +305,6 @@ public String toString() { sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); - sb.append(" reverseETLSchedule: ") - .append(toIndentedString(reverseETLSchedule)) - .append("\n"); sb.append("}"); return sb.toString(); } @@ -392,7 +335,6 @@ private String toIndentedString(Object o) { openapiFields.add("settings"); openapiFields.add("trigger"); openapiFields.add("modelId"); - openapiFields.add("reverseETLSchedule"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index f4bd534b..12d7c2a2 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -48,8 +48,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index 4460e65b..7afbfac9 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -48,8 +48,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index 80517c9d..64a5572d 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -42,8 +42,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java index c2a61a5a..9b7249b2 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java @@ -22,12 +22,11 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** Defines a Reverse ETL Model. */ public class ReverseEtlModel { @@ -64,7 +63,7 @@ public class ReverseEtlModel { public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) - private ScheduleConfig scheduleConfig; + private Map scheduleConfig; public static final String SERIALIZED_NAME_QUERY = "query"; @@ -201,23 +200,32 @@ public void setScheduleStrategy(String scheduleStrategy) { this.scheduleStrategy = scheduleStrategy; } - public ReverseEtlModel scheduleConfig(ScheduleConfig scheduleConfig) { + public ReverseEtlModel scheduleConfig(Map scheduleConfig) { this.scheduleConfig = scheduleConfig; return this; } + public ReverseEtlModel putScheduleConfigItem(String key, Object scheduleConfigItem) { + if (this.scheduleConfig == null) { + this.scheduleConfig = new HashMap<>(); + } + this.scheduleConfig.put(key, scheduleConfigItem); + return this; + } + /** - * Get scheduleConfig + * Defines a configuration object used for scheduling, which can vary depending on the + * configured strategy, but must always be an object with at least 1 level of keys. * * @return scheduleConfig */ @javax.annotation.Nullable - public ScheduleConfig getScheduleConfig() { + public Map getScheduleConfig() { return scheduleConfig; } - public void setScheduleConfig(ScheduleConfig scheduleConfig) { + public void setScheduleConfig(Map scheduleConfig) { this.scheduleConfig = scheduleConfig; } @@ -283,15 +291,6 @@ public boolean equals(Object o) { this.queryIdentifierColumn, reverseEtlModel.queryIdentifierColumn); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash( @@ -306,13 +305,6 @@ public int hashCode() { queryIdentifierColumn); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -446,10 +438,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("scheduleStrategy").toString())); } - // validate the optional field `scheduleConfig` - if (jsonObj.get("scheduleConfig") != null && !jsonObj.get("scheduleConfig").isJsonNull()) { - ScheduleConfig.validateJsonElement(jsonObj.get("scheduleConfig")); - } if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java deleted file mode 100644 index bee34172..00000000 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Definition for periodic interval. */ -public class ReverseEtlPeriodicScheduleConfig { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; - - public ReverseEtlPeriodicScheduleConfig() {} - - public ReverseEtlPeriodicScheduleConfig interval(String interval) { - - this.interval = interval; - return this; - } - - /** - * Duration is specified as a string, eg: 15m, 3h25m30s. - * - * @return interval - */ - @javax.annotation.Nonnull - public String getInterval() { - return interval; - } - - public void setInterval(String interval) { - this.interval = interval; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReverseEtlPeriodicScheduleConfig reverseEtlPeriodicScheduleConfig = - (ReverseEtlPeriodicScheduleConfig) o; - return Objects.equals(this.interval, reverseEtlPeriodicScheduleConfig.interval); - } - - @Override - public int hashCode() { - return Objects.hash(interval); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReverseEtlPeriodicScheduleConfig {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReverseEtlPeriodicScheduleConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReverseEtlPeriodicScheduleConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReverseEtlPeriodicScheduleConfig is" - + " not found in the empty JSON string", - ReverseEtlPeriodicScheduleConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReverseEtlPeriodicScheduleConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReverseEtlPeriodicScheduleConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseEtlPeriodicScheduleConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseEtlPeriodicScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseEtlPeriodicScheduleConfig' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReverseEtlPeriodicScheduleConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReverseEtlPeriodicScheduleConfig read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReverseEtlPeriodicScheduleConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReverseEtlPeriodicScheduleConfig - * @throws IOException if the JSON string is invalid with respect to - * ReverseEtlPeriodicScheduleConfig - */ - public static ReverseEtlPeriodicScheduleConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseEtlPeriodicScheduleConfig.class); - } - - /** - * Convert an instance of ReverseEtlPeriodicScheduleConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java deleted file mode 100644 index 656a63b4..00000000 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class ReverseEtlScheduleConfig extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(ReverseEtlScheduleConfig.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseEtlScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseEtlScheduleConfig' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReverseEtlScheduleConfig value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { - JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { - JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } - - @Override - public ReverseEtlScheduleConfig read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize ReverseEtlPeriodicScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; - ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", - e); - } - // deserialize ReverseEtlSpecificTimeScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; - ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for ReverseEtlScheduleConfig:" - + " no class matches result, expected at least 1." - + " Detailed failure message for anyOf schemas: %s." - + " JSON: %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public ReverseEtlScheduleConfig() { - super("anyOf", Boolean.FALSE); - } - - public ReverseEtlScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public ReverseEtlScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - } - - @Override - public Map> getSchemas() { - return ReverseEtlScheduleConfig.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } - - /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` - */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReverseEtlScheduleConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" - + " schemas: ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of ReverseEtlScheduleConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReverseEtlScheduleConfig - * @throws IOException if the JSON string is invalid with respect to ReverseEtlScheduleConfig - */ - public static ReverseEtlScheduleConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseEtlScheduleConfig.class); - } - - /** - * Convert an instance of ReverseEtlScheduleConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java deleted file mode 100644 index 977d3b2c..00000000 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Defines a configuration object used for scheduling, which can vary depending on the configured - * strategy. - */ -public class ReverseEtlScheduleDefinition { - /** Strategy supports three modes: Periodic, Specific Days, or Manual. */ - @JsonAdapter(StrategyEnum.Adapter.class) - public enum StrategyEnum { - MANUAL("MANUAL"), - - PERIODIC("PERIODIC"), - - SPECIFIC_DAYS("SPECIFIC_DAYS"); - - private String value; - - StrategyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StrategyEnum fromValue(String value) { - for (StrategyEnum b : StrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StrategyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StrategyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STRATEGY = "strategy"; - - @SerializedName(SERIALIZED_NAME_STRATEGY) - private StrategyEnum strategy; - - public static final String SERIALIZED_NAME_CONFIG = "config"; - - @SerializedName(SERIALIZED_NAME_CONFIG) - private ReverseEtlScheduleConfig config; - - public ReverseEtlScheduleDefinition() {} - - public ReverseEtlScheduleDefinition strategy(StrategyEnum strategy) { - - this.strategy = strategy; - return this; - } - - /** - * Strategy supports three modes: Periodic, Specific Days, or Manual. - * - * @return strategy - */ - @javax.annotation.Nonnull - public StrategyEnum getStrategy() { - return strategy; - } - - public void setStrategy(StrategyEnum strategy) { - this.strategy = strategy; - } - - public ReverseEtlScheduleDefinition config(ReverseEtlScheduleConfig config) { - - this.config = config; - return this; - } - - /** - * Get config - * - * @return config - */ - @javax.annotation.Nonnull - public ReverseEtlScheduleConfig getConfig() { - return config; - } - - public void setConfig(ReverseEtlScheduleConfig config) { - this.config = config; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReverseEtlScheduleDefinition reverseEtlScheduleDefinition = - (ReverseEtlScheduleDefinition) o; - return Objects.equals(this.strategy, reverseEtlScheduleDefinition.strategy) - && Objects.equals(this.config, reverseEtlScheduleDefinition.config); - } - - @Override - public int hashCode() { - return Objects.hash(strategy, config); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReverseEtlScheduleDefinition {\n"); - sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("strategy"); - openapiFields.add("config"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("strategy"); - openapiRequiredFields.add("config"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReverseEtlScheduleDefinition - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReverseEtlScheduleDefinition.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReverseEtlScheduleDefinition is not" - + " found in the empty JSON string", - ReverseEtlScheduleDefinition.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReverseEtlScheduleDefinition.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReverseEtlScheduleDefinition` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseEtlScheduleDefinition.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("strategy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `strategy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("strategy").toString())); - } - // validate the required field `config` - ReverseEtlScheduleConfig.validateJsonElement(jsonObj.get("config")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseEtlScheduleDefinition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseEtlScheduleDefinition' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlScheduleDefinition.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReverseEtlScheduleDefinition value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReverseEtlScheduleDefinition read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReverseEtlScheduleDefinition given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReverseEtlScheduleDefinition - * @throws IOException if the JSON string is invalid with respect to - * ReverseEtlScheduleDefinition - */ - public static ReverseEtlScheduleDefinition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseEtlScheduleDefinition.class); - } - - /** - * Convert an instance of ReverseEtlScheduleDefinition to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java deleted file mode 100644 index 0641b8a3..00000000 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Definition for specific day and time schedule. Days is list of numbered day of the week and hours - * is a list of hour of the day. The corresponding Timezone is also input as string. - */ -public class ReverseEtlSpecificTimeScheduleConfig { - public static final String SERIALIZED_NAME_DAYS = "days"; - - @SerializedName(SERIALIZED_NAME_DAYS) - private List days = new ArrayList<>(); - - public static final String SERIALIZED_NAME_HOURS = "hours"; - - @SerializedName(SERIALIZED_NAME_HOURS) - private List hours = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - - @SerializedName(SERIALIZED_NAME_TIMEZONE) - private String timezone; - - public ReverseEtlSpecificTimeScheduleConfig() {} - - public ReverseEtlSpecificTimeScheduleConfig days(List days) { - - this.days = days; - return this; - } - - public ReverseEtlSpecificTimeScheduleConfig addDaysItem(BigDecimal daysItem) { - if (this.days == null) { - this.days = new ArrayList<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Days of the week. - * - * @return days - */ - @javax.annotation.Nonnull - public List getDays() { - return days; - } - - public void setDays(List days) { - this.days = days; - } - - public ReverseEtlSpecificTimeScheduleConfig hours(List hours) { - - this.hours = hours; - return this; - } - - public ReverseEtlSpecificTimeScheduleConfig addHoursItem(BigDecimal hoursItem) { - if (this.hours == null) { - this.hours = new ArrayList<>(); - } - this.hours.add(hoursItem); - return this; - } - - /** - * Hours of the day. - * - * @return hours - */ - @javax.annotation.Nonnull - public List getHours() { - return hours; - } - - public void setHours(List hours) { - this.hours = hours; - } - - public ReverseEtlSpecificTimeScheduleConfig timezone(String timezone) { - - this.timezone = timezone; - return this; - } - - /** - * Timezone for the specified times. - * - * @return timezone - */ - @javax.annotation.Nonnull - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReverseEtlSpecificTimeScheduleConfig reverseEtlSpecificTimeScheduleConfig = - (ReverseEtlSpecificTimeScheduleConfig) o; - return Objects.equals(this.days, reverseEtlSpecificTimeScheduleConfig.days) - && Objects.equals(this.hours, reverseEtlSpecificTimeScheduleConfig.hours) - && Objects.equals(this.timezone, reverseEtlSpecificTimeScheduleConfig.timezone); - } - - @Override - public int hashCode() { - return Objects.hash(days, hours, timezone); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReverseEtlSpecificTimeScheduleConfig {\n"); - sb.append(" days: ").append(toIndentedString(days)).append("\n"); - sb.append(" hours: ").append(toIndentedString(hours)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("days"); - openapiFields.add("hours"); - openapiFields.add("timezone"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("days"); - openapiRequiredFields.add("hours"); - openapiRequiredFields.add("timezone"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReverseEtlSpecificTimeScheduleConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReverseEtlSpecificTimeScheduleConfig" - + " is not found in the empty JSON string", - ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReverseEtlSpecificTimeScheduleConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReverseEtlSpecificTimeScheduleConfig` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("days") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("days").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `days` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("days").toString())); - } - // ensure the required json array is present - if (jsonObj.get("hours") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("hours").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `hours` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("hours").toString())); - } - if (!jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `timezone` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("timezone").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseEtlSpecificTimeScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseEtlSpecificTimeScheduleConfig' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, ReverseEtlSpecificTimeScheduleConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReverseEtlSpecificTimeScheduleConfig read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReverseEtlSpecificTimeScheduleConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReverseEtlSpecificTimeScheduleConfig - * @throws IOException if the JSON string is invalid with respect to - * ReverseEtlSpecificTimeScheduleConfig - */ - public static ReverseEtlSpecificTimeScheduleConfig fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseEtlSpecificTimeScheduleConfig.class); - } - - /** - * Convert an instance of ReverseEtlSpecificTimeScheduleConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java deleted file mode 100644 index 1e23a36d..00000000 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Depending on the chosen strategy, configures the schedule for this model. */ -public class ScheduleConfig { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; - - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; - - public ScheduleConfig() {} - - public ScheduleConfig interval(String interval) { - - this.interval = interval; - return this; - } - - /** - * Duration is specified as a string, eg: 15m, 3h25m30s. - * - * @return interval - */ - @javax.annotation.Nonnull - public String getInterval() { - return interval; - } - - public void setInterval(String interval) { - this.interval = interval; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScheduleConfig scheduleConfig = (ScheduleConfig) o; - return Objects.equals(this.interval, scheduleConfig.interval); - } - - @Override - public int hashCode() { - return Objects.hash(interval); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScheduleConfig {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ScheduleConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ScheduleConfig is not found in the" - + " empty JSON string", - ScheduleConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ScheduleConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ScheduleConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ScheduleConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ScheduleConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ScheduleConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ScheduleConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ScheduleConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ScheduleConfig - * @throws IOException if the JSON string is invalid with respect to ScheduleConfig - */ - public static ScheduleConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ScheduleConfig.class); - } - - /** - * Convert an instance of ScheduleConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 12ff8b720e6478532de55ae0d188ccc861b083df Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 4 Jul 2024 17:05:12 +0000 Subject: [PATCH 297/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3b784558. From b83f52fcdb6e19252a343e61f7eeff6e002ce784 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 11 Jul 2024 17:15:08 +0000 Subject: [PATCH 298/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@19cef016. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 16 + .../com/segment/publicapi/models/Config.java | 209 ++++++++++++ .../models/DestinationSubscription.java | 62 +++- .../segment/publicapi/models/Function.java | 2 + .../segment/publicapi/models/FunctionV1.java | 2 + .../publicapi/models/ListFunctionItemV1.java | 2 + .../publicapi/models/ReverseEtlModel.java | 42 ++- .../ReverseEtlPeriodicScheduleConfig.java | 213 ++++++++++++ .../models/ReverseEtlScheduleConfig.java | 305 +++++++++++++++++ .../models/ReverseEtlScheduleDefinition.java | 314 +++++++++++++++++ .../ReverseEtlSpecificTimeScheduleConfig.java | 321 ++++++++++++++++++ .../publicapi/models/ScheduleConfig.java | 206 +++++++++++ 16 files changed, 1684 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/Config.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/ScheduleConfig.java diff --git a/README.md b/README.md index 1f412f5f..d256b534 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 50.2.0 +Latest API and SDK version: 50.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 50.2.0 + 50.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:50.2.0" + implementation "com.segment.publicapi:segment-publicapi:50.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-50.2.0.jar` +* `target/segment-publicapi-50.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 9ad1465c..209f9a07 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 50.2.0 + 50.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 72c2e970..4276a3f5 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 50.2.0 (Java)"); + setUserAgent("Public API SDK 50.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 68ec30c0..d8f15312 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "50.2.0"; + public static final String VERSION = "50.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 28018fcb..83d0ff97 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -192,6 +192,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ComputedTraitsDefinition .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1287,12 +1289,26 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ReverseETLSyncOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlPeriodicScheduleConfig + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlScheduleConfig + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlScheduleDefinition + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlSpecificTimeScheduleConfig + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RoleV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ScheduleConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java new file mode 100644 index 00000000..63ff722e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Config contains interval duration in case of periodic or day and hours in case of specific_days. + * Empty if strategy is MANUAL. + */ +public class Config { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public Config() {} + + public Config interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Duration is specified as a string, eg: 15m, 3h25m30s. + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Config config = (Config) o; + return Objects.equals(this.interval, config.interval); + } + + @Override + public int hashCode() { + return Objects.hash(interval); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Config {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Config + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Config.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Config is not found in the empty JSON" + + " string", + Config.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Config.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Config`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Config.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Config.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Config' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Config.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Config value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Config read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Config given an JSON string + * + * @param jsonString JSON string + * @return An instance of Config + * @throws IOException if the JSON string is invalid with respect to Config + */ + public static Config fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Config.class); + } + + /** + * Convert an instance of Config to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 85fa7871..1db32a50 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -22,11 +22,13 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; /** DestinationSubscription */ public class DestinationSubscription { @@ -75,6 +77,11 @@ public class DestinationSubscription { @SerializedName(SERIALIZED_NAME_MODEL_ID) private String modelId; + public static final String SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE = "reverseETLSchedule"; + + @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE) + private Object reverseETLSchedule; + public DestinationSubscription() {} public DestinationSubscription id(String id) { @@ -266,6 +273,26 @@ public void setModelId(String modelId) { this.modelId = modelId; } + public DestinationSubscription reverseETLSchedule(Object reverseETLSchedule) { + + this.reverseETLSchedule = reverseETLSchedule; + return this; + } + + /** + * The schedule for the Reverse ETL subscription. + * + * @return reverseETLSchedule + */ + @javax.annotation.Nullable + public Object getReverseETLSchedule() { + return reverseETLSchedule; + } + + public void setReverseETLSchedule(Object reverseETLSchedule) { + this.reverseETLSchedule = reverseETLSchedule; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -283,13 +310,40 @@ public boolean equals(Object o) { && Objects.equals(this.enabled, destinationSubscription.enabled) && Objects.equals(this.settings, destinationSubscription.settings) && Objects.equals(this.trigger, destinationSubscription.trigger) - && Objects.equals(this.modelId, destinationSubscription.modelId); + && Objects.equals(this.modelId, destinationSubscription.modelId) + && Objects.equals( + this.reverseETLSchedule, destinationSubscription.reverseETLSchedule); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { return Objects.hash( - id, name, actionId, actionSlug, destinationId, enabled, settings, trigger, modelId); + id, + name, + actionId, + actionSlug, + destinationId, + enabled, + settings, + trigger, + modelId, + reverseETLSchedule); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } @Override @@ -305,6 +359,9 @@ public String toString() { sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" reverseETLSchedule: ") + .append(toIndentedString(reverseETLSchedule)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -335,6 +392,7 @@ private String toIndentedString(Object o) { openapiFields.add("settings"); openapiFields.add("trigger"); openapiFields.add("modelId"); + openapiFields.add("reverseETLSchedule"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java index 12d7c2a2..f4bd534b 100644 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -48,6 +48,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/FunctionV1.java b/src/main/java/com/segment/publicapi/models/FunctionV1.java index 7afbfac9..4460e65b 100644 --- a/src/main/java/com/segment/publicapi/models/FunctionV1.java +++ b/src/main/java/com/segment/publicapi/models/FunctionV1.java @@ -48,6 +48,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java index 64a5572d..80517c9d 100644 --- a/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java +++ b/src/main/java/com/segment/publicapi/models/ListFunctionItemV1.java @@ -42,6 +42,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java index 9b7249b2..c2a61a5a 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java @@ -22,11 +22,12 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashMap; +import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; /** Defines a Reverse ETL Model. */ public class ReverseEtlModel { @@ -63,7 +64,7 @@ public class ReverseEtlModel { public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) - private Map scheduleConfig; + private ScheduleConfig scheduleConfig; public static final String SERIALIZED_NAME_QUERY = "query"; @@ -200,32 +201,23 @@ public void setScheduleStrategy(String scheduleStrategy) { this.scheduleStrategy = scheduleStrategy; } - public ReverseEtlModel scheduleConfig(Map scheduleConfig) { + public ReverseEtlModel scheduleConfig(ScheduleConfig scheduleConfig) { this.scheduleConfig = scheduleConfig; return this; } - public ReverseEtlModel putScheduleConfigItem(String key, Object scheduleConfigItem) { - if (this.scheduleConfig == null) { - this.scheduleConfig = new HashMap<>(); - } - this.scheduleConfig.put(key, scheduleConfigItem); - return this; - } - /** - * Defines a configuration object used for scheduling, which can vary depending on the - * configured strategy, but must always be an object with at least 1 level of keys. + * Get scheduleConfig * * @return scheduleConfig */ @javax.annotation.Nullable - public Map getScheduleConfig() { + public ScheduleConfig getScheduleConfig() { return scheduleConfig; } - public void setScheduleConfig(Map scheduleConfig) { + public void setScheduleConfig(ScheduleConfig scheduleConfig) { this.scheduleConfig = scheduleConfig; } @@ -291,6 +283,15 @@ public boolean equals(Object o) { this.queryIdentifierColumn, reverseEtlModel.queryIdentifierColumn); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { return Objects.hash( @@ -305,6 +306,13 @@ public int hashCode() { queryIdentifierColumn); } + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -438,6 +446,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("scheduleStrategy").toString())); } + // validate the optional field `scheduleConfig` + if (jsonObj.get("scheduleConfig") != null && !jsonObj.get("scheduleConfig").isJsonNull()) { + ScheduleConfig.validateJsonElement(jsonObj.get("scheduleConfig")); + } if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java new file mode 100644 index 00000000..bee34172 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java @@ -0,0 +1,213 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Definition for periodic interval. */ +public class ReverseEtlPeriodicScheduleConfig { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public ReverseEtlPeriodicScheduleConfig() {} + + public ReverseEtlPeriodicScheduleConfig interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Duration is specified as a string, eg: 15m, 3h25m30s. + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlPeriodicScheduleConfig reverseEtlPeriodicScheduleConfig = + (ReverseEtlPeriodicScheduleConfig) o; + return Objects.equals(this.interval, reverseEtlPeriodicScheduleConfig.interval); + } + + @Override + public int hashCode() { + return Objects.hash(interval); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlPeriodicScheduleConfig {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlPeriodicScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlPeriodicScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlPeriodicScheduleConfig is" + + " not found in the empty JSON string", + ReverseEtlPeriodicScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlPeriodicScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlPeriodicScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlPeriodicScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlPeriodicScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlPeriodicScheduleConfig' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlPeriodicScheduleConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlPeriodicScheduleConfig read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlPeriodicScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlPeriodicScheduleConfig + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlPeriodicScheduleConfig + */ + public static ReverseEtlPeriodicScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlPeriodicScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlPeriodicScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java new file mode 100644 index 00000000..656a63b4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java @@ -0,0 +1,305 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class ReverseEtlScheduleConfig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ReverseEtlScheduleConfig.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlScheduleConfig' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlScheduleConfig value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public ReverseEtlScheduleConfig read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for ReverseEtlScheduleConfig:" + + " no class matches result, expected at least 1." + + " Detailed failure message for anyOf schemas: %s." + + " JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public ReverseEtlScheduleConfig() { + super("anyOf", Boolean.FALSE); + } + + public ReverseEtlScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public ReverseEtlScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + } + + @Override + public Map> getSchemas() { + return ReverseEtlScheduleConfig.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + /** + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReverseEtlScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" + + " schemas: ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of ReverseEtlScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlScheduleConfig + * @throws IOException if the JSON string is invalid with respect to ReverseEtlScheduleConfig + */ + public static ReverseEtlScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java new file mode 100644 index 00000000..8a222746 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -0,0 +1,314 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Defines a configuration object used for scheduling, which can vary depending on the configured + * strategy. + */ +public class ReverseEtlScheduleDefinition { + /** Strategy supports three modes: Periodic, Specific Days, or Manual. */ + @JsonAdapter(StrategyEnum.Adapter.class) + public enum StrategyEnum { + MANUAL("MANUAL"), + + PERIODIC("PERIODIC"), + + SPECIFIC_DAYS("SPECIFIC_DAYS"); + + private String value; + + StrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrategyEnum fromValue(String value) { + for (StrategyEnum b : StrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + + @SerializedName(SERIALIZED_NAME_STRATEGY) + private StrategyEnum strategy; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + private Config config; + + public ReverseEtlScheduleDefinition() {} + + public ReverseEtlScheduleDefinition strategy(StrategyEnum strategy) { + + this.strategy = strategy; + return this; + } + + /** + * Strategy supports three modes: Periodic, Specific Days, or Manual. + * + * @return strategy + */ + @javax.annotation.Nonnull + public StrategyEnum getStrategy() { + return strategy; + } + + public void setStrategy(StrategyEnum strategy) { + this.strategy = strategy; + } + + public ReverseEtlScheduleDefinition config(Config config) { + + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlScheduleDefinition reverseEtlScheduleDefinition = + (ReverseEtlScheduleDefinition) o; + return Objects.equals(this.strategy, reverseEtlScheduleDefinition.strategy) + && Objects.equals(this.config, reverseEtlScheduleDefinition.config); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(strategy, config); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlScheduleDefinition {\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("strategy"); + openapiFields.add("config"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("strategy"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlScheduleDefinition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlScheduleDefinition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlScheduleDefinition is not" + + " found in the empty JSON string", + ReverseEtlScheduleDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlScheduleDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlScheduleDefinition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlScheduleDefinition.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `strategy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("strategy").toString())); + } + // validate the optional field `config` + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + Config.validateJsonElement(jsonObj.get("config")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlScheduleDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlScheduleDefinition' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlScheduleDefinition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlScheduleDefinition value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlScheduleDefinition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlScheduleDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlScheduleDefinition + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlScheduleDefinition + */ + public static ReverseEtlScheduleDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlScheduleDefinition.class); + } + + /** + * Convert an instance of ReverseEtlScheduleDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java new file mode 100644 index 00000000..0641b8a3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlSpecificTimeScheduleConfig.java @@ -0,0 +1,321 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Definition for specific day and time schedule. Days is list of numbered day of the week and hours + * is a list of hour of the day. The corresponding Timezone is also input as string. + */ +public class ReverseEtlSpecificTimeScheduleConfig { + public static final String SERIALIZED_NAME_DAYS = "days"; + + @SerializedName(SERIALIZED_NAME_DAYS) + private List days = new ArrayList<>(); + + public static final String SERIALIZED_NAME_HOURS = "hours"; + + @SerializedName(SERIALIZED_NAME_HOURS) + private List hours = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; + + public ReverseEtlSpecificTimeScheduleConfig() {} + + public ReverseEtlSpecificTimeScheduleConfig days(List days) { + + this.days = days; + return this; + } + + public ReverseEtlSpecificTimeScheduleConfig addDaysItem(BigDecimal daysItem) { + if (this.days == null) { + this.days = new ArrayList<>(); + } + this.days.add(daysItem); + return this; + } + + /** + * Days of the week. + * + * @return days + */ + @javax.annotation.Nonnull + public List getDays() { + return days; + } + + public void setDays(List days) { + this.days = days; + } + + public ReverseEtlSpecificTimeScheduleConfig hours(List hours) { + + this.hours = hours; + return this; + } + + public ReverseEtlSpecificTimeScheduleConfig addHoursItem(BigDecimal hoursItem) { + if (this.hours == null) { + this.hours = new ArrayList<>(); + } + this.hours.add(hoursItem); + return this; + } + + /** + * Hours of the day. + * + * @return hours + */ + @javax.annotation.Nonnull + public List getHours() { + return hours; + } + + public void setHours(List hours) { + this.hours = hours; + } + + public ReverseEtlSpecificTimeScheduleConfig timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Timezone for the specified times. + * + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlSpecificTimeScheduleConfig reverseEtlSpecificTimeScheduleConfig = + (ReverseEtlSpecificTimeScheduleConfig) o; + return Objects.equals(this.days, reverseEtlSpecificTimeScheduleConfig.days) + && Objects.equals(this.hours, reverseEtlSpecificTimeScheduleConfig.hours) + && Objects.equals(this.timezone, reverseEtlSpecificTimeScheduleConfig.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(days, hours, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlSpecificTimeScheduleConfig {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" hours: ").append(toIndentedString(hours)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("days"); + openapiFields.add("hours"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("days"); + openapiRequiredFields.add("hours"); + openapiRequiredFields.add("timezone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlSpecificTimeScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlSpecificTimeScheduleConfig" + + " is not found in the empty JSON string", + ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlSpecificTimeScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlSpecificTimeScheduleConfig` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlSpecificTimeScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("days") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("days").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `days` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("days").toString())); + } + // ensure the required json array is present + if (jsonObj.get("hours") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("hours").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `hours` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("hours").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlSpecificTimeScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlSpecificTimeScheduleConfig' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ReverseEtlSpecificTimeScheduleConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlSpecificTimeScheduleConfig read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlSpecificTimeScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlSpecificTimeScheduleConfig + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlSpecificTimeScheduleConfig + */ + public static ReverseEtlSpecificTimeScheduleConfig fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlSpecificTimeScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlSpecificTimeScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java new file mode 100644 index 00000000..1e23a36d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Depending on the chosen strategy, configures the schedule for this model. */ +public class ScheduleConfig { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public ScheduleConfig() {} + + public ScheduleConfig interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Duration is specified as a string, eg: 15m, 3h25m30s. + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleConfig scheduleConfig = (ScheduleConfig) o; + return Objects.equals(this.interval, scheduleConfig.interval); + } + + @Override + public int hashCode() { + return Objects.hash(interval); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleConfig {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ScheduleConfig is not found in the" + + " empty JSON string", + ScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScheduleConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ScheduleConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScheduleConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScheduleConfig + * @throws IOException if the JSON string is invalid with respect to ScheduleConfig + */ + public static ScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScheduleConfig.class); + } + + /** + * Convert an instance of ScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From fbb336e1f8a01f066c55f5a8c209d4f8f52ac27e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 12 Jul 2024 17:55:39 +0000 Subject: [PATCH 299/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@07910387. From 7d6936c16c4357d79a5a8b76e6b7890f8817f9c6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 12 Jul 2024 18:07:23 +0000 Subject: [PATCH 300/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@aa445e17. From 78441827478bb543cbe786083c2e7441e8c223bd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 13 Jul 2024 07:29:54 +0000 Subject: [PATCH 301/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d07bdacb. From 8b46558b4552ed68a97e39ff24e46e2f8fdc2e8a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 13 Jul 2024 08:07:37 +0000 Subject: [PATCH 302/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8d07d129. From de6c0276d669362b7cd5671f2dc00d7dd0d114eb Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 13 Jul 2024 08:33:53 +0000 Subject: [PATCH 303/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@fc911ba9. From a20e36a64ace2a83ab1b286b9d64ca749167bd89 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 16 Jul 2024 11:19:28 +0000 Subject: [PATCH 304/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6612854f. From 5da05f1d62943cf8c88e93423eef8c38f1486ea6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 19 Jul 2024 11:41:35 +0000 Subject: [PATCH 305/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a77e29fd. --- README.md | 8 ++--- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- .../DestinationMetadataActionFieldV1.java | 33 +++++++++++++++++-- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d256b534..3e159d7f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 50.3.0 +Latest API and SDK version: 50.4.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 50.3.0 + 50.4.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:50.3.0" + implementation "com.segment.publicapi:segment-publicapi:50.4.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-50.3.0.jar` +* `target/segment-publicapi-50.4.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 209f9a07..4326dfbc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 50.3.0 + 50.4.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 4276a3f5..d6d4fcaf 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 50.3.0 (Java)"); + setUserAgent("Public API SDK 50.4.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index d8f15312..a79f8855 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "50.3.0"; + public static final String VERSION = "50.4.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java index a22f558b..2fb18617 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataActionFieldV1.java @@ -158,6 +158,11 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ALLOW_NULL) private Boolean allowNull; + public static final String SERIALIZED_NAME_HIDDEN = "hidden"; + + @SerializedName(SERIALIZED_NAME_HIDDEN) + private Boolean hidden; + public DestinationMetadataActionFieldV1() {} public DestinationMetadataActionFieldV1 id(String id) { @@ -423,6 +428,26 @@ public void setAllowNull(Boolean allowNull) { this.allowNull = allowNull; } + public DestinationMetadataActionFieldV1 hidden(Boolean hidden) { + + this.hidden = hidden; + return this; + } + + /** + * Whether the action field should be hidden or not. + * + * @return hidden + */ + @javax.annotation.Nullable + public Boolean getHidden() { + return hidden; + } + + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -445,7 +470,8 @@ public boolean equals(Object o) { && Objects.equals(this.multiple, destinationMetadataActionFieldV1.multiple) && Objects.equals(this.choices, destinationMetadataActionFieldV1.choices) && Objects.equals(this.dynamic, destinationMetadataActionFieldV1.dynamic) - && Objects.equals(this.allowNull, destinationMetadataActionFieldV1.allowNull); + && Objects.equals(this.allowNull, destinationMetadataActionFieldV1.allowNull) + && Objects.equals(this.hidden, destinationMetadataActionFieldV1.hidden); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -472,7 +498,8 @@ public int hashCode() { multiple, choices, dynamic, - allowNull); + allowNull, + hidden); } private static int hashCodeNullable(JsonNullable a) { @@ -499,6 +526,7 @@ public String toString() { sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); sb.append(" dynamic: ").append(toIndentedString(dynamic)).append("\n"); sb.append(" allowNull: ").append(toIndentedString(allowNull)).append("\n"); + sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); sb.append("}"); return sb.toString(); } @@ -533,6 +561,7 @@ private String toIndentedString(Object o) { openapiFields.add("choices"); openapiFields.add("dynamic"); openapiFields.add("allowNull"); + openapiFields.add("hidden"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); From a32c07d43cf6804fd33c9047695b24c36d2847ec Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 22 Jul 2024 06:48:51 +0000 Subject: [PATCH 306/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ac62c1f4. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/Configuration.java | 2 +- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++------- .../java/com/segment/publicapi/models/Definition1.java | 10 +++++++--- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 3e159d7f..f1457c87 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 50.4.0 +Latest API and SDK version: 51.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 50.4.0 + 51.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:50.4.0" + implementation "com.segment.publicapi:segment-publicapi:51.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-50.4.0.jar` +* `target/segment-publicapi-51.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 4326dfbc..b46c8052 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 50.4.0 + 51.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d6d4fcaf..9477e0be 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 50.4.0 (Java)"); + setUserAgent("Public API SDK 51.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index a79f8855..6325773f 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "50.4.0"; + public static final String VERSION = "51.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index a1266e2b..f2d34d1c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition1 definition) { + public AudienceSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index d88aeba3..c9b644f2 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition definition) { + public ComputedTraitSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index 012d83c6..d8aa8981 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,8 +36,7 @@ public class Definition { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index e6c5ae7d..ed071aaa 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,7 +36,8 @@ public class Definition1 { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition1 query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ From 0c4884e37d92d77f9d819b974003bb003701b25d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 22 Jul 2024 07:28:14 +0000 Subject: [PATCH 307/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ac62c1f4. --- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++++++--- .../java/com/segment/publicapi/models/Definition1.java | 10 +++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index f2d34d1c..a1266e2b 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition definition) { + public AudienceSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index c9b644f2..d88aeba3 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition1 definition) { + public ComputedTraitSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index d8aa8981..012d83c6 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,7 +36,8 @@ public class Definition { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index ed071aaa..e6c5ae7d 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,8 +36,7 @@ public class Definition1 { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition1 query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ From fc9a040cbcb258daa9ec408a2c8dd4c68f20a0b9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 22 Jul 2024 09:44:55 +0000 Subject: [PATCH 308/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e49b8279. From ced6f21269330d54092ed48b822020f6ec752fa9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 23 Jul 2024 11:56:29 +0000 Subject: [PATCH 309/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@04b71350. --- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++------- .../java/com/segment/publicapi/models/Definition1.java | 10 +++++++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index a1266e2b..f2d34d1c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition1 definition) { + public AudienceSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index d88aeba3..c9b644f2 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition definition) { + public ComputedTraitSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index 012d83c6..d8aa8981 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,8 +36,7 @@ public class Definition { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index e6c5ae7d..ed071aaa 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,7 +36,8 @@ public class Definition1 { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition1 query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ From 7148eb9acac2b29354b426d1ed7111f964a52e14 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 24 Jul 2024 05:12:23 +0000 Subject: [PATCH 310/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4cc9f446. --- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++++++--- .../java/com/segment/publicapi/models/Definition1.java | 10 +++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index f2d34d1c..a1266e2b 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition definition) { + public AudienceSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index c9b644f2..d88aeba3 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition1 definition) { + public ComputedTraitSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index d8aa8981..012d83c6 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,7 +36,8 @@ public class Definition { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index ed071aaa..e6c5ae7d 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,8 +36,7 @@ public class Definition1 { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition1 query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ From a566c261dd73ffa30a66bfae549b02af24d8baa8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 24 Jul 2024 05:45:37 +0000 Subject: [PATCH 311/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@1252c929. From 52feb627f631251e7e9b80fb56a78a846c87b8ad Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 30 Jul 2024 09:13:21 +0000 Subject: [PATCH 312/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6e341066. --- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++------- .../java/com/segment/publicapi/models/Definition1.java | 10 +++++++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index a1266e2b..f2d34d1c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition1 definition) { + public AudienceSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index d88aeba3..c9b644f2 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition definition) { + public ComputedTraitSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index 012d83c6..d8aa8981 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,8 +36,7 @@ public class Definition { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index e6c5ae7d..ed071aaa 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,7 +36,8 @@ public class Definition1 { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition1 query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ From 121ea8e2ce885c21c79e823c7824b70333937786 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 30 Jul 2024 09:47:22 +0000 Subject: [PATCH 313/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5de2fb00. --- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++++++--- .../java/com/segment/publicapi/models/Definition1.java | 10 +++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index f2d34d1c..a1266e2b 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition definition) { + public AudienceSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index c9b644f2..d88aeba3 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition1 definition) { + public ComputedTraitSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index d8aa8981..012d83c6 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,7 +36,8 @@ public class Definition { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index ed071aaa..e6c5ae7d 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,8 +36,7 @@ public class Definition1 { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition1 query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ From bbc9239d3fd8daa6eb0aed854261369e6279c1f8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 31 Jul 2024 17:41:27 +0000 Subject: [PATCH 314/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7baf47c8. From 05a9ec9a441dbd3183d993430c662b6bbdcedd00 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 5 Aug 2024 10:10:40 +0000 Subject: [PATCH 315/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6dd6842d. From e6229232d10314a858af148a8d15863116741665 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 6 Aug 2024 16:30:38 +0000 Subject: [PATCH 316/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8ecb9ef6. --- README.md | 8 +- docs/DeliveryOverviewApi.md | 54 ++-- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- .../publicapi/api/DeliveryOverviewApi.java | 268 ++++++++++-------- .../DeliveryOverviewDestinationFilterBy.java | 151 +++++++++- .../DeliveryOverviewSourceFilterBy.java | 143 +++++++++- ...yOverviewSuccessfullyReceivedFilterBy.java | 147 +++++++++- 9 files changed, 611 insertions(+), 166 deletions(-) diff --git a/README.md b/README.md index f1457c87..b81c101b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 51.0.0 +Latest API and SDK version: 52.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 51.0.0 + 52.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:51.0.0" + implementation "com.segment.publicapi:segment-publicapi:52.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-51.0.0.jar` +* `target/segment-publicapi-52.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index 97f80bb8..98718d00 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -45,9 +45,9 @@ public class Example { String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, and/or `subscriptionId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getEgressFailedMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -72,9 +72,9 @@ public class Example { | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, and/or `subscriptionId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -132,9 +132,9 @@ public class Example { String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, and/or `subscriptionId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getEgressSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -159,9 +159,9 @@ public class Example { | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, and/or `subscriptionId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -189,7 +189,7 @@ public class Example { ## Operation: getFilteredAtDestinationMetricsFromDeliveryOverview -> GetEgressFailedMetricsFromDeliveryOverview200Response getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination, subscriptionId) +> GetEgressFailedMetricsFromDeliveryOverview200Response getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination) Get Filtered At Destination Metrics from Delivery Overview @@ -219,13 +219,12 @@ public class Example { String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, and/or `subscriptionId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. - String subscriptionId = "subscriptionId_example"; // String | An optional filter for actions destinations, to filter by a specific action. This parameter exists in beta. try { - GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination, subscriptionId); + GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DeliveryOverviewApi#getFilteredAtDestinationMetricsFromDeliveryOverview"); @@ -247,11 +246,10 @@ public class Example { | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, and/or `subscriptionId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | -| **subscriptionId** | **String**| An optional filter for actions destinations, to filter by a specific action. This parameter exists in beta. | [optional] | ### Return type @@ -307,9 +305,9 @@ public class Example { String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion` `activationId`, `audienceId`, and `spaceId`, . This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtSourceMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -333,9 +331,9 @@ public class Example { | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion` `activationId`, `audienceId`, and `spaceId`, . This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -392,9 +390,9 @@ public class Example { String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`,`activationId`, `audienceId`, and/or `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getIngressFailedMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -418,9 +416,9 @@ public class Example { | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`,`activationId`, `audienceId`, and/or `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -477,9 +475,9 @@ public class Example { String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, and `appVersion`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSuccessfullyReceivedFilterBy filter = new DeliveryOverviewSuccessfullyReceivedFilterBy(); // DeliveryOverviewSuccessfullyReceivedFilterBy | An optional filter for `eventName`, `eventType`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSuccessfullyReceivedFilterBy filter = new DeliveryOverviewSuccessfullyReceivedFilterBy(); // DeliveryOverviewSuccessfullyReceivedFilterBy | An optional filter for `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getIngressSuccessMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -503,9 +501,9 @@ public class Example { | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, and `appVersion`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSuccessfullyReceivedFilterBy**](.md)| An optional filter for `eventName`, `eventType`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSuccessfullyReceivedFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index b46c8052..5b6e9405 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 51.0.0 + 52.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9477e0be..e0b1d518 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 51.0.0 (Java)"); + setUserAgent("Public API SDK 52.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 6325773f..2d59dc54 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "51.0.0"; + public static final String VERSION = "52.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index f28a3d17..dfd3446e 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -78,8 +78,9 @@ public void setCustomBaseUrl(String customBaseUrl) { * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -87,9 +88,9 @@ public void setCustomBaseUrl(String customBaseUrl) { * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback Callback for upload/download progress @@ -276,8 +277,9 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -285,9 +287,9 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -339,8 +341,9 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -348,9 +351,9 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -405,8 +408,9 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -414,9 +418,9 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback The callback to be executed when the API call finishes @@ -473,8 +477,9 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -482,9 +487,10 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. If you would like to view retry - * attempts for a successful delivery, you can filter `discardReason` from + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -673,8 +679,9 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -682,9 +689,10 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. If you would like to view retry - * attempts for a successful delivery, you can filter `discardReason` from + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -738,8 +746,9 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -747,9 +756,10 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. If you would like to view retry - * attempts for a successful delivery, you can filter `discardReason` from + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -806,8 +816,9 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -815,9 +826,10 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. If you would like to view retry - * attempts for a successful delivery, you can filter `discardReason` from + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -876,8 +888,9 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, and `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -885,13 +898,11 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) - * @param subscriptionId An optional filter for actions destinations, to filter by a specific - * action. This parameter exists in beta. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -913,7 +924,6 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewCall( String granularity, DeliveryOverviewDestinationFilterBy filter, PaginationInput pagination, - String subscriptionId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -975,11 +985,6 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } - if (subscriptionId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("subscriptionId", subscriptionId)); - } - final String[] localVarAccepts = { "application/vnd.segment.v1beta+json", "application/json" }; @@ -1020,7 +1025,6 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate String granularity, DeliveryOverviewDestinationFilterBy filter, PaginationInput pagination, - String subscriptionId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'sourceId' is set @@ -1067,7 +1071,6 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate granularity, filter, pagination, - subscriptionId, _callback); } @@ -1084,8 +1087,9 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, and `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -1093,13 +1097,11 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) - * @param subscriptionId An optional filter for actions destinations, to filter by a specific - * action. This parameter exists in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1121,8 +1123,7 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate List groupBy, String granularity, DeliveryOverviewDestinationFilterBy filter, - PaginationInput pagination, - String subscriptionId) + PaginationInput pagination) throws ApiException { ApiResponse localVarResp = getFilteredAtDestinationMetricsFromDeliveryOverviewWithHttpInfo( @@ -1133,8 +1134,7 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate groupBy, granularity, filter, - pagination, - subscriptionId); + pagination); return localVarResp.getData(); } @@ -1151,8 +1151,9 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, and `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -1160,13 +1161,11 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) - * @param subscriptionId An optional filter for actions destinations, to filter by a specific - * action. This parameter exists in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1188,8 +1187,7 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate List groupBy, String granularity, DeliveryOverviewDestinationFilterBy filter, - PaginationInput pagination, - String subscriptionId) + PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = getFilteredAtDestinationMetricsFromDeliveryOverviewValidateBeforeCall( @@ -1201,7 +1199,6 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate granularity, filter, pagination, - subscriptionId, null); Type localVarReturnType = new TypeToken() {}.getType(); @@ -1221,8 +1218,9 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`. This - * parameter exists in beta. (optional) + * `discardReason`, `appVersion`, and `subscriptionId`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time @@ -1230,13 +1228,11 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, and/or `subscriptionId` that - * can be applied in addition to a `groupBy`. This parameter exists in beta. - * (optional) + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) - * @param subscriptionId An optional filter for actions destinations, to filter by a specific - * action. This parameter exists in beta. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1259,7 +1255,6 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( String granularity, DeliveryOverviewDestinationFilterBy filter, PaginationInput pagination, - String subscriptionId, final ApiCallback _callback) throws ApiException { @@ -1273,7 +1268,6 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( granularity, filter, pagination, - subscriptionId, _callback); Type localVarReturnType = new TypeToken() {}.getType(); @@ -1291,7 +1285,8 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion` `activationId`, + * `audienceId`, and `spaceId`, . This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1300,8 +1295,9 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback Callback for upload/download progress @@ -1464,7 +1460,8 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion` `activationId`, + * `audienceId`, and `spaceId`, . This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1473,8 +1470,9 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1516,7 +1514,8 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion` `activationId`, + * `audienceId`, and `spaceId`, . This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1525,8 +1524,9 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1577,7 +1577,8 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion` `activationId`, + * `audienceId`, and `spaceId`, . This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1586,8 +1587,9 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback The callback to be executed when the API call finishes @@ -1640,7 +1642,8 @@ public okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion`,`activationId`, + * `audienceId`, and/or `spaceId`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1649,8 +1652,9 @@ public okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewAsync( * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback Callback for upload/download progress @@ -1812,7 +1816,8 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion`,`activationId`, + * `audienceId`, and/or `spaceId`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1821,8 +1826,9 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1863,7 +1869,8 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion`,`activationId`, + * `audienceId`, and/or `spaceId`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1872,8 +1879,9 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1924,7 +1932,8 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * `discardReason`, `appVersion`,`activationId`, + * `audienceId`, and/or `spaceId`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1933,8 +1942,9 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, `appVersion`, `activationId`, + * `audienceId`, and/or `spaceId` that can be applied in addition to a + * `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback The callback to be executed when the API call finishes @@ -1986,16 +1996,18 @@ public okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewAsync( * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and + * `spaceId`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and/or + * `spaceId` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2158,16 +2170,18 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and + * `spaceId`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and/or + * `spaceId` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2209,16 +2223,18 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and + * `spaceId`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and/or + * `spaceId` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2269,16 +2285,18 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and + * `spaceId`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, + * `appVersion`, `activationId`, `audienceId`, and/or + * `spaceId` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java index 685e9f4f..bd929d94 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java @@ -59,6 +59,21 @@ public class DeliveryOverviewDestinationFilterBy { @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) private List subscriptionId; + public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) + private List activationId; + + public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) + private List audienceId; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private List spaceId; + public DeliveryOverviewDestinationFilterBy() {} public DeliveryOverviewDestinationFilterBy discardReason(List discardReason) { @@ -204,6 +219,90 @@ public void setSubscriptionId(List subscriptionId) { this.subscriptionId = subscriptionId; } + public DeliveryOverviewDestinationFilterBy activationId(List activationId) { + + this.activationId = activationId; + return this; + } + + public DeliveryOverviewDestinationFilterBy addActivationIdItem(String activationIdItem) { + if (this.activationId == null) { + this.activationId = new ArrayList<>(); + } + this.activationId.add(activationIdItem); + return this; + } + + /** + * A list of strings of event context IDs from a Linked Audience mapping/activation. + * + * @return activationId + */ + @javax.annotation.Nullable + public List getActivationId() { + return activationId; + } + + public void setActivationId(List activationId) { + this.activationId = activationId; + } + + public DeliveryOverviewDestinationFilterBy audienceId(List audienceId) { + + this.audienceId = audienceId; + return this; + } + + public DeliveryOverviewDestinationFilterBy addAudienceIdItem(String audienceIdItem) { + if (this.audienceId == null) { + this.audienceId = new ArrayList<>(); + } + this.audienceId.add(audienceIdItem); + return this; + } + + /** + * A list of strings of audienceIDs for a Linked Audience. + * + * @return audienceId + */ + @javax.annotation.Nullable + public List getAudienceId() { + return audienceId; + } + + public void setAudienceId(List audienceId) { + this.audienceId = audienceId; + } + + public DeliveryOverviewDestinationFilterBy spaceId(List spaceId) { + + this.spaceId = spaceId; + return this; + } + + public DeliveryOverviewDestinationFilterBy addSpaceIdItem(String spaceIdItem) { + if (this.spaceId == null) { + this.spaceId = new ArrayList<>(); + } + this.spaceId.add(spaceIdItem); + return this; + } + + /** + * A list of strings of spaceIDs for a Linked Audience. + * + * @return spaceId + */ + @javax.annotation.Nullable + public List getSpaceId() { + return spaceId; + } + + public void setSpaceId(List spaceId) { + this.spaceId = spaceId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -219,12 +318,24 @@ public boolean equals(Object o) { && Objects.equals(this.eventType, deliveryOverviewDestinationFilterBy.eventType) && Objects.equals(this.appVersion, deliveryOverviewDestinationFilterBy.appVersion) && Objects.equals( - this.subscriptionId, deliveryOverviewDestinationFilterBy.subscriptionId); + this.subscriptionId, deliveryOverviewDestinationFilterBy.subscriptionId) + && Objects.equals( + this.activationId, deliveryOverviewDestinationFilterBy.activationId) + && Objects.equals(this.audienceId, deliveryOverviewDestinationFilterBy.audienceId) + && Objects.equals(this.spaceId, deliveryOverviewDestinationFilterBy.spaceId); } @Override public int hashCode() { - return Objects.hash(discardReason, eventName, eventType, appVersion, subscriptionId); + return Objects.hash( + discardReason, + eventName, + eventType, + appVersion, + subscriptionId, + activationId, + audienceId, + spaceId); } @Override @@ -236,6 +347,9 @@ public String toString() { sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -262,6 +376,9 @@ private String toIndentedString(Object o) { openapiFields.add("eventType"); openapiFields.add("appVersion"); openapiFields.add("subscriptionId"); + openapiFields.add("activationId"); + openapiFields.add("audienceId"); + openapiFields.add("spaceId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -349,6 +466,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("subscriptionId").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("activationId") != null + && !jsonObj.get("activationId").isJsonNull() + && !jsonObj.get("activationId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activationId` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("activationId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("audienceId") != null + && !jsonObj.get("audienceId").isJsonNull() + && !jsonObj.get("audienceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audienceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("spaceId") != null + && !jsonObj.get("spaceId").isJsonNull() + && !jsonObj.get("spaceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("spaceId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java index 46d0c5cd..646c3f44 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java @@ -54,6 +54,21 @@ public class DeliveryOverviewSourceFilterBy { @SerializedName(SERIALIZED_NAME_APP_VERSION) private List appVersion; + public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) + private List activationId; + + public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) + private List audienceId; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private List spaceId; + public DeliveryOverviewSourceFilterBy() {} public DeliveryOverviewSourceFilterBy discardReason(List discardReason) { @@ -171,6 +186,90 @@ public void setAppVersion(List appVersion) { this.appVersion = appVersion; } + public DeliveryOverviewSourceFilterBy activationId(List activationId) { + + this.activationId = activationId; + return this; + } + + public DeliveryOverviewSourceFilterBy addActivationIdItem(String activationIdItem) { + if (this.activationId == null) { + this.activationId = new ArrayList<>(); + } + this.activationId.add(activationIdItem); + return this; + } + + /** + * A list of strings of event context IDs from a Linked Audience mapping/activation. + * + * @return activationId + */ + @javax.annotation.Nullable + public List getActivationId() { + return activationId; + } + + public void setActivationId(List activationId) { + this.activationId = activationId; + } + + public DeliveryOverviewSourceFilterBy audienceId(List audienceId) { + + this.audienceId = audienceId; + return this; + } + + public DeliveryOverviewSourceFilterBy addAudienceIdItem(String audienceIdItem) { + if (this.audienceId == null) { + this.audienceId = new ArrayList<>(); + } + this.audienceId.add(audienceIdItem); + return this; + } + + /** + * A list of strings of audienceIDs for a Linked Audience. + * + * @return audienceId + */ + @javax.annotation.Nullable + public List getAudienceId() { + return audienceId; + } + + public void setAudienceId(List audienceId) { + this.audienceId = audienceId; + } + + public DeliveryOverviewSourceFilterBy spaceId(List spaceId) { + + this.spaceId = spaceId; + return this; + } + + public DeliveryOverviewSourceFilterBy addSpaceIdItem(String spaceIdItem) { + if (this.spaceId == null) { + this.spaceId = new ArrayList<>(); + } + this.spaceId.add(spaceIdItem); + return this; + } + + /** + * A list of strings of spaceIDs for a Linked Audience. + * + * @return spaceId + */ + @javax.annotation.Nullable + public List getSpaceId() { + return spaceId; + } + + public void setSpaceId(List spaceId) { + this.spaceId = spaceId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -184,12 +283,16 @@ public boolean equals(Object o) { return Objects.equals(this.discardReason, deliveryOverviewSourceFilterBy.discardReason) && Objects.equals(this.eventName, deliveryOverviewSourceFilterBy.eventName) && Objects.equals(this.eventType, deliveryOverviewSourceFilterBy.eventType) - && Objects.equals(this.appVersion, deliveryOverviewSourceFilterBy.appVersion); + && Objects.equals(this.appVersion, deliveryOverviewSourceFilterBy.appVersion) + && Objects.equals(this.activationId, deliveryOverviewSourceFilterBy.activationId) + && Objects.equals(this.audienceId, deliveryOverviewSourceFilterBy.audienceId) + && Objects.equals(this.spaceId, deliveryOverviewSourceFilterBy.spaceId); } @Override public int hashCode() { - return Objects.hash(discardReason, eventName, eventType, appVersion); + return Objects.hash( + discardReason, eventName, eventType, appVersion, activationId, audienceId, spaceId); } @Override @@ -200,6 +303,9 @@ public String toString() { sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -225,6 +331,9 @@ private String toIndentedString(Object o) { openapiFields.add("eventName"); openapiFields.add("eventType"); openapiFields.add("appVersion"); + openapiFields.add("activationId"); + openapiFields.add("audienceId"); + openapiFields.add("spaceId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -301,6 +410,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("appVersion").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("activationId") != null + && !jsonObj.get("activationId").isJsonNull() + && !jsonObj.get("activationId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activationId` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("activationId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("audienceId") != null + && !jsonObj.get("audienceId").isJsonNull() + && !jsonObj.get("audienceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audienceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("spaceId") != null + && !jsonObj.get("spaceId").isJsonNull() + && !jsonObj.get("spaceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("spaceId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java index 62aefed9..8484bb1a 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java @@ -49,6 +49,21 @@ public class DeliveryOverviewSuccessfullyReceivedFilterBy { @SerializedName(SERIALIZED_NAME_APP_VERSION) private List appVersion; + public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) + private List activationId; + + public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) + private List audienceId; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private List spaceId; + public DeliveryOverviewSuccessfullyReceivedFilterBy() {} public DeliveryOverviewSuccessfullyReceivedFilterBy eventName(List eventName) { @@ -136,6 +151,91 @@ public void setAppVersion(List appVersion) { this.appVersion = appVersion; } + public DeliveryOverviewSuccessfullyReceivedFilterBy activationId(List activationId) { + + this.activationId = activationId; + return this; + } + + public DeliveryOverviewSuccessfullyReceivedFilterBy addActivationIdItem( + String activationIdItem) { + if (this.activationId == null) { + this.activationId = new ArrayList<>(); + } + this.activationId.add(activationIdItem); + return this; + } + + /** + * A list of strings of event context IDs from a Linked Audience mapping/activation. + * + * @return activationId + */ + @javax.annotation.Nullable + public List getActivationId() { + return activationId; + } + + public void setActivationId(List activationId) { + this.activationId = activationId; + } + + public DeliveryOverviewSuccessfullyReceivedFilterBy audienceId(List audienceId) { + + this.audienceId = audienceId; + return this; + } + + public DeliveryOverviewSuccessfullyReceivedFilterBy addAudienceIdItem(String audienceIdItem) { + if (this.audienceId == null) { + this.audienceId = new ArrayList<>(); + } + this.audienceId.add(audienceIdItem); + return this; + } + + /** + * A list of strings of audienceIDs for a Linked Audience. + * + * @return audienceId + */ + @javax.annotation.Nullable + public List getAudienceId() { + return audienceId; + } + + public void setAudienceId(List audienceId) { + this.audienceId = audienceId; + } + + public DeliveryOverviewSuccessfullyReceivedFilterBy spaceId(List spaceId) { + + this.spaceId = spaceId; + return this; + } + + public DeliveryOverviewSuccessfullyReceivedFilterBy addSpaceIdItem(String spaceIdItem) { + if (this.spaceId == null) { + this.spaceId = new ArrayList<>(); + } + this.spaceId.add(spaceIdItem); + return this; + } + + /** + * A list of strings of spaceIDs for a Linked Audience. + * + * @return spaceId + */ + @javax.annotation.Nullable + public List getSpaceId() { + return spaceId; + } + + public void setSpaceId(List spaceId) { + this.spaceId = spaceId; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -151,12 +251,19 @@ public boolean equals(Object o) { && Objects.equals( this.eventType, deliveryOverviewSuccessfullyReceivedFilterBy.eventType) && Objects.equals( - this.appVersion, deliveryOverviewSuccessfullyReceivedFilterBy.appVersion); + this.appVersion, deliveryOverviewSuccessfullyReceivedFilterBy.appVersion) + && Objects.equals( + this.activationId, + deliveryOverviewSuccessfullyReceivedFilterBy.activationId) + && Objects.equals( + this.audienceId, deliveryOverviewSuccessfullyReceivedFilterBy.audienceId) + && Objects.equals( + this.spaceId, deliveryOverviewSuccessfullyReceivedFilterBy.spaceId); } @Override public int hashCode() { - return Objects.hash(eventName, eventType, appVersion); + return Objects.hash(eventName, eventType, appVersion, activationId, audienceId, spaceId); } @Override @@ -166,6 +273,9 @@ public String toString() { sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); + sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -190,6 +300,9 @@ private String toIndentedString(Object o) { openapiFields.add("eventName"); openapiFields.add("eventType"); openapiFields.add("appVersion"); + openapiFields.add("activationId"); + openapiFields.add("audienceId"); + openapiFields.add("spaceId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -260,6 +373,36 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("appVersion").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("activationId") != null + && !jsonObj.get("activationId").isJsonNull() + && !jsonObj.get("activationId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activationId` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("activationId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("audienceId") != null + && !jsonObj.get("audienceId").isJsonNull() + && !jsonObj.get("audienceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audienceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("spaceId") != null + && !jsonObj.get("spaceId").isJsonNull() + && !jsonObj.get("spaceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("spaceId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 42c8c6bd19af0d4fec84eb7aa2a71014c612acfa Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 6 Aug 2024 21:45:37 +0000 Subject: [PATCH 317/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@cee6340c. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- .../publicapi/models/SourceMetadataV1.java | 134 +++++++++++++++++- 5 files changed, 139 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b81c101b..e013a1a6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 52.0.0 +Latest API and SDK version: 53.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 52.0.0 + 53.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:52.0.0" + implementation "com.segment.publicapi:segment-publicapi:53.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-52.0.0.jar` +* `target/segment-publicapi-53.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 5b6e9405..cc4ea3dd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 52.0.0 + 53.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index e0b1d518..81b7400e 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 52.0.0 (Java)"); + setUserAgent("Public API SDK 53.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 2d59dc54..bf10b1fd 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "52.0.0"; + public static final String VERSION = "53.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java index bea4c926..806fee65 100644 --- a/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/SourceMetadataV1.java @@ -17,6 +17,7 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; @@ -72,6 +73,72 @@ public class SourceMetadataV1 { @SerializedName(SERIALIZED_NAME_IS_CLOUD_EVENT_SOURCE) private Boolean isCloudEventSource; + /** Support status of the Source. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + DEPRECATED("DEPRECATED"), + + PRIVATE_BETA("PRIVATE_BETA"), + + PRIVATE_BUILDING("PRIVATE_BUILDING"), + + PRIVATE_SUBMITTED("PRIVATE_SUBMITTED"), + + PUBLIC("PUBLIC"), + + PUBLIC_BETA("PUBLIC_BETA"), + + UNAVAILABLE("UNAVAILABLE"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_PARTNER_OWNED = "partnerOwned"; + + @SerializedName(SERIALIZED_NAME_PARTNER_OWNED) + private Boolean partnerOwned; + public SourceMetadataV1() {} public SourceMetadataV1 id(String id) { @@ -252,6 +319,46 @@ public void setIsCloudEventSource(Boolean isCloudEventSource) { this.isCloudEventSource = isCloudEventSource; } + public SourceMetadataV1 status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Support status of the Source. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public SourceMetadataV1 partnerOwned(Boolean partnerOwned) { + + this.partnerOwned = partnerOwned; + return this; + } + + /** + * Partner Owned flag. + * + * @return partnerOwned + */ + @javax.annotation.Nullable + public Boolean getPartnerOwned() { + return partnerOwned; + } + + public void setPartnerOwned(Boolean partnerOwned) { + this.partnerOwned = partnerOwned; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -268,13 +375,24 @@ public boolean equals(Object o) { && Objects.equals(this.logos, sourceMetadataV1.logos) && Objects.equals(this.options, sourceMetadataV1.options) && Objects.equals(this.categories, sourceMetadataV1.categories) - && Objects.equals(this.isCloudEventSource, sourceMetadataV1.isCloudEventSource); + && Objects.equals(this.isCloudEventSource, sourceMetadataV1.isCloudEventSource) + && Objects.equals(this.status, sourceMetadataV1.status) + && Objects.equals(this.partnerOwned, sourceMetadataV1.partnerOwned); } @Override public int hashCode() { return Objects.hash( - id, name, slug, description, logos, options, categories, isCloudEventSource); + id, + name, + slug, + description, + logos, + options, + categories, + isCloudEventSource, + status, + partnerOwned); } @Override @@ -291,6 +409,8 @@ public String toString() { sb.append(" isCloudEventSource: ") .append(toIndentedString(isCloudEventSource)) .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); sb.append("}"); return sb.toString(); } @@ -320,6 +440,8 @@ private String toIndentedString(Object o) { openapiFields.add("options"); openapiFields.add("categories"); openapiFields.add("isCloudEventSource"); + openapiFields.add("status"); + openapiFields.add("partnerOwned"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -331,6 +453,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("options"); openapiRequiredFields.add("categories"); openapiRequiredFields.add("isCloudEventSource"); + openapiRequiredFields.add("status"); } /** @@ -430,6 +553,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("categories").toString())); } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 7be2ddacd48e9668b9b77b6eeed265e07ecce533 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 7 Aug 2024 16:57:25 +0000 Subject: [PATCH 318/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a49cd70b. From edbac59f6794b9262d4b4340cd9401506cdf78bc Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 9 Aug 2024 22:03:18 +0000 Subject: [PATCH 319/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@229c59b8. --- .../models/CreateTransformationV1Input.java | 30 +++++++++++++++++++ .../publicapi/models/TransformationV1.java | 30 +++++++++++++++++++ .../models/UpdateTransformationV1Input.java | 30 +++++++++++++++++++ 3 files changed, 90 insertions(+) diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index 09b1758c..ae2ef47d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -57,6 +57,11 @@ public class CreateTransformationV1Input { @SerializedName(SERIALIZED_NAME_IF) private String _if; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -195,6 +200,27 @@ public void setIf(String _if) { this._if = _if; } + public CreateTransformationV1Input drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Optional boolean value if the Transformation should drop the event entirely when the if + * statement matches, ignores all other transforms. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + public CreateTransformationV1Input newEventName(String newEventName) { this.newEventName = newEventName; @@ -373,6 +399,7 @@ public boolean equals(Object o) { createTransformationV1Input.destinationMetadataId) && Objects.equals(this.enabled, createTransformationV1Input.enabled) && Objects.equals(this._if, createTransformationV1Input._if) + && Objects.equals(this.drop, createTransformationV1Input.drop) && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) && Objects.equals( @@ -394,6 +421,7 @@ public int hashCode() { destinationMetadataId, enabled, _if, + drop, newEventName, propertyRenames, propertyValueTransformations, @@ -413,6 +441,7 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -451,6 +480,7 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); + openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java index 7d9380a7..6bbc7712 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -62,6 +62,11 @@ public class TransformationV1 { @SerializedName(SERIALIZED_NAME_IF) private String _if; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -220,6 +225,27 @@ public void setIf(String _if) { this._if = _if; } + public TransformationV1 drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Optional boolean value if the Transformation should drop the event entirely when the if + * statement matches, ignores all other transforms. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + public TransformationV1 newEventName(String newEventName) { this.newEventName = newEventName; @@ -395,6 +421,7 @@ public boolean equals(Object o) { this.destinationMetadataId, transformationV1.destinationMetadataId) && Objects.equals(this.enabled, transformationV1.enabled) && Objects.equals(this._if, transformationV1._if) + && Objects.equals(this.drop, transformationV1.drop) && Objects.equals(this.newEventName, transformationV1.newEventName) && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) && Objects.equals( @@ -416,6 +443,7 @@ public int hashCode() { destinationMetadataId, enabled, _if, + drop, newEventName, propertyRenames, propertyValueTransformations, @@ -436,6 +464,7 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -475,6 +504,7 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); + openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java index 3e0c1231..ff9bacae 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -57,6 +57,11 @@ public class UpdateTransformationV1Input { @SerializedName(SERIALIZED_NAME_IF) private String _if; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -195,6 +200,27 @@ public void setIf(String _if) { this._if = _if; } + public UpdateTransformationV1Input drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Optional boolean value if the Transformation should drop the event entirely when the if + * statement matches, ignores all other transforms. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + public UpdateTransformationV1Input newEventName(String newEventName) { this.newEventName = newEventName; @@ -373,6 +399,7 @@ public boolean equals(Object o) { updateTransformationV1Input.destinationMetadataId) && Objects.equals(this.enabled, updateTransformationV1Input.enabled) && Objects.equals(this._if, updateTransformationV1Input._if) + && Objects.equals(this.drop, updateTransformationV1Input.drop) && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) && Objects.equals( @@ -394,6 +421,7 @@ public int hashCode() { destinationMetadataId, enabled, _if, + drop, newEventName, propertyRenames, propertyValueTransformations, @@ -413,6 +441,7 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -451,6 +480,7 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); + openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); From 42f022b3153eecddbcfc528563e2553f68b93c74 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 12 Aug 2024 17:04:37 +0000 Subject: [PATCH 320/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@1befb8ce. --- docs/DeliveryOverviewApi.md | 20 +-- .../publicapi/api/DeliveryOverviewApi.java | 84 ++++------ .../DeliveryOverviewSourceFilterBy.java | 143 +---------------- ...yOverviewSuccessfullyReceivedFilterBy.java | 147 +----------------- 4 files changed, 46 insertions(+), 348 deletions(-) diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index 98718d00..e5c83583 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -305,7 +305,7 @@ public class Example { String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion` `activationId`, `audienceId`, and `spaceId`, . This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. @@ -331,7 +331,7 @@ public class Example { | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion` `activationId`, `audienceId`, and `spaceId`, . This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | | **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | @@ -390,9 +390,9 @@ public class Example { String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`,`activationId`, `audienceId`, and/or `spaceId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and/or `appVersion`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getIngressFailedMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -416,9 +416,9 @@ public class Example { | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`,`activationId`, `audienceId`, and/or `spaceId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and/or `appVersion`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -475,9 +475,9 @@ public class Example { String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, and/or `appVersion`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSuccessfullyReceivedFilterBy filter = new DeliveryOverviewSuccessfullyReceivedFilterBy(); // DeliveryOverviewSuccessfullyReceivedFilterBy | An optional filter for `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSuccessfullyReceivedFilterBy filter = new DeliveryOverviewSuccessfullyReceivedFilterBy(); // DeliveryOverviewSuccessfullyReceivedFilterBy | An optional filter for `eventName`, `eventType`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getIngressSuccessMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -501,9 +501,9 @@ public class Example { | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, and/or `appVersion`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSuccessfullyReceivedFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSuccessfullyReceivedFilterBy**](.md)| An optional filter for `eventName`, `eventType`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index dfd3446e..1c024926 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -1285,8 +1285,7 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion` `activationId`, - * `audienceId`, and `spaceId`, . This parameter exists in beta. + * `discardReason`, and `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1460,8 +1459,7 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion` `activationId`, - * `audienceId`, and `spaceId`, . This parameter exists in beta. + * `discardReason`, and `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1514,8 +1512,7 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion` `activationId`, - * `audienceId`, and `spaceId`, . This parameter exists in beta. + * `discardReason`, and `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1577,8 +1574,7 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion` `activationId`, - * `audienceId`, and `spaceId`, . This parameter exists in beta. + * `discardReason`, and `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1642,8 +1638,7 @@ public okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`,`activationId`, - * `audienceId`, and/or `spaceId`. This parameter exists in beta. + * `discardReason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1652,9 +1647,8 @@ public okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewAsync( * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback Callback for upload/download progress @@ -1816,8 +1810,7 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`,`activationId`, - * `audienceId`, and/or `spaceId`. This parameter exists in beta. + * `discardReason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1826,9 +1819,8 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1869,8 +1861,7 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`,`activationId`, - * `audienceId`, and/or `spaceId`. This parameter exists in beta. + * `discardReason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1879,9 +1870,8 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1932,8 +1922,7 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`,`activationId`, - * `audienceId`, and/or `spaceId`. This parameter exists in beta. + * `discardReason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1942,9 +1931,8 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback The callback to be executed when the API call finishes @@ -1996,18 +1984,16 @@ public okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewAsync( * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and - * `spaceId`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, and/or + * `appVersion`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and/or - * `spaceId` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, and/or + * `appVersion` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2170,18 +2156,16 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and - * `spaceId`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, and/or + * `appVersion`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and/or - * `spaceId` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, and/or + * `appVersion` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2223,18 +2207,16 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and - * `spaceId`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, and/or + * `appVersion`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and/or - * `spaceId` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, and/or + * `appVersion` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2285,18 +2267,16 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and - * `spaceId`. This parameter exists in beta. (optional) + * the result by. Valid options are: `eventName`, `eventType`, and/or + * `appVersion`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `appVersion`, `activationId`, `audienceId`, and/or - * `spaceId` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `eventName`, `eventType`, and/or + * `appVersion` that can be applied in addition to a `groupBy`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java index 646c3f44..46d0c5cd 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSourceFilterBy.java @@ -54,21 +54,6 @@ public class DeliveryOverviewSourceFilterBy { @SerializedName(SERIALIZED_NAME_APP_VERSION) private List appVersion; - public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; - - @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) - private List activationId; - - public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) - private List audienceId; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private List spaceId; - public DeliveryOverviewSourceFilterBy() {} public DeliveryOverviewSourceFilterBy discardReason(List discardReason) { @@ -186,90 +171,6 @@ public void setAppVersion(List appVersion) { this.appVersion = appVersion; } - public DeliveryOverviewSourceFilterBy activationId(List activationId) { - - this.activationId = activationId; - return this; - } - - public DeliveryOverviewSourceFilterBy addActivationIdItem(String activationIdItem) { - if (this.activationId == null) { - this.activationId = new ArrayList<>(); - } - this.activationId.add(activationIdItem); - return this; - } - - /** - * A list of strings of event context IDs from a Linked Audience mapping/activation. - * - * @return activationId - */ - @javax.annotation.Nullable - public List getActivationId() { - return activationId; - } - - public void setActivationId(List activationId) { - this.activationId = activationId; - } - - public DeliveryOverviewSourceFilterBy audienceId(List audienceId) { - - this.audienceId = audienceId; - return this; - } - - public DeliveryOverviewSourceFilterBy addAudienceIdItem(String audienceIdItem) { - if (this.audienceId == null) { - this.audienceId = new ArrayList<>(); - } - this.audienceId.add(audienceIdItem); - return this; - } - - /** - * A list of strings of audienceIDs for a Linked Audience. - * - * @return audienceId - */ - @javax.annotation.Nullable - public List getAudienceId() { - return audienceId; - } - - public void setAudienceId(List audienceId) { - this.audienceId = audienceId; - } - - public DeliveryOverviewSourceFilterBy spaceId(List spaceId) { - - this.spaceId = spaceId; - return this; - } - - public DeliveryOverviewSourceFilterBy addSpaceIdItem(String spaceIdItem) { - if (this.spaceId == null) { - this.spaceId = new ArrayList<>(); - } - this.spaceId.add(spaceIdItem); - return this; - } - - /** - * A list of strings of spaceIDs for a Linked Audience. - * - * @return spaceId - */ - @javax.annotation.Nullable - public List getSpaceId() { - return spaceId; - } - - public void setSpaceId(List spaceId) { - this.spaceId = spaceId; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -283,16 +184,12 @@ public boolean equals(Object o) { return Objects.equals(this.discardReason, deliveryOverviewSourceFilterBy.discardReason) && Objects.equals(this.eventName, deliveryOverviewSourceFilterBy.eventName) && Objects.equals(this.eventType, deliveryOverviewSourceFilterBy.eventType) - && Objects.equals(this.appVersion, deliveryOverviewSourceFilterBy.appVersion) - && Objects.equals(this.activationId, deliveryOverviewSourceFilterBy.activationId) - && Objects.equals(this.audienceId, deliveryOverviewSourceFilterBy.audienceId) - && Objects.equals(this.spaceId, deliveryOverviewSourceFilterBy.spaceId); + && Objects.equals(this.appVersion, deliveryOverviewSourceFilterBy.appVersion); } @Override public int hashCode() { - return Objects.hash( - discardReason, eventName, eventType, appVersion, activationId, audienceId, spaceId); + return Objects.hash(discardReason, eventName, eventType, appVersion); } @Override @@ -303,9 +200,6 @@ public String toString() { sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); - sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); - sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -331,9 +225,6 @@ private String toIndentedString(Object o) { openapiFields.add("eventName"); openapiFields.add("eventType"); openapiFields.add("appVersion"); - openapiFields.add("activationId"); - openapiFields.add("audienceId"); - openapiFields.add("spaceId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -410,36 +301,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("appVersion").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("activationId") != null - && !jsonObj.get("activationId").isJsonNull() - && !jsonObj.get("activationId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activationId` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("activationId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("audienceId") != null - && !jsonObj.get("audienceId").isJsonNull() - && !jsonObj.get("audienceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceId` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("audienceId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("spaceId") != null - && !jsonObj.get("spaceId").isJsonNull() - && !jsonObj.get("spaceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("spaceId").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java index 8484bb1a..62aefed9 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewSuccessfullyReceivedFilterBy.java @@ -49,21 +49,6 @@ public class DeliveryOverviewSuccessfullyReceivedFilterBy { @SerializedName(SERIALIZED_NAME_APP_VERSION) private List appVersion; - public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; - - @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) - private List activationId; - - public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) - private List audienceId; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private List spaceId; - public DeliveryOverviewSuccessfullyReceivedFilterBy() {} public DeliveryOverviewSuccessfullyReceivedFilterBy eventName(List eventName) { @@ -151,91 +136,6 @@ public void setAppVersion(List appVersion) { this.appVersion = appVersion; } - public DeliveryOverviewSuccessfullyReceivedFilterBy activationId(List activationId) { - - this.activationId = activationId; - return this; - } - - public DeliveryOverviewSuccessfullyReceivedFilterBy addActivationIdItem( - String activationIdItem) { - if (this.activationId == null) { - this.activationId = new ArrayList<>(); - } - this.activationId.add(activationIdItem); - return this; - } - - /** - * A list of strings of event context IDs from a Linked Audience mapping/activation. - * - * @return activationId - */ - @javax.annotation.Nullable - public List getActivationId() { - return activationId; - } - - public void setActivationId(List activationId) { - this.activationId = activationId; - } - - public DeliveryOverviewSuccessfullyReceivedFilterBy audienceId(List audienceId) { - - this.audienceId = audienceId; - return this; - } - - public DeliveryOverviewSuccessfullyReceivedFilterBy addAudienceIdItem(String audienceIdItem) { - if (this.audienceId == null) { - this.audienceId = new ArrayList<>(); - } - this.audienceId.add(audienceIdItem); - return this; - } - - /** - * A list of strings of audienceIDs for a Linked Audience. - * - * @return audienceId - */ - @javax.annotation.Nullable - public List getAudienceId() { - return audienceId; - } - - public void setAudienceId(List audienceId) { - this.audienceId = audienceId; - } - - public DeliveryOverviewSuccessfullyReceivedFilterBy spaceId(List spaceId) { - - this.spaceId = spaceId; - return this; - } - - public DeliveryOverviewSuccessfullyReceivedFilterBy addSpaceIdItem(String spaceIdItem) { - if (this.spaceId == null) { - this.spaceId = new ArrayList<>(); - } - this.spaceId.add(spaceIdItem); - return this; - } - - /** - * A list of strings of spaceIDs for a Linked Audience. - * - * @return spaceId - */ - @javax.annotation.Nullable - public List getSpaceId() { - return spaceId; - } - - public void setSpaceId(List spaceId) { - this.spaceId = spaceId; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -251,19 +151,12 @@ public boolean equals(Object o) { && Objects.equals( this.eventType, deliveryOverviewSuccessfullyReceivedFilterBy.eventType) && Objects.equals( - this.appVersion, deliveryOverviewSuccessfullyReceivedFilterBy.appVersion) - && Objects.equals( - this.activationId, - deliveryOverviewSuccessfullyReceivedFilterBy.activationId) - && Objects.equals( - this.audienceId, deliveryOverviewSuccessfullyReceivedFilterBy.audienceId) - && Objects.equals( - this.spaceId, deliveryOverviewSuccessfullyReceivedFilterBy.spaceId); + this.appVersion, deliveryOverviewSuccessfullyReceivedFilterBy.appVersion); } @Override public int hashCode() { - return Objects.hash(eventName, eventType, appVersion, activationId, audienceId, spaceId); + return Objects.hash(eventName, eventType, appVersion); } @Override @@ -273,9 +166,6 @@ public String toString() { sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" appVersion: ").append(toIndentedString(appVersion)).append("\n"); - sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); - sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -300,9 +190,6 @@ private String toIndentedString(Object o) { openapiFields.add("eventName"); openapiFields.add("eventType"); openapiFields.add("appVersion"); - openapiFields.add("activationId"); - openapiFields.add("audienceId"); - openapiFields.add("spaceId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -373,36 +260,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("appVersion").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("activationId") != null - && !jsonObj.get("activationId").isJsonNull() - && !jsonObj.get("activationId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activationId` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("activationId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("audienceId") != null - && !jsonObj.get("audienceId").isJsonNull() - && !jsonObj.get("audienceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceId` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("audienceId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("spaceId") != null - && !jsonObj.get("spaceId").isJsonNull() - && !jsonObj.get("spaceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("spaceId").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 21da8485d899200cfd70c2c19efde61d629be8c2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 12 Aug 2024 17:36:54 +0000 Subject: [PATCH 321/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@cbb6267e. --- docs/DeliveryOverviewApi.md | 4 ++-- .../publicapi/api/DeliveryOverviewApi.java | 20 ++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index e5c83583..9dd1a55d 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -307,7 +307,7 @@ public class Example { String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtSourceMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -333,7 +333,7 @@ public class Example { | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | | **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index 1c024926..d8e1e900 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -1294,9 +1294,8 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback Callback for upload/download progress @@ -1468,9 +1467,8 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1521,9 +1519,8 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1583,9 +1580,8 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `activationId`, - * `audienceId`, and/or `spaceId` that can be applied in addition to a - * `groupBy`. This parameter exists in beta. (optional) + * `discardReason`, and/or `appVersion` that can be applied in addition + * to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback The callback to be executed when the API call finishes From 62ef2be9fada092666c1139173cb577646ba451e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 15 Aug 2024 23:24:56 +0000 Subject: [PATCH 322/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d5bc75d1. --- docs/DeliveryOverviewApi.md | 4 +-- docs/DestinationFiltersApi.md | 2 +- docs/DestinationsApi.md | 4 +-- .../publicapi/api/DeliveryOverviewApi.java | 8 ++--- .../publicapi/models/AudienceSummary.java | 10 +++---- .../models/ComputedTraitSummary.java | 10 +++---- .../models/CreateTransformationV1Input.java | 30 ------------------- .../segment/publicapi/models/Definition.java | 10 ++----- .../segment/publicapi/models/Definition1.java | 10 +++++-- .../publicapi/models/TransformationV1.java | 30 ------------------- .../models/UpdateTransformationV1Input.java | 30 ------------------- 11 files changed, 29 insertions(+), 119 deletions(-) diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index 9dd1a55d..982cfebd 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -219,7 +219,7 @@ public class Example { String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. @@ -246,7 +246,7 @@ public class Example { | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, and `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | | **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | diff --git a/docs/DestinationFiltersApi.md b/docs/DestinationFiltersApi.md index 8de3427b..844bb68c 100644 --- a/docs/DestinationFiltersApi.md +++ b/docs/DestinationFiltersApi.md @@ -191,7 +191,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); DestinationFiltersApi apiInstance = new DestinationFiltersApi(defaultClient); - String destinationId = "fP7qoQw2HTWt9WdMr718gn"; // String | + String destinationId = "qtiZHLLqqsHmpvLXNtP5du"; // String | PaginationInput pagination = new PaginationInput(); // PaginationInput | Pagination options. This parameter exists in v1. try { ListFiltersFromDestination200Response result = apiInstance.listFiltersFromDestination(destinationId, pagination); diff --git a/docs/DestinationsApi.md b/docs/DestinationsApi.md index 26769527..13a79486 100644 --- a/docs/DestinationsApi.md +++ b/docs/DestinationsApi.md @@ -267,7 +267,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); DestinationsApi apiInstance = new DestinationsApi(defaultClient); - String destinationId = "fP7qoQw2HTWt9WdMr718gn"; // String | + String destinationId = "qtiZHLLqqsHmpvLXNtP5du"; // String | try { GetDestination200Response result = apiInstance.getDestination(destinationId); System.out.println(result); @@ -719,7 +719,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); DestinationsApi apiInstance = new DestinationsApi(defaultClient); - String destinationId = "fP7qoQw2HTWt9WdMr718gn"; // String | + String destinationId = "qtiZHLLqqsHmpvLXNtP5du"; // String | UpdateDestinationV1Input updateDestinationV1Input = new UpdateDestinationV1Input(); // UpdateDestinationV1Input | try { UpdateDestination200Response result = apiInstance.updateDestination(destinationId, updateDestinationV1Input); diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index d8e1e900..a5b8cade 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -888,7 +888,7 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -1087,7 +1087,7 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -1151,7 +1151,7 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -1218,7 +1218,7 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * timeframe, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, and `subscriptionId`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index a1266e2b..f2d34d1c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition1 definition) { + public AudienceSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index d88aeba3..c9b644f2 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition definition) { + public ComputedTraitSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index ae2ef47d..09b1758c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -57,11 +57,6 @@ public class CreateTransformationV1Input { @SerializedName(SERIALIZED_NAME_IF) private String _if; - public static final String SERIALIZED_NAME_DROP = "drop"; - - @SerializedName(SERIALIZED_NAME_DROP) - private Boolean drop; - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -200,27 +195,6 @@ public void setIf(String _if) { this._if = _if; } - public CreateTransformationV1Input drop(Boolean drop) { - - this.drop = drop; - return this; - } - - /** - * Optional boolean value if the Transformation should drop the event entirely when the if - * statement matches, ignores all other transforms. - * - * @return drop - */ - @javax.annotation.Nullable - public Boolean getDrop() { - return drop; - } - - public void setDrop(Boolean drop) { - this.drop = drop; - } - public CreateTransformationV1Input newEventName(String newEventName) { this.newEventName = newEventName; @@ -399,7 +373,6 @@ public boolean equals(Object o) { createTransformationV1Input.destinationMetadataId) && Objects.equals(this.enabled, createTransformationV1Input.enabled) && Objects.equals(this._if, createTransformationV1Input._if) - && Objects.equals(this.drop, createTransformationV1Input.drop) && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) && Objects.equals( @@ -421,7 +394,6 @@ public int hashCode() { destinationMetadataId, enabled, _if, - drop, newEventName, propertyRenames, propertyValueTransformations, @@ -441,7 +413,6 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -480,7 +451,6 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); - openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index 012d83c6..d8aa8981 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,8 +36,7 @@ public class Definition { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index e6c5ae7d..ed071aaa 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,7 +36,8 @@ public class Definition1 { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition1 query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java index 6bbc7712..7d9380a7 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -62,11 +62,6 @@ public class TransformationV1 { @SerializedName(SERIALIZED_NAME_IF) private String _if; - public static final String SERIALIZED_NAME_DROP = "drop"; - - @SerializedName(SERIALIZED_NAME_DROP) - private Boolean drop; - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -225,27 +220,6 @@ public void setIf(String _if) { this._if = _if; } - public TransformationV1 drop(Boolean drop) { - - this.drop = drop; - return this; - } - - /** - * Optional boolean value if the Transformation should drop the event entirely when the if - * statement matches, ignores all other transforms. - * - * @return drop - */ - @javax.annotation.Nullable - public Boolean getDrop() { - return drop; - } - - public void setDrop(Boolean drop) { - this.drop = drop; - } - public TransformationV1 newEventName(String newEventName) { this.newEventName = newEventName; @@ -421,7 +395,6 @@ public boolean equals(Object o) { this.destinationMetadataId, transformationV1.destinationMetadataId) && Objects.equals(this.enabled, transformationV1.enabled) && Objects.equals(this._if, transformationV1._if) - && Objects.equals(this.drop, transformationV1.drop) && Objects.equals(this.newEventName, transformationV1.newEventName) && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) && Objects.equals( @@ -443,7 +416,6 @@ public int hashCode() { destinationMetadataId, enabled, _if, - drop, newEventName, propertyRenames, propertyValueTransformations, @@ -464,7 +436,6 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -504,7 +475,6 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); - openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java index ff9bacae..3e0c1231 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -57,11 +57,6 @@ public class UpdateTransformationV1Input { @SerializedName(SERIALIZED_NAME_IF) private String _if; - public static final String SERIALIZED_NAME_DROP = "drop"; - - @SerializedName(SERIALIZED_NAME_DROP) - private Boolean drop; - public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -200,27 +195,6 @@ public void setIf(String _if) { this._if = _if; } - public UpdateTransformationV1Input drop(Boolean drop) { - - this.drop = drop; - return this; - } - - /** - * Optional boolean value if the Transformation should drop the event entirely when the if - * statement matches, ignores all other transforms. - * - * @return drop - */ - @javax.annotation.Nullable - public Boolean getDrop() { - return drop; - } - - public void setDrop(Boolean drop) { - this.drop = drop; - } - public UpdateTransformationV1Input newEventName(String newEventName) { this.newEventName = newEventName; @@ -399,7 +373,6 @@ public boolean equals(Object o) { updateTransformationV1Input.destinationMetadataId) && Objects.equals(this.enabled, updateTransformationV1Input.enabled) && Objects.equals(this._if, updateTransformationV1Input._if) - && Objects.equals(this.drop, updateTransformationV1Input.drop) && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) && Objects.equals( @@ -421,7 +394,6 @@ public int hashCode() { destinationMetadataId, enabled, _if, - drop, newEventName, propertyRenames, propertyValueTransformations, @@ -441,7 +413,6 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -480,7 +451,6 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); - openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); From 1ad118808bf2466ce7097075f30ab564359b7ca7 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 19 Aug 2024 20:34:18 +0000 Subject: [PATCH 323/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c96c9235. --- README.md | 8 ++--- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- .../publicapi/models/AudienceSummary.java | 10 +++--- .../models/ComputedTraitSummary.java | 10 +++--- .../publicapi/models/CreateSourceV1Input.java | 36 +++++++++++++++++-- .../models/CreateWarehouseV1Input.java | 35 ++++++++++++++++-- .../segment/publicapi/models/Definition.java | 10 ++++-- .../segment/publicapi/models/Definition1.java | 10 ++---- 10 files changed, 94 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index e013a1a6..4db1b961 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.0.0 +Latest API and SDK version: 53.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.0.0 + 53.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.0.0" + implementation "com.segment.publicapi:segment-publicapi:53.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.0.0.jar` +* `target/segment-publicapi-53.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index cc4ea3dd..a031f1da 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.0.0 + 53.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 81b7400e..2eb34e13 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.0.0 (Java)"); + setUserAgent("Public API SDK 53.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index bf10b1fd..f3bb69e2 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.0.0"; + public static final String VERSION = "53.1.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index f2d34d1c..a1266e2b 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition definition) { + public AudienceSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index c9b644f2..d88aeba3 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition1 definition) { + public ComputedTraitSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java index 356ed52d..bec9dbca 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceV1Input.java @@ -50,6 +50,12 @@ public class CreateSourceV1Input { @SerializedName(SERIALIZED_NAME_SETTINGS) private Map settings; + public static final String SERIALIZED_NAME_DISCONNECT_ALL_WAREHOUSES = + "disconnectAllWarehouses"; + + @SerializedName(SERIALIZED_NAME_DISCONNECT_ALL_WAREHOUSES) + private Boolean disconnectAllWarehouses; + public CreateSourceV1Input() {} public CreateSourceV1Input slug(String slug) { @@ -142,6 +148,26 @@ public void setSettings(Map settings) { this.settings = settings; } + public CreateSourceV1Input disconnectAllWarehouses(Boolean disconnectAllWarehouses) { + + this.disconnectAllWarehouses = disconnectAllWarehouses; + return this; + } + + /** + * Whether to disconnect all Warehouses from the Source. + * + * @return disconnectAllWarehouses + */ + @javax.annotation.Nullable + public Boolean getDisconnectAllWarehouses() { + return disconnectAllWarehouses; + } + + public void setDisconnectAllWarehouses(Boolean disconnectAllWarehouses) { + this.disconnectAllWarehouses = disconnectAllWarehouses; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -154,12 +180,14 @@ public boolean equals(Object o) { return Objects.equals(this.slug, createSourceV1Input.slug) && Objects.equals(this.enabled, createSourceV1Input.enabled) && Objects.equals(this.metadataId, createSourceV1Input.metadataId) - && Objects.equals(this.settings, createSourceV1Input.settings); + && Objects.equals(this.settings, createSourceV1Input.settings) + && Objects.equals( + this.disconnectAllWarehouses, createSourceV1Input.disconnectAllWarehouses); } @Override public int hashCode() { - return Objects.hash(slug, enabled, metadataId, settings); + return Objects.hash(slug, enabled, metadataId, settings, disconnectAllWarehouses); } @Override @@ -170,6 +198,9 @@ public String toString() { sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" metadataId: ").append(toIndentedString(metadataId)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" disconnectAllWarehouses: ") + .append(toIndentedString(disconnectAllWarehouses)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -195,6 +226,7 @@ private String toIndentedString(Object o) { openapiFields.add("enabled"); openapiFields.add("metadataId"); openapiFields.add("settings"); + openapiFields.add("disconnectAllWarehouses"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java index b66784c1..b8ee44b7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWarehouseV1Input.java @@ -50,6 +50,11 @@ public class CreateWarehouseV1Input { @SerializedName(SERIALIZED_NAME_SETTINGS) private Map settings; + public static final String SERIALIZED_NAME_DISCONNECT_ALL_SOURCES = "disconnectAllSources"; + + @SerializedName(SERIALIZED_NAME_DISCONNECT_ALL_SOURCES) + private Boolean disconnectAllSources; + public CreateWarehouseV1Input() {} public CreateWarehouseV1Input metadataId(String metadataId) { @@ -140,6 +145,26 @@ public void setSettings(Map settings) { this.settings = settings; } + public CreateWarehouseV1Input disconnectAllSources(Boolean disconnectAllSources) { + + this.disconnectAllSources = disconnectAllSources; + return this; + } + + /** + * Whether to disconnect all Sources from this Warehouse. + * + * @return disconnectAllSources + */ + @javax.annotation.Nullable + public Boolean getDisconnectAllSources() { + return disconnectAllSources; + } + + public void setDisconnectAllSources(Boolean disconnectAllSources) { + this.disconnectAllSources = disconnectAllSources; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -152,12 +177,14 @@ public boolean equals(Object o) { return Objects.equals(this.metadataId, createWarehouseV1Input.metadataId) && Objects.equals(this.name, createWarehouseV1Input.name) && Objects.equals(this.enabled, createWarehouseV1Input.enabled) - && Objects.equals(this.settings, createWarehouseV1Input.settings); + && Objects.equals(this.settings, createWarehouseV1Input.settings) + && Objects.equals( + this.disconnectAllSources, createWarehouseV1Input.disconnectAllSources); } @Override public int hashCode() { - return Objects.hash(metadataId, name, enabled, settings); + return Objects.hash(metadataId, name, enabled, settings, disconnectAllSources); } @Override @@ -168,6 +195,9 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" disconnectAllSources: ") + .append(toIndentedString(disconnectAllSources)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -193,6 +223,7 @@ private String toIndentedString(Object o) { openapiFields.add("name"); openapiFields.add("enabled"); openapiFields.add("settings"); + openapiFields.add("disconnectAllSources"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index d8aa8981..012d83c6 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,7 +36,8 @@ public class Definition { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index ed071aaa..e6c5ae7d 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,8 +36,7 @@ public class Definition1 { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition1 query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ From 186979119bb2bb21a29845bfa62188792daa2777 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 20 Aug 2024 22:46:18 +0000 Subject: [PATCH 324/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0d441421. --- src/main/java/com/segment/publicapi/JSON.java | 6 - .../publicapi/models/AudienceSummary.java | 10 +- .../models/ComputedTraitSummary.java | 10 +- .../com/segment/publicapi/models/Config.java | 352 +++++--- .../segment/publicapi/models/Definition.java | 295 ------- .../segment/publicapi/models/Definition1.java | 291 ------- .../models/DestinationSubscription.java | 2 +- .../segment/publicapi/models/Function.java | 757 ------------------ .../publicapi/models/GetFunctionV1Output.java | 10 +- .../publicapi/models/ScheduleConfig.java | 350 +++++--- .../com/segment/publicapi/models/Space.java | 2 +- 11 files changed, 468 insertions(+), 1617 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/Definition.java delete mode 100644 src/main/java/com/segment/publicapi/models/Definition1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Function.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 83d0ff97..c7209477 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -409,10 +409,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateWriteKeyForSourceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Definition.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Definition1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); @@ -577,8 +573,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Function.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index a1266e2b..310b96d4 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private AudienceDefinition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition1 definition) { + public AudienceSummary definition(AudienceDefinition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public AudienceDefinition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(AudienceDefinition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index d88aeba3..a7e67bca 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private ComputedTraitsDefinition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition definition) { + public ComputedTraitSummary definition(ComputedTraitsDefinition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public ComputedTraitsDefinition getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(ComputedTraitsDefinition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + ComputedTraitsDefinition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index 63ff722e..b70fcf4a 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -13,100 +13,233 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; -/** - * Config contains interval duration in case of periodic or day and hours in case of specific_days. - * Empty if strategy is MANUAL. - */ -public class Config { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; +public class Config extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Config.class.getName()); - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Config.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Config' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - public Config() {} + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Config value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public Config read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); - public Config interval(String interval) { + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; - this.interval = interval; - return this; + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for Config: no class matches" + + " result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } } - /** - * Duration is specified as a string, eg: 15m, 3h25m30s. - * - * @return interval - */ - @javax.annotation.Nonnull - public String getInterval() { - return interval; + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public Config() { + super("anyOf", Boolean.TRUE); } - public void setInterval(String interval) { - this.interval = interval; + public Config(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Config config = (Config) o; - return Objects.equals(this.interval, config.interval); + public Config(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public int hashCode() { - return Objects.hash(interval); + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Config {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append("}"); - return sb.toString(); + public Map> getSchemas() { + return Config.schemas; } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; } - return o.toString().replace("\n", "\n "); + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } /** @@ -116,75 +249,40 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to Config */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Config.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Config is not found in the empty JSON" - + " string", - Config.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Config.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Config`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Config.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Config.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Config' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Config.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Config value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Config read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } + throw new IOException( + String.format( + "The JSON string is invalid for Config with anyOf schemas:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java deleted file mode 100644 index 012d83c6..00000000 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Query language definition and type. */ -public class Definition { - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; - - /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public Definition() {} - - public Definition query(String query) { - - this.query = query; - return this; - } - - /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public Definition type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Definition definition = (Definition) o; - return Objects.equals(this.query, definition.query) - && Objects.equals(this.type, definition.type); - } - - @Override - public int hashCode() { - return Objects.hash(query, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Definition {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("query"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("query"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Definition - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Definition.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Definition is not found in the empty" - + " JSON string", - Definition.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Definition.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Definition` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Definition.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("query").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `query` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("query").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Definition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Definition' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Definition.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Definition value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Definition read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Definition given an JSON string - * - * @param jsonString JSON string - * @return An instance of Definition - * @throws IOException if the JSON string is invalid with respect to Definition - */ - public static Definition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Definition.class); - } - - /** - * Convert an instance of Definition to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java deleted file mode 100644 index e6c5ae7d..00000000 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Query language definition and type. */ -public class Definition1 { - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; - - /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public Definition1() {} - - public Definition1 query(String query) { - - this.query = query; - return this; - } - - /** - * The query language string defining the audience segmentation criteria. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public Definition1 type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Definition1 definition1 = (Definition1) o; - return Objects.equals(this.query, definition1.query) - && Objects.equals(this.type, definition1.type); - } - - @Override - public int hashCode() { - return Objects.hash(query, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Definition1 {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("query"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("query"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Definition1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Definition1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Definition1 is not found in the empty" - + " JSON string", - Definition1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Definition1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Definition1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Definition1.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("query").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `query` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("query").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Definition1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Definition1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Definition1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Definition1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Definition1 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Definition1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Definition1 - * @throws IOException if the JSON string is invalid with respect to Definition1 - */ - public static Definition1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Definition1.class); - } - - /** - * Convert an instance of Definition1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 1db32a50..03695b38 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -80,7 +80,7 @@ public class DestinationSubscription { public static final String SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE = "reverseETLSchedule"; @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE) - private Object reverseETLSchedule; + private Object reverseETLSchedule = null; public DestinationSubscription() {} diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java deleted file mode 100644 index f4bd534b..00000000 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ /dev/null @@ -1,757 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** A Function object. */ -public class Function { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The Function type. Config API note: equal to `type`. */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - INSERT_DESTINATION("INSERT_DESTINATION"), - - INSERT_SOURCE("INSERT_SOURCE"), - - SOURCE("SOURCE"); - - private String value; - - ResourceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_CODE = "code"; - - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; - - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; - - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; - - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; - - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; - - public Function() {} - - public Function id(String id) { - - this.id = id; - return this; - } - - /** - * An identifier for this Function. - * - * @return id - */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Function resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } - - /** - * The Function type. Config API note: equal to `type`. - * - * @return resourceType - */ - @javax.annotation.Nullable - public ResourceTypeEnum getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } - - public Function createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The time this Function was created. - * - * @return createdAt - */ - @javax.annotation.Nullable - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Function createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * The id of the user who created this Function. - * - * @return createdBy - */ - @javax.annotation.Nullable - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Function code(String code) { - - this.code = code; - return this; - } - - /** - * The Function code. - * - * @return code - */ - @javax.annotation.Nullable - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Function deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } - - /** - * The time of this Function's last deployment. - * - * @return deployedAt - */ - @javax.annotation.Nullable - public String getDeployedAt() { - return deployedAt; - } - - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } - - public Function settings(List settings) { - - this.settings = settings; - return this; - } - - public Function addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); - } - this.settings.add(settingsItem); - return this; - } - - /** - * The list of settings for this Function. - * - * @return settings - */ - @javax.annotation.Nullable - public List getSettings() { - return settings; - } - - public void setSettings(List settings) { - this.settings = settings; - } - - public Function displayName(String displayName) { - - this.displayName = displayName; - return this; - } - - /** - * A display name for this Function. - * - * @return displayName - */ - @javax.annotation.Nullable - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public Function description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this Function. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Function logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } - - /** - * The URL of the logo for this Function. - * - * @return logoUrl - */ - @javax.annotation.Nullable - public String getLogoUrl() { - return logoUrl; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public Function previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } - - /** - * The preview webhook URL for this Function. - * - * @return previewWebhookUrl - */ - @javax.annotation.Nullable - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } - - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } - - public Function batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } - - /** - * The max count of the batch for this Function. - * - * @return batchMaxCount - */ - @javax.annotation.Nullable - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - public Function catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * - * @return catalogId - */ - @javax.annotation.Nullable - public String getCatalogId() { - return catalogId; - } - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - public Function isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * - * @return isLatestVersion - */ - @javax.annotation.Nullable - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function function = (Function) o; - return Objects.equals(this.id, function.id) - && Objects.equals(this.resourceType, function.resourceType) - && Objects.equals(this.createdAt, function.createdAt) - && Objects.equals(this.createdBy, function.createdBy) - && Objects.equals(this.code, function.code) - && Objects.equals(this.deployedAt, function.deployedAt) - && Objects.equals(this.settings, function.settings) - && Objects.equals(this.displayName, function.displayName) - && Objects.equals(this.description, function.description) - && Objects.equals(this.logoUrl, function.logoUrl) - && Objects.equals(this.previewWebhookUrl, function.previewWebhookUrl) - && Objects.equals(this.batchMaxCount, function.batchMaxCount) - && Objects.equals(this.catalogId, function.catalogId) - && Objects.equals(this.isLatestVersion, function.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - resourceType, - createdAt, - createdBy, - code, - deployedAt, - settings, - displayName, - description, - logoUrl, - previewWebhookUrl, - batchMaxCount, - catalogId, - isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ") - .append(toIndentedString(previewWebhookUrl)) - .append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Function - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Function.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Function is not found in the empty" - + " JSON string", - Function.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Function.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Function`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) - && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `resourceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) - && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) - && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) - && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `code` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) - && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `deployedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `settings` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("settings").toString())); - } - - // validate the optional field `settings` (array) - for (int i = 0; i < jsonArraysettings.size(); i++) { - FunctionSettingV1.validateJsonElement(jsonArraysettings.get(i)); - } - ; - } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) - && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `displayName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) - && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `logoUrl` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null - && !jsonObj.get("previewWebhookUrl").isJsonNull()) - && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `previewWebhookUrl` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) - && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `catalogId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Function.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Function value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Function given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function - * @throws IOException if the JSON string is invalid with respect to Function - */ - public static Function fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function.class); - } - - /** - * Convert an instance of Function to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 7eb76e51..318c309f 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -32,11 +32,11 @@ public class GetFunctionV1Output { public static final String SERIALIZED_NAME_FUNCTION = "function"; @SerializedName(SERIALIZED_NAME_FUNCTION) - private Function function; + private FunctionV1 function; public GetFunctionV1Output() {} - public GetFunctionV1Output function(Function function) { + public GetFunctionV1Output function(FunctionV1 function) { this.function = function; return this; @@ -48,11 +48,11 @@ public GetFunctionV1Output function(Function function) { * @return function */ @javax.annotation.Nullable - public Function getFunction() { + public FunctionV1 getFunction() { return function; } - public void setFunction(Function function) { + public void setFunction(FunctionV1 function) { this.function = function; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `function` - Function.validateJsonElement(jsonObj.get("function")); + FunctionV1.validateJsonElement(jsonObj.get("function")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java index 1e23a36d..3b527dda 100644 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -13,97 +13,234 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; -/** Depending on the chosen strategy, configures the schedule for this model. */ -public class ScheduleConfig { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; +public class ScheduleConfig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ScheduleConfig.class.getName()); - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScheduleConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - public ScheduleConfig() {} + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ScheduleConfig value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public ScheduleConfig read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; - public ScheduleConfig interval(String interval) { + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + ScheduleConfig ret = new ScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + ScheduleConfig ret = new ScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } - this.interval = interval; - return this; + throw new IOException( + String.format( + "Failed deserialization for ScheduleConfig: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } } - /** - * Duration is specified as a string, eg: 15m, 3h25m30s. - * - * @return interval - */ - @javax.annotation.Nonnull - public String getInterval() { - return interval; + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public ScheduleConfig() { + super("anyOf", Boolean.TRUE); } - public void setInterval(String interval) { - this.interval = interval; + public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScheduleConfig scheduleConfig = (ScheduleConfig) o; - return Objects.equals(this.interval, scheduleConfig.interval); + public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public int hashCode() { - return Objects.hash(interval); + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScheduleConfig {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append("}"); - return sb.toString(); + public Map> getSchemas() { + return ScheduleConfig.schemas; } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; } - return o.toString().replace("\n", "\n "); + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } /** @@ -113,75 +250,40 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ScheduleConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ScheduleConfig is not found in the" - + " empty JSON string", - ScheduleConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ScheduleConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ScheduleConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ScheduleConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ScheduleConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ScheduleConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ScheduleConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } + throw new IOException( + String.format( + "The JSON string is invalid for ScheduleConfig with anyOf schemas:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 7dad935d..7e505e05 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -27,7 +27,7 @@ import java.util.Objects; import java.util.Set; -/** Space matching the given id. */ +/** Space */ public class Space { public static final String SERIALIZED_NAME_ID = "id"; From c35197189d6a9bb20533be73469e3c03d648795c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 21 Aug 2024 01:15:12 +0000 Subject: [PATCH 325/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e2091fde. --- docs/ReverseEtlApi.md | 78 +++++ src/main/java/com/segment/publicapi/JSON.java | 9 +- .../segment/publicapi/api/ReverseEtlApi.java | 220 ++++++++++++++ .../models/GetReverseETLSyncStatusOutput.java | 10 +- ...ncStatusesBySubscriptionId200Response.java | 216 +++++++++++++ ...ETLSyncStatusesBySubscriptionIdOutput.java | 283 ++++++++++++++++++ ...cOutput.java => ReverseETLSyncStatus.java} | 92 +++--- 7 files changed, 856 insertions(+), 52 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java rename src/main/java/com/segment/publicapi/models/{ReverseETLSyncOutput.java => ReverseETLSyncStatus.java} (88%) diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index d22678eb..492a2054 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.segmentapis.com* | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | | [**getReverseETLSyncStatus**](ReverseEtlApi.md#getReverseETLSyncStatus) | **GET** /reverse-etl-models/{modelId}/syncs/{syncId} | Get Reverse ETL Sync Status | +| [**getReverseETLSyncStatusesBySubscriptionId**](ReverseEtlApi.md#getReverseETLSyncStatusesBySubscriptionId) | **GET** /reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs | Get Reverse ETL Sync Statuses By Subscription Id | | [**getReverseEtlModel**](ReverseEtlApi.md#getReverseEtlModel) | **GET** /reverse-etl-models/{modelId} | Get Reverse Etl Model | | [**listReverseEtlModels**](ReverseEtlApi.md#listReverseEtlModels) | **GET** /reverse-etl-models | List Reverse Etl Models | | [**updateReverseEtlModel**](ReverseEtlApi.md#updateReverseEtlModel) | **PATCH** /reverse-etl-models/{modelId} | Update Reverse Etl Model | @@ -308,6 +309,83 @@ public class Example { | **429** | Too many requests | - | +## Operation: getReverseETLSyncStatusesBySubscriptionId + +> GetReverseETLSyncStatusesBySubscriptionId200Response getReverseETLSyncStatusesBySubscriptionId(modelId, subscriptionId, pagination) + +Get Reverse ETL Sync Statuses By Subscription Id + +Get the sync statuses for a Reverse ETL mapping subscription. The sync status includes all detailed information about the sync - sync status, duration, details about the extract and load phase if applicable, etc. The default page count is 10, and then the next page can be fetched by passing the `cursor` query parameter. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ReverseEtlApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); + String modelId = "modelId"; // String | + String subscriptionId = "subscriptionId"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination params. This parameter exists in alpha. + try { + GetReverseETLSyncStatusesBySubscriptionId200Response result = apiInstance.getReverseETLSyncStatusesBySubscriptionId(modelId, subscriptionId, pagination); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReverseEtlApi#getReverseETLSyncStatusesBySubscriptionId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **modelId** | **String**| | | +| **subscriptionId** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Optional pagination params. This parameter exists in alpha. | [optional] | + +### Return type + +[**GetReverseETLSyncStatusesBySubscriptionId200Response**](GetReverseETLSyncStatusesBySubscriptionId200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: getReverseEtlModel > GetReverseEtlModel200Response getReverseEtlModel(modelId) diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index c7209477..0f6581a1 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -709,6 +709,13 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetReverseETLSyncStatusOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .GetReverseETLSyncStatusesBySubscriptionId200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetReverseETLSyncStatusesBySubscriptionIdOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetReverseEtlModel200Response .CustomTypeAdapterFactory()); @@ -1280,7 +1287,7 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ReverseETLManualSyncJobOutput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseETLSyncOutput.CustomTypeAdapterFactory()); + new com.segment.publicapi.models.ReverseETLSyncStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 68f252c9..f502cbd1 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -24,6 +24,7 @@ import com.segment.publicapi.models.CreateReverseEtlModelInput; import com.segment.publicapi.models.DeleteReverseEtlModel200Response; import com.segment.publicapi.models.GetReverseETLSyncStatus200Response; +import com.segment.publicapi.models.GetReverseETLSyncStatusesBySubscriptionId200Response; import com.segment.publicapi.models.GetReverseEtlModel200Response; import com.segment.publicapi.models.ListReverseEtlModels200Response; import com.segment.publicapi.models.PaginationInput; @@ -794,6 +795,225 @@ public okhttp3.Call getReverseETLSyncStatusAsync( return localVarCall; } + /** + * Build call for getReverseETLSyncStatusesBySubscriptionId + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdCall( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs" + .replace( + "{" + "modelId" + "}", + localVarApiClient.escapeString(modelId.toString())) + .replace( + "{" + "subscriptionId" + "}", + localVarApiClient.escapeString(subscriptionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " getReverseETLSyncStatusesBySubscriptionId(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException( + "Missing the required parameter 'subscriptionId' when calling" + + " getReverseETLSyncStatusesBySubscriptionId(Async)"); + } + + return getReverseETLSyncStatusesBySubscriptionIdCall( + modelId, subscriptionId, pagination, _callback); + } + + /** + * Get Reverse ETL Sync Statuses By Subscription Id Get the sync statuses for a Reverse ETL + * mapping subscription. The sync status includes all detailed information about the sync - sync + * status, duration, details about the extract and load phase if applicable, etc. The default + * page count is 10, and then the next page can be fetched by passing the `cursor` + * query parameter. + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @return GetReverseETLSyncStatusesBySubscriptionId200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetReverseETLSyncStatusesBySubscriptionId200Response + getReverseETLSyncStatusesBySubscriptionId( + String modelId, String subscriptionId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + getReverseETLSyncStatusesBySubscriptionIdWithHttpInfo( + modelId, subscriptionId, pagination); + return localVarResp.getData(); + } + + /** + * Get Reverse ETL Sync Statuses By Subscription Id Get the sync statuses for a Reverse ETL + * mapping subscription. The sync status includes all detailed information about the sync - sync + * status, duration, details about the extract and load phase if applicable, etc. The default + * page count is 10, and then the next page can be fetched by passing the `cursor` + * query parameter. + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @return ApiResponse<GetReverseETLSyncStatusesBySubscriptionId200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + getReverseETLSyncStatusesBySubscriptionIdWithHttpInfo( + String modelId, String subscriptionId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall( + modelId, subscriptionId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Reverse ETL Sync Statuses By Subscription Id (asynchronously) Get the sync statuses for a + * Reverse ETL mapping subscription. The sync status includes all detailed information about the + * sync - sync status, duration, details about the extract and load phase if applicable, etc. + * The default page count is 10, and then the next page can be fetched by passing the + * `cursor` query parameter. + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdAsync( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall( + modelId, subscriptionId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for getReverseEtlModel * diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java index c72328cc..67e794a4 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java @@ -32,12 +32,12 @@ public class GetReverseETLSyncStatusOutput { public static final String SERIALIZED_NAME_REVERSE_E_T_L_SYNC_STATUS = "reverseETLSyncStatus"; @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SYNC_STATUS) - private ReverseETLSyncOutput reverseETLSyncStatus; + private ReverseETLSyncStatus reverseETLSyncStatus; public GetReverseETLSyncStatusOutput() {} public GetReverseETLSyncStatusOutput reverseETLSyncStatus( - ReverseETLSyncOutput reverseETLSyncStatus) { + ReverseETLSyncStatus reverseETLSyncStatus) { this.reverseETLSyncStatus = reverseETLSyncStatus; return this; @@ -49,11 +49,11 @@ public GetReverseETLSyncStatusOutput reverseETLSyncStatus( * @return reverseETLSyncStatus */ @javax.annotation.Nonnull - public ReverseETLSyncOutput getReverseETLSyncStatus() { + public ReverseETLSyncStatus getReverseETLSyncStatus() { return reverseETLSyncStatus; } - public void setReverseETLSyncStatus(ReverseETLSyncOutput reverseETLSyncStatus) { + public void setReverseETLSyncStatus(ReverseETLSyncStatus reverseETLSyncStatus) { this.reverseETLSyncStatus = reverseETLSyncStatus; } @@ -153,7 +153,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `reverseETLSyncStatus` - ReverseETLSyncOutput.validateJsonElement(jsonObj.get("reverseETLSyncStatus")); + ReverseETLSyncStatus.validateJsonElement(jsonObj.get("reverseETLSyncStatus")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java new file mode 100644 index 00000000..01701714 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java @@ -0,0 +1,216 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetReverseETLSyncStatusesBySubscriptionId200Response */ +public class GetReverseETLSyncStatusesBySubscriptionId200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetReverseETLSyncStatusesBySubscriptionIdOutput data; + + public GetReverseETLSyncStatusesBySubscriptionId200Response() {} + + public GetReverseETLSyncStatusesBySubscriptionId200Response data( + GetReverseETLSyncStatusesBySubscriptionIdOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetReverseETLSyncStatusesBySubscriptionIdOutput getData() { + return data; + } + + public void setData(GetReverseETLSyncStatusesBySubscriptionIdOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetReverseETLSyncStatusesBySubscriptionId200Response + getReverseETLSyncStatusesBySubscriptionId200Response = + (GetReverseETLSyncStatusesBySubscriptionId200Response) o; + return Objects.equals(this.data, getReverseETLSyncStatusesBySubscriptionId200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetReverseETLSyncStatusesBySubscriptionId200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetReverseETLSyncStatusesBySubscriptionId200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetReverseETLSyncStatusesBySubscriptionId200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetReverseETLSyncStatusesBySubscriptionId200Response is not" + + " found in the empty JSON string", + GetReverseETLSyncStatusesBySubscriptionId200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetReverseETLSyncStatusesBySubscriptionId200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetReverseETLSyncStatusesBySubscriptionId200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetReverseETLSyncStatusesBySubscriptionIdOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetReverseETLSyncStatusesBySubscriptionId200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetReverseETLSyncStatusesBySubscriptionId200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetReverseETLSyncStatusesBySubscriptionId200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetReverseETLSyncStatusesBySubscriptionId200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetReverseETLSyncStatusesBySubscriptionId200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetReverseETLSyncStatusesBySubscriptionId200Response given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetReverseETLSyncStatusesBySubscriptionId200Response + * @throws IOException if the JSON string is invalid with respect to + * GetReverseETLSyncStatusesBySubscriptionId200Response + */ + public static GetReverseETLSyncStatusesBySubscriptionId200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetReverseETLSyncStatusesBySubscriptionId200Response.class); + } + + /** + * Convert an instance of GetReverseETLSyncStatusesBySubscriptionId200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java new file mode 100644 index 00000000..1ef69a0b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java @@ -0,0 +1,283 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The reverse ETL sync statuses that were looked up. */ +public class GetReverseETLSyncStatusesBySubscriptionIdOutput { + public static final String SERIALIZED_NAME_SYNC_STATUSES = "syncStatuses"; + + @SerializedName(SERIALIZED_NAME_SYNC_STATUSES) + private List syncStatuses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationOutput pagination; + + public GetReverseETLSyncStatusesBySubscriptionIdOutput() {} + + public GetReverseETLSyncStatusesBySubscriptionIdOutput syncStatuses( + List syncStatuses) { + + this.syncStatuses = syncStatuses; + return this; + } + + public GetReverseETLSyncStatusesBySubscriptionIdOutput addSyncStatusesItem( + ReverseETLSyncStatus syncStatusesItem) { + if (this.syncStatuses == null) { + this.syncStatuses = new ArrayList<>(); + } + this.syncStatuses.add(syncStatusesItem); + return this; + } + + /** + * The reverse ETL sync statuses that were looked up of the subscriptionId. + * + * @return syncStatuses + */ + @javax.annotation.Nonnull + public List getSyncStatuses() { + return syncStatuses; + } + + public void setSyncStatuses(List syncStatuses) { + this.syncStatuses = syncStatuses; + } + + public GetReverseETLSyncStatusesBySubscriptionIdOutput pagination(PaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + public PaginationOutput getPagination() { + return pagination; + } + + public void setPagination(PaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetReverseETLSyncStatusesBySubscriptionIdOutput + getReverseETLSyncStatusesBySubscriptionIdOutput = + (GetReverseETLSyncStatusesBySubscriptionIdOutput) o; + return Objects.equals( + this.syncStatuses, + getReverseETLSyncStatusesBySubscriptionIdOutput.syncStatuses) + && Objects.equals( + this.pagination, + getReverseETLSyncStatusesBySubscriptionIdOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(syncStatuses, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetReverseETLSyncStatusesBySubscriptionIdOutput {\n"); + sb.append(" syncStatuses: ").append(toIndentedString(syncStatuses)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("syncStatuses"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("syncStatuses"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetReverseETLSyncStatusesBySubscriptionIdOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetReverseETLSyncStatusesBySubscriptionIdOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetReverseETLSyncStatusesBySubscriptionIdOutput is not" + + " found in the empty JSON string", + GetReverseETLSyncStatusesBySubscriptionIdOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetReverseETLSyncStatusesBySubscriptionIdOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetReverseETLSyncStatusesBySubscriptionIdOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetReverseETLSyncStatusesBySubscriptionIdOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("syncStatuses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `syncStatuses` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("syncStatuses").toString())); + } + + JsonArray jsonArraysyncStatuses = jsonObj.getAsJsonArray("syncStatuses"); + // validate the required field `syncStatuses` (array) + for (int i = 0; i < jsonArraysyncStatuses.size(); i++) { + ReverseETLSyncStatus.validateJsonElement(jsonArraysyncStatuses.get(i)); + } + ; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetReverseETLSyncStatusesBySubscriptionIdOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetReverseETLSyncStatusesBySubscriptionIdOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetReverseETLSyncStatusesBySubscriptionIdOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetReverseETLSyncStatusesBySubscriptionIdOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetReverseETLSyncStatusesBySubscriptionIdOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetReverseETLSyncStatusesBySubscriptionIdOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetReverseETLSyncStatusesBySubscriptionIdOutput + * @throws IOException if the JSON string is invalid with respect to + * GetReverseETLSyncStatusesBySubscriptionIdOutput + */ + public static GetReverseETLSyncStatusesBySubscriptionIdOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetReverseETLSyncStatusesBySubscriptionIdOutput.class); + } + + /** + * Convert an instance of GetReverseETLSyncStatusesBySubscriptionIdOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java b/src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java similarity index 88% rename from src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java rename to src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java index 6943ed2d..e6626b2a 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java @@ -28,7 +28,7 @@ import java.util.Set; /** Defines the result of getting the sync status of a RETL connection. */ -public class ReverseETLSyncOutput { +public class ReverseETLSyncStatus { public static final String SERIALIZED_NAME_SYNC_ID = "syncId"; @SerializedName(SERIALIZED_NAME_SYNC_ID) @@ -84,9 +84,9 @@ public class ReverseETLSyncOutput { @SerializedName(SERIALIZED_NAME_ERROR_CODE) private String errorCode; - public ReverseETLSyncOutput() {} + public ReverseETLSyncStatus() {} - public ReverseETLSyncOutput syncId(String syncId) { + public ReverseETLSyncStatus syncId(String syncId) { this.syncId = syncId; return this; @@ -106,7 +106,7 @@ public void setSyncId(String syncId) { this.syncId = syncId; } - public ReverseETLSyncOutput modelId(String modelId) { + public ReverseETLSyncStatus modelId(String modelId) { this.modelId = modelId; return this; @@ -126,7 +126,7 @@ public void setModelId(String modelId) { this.modelId = modelId; } - public ReverseETLSyncOutput sourceId(String sourceId) { + public ReverseETLSyncStatus sourceId(String sourceId) { this.sourceId = sourceId; return this; @@ -146,7 +146,7 @@ public void setSourceId(String sourceId) { this.sourceId = sourceId; } - public ReverseETLSyncOutput syncStatus(String syncStatus) { + public ReverseETLSyncStatus syncStatus(String syncStatus) { this.syncStatus = syncStatus; return this; @@ -166,7 +166,7 @@ public void setSyncStatus(String syncStatus) { this.syncStatus = syncStatus; } - public ReverseETLSyncOutput duration(String duration) { + public ReverseETLSyncStatus duration(String duration) { this.duration = duration; return this; @@ -186,7 +186,7 @@ public void setDuration(String duration) { this.duration = duration; } - public ReverseETLSyncOutput startedAt(String startedAt) { + public ReverseETLSyncStatus startedAt(String startedAt) { this.startedAt = startedAt; return this; @@ -206,7 +206,7 @@ public void setStartedAt(String startedAt) { this.startedAt = startedAt; } - public ReverseETLSyncOutput finishedAt(String finishedAt) { + public ReverseETLSyncStatus finishedAt(String finishedAt) { this.finishedAt = finishedAt; return this; @@ -226,7 +226,7 @@ public void setFinishedAt(String finishedAt) { this.finishedAt = finishedAt; } - public ReverseETLSyncOutput extractPhase(SyncExtractPhase extractPhase) { + public ReverseETLSyncStatus extractPhase(SyncExtractPhase extractPhase) { this.extractPhase = extractPhase; return this; @@ -246,7 +246,7 @@ public void setExtractPhase(SyncExtractPhase extractPhase) { this.extractPhase = extractPhase; } - public ReverseETLSyncOutput loadPhase(SyncLoadPhase loadPhase) { + public ReverseETLSyncStatus loadPhase(SyncLoadPhase loadPhase) { this.loadPhase = loadPhase; return this; @@ -266,7 +266,7 @@ public void setLoadPhase(SyncLoadPhase loadPhase) { this.loadPhase = loadPhase; } - public ReverseETLSyncOutput error(String error) { + public ReverseETLSyncStatus error(String error) { this.error = error; return this; @@ -286,7 +286,7 @@ public void setError(String error) { this.error = error; } - public ReverseETLSyncOutput errorCode(String errorCode) { + public ReverseETLSyncStatus errorCode(String errorCode) { this.errorCode = errorCode; return this; @@ -314,18 +314,18 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ReverseETLSyncOutput reverseETLSyncOutput = (ReverseETLSyncOutput) o; - return Objects.equals(this.syncId, reverseETLSyncOutput.syncId) - && Objects.equals(this.modelId, reverseETLSyncOutput.modelId) - && Objects.equals(this.sourceId, reverseETLSyncOutput.sourceId) - && Objects.equals(this.syncStatus, reverseETLSyncOutput.syncStatus) - && Objects.equals(this.duration, reverseETLSyncOutput.duration) - && Objects.equals(this.startedAt, reverseETLSyncOutput.startedAt) - && Objects.equals(this.finishedAt, reverseETLSyncOutput.finishedAt) - && Objects.equals(this.extractPhase, reverseETLSyncOutput.extractPhase) - && Objects.equals(this.loadPhase, reverseETLSyncOutput.loadPhase) - && Objects.equals(this.error, reverseETLSyncOutput.error) - && Objects.equals(this.errorCode, reverseETLSyncOutput.errorCode); + ReverseETLSyncStatus reverseETLSyncStatus = (ReverseETLSyncStatus) o; + return Objects.equals(this.syncId, reverseETLSyncStatus.syncId) + && Objects.equals(this.modelId, reverseETLSyncStatus.modelId) + && Objects.equals(this.sourceId, reverseETLSyncStatus.sourceId) + && Objects.equals(this.syncStatus, reverseETLSyncStatus.syncStatus) + && Objects.equals(this.duration, reverseETLSyncStatus.duration) + && Objects.equals(this.startedAt, reverseETLSyncStatus.startedAt) + && Objects.equals(this.finishedAt, reverseETLSyncStatus.finishedAt) + && Objects.equals(this.extractPhase, reverseETLSyncStatus.extractPhase) + && Objects.equals(this.loadPhase, reverseETLSyncStatus.loadPhase) + && Objects.equals(this.error, reverseETLSyncStatus.error) + && Objects.equals(this.errorCode, reverseETLSyncStatus.errorCode); } @Override @@ -347,7 +347,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ReverseETLSyncOutput {\n"); + sb.append("class ReverseETLSyncStatus {\n"); sb.append(" syncId: ").append(toIndentedString(syncId)).append("\n"); sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); @@ -406,34 +406,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReverseETLSyncOutput + * @throws IOException if the JSON Element is invalid with respect to ReverseETLSyncStatus */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ReverseETLSyncOutput.openapiRequiredFields + if (!ReverseETLSyncStatus.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ReverseETLSyncOutput is not found in" + "The required field(s) %s in ReverseETLSyncStatus is not found in" + " the empty JSON string", - ReverseETLSyncOutput.openapiRequiredFields.toString())); + ReverseETLSyncStatus.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ReverseETLSyncOutput.openapiFields.contains(entry.getKey())) { + if (!ReverseETLSyncStatus.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ReverseETLSyncOutput` properties. JSON: %s", + + " `ReverseETLSyncStatus` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseETLSyncOutput.openapiRequiredFields) { + for (String requiredField : ReverseETLSyncStatus.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -522,24 +522,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseETLSyncOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseETLSyncOutput' and its subtypes + if (!ReverseETLSyncStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseETLSyncStatus' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ReverseETLSyncOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReverseETLSyncStatus.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ReverseETLSyncOutput value) + public void write(JsonWriter out, ReverseETLSyncStatus value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ReverseETLSyncOutput read(JsonReader in) throws IOException { + public ReverseETLSyncStatus read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -549,18 +549,18 @@ public ReverseETLSyncOutput read(JsonReader in) throws IOException { } /** - * Create an instance of ReverseETLSyncOutput given an JSON string + * Create an instance of ReverseETLSyncStatus given an JSON string * * @param jsonString JSON string - * @return An instance of ReverseETLSyncOutput - * @throws IOException if the JSON string is invalid with respect to ReverseETLSyncOutput + * @return An instance of ReverseETLSyncStatus + * @throws IOException if the JSON string is invalid with respect to ReverseETLSyncStatus */ - public static ReverseETLSyncOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseETLSyncOutput.class); + public static ReverseETLSyncStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseETLSyncStatus.class); } /** - * Convert an instance of ReverseETLSyncOutput to an JSON string + * Convert an instance of ReverseETLSyncStatus to an JSON string * * @return JSON string */ From 52ac3910edf8e780479a67139531801c755e69af Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 Aug 2024 03:58:44 +0000 Subject: [PATCH 326/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7845fc1d. --- README.md | 8 +- docs/ReverseEtlApi.md | 42 ++-- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 15 +- .../segment/publicapi/api/ReverseEtlApi.java | 217 +++++++++--------- ...romModelAndSubscriptionId200Response.java} | 95 ++++---- ...usesFromModelAndSubscriptionIdOutput.java} | 83 ++++--- 9 files changed, 244 insertions(+), 222 deletions(-) rename src/main/java/com/segment/publicapi/models/{GetReverseETLSyncStatusesBySubscriptionId200Response.java => ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java} (60%) rename src/main/java/com/segment/publicapi/models/{GetReverseETLSyncStatusesBySubscriptionIdOutput.java => ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java} (71%) diff --git a/README.md b/README.md index 4db1b961..d1ea5c18 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.1.0 +Latest API and SDK version: 53.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.1.0 + 53.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.1.0" + implementation "com.segment.publicapi:segment-publicapi:53.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.1.0.jar` +* `target/segment-publicapi-53.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index 492a2054..a060fde8 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -8,8 +8,8 @@ All URIs are relative to *https://api.segmentapis.com* | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | | [**getReverseETLSyncStatus**](ReverseEtlApi.md#getReverseETLSyncStatus) | **GET** /reverse-etl-models/{modelId}/syncs/{syncId} | Get Reverse ETL Sync Status | -| [**getReverseETLSyncStatusesBySubscriptionId**](ReverseEtlApi.md#getReverseETLSyncStatusesBySubscriptionId) | **GET** /reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs | Get Reverse ETL Sync Statuses By Subscription Id | | [**getReverseEtlModel**](ReverseEtlApi.md#getReverseEtlModel) | **GET** /reverse-etl-models/{modelId} | Get Reverse Etl Model | +| [**listReverseETLSyncStatusesFromModelAndSubscriptionId**](ReverseEtlApi.md#listReverseETLSyncStatusesFromModelAndSubscriptionId) | **GET** /reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs | List Reverse ETL Sync Statuses from Model And Subscription Id | | [**listReverseEtlModels**](ReverseEtlApi.md#listReverseEtlModels) | **GET** /reverse-etl-models | List Reverse Etl Models | | [**updateReverseEtlModel**](ReverseEtlApi.md#updateReverseEtlModel) | **PATCH** /reverse-etl-models/{modelId} | Update Reverse Etl Model | @@ -309,13 +309,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: getReverseETLSyncStatusesBySubscriptionId +## Operation: getReverseEtlModel -> GetReverseETLSyncStatusesBySubscriptionId200Response getReverseETLSyncStatusesBySubscriptionId(modelId, subscriptionId, pagination) +> GetReverseEtlModel200Response getReverseEtlModel(modelId) -Get Reverse ETL Sync Statuses By Subscription Id +Get Reverse Etl Model -Get the sync statuses for a Reverse ETL mapping subscription. The sync status includes all detailed information about the sync - sync status, duration, details about the extract and load phase if applicable, etc. The default page count is 10, and then the next page can be fetched by passing the `cursor` query parameter. +Returns a Reverse ETL Model by its id. ### Example @@ -337,14 +337,12 @@ public class Example { token.setBearerToken("BEARER TOKEN"); ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "modelId"; // String | - String subscriptionId = "subscriptionId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination params. This parameter exists in alpha. + String modelId = "dY1JLx4HgWHKUNsB76tEU"; // String | try { - GetReverseETLSyncStatusesBySubscriptionId200Response result = apiInstance.getReverseETLSyncStatusesBySubscriptionId(modelId, subscriptionId, pagination); + GetReverseEtlModel200Response result = apiInstance.getReverseEtlModel(modelId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReverseEtlApi#getReverseETLSyncStatusesBySubscriptionId"); + System.err.println("Exception when calling ReverseEtlApi#getReverseEtlModel"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -360,12 +358,10 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **modelId** | **String**| | | -| **subscriptionId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Optional pagination params. This parameter exists in alpha. | [optional] | ### Return type -[**GetReverseETLSyncStatusesBySubscriptionId200Response**](GetReverseETLSyncStatusesBySubscriptionId200Response.md) +[**GetReverseEtlModel200Response**](GetReverseEtlModel200Response.md) ### Authorization @@ -386,13 +382,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: getReverseEtlModel +## Operation: listReverseETLSyncStatusesFromModelAndSubscriptionId -> GetReverseEtlModel200Response getReverseEtlModel(modelId) +> ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination) -Get Reverse Etl Model +List Reverse ETL Sync Statuses from Model And Subscription Id -Returns a Reverse ETL Model by its id. +Get the sync statuses for a Reverse ETL mapping subscription. The sync status includes all detailed information about the sync - sync status, duration, details about the extract and load phase if applicable, etc. The default page count is 10, and then the next page can be fetched by passing the `cursor` query parameter. ### Example @@ -414,12 +410,14 @@ public class Example { token.setBearerToken("BEARER TOKEN"); ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "dY1JLx4HgWHKUNsB76tEU"; // String | + String modelId = "modelId"; // String | + String subscriptionId = "subscriptionId"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination params. This parameter exists in alpha. try { - GetReverseEtlModel200Response result = apiInstance.getReverseEtlModel(modelId); + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReverseEtlApi#getReverseEtlModel"); + System.err.println("Exception when calling ReverseEtlApi#listReverseETLSyncStatusesFromModelAndSubscriptionId"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -435,10 +433,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **modelId** | **String**| | | +| **subscriptionId** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Optional pagination params. This parameter exists in alpha. | [optional] | ### Return type -[**GetReverseEtlModel200Response**](GetReverseEtlModel200Response.md) +[**ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response**](ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.md) ### Authorization diff --git a/pom.xml b/pom.xml index a031f1da..8b1039c3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.1.0 + 53.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 2eb34e13..a7c98b99 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.1.0 (Java)"); + setUserAgent("Public API SDK 53.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f3bb69e2..ee2e89fc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.1.0"; + public static final String VERSION = "53.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 0f6581a1..7d881285 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -709,13 +709,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetReverseETLSyncStatusOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models - .GetReverseETLSyncStatusesBySubscriptionId200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetReverseETLSyncStatusesBySubscriptionIdOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetReverseEtlModel200Response .CustomTypeAdapterFactory()); @@ -950,6 +943,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListRegulationsFromSourceV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListReverseEtlModels200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index f502cbd1..f5d7efc5 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -24,8 +24,8 @@ import com.segment.publicapi.models.CreateReverseEtlModelInput; import com.segment.publicapi.models.DeleteReverseEtlModel200Response; import com.segment.publicapi.models.GetReverseETLSyncStatus200Response; -import com.segment.publicapi.models.GetReverseETLSyncStatusesBySubscriptionId200Response; import com.segment.publicapi.models.GetReverseEtlModel200Response; +import com.segment.publicapi.models.ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response; import com.segment.publicapi.models.ListReverseEtlModels200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateReverseEtlModel200Response; @@ -796,11 +796,9 @@ public okhttp3.Call getReverseETLSyncStatusAsync( } /** - * Build call for getReverseETLSyncStatusesBySubscriptionId + * Build call for getReverseEtlModel * * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -813,11 +811,7 @@ public okhttp3.Call getReverseETLSyncStatusAsync( * 429 Too many requests - * */ - public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdCall( - String modelId, - String subscriptionId, - PaginationInput pagination, - final ApiCallback _callback) + public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -836,13 +830,10 @@ public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdCall( // create path and map variables String localVarPath = - "/reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs" + "/reverse-etl-models/{modelId}" .replace( "{" + "modelId" + "}", - localVarApiClient.escapeString(modelId.toString())) - .replace( - "{" + "subscriptionId" + "}", - localVarApiClient.escapeString(subscriptionId.toString())); + localVarApiClient.escapeString(modelId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -850,10 +841,6 @@ public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - final String[] localVarAccepts = { "application/vnd.segment.v1alpha+json", "application/json" }; @@ -885,41 +872,23 @@ public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall( - String modelId, - String subscriptionId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { + private okhttp3.Call getReverseEtlModelValidateBeforeCall( + String modelId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'modelId' is set if (modelId == null) { throw new ApiException( "Missing the required parameter 'modelId' when calling" - + " getReverseETLSyncStatusesBySubscriptionId(Async)"); - } - - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException( - "Missing the required parameter 'subscriptionId' when calling" - + " getReverseETLSyncStatusesBySubscriptionId(Async)"); + + " getReverseEtlModel(Async)"); } - return getReverseETLSyncStatusesBySubscriptionIdCall( - modelId, subscriptionId, pagination, _callback); + return getReverseEtlModelCall(modelId, _callback); } /** - * Get Reverse ETL Sync Statuses By Subscription Id Get the sync statuses for a Reverse ETL - * mapping subscription. The sync status includes all detailed information about the sync - sync - * status, duration, details about the extract and load phase if applicable, etc. The default - * page count is 10, and then the next page can be fetched by passing the `cursor` - * query parameter. + * Get Reverse Etl Model Returns a Reverse ETL Model by its id. * * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) - * @return GetReverseETLSyncStatusesBySubscriptionId200Response + * @return GetReverseEtlModel200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -931,27 +900,17 @@ private okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall * 429 Too many requests - * */ - public GetReverseETLSyncStatusesBySubscriptionId200Response - getReverseETLSyncStatusesBySubscriptionId( - String modelId, String subscriptionId, PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - getReverseETLSyncStatusesBySubscriptionIdWithHttpInfo( - modelId, subscriptionId, pagination); + public GetReverseEtlModel200Response getReverseEtlModel(String modelId) throws ApiException { + ApiResponse localVarResp = + getReverseEtlModelWithHttpInfo(modelId); return localVarResp.getData(); } /** - * Get Reverse ETL Sync Statuses By Subscription Id Get the sync statuses for a Reverse ETL - * mapping subscription. The sync status includes all detailed information about the sync - sync - * status, duration, details about the extract and load phase if applicable, etc. The default - * page count is 10, and then the next page can be fetched by passing the `cursor` - * query parameter. + * Get Reverse Etl Model Returns a Reverse ETL Model by its id. * * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) - * @return ApiResponse<GetReverseETLSyncStatusesBySubscriptionId200Response> + * @return ApiResponse<GetReverseEtlModel200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -963,28 +922,17 @@ private okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall * 429 Too many requests - * */ - public ApiResponse - getReverseETLSyncStatusesBySubscriptionIdWithHttpInfo( - String modelId, String subscriptionId, PaginationInput pagination) - throws ApiException { - okhttp3.Call localVarCall = - getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall( - modelId, subscriptionId, pagination, null); - Type localVarReturnType = - new TypeToken() {}.getType(); + public ApiResponse getReverseEtlModelWithHttpInfo(String modelId) + throws ApiException { + okhttp3.Call localVarCall = getReverseEtlModelValidateBeforeCall(modelId, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Reverse ETL Sync Statuses By Subscription Id (asynchronously) Get the sync statuses for a - * Reverse ETL mapping subscription. The sync status includes all detailed information about the - * sync - sync status, duration, details about the extract and load phase if applicable, etc. - * The default page count is 10, and then the next page can be fetched by passing the - * `cursor` query parameter. + * Get Reverse Etl Model (asynchronously) Returns a Reverse ETL Model by its id. * * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -998,26 +946,22 @@ private okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall * 429 Too many requests - * */ - public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdAsync( - String modelId, - String subscriptionId, - PaginationInput pagination, - final ApiCallback _callback) + public okhttp3.Call getReverseEtlModelAsync( + String modelId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - getReverseETLSyncStatusesBySubscriptionIdValidateBeforeCall( - modelId, subscriptionId, pagination, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getReverseEtlModelValidateBeforeCall(modelId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getReverseEtlModel + * Build call for listReverseETLSyncStatusesFromModelAndSubscriptionId * * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1030,7 +974,11 @@ public okhttp3.Call getReverseETLSyncStatusesBySubscriptionIdAsync( * 429 Too many requests - * */ - public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _callback) + public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1049,10 +997,13 @@ public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _ca // create path and map variables String localVarPath = - "/reverse-etl-models/{modelId}" + "/reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs" .replace( "{" + "modelId" + "}", - localVarApiClient.escapeString(modelId.toString())); + localVarApiClient.escapeString(modelId.toString())) + .replace( + "{" + "subscriptionId" + "}", + localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1060,6 +1011,10 @@ public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _ca Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + final String[] localVarAccepts = { "application/vnd.segment.v1alpha+json", "application/json" }; @@ -1091,23 +1046,41 @@ public okhttp3.Call getReverseEtlModelCall(String modelId, final ApiCallback _ca } @SuppressWarnings("rawtypes") - private okhttp3.Call getReverseEtlModelValidateBeforeCall( - String modelId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { // verify the required parameter 'modelId' is set if (modelId == null) { throw new ApiException( "Missing the required parameter 'modelId' when calling" - + " getReverseEtlModel(Async)"); + + " listReverseETLSyncStatusesFromModelAndSubscriptionId(Async)"); } - return getReverseEtlModelCall(modelId, _callback); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException( + "Missing the required parameter 'subscriptionId' when calling" + + " listReverseETLSyncStatusesFromModelAndSubscriptionId(Async)"); + } + + return listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( + modelId, subscriptionId, pagination, _callback); } /** - * Get Reverse Etl Model Returns a Reverse ETL Model by its id. + * List Reverse ETL Sync Statuses from Model And Subscription Id Get the sync statuses for a + * Reverse ETL mapping subscription. The sync status includes all detailed information about the + * sync - sync status, duration, details about the extract and load phase if applicable, etc. + * The default page count is 10, and then the next page can be fetched by passing the + * `cursor` query parameter. * * @param modelId (required) - * @return GetReverseEtlModel200Response + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @return ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1119,17 +1092,27 @@ private okhttp3.Call getReverseEtlModelValidateBeforeCall( * 429 Too many requests - * */ - public GetReverseEtlModel200Response getReverseEtlModel(String modelId) throws ApiException { - ApiResponse localVarResp = - getReverseEtlModelWithHttpInfo(modelId); + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + listReverseETLSyncStatusesFromModelAndSubscriptionId( + String modelId, String subscriptionId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( + modelId, subscriptionId, pagination); return localVarResp.getData(); } /** - * Get Reverse Etl Model Returns a Reverse ETL Model by its id. + * List Reverse ETL Sync Statuses from Model And Subscription Id Get the sync statuses for a + * Reverse ETL mapping subscription. The sync status includes all detailed information about the + * sync - sync status, duration, details about the extract and load phase if applicable, etc. + * The default page count is 10, and then the next page can be fetched by passing the + * `cursor` query parameter. * * @param modelId (required) - * @return ApiResponse<GetReverseEtlModel200Response> + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @return ApiResponse<ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1141,17 +1124,29 @@ public GetReverseEtlModel200Response getReverseEtlModel(String modelId) throws A * 429 Too many requests - * */ - public ApiResponse getReverseEtlModelWithHttpInfo(String modelId) - throws ApiException { - okhttp3.Call localVarCall = getReverseEtlModelValidateBeforeCall(modelId, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse + listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( + String modelId, String subscriptionId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( + modelId, subscriptionId, pagination, null); + Type localVarReturnType = + new TypeToken< + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Reverse Etl Model (asynchronously) Returns a Reverse ETL Model by its id. + * List Reverse ETL Sync Statuses from Model And Subscription Id (asynchronously) Get the sync + * statuses for a Reverse ETL mapping subscription. The sync status includes all detailed + * information about the sync - sync status, duration, details about the extract and load phase + * if applicable, etc. The default page count is 10, and then the next page can be fetched by + * passing the `cursor` query parameter. * * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1165,12 +1160,20 @@ public ApiResponse getReverseEtlModelWithHttpInfo * 429 Too many requests - * */ - public okhttp3.Call getReverseEtlModelAsync( - String modelId, final ApiCallback _callback) + public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdAsync( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback + _callback) throws ApiException { - okhttp3.Call localVarCall = getReverseEtlModelValidateBeforeCall(modelId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( + modelId, subscriptionId, pagination, _callback); + Type localVarReturnType = + new TypeToken< + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java similarity index 60% rename from src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java rename to src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java index 01701714..40229b70 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionId200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java @@ -27,17 +27,17 @@ import java.util.Objects; import java.util.Set; -/** GetReverseETLSyncStatusesBySubscriptionId200Response */ -public class GetReverseETLSyncStatusesBySubscriptionId200Response { +/** ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response */ +public class ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetReverseETLSyncStatusesBySubscriptionIdOutput data; + private ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data; - public GetReverseETLSyncStatusesBySubscriptionId200Response() {} + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response() {} - public GetReverseETLSyncStatusesBySubscriptionId200Response data( - GetReverseETLSyncStatusesBySubscriptionIdOutput data) { + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response data( + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data) { this.data = data; return this; @@ -49,11 +49,11 @@ public GetReverseETLSyncStatusesBySubscriptionId200Response data( * @return data */ @javax.annotation.Nullable - public GetReverseETLSyncStatusesBySubscriptionIdOutput getData() { + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput getData() { return data; } - public void setData(GetReverseETLSyncStatusesBySubscriptionIdOutput data) { + public void setData(ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data) { this.data = data; } @@ -65,10 +65,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetReverseETLSyncStatusesBySubscriptionId200Response - getReverseETLSyncStatusesBySubscriptionId200Response = - (GetReverseETLSyncStatusesBySubscriptionId200Response) o; - return Objects.equals(this.data, getReverseETLSyncStatusesBySubscriptionId200Response.data); + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + listReverseETLSyncStatusesFromModelAndSubscriptionId200Response = + (ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response) o; + return Objects.equals( + this.data, listReverseETLSyncStatusesFromModelAndSubscriptionId200Response.data); } @Override @@ -79,7 +80,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetReverseETLSyncStatusesBySubscriptionId200Response {\n"); + sb.append("class ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -113,18 +114,19 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * GetReverseETLSyncStatusesBySubscriptionId200Response + * ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetReverseETLSyncStatusesBySubscriptionId200Response.openapiRequiredFields + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" - + " GetReverseETLSyncStatusesBySubscriptionId200Response is not" - + " found in the empty JSON string", - GetReverseETLSyncStatusesBySubscriptionId200Response + + " ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response" + + " is not found in the empty JSON string", + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response .openapiRequiredFields .toString())); } @@ -133,20 +135,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!GetReverseETLSyncStatusesBySubscriptionId200Response.openapiFields.contains( - entry.getKey())) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.openapiFields + .contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `GetReverseETLSyncStatusesBySubscriptionId200Response`" - + " properties. JSON: %s", + + " `ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response`" + + " properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetReverseETLSyncStatusesBySubscriptionIdOutput.validateJsonElement( + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.validateJsonElement( jsonObj.get("data")); } } @@ -155,32 +157,36 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetReverseETLSyncStatusesBySubscriptionId200Response.class.isAssignableFrom( - type.getRawType())) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.class + .isAssignableFrom(type.getRawType())) { return null; // this class only serializes - // 'GetReverseETLSyncStatusesBySubscriptionId200Response' and its - // subtypes + // 'ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response' + // and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - GetReverseETLSyncStatusesBySubscriptionId200Response.class)); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter< + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() { @Override public void write( JsonWriter out, - GetReverseETLSyncStatusesBySubscriptionId200Response value) + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public GetReverseETLSyncStatusesBySubscriptionId200Response read( + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response read( JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); @@ -191,22 +197,25 @@ public GetReverseETLSyncStatusesBySubscriptionId200Response read( } /** - * Create an instance of GetReverseETLSyncStatusesBySubscriptionId200Response given an JSON - * string + * Create an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response given + * an JSON string * * @param jsonString JSON string - * @return An instance of GetReverseETLSyncStatusesBySubscriptionId200Response + * @return An instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response * @throws IOException if the JSON string is invalid with respect to - * GetReverseETLSyncStatusesBySubscriptionId200Response + * ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response */ - public static GetReverseETLSyncStatusesBySubscriptionId200Response fromJson(String jsonString) - throws IOException { + public static ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response fromJson( + String jsonString) throws IOException { return JSON.getGson() - .fromJson(jsonString, GetReverseETLSyncStatusesBySubscriptionId200Response.class); + .fromJson( + jsonString, + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.class); } /** - * Convert an instance of GetReverseETLSyncStatusesBySubscriptionId200Response to an JSON string + * Convert an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response to an + * JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java similarity index 71% rename from src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java rename to src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java index 1ef69a0b..766d64a1 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusesBySubscriptionIdOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java @@ -31,7 +31,7 @@ import java.util.Set; /** The reverse ETL sync statuses that were looked up. */ -public class GetReverseETLSyncStatusesBySubscriptionIdOutput { +public class ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput { public static final String SERIALIZED_NAME_SYNC_STATUSES = "syncStatuses"; @SerializedName(SERIALIZED_NAME_SYNC_STATUSES) @@ -42,16 +42,16 @@ public class GetReverseETLSyncStatusesBySubscriptionIdOutput { @SerializedName(SERIALIZED_NAME_PAGINATION) private PaginationOutput pagination; - public GetReverseETLSyncStatusesBySubscriptionIdOutput() {} + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput() {} - public GetReverseETLSyncStatusesBySubscriptionIdOutput syncStatuses( + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput syncStatuses( List syncStatuses) { this.syncStatuses = syncStatuses; return this; } - public GetReverseETLSyncStatusesBySubscriptionIdOutput addSyncStatusesItem( + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput addSyncStatusesItem( ReverseETLSyncStatus syncStatusesItem) { if (this.syncStatuses == null) { this.syncStatuses = new ArrayList<>(); @@ -74,7 +74,8 @@ public void setSyncStatuses(List syncStatuses) { this.syncStatuses = syncStatuses; } - public GetReverseETLSyncStatusesBySubscriptionIdOutput pagination(PaginationOutput pagination) { + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput pagination( + PaginationOutput pagination) { this.pagination = pagination; return this; @@ -102,15 +103,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetReverseETLSyncStatusesBySubscriptionIdOutput - getReverseETLSyncStatusesBySubscriptionIdOutput = - (GetReverseETLSyncStatusesBySubscriptionIdOutput) o; + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput = + (ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput) o; return Objects.equals( this.syncStatuses, - getReverseETLSyncStatusesBySubscriptionIdOutput.syncStatuses) + listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.syncStatuses) && Objects.equals( this.pagination, - getReverseETLSyncStatusesBySubscriptionIdOutput.pagination); + listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.pagination); } @Override @@ -121,7 +122,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetReverseETLSyncStatusesBySubscriptionIdOutput {\n"); + sb.append("class ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput {\n"); sb.append(" syncStatuses: ").append(toIndentedString(syncStatuses)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -158,18 +159,18 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * GetReverseETLSyncStatusesBySubscriptionIdOutput + * ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetReverseETLSyncStatusesBySubscriptionIdOutput.openapiRequiredFields + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" - + " GetReverseETLSyncStatusesBySubscriptionIdOutput is not" - + " found in the empty JSON string", - GetReverseETLSyncStatusesBySubscriptionIdOutput + + " ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput" + + " is not found in the empty JSON string", + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput .openapiRequiredFields .toString())); } @@ -178,20 +179,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!GetReverseETLSyncStatusesBySubscriptionIdOutput.openapiFields.contains( + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `GetReverseETLSyncStatusesBySubscriptionIdOutput`" - + " properties. JSON: %s", + + " `ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput`" + + " properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string for (String requiredField : - GetReverseETLSyncStatusesBySubscriptionIdOutput.openapiRequiredFields) { + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -225,31 +226,35 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetReverseETLSyncStatusesBySubscriptionIdOutput.class.isAssignableFrom( + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.class.isAssignableFrom( type.getRawType())) { return null; // this class only serializes - // 'GetReverseETLSyncStatusesBySubscriptionIdOutput' and its subtypes + // 'ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get(GetReverseETLSyncStatusesBySubscriptionIdOutput.class)); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + .class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override public void write( JsonWriter out, - GetReverseETLSyncStatusesBySubscriptionIdOutput value) + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public GetReverseETLSyncStatusesBySubscriptionIdOutput read(JsonReader in) - throws IOException { + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput read( + JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -259,21 +264,25 @@ public GetReverseETLSyncStatusesBySubscriptionIdOutput read(JsonReader in) } /** - * Create an instance of GetReverseETLSyncStatusesBySubscriptionIdOutput given an JSON string + * Create an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput given an + * JSON string * * @param jsonString JSON string - * @return An instance of GetReverseETLSyncStatusesBySubscriptionIdOutput + * @return An instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput * @throws IOException if the JSON string is invalid with respect to - * GetReverseETLSyncStatusesBySubscriptionIdOutput + * ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput */ - public static GetReverseETLSyncStatusesBySubscriptionIdOutput fromJson(String jsonString) - throws IOException { + public static ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput fromJson( + String jsonString) throws IOException { return JSON.getGson() - .fromJson(jsonString, GetReverseETLSyncStatusesBySubscriptionIdOutput.class); + .fromJson( + jsonString, + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.class); } /** - * Convert an instance of GetReverseETLSyncStatusesBySubscriptionIdOutput to an JSON string + * Convert an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput to an JSON + * string * * @return JSON string */ From 5ab32e05385dc5d40212cfb503ea4fcf47800c52 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 Aug 2024 04:01:39 +0000 Subject: [PATCH 327/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@296e8a9e. --- README.md | 8 +- docs/ReverseEtlApi.md | 78 ----- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 10 +- .../segment/publicapi/api/ReverseEtlApi.java | 223 ------------- .../models/GetReverseETLSyncStatusOutput.java | 10 +- ...FromModelAndSubscriptionId200Response.java | 225 -------------- ...tusesFromModelAndSubscriptionIdOutput.java | 292 ------------------ ...cStatus.java => ReverseETLSyncOutput.java} | 92 +++--- 11 files changed, 59 insertions(+), 885 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java rename src/main/java/com/segment/publicapi/models/{ReverseETLSyncStatus.java => ReverseETLSyncOutput.java} (88%) diff --git a/README.md b/README.md index d1ea5c18..4db1b961 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.2.0 +Latest API and SDK version: 53.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.2.0 + 53.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.2.0" + implementation "com.segment.publicapi:segment-publicapi:53.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.2.0.jar` +* `target/segment-publicapi-53.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index a060fde8..d22678eb 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -9,7 +9,6 @@ All URIs are relative to *https://api.segmentapis.com* | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | | [**getReverseETLSyncStatus**](ReverseEtlApi.md#getReverseETLSyncStatus) | **GET** /reverse-etl-models/{modelId}/syncs/{syncId} | Get Reverse ETL Sync Status | | [**getReverseEtlModel**](ReverseEtlApi.md#getReverseEtlModel) | **GET** /reverse-etl-models/{modelId} | Get Reverse Etl Model | -| [**listReverseETLSyncStatusesFromModelAndSubscriptionId**](ReverseEtlApi.md#listReverseETLSyncStatusesFromModelAndSubscriptionId) | **GET** /reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs | List Reverse ETL Sync Statuses from Model And Subscription Id | | [**listReverseEtlModels**](ReverseEtlApi.md#listReverseEtlModels) | **GET** /reverse-etl-models | List Reverse Etl Models | | [**updateReverseEtlModel**](ReverseEtlApi.md#updateReverseEtlModel) | **PATCH** /reverse-etl-models/{modelId} | Update Reverse Etl Model | @@ -382,83 +381,6 @@ public class Example { | **429** | Too many requests | - | -## Operation: listReverseETLSyncStatusesFromModelAndSubscriptionId - -> ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination) - -List Reverse ETL Sync Statuses from Model And Subscription Id - -Get the sync statuses for a Reverse ETL mapping subscription. The sync status includes all detailed information about the sync - sync status, duration, details about the extract and load phase if applicable, etc. The default page count is 10, and then the next page can be fetched by passing the `cursor` query parameter. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.ReverseEtlApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "modelId"; // String | - String subscriptionId = "subscriptionId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination params. This parameter exists in alpha. - try { - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ReverseEtlApi#listReverseETLSyncStatusesFromModelAndSubscriptionId"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **modelId** | **String**| | | -| **subscriptionId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Optional pagination params. This parameter exists in alpha. | [optional] | - -### Return type - -[**ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response**](ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - ## Operation: listReverseEtlModels > ListReverseEtlModels200Response listReverseEtlModels(pagination) diff --git a/pom.xml b/pom.xml index 8b1039c3..a031f1da 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.2.0 + 53.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index a7c98b99..2eb34e13 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.2.0 (Java)"); + setUserAgent("Public API SDK 53.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ee2e89fc..f3bb69e2 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.2.0"; + public static final String VERSION = "53.1.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7d881285..c7209477 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -943,14 +943,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListRegulationsFromSourceV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models - .ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models - .ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListReverseEtlModels200Response .CustomTypeAdapterFactory()); @@ -1288,7 +1280,7 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ReverseETLManualSyncJobOutput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseETLSyncStatus.CustomTypeAdapterFactory()); + new com.segment.publicapi.models.ReverseETLSyncOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index f5d7efc5..68f252c9 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -25,7 +25,6 @@ import com.segment.publicapi.models.DeleteReverseEtlModel200Response; import com.segment.publicapi.models.GetReverseETLSyncStatus200Response; import com.segment.publicapi.models.GetReverseEtlModel200Response; -import com.segment.publicapi.models.ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response; import com.segment.publicapi.models.ListReverseEtlModels200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateReverseEtlModel200Response; @@ -956,228 +955,6 @@ public okhttp3.Call getReverseEtlModelAsync( return localVarCall; } - /** - * Build call for listReverseETLSyncStatusesFromModelAndSubscriptionId - * - * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( - String modelId, - String subscriptionId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs" - .replace( - "{" + "modelId" + "}", - localVarApiClient.escapeString(modelId.toString())) - .replace( - "{" + "subscriptionId" + "}", - localVarApiClient.escapeString(subscriptionId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( - String modelId, - String subscriptionId, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'modelId' is set - if (modelId == null) { - throw new ApiException( - "Missing the required parameter 'modelId' when calling" - + " listReverseETLSyncStatusesFromModelAndSubscriptionId(Async)"); - } - - // verify the required parameter 'subscriptionId' is set - if (subscriptionId == null) { - throw new ApiException( - "Missing the required parameter 'subscriptionId' when calling" - + " listReverseETLSyncStatusesFromModelAndSubscriptionId(Async)"); - } - - return listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( - modelId, subscriptionId, pagination, _callback); - } - - /** - * List Reverse ETL Sync Statuses from Model And Subscription Id Get the sync statuses for a - * Reverse ETL mapping subscription. The sync status includes all detailed information about the - * sync - sync status, duration, details about the extract and load phase if applicable, etc. - * The default page count is 10, and then the next page can be fetched by passing the - * `cursor` query parameter. - * - * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) - * @return ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - listReverseETLSyncStatusesFromModelAndSubscriptionId( - String modelId, String subscriptionId, PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( - modelId, subscriptionId, pagination); - return localVarResp.getData(); - } - - /** - * List Reverse ETL Sync Statuses from Model And Subscription Id Get the sync statuses for a - * Reverse ETL mapping subscription. The sync status includes all detailed information about the - * sync - sync status, duration, details about the extract and load phase if applicable, etc. - * The default page count is 10, and then the next page can be fetched by passing the - * `cursor` query parameter. - * - * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) - * @return ApiResponse<ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( - String modelId, String subscriptionId, PaginationInput pagination) - throws ApiException { - okhttp3.Call localVarCall = - listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( - modelId, subscriptionId, pagination, null); - Type localVarReturnType = - new TypeToken< - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * List Reverse ETL Sync Statuses from Model And Subscription Id (asynchronously) Get the sync - * statuses for a Reverse ETL mapping subscription. The sync status includes all detailed - * information about the sync - sync status, duration, details about the extract and load phase - * if applicable, etc. The default page count is 10, and then the next page can be fetched by - * passing the `cursor` query parameter. - * - * @param modelId (required) - * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdAsync( - String modelId, - String subscriptionId, - PaginationInput pagination, - final ApiCallback - _callback) - throws ApiException { - - okhttp3.Call localVarCall = - listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( - modelId, subscriptionId, pagination, _callback); - Type localVarReturnType = - new TypeToken< - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for listReverseEtlModels * diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java index 67e794a4..c72328cc 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java @@ -32,12 +32,12 @@ public class GetReverseETLSyncStatusOutput { public static final String SERIALIZED_NAME_REVERSE_E_T_L_SYNC_STATUS = "reverseETLSyncStatus"; @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SYNC_STATUS) - private ReverseETLSyncStatus reverseETLSyncStatus; + private ReverseETLSyncOutput reverseETLSyncStatus; public GetReverseETLSyncStatusOutput() {} public GetReverseETLSyncStatusOutput reverseETLSyncStatus( - ReverseETLSyncStatus reverseETLSyncStatus) { + ReverseETLSyncOutput reverseETLSyncStatus) { this.reverseETLSyncStatus = reverseETLSyncStatus; return this; @@ -49,11 +49,11 @@ public GetReverseETLSyncStatusOutput reverseETLSyncStatus( * @return reverseETLSyncStatus */ @javax.annotation.Nonnull - public ReverseETLSyncStatus getReverseETLSyncStatus() { + public ReverseETLSyncOutput getReverseETLSyncStatus() { return reverseETLSyncStatus; } - public void setReverseETLSyncStatus(ReverseETLSyncStatus reverseETLSyncStatus) { + public void setReverseETLSyncStatus(ReverseETLSyncOutput reverseETLSyncStatus) { this.reverseETLSyncStatus = reverseETLSyncStatus; } @@ -153,7 +153,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `reverseETLSyncStatus` - ReverseETLSyncStatus.validateJsonElement(jsonObj.get("reverseETLSyncStatus")); + ReverseETLSyncOutput.validateJsonElement(jsonObj.get("reverseETLSyncStatus")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java deleted file mode 100644 index 40229b70..00000000 --- a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response */ -public class ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data; - - public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response() {} - - public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response data( - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput getData() { - return data; - } - - public void setData(ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - listReverseETLSyncStatusesFromModelAndSubscriptionId200Response = - (ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response) o; - return Objects.equals( - this.data, listReverseETLSyncStatusesFromModelAndSubscriptionId200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - .openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response" - + " is not found in the empty JSON string", - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.openapiFields - .contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.validateJsonElement( - jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.class - .isAssignableFrom(type.getRawType())) { - return null; // this class only serializes - // 'ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - .class)); - - return (TypeAdapter) - new TypeAdapter< - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() { - @Override - public void write( - JsonWriter out, - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response given - * an JSON string - * - * @param jsonString JSON string - * @return An instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - * @throws IOException if the JSON string is invalid with respect to - * ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response - */ - public static ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response fromJson( - String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.class); - } - - /** - * Convert an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response to an - * JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java deleted file mode 100644 index 766d64a1..00000000 --- a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The reverse ETL sync statuses that were looked up. */ -public class ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput { - public static final String SERIALIZED_NAME_SYNC_STATUSES = "syncStatuses"; - - @SerializedName(SERIALIZED_NAME_SYNC_STATUSES) - private List syncStatuses = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - - @SerializedName(SERIALIZED_NAME_PAGINATION) - private PaginationOutput pagination; - - public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput() {} - - public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput syncStatuses( - List syncStatuses) { - - this.syncStatuses = syncStatuses; - return this; - } - - public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput addSyncStatusesItem( - ReverseETLSyncStatus syncStatusesItem) { - if (this.syncStatuses == null) { - this.syncStatuses = new ArrayList<>(); - } - this.syncStatuses.add(syncStatusesItem); - return this; - } - - /** - * The reverse ETL sync statuses that were looked up of the subscriptionId. - * - * @return syncStatuses - */ - @javax.annotation.Nonnull - public List getSyncStatuses() { - return syncStatuses; - } - - public void setSyncStatuses(List syncStatuses) { - this.syncStatuses = syncStatuses; - } - - public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput pagination( - PaginationOutput pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * - * @return pagination - */ - @javax.annotation.Nullable - public PaginationOutput getPagination() { - return pagination; - } - - public void setPagination(PaginationOutput pagination) { - this.pagination = pagination; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput = - (ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput) o; - return Objects.equals( - this.syncStatuses, - listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.syncStatuses) - && Objects.equals( - this.pagination, - listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(syncStatuses, pagination); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput {\n"); - sb.append(" syncStatuses: ").append(toIndentedString(syncStatuses)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("syncStatuses"); - openapiFields.add("pagination"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("syncStatuses"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput" - + " is not found in the empty JSON string", - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("syncStatuses").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `syncStatuses` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("syncStatuses").toString())); - } - - JsonArray jsonArraysyncStatuses = jsonObj.getAsJsonArray("syncStatuses"); - // validate the required field `syncStatuses` (array) - for (int i = 0; i < jsonArraysyncStatuses.size(); i++) { - ReverseETLSyncStatus.validateJsonElement(jsonArraysyncStatuses.get(i)); - } - ; - // validate the optional field `pagination` - if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { - PaginationOutput.validateJsonElement(jsonObj.get("pagination")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - .class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput given an - * JSON string - * - * @param jsonString JSON string - * @return An instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - * @throws IOException if the JSON string is invalid with respect to - * ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput - */ - public static ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput fromJson( - String jsonString) throws IOException { - return JSON.getGson() - .fromJson( - jsonString, - ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.class); - } - - /** - * Convert an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput to an JSON - * string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java b/src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java similarity index 88% rename from src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java rename to src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java index e6626b2a..6943ed2d 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java +++ b/src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java @@ -28,7 +28,7 @@ import java.util.Set; /** Defines the result of getting the sync status of a RETL connection. */ -public class ReverseETLSyncStatus { +public class ReverseETLSyncOutput { public static final String SERIALIZED_NAME_SYNC_ID = "syncId"; @SerializedName(SERIALIZED_NAME_SYNC_ID) @@ -84,9 +84,9 @@ public class ReverseETLSyncStatus { @SerializedName(SERIALIZED_NAME_ERROR_CODE) private String errorCode; - public ReverseETLSyncStatus() {} + public ReverseETLSyncOutput() {} - public ReverseETLSyncStatus syncId(String syncId) { + public ReverseETLSyncOutput syncId(String syncId) { this.syncId = syncId; return this; @@ -106,7 +106,7 @@ public void setSyncId(String syncId) { this.syncId = syncId; } - public ReverseETLSyncStatus modelId(String modelId) { + public ReverseETLSyncOutput modelId(String modelId) { this.modelId = modelId; return this; @@ -126,7 +126,7 @@ public void setModelId(String modelId) { this.modelId = modelId; } - public ReverseETLSyncStatus sourceId(String sourceId) { + public ReverseETLSyncOutput sourceId(String sourceId) { this.sourceId = sourceId; return this; @@ -146,7 +146,7 @@ public void setSourceId(String sourceId) { this.sourceId = sourceId; } - public ReverseETLSyncStatus syncStatus(String syncStatus) { + public ReverseETLSyncOutput syncStatus(String syncStatus) { this.syncStatus = syncStatus; return this; @@ -166,7 +166,7 @@ public void setSyncStatus(String syncStatus) { this.syncStatus = syncStatus; } - public ReverseETLSyncStatus duration(String duration) { + public ReverseETLSyncOutput duration(String duration) { this.duration = duration; return this; @@ -186,7 +186,7 @@ public void setDuration(String duration) { this.duration = duration; } - public ReverseETLSyncStatus startedAt(String startedAt) { + public ReverseETLSyncOutput startedAt(String startedAt) { this.startedAt = startedAt; return this; @@ -206,7 +206,7 @@ public void setStartedAt(String startedAt) { this.startedAt = startedAt; } - public ReverseETLSyncStatus finishedAt(String finishedAt) { + public ReverseETLSyncOutput finishedAt(String finishedAt) { this.finishedAt = finishedAt; return this; @@ -226,7 +226,7 @@ public void setFinishedAt(String finishedAt) { this.finishedAt = finishedAt; } - public ReverseETLSyncStatus extractPhase(SyncExtractPhase extractPhase) { + public ReverseETLSyncOutput extractPhase(SyncExtractPhase extractPhase) { this.extractPhase = extractPhase; return this; @@ -246,7 +246,7 @@ public void setExtractPhase(SyncExtractPhase extractPhase) { this.extractPhase = extractPhase; } - public ReverseETLSyncStatus loadPhase(SyncLoadPhase loadPhase) { + public ReverseETLSyncOutput loadPhase(SyncLoadPhase loadPhase) { this.loadPhase = loadPhase; return this; @@ -266,7 +266,7 @@ public void setLoadPhase(SyncLoadPhase loadPhase) { this.loadPhase = loadPhase; } - public ReverseETLSyncStatus error(String error) { + public ReverseETLSyncOutput error(String error) { this.error = error; return this; @@ -286,7 +286,7 @@ public void setError(String error) { this.error = error; } - public ReverseETLSyncStatus errorCode(String errorCode) { + public ReverseETLSyncOutput errorCode(String errorCode) { this.errorCode = errorCode; return this; @@ -314,18 +314,18 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ReverseETLSyncStatus reverseETLSyncStatus = (ReverseETLSyncStatus) o; - return Objects.equals(this.syncId, reverseETLSyncStatus.syncId) - && Objects.equals(this.modelId, reverseETLSyncStatus.modelId) - && Objects.equals(this.sourceId, reverseETLSyncStatus.sourceId) - && Objects.equals(this.syncStatus, reverseETLSyncStatus.syncStatus) - && Objects.equals(this.duration, reverseETLSyncStatus.duration) - && Objects.equals(this.startedAt, reverseETLSyncStatus.startedAt) - && Objects.equals(this.finishedAt, reverseETLSyncStatus.finishedAt) - && Objects.equals(this.extractPhase, reverseETLSyncStatus.extractPhase) - && Objects.equals(this.loadPhase, reverseETLSyncStatus.loadPhase) - && Objects.equals(this.error, reverseETLSyncStatus.error) - && Objects.equals(this.errorCode, reverseETLSyncStatus.errorCode); + ReverseETLSyncOutput reverseETLSyncOutput = (ReverseETLSyncOutput) o; + return Objects.equals(this.syncId, reverseETLSyncOutput.syncId) + && Objects.equals(this.modelId, reverseETLSyncOutput.modelId) + && Objects.equals(this.sourceId, reverseETLSyncOutput.sourceId) + && Objects.equals(this.syncStatus, reverseETLSyncOutput.syncStatus) + && Objects.equals(this.duration, reverseETLSyncOutput.duration) + && Objects.equals(this.startedAt, reverseETLSyncOutput.startedAt) + && Objects.equals(this.finishedAt, reverseETLSyncOutput.finishedAt) + && Objects.equals(this.extractPhase, reverseETLSyncOutput.extractPhase) + && Objects.equals(this.loadPhase, reverseETLSyncOutput.loadPhase) + && Objects.equals(this.error, reverseETLSyncOutput.error) + && Objects.equals(this.errorCode, reverseETLSyncOutput.errorCode); } @Override @@ -347,7 +347,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ReverseETLSyncStatus {\n"); + sb.append("class ReverseETLSyncOutput {\n"); sb.append(" syncId: ").append(toIndentedString(syncId)).append("\n"); sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); @@ -406,34 +406,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReverseETLSyncStatus + * @throws IOException if the JSON Element is invalid with respect to ReverseETLSyncOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ReverseETLSyncStatus.openapiRequiredFields + if (!ReverseETLSyncOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ReverseETLSyncStatus is not found in" + "The required field(s) %s in ReverseETLSyncOutput is not found in" + " the empty JSON string", - ReverseETLSyncStatus.openapiRequiredFields.toString())); + ReverseETLSyncOutput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ReverseETLSyncStatus.openapiFields.contains(entry.getKey())) { + if (!ReverseETLSyncOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ReverseETLSyncStatus` properties. JSON: %s", + + " `ReverseETLSyncOutput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseETLSyncStatus.openapiRequiredFields) { + for (String requiredField : ReverseETLSyncOutput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -522,24 +522,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseETLSyncStatus.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseETLSyncStatus' and its subtypes + if (!ReverseETLSyncOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseETLSyncOutput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ReverseETLSyncStatus.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReverseETLSyncOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ReverseETLSyncStatus value) + public void write(JsonWriter out, ReverseETLSyncOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ReverseETLSyncStatus read(JsonReader in) throws IOException { + public ReverseETLSyncOutput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -549,18 +549,18 @@ public ReverseETLSyncStatus read(JsonReader in) throws IOException { } /** - * Create an instance of ReverseETLSyncStatus given an JSON string + * Create an instance of ReverseETLSyncOutput given an JSON string * * @param jsonString JSON string - * @return An instance of ReverseETLSyncStatus - * @throws IOException if the JSON string is invalid with respect to ReverseETLSyncStatus + * @return An instance of ReverseETLSyncOutput + * @throws IOException if the JSON string is invalid with respect to ReverseETLSyncOutput */ - public static ReverseETLSyncStatus fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseETLSyncStatus.class); + public static ReverseETLSyncOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseETLSyncOutput.class); } /** - * Convert an instance of ReverseETLSyncStatus to an JSON string + * Convert an instance of ReverseETLSyncOutput to an JSON string * * @return JSON string */ From f72fa533b44597195c3ac45fcb61f35a6e4ebe09 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 Aug 2024 04:43:16 +0000 Subject: [PATCH 328/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7845fc1d. --- README.md | 8 +- docs/ReverseEtlApi.md | 78 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 10 +- .../segment/publicapi/api/ReverseEtlApi.java | 223 +++++++++++++ .../models/GetReverseETLSyncStatusOutput.java | 10 +- ...FromModelAndSubscriptionId200Response.java | 225 ++++++++++++++ ...tusesFromModelAndSubscriptionIdOutput.java | 292 ++++++++++++++++++ ...cOutput.java => ReverseETLSyncStatus.java} | 92 +++--- 11 files changed, 885 insertions(+), 59 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java rename src/main/java/com/segment/publicapi/models/{ReverseETLSyncOutput.java => ReverseETLSyncStatus.java} (88%) diff --git a/README.md b/README.md index 4db1b961..d1ea5c18 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.1.0 +Latest API and SDK version: 53.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.1.0 + 53.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.1.0" + implementation "com.segment.publicapi:segment-publicapi:53.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.1.0.jar` +* `target/segment-publicapi-53.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index d22678eb..a060fde8 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -9,6 +9,7 @@ All URIs are relative to *https://api.segmentapis.com* | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | | [**getReverseETLSyncStatus**](ReverseEtlApi.md#getReverseETLSyncStatus) | **GET** /reverse-etl-models/{modelId}/syncs/{syncId} | Get Reverse ETL Sync Status | | [**getReverseEtlModel**](ReverseEtlApi.md#getReverseEtlModel) | **GET** /reverse-etl-models/{modelId} | Get Reverse Etl Model | +| [**listReverseETLSyncStatusesFromModelAndSubscriptionId**](ReverseEtlApi.md#listReverseETLSyncStatusesFromModelAndSubscriptionId) | **GET** /reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs | List Reverse ETL Sync Statuses from Model And Subscription Id | | [**listReverseEtlModels**](ReverseEtlApi.md#listReverseEtlModels) | **GET** /reverse-etl-models | List Reverse Etl Models | | [**updateReverseEtlModel**](ReverseEtlApi.md#updateReverseEtlModel) | **PATCH** /reverse-etl-models/{modelId} | Update Reverse Etl Model | @@ -381,6 +382,83 @@ public class Example { | **429** | Too many requests | - | +## Operation: listReverseETLSyncStatusesFromModelAndSubscriptionId + +> ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination) + +List Reverse ETL Sync Statuses from Model And Subscription Id + +Get the sync statuses for a Reverse ETL mapping subscription. The sync status includes all detailed information about the sync - sync status, duration, details about the extract and load phase if applicable, etc. The default page count is 10, and then the next page can be fetched by passing the `cursor` query parameter. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ReverseEtlApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); + String modelId = "modelId"; // String | + String subscriptionId = "subscriptionId"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination params. This parameter exists in alpha. + try { + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReverseEtlApi#listReverseETLSyncStatusesFromModelAndSubscriptionId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **modelId** | **String**| | | +| **subscriptionId** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Optional pagination params. This parameter exists in alpha. | [optional] | + +### Return type + +[**ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response**](ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: listReverseEtlModels > ListReverseEtlModels200Response listReverseEtlModels(pagination) diff --git a/pom.xml b/pom.xml index a031f1da..8b1039c3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.1.0 + 53.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 2eb34e13..a7c98b99 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.1.0 (Java)"); + setUserAgent("Public API SDK 53.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f3bb69e2..ee2e89fc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.1.0"; + public static final String VERSION = "53.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index c7209477..7d881285 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -943,6 +943,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListRegulationsFromSourceV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListReverseEtlModels200Response .CustomTypeAdapterFactory()); @@ -1280,7 +1288,7 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ReverseETLManualSyncJobOutput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseETLSyncOutput.CustomTypeAdapterFactory()); + new com.segment.publicapi.models.ReverseETLSyncStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 68f252c9..f5d7efc5 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -25,6 +25,7 @@ import com.segment.publicapi.models.DeleteReverseEtlModel200Response; import com.segment.publicapi.models.GetReverseETLSyncStatus200Response; import com.segment.publicapi.models.GetReverseEtlModel200Response; +import com.segment.publicapi.models.ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response; import com.segment.publicapi.models.ListReverseEtlModels200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.UpdateReverseEtlModel200Response; @@ -955,6 +956,228 @@ public okhttp3.Call getReverseEtlModelAsync( return localVarCall; } + /** + * Build call for listReverseETLSyncStatusesFromModelAndSubscriptionId + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}/subscriptionId/{subscriptionId}/syncs" + .replace( + "{" + "modelId" + "}", + localVarApiClient.escapeString(modelId.toString())) + .replace( + "{" + "subscriptionId" + "}", + localVarApiClient.escapeString(subscriptionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " listReverseETLSyncStatusesFromModelAndSubscriptionId(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException( + "Missing the required parameter 'subscriptionId' when calling" + + " listReverseETLSyncStatusesFromModelAndSubscriptionId(Async)"); + } + + return listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( + modelId, subscriptionId, pagination, _callback); + } + + /** + * List Reverse ETL Sync Statuses from Model And Subscription Id Get the sync statuses for a + * Reverse ETL mapping subscription. The sync status includes all detailed information about the + * sync - sync status, duration, details about the extract and load phase if applicable, etc. + * The default page count is 10, and then the next page can be fetched by passing the + * `cursor` query parameter. + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @return ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + listReverseETLSyncStatusesFromModelAndSubscriptionId( + String modelId, String subscriptionId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( + modelId, subscriptionId, pagination); + return localVarResp.getData(); + } + + /** + * List Reverse ETL Sync Statuses from Model And Subscription Id Get the sync statuses for a + * Reverse ETL mapping subscription. The sync status includes all detailed information about the + * sync - sync status, duration, details about the extract and load phase if applicable, etc. + * The default page count is 10, and then the next page can be fetched by passing the + * `cursor` query parameter. + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @return ApiResponse<ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( + String modelId, String subscriptionId, PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( + modelId, subscriptionId, pagination, null); + Type localVarReturnType = + new TypeToken< + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Reverse ETL Sync Statuses from Model And Subscription Id (asynchronously) Get the sync + * statuses for a Reverse ETL mapping subscription. The sync status includes all detailed + * information about the sync - sync status, duration, details about the extract and load phase + * if applicable, etc. The default page count is 10, and then the next page can be fetched by + * passing the `cursor` query parameter. + * + * @param modelId (required) + * @param subscriptionId (required) + * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdAsync( + String modelId, + String subscriptionId, + PaginationInput pagination, + final ApiCallback + _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( + modelId, subscriptionId, pagination, _callback); + Type localVarReturnType = + new TypeToken< + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listReverseEtlModels * diff --git a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java index c72328cc..67e794a4 100644 --- a/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetReverseETLSyncStatusOutput.java @@ -32,12 +32,12 @@ public class GetReverseETLSyncStatusOutput { public static final String SERIALIZED_NAME_REVERSE_E_T_L_SYNC_STATUS = "reverseETLSyncStatus"; @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SYNC_STATUS) - private ReverseETLSyncOutput reverseETLSyncStatus; + private ReverseETLSyncStatus reverseETLSyncStatus; public GetReverseETLSyncStatusOutput() {} public GetReverseETLSyncStatusOutput reverseETLSyncStatus( - ReverseETLSyncOutput reverseETLSyncStatus) { + ReverseETLSyncStatus reverseETLSyncStatus) { this.reverseETLSyncStatus = reverseETLSyncStatus; return this; @@ -49,11 +49,11 @@ public GetReverseETLSyncStatusOutput reverseETLSyncStatus( * @return reverseETLSyncStatus */ @javax.annotation.Nonnull - public ReverseETLSyncOutput getReverseETLSyncStatus() { + public ReverseETLSyncStatus getReverseETLSyncStatus() { return reverseETLSyncStatus; } - public void setReverseETLSyncStatus(ReverseETLSyncOutput reverseETLSyncStatus) { + public void setReverseETLSyncStatus(ReverseETLSyncStatus reverseETLSyncStatus) { this.reverseETLSyncStatus = reverseETLSyncStatus; } @@ -153,7 +153,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `reverseETLSyncStatus` - ReverseETLSyncOutput.validateJsonElement(jsonObj.get("reverseETLSyncStatus")); + ReverseETLSyncStatus.validateJsonElement(jsonObj.get("reverseETLSyncStatus")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java new file mode 100644 index 00000000..40229b70 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.java @@ -0,0 +1,225 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response */ +public class ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data; + + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response() {} + + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response data( + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput getData() { + return data; + } + + public void setData(ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + listReverseETLSyncStatusesFromModelAndSubscriptionId200Response = + (ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response) o; + return Objects.equals( + this.data, listReverseETLSyncStatusesFromModelAndSubscriptionId200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response" + + " is not found in the empty JSON string", + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.openapiFields + .contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.class + .isAssignableFrom(type.getRawType())) { + return null; // this class only serializes + // 'ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + .class)); + + return (TypeAdapter) + new TypeAdapter< + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() { + @Override + public void write( + JsonWriter out, + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response given + * an JSON string + * + * @param jsonString JSON string + * @return An instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + * @throws IOException if the JSON string is invalid with respect to + * ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response + */ + public static ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response.class); + } + + /** + * Convert an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response to an + * JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java new file mode 100644 index 00000000..766d64a1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java @@ -0,0 +1,292 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The reverse ETL sync statuses that were looked up. */ +public class ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput { + public static final String SERIALIZED_NAME_SYNC_STATUSES = "syncStatuses"; + + @SerializedName(SERIALIZED_NAME_SYNC_STATUSES) + private List syncStatuses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationOutput pagination; + + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput() {} + + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput syncStatuses( + List syncStatuses) { + + this.syncStatuses = syncStatuses; + return this; + } + + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput addSyncStatusesItem( + ReverseETLSyncStatus syncStatusesItem) { + if (this.syncStatuses == null) { + this.syncStatuses = new ArrayList<>(); + } + this.syncStatuses.add(syncStatusesItem); + return this; + } + + /** + * The reverse ETL sync statuses that were looked up of the subscriptionId. + * + * @return syncStatuses + */ + @javax.annotation.Nonnull + public List getSyncStatuses() { + return syncStatuses; + } + + public void setSyncStatuses(List syncStatuses) { + this.syncStatuses = syncStatuses; + } + + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput pagination( + PaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + public PaginationOutput getPagination() { + return pagination; + } + + public void setPagination(PaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput = + (ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput) o; + return Objects.equals( + this.syncStatuses, + listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.syncStatuses) + && Objects.equals( + this.pagination, + listReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(syncStatuses, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput {\n"); + sb.append(" syncStatuses: ").append(toIndentedString(syncStatuses)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("syncStatuses"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("syncStatuses"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput" + + " is not found in the empty JSON string", + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("syncStatuses").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `syncStatuses` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("syncStatuses").toString())); + } + + JsonArray jsonArraysyncStatuses = jsonObj.getAsJsonArray("syncStatuses"); + // validate the required field `syncStatuses` (array) + for (int i = 0; i < jsonArraysyncStatuses.size(); i++) { + ReverseETLSyncStatus.validateJsonElement(jsonArraysyncStatuses.get(i)); + } + ; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + .class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput given an + * JSON string + * + * @param jsonString JSON string + * @return An instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + * @throws IOException if the JSON string is invalid with respect to + * ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput + */ + public static ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, + ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.class); + } + + /** + * Convert an instance of ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java b/src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java similarity index 88% rename from src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java rename to src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java index 6943ed2d..e6626b2a 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseETLSyncOutput.java +++ b/src/main/java/com/segment/publicapi/models/ReverseETLSyncStatus.java @@ -28,7 +28,7 @@ import java.util.Set; /** Defines the result of getting the sync status of a RETL connection. */ -public class ReverseETLSyncOutput { +public class ReverseETLSyncStatus { public static final String SERIALIZED_NAME_SYNC_ID = "syncId"; @SerializedName(SERIALIZED_NAME_SYNC_ID) @@ -84,9 +84,9 @@ public class ReverseETLSyncOutput { @SerializedName(SERIALIZED_NAME_ERROR_CODE) private String errorCode; - public ReverseETLSyncOutput() {} + public ReverseETLSyncStatus() {} - public ReverseETLSyncOutput syncId(String syncId) { + public ReverseETLSyncStatus syncId(String syncId) { this.syncId = syncId; return this; @@ -106,7 +106,7 @@ public void setSyncId(String syncId) { this.syncId = syncId; } - public ReverseETLSyncOutput modelId(String modelId) { + public ReverseETLSyncStatus modelId(String modelId) { this.modelId = modelId; return this; @@ -126,7 +126,7 @@ public void setModelId(String modelId) { this.modelId = modelId; } - public ReverseETLSyncOutput sourceId(String sourceId) { + public ReverseETLSyncStatus sourceId(String sourceId) { this.sourceId = sourceId; return this; @@ -146,7 +146,7 @@ public void setSourceId(String sourceId) { this.sourceId = sourceId; } - public ReverseETLSyncOutput syncStatus(String syncStatus) { + public ReverseETLSyncStatus syncStatus(String syncStatus) { this.syncStatus = syncStatus; return this; @@ -166,7 +166,7 @@ public void setSyncStatus(String syncStatus) { this.syncStatus = syncStatus; } - public ReverseETLSyncOutput duration(String duration) { + public ReverseETLSyncStatus duration(String duration) { this.duration = duration; return this; @@ -186,7 +186,7 @@ public void setDuration(String duration) { this.duration = duration; } - public ReverseETLSyncOutput startedAt(String startedAt) { + public ReverseETLSyncStatus startedAt(String startedAt) { this.startedAt = startedAt; return this; @@ -206,7 +206,7 @@ public void setStartedAt(String startedAt) { this.startedAt = startedAt; } - public ReverseETLSyncOutput finishedAt(String finishedAt) { + public ReverseETLSyncStatus finishedAt(String finishedAt) { this.finishedAt = finishedAt; return this; @@ -226,7 +226,7 @@ public void setFinishedAt(String finishedAt) { this.finishedAt = finishedAt; } - public ReverseETLSyncOutput extractPhase(SyncExtractPhase extractPhase) { + public ReverseETLSyncStatus extractPhase(SyncExtractPhase extractPhase) { this.extractPhase = extractPhase; return this; @@ -246,7 +246,7 @@ public void setExtractPhase(SyncExtractPhase extractPhase) { this.extractPhase = extractPhase; } - public ReverseETLSyncOutput loadPhase(SyncLoadPhase loadPhase) { + public ReverseETLSyncStatus loadPhase(SyncLoadPhase loadPhase) { this.loadPhase = loadPhase; return this; @@ -266,7 +266,7 @@ public void setLoadPhase(SyncLoadPhase loadPhase) { this.loadPhase = loadPhase; } - public ReverseETLSyncOutput error(String error) { + public ReverseETLSyncStatus error(String error) { this.error = error; return this; @@ -286,7 +286,7 @@ public void setError(String error) { this.error = error; } - public ReverseETLSyncOutput errorCode(String errorCode) { + public ReverseETLSyncStatus errorCode(String errorCode) { this.errorCode = errorCode; return this; @@ -314,18 +314,18 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ReverseETLSyncOutput reverseETLSyncOutput = (ReverseETLSyncOutput) o; - return Objects.equals(this.syncId, reverseETLSyncOutput.syncId) - && Objects.equals(this.modelId, reverseETLSyncOutput.modelId) - && Objects.equals(this.sourceId, reverseETLSyncOutput.sourceId) - && Objects.equals(this.syncStatus, reverseETLSyncOutput.syncStatus) - && Objects.equals(this.duration, reverseETLSyncOutput.duration) - && Objects.equals(this.startedAt, reverseETLSyncOutput.startedAt) - && Objects.equals(this.finishedAt, reverseETLSyncOutput.finishedAt) - && Objects.equals(this.extractPhase, reverseETLSyncOutput.extractPhase) - && Objects.equals(this.loadPhase, reverseETLSyncOutput.loadPhase) - && Objects.equals(this.error, reverseETLSyncOutput.error) - && Objects.equals(this.errorCode, reverseETLSyncOutput.errorCode); + ReverseETLSyncStatus reverseETLSyncStatus = (ReverseETLSyncStatus) o; + return Objects.equals(this.syncId, reverseETLSyncStatus.syncId) + && Objects.equals(this.modelId, reverseETLSyncStatus.modelId) + && Objects.equals(this.sourceId, reverseETLSyncStatus.sourceId) + && Objects.equals(this.syncStatus, reverseETLSyncStatus.syncStatus) + && Objects.equals(this.duration, reverseETLSyncStatus.duration) + && Objects.equals(this.startedAt, reverseETLSyncStatus.startedAt) + && Objects.equals(this.finishedAt, reverseETLSyncStatus.finishedAt) + && Objects.equals(this.extractPhase, reverseETLSyncStatus.extractPhase) + && Objects.equals(this.loadPhase, reverseETLSyncStatus.loadPhase) + && Objects.equals(this.error, reverseETLSyncStatus.error) + && Objects.equals(this.errorCode, reverseETLSyncStatus.errorCode); } @Override @@ -347,7 +347,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ReverseETLSyncOutput {\n"); + sb.append("class ReverseETLSyncStatus {\n"); sb.append(" syncId: ").append(toIndentedString(syncId)).append("\n"); sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); @@ -406,34 +406,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReverseETLSyncOutput + * @throws IOException if the JSON Element is invalid with respect to ReverseETLSyncStatus */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ReverseETLSyncOutput.openapiRequiredFields + if (!ReverseETLSyncStatus.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ReverseETLSyncOutput is not found in" + "The required field(s) %s in ReverseETLSyncStatus is not found in" + " the empty JSON string", - ReverseETLSyncOutput.openapiRequiredFields.toString())); + ReverseETLSyncStatus.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ReverseETLSyncOutput.openapiFields.contains(entry.getKey())) { + if (!ReverseETLSyncStatus.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ReverseETLSyncOutput` properties. JSON: %s", + + " `ReverseETLSyncStatus` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseETLSyncOutput.openapiRequiredFields) { + for (String requiredField : ReverseETLSyncStatus.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -522,24 +522,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseETLSyncOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseETLSyncOutput' and its subtypes + if (!ReverseETLSyncStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseETLSyncStatus' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ReverseETLSyncOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReverseETLSyncStatus.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ReverseETLSyncOutput value) + public void write(JsonWriter out, ReverseETLSyncStatus value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ReverseETLSyncOutput read(JsonReader in) throws IOException { + public ReverseETLSyncStatus read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -549,18 +549,18 @@ public ReverseETLSyncOutput read(JsonReader in) throws IOException { } /** - * Create an instance of ReverseETLSyncOutput given an JSON string + * Create an instance of ReverseETLSyncStatus given an JSON string * * @param jsonString JSON string - * @return An instance of ReverseETLSyncOutput - * @throws IOException if the JSON string is invalid with respect to ReverseETLSyncOutput + * @return An instance of ReverseETLSyncStatus + * @throws IOException if the JSON string is invalid with respect to ReverseETLSyncStatus */ - public static ReverseETLSyncOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseETLSyncOutput.class); + public static ReverseETLSyncStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseETLSyncStatus.class); } /** - * Convert an instance of ReverseETLSyncOutput to an JSON string + * Convert an instance of ReverseETLSyncStatus to an JSON string * * @return JSON string */ From e5b84c771189027fc10199e7f8d19a0c2a638df7 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 Aug 2024 17:32:40 +0000 Subject: [PATCH 329/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@59fbabb8. From 15a96d77d77a6213a90188198b7a4398b0fd1914 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 Aug 2024 21:35:03 +0000 Subject: [PATCH 330/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@734ce8c8. --- docs/ReverseEtlApi.md | 10 ++-- .../segment/publicapi/api/ReverseEtlApi.java | 54 +++++++++++++------ 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index a060fde8..ca6cc1e0 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -384,7 +384,7 @@ public class Example { ## Operation: listReverseETLSyncStatusesFromModelAndSubscriptionId -> ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination) +> ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, count, cursor) List Reverse ETL Sync Statuses from Model And Subscription Id @@ -412,9 +412,10 @@ public class Example { ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); String modelId = "modelId"; // String | String subscriptionId = "subscriptionId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination params. This parameter exists in alpha. + BigDecimal count = new BigDecimal(78); // BigDecimal | The number of items to retrieve in a page, between 1 and 100. Default is 10 This parameter exists in alpha. + String cursor = "cursor_example"; // String | The page to request. Acceptable values to use here are in PaginationOutput objects, in the `current`, `next`, and `previous` keys. This parameter exists in alpha. try { - ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, pagination); + ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, count, cursor); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ReverseEtlApi#listReverseETLSyncStatusesFromModelAndSubscriptionId"); @@ -434,7 +435,8 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **modelId** | **String**| | | | **subscriptionId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Optional pagination params. This parameter exists in alpha. | [optional] | +| **count** | **BigDecimal**| The number of items to retrieve in a page, between 1 and 100. Default is 10 This parameter exists in alpha. | [optional] | +| **cursor** | **String**| The page to request. Acceptable values to use here are in PaginationOutput objects, in the `current`, `next`, and `previous` keys. This parameter exists in alpha. | [optional] | ### Return type diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index f5d7efc5..8ec92b34 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -31,6 +31,7 @@ import com.segment.publicapi.models.UpdateReverseEtlModel200Response; import com.segment.publicapi.models.UpdateReverseEtlModelInput; import java.lang.reflect.Type; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -961,7 +962,11 @@ public okhttp3.Call getReverseEtlModelAsync( * * @param modelId (required) * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This + * parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in PaginationOutput + * objects, in the `current`, `next`, and `previous` keys. + * This parameter exists in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -977,7 +982,8 @@ public okhttp3.Call getReverseEtlModelAsync( public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( String modelId, String subscriptionId, - PaginationInput pagination, + BigDecimal count, + String cursor, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1011,8 +1017,12 @@ public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + if (count != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", count)); + } + + if (cursor != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cursor", cursor)); } final String[] localVarAccepts = { @@ -1049,7 +1059,8 @@ public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( String modelId, String subscriptionId, - PaginationInput pagination, + BigDecimal count, + String cursor, final ApiCallback _callback) throws ApiException { // verify the required parameter 'modelId' is set @@ -1067,7 +1078,7 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat } return listReverseETLSyncStatusesFromModelAndSubscriptionIdCall( - modelId, subscriptionId, pagination, _callback); + modelId, subscriptionId, count, cursor, _callback); } /** @@ -1079,7 +1090,11 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * * @param modelId (required) * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This + * parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in PaginationOutput + * objects, in the `current`, `next`, and `previous` keys. + * This parameter exists in alpha. (optional) * @return ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1094,11 +1109,11 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat */ public ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response listReverseETLSyncStatusesFromModelAndSubscriptionId( - String modelId, String subscriptionId, PaginationInput pagination) + String modelId, String subscriptionId, BigDecimal count, String cursor) throws ApiException { ApiResponse localVarResp = listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( - modelId, subscriptionId, pagination); + modelId, subscriptionId, count, cursor); return localVarResp.getData(); } @@ -1111,7 +1126,11 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * * @param modelId (required) * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This + * parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in PaginationOutput + * objects, in the `current`, `next`, and `previous` keys. + * This parameter exists in alpha. (optional) * @return ApiResponse<ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1126,11 +1145,11 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat */ public ApiResponse listReverseETLSyncStatusesFromModelAndSubscriptionIdWithHttpInfo( - String modelId, String subscriptionId, PaginationInput pagination) + String modelId, String subscriptionId, BigDecimal count, String cursor) throws ApiException { okhttp3.Call localVarCall = listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( - modelId, subscriptionId, pagination, null); + modelId, subscriptionId, count, cursor, null); Type localVarReturnType = new TypeToken< ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); @@ -1146,7 +1165,11 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * * @param modelId (required) * @param subscriptionId (required) - * @param pagination Optional pagination params. This parameter exists in alpha. (optional) + * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This + * parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in PaginationOutput + * objects, in the `current`, `next`, and `previous` keys. + * This parameter exists in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1163,14 +1186,15 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat public okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdAsync( String modelId, String subscriptionId, - PaginationInput pagination, + BigDecimal count, + String cursor, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listReverseETLSyncStatusesFromModelAndSubscriptionIdValidateBeforeCall( - modelId, subscriptionId, pagination, _callback); + modelId, subscriptionId, count, cursor, _callback); Type localVarReturnType = new TypeToken< ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response>() {}.getType(); From c239fffc898ec3b335199c1f2d359eb55d0475df Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 Aug 2024 21:36:06 +0000 Subject: [PATCH 331/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d3c5f419. --- docs/ReverseEtlApi.md | 4 ++-- .../segment/publicapi/api/ReverseEtlApi.java | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index ca6cc1e0..261fef3d 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -413,7 +413,7 @@ public class Example { String modelId = "modelId"; // String | String subscriptionId = "subscriptionId"; // String | BigDecimal count = new BigDecimal(78); // BigDecimal | The number of items to retrieve in a page, between 1 and 100. Default is 10 This parameter exists in alpha. - String cursor = "cursor_example"; // String | The page to request. Acceptable values to use here are in PaginationOutput objects, in the `current`, `next`, and `previous` keys. This parameter exists in alpha. + String cursor = "cursor_example"; // String | The page to request. Acceptable values to use here are in the `current`, `next`, and `previous` keys. This parameter exists in alpha. try { ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, count, cursor); System.out.println(result); @@ -436,7 +436,7 @@ public class Example { | **modelId** | **String**| | | | **subscriptionId** | **String**| | | | **count** | **BigDecimal**| The number of items to retrieve in a page, between 1 and 100. Default is 10 This parameter exists in alpha. | [optional] | -| **cursor** | **String**| The page to request. Acceptable values to use here are in PaginationOutput objects, in the `current`, `next`, and `previous` keys. This parameter exists in alpha. | [optional] | +| **cursor** | **String**| The page to request. Acceptable values to use here are in the `current`, `next`, and `previous` keys. This parameter exists in alpha. | [optional] | ### Return type diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 8ec92b34..e2470133 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -964,9 +964,9 @@ public okhttp3.Call getReverseEtlModelAsync( * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in PaginationOutput - * objects, in the `current`, `next`, and `previous` keys. - * This parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in the + * `current`, `next`, and `previous` keys. This parameter + * exists in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1092,9 +1092,9 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in PaginationOutput - * objects, in the `current`, `next`, and `previous` keys. - * This parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in the + * `current`, `next`, and `previous` keys. This parameter + * exists in alpha. (optional) * @return ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1128,9 +1128,9 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in PaginationOutput - * objects, in the `current`, `next`, and `previous` keys. - * This parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in the + * `current`, `next`, and `previous` keys. This parameter + * exists in alpha. (optional) * @return ApiResponse<ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1167,9 +1167,9 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in PaginationOutput - * objects, in the `current`, `next`, and `previous` keys. - * This parameter exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use here are in the + * `current`, `next`, and `previous` keys. This parameter + * exists in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body From 9c24c25477620d6df592c142353a289a0257b3b8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 30 Aug 2024 16:28:31 +0000 Subject: [PATCH 332/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c276be7a. --- src/main/java/com/segment/publicapi/JSON.java | 6 + .../models/GetPersonalizationDataInput.java | 319 ++++++++++++++++++ .../models/GetPersonalizationDataOutput.java | 219 ++++++++++++ 3 files changed, 544 insertions(+) create mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7d881285..03e64221 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -698,6 +698,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetPersonalizationDataInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetPersonalizationDataOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetRegulation200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java new file mode 100644 index 00000000..e06b6015 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java @@ -0,0 +1,319 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input for the getEntityDataForProfile endpoint. */ +public class GetPersonalizationDataInput { + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_ENTITY_TYPE = "entityType"; + + @SerializedName(SERIALIZED_NAME_ENTITY_TYPE) + private String entityType; + + public static final String SERIALIZED_NAME_ENTITY_ID = "entityId"; + + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + private String entityId; + + public static final String SERIALIZED_NAME_CHILD_ENTITY_TYPE = "childEntityType"; + + @SerializedName(SERIALIZED_NAME_CHILD_ENTITY_TYPE) + private String childEntityType; + + public GetPersonalizationDataInput() {} + + public GetPersonalizationDataInput spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * The space id. + * + * @return spaceId + */ + @javax.annotation.Nonnull + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public GetPersonalizationDataInput entityType(String entityType) { + + this.entityType = entityType; + return this; + } + + /** + * Entity type. + * + * @return entityType + */ + @javax.annotation.Nonnull + public String getEntityType() { + return entityType; + } + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + public GetPersonalizationDataInput entityId(String entityId) { + + this.entityId = entityId; + return this; + } + + /** + * Entity id - if type is profile, should have the shape + * \"<type>:<identifier>\". + * + * @return entityId + */ + @javax.annotation.Nonnull + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public GetPersonalizationDataInput childEntityType(String childEntityType) { + + this.childEntityType = childEntityType; + return this; + } + + /** + * Child entity type. + * + * @return childEntityType + */ + @javax.annotation.Nullable + public String getChildEntityType() { + return childEntityType; + } + + public void setChildEntityType(String childEntityType) { + this.childEntityType = childEntityType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPersonalizationDataInput getPersonalizationDataInput = (GetPersonalizationDataInput) o; + return Objects.equals(this.spaceId, getPersonalizationDataInput.spaceId) + && Objects.equals(this.entityType, getPersonalizationDataInput.entityType) + && Objects.equals(this.entityId, getPersonalizationDataInput.entityId) + && Objects.equals( + this.childEntityType, getPersonalizationDataInput.childEntityType); + } + + @Override + public int hashCode() { + return Objects.hash(spaceId, entityType, entityId, childEntityType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPersonalizationDataInput {\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" entityType: ").append(toIndentedString(entityType)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" childEntityType: ").append(toIndentedString(childEntityType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("spaceId"); + openapiFields.add("entityType"); + openapiFields.add("entityId"); + openapiFields.add("childEntityType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("entityType"); + openapiRequiredFields.add("entityId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetPersonalizationDataInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPersonalizationDataInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetPersonalizationDataInput is not" + + " found in the empty JSON string", + GetPersonalizationDataInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetPersonalizationDataInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetPersonalizationDataInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPersonalizationDataInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("entityType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `entityType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("entityType").toString())); + } + if (!jsonObj.get("entityId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `entityId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("entityId").toString())); + } + if ((jsonObj.get("childEntityType") != null && !jsonObj.get("childEntityType").isJsonNull()) + && !jsonObj.get("childEntityType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `childEntityType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("childEntityType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPersonalizationDataInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPersonalizationDataInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetPersonalizationDataInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPersonalizationDataInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPersonalizationDataInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPersonalizationDataInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPersonalizationDataInput + * @throws IOException if the JSON string is invalid with respect to GetPersonalizationDataInput + */ + public static GetPersonalizationDataInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPersonalizationDataInput.class); + } + + /** + * Convert an instance of GetPersonalizationDataInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java new file mode 100644 index 00000000..fa5fb97d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java @@ -0,0 +1,219 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Response for the getEntityDataForProfile endpoint. */ +public class GetPersonalizationDataOutput { + public static final String SERIALIZED_NAME_PERSONALIZATION_DATA = "personalizationData"; + + @SerializedName(SERIALIZED_NAME_PERSONALIZATION_DATA) + private Map personalizationData; + + public GetPersonalizationDataOutput() {} + + public GetPersonalizationDataOutput personalizationData( + Map personalizationData) { + + this.personalizationData = personalizationData; + return this; + } + + public GetPersonalizationDataOutput putPersonalizationDataItem( + String key, Object personalizationDataItem) { + if (this.personalizationData == null) { + this.personalizationData = new HashMap<>(); + } + this.personalizationData.put(key, personalizationDataItem); + return this; + } + + /** + * A key-value object that contains instance-specific Warehouse settings. + * + * @return personalizationData + */ + @javax.annotation.Nonnull + public Map getPersonalizationData() { + return personalizationData; + } + + public void setPersonalizationData(Map personalizationData) { + this.personalizationData = personalizationData; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPersonalizationDataOutput getPersonalizationDataOutput = + (GetPersonalizationDataOutput) o; + return Objects.equals( + this.personalizationData, getPersonalizationDataOutput.personalizationData); + } + + @Override + public int hashCode() { + return Objects.hash(personalizationData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPersonalizationDataOutput {\n"); + sb.append(" personalizationData: ") + .append(toIndentedString(personalizationData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("personalizationData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("personalizationData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetPersonalizationDataOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPersonalizationDataOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetPersonalizationDataOutput is not" + + " found in the empty JSON string", + GetPersonalizationDataOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetPersonalizationDataOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetPersonalizationDataOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPersonalizationDataOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPersonalizationDataOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPersonalizationDataOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetPersonalizationDataOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPersonalizationDataOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPersonalizationDataOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPersonalizationDataOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPersonalizationDataOutput + * @throws IOException if the JSON string is invalid with respect to + * GetPersonalizationDataOutput + */ + public static GetPersonalizationDataOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPersonalizationDataOutput.class); + } + + /** + * Convert an instance of GetPersonalizationDataOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 204566f1fc8edc3691cd22c452aca765b9d33c94 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 30 Aug 2024 20:56:07 +0000 Subject: [PATCH 333/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5fcacbcb. --- README.md | 8 +- docs/PersonalizationApi.md | 88 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 2 +- .../publicapi/api/PersonalizationApi.java | 295 ++++++++++++++++ .../GetPersonalizationData200Response.java | 200 +++++++++++ .../models/GetPersonalizationDataInput.java | 319 ------------------ 9 files changed, 591 insertions(+), 327 deletions(-) create mode 100644 docs/PersonalizationApi.md create mode 100644 src/main/java/com/segment/publicapi/api/PersonalizationApi.java create mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java diff --git a/README.md b/README.md index d1ea5c18..d1e142f9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.2.0 +Latest API and SDK version: 53.2.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.2.0 + 53.2.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.2.0" + implementation "com.segment.publicapi:segment-publicapi:53.2.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.2.0.jar` +* `target/segment-publicapi-53.2.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/PersonalizationApi.md b/docs/PersonalizationApi.md new file mode 100644 index 00000000..2dab389f --- /dev/null +++ b/docs/PersonalizationApi.md @@ -0,0 +1,88 @@ +# PersonalizationApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getPersonalizationData**](PersonalizationApi.md#getPersonalizationData) | **GET** /personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier} | Get Personalization Data | + + + +## Operation: getPersonalizationData + +> GetPersonalizationData200Response getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType) + +Get Personalization Data + +Get Personalization Data. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Entities feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.PersonalizationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + PersonalizationApi apiInstance = new PersonalizationApi(defaultClient); + String spaceId = "spaceId"; // String | + String entityType = "profile"; // String | + String entityIdentifier = "identifier"; // String | + String childrenEntityType = "childrenEntityType_example"; // String | Child entity type. This parameter exists in alpha. + try { + GetPersonalizationData200Response result = apiInstance.getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PersonalizationApi#getPersonalizationData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **entityType** | **String**| | | +| **entityIdentifier** | **String**| | | +| **childrenEntityType** | **String**| Child entity type. This parameter exists in alpha. | [optional] | + +### Return type + +[**GetPersonalizationData200Response**](GetPersonalizationData200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/pom.xml b/pom.xml index 8b1039c3..2dc93bcc 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.2.0 + 53.2.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index a7c98b99..d5ac5e02 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.2.0 (Java)"); + setUserAgent("Public API SDK 53.2.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ee2e89fc..2d0f0de4 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.2.0"; + public static final String VERSION = "53.2.1"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 03e64221..e73cd2ea 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -699,7 +699,7 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetPersonalizationDataInput + new com.segment.publicapi.models.GetPersonalizationData200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetPersonalizationDataOutput diff --git a/src/main/java/com/segment/publicapi/api/PersonalizationApi.java b/src/main/java/com/segment/publicapi/api/PersonalizationApi.java new file mode 100644 index 00000000..b685d288 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/PersonalizationApi.java @@ -0,0 +1,295 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.GetPersonalizationData200Response; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PersonalizationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PersonalizationApi() { + this(Configuration.getDefaultApiClient()); + } + + public PersonalizationApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getPersonalizationData + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getPersonalizationDataCall( + String spaceId, + String entityType, + String entityIdentifier, + String childrenEntityType, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "entityType" + "}", + localVarApiClient.escapeString(entityType.toString())) + .replace( + "{" + "entityIdentifier" + "}", + localVarApiClient.escapeString(entityIdentifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (childrenEntityType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("childrenEntityType", childrenEntityType)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPersonalizationDataValidateBeforeCall( + String spaceId, + String entityType, + String entityIdentifier, + String childrenEntityType, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getPersonalizationData(Async)"); + } + + // verify the required parameter 'entityType' is set + if (entityType == null) { + throw new ApiException( + "Missing the required parameter 'entityType' when calling" + + " getPersonalizationData(Async)"); + } + + // verify the required parameter 'entityIdentifier' is set + if (entityIdentifier == null) { + throw new ApiException( + "Missing the required parameter 'entityIdentifier' when calling" + + " getPersonalizationData(Async)"); + } + + return getPersonalizationDataCall( + spaceId, entityType, entityIdentifier, childrenEntityType, _callback); + } + + /** + * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Entities feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @return GetPersonalizationData200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetPersonalizationData200Response getPersonalizationData( + String spaceId, String entityType, String entityIdentifier, String childrenEntityType) + throws ApiException { + ApiResponse localVarResp = + getPersonalizationDataWithHttpInfo( + spaceId, entityType, entityIdentifier, childrenEntityType); + return localVarResp.getData(); + } + + /** + * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Entities feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @return ApiResponse<GetPersonalizationData200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getPersonalizationDataWithHttpInfo( + String spaceId, String entityType, String entityIdentifier, String childrenEntityType) + throws ApiException { + okhttp3.Call localVarCall = + getPersonalizationDataValidateBeforeCall( + spaceId, entityType, entityIdentifier, childrenEntityType, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Personalization Data (asynchronously) Get Personalization Data. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Entities feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getPersonalizationDataAsync( + String spaceId, + String entityType, + String entityIdentifier, + String childrenEntityType, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getPersonalizationDataValidateBeforeCall( + spaceId, entityType, entityIdentifier, childrenEntityType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java new file mode 100644 index 00000000..b490a132 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java @@ -0,0 +1,200 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetPersonalizationData200Response */ +public class GetPersonalizationData200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetPersonalizationDataOutput data; + + public GetPersonalizationData200Response() {} + + public GetPersonalizationData200Response data(GetPersonalizationDataOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetPersonalizationDataOutput getData() { + return data; + } + + public void setData(GetPersonalizationDataOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPersonalizationData200Response getPersonalizationData200Response = + (GetPersonalizationData200Response) o; + return Objects.equals(this.data, getPersonalizationData200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPersonalizationData200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetPersonalizationData200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPersonalizationData200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetPersonalizationData200Response is" + + " not found in the empty JSON string", + GetPersonalizationData200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetPersonalizationData200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetPersonalizationData200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetPersonalizationDataOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPersonalizationData200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPersonalizationData200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetPersonalizationData200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPersonalizationData200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPersonalizationData200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPersonalizationData200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPersonalizationData200Response + * @throws IOException if the JSON string is invalid with respect to + * GetPersonalizationData200Response + */ + public static GetPersonalizationData200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPersonalizationData200Response.class); + } + + /** + * Convert an instance of GetPersonalizationData200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java deleted file mode 100644 index e06b6015..00000000 --- a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataInput.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Input for the getEntityDataForProfile endpoint. */ -public class GetPersonalizationDataInput { - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_ENTITY_TYPE = "entityType"; - - @SerializedName(SERIALIZED_NAME_ENTITY_TYPE) - private String entityType; - - public static final String SERIALIZED_NAME_ENTITY_ID = "entityId"; - - @SerializedName(SERIALIZED_NAME_ENTITY_ID) - private String entityId; - - public static final String SERIALIZED_NAME_CHILD_ENTITY_TYPE = "childEntityType"; - - @SerializedName(SERIALIZED_NAME_CHILD_ENTITY_TYPE) - private String childEntityType; - - public GetPersonalizationDataInput() {} - - public GetPersonalizationDataInput spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * The space id. - * - * @return spaceId - */ - @javax.annotation.Nonnull - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public GetPersonalizationDataInput entityType(String entityType) { - - this.entityType = entityType; - return this; - } - - /** - * Entity type. - * - * @return entityType - */ - @javax.annotation.Nonnull - public String getEntityType() { - return entityType; - } - - public void setEntityType(String entityType) { - this.entityType = entityType; - } - - public GetPersonalizationDataInput entityId(String entityId) { - - this.entityId = entityId; - return this; - } - - /** - * Entity id - if type is profile, should have the shape - * \"<type>:<identifier>\". - * - * @return entityId - */ - @javax.annotation.Nonnull - public String getEntityId() { - return entityId; - } - - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - public GetPersonalizationDataInput childEntityType(String childEntityType) { - - this.childEntityType = childEntityType; - return this; - } - - /** - * Child entity type. - * - * @return childEntityType - */ - @javax.annotation.Nullable - public String getChildEntityType() { - return childEntityType; - } - - public void setChildEntityType(String childEntityType) { - this.childEntityType = childEntityType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPersonalizationDataInput getPersonalizationDataInput = (GetPersonalizationDataInput) o; - return Objects.equals(this.spaceId, getPersonalizationDataInput.spaceId) - && Objects.equals(this.entityType, getPersonalizationDataInput.entityType) - && Objects.equals(this.entityId, getPersonalizationDataInput.entityId) - && Objects.equals( - this.childEntityType, getPersonalizationDataInput.childEntityType); - } - - @Override - public int hashCode() { - return Objects.hash(spaceId, entityType, entityId, childEntityType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetPersonalizationDataInput {\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" entityType: ").append(toIndentedString(entityType)).append("\n"); - sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); - sb.append(" childEntityType: ").append(toIndentedString(childEntityType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("spaceId"); - openapiFields.add("entityType"); - openapiFields.add("entityId"); - openapiFields.add("childEntityType"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("entityType"); - openapiRequiredFields.add("entityId"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetPersonalizationDataInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetPersonalizationDataInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetPersonalizationDataInput is not" - + " found in the empty JSON string", - GetPersonalizationDataInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPersonalizationDataInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPersonalizationDataInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetPersonalizationDataInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("entityType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `entityType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("entityType").toString())); - } - if (!jsonObj.get("entityId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `entityId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("entityId").toString())); - } - if ((jsonObj.get("childEntityType") != null && !jsonObj.get("childEntityType").isJsonNull()) - && !jsonObj.get("childEntityType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `childEntityType` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("childEntityType").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPersonalizationDataInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetPersonalizationDataInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetPersonalizationDataInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetPersonalizationDataInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetPersonalizationDataInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetPersonalizationDataInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetPersonalizationDataInput - * @throws IOException if the JSON string is invalid with respect to GetPersonalizationDataInput - */ - public static GetPersonalizationDataInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetPersonalizationDataInput.class); - } - - /** - * Convert an instance of GetPersonalizationDataInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 8e67bf642162305b70a1a4577928cb92f0079f59 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 30 Aug 2024 21:10:08 +0000 Subject: [PATCH 334/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5fcacbcb. From 1f03a0f80fcd12330aaf7720135d2943d181a6e3 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 30 Aug 2024 21:43:49 +0000 Subject: [PATCH 335/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3083836d. --- README.md | 8 +- docs/PersonalizationApi.md | 88 -- docs/ReverseEtlApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 12 +- .../publicapi/api/PersonalizationApi.java | 295 ------- .../segment/publicapi/api/ReverseEtlApi.java | 24 +- .../publicapi/models/AudienceSummary.java | 10 +- .../models/ComputedTraitSummary.java | 10 +- .../com/segment/publicapi/models/Config.java | 352 +++----- ...izationDataOutput.java => Definition.java} | 190 +++-- .../segment/publicapi/models/Definition1.java | 295 +++++++ .../models/DestinationSubscription.java | 2 +- .../segment/publicapi/models/Function.java | 757 ++++++++++++++++++ .../publicapi/models/GetFunctionV1Output.java | 10 +- .../GetPersonalizationData200Response.java | 200 ----- .../publicapi/models/ScheduleConfig.java | 350 +++----- .../com/segment/publicapi/models/Space.java | 2 +- 20 files changed, 1478 insertions(+), 1137 deletions(-) delete mode 100644 docs/PersonalizationApi.md delete mode 100644 src/main/java/com/segment/publicapi/api/PersonalizationApi.java rename src/main/java/com/segment/publicapi/models/{GetPersonalizationDataOutput.java => Definition.java} (50%) create mode 100644 src/main/java/com/segment/publicapi/models/Definition1.java create mode 100644 src/main/java/com/segment/publicapi/models/Function.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java diff --git a/README.md b/README.md index d1e142f9..d1ea5c18 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.2.1 +Latest API and SDK version: 53.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.2.1 + 53.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.2.1" + implementation "com.segment.publicapi:segment-publicapi:53.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.2.1.jar` +* `target/segment-publicapi-53.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/PersonalizationApi.md b/docs/PersonalizationApi.md deleted file mode 100644 index 2dab389f..00000000 --- a/docs/PersonalizationApi.md +++ /dev/null @@ -1,88 +0,0 @@ -# PersonalizationApi - -All URIs are relative to *https://api.segmentapis.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getPersonalizationData**](PersonalizationApi.md#getPersonalizationData) | **GET** /personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier} | Get Personalization Data | - - - -## Operation: getPersonalizationData - -> GetPersonalizationData200Response getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType) - -Get Personalization Data - -Get Personalization Data. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Entities feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.PersonalizationApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - PersonalizationApi apiInstance = new PersonalizationApi(defaultClient); - String spaceId = "spaceId"; // String | - String entityType = "profile"; // String | - String entityIdentifier = "identifier"; // String | - String childrenEntityType = "childrenEntityType_example"; // String | Child entity type. This parameter exists in alpha. - try { - GetPersonalizationData200Response result = apiInstance.getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PersonalizationApi#getPersonalizationData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **entityType** | **String**| | | -| **entityIdentifier** | **String**| | | -| **childrenEntityType** | **String**| Child entity type. This parameter exists in alpha. | [optional] | - -### Return type - -[**GetPersonalizationData200Response**](GetPersonalizationData200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index 261fef3d..e2ce6a57 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -413,7 +413,7 @@ public class Example { String modelId = "modelId"; // String | String subscriptionId = "subscriptionId"; // String | BigDecimal count = new BigDecimal(78); // BigDecimal | The number of items to retrieve in a page, between 1 and 100. Default is 10 This parameter exists in alpha. - String cursor = "cursor_example"; // String | The page to request. Acceptable values to use here are in the `current`, `next`, and `previous` keys. This parameter exists in alpha. + String cursor = "cursor_example"; // String | The page to request. Acceptable values to use are from the `current`, `next`, and `previous` keys. This parameter exists in alpha. try { ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response result = apiInstance.listReverseETLSyncStatusesFromModelAndSubscriptionId(modelId, subscriptionId, count, cursor); System.out.println(result); @@ -436,7 +436,7 @@ public class Example { | **modelId** | **String**| | | | **subscriptionId** | **String**| | | | **count** | **BigDecimal**| The number of items to retrieve in a page, between 1 and 100. Default is 10 This parameter exists in alpha. | [optional] | -| **cursor** | **String**| The page to request. Acceptable values to use here are in the `current`, `next`, and `previous` keys. This parameter exists in alpha. | [optional] | +| **cursor** | **String**| The page to request. Acceptable values to use are from the `current`, `next`, and `previous` keys. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index 2dc93bcc..8b1039c3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.2.1 + 53.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d5ac5e02..a7c98b99 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.2.1 (Java)"); + setUserAgent("Public API SDK 53.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 2d0f0de4..ee2e89fc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.2.1"; + public static final String VERSION = "53.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index e73cd2ea..320f0044 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -409,6 +409,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateWriteKeyForSourceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Definition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Definition1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); @@ -573,6 +577,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Function.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -698,12 +704,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetPersonalizationData200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetPersonalizationDataOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetRegulation200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/PersonalizationApi.java b/src/main/java/com/segment/publicapi/api/PersonalizationApi.java deleted file mode 100644 index b685d288..00000000 --- a/src/main/java/com/segment/publicapi/api/PersonalizationApi.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.GetPersonalizationData200Response; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PersonalizationApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public PersonalizationApi() { - this(Configuration.getDefaultApiClient()); - } - - public PersonalizationApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getPersonalizationData - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getPersonalizationDataCall( - String spaceId, - String entityType, - String entityIdentifier, - String childrenEntityType, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "entityType" + "}", - localVarApiClient.escapeString(entityType.toString())) - .replace( - "{" + "entityIdentifier" + "}", - localVarApiClient.escapeString(entityIdentifier.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (childrenEntityType != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("childrenEntityType", childrenEntityType)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPersonalizationDataValidateBeforeCall( - String spaceId, - String entityType, - String entityIdentifier, - String childrenEntityType, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getPersonalizationData(Async)"); - } - - // verify the required parameter 'entityType' is set - if (entityType == null) { - throw new ApiException( - "Missing the required parameter 'entityType' when calling" - + " getPersonalizationData(Async)"); - } - - // verify the required parameter 'entityIdentifier' is set - if (entityIdentifier == null) { - throw new ApiException( - "Missing the required parameter 'entityIdentifier' when calling" - + " getPersonalizationData(Async)"); - } - - return getPersonalizationDataCall( - spaceId, entityType, entityIdentifier, childrenEntityType, _callback); - } - - /** - * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Entities feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @return GetPersonalizationData200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetPersonalizationData200Response getPersonalizationData( - String spaceId, String entityType, String entityIdentifier, String childrenEntityType) - throws ApiException { - ApiResponse localVarResp = - getPersonalizationDataWithHttpInfo( - spaceId, entityType, entityIdentifier, childrenEntityType); - return localVarResp.getData(); - } - - /** - * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Entities feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @return ApiResponse<GetPersonalizationData200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getPersonalizationDataWithHttpInfo( - String spaceId, String entityType, String entityIdentifier, String childrenEntityType) - throws ApiException { - okhttp3.Call localVarCall = - getPersonalizationDataValidateBeforeCall( - spaceId, entityType, entityIdentifier, childrenEntityType, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Personalization Data (asynchronously) Get Personalization Data. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Entities feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getPersonalizationDataAsync( - String spaceId, - String entityType, - String entityIdentifier, - String childrenEntityType, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getPersonalizationDataValidateBeforeCall( - spaceId, entityType, entityIdentifier, childrenEntityType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index e2470133..d72ea549 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -964,9 +964,9 @@ public okhttp3.Call getReverseEtlModelAsync( * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in the - * `current`, `next`, and `previous` keys. This parameter - * exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use are from the `current`, + * `next`, and `previous` keys. This parameter exists in alpha. + * (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1092,9 +1092,9 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in the - * `current`, `next`, and `previous` keys. This parameter - * exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use are from the `current`, + * `next`, and `previous` keys. This parameter exists in alpha. + * (optional) * @return ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1128,9 +1128,9 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in the - * `current`, `next`, and `previous` keys. This parameter - * exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use are from the `current`, + * `next`, and `previous` keys. This parameter exists in alpha. + * (optional) * @return ApiResponse<ListReverseETLSyncStatusesFromModelAndSubscriptionId200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1167,9 +1167,9 @@ private okhttp3.Call listReverseETLSyncStatusesFromModelAndSubscriptionIdValidat * @param subscriptionId (required) * @param count The number of items to retrieve in a page, between 1 and 100. Default is 10 This * parameter exists in alpha. (optional) - * @param cursor The page to request. Acceptable values to use here are in the - * `current`, `next`, and `previous` keys. This parameter - * exists in alpha. (optional) + * @param cursor The page to request. Acceptable values to use are from the `current`, + * `next`, and `previous` keys. This parameter exists in alpha. + * (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index 310b96d4..f2d34d1c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinition definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(AudienceDefinition definition) { + public AudienceSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(AudienceDefinition definition) { * @return definition */ @javax.annotation.Nullable - public AudienceDefinition getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(AudienceDefinition definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - AudienceDefinition.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index a7e67bca..c9b644f2 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private ComputedTraitsDefinition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(ComputedTraitsDefinition definition) { + public ComputedTraitSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(ComputedTraitsDefinition definition) { * @return definition */ @javax.annotation.Nullable - public ComputedTraitsDefinition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(ComputedTraitsDefinition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - ComputedTraitsDefinition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index b70fcf4a..63ff722e 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -13,233 +13,100 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.HashSet; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.Objects; +import java.util.Set; -public class Config extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(Config.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Config.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Config' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Config value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { - JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { - JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } +/** + * Config contains interval duration in case of periodic or day and hours in case of specific_days. + * Empty if strategy is MANUAL. + */ +public class Config { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; - @Override - public Config read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; + public Config() {} - // deserialize ReverseEtlPeriodicScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", - e); - } - // deserialize ReverseEtlSpecificTimeScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } + public Config interval(String interval) { - throw new IOException( - String.format( - "Failed deserialization for Config: no class matches" - + " result, expected at least 1. Detailed failure" - + " message for anyOf schemas: %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } + this.interval = interval; + return this; } - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public Config() { - super("anyOf", Boolean.TRUE); + /** + * Duration is specified as a string, eg: 15m, 3h25m30s. + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; } - public Config(ReverseEtlPeriodicScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); + public void setInterval(String interval) { + this.interval = interval; } - public Config(ReverseEtlSpecificTimeScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Config config = (Config) o; + return Objects.equals(this.interval, config.interval); } - static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + @Override + public int hashCode() { + return Objects.hash(interval); } @Override - public Map> getSchemas() { - return Config.schemas; + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Config {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); } /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - *

It could be an instance of the 'anyOf' schemas. + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). */ - @Override - public void setActualInstance(Object instance) { - if (instance == null) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + return o.toString().replace("\n", "\n "); } - /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; - /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` - */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); } /** @@ -249,40 +116,75 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon * @throws IOException if the JSON Element is invalid with respect to Config */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one + if (jsonElement == null) { + if (!Config.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Config is not found in the empty JSON" + + " string", + Config.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Config.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Config`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Config.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Config.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Config' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Config.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Config value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Config read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); } - throw new IOException( - String.format( - "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java b/src/main/java/com/segment/publicapi/models/Definition.java similarity index 50% rename from src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java rename to src/main/java/com/segment/publicapi/models/Definition.java index fa5fb97d..d8aa8981 100644 --- a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -16,55 +16,118 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; -/** Response for the getEntityDataForProfile endpoint. */ -public class GetPersonalizationDataOutput { - public static final String SERIALIZED_NAME_PERSONALIZATION_DATA = "personalizationData"; +/** Query language definition and type. */ +public class Definition { + public static final String SERIALIZED_NAME_QUERY = "query"; - @SerializedName(SERIALIZED_NAME_PERSONALIZATION_DATA) - private Map personalizationData; + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; - public GetPersonalizationDataOutput() {} + /** + * The underlying data type being segmented for this audience. Possible values: users, accounts. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } - public GetPersonalizationDataOutput personalizationData( - Map personalizationData) { + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - this.personalizationData = personalizationData; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public Definition() {} + + public Definition query(String query) { + + this.query = query; return this; } - public GetPersonalizationDataOutput putPersonalizationDataItem( - String key, Object personalizationDataItem) { - if (this.personalizationData == null) { - this.personalizationData = new HashMap<>(); - } - this.personalizationData.put(key, personalizationDataItem); + /** + * The query language string defining the audience segmentation criteria. + * + * @return query + */ + @javax.annotation.Nonnull + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public Definition type(TypeEnum type) { + + this.type = type; return this; } /** - * A key-value object that contains instance-specific Warehouse settings. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * - * @return personalizationData + * @return type */ @javax.annotation.Nonnull - public Map getPersonalizationData() { - return personalizationData; + public TypeEnum getType() { + return type; } - public void setPersonalizationData(Map personalizationData) { - this.personalizationData = personalizationData; + public void setType(TypeEnum type) { + this.type = type; } @Override @@ -75,24 +138,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetPersonalizationDataOutput getPersonalizationDataOutput = - (GetPersonalizationDataOutput) o; - return Objects.equals( - this.personalizationData, getPersonalizationDataOutput.personalizationData); + Definition definition = (Definition) o; + return Objects.equals(this.query, definition.query) + && Objects.equals(this.type, definition.type); } @Override public int hashCode() { - return Objects.hash(personalizationData); + return Objects.hash(query, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetPersonalizationDataOutput {\n"); - sb.append(" personalizationData: ") - .append(toIndentedString(personalizationData)) - .append("\n"); + sb.append("class Definition {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -114,46 +175,47 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("personalizationData"); + openapiFields.add("query"); + openapiFields.add("type"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("personalizationData"); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("type"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetPersonalizationDataOutput + * @throws IOException if the JSON Element is invalid with respect to Definition */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetPersonalizationDataOutput.openapiRequiredFields + if (!Definition.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in GetPersonalizationDataOutput is not" - + " found in the empty JSON string", - GetPersonalizationDataOutput.openapiRequiredFields.toString())); + "The required field(s) %s in Definition is not found in the empty" + + " JSON string", + Definition.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!GetPersonalizationDataOutput.openapiFields.contains(entry.getKey())) { + if (!Definition.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `GetPersonalizationDataOutput` properties. JSON: %s", + + " `Definition` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetPersonalizationDataOutput.openapiRequiredFields) { + for (String requiredField : Definition.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -162,32 +224,43 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPersonalizationDataOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetPersonalizationDataOutput' and its - // subtypes + if (!Definition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Definition' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetPersonalizationDataOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Definition.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, GetPersonalizationDataOutput value) - throws IOException { + public void write(JsonWriter out, Definition value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public GetPersonalizationDataOutput read(JsonReader in) throws IOException { + public Definition read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -197,19 +270,18 @@ public GetPersonalizationDataOutput read(JsonReader in) throws IOException { } /** - * Create an instance of GetPersonalizationDataOutput given an JSON string + * Create an instance of Definition given an JSON string * * @param jsonString JSON string - * @return An instance of GetPersonalizationDataOutput - * @throws IOException if the JSON string is invalid with respect to - * GetPersonalizationDataOutput + * @return An instance of Definition + * @throws IOException if the JSON string is invalid with respect to Definition */ - public static GetPersonalizationDataOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetPersonalizationDataOutput.class); + public static Definition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Definition.class); } /** - * Convert an instance of GetPersonalizationDataOutput to an JSON string + * Convert an instance of Definition to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java new file mode 100644 index 00000000..ed071aaa --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -0,0 +1,295 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Query language definition and type. */ +public class Definition1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + /** + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public Definition1() {} + + public Definition1 query(String query) { + + this.query = query; + return this; + } + + /** + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). + * + * @return query + */ + @javax.annotation.Nonnull + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public Definition1 type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Definition1 definition1 = (Definition1) o; + return Objects.equals(this.query, definition1.query) + && Objects.equals(this.type, definition1.type); + } + + @Override + public int hashCode() { + return Objects.hash(query, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Definition1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Definition1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Definition1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Definition1 is not found in the empty" + + " JSON string", + Definition1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Definition1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Definition1` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Definition1.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Definition1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Definition1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Definition1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Definition1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Definition1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Definition1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Definition1 + * @throws IOException if the JSON string is invalid with respect to Definition1 + */ + public static Definition1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Definition1.class); + } + + /** + * Convert an instance of Definition1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 03695b38..1db32a50 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -80,7 +80,7 @@ public class DestinationSubscription { public static final String SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE = "reverseETLSchedule"; @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE) - private Object reverseETLSchedule = null; + private Object reverseETLSchedule; public DestinationSubscription() {} diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java new file mode 100644 index 00000000..f4bd534b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Function.java @@ -0,0 +1,757 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; + +/** A Function object. */ +public class Function { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The Function type. Config API note: equal to `type`. */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + DESTINATION("DESTINATION"), + + INSERT_DESTINATION("INSERT_DESTINATION"), + + INSERT_SOURCE("INSERT_SOURCE"), + + SOURCE("SOURCE"); + + private String value; + + ResourceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResourceTypeEnum fromValue(String value) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; + + @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) + private ResourceTypeEnum resourceType; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_CODE = "code"; + + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; + + @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) + private String deployedAt; + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; + + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; + + @SerializedName(SERIALIZED_NAME_LOGO_URL) + private String logoUrl; + + public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; + + @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) + private String previewWebhookUrl; + + public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; + + @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) + private BigDecimal batchMaxCount; + + public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; + + @SerializedName(SERIALIZED_NAME_CATALOG_ID) + private String catalogId; + + public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; + + @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) + private Boolean isLatestVersion; + + public Function() {} + + public Function id(String id) { + + this.id = id; + return this; + } + + /** + * An identifier for this Function. + * + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Function resourceType(ResourceTypeEnum resourceType) { + + this.resourceType = resourceType; + return this; + } + + /** + * The Function type. Config API note: equal to `type`. + * + * @return resourceType + */ + @javax.annotation.Nullable + public ResourceTypeEnum getResourceType() { + return resourceType; + } + + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + + public Function createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The time this Function was created. + * + * @return createdAt + */ + @javax.annotation.Nullable + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Function createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * The id of the user who created this Function. + * + * @return createdBy + */ + @javax.annotation.Nullable + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Function code(String code) { + + this.code = code; + return this; + } + + /** + * The Function code. + * + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Function deployedAt(String deployedAt) { + + this.deployedAt = deployedAt; + return this; + } + + /** + * The time of this Function's last deployment. + * + * @return deployedAt + */ + @javax.annotation.Nullable + public String getDeployedAt() { + return deployedAt; + } + + public void setDeployedAt(String deployedAt) { + this.deployedAt = deployedAt; + } + + public Function settings(List settings) { + + this.settings = settings; + return this; + } + + public Function addSettingsItem(FunctionSettingV1 settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } + + /** + * The list of settings for this Function. + * + * @return settings + */ + @javax.annotation.Nullable + public List getSettings() { + return settings; + } + + public void setSettings(List settings) { + this.settings = settings; + } + + public Function displayName(String displayName) { + + this.displayName = displayName; + return this; + } + + /** + * A display name for this Function. + * + * @return displayName + */ + @javax.annotation.Nullable + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public Function description(String description) { + + this.description = description; + return this; + } + + /** + * A description for this Function. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Function logoUrl(String logoUrl) { + + this.logoUrl = logoUrl; + return this; + } + + /** + * The URL of the logo for this Function. + * + * @return logoUrl + */ + @javax.annotation.Nullable + public String getLogoUrl() { + return logoUrl; + } + + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + } + + public Function previewWebhookUrl(String previewWebhookUrl) { + + this.previewWebhookUrl = previewWebhookUrl; + return this; + } + + /** + * The preview webhook URL for this Function. + * + * @return previewWebhookUrl + */ + @javax.annotation.Nullable + public String getPreviewWebhookUrl() { + return previewWebhookUrl; + } + + public void setPreviewWebhookUrl(String previewWebhookUrl) { + this.previewWebhookUrl = previewWebhookUrl; + } + + public Function batchMaxCount(BigDecimal batchMaxCount) { + + this.batchMaxCount = batchMaxCount; + return this; + } + + /** + * The max count of the batch for this Function. + * + * @return batchMaxCount + */ + @javax.annotation.Nullable + public BigDecimal getBatchMaxCount() { + return batchMaxCount; + } + + public void setBatchMaxCount(BigDecimal batchMaxCount) { + this.batchMaxCount = batchMaxCount; + } + + public Function catalogId(String catalogId) { + + this.catalogId = catalogId; + return this; + } + + /** + * The catalog id of this Function. + * + * @return catalogId + */ + @javax.annotation.Nullable + public String getCatalogId() { + return catalogId; + } + + public void setCatalogId(String catalogId) { + this.catalogId = catalogId; + } + + public Function isLatestVersion(Boolean isLatestVersion) { + + this.isLatestVersion = isLatestVersion; + return this; + } + + /** + * Whether the deployment of this Function is the latest version. + * + * @return isLatestVersion + */ + @javax.annotation.Nullable + public Boolean getIsLatestVersion() { + return isLatestVersion; + } + + public void setIsLatestVersion(Boolean isLatestVersion) { + this.isLatestVersion = isLatestVersion; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Function function = (Function) o; + return Objects.equals(this.id, function.id) + && Objects.equals(this.resourceType, function.resourceType) + && Objects.equals(this.createdAt, function.createdAt) + && Objects.equals(this.createdBy, function.createdBy) + && Objects.equals(this.code, function.code) + && Objects.equals(this.deployedAt, function.deployedAt) + && Objects.equals(this.settings, function.settings) + && Objects.equals(this.displayName, function.displayName) + && Objects.equals(this.description, function.description) + && Objects.equals(this.logoUrl, function.logoUrl) + && Objects.equals(this.previewWebhookUrl, function.previewWebhookUrl) + && Objects.equals(this.batchMaxCount, function.batchMaxCount) + && Objects.equals(this.catalogId, function.catalogId) + && Objects.equals(this.isLatestVersion, function.isLatestVersion); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + resourceType, + createdAt, + createdBy, + code, + deployedAt, + settings, + displayName, + description, + logoUrl, + previewWebhookUrl, + batchMaxCount, + catalogId, + isLatestVersion); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Function {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" previewWebhookUrl: ") + .append(toIndentedString(previewWebhookUrl)) + .append("\n"); + sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); + sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); + sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("resourceType"); + openapiFields.add("createdAt"); + openapiFields.add("createdBy"); + openapiFields.add("code"); + openapiFields.add("deployedAt"); + openapiFields.add("settings"); + openapiFields.add("displayName"); + openapiFields.add("description"); + openapiFields.add("logoUrl"); + openapiFields.add("previewWebhookUrl"); + openapiFields.add("batchMaxCount"); + openapiFields.add("catalogId"); + openapiFields.add("isLatestVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Function + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Function.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Function is not found in the empty" + + " JSON string", + Function.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Function.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Function`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) + && !jsonObj.get("resourceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `resourceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("resourceType").toString())); + } + if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) + && !jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) + && !jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `code` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("code").toString())); + } + if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) + && !jsonObj.get("deployedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `deployedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("deployedAt").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `settings` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("settings").toString())); + } + + // validate the optional field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + FunctionSettingV1.validateJsonElement(jsonArraysettings.get(i)); + } + ; + } + } + if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) + && !jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `displayName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) + && !jsonObj.get("logoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `logoUrl` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("logoUrl").toString())); + } + if ((jsonObj.get("previewWebhookUrl") != null + && !jsonObj.get("previewWebhookUrl").isJsonNull()) + && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `previewWebhookUrl` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("previewWebhookUrl").toString())); + } + if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) + && !jsonObj.get("catalogId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `catalogId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("catalogId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Function.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Function' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Function.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Function value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Function read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Function given an JSON string + * + * @param jsonString JSON string + * @return An instance of Function + * @throws IOException if the JSON string is invalid with respect to Function + */ + public static Function fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Function.class); + } + + /** + * Convert an instance of Function to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 318c309f..7eb76e51 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -32,11 +32,11 @@ public class GetFunctionV1Output { public static final String SERIALIZED_NAME_FUNCTION = "function"; @SerializedName(SERIALIZED_NAME_FUNCTION) - private FunctionV1 function; + private Function function; public GetFunctionV1Output() {} - public GetFunctionV1Output function(FunctionV1 function) { + public GetFunctionV1Output function(Function function) { this.function = function; return this; @@ -48,11 +48,11 @@ public GetFunctionV1Output function(FunctionV1 function) { * @return function */ @javax.annotation.Nullable - public FunctionV1 getFunction() { + public Function getFunction() { return function; } - public void setFunction(FunctionV1 function) { + public void setFunction(Function function) { this.function = function; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `function` - FunctionV1.validateJsonElement(jsonObj.get("function")); + Function.validateJsonElement(jsonObj.get("function")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java deleted file mode 100644 index b490a132..00000000 --- a/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** GetPersonalizationData200Response */ -public class GetPersonalizationData200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetPersonalizationDataOutput data; - - public GetPersonalizationData200Response() {} - - public GetPersonalizationData200Response data(GetPersonalizationDataOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public GetPersonalizationDataOutput getData() { - return data; - } - - public void setData(GetPersonalizationDataOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPersonalizationData200Response getPersonalizationData200Response = - (GetPersonalizationData200Response) o; - return Objects.equals(this.data, getPersonalizationData200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetPersonalizationData200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetPersonalizationData200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetPersonalizationData200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetPersonalizationData200Response is" - + " not found in the empty JSON string", - GetPersonalizationData200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPersonalizationData200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPersonalizationData200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetPersonalizationDataOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPersonalizationData200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetPersonalizationData200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetPersonalizationData200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetPersonalizationData200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetPersonalizationData200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetPersonalizationData200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetPersonalizationData200Response - * @throws IOException if the JSON string is invalid with respect to - * GetPersonalizationData200Response - */ - public static GetPersonalizationData200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetPersonalizationData200Response.class); - } - - /** - * Convert an instance of GetPersonalizationData200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java index 3b527dda..1e23a36d 100644 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -13,234 +13,97 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.HashSet; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.Objects; +import java.util.Set; -public class ScheduleConfig extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(ScheduleConfig.class.getName()); +/** Depending on the chosen strategy, configures the schedule for this model. */ +public class ScheduleConfig { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ScheduleConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ScheduleConfig value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { - JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { - JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } - - @Override - public ScheduleConfig read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; + public ScheduleConfig() {} - // deserialize ReverseEtlPeriodicScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; - ScheduleConfig ret = new ScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", - e); - } - // deserialize ReverseEtlSpecificTimeScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; - ScheduleConfig ret = new ScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } + public ScheduleConfig interval(String interval) { - throw new IOException( - String.format( - "Failed deserialization for ScheduleConfig: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } + this.interval = interval; + return this; } - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public ScheduleConfig() { - super("anyOf", Boolean.TRUE); + /** + * Duration is specified as a string, eg: 15m, 3h25m30s. + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; } - public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); + public void setInterval(String interval) { + this.interval = interval; } - public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleConfig scheduleConfig = (ScheduleConfig) o; + return Objects.equals(this.interval, scheduleConfig.interval); } - static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + @Override + public int hashCode() { + return Objects.hash(interval); } @Override - public Map> getSchemas() { - return ScheduleConfig.schemas; + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleConfig {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); } /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - *

It could be an instance of the 'anyOf' schemas. + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). */ - @Override - public void setActualInstance(Object instance) { - if (instance == null) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + return o.toString().replace("\n", "\n "); } - /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; - /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` - */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); } /** @@ -250,40 +113,75 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one + if (jsonElement == null) { + if (!ScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ScheduleConfig is not found in the" + + " empty JSON string", + ScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScheduleConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ScheduleConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScheduleConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); } - throw new IOException( - String.format( - "The JSON string is invalid for ScheduleConfig with anyOf schemas:" - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 7e505e05..7dad935d 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -27,7 +27,7 @@ import java.util.Objects; import java.util.Set; -/** Space */ +/** Space matching the given id. */ public class Space { public static final String SERIALIZED_NAME_ID = "id"; From cb71990f81b0f7011492fcafa7d870ddb2182cd0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 5 Sep 2024 19:39:24 +0000 Subject: [PATCH 336/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f8fdf777. --- README.md | 8 +- docs/PersonalizationApi.md | 88 ++++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 6 + .../publicapi/api/PersonalizationApi.java | 295 ++++++++++++++++++ .../publicapi/models/AudienceSummary.java | 10 +- .../models/ComputedTraitSummary.java | 10 +- .../segment/publicapi/models/Definition.java | 10 +- .../segment/publicapi/models/Definition1.java | 10 +- .../DestinationSubscriptionUpdateInput.java | 84 ++++- .../GetPersonalizationData200Response.java | 200 ++++++++++++ .../models/GetPersonalizationDataOutput.java | 219 +++++++++++++ 14 files changed, 917 insertions(+), 29 deletions(-) create mode 100644 docs/PersonalizationApi.md create mode 100644 src/main/java/com/segment/publicapi/api/PersonalizationApi.java create mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java diff --git a/README.md b/README.md index d1ea5c18..8ef4c0d8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.2.0 +Latest API and SDK version: 53.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.2.0 + 53.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.2.0" + implementation "com.segment.publicapi:segment-publicapi:53.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.2.0.jar` +* `target/segment-publicapi-53.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/PersonalizationApi.md b/docs/PersonalizationApi.md new file mode 100644 index 00000000..6c23e90e --- /dev/null +++ b/docs/PersonalizationApi.md @@ -0,0 +1,88 @@ +# PersonalizationApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getPersonalizationData**](PersonalizationApi.md#getPersonalizationData) | **GET** /personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier} | Get Personalization Data | + + + +## Operation: getPersonalizationData + +> GetPersonalizationData200Response getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType) + +Get Personalization Data + +Get Personalization Data. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Entities feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.PersonalizationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + PersonalizationApi apiInstance = new PersonalizationApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String entityType = "account"; // String | + String entityIdentifier = "1"; // String | + String childrenEntityType = "childrenEntityType_example"; // String | Child entity type. This parameter exists in alpha. + try { + GetPersonalizationData200Response result = apiInstance.getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PersonalizationApi#getPersonalizationData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **entityType** | **String**| | | +| **entityIdentifier** | **String**| | | +| **childrenEntityType** | **String**| Child entity type. This parameter exists in alpha. | [optional] | + +### Return type + +[**GetPersonalizationData200Response**](GetPersonalizationData200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/pom.xml b/pom.xml index 8b1039c3..85dfc1eb 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.2.0 + 53.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index a7c98b99..e1c7dcd6 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.2.0 (Java)"); + setUserAgent("Public API SDK 53.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ee2e89fc..dd46127e 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.2.0"; + public static final String VERSION = "53.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 320f0044..e2f12717 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -704,6 +704,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetPersonalizationData200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetPersonalizationDataOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetRegulation200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/PersonalizationApi.java b/src/main/java/com/segment/publicapi/api/PersonalizationApi.java new file mode 100644 index 00000000..b685d288 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/PersonalizationApi.java @@ -0,0 +1,295 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.GetPersonalizationData200Response; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PersonalizationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PersonalizationApi() { + this(Configuration.getDefaultApiClient()); + } + + public PersonalizationApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getPersonalizationData + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getPersonalizationDataCall( + String spaceId, + String entityType, + String entityIdentifier, + String childrenEntityType, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "entityType" + "}", + localVarApiClient.escapeString(entityType.toString())) + .replace( + "{" + "entityIdentifier" + "}", + localVarApiClient.escapeString(entityIdentifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (childrenEntityType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("childrenEntityType", childrenEntityType)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPersonalizationDataValidateBeforeCall( + String spaceId, + String entityType, + String entityIdentifier, + String childrenEntityType, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getPersonalizationData(Async)"); + } + + // verify the required parameter 'entityType' is set + if (entityType == null) { + throw new ApiException( + "Missing the required parameter 'entityType' when calling" + + " getPersonalizationData(Async)"); + } + + // verify the required parameter 'entityIdentifier' is set + if (entityIdentifier == null) { + throw new ApiException( + "Missing the required parameter 'entityIdentifier' when calling" + + " getPersonalizationData(Async)"); + } + + return getPersonalizationDataCall( + spaceId, entityType, entityIdentifier, childrenEntityType, _callback); + } + + /** + * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Entities feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @return GetPersonalizationData200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetPersonalizationData200Response getPersonalizationData( + String spaceId, String entityType, String entityIdentifier, String childrenEntityType) + throws ApiException { + ApiResponse localVarResp = + getPersonalizationDataWithHttpInfo( + spaceId, entityType, entityIdentifier, childrenEntityType); + return localVarResp.getData(); + } + + /** + * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Entities feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @return ApiResponse<GetPersonalizationData200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getPersonalizationDataWithHttpInfo( + String spaceId, String entityType, String entityIdentifier, String childrenEntityType) + throws ApiException { + okhttp3.Call localVarCall = + getPersonalizationDataValidateBeforeCall( + spaceId, entityType, entityIdentifier, childrenEntityType, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Personalization Data (asynchronously) Get Personalization Data. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Entities feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param entityType (required) + * @param entityIdentifier (required) + * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getPersonalizationDataAsync( + String spaceId, + String entityType, + String entityIdentifier, + String childrenEntityType, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getPersonalizationDataValidateBeforeCall( + spaceId, entityType, entityIdentifier, childrenEntityType, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index f2d34d1c..a1266e2b 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition definition) { + public AudienceSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index c9b644f2..d88aeba3 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition1 definition) { + public ComputedTraitSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index d8aa8981..012d83c6 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,7 +36,8 @@ public class Definition { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index ed071aaa..e6c5ae7d 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,8 +36,7 @@ public class Definition1 { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition1 query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java index 2685fc9b..01e7de0d 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscriptionUpdateInput.java @@ -50,6 +50,16 @@ public class DestinationSubscriptionUpdateInput { @SerializedName(SERIALIZED_NAME_SETTINGS) private Map settings; + public static final String SERIALIZED_NAME_REVERSE_E_T_L_MODEL_ID = "reverseETLModelId"; + + @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_MODEL_ID) + private String reverseETLModelId; + + public static final String SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE = "reverseETLSchedule"; + + @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE) + private ReverseEtlScheduleDefinition reverseETLSchedule; + public DestinationSubscriptionUpdateInput() {} public DestinationSubscriptionUpdateInput name(String name) { @@ -140,6 +150,47 @@ public void setSettings(Map settings) { this.settings = settings; } + public DestinationSubscriptionUpdateInput reverseETLModelId(String reverseETLModelId) { + + this.reverseETLModelId = reverseETLModelId; + return this; + } + + /** + * (Reverse ETL only) The reverse ETL model to attach this subscription to. + * + * @return reverseETLModelId + */ + @javax.annotation.Nullable + public String getReverseETLModelId() { + return reverseETLModelId; + } + + public void setReverseETLModelId(String reverseETLModelId) { + this.reverseETLModelId = reverseETLModelId; + } + + public DestinationSubscriptionUpdateInput reverseETLSchedule( + ReverseEtlScheduleDefinition reverseETLSchedule) { + + this.reverseETLSchedule = reverseETLSchedule; + return this; + } + + /** + * Get reverseETLSchedule + * + * @return reverseETLSchedule + */ + @javax.annotation.Nullable + public ReverseEtlScheduleDefinition getReverseETLSchedule() { + return reverseETLSchedule; + } + + public void setReverseETLSchedule(ReverseEtlScheduleDefinition reverseETLSchedule) { + this.reverseETLSchedule = reverseETLSchedule; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -153,12 +204,19 @@ public boolean equals(Object o) { return Objects.equals(this.name, destinationSubscriptionUpdateInput.name) && Objects.equals(this.trigger, destinationSubscriptionUpdateInput.trigger) && Objects.equals(this.enabled, destinationSubscriptionUpdateInput.enabled) - && Objects.equals(this.settings, destinationSubscriptionUpdateInput.settings); + && Objects.equals(this.settings, destinationSubscriptionUpdateInput.settings) + && Objects.equals( + this.reverseETLModelId, + destinationSubscriptionUpdateInput.reverseETLModelId) + && Objects.equals( + this.reverseETLSchedule, + destinationSubscriptionUpdateInput.reverseETLSchedule); } @Override public int hashCode() { - return Objects.hash(name, trigger, enabled, settings); + return Objects.hash( + name, trigger, enabled, settings, reverseETLModelId, reverseETLSchedule); } @Override @@ -169,6 +227,12 @@ public String toString() { sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" reverseETLModelId: ") + .append(toIndentedString(reverseETLModelId)) + .append("\n"); + sb.append(" reverseETLSchedule: ") + .append(toIndentedString(reverseETLSchedule)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -194,6 +258,8 @@ private String toIndentedString(Object o) { openapiFields.add("trigger"); openapiFields.add("enabled"); openapiFields.add("settings"); + openapiFields.add("reverseETLModelId"); + openapiFields.add("reverseETLSchedule"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -247,6 +313,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("trigger").toString())); } + if ((jsonObj.get("reverseETLModelId") != null + && !jsonObj.get("reverseETLModelId").isJsonNull()) + && !jsonObj.get("reverseETLModelId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reverseETLModelId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("reverseETLModelId").toString())); + } + // validate the optional field `reverseETLSchedule` + if (jsonObj.get("reverseETLSchedule") != null + && !jsonObj.get("reverseETLSchedule").isJsonNull()) { + ReverseEtlScheduleDefinition.validateJsonElement(jsonObj.get("reverseETLSchedule")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java new file mode 100644 index 00000000..b490a132 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java @@ -0,0 +1,200 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetPersonalizationData200Response */ +public class GetPersonalizationData200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetPersonalizationDataOutput data; + + public GetPersonalizationData200Response() {} + + public GetPersonalizationData200Response data(GetPersonalizationDataOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetPersonalizationDataOutput getData() { + return data; + } + + public void setData(GetPersonalizationDataOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPersonalizationData200Response getPersonalizationData200Response = + (GetPersonalizationData200Response) o; + return Objects.equals(this.data, getPersonalizationData200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPersonalizationData200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetPersonalizationData200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPersonalizationData200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetPersonalizationData200Response is" + + " not found in the empty JSON string", + GetPersonalizationData200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetPersonalizationData200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetPersonalizationData200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetPersonalizationDataOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPersonalizationData200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPersonalizationData200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetPersonalizationData200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPersonalizationData200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPersonalizationData200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPersonalizationData200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPersonalizationData200Response + * @throws IOException if the JSON string is invalid with respect to + * GetPersonalizationData200Response + */ + public static GetPersonalizationData200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPersonalizationData200Response.class); + } + + /** + * Convert an instance of GetPersonalizationData200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java new file mode 100644 index 00000000..fa5fb97d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java @@ -0,0 +1,219 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Response for the getEntityDataForProfile endpoint. */ +public class GetPersonalizationDataOutput { + public static final String SERIALIZED_NAME_PERSONALIZATION_DATA = "personalizationData"; + + @SerializedName(SERIALIZED_NAME_PERSONALIZATION_DATA) + private Map personalizationData; + + public GetPersonalizationDataOutput() {} + + public GetPersonalizationDataOutput personalizationData( + Map personalizationData) { + + this.personalizationData = personalizationData; + return this; + } + + public GetPersonalizationDataOutput putPersonalizationDataItem( + String key, Object personalizationDataItem) { + if (this.personalizationData == null) { + this.personalizationData = new HashMap<>(); + } + this.personalizationData.put(key, personalizationDataItem); + return this; + } + + /** + * A key-value object that contains instance-specific Warehouse settings. + * + * @return personalizationData + */ + @javax.annotation.Nonnull + public Map getPersonalizationData() { + return personalizationData; + } + + public void setPersonalizationData(Map personalizationData) { + this.personalizationData = personalizationData; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPersonalizationDataOutput getPersonalizationDataOutput = + (GetPersonalizationDataOutput) o; + return Objects.equals( + this.personalizationData, getPersonalizationDataOutput.personalizationData); + } + + @Override + public int hashCode() { + return Objects.hash(personalizationData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPersonalizationDataOutput {\n"); + sb.append(" personalizationData: ") + .append(toIndentedString(personalizationData)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("personalizationData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("personalizationData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetPersonalizationDataOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetPersonalizationDataOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetPersonalizationDataOutput is not" + + " found in the empty JSON string", + GetPersonalizationDataOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetPersonalizationDataOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetPersonalizationDataOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPersonalizationDataOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPersonalizationDataOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPersonalizationDataOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetPersonalizationDataOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPersonalizationDataOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPersonalizationDataOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetPersonalizationDataOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPersonalizationDataOutput + * @throws IOException if the JSON string is invalid with respect to + * GetPersonalizationDataOutput + */ + public static GetPersonalizationDataOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPersonalizationDataOutput.class); + } + + /** + * Convert an instance of GetPersonalizationDataOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From a5b2c87cc7e05de3e40fcba6d8aa4b2050cc4067 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 6 Sep 2024 17:03:36 +0000 Subject: [PATCH 337/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@dad6d11f. From e314b8e67cbfe999c844a5404e83bf78040f0b53 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 6 Sep 2024 18:55:20 +0000 Subject: [PATCH 338/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@dad6d11f. --- .../com/segment/publicapi/models/AudienceSummary.java | 10 +++++----- .../segment/publicapi/models/ComputedTraitSummary.java | 10 +++++----- .../java/com/segment/publicapi/models/Definition.java | 10 +++------- .../java/com/segment/publicapi/models/Definition1.java | 10 +++++++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index a1266e2b..f2d34d1c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private Definition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition1 definition) { + public AudienceSummary definition(Definition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public Definition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(Definition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + Definition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index d88aeba3..c9b644f2 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private Definition1 definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition definition) { + public ComputedTraitSummary definition(Definition1 definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public Definition1 getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(Definition1 definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + Definition1.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java index 012d83c6..d8aa8981 100644 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ b/src/main/java/com/segment/publicapi/models/Definition.java @@ -36,8 +36,7 @@ public class Definition { private String query; /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -98,9 +97,7 @@ public Definition query(String query) { } /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * The query language string defining the audience segmentation criteria. * * @return query */ @@ -120,8 +117,7 @@ public Definition type(TypeEnum type) { } /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * * @return type */ diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java index e6c5ae7d..ed071aaa 100644 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ b/src/main/java/com/segment/publicapi/models/Definition1.java @@ -36,7 +36,8 @@ public class Definition1 { private String query; /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -97,7 +98,9 @@ public Definition1 query(String query) { } /** - * The query language string defining the audience segmentation criteria. + * The query language string defining the computed trait aggregation criteria. For guidance on + * using the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * * @return query */ @@ -117,7 +120,8 @@ public Definition1 type(TypeEnum type) { } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The underlying data type being aggregated for this computed trait. Possible values: users, + * accounts. * * @return type */ From d64baed58d9224fa362e476a93cba49c0474798a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 9 Sep 2024 23:57:35 +0000 Subject: [PATCH 339/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3363268f. --- README.md | 8 +- docs/PersonalizationApi.md | 88 -- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 12 - .../publicapi/api/PersonalizationApi.java | 295 ------- .../publicapi/models/AudienceSummary.java | 10 +- .../models/ComputedTraitSummary.java | 10 +- .../com/segment/publicapi/models/Config.java | 352 +++++--- .../segment/publicapi/models/Definition.java | 291 ------- .../segment/publicapi/models/Definition1.java | 295 ------- .../models/DestinationSubscription.java | 34 +- .../segment/publicapi/models/Function.java | 757 ------------------ .../publicapi/models/GetFunctionV1Output.java | 10 +- .../GetPersonalizationData200Response.java | 200 ----- .../models/GetPersonalizationDataOutput.java | 219 ----- .../publicapi/models/ScheduleConfig.java | 350 +++++--- .../com/segment/publicapi/models/Space.java | 2 +- 19 files changed, 485 insertions(+), 2454 deletions(-) delete mode 100644 docs/PersonalizationApi.md delete mode 100644 src/main/java/com/segment/publicapi/api/PersonalizationApi.java delete mode 100644 src/main/java/com/segment/publicapi/models/Definition.java delete mode 100644 src/main/java/com/segment/publicapi/models/Definition1.java delete mode 100644 src/main/java/com/segment/publicapi/models/Function.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java diff --git a/README.md b/README.md index 8ef4c0d8..7a5b9000 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 53.3.0 +Latest API and SDK version: 54.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 53.3.0 + 54.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:53.3.0" + implementation "com.segment.publicapi:segment-publicapi:54.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-53.3.0.jar` +* `target/segment-publicapi-54.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/PersonalizationApi.md b/docs/PersonalizationApi.md deleted file mode 100644 index 6c23e90e..00000000 --- a/docs/PersonalizationApi.md +++ /dev/null @@ -1,88 +0,0 @@ -# PersonalizationApi - -All URIs are relative to *https://api.segmentapis.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getPersonalizationData**](PersonalizationApi.md#getPersonalizationData) | **GET** /personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier} | Get Personalization Data | - - - -## Operation: getPersonalizationData - -> GetPersonalizationData200Response getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType) - -Get Personalization Data - -Get Personalization Data. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Entities feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.PersonalizationApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - PersonalizationApi apiInstance = new PersonalizationApi(defaultClient); - String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String entityType = "account"; // String | - String entityIdentifier = "1"; // String | - String childrenEntityType = "childrenEntityType_example"; // String | Child entity type. This parameter exists in alpha. - try { - GetPersonalizationData200Response result = apiInstance.getPersonalizationData(spaceId, entityType, entityIdentifier, childrenEntityType); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PersonalizationApi#getPersonalizationData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **entityType** | **String**| | | -| **entityIdentifier** | **String**| | | -| **childrenEntityType** | **String**| Child entity type. This parameter exists in alpha. | [optional] | - -### Return type - -[**GetPersonalizationData200Response**](GetPersonalizationData200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - diff --git a/pom.xml b/pom.xml index 85dfc1eb..758a43bf 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 53.3.0 + 54.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index e1c7dcd6..af3d25ef 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 53.3.0 (Java)"); + setUserAgent("Public API SDK 54.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index dd46127e..8c4df2c5 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "53.3.0"; + public static final String VERSION = "54.1.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index e2f12717..7d881285 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -409,10 +409,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateWriteKeyForSourceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Definition.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Definition1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); @@ -577,8 +573,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Function.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -704,12 +698,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetMessagingSubscriptionSuccessResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetPersonalizationData200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetPersonalizationDataOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetRegulation200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/PersonalizationApi.java b/src/main/java/com/segment/publicapi/api/PersonalizationApi.java deleted file mode 100644 index b685d288..00000000 --- a/src/main/java/com/segment/publicapi/api/PersonalizationApi.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.GetPersonalizationData200Response; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PersonalizationApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public PersonalizationApi() { - this(Configuration.getDefaultApiClient()); - } - - public PersonalizationApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for getPersonalizationData - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getPersonalizationDataCall( - String spaceId, - String entityType, - String entityIdentifier, - String childrenEntityType, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/personalization/v1/spaces/{spaceId}/{entityType}/{entityIdentifier}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "entityType" + "}", - localVarApiClient.escapeString(entityType.toString())) - .replace( - "{" + "entityIdentifier" + "}", - localVarApiClient.escapeString(entityIdentifier.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (childrenEntityType != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("childrenEntityType", childrenEntityType)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPersonalizationDataValidateBeforeCall( - String spaceId, - String entityType, - String entityIdentifier, - String childrenEntityType, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getPersonalizationData(Async)"); - } - - // verify the required parameter 'entityType' is set - if (entityType == null) { - throw new ApiException( - "Missing the required parameter 'entityType' when calling" - + " getPersonalizationData(Async)"); - } - - // verify the required parameter 'entityIdentifier' is set - if (entityIdentifier == null) { - throw new ApiException( - "Missing the required parameter 'entityIdentifier' when calling" - + " getPersonalizationData(Async)"); - } - - return getPersonalizationDataCall( - spaceId, entityType, entityIdentifier, childrenEntityType, _callback); - } - - /** - * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Entities feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @return GetPersonalizationData200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetPersonalizationData200Response getPersonalizationData( - String spaceId, String entityType, String entityIdentifier, String childrenEntityType) - throws ApiException { - ApiResponse localVarResp = - getPersonalizationDataWithHttpInfo( - spaceId, entityType, entityIdentifier, childrenEntityType); - return localVarResp.getData(); - } - - /** - * Get Personalization Data Get Personalization Data. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Entities feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @return ApiResponse<GetPersonalizationData200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getPersonalizationDataWithHttpInfo( - String spaceId, String entityType, String entityIdentifier, String childrenEntityType) - throws ApiException { - okhttp3.Call localVarCall = - getPersonalizationDataValidateBeforeCall( - spaceId, entityType, entityIdentifier, childrenEntityType, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Personalization Data (asynchronously) Get Personalization Data. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Entities feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param entityType (required) - * @param entityIdentifier (required) - * @param childrenEntityType Child entity type. This parameter exists in alpha. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getPersonalizationDataAsync( - String spaceId, - String entityType, - String entityIdentifier, - String childrenEntityType, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getPersonalizationDataValidateBeforeCall( - spaceId, entityType, entityIdentifier, childrenEntityType, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummary.java b/src/main/java/com/segment/publicapi/models/AudienceSummary.java index f2d34d1c..310b96d4 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummary.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummary.java @@ -62,7 +62,7 @@ public class AudienceSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition definition; + private AudienceDefinition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public AudienceSummary definition(Definition definition) { + public AudienceSummary definition(AudienceDefinition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public AudienceSummary definition(Definition definition) { * @return definition */ @javax.annotation.Nullable - public Definition getDefinition() { + public AudienceDefinition getDefinition() { return definition; } - public void setDefinition(Definition definition) { + public void setDefinition(AudienceDefinition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition.validateJsonElement(jsonObj.get("definition")); + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java index c9b644f2..a7e67bca 100644 --- a/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java +++ b/src/main/java/com/segment/publicapi/models/ComputedTraitSummary.java @@ -62,7 +62,7 @@ public class ComputedTraitSummary { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private Definition1 definition; + private ComputedTraitsDefinition definition; public static final String SERIALIZED_NAME_STATUS = "status"; @@ -216,7 +216,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ComputedTraitSummary definition(Definition1 definition) { + public ComputedTraitSummary definition(ComputedTraitsDefinition definition) { this.definition = definition; return this; @@ -228,11 +228,11 @@ public ComputedTraitSummary definition(Definition1 definition) { * @return definition */ @javax.annotation.Nullable - public Definition1 getDefinition() { + public ComputedTraitsDefinition getDefinition() { return definition; } - public void setDefinition(Definition1 definition) { + public void setDefinition(ComputedTraitsDefinition definition) { this.definition = definition; } @@ -542,7 +542,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("key").toString())); } // validate the required field `definition` - Definition1.validateJsonElement(jsonObj.get("definition")); + ComputedTraitsDefinition.validateJsonElement(jsonObj.get("definition")); if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index 63ff722e..b70fcf4a 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -13,100 +13,233 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; -/** - * Config contains interval duration in case of periodic or day and hours in case of specific_days. - * Empty if strategy is MANUAL. - */ -public class Config { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; +public class Config extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Config.class.getName()); - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Config.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Config' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - public Config() {} + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Config value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public Config read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); - public Config interval(String interval) { + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; - this.interval = interval; - return this; + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for Config: no class matches" + + " result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } } - /** - * Duration is specified as a string, eg: 15m, 3h25m30s. - * - * @return interval - */ - @javax.annotation.Nonnull - public String getInterval() { - return interval; + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public Config() { + super("anyOf", Boolean.TRUE); } - public void setInterval(String interval) { - this.interval = interval; + public Config(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Config config = (Config) o; - return Objects.equals(this.interval, config.interval); + public Config(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public int hashCode() { - return Objects.hash(interval); + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Config {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append("}"); - return sb.toString(); + public Map> getSchemas() { + return Config.schemas; } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; } - return o.toString().replace("\n", "\n "); + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } /** @@ -116,75 +249,40 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to Config */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Config.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Config is not found in the empty JSON" - + " string", - Config.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Config.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Config`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Config.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Config.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Config' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Config.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Config value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Config read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } + throw new IOException( + String.format( + "The JSON string is invalid for Config with anyOf schemas:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/Definition.java b/src/main/java/com/segment/publicapi/models/Definition.java deleted file mode 100644 index d8aa8981..00000000 --- a/src/main/java/com/segment/publicapi/models/Definition.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Query language definition and type. */ -public class Definition { - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; - - /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public Definition() {} - - public Definition query(String query) { - - this.query = query; - return this; - } - - /** - * The query language string defining the audience segmentation criteria. - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public Definition type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Definition definition = (Definition) o; - return Objects.equals(this.query, definition.query) - && Objects.equals(this.type, definition.type); - } - - @Override - public int hashCode() { - return Objects.hash(query, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Definition {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("query"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("query"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Definition - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Definition.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Definition is not found in the empty" - + " JSON string", - Definition.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Definition.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Definition` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Definition.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("query").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `query` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("query").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Definition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Definition' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Definition.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Definition value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Definition read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Definition given an JSON string - * - * @param jsonString JSON string - * @return An instance of Definition - * @throws IOException if the JSON string is invalid with respect to Definition - */ - public static Definition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Definition.class); - } - - /** - * Convert an instance of Definition to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Definition1.java b/src/main/java/com/segment/publicapi/models/Definition1.java deleted file mode 100644 index ed071aaa..00000000 --- a/src/main/java/com/segment/publicapi/models/Definition1.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Query language definition and type. */ -public class Definition1 { - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; - - /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public Definition1() {} - - public Definition1 query(String query) { - - this.query = query; - return this; - } - - /** - * The query language string defining the computed trait aggregation criteria. For guidance on - * using the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). - * - * @return query - */ - @javax.annotation.Nonnull - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public Definition1 type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The underlying data type being aggregated for this computed trait. Possible values: users, - * accounts. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Definition1 definition1 = (Definition1) o; - return Objects.equals(this.query, definition1.query) - && Objects.equals(this.type, definition1.type); - } - - @Override - public int hashCode() { - return Objects.hash(query, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Definition1 {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("query"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("query"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Definition1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Definition1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Definition1 is not found in the empty" - + " JSON string", - Definition1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Definition1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Definition1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Definition1.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("query").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `query` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("query").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Definition1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Definition1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Definition1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Definition1 value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Definition1 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Definition1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Definition1 - * @throws IOException if the JSON string is invalid with respect to Definition1 - */ - public static Definition1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Definition1.class); - } - - /** - * Convert an instance of Definition1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java index 1db32a50..bde984ad 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationSubscription.java +++ b/src/main/java/com/segment/publicapi/models/DestinationSubscription.java @@ -22,13 +22,11 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** DestinationSubscription */ public class DestinationSubscription { @@ -80,7 +78,7 @@ public class DestinationSubscription { public static final String SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE = "reverseETLSchedule"; @SerializedName(SERIALIZED_NAME_REVERSE_E_T_L_SCHEDULE) - private Object reverseETLSchedule; + private ReverseEtlScheduleDefinition reverseETLSchedule; public DestinationSubscription() {} @@ -273,23 +271,24 @@ public void setModelId(String modelId) { this.modelId = modelId; } - public DestinationSubscription reverseETLSchedule(Object reverseETLSchedule) { + public DestinationSubscription reverseETLSchedule( + ReverseEtlScheduleDefinition reverseETLSchedule) { this.reverseETLSchedule = reverseETLSchedule; return this; } /** - * The schedule for the Reverse ETL subscription. + * Get reverseETLSchedule * * @return reverseETLSchedule */ @javax.annotation.Nullable - public Object getReverseETLSchedule() { + public ReverseEtlScheduleDefinition getReverseETLSchedule() { return reverseETLSchedule; } - public void setReverseETLSchedule(Object reverseETLSchedule) { + public void setReverseETLSchedule(ReverseEtlScheduleDefinition reverseETLSchedule) { this.reverseETLSchedule = reverseETLSchedule; } @@ -315,15 +314,6 @@ public boolean equals(Object o) { this.reverseETLSchedule, destinationSubscription.reverseETLSchedule); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { return Objects.hash( @@ -339,13 +329,6 @@ public int hashCode() { reverseETLSchedule); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -496,6 +479,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("modelId").toString())); } + // validate the optional field `reverseETLSchedule` + if (jsonObj.get("reverseETLSchedule") != null + && !jsonObj.get("reverseETLSchedule").isJsonNull()) { + ReverseEtlScheduleDefinition.validateJsonElement(jsonObj.get("reverseETLSchedule")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Function.java b/src/main/java/com/segment/publicapi/models/Function.java deleted file mode 100644 index f4bd534b..00000000 --- a/src/main/java/com/segment/publicapi/models/Function.java +++ /dev/null @@ -1,757 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** A Function object. */ -public class Function { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The Function type. Config API note: equal to `type`. */ - @JsonAdapter(ResourceTypeEnum.Adapter.class) - public enum ResourceTypeEnum { - DESTINATION("DESTINATION"), - - INSERT_DESTINATION("INSERT_DESTINATION"), - - INSERT_SOURCE("INSERT_SOURCE"), - - SOURCE("SOURCE"); - - private String value; - - ResourceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ResourceTypeEnum fromValue(String value) { - for (ResourceTypeEnum b : ResourceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResourceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType"; - - @SerializedName(SERIALIZED_NAME_RESOURCE_TYPE) - private ResourceTypeEnum resourceType; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_CODE = "code"; - - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_DEPLOYED_AT = "deployedAt"; - - @SerializedName(SERIALIZED_NAME_DEPLOYED_AT) - private String deployedAt; - - public static final String SERIALIZED_NAME_SETTINGS = "settings"; - - @SerializedName(SERIALIZED_NAME_SETTINGS) - private List settings; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_LOGO_URL = "logoUrl"; - - @SerializedName(SERIALIZED_NAME_LOGO_URL) - private String logoUrl; - - public static final String SERIALIZED_NAME_PREVIEW_WEBHOOK_URL = "previewWebhookUrl"; - - @SerializedName(SERIALIZED_NAME_PREVIEW_WEBHOOK_URL) - private String previewWebhookUrl; - - public static final String SERIALIZED_NAME_BATCH_MAX_COUNT = "batchMaxCount"; - - @SerializedName(SERIALIZED_NAME_BATCH_MAX_COUNT) - private BigDecimal batchMaxCount; - - public static final String SERIALIZED_NAME_CATALOG_ID = "catalogId"; - - @SerializedName(SERIALIZED_NAME_CATALOG_ID) - private String catalogId; - - public static final String SERIALIZED_NAME_IS_LATEST_VERSION = "isLatestVersion"; - - @SerializedName(SERIALIZED_NAME_IS_LATEST_VERSION) - private Boolean isLatestVersion; - - public Function() {} - - public Function id(String id) { - - this.id = id; - return this; - } - - /** - * An identifier for this Function. - * - * @return id - */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Function resourceType(ResourceTypeEnum resourceType) { - - this.resourceType = resourceType; - return this; - } - - /** - * The Function type. Config API note: equal to `type`. - * - * @return resourceType - */ - @javax.annotation.Nullable - public ResourceTypeEnum getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceTypeEnum resourceType) { - this.resourceType = resourceType; - } - - public Function createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * The time this Function was created. - * - * @return createdAt - */ - @javax.annotation.Nullable - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Function createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * The id of the user who created this Function. - * - * @return createdBy - */ - @javax.annotation.Nullable - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Function code(String code) { - - this.code = code; - return this; - } - - /** - * The Function code. - * - * @return code - */ - @javax.annotation.Nullable - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public Function deployedAt(String deployedAt) { - - this.deployedAt = deployedAt; - return this; - } - - /** - * The time of this Function's last deployment. - * - * @return deployedAt - */ - @javax.annotation.Nullable - public String getDeployedAt() { - return deployedAt; - } - - public void setDeployedAt(String deployedAt) { - this.deployedAt = deployedAt; - } - - public Function settings(List settings) { - - this.settings = settings; - return this; - } - - public Function addSettingsItem(FunctionSettingV1 settingsItem) { - if (this.settings == null) { - this.settings = new ArrayList<>(); - } - this.settings.add(settingsItem); - return this; - } - - /** - * The list of settings for this Function. - * - * @return settings - */ - @javax.annotation.Nullable - public List getSettings() { - return settings; - } - - public void setSettings(List settings) { - this.settings = settings; - } - - public Function displayName(String displayName) { - - this.displayName = displayName; - return this; - } - - /** - * A display name for this Function. - * - * @return displayName - */ - @javax.annotation.Nullable - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public Function description(String description) { - - this.description = description; - return this; - } - - /** - * A description for this Function. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Function logoUrl(String logoUrl) { - - this.logoUrl = logoUrl; - return this; - } - - /** - * The URL of the logo for this Function. - * - * @return logoUrl - */ - @javax.annotation.Nullable - public String getLogoUrl() { - return logoUrl; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public Function previewWebhookUrl(String previewWebhookUrl) { - - this.previewWebhookUrl = previewWebhookUrl; - return this; - } - - /** - * The preview webhook URL for this Function. - * - * @return previewWebhookUrl - */ - @javax.annotation.Nullable - public String getPreviewWebhookUrl() { - return previewWebhookUrl; - } - - public void setPreviewWebhookUrl(String previewWebhookUrl) { - this.previewWebhookUrl = previewWebhookUrl; - } - - public Function batchMaxCount(BigDecimal batchMaxCount) { - - this.batchMaxCount = batchMaxCount; - return this; - } - - /** - * The max count of the batch for this Function. - * - * @return batchMaxCount - */ - @javax.annotation.Nullable - public BigDecimal getBatchMaxCount() { - return batchMaxCount; - } - - public void setBatchMaxCount(BigDecimal batchMaxCount) { - this.batchMaxCount = batchMaxCount; - } - - public Function catalogId(String catalogId) { - - this.catalogId = catalogId; - return this; - } - - /** - * The catalog id of this Function. - * - * @return catalogId - */ - @javax.annotation.Nullable - public String getCatalogId() { - return catalogId; - } - - public void setCatalogId(String catalogId) { - this.catalogId = catalogId; - } - - public Function isLatestVersion(Boolean isLatestVersion) { - - this.isLatestVersion = isLatestVersion; - return this; - } - - /** - * Whether the deployment of this Function is the latest version. - * - * @return isLatestVersion - */ - @javax.annotation.Nullable - public Boolean getIsLatestVersion() { - return isLatestVersion; - } - - public void setIsLatestVersion(Boolean isLatestVersion) { - this.isLatestVersion = isLatestVersion; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Function function = (Function) o; - return Objects.equals(this.id, function.id) - && Objects.equals(this.resourceType, function.resourceType) - && Objects.equals(this.createdAt, function.createdAt) - && Objects.equals(this.createdBy, function.createdBy) - && Objects.equals(this.code, function.code) - && Objects.equals(this.deployedAt, function.deployedAt) - && Objects.equals(this.settings, function.settings) - && Objects.equals(this.displayName, function.displayName) - && Objects.equals(this.description, function.description) - && Objects.equals(this.logoUrl, function.logoUrl) - && Objects.equals(this.previewWebhookUrl, function.previewWebhookUrl) - && Objects.equals(this.batchMaxCount, function.batchMaxCount) - && Objects.equals(this.catalogId, function.catalogId) - && Objects.equals(this.isLatestVersion, function.isLatestVersion); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - resourceType, - createdAt, - createdBy, - code, - deployedAt, - settings, - displayName, - description, - logoUrl, - previewWebhookUrl, - batchMaxCount, - catalogId, - isLatestVersion); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Function {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" deployedAt: ").append(toIndentedString(deployedAt)).append("\n"); - sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); - sb.append(" previewWebhookUrl: ") - .append(toIndentedString(previewWebhookUrl)) - .append("\n"); - sb.append(" batchMaxCount: ").append(toIndentedString(batchMaxCount)).append("\n"); - sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); - sb.append(" isLatestVersion: ").append(toIndentedString(isLatestVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("resourceType"); - openapiFields.add("createdAt"); - openapiFields.add("createdBy"); - openapiFields.add("code"); - openapiFields.add("deployedAt"); - openapiFields.add("settings"); - openapiFields.add("displayName"); - openapiFields.add("description"); - openapiFields.add("logoUrl"); - openapiFields.add("previewWebhookUrl"); - openapiFields.add("batchMaxCount"); - openapiFields.add("catalogId"); - openapiFields.add("isLatestVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Function - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Function.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Function is not found in the empty" - + " JSON string", - Function.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Function.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Function`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) - && !jsonObj.get("resourceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `resourceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("resourceType").toString())); - } - if ((jsonObj.get("createdAt") != null && !jsonObj.get("createdAt").isJsonNull()) - && !jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) - && !jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) - && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `code` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("code").toString())); - } - if ((jsonObj.get("deployedAt") != null && !jsonObj.get("deployedAt").isJsonNull()) - && !jsonObj.get("deployedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `deployedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("deployedAt").toString())); - } - if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { - JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); - if (jsonArraysettings != null) { - // ensure the json data is an array - if (!jsonObj.get("settings").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `settings` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("settings").toString())); - } - - // validate the optional field `settings` (array) - for (int i = 0; i < jsonArraysettings.size(); i++) { - FunctionSettingV1.validateJsonElement(jsonArraysettings.get(i)); - } - ; - } - } - if ((jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonNull()) - && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `displayName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("displayName").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if ((jsonObj.get("logoUrl") != null && !jsonObj.get("logoUrl").isJsonNull()) - && !jsonObj.get("logoUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `logoUrl` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("logoUrl").toString())); - } - if ((jsonObj.get("previewWebhookUrl") != null - && !jsonObj.get("previewWebhookUrl").isJsonNull()) - && !jsonObj.get("previewWebhookUrl").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `previewWebhookUrl` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("previewWebhookUrl").toString())); - } - if ((jsonObj.get("catalogId") != null && !jsonObj.get("catalogId").isJsonNull()) - && !jsonObj.get("catalogId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `catalogId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("catalogId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Function.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Function' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Function.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Function value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Function read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Function given an JSON string - * - * @param jsonString JSON string - * @return An instance of Function - * @throws IOException if the JSON string is invalid with respect to Function - */ - public static Function fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Function.class); - } - - /** - * Convert an instance of Function to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java index 7eb76e51..318c309f 100644 --- a/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java +++ b/src/main/java/com/segment/publicapi/models/GetFunctionV1Output.java @@ -32,11 +32,11 @@ public class GetFunctionV1Output { public static final String SERIALIZED_NAME_FUNCTION = "function"; @SerializedName(SERIALIZED_NAME_FUNCTION) - private Function function; + private FunctionV1 function; public GetFunctionV1Output() {} - public GetFunctionV1Output function(Function function) { + public GetFunctionV1Output function(FunctionV1 function) { this.function = function; return this; @@ -48,11 +48,11 @@ public GetFunctionV1Output function(Function function) { * @return function */ @javax.annotation.Nullable - public Function getFunction() { + public FunctionV1 getFunction() { return function; } - public void setFunction(Function function) { + public void setFunction(FunctionV1 function) { this.function = function; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `function` - Function.validateJsonElement(jsonObj.get("function")); + FunctionV1.validateJsonElement(jsonObj.get("function")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java deleted file mode 100644 index b490a132..00000000 --- a/src/main/java/com/segment/publicapi/models/GetPersonalizationData200Response.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** GetPersonalizationData200Response */ -public class GetPersonalizationData200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetPersonalizationDataOutput data; - - public GetPersonalizationData200Response() {} - - public GetPersonalizationData200Response data(GetPersonalizationDataOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public GetPersonalizationDataOutput getData() { - return data; - } - - public void setData(GetPersonalizationDataOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPersonalizationData200Response getPersonalizationData200Response = - (GetPersonalizationData200Response) o; - return Objects.equals(this.data, getPersonalizationData200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetPersonalizationData200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetPersonalizationData200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetPersonalizationData200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetPersonalizationData200Response is" - + " not found in the empty JSON string", - GetPersonalizationData200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPersonalizationData200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPersonalizationData200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetPersonalizationDataOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPersonalizationData200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetPersonalizationData200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetPersonalizationData200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetPersonalizationData200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetPersonalizationData200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetPersonalizationData200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetPersonalizationData200Response - * @throws IOException if the JSON string is invalid with respect to - * GetPersonalizationData200Response - */ - public static GetPersonalizationData200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetPersonalizationData200Response.class); - } - - /** - * Convert an instance of GetPersonalizationData200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java b/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java deleted file mode 100644 index fa5fb97d..00000000 --- a/src/main/java/com/segment/publicapi/models/GetPersonalizationDataOutput.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Response for the getEntityDataForProfile endpoint. */ -public class GetPersonalizationDataOutput { - public static final String SERIALIZED_NAME_PERSONALIZATION_DATA = "personalizationData"; - - @SerializedName(SERIALIZED_NAME_PERSONALIZATION_DATA) - private Map personalizationData; - - public GetPersonalizationDataOutput() {} - - public GetPersonalizationDataOutput personalizationData( - Map personalizationData) { - - this.personalizationData = personalizationData; - return this; - } - - public GetPersonalizationDataOutput putPersonalizationDataItem( - String key, Object personalizationDataItem) { - if (this.personalizationData == null) { - this.personalizationData = new HashMap<>(); - } - this.personalizationData.put(key, personalizationDataItem); - return this; - } - - /** - * A key-value object that contains instance-specific Warehouse settings. - * - * @return personalizationData - */ - @javax.annotation.Nonnull - public Map getPersonalizationData() { - return personalizationData; - } - - public void setPersonalizationData(Map personalizationData) { - this.personalizationData = personalizationData; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetPersonalizationDataOutput getPersonalizationDataOutput = - (GetPersonalizationDataOutput) o; - return Objects.equals( - this.personalizationData, getPersonalizationDataOutput.personalizationData); - } - - @Override - public int hashCode() { - return Objects.hash(personalizationData); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetPersonalizationDataOutput {\n"); - sb.append(" personalizationData: ") - .append(toIndentedString(personalizationData)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("personalizationData"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("personalizationData"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetPersonalizationDataOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetPersonalizationDataOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetPersonalizationDataOutput is not" - + " found in the empty JSON string", - GetPersonalizationDataOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetPersonalizationDataOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetPersonalizationDataOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetPersonalizationDataOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetPersonalizationDataOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetPersonalizationDataOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetPersonalizationDataOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetPersonalizationDataOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetPersonalizationDataOutput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetPersonalizationDataOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetPersonalizationDataOutput - * @throws IOException if the JSON string is invalid with respect to - * GetPersonalizationDataOutput - */ - public static GetPersonalizationDataOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetPersonalizationDataOutput.class); - } - - /** - * Convert an instance of GetPersonalizationDataOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java index 1e23a36d..3b527dda 100644 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -13,97 +13,234 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; -/** Depending on the chosen strategy, configures the schedule for this model. */ -public class ScheduleConfig { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; +public class ScheduleConfig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ScheduleConfig.class.getName()); - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScheduleConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - public ScheduleConfig() {} + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ScheduleConfig value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public ScheduleConfig read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; - public ScheduleConfig interval(String interval) { + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + ScheduleConfig ret = new ScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + ScheduleConfig ret = new ScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } - this.interval = interval; - return this; + throw new IOException( + String.format( + "Failed deserialization for ScheduleConfig: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } } - /** - * Duration is specified as a string, eg: 15m, 3h25m30s. - * - * @return interval - */ - @javax.annotation.Nonnull - public String getInterval() { - return interval; + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public ScheduleConfig() { + super("anyOf", Boolean.TRUE); } - public void setInterval(String interval) { - this.interval = interval; + public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScheduleConfig scheduleConfig = (ScheduleConfig) o; - return Objects.equals(this.interval, scheduleConfig.interval); + public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); } - @Override - public int hashCode() { - return Objects.hash(interval); + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScheduleConfig {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); - sb.append("}"); - return sb.toString(); + public Map> getSchemas() { + return ScheduleConfig.schemas; } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; } - return o.toString().replace("\n", "\n "); + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } /** @@ -113,75 +250,40 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ScheduleConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ScheduleConfig is not found in the" - + " empty JSON string", - ScheduleConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ScheduleConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ScheduleConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ScheduleConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ScheduleConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ScheduleConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ScheduleConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one } + throw new IOException( + String.format( + "The JSON string is invalid for ScheduleConfig with anyOf schemas:" + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/Space.java b/src/main/java/com/segment/publicapi/models/Space.java index 7dad935d..7e505e05 100644 --- a/src/main/java/com/segment/publicapi/models/Space.java +++ b/src/main/java/com/segment/publicapi/models/Space.java @@ -27,7 +27,7 @@ import java.util.Objects; import java.util.Set; -/** Space matching the given id. */ +/** Space */ public class Space { public static final String SERIALIZED_NAME_ID = "id"; From 36da684e846672c7fbf6f2d9f206151fcb7b5ebc Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Sep 2024 00:24:35 +0000 Subject: [PATCH 340/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f69cb91b. From 493f1b9b928e31431e849a157355255e94300dda Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Sep 2024 04:16:25 +0000 Subject: [PATCH 341/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2a9703df. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- docs/ComputedTraitsApi.md | 4 +- docs/DeliveryOverviewApi.md | 96 +- docs/FiltersApi.md | 382 ++++++++ docs/ReverseEtlApi.md | 2 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 38 + .../segment/publicapi/api/AudiencesApi.java | 44 +- .../publicapi/api/ComputedTraitsApi.java | 45 +- .../publicapi/api/DeliveryOverviewApi.java | 384 ++++---- .../com/segment/publicapi/api/FiltersApi.java | 917 ++++++++++++++++++ .../segment/publicapi/api/ReverseEtlApi.java | 18 +- .../models/CreateFilter200Response.java | 194 ++++ .../publicapi/models/CreateFilterInput.java | 473 +++++++++ .../publicapi/models/CreateFilterOutput.java | 202 ++++ .../models/DeleteFilterById200Response.java | 195 ++++ .../models/DeleteFilterByIdOutput.java | 200 ++++ .../DeliveryOverviewDestinationFilterBy.java | 6 +- .../DeliveryOverviewMetricsDatapoint.java | 2 +- .../DeliveryOverviewMetricsDataset.java | 12 +- .../com/segment/publicapi/models/Filter.java | 546 +++++++++++ .../GetDeliveryOverviewMetricsBetaOutput.java | 4 +- .../models/GetFilterById200Response.java | 194 ++++ .../publicapi/models/GetFilterByIdOutput.java | 202 ++++ ...ListFiltersByIntegrationId200Response.java | 203 ++++ .../ListFiltersByIntegrationIdOutput.java | 257 +++++ .../models/ListFiltersPaginationInput.java | 230 +++++ .../models/ListFiltersPaginationOutput.java | 248 +++++ ...tusesFromModelAndSubscriptionIdOutput.java | 2 +- .../ReverseEtlPeriodicScheduleConfig.java | 2 +- .../models/UpdateFilterById200Response.java | 195 ++++ .../models/UpdateFilterByIdInput.java | 473 +++++++++ .../models/UpdateFilterByIdOutput.java | 202 ++++ 36 files changed, 5671 insertions(+), 319 deletions(-) create mode 100644 docs/FiltersApi.md create mode 100644 src/main/java/com/segment/publicapi/api/FiltersApi.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateFilter200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateFilterInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateFilterOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteFilterById200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteFilterByIdOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/Filter.java create mode 100644 src/main/java/com/segment/publicapi/models/GetFilterById200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetFilterByIdOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListFiltersPaginationInput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListFiltersPaginationOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateFilterById200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateFilterByIdOutput.java diff --git a/README.md b/README.md index 7a5b9000..a4f7cb27 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 54.1.0 +Latest API and SDK version: 54.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 54.1.0 + 54.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:54.1.0" + implementation "com.segment.publicapi:segment-publicapi:54.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-54.1.0.jar` +* `target/segment-publicapi-54.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index aaa5358b..781dc14e 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -18,7 +18,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Audience -Creates Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created via the API is not editable via the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Creates Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -318,7 +318,7 @@ public class Example { Update Audience for Space -Updates the enabled status for an audience • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). Note: The definition for an Audience updated via the API is not editable via the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Updates the enabled status for an audience • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). Note: The definition for an Audience updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/ComputedTraitsApi.md b/docs/ComputedTraitsApi.md index 50b22242..302f2fb3 100644 --- a/docs/ComputedTraitsApi.md +++ b/docs/ComputedTraitsApi.md @@ -18,7 +18,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Computed Trait -Creates a Computed Trait • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Computed Trait Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait created via the API is not editable via the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Creates a Computed Trait • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Computed Trait Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -318,7 +318,7 @@ public class Example { Update Computed Trait for Space -Updates the enabled status for a computed trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a Computed Trait is updated, the Computed Trait will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). Note: The definition for a Computed Trait updated via the API is not editable via the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Updates the enabled status for a computed trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a Computed Trait is updated, the Computed Trait will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). Note: The definition for a Computed Trait updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index 982cfebd..dc4089a6 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -43,11 +43,11 @@ public class Example { DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getEgressFailedMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -70,11 +70,11 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -130,11 +130,11 @@ public class Example { DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `appVersion`, `subscription Id`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `group By`. If you would like to view retry attempts for a successful delivery, you can filter `discard Reason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getEgressSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -157,11 +157,11 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `appVersion`, `subscription Id`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `group By`. If you would like to view retry attempts for a successful delivery, you can filter `discard Reason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -217,11 +217,11 @@ public class Example { DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -244,11 +244,11 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -303,11 +303,11 @@ public class Example { DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, and `app Version`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, and/or `app Version` that can be applied in addition to a `group By`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtSourceMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -329,11 +329,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and `appVersion`. This parameter exists in beta. | [optional] | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, and `app Version`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, and/or `app Version` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -388,11 +388,11 @@ public class Example { DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and/or `appVersion`. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, and/or `appVersion`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSourceFilterBy filter = new DeliveryOverviewSourceFilterBy(); // DeliveryOverviewSourceFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, and/or `app Version` that can be applied in addition to a `group By`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getIngressFailedMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -414,11 +414,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, and/or `appVersion`. This parameter exists in beta. | [optional] | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, and/or `appVersion`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSourceFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, and/or `app Version` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -473,11 +473,11 @@ public class Example { DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, and/or `appVersion`. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, and/or `app Version`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewSuccessfullyReceivedFilterBy filter = new DeliveryOverviewSuccessfullyReceivedFilterBy(); // DeliveryOverviewSuccessfullyReceivedFilterBy | An optional filter for `eventName`, `eventType`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewSuccessfullyReceivedFilterBy filter = new DeliveryOverviewSuccessfullyReceivedFilterBy(); // DeliveryOverviewSuccessfullyReceivedFilterBy | An optional filter for `event Name`, `event Type`, and/or `app Version` that can be applied in addition to a `group By`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getIngressSuccessMetricsFromDeliveryOverview(sourceId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -499,11 +499,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, and/or `appVersion`. This parameter exists in beta. | [optional] | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, and/or `app Version`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewSuccessfullyReceivedFilterBy**](.md)| An optional filter for `eventName`, `eventType`, and/or `appVersion` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewSuccessfullyReceivedFilterBy**](.md)| An optional filter for `event Name`, `event Type`, and/or `app Version` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Optional params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type diff --git a/docs/FiltersApi.md b/docs/FiltersApi.md new file mode 100644 index 00000000..92f3ec36 --- /dev/null +++ b/docs/FiltersApi.md @@ -0,0 +1,382 @@ +# FiltersApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createFilter**](FiltersApi.md#createFilter) | **POST** /filters | Create Filter | +| [**deleteFilterById**](FiltersApi.md#deleteFilterById) | **DELETE** /filters/{id} | Delete Filter By Id | +| [**getFilterById**](FiltersApi.md#getFilterById) | **GET** /filters/{id} | Get Filter By Id | +| [**listFiltersByIntegrationId**](FiltersApi.md#listFiltersByIntegrationId) | **GET** /filters | List Filters By Integration Id | +| [**updateFilterById**](FiltersApi.md#updateFilterById) | **PATCH** /filters/{id} | Update Filter By Id | + + + +## Operation: createFilter + +> CreateFilter200Response createFilter(createFilterInput) + +Create Filter + +Creates a filter. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.FiltersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + FiltersApi apiInstance = new FiltersApi(defaultClient); + CreateFilterInput createFilterInput = new CreateFilterInput(); // CreateFilterInput | + try { + CreateFilter200Response result = apiInstance.createFilter(createFilterInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiltersApi#createFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **createFilterInput** | [**CreateFilterInput**](CreateFilterInput.md)| | | + +### Return type + +[**CreateFilter200Response**](CreateFilter200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: deleteFilterById + +> DeleteFilterById200Response deleteFilterById(id) + +Delete Filter By Id + +Deletes a filter by id. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.FiltersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + FiltersApi apiInstance = new FiltersApi(defaultClient); + String id = ""; // String | + try { + DeleteFilterById200Response result = apiInstance.deleteFilterById(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiltersApi#deleteFilterById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +[**DeleteFilterById200Response**](DeleteFilterById200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: getFilterById + +> GetFilterById200Response getFilterById(id) + +Get Filter By Id + +Gets a filter by id. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.FiltersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + FiltersApi apiInstance = new FiltersApi(defaultClient); + String id = ""; // String | + try { + GetFilterById200Response result = apiInstance.getFilterById(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiltersApi#getFilterById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +[**GetFilterById200Response**](GetFilterById200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: listFiltersByIntegrationId + +> ListFiltersByIntegrationId200Response listFiltersByIntegrationId(integrationId, pagination) + +List Filters By Integration Id + +Lists filters by Integration id. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.FiltersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + FiltersApi apiInstance = new FiltersApi(defaultClient); + String integrationId = ""; // String | The integration id used to fetch filters. This parameter exists in alpha. + ListFiltersPaginationInput pagination = new ListFiltersPaginationInput(); // ListFiltersPaginationInput | Pagination parameters. This parameter exists in alpha. + try { + ListFiltersByIntegrationId200Response result = apiInstance.listFiltersByIntegrationId(integrationId, pagination); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiltersApi#listFiltersByIntegrationId"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integrationId** | **String**| The integration id used to fetch filters. This parameter exists in alpha. | | +| **pagination** | [**ListFiltersPaginationInput**](.md)| Pagination parameters. This parameter exists in alpha. | [optional] | + +### Return type + +[**ListFiltersByIntegrationId200Response**](ListFiltersByIntegrationId200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: updateFilterById + +> UpdateFilterById200Response updateFilterById(id, updateFilterByIdInput) + +Update Filter By Id + +Updates a filter by id. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.FiltersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + FiltersApi apiInstance = new FiltersApi(defaultClient); + String id = ""; // String | + UpdateFilterByIdInput updateFilterByIdInput = new UpdateFilterByIdInput(); // UpdateFilterByIdInput | + try { + UpdateFilterById200Response result = apiInstance.updateFilterById(id, updateFilterByIdInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FiltersApi#updateFilterById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | +| **updateFilterByIdInput** | [**UpdateFilterByIdInput**](UpdateFilterByIdInput.md)| | | + +### Return type + +[**UpdateFilterById200Response**](UpdateFilterById200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index e2ce6a57..ea4e4f9d 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -21,7 +21,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Reverse ETL Manual Sync -Triggers a manual sync for a Reverse ETL Connection. In the request body, the `subscriptionId` is the id that follows after `/mappings/` portion in the URL of the sync. For example, the `subscriptionId` would be `2` for this sync: https://app.Segment.com/example-workspace/reverse-etl/destinations/example-destination/sources/example-source/instances/1/mappings/2/source-id/3/model-id/4/sync-details The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Triggers a manual sync for a Reverse ETL Connection. In the request body, the `subscription id` is the id that follows after `/mappings/` portion in the URL of the sync. For example, the `subscription id` would be `2` for this sync: https://app.Segment.com/example-workspace/reverse-etl/destinations/example-destination/sources/example-source/instances/1/mappings/2/source-id/3/model-id/4/sync-details The rate limit for this endpoint is 20 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/pom.xml b/pom.xml index 758a43bf..94873b40 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 54.1.0 + 54.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index af3d25ef..9f6ad7fe 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 54.1.0 (Java)"); + setUserAgent("Public API SDK 54.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 8c4df2c5..2f9e98c0 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "54.1.0"; + public static final String VERSION = "54.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7d881285..09ec404d 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -250,6 +250,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateEdgeFunctionsAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilter200Response + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFilterForDestination200Response .CustomTypeAdapterFactory()); @@ -259,6 +262,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFilterForDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilterInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilterOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFunction200Response .CustomTypeAdapterFactory()); @@ -415,6 +422,11 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteFilterById200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteFilterByIdOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteFunction200Response .CustomTypeAdapterFactory()); @@ -573,6 +585,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FunctionDeployment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -664,6 +678,11 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetEventsVolumeFromWorkspaceV1Query .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFilterById200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetFilterByIdOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetFilterInDestination200Response .CustomTypeAdapterFactory()); @@ -888,12 +907,24 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListDestinationsV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFiltersByIntegrationId200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFiltersByIntegrationIdOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFiltersFromDestination200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFiltersFromDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFiltersPaginationInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListFiltersPaginationOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFunctionItemV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1386,6 +1417,13 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFilterById200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFilterByIdInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateFilterByIdOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateFilterForDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 04b7143e..381380c0 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -177,10 +177,10 @@ private okhttp3.Call createAudienceValidateBeforeCall( * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach * out to your customer success manager for more information. • When called, this endpoint may * generate the `Audience Created` event in the [audit trail](/tag/Audit-Trail). Note: - * The definition for an Audience created via the API is not editable via the Segment App. The - * rate limit for this endpoint is 10 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate + * The definition for an Audience created using the API is not editable through the Segment App. + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -210,10 +210,10 @@ public CreateAudience200Response createAudience( * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach * out to your customer success manager for more information. • When called, this endpoint may * generate the `Audience Created` event in the [audit trail](/tag/Audit-Trail). Note: - * The definition for an Audience created via the API is not editable via the Segment App. The - * rate limit for this endpoint is 10 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate + * The definition for an Audience created using the API is not editable through the Segment App. + * The rate limit for this endpoint is 10 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -244,8 +244,8 @@ public ApiResponse createAudienceWithHttpInfo( * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. • When * called, this endpoint may generate the `Audience Created` event in the [audit - * trail](/tag/Audit-Trail). Note: The definition for an Audience created via the API is not - * editable via the Segment App. The rate limit for this endpoint is 10 requests per minute, + * trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not + * editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, * which is lower than the default due to access pattern restrictions. Once reached, this * endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -997,10 +997,10 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( * Audience will be locked from future edits until the changes have been incorporated. You can * find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * Note: The definition for an Audience updated via the API is not editable via the Segment App. - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate + * Note: The definition for an Audience updated using the API is not editable through the + * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -1036,10 +1036,10 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( * Audience will be locked from future edits until the changes have been incorporated. You can * find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * Note: The definition for an Audience updated via the API is not editable via the Segment App. - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate + * Note: The definition for an Audience updated using the API is not editable through the + * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -1077,10 +1077,10 @@ public ApiResponse updateAudienceForSpaceWith * updated, the Audience will be locked from future edits until the changes have been * incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). - * Note: The definition for an Audience updated via the API is not editable via the Segment App. - * The rate limit for this endpoint is 10 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate + * Note: The definition for an Audience updated using the API is not editable through the + * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java index e3da0754..393ee35f 100644 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -178,9 +178,9 @@ private okhttp3.Call createComputedTraitValidateBeforeCall( * successfully call this endpoint, the specified Workspace needs to have the Computed Trait * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Computed Trait Created` event in the - * [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait created via the - * API is not editable via the Segment App. The rate limit for this endpoint is 10 requests per - * minute, which is lower than the default due to access pattern restrictions. Once reached, + * [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait created using the + * API is not editable through the Segment App. The rate limit for this endpoint is 10 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * @@ -212,9 +212,9 @@ public CreateComputedTrait200Response createComputedTrait( * successfully call this endpoint, the specified Workspace needs to have the Computed Trait * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Computed Trait Created` event in the - * [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait created via the - * API is not editable via the Segment App. The rate limit for this endpoint is 10 requests per - * minute, which is lower than the default due to access pattern restrictions. Once reached, + * [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait created using the + * API is not editable through the Segment App. The rate limit for this endpoint is 10 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, * this endpoint will respond with the 429 HTTP status code with headers indicating the limit * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * @@ -248,10 +248,11 @@ public ApiResponse createComputedTraitWithHttpIn * Computed Trait feature enabled. Please reach out to your customer success manager for more * information. • When called, this endpoint may generate the `Computed Trait Created` * event in the [audit trail](/tag/Audit-Trail). Note: The definition for a Computed Trait - * created via the API is not editable via the Segment App. The rate limit for this endpoint is - * 10 requests per minute, which is lower than the default due to access pattern restrictions. - * Once reached, this endpoint will respond with the 429 HTTP status code with headers - * indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * created using the API is not editable through the Segment App. The rate limit for this + * endpoint is 10 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param createComputedTraitAlphaInput (required) @@ -1013,10 +1014,10 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( * Computed Trait is updated, the Computed Trait will be locked from future edits until the * changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * Note: The definition for a Computed Trait updated via the API is not editable via the Segment - * App. The rate limit for this endpoint is 10 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Note: The definition for a Computed Trait updated using the API is not editable through the + * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -1055,10 +1056,10 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * Computed Trait is updated, the Computed Trait will be locked from future edits until the * changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * Note: The definition for a Computed Trait updated via the API is not editable via the Segment - * App. The rate limit for this endpoint is 10 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Note: The definition for a Computed Trait updated using the API is not editable through the + * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -1100,10 +1101,10 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( * when a Computed Trait is updated, the Computed Trait will be locked from future edits until * the changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). - * Note: The definition for a Computed Trait updated via the API is not editable via the Segment - * App. The rate limit for this endpoint is 10 requests per minute, which is lower than the - * default due to access pattern restrictions. Once reached, this endpoint will respond with the - * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Note: The definition for a Computed Trait updated using the API is not editable through the + * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index a5b8cade..236e3df9 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -73,12 +73,12 @@ public void setCustomBaseUrl(String customBaseUrl) { * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -87,10 +87,10 @@ public void setCustomBaseUrl(String customBaseUrl) { * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback Callback for upload/download progress @@ -272,12 +272,12 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -286,10 +286,10 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -336,12 +336,12 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -350,10 +350,10 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -403,12 +403,12 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -417,10 +417,10 @@ private okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewValidateBeforeCal * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback The callback to be executed when the API call finishes @@ -472,12 +472,12 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -486,11 +486,11 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -674,12 +674,12 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -688,11 +688,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -741,12 +741,12 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -755,11 +755,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -811,12 +811,12 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -825,11 +825,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -883,12 +883,12 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -897,10 +897,10 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback Callback for upload/download progress @@ -1082,12 +1082,12 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -1096,10 +1096,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1146,12 +1146,12 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -1160,10 +1160,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1213,12 +1213,12 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in * beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -1227,10 +1227,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback The callback to be executed when the API call finishes @@ -1280,12 +1280,12 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and `app Version`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1293,9 +1293,9 @@ public okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback Callback for upload/download progress @@ -1453,12 +1453,12 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and `app Version`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1466,9 +1466,9 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1505,12 +1505,12 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and `app Version`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1518,9 +1518,9 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1566,12 +1566,12 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and `app Version`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1579,9 +1579,9 @@ private okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewValidateBefor * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback The callback to be executed when the API call finishes @@ -1629,12 +1629,12 @@ public okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewAsync( * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and/or `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1642,9 +1642,9 @@ public okhttp3.Call getFilteredAtSourceMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback Callback for upload/download progress @@ -1801,12 +1801,12 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and/or `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1814,9 +1814,9 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1852,12 +1852,12 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and/or `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1865,9 +1865,9 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1913,12 +1913,12 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, and/or `appVersion`. This parameter exists in beta. + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, and/or `appVersion`. This parameter exists in beta. * (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time @@ -1926,9 +1926,9 @@ private okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, and/or `appVersion` that can be applied in addition - * to a `groupBy`. This parameter exists in beta. (optional) + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, and/or `app Version` that can be applied in + * addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) * @param _callback The callback to be executed when the API call finishes @@ -1976,20 +1976,20 @@ public okhttp3.Call getIngressFailedMetricsFromDeliveryOverviewAsync( * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and/or - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `event Name`, `event Type`, and/or + * `app Version`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `event Name`, `event Type`, and/or + * `app Version` that can be applied in addition to a `group By`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2148,20 +2148,20 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and/or - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `event Name`, `event Type`, and/or + * `app Version`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `event Name`, `event Type`, and/or + * `app Version` that can be applied in addition to a `group By`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2199,20 +2199,20 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and/or - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `event Name`, `event Type`, and/or + * `app Version`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `event Name`, `event Type`, and/or + * `app Version` that can be applied in addition to a `group By`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) @@ -2259,20 +2259,20 @@ private okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewValidateBeforeC * * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) + * requested time frame, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time + * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, and/or - * `appVersion`. This parameter exists in beta. (optional) + * the result by. Valid options are: `event Name`, `event Type`, and/or + * `app Version`. This parameter exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity * chosen, there are restrictions on the time range you can query: **Minute**: - Max time * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, and/or - * `appVersion` that can be applied in addition to a `groupBy`. This + * @param filter An optional filter for `event Name`, `event Type`, and/or + * `app Version` that can be applied in addition to a `group By`. This * parameter exists in beta. (optional) * @param pagination Optional params to specify the page cursor and count. This parameter exists * in beta. (optional) diff --git a/src/main/java/com/segment/publicapi/api/FiltersApi.java b/src/main/java/com/segment/publicapi/api/FiltersApi.java new file mode 100644 index 00000000..3ef02696 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/FiltersApi.java @@ -0,0 +1,917 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateFilter200Response; +import com.segment.publicapi.models.CreateFilterInput; +import com.segment.publicapi.models.DeleteFilterById200Response; +import com.segment.publicapi.models.GetFilterById200Response; +import com.segment.publicapi.models.ListFiltersByIntegrationId200Response; +import com.segment.publicapi.models.ListFiltersPaginationInput; +import com.segment.publicapi.models.UpdateFilterById200Response; +import com.segment.publicapi.models.UpdateFilterByIdInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FiltersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public FiltersApi() { + this(Configuration.getDefaultApiClient()); + } + + public FiltersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createFilter + * + * @param createFilterInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createFilterCall( + CreateFilterInput createFilterInput, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createFilterInput; + + // create path and map variables + String localVarPath = "/filters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createFilterValidateBeforeCall( + CreateFilterInput createFilterInput, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createFilterInput' is set + if (createFilterInput == null) { + throw new ApiException( + "Missing the required parameter 'createFilterInput' when calling" + + " createFilter(Async)"); + } + + return createFilterCall(createFilterInput, _callback); + } + + /** + * Create Filter Creates a filter. • When called, this endpoint may generate the `Filter + * Created` event in the [audit trail](/tag/Audit-Trail). + * + * @param createFilterInput (required) + * @return CreateFilter200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateFilter200Response createFilter(CreateFilterInput createFilterInput) + throws ApiException { + ApiResponse localVarResp = + createFilterWithHttpInfo(createFilterInput); + return localVarResp.getData(); + } + + /** + * Create Filter Creates a filter. • When called, this endpoint may generate the `Filter + * Created` event in the [audit trail](/tag/Audit-Trail). + * + * @param createFilterInput (required) + * @return ApiResponse<CreateFilter200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createFilterWithHttpInfo( + CreateFilterInput createFilterInput) throws ApiException { + okhttp3.Call localVarCall = createFilterValidateBeforeCall(createFilterInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Filter (asynchronously) Creates a filter. • When called, this endpoint may generate + * the `Filter Created` event in the [audit trail](/tag/Audit-Trail). + * + * @param createFilterInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createFilterAsync( + CreateFilterInput createFilterInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = createFilterValidateBeforeCall(createFilterInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for deleteFilterById + * + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteFilterByIdCall(String id, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/filters/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteFilterByIdValidateBeforeCall(String id, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling deleteFilterById(Async)"); + } + + return deleteFilterByIdCall(id, _callback); + } + + /** + * Delete Filter By Id Deletes a filter by id. • When called, this endpoint may generate the + * `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param id (required) + * @return DeleteFilterById200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public DeleteFilterById200Response deleteFilterById(String id) throws ApiException { + ApiResponse localVarResp = deleteFilterByIdWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Delete Filter By Id Deletes a filter by id. • When called, this endpoint may generate the + * `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param id (required) + * @return ApiResponse<DeleteFilterById200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse deleteFilterByIdWithHttpInfo(String id) + throws ApiException { + okhttp3.Call localVarCall = deleteFilterByIdValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Filter By Id (asynchronously) Deletes a filter by id. • When called, this endpoint may + * generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call deleteFilterByIdAsync( + String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = deleteFilterByIdValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getFilterById + * + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getFilterByIdCall(String id, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/filters/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFilterByIdValidateBeforeCall(String id, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getFilterById(Async)"); + } + + return getFilterByIdCall(id, _callback); + } + + /** + * Get Filter By Id Gets a filter by id. + * + * @param id (required) + * @return GetFilterById200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetFilterById200Response getFilterById(String id) throws ApiException { + ApiResponse localVarResp = getFilterByIdWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Get Filter By Id Gets a filter by id. + * + * @param id (required) + * @return ApiResponse<GetFilterById200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getFilterByIdWithHttpInfo(String id) + throws ApiException { + okhttp3.Call localVarCall = getFilterByIdValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Filter By Id (asynchronously) Gets a filter by id. + * + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getFilterByIdAsync( + String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getFilterByIdValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listFiltersByIntegrationId + * + * @param integrationId The integration id used to fetch filters. This parameter exists in + * alpha. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFiltersByIntegrationIdCall( + String integrationId, + ListFiltersPaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/filters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (integrationId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("integrationId", integrationId)); + } + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFiltersByIntegrationIdValidateBeforeCall( + String integrationId, + ListFiltersPaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException( + "Missing the required parameter 'integrationId' when calling" + + " listFiltersByIntegrationId(Async)"); + } + + return listFiltersByIntegrationIdCall(integrationId, pagination, _callback); + } + + /** + * List Filters By Integration Id Lists filters by Integration id. + * + * @param integrationId The integration id used to fetch filters. This parameter exists in + * alpha. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (optional) + * @return ListFiltersByIntegrationId200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( + String integrationId, ListFiltersPaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listFiltersByIntegrationIdWithHttpInfo(integrationId, pagination); + return localVarResp.getData(); + } + + /** + * List Filters By Integration Id Lists filters by Integration id. + * + * @param integrationId The integration id used to fetch filters. This parameter exists in + * alpha. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (optional) + * @return ApiResponse<ListFiltersByIntegrationId200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listFiltersByIntegrationIdWithHttpInfo( + String integrationId, ListFiltersPaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listFiltersByIntegrationIdValidateBeforeCall(integrationId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Filters By Integration Id (asynchronously) Lists filters by Integration id. + * + * @param integrationId The integration id used to fetch filters. This parameter exists in + * alpha. (required) + * @param pagination Pagination parameters. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listFiltersByIntegrationIdAsync( + String integrationId, + ListFiltersPaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listFiltersByIntegrationIdValidateBeforeCall(integrationId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateFilterById + * + * @param id (required) + * @param updateFilterByIdInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateFilterByIdCall( + String id, UpdateFilterByIdInput updateFilterByIdInput, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateFilterByIdInput; + + // create path and map variables + String localVarPath = + "/filters/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateFilterByIdValidateBeforeCall( + String id, UpdateFilterByIdInput updateFilterByIdInput, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling updateFilterById(Async)"); + } + + // verify the required parameter 'updateFilterByIdInput' is set + if (updateFilterByIdInput == null) { + throw new ApiException( + "Missing the required parameter 'updateFilterByIdInput' when calling" + + " updateFilterById(Async)"); + } + + return updateFilterByIdCall(id, updateFilterByIdInput, _callback); + } + + /** + * Update Filter By Id Updates a filter by id. • When called, this endpoint may generate the + * `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + * + * @param id (required) + * @param updateFilterByIdInput (required) + * @return UpdateFilterById200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateFilterById200Response updateFilterById( + String id, UpdateFilterByIdInput updateFilterByIdInput) throws ApiException { + ApiResponse localVarResp = + updateFilterByIdWithHttpInfo(id, updateFilterByIdInput); + return localVarResp.getData(); + } + + /** + * Update Filter By Id Updates a filter by id. • When called, this endpoint may generate the + * `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + * + * @param id (required) + * @param updateFilterByIdInput (required) + * @return ApiResponse<UpdateFilterById200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse updateFilterByIdWithHttpInfo( + String id, UpdateFilterByIdInput updateFilterByIdInput) throws ApiException { + okhttp3.Call localVarCall = + updateFilterByIdValidateBeforeCall(id, updateFilterByIdInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Filter By Id (asynchronously) Updates a filter by id. • When called, this endpoint may + * generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + * + * @param id (required) + * @param updateFilterByIdInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateFilterByIdAsync( + String id, + UpdateFilterByIdInput updateFilterByIdInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateFilterByIdValidateBeforeCall(id, updateFilterByIdInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index d72ea549..816d05cc 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -165,9 +165,9 @@ private okhttp3.Call createReverseETLManualSyncValidateBeforeCall( /** * Create Reverse ETL Manual Sync Triggers a manual sync for a Reverse ETL Connection. In the - * request body, the `subscriptionId` is the id that follows after - * `/mappings/` portion in the URL of the sync. For example, the - * `subscriptionId` would be `2` for this sync: + * request body, the `subscription id` is the id that follows after + * `/mappings/` portion in the URL of the sync. For example, the `subscription + * id` would be `2` for this sync: * https://app.Segment.com/example-workspace/reverse-etl/destinations/example-destination/sources/example-source/instances/1/mappings/2/source-id/3/model-id/4/sync-details * The rate limit for this endpoint is 20 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 @@ -196,9 +196,9 @@ public CreateReverseETLManualSync200Response createReverseETLManualSync( /** * Create Reverse ETL Manual Sync Triggers a manual sync for a Reverse ETL Connection. In the - * request body, the `subscriptionId` is the id that follows after - * `/mappings/` portion in the URL of the sync. For example, the - * `subscriptionId` would be `2` for this sync: + * request body, the `subscription id` is the id that follows after + * `/mappings/` portion in the URL of the sync. For example, the `subscription + * id` would be `2` for this sync: * https://app.Segment.com/example-workspace/reverse-etl/destinations/example-destination/sources/example-source/instances/1/mappings/2/source-id/3/model-id/4/sync-details * The rate limit for this endpoint is 20 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 @@ -231,9 +231,9 @@ public CreateReverseETLManualSync200Response createReverseETLManualSync( /** * Create Reverse ETL Manual Sync (asynchronously) Triggers a manual sync for a Reverse ETL - * Connection. In the request body, the `subscriptionId` is the id that follows after - * `/mappings/` portion in the URL of the sync. For example, the - * `subscriptionId` would be `2` for this sync: + * Connection. In the request body, the `subscription id` is the id that follows after + * `/mappings/` portion in the URL of the sync. For example, the `subscription + * id` would be `2` for this sync: * https://app.Segment.com/example-workspace/reverse-etl/destinations/example-destination/sources/example-source/instances/1/mappings/2/source-id/3/model-id/4/sync-details * The rate limit for this endpoint is 20 requests per minute, which is lower than the default * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 diff --git a/src/main/java/com/segment/publicapi/models/CreateFilter200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilter200Response.java new file mode 100644 index 00000000..6afb6664 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateFilter200Response.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateFilter200Response */ +public class CreateFilter200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateFilterOutput data; + + public CreateFilter200Response() {} + + public CreateFilter200Response data(CreateFilterOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateFilterOutput getData() { + return data; + } + + public void setData(CreateFilterOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilter200Response createFilter200Response = (CreateFilter200Response) o; + return Objects.equals(this.data, createFilter200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilter200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateFilter200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateFilter200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFilter200Response is not found" + + " in the empty JSON string", + CreateFilter200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateFilter200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFilter200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateFilterOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFilter200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilter200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFilter200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFilter200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFilter200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFilter200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFilter200Response + * @throws IOException if the JSON string is invalid with respect to CreateFilter200Response + */ + public static CreateFilter200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilter200Response.class); + } + + /** + * Convert an instance of CreateFilter200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterInput.java b/src/main/java/com/segment/publicapi/models/CreateFilterInput.java new file mode 100644 index 00000000..76a52c5b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateFilterInput.java @@ -0,0 +1,473 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input for CreateFilter. */ +public class CreateFilterInput { + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_PROPERTY_DROPS = "propertyDrops"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_DROPS) + private List propertyDrops; + + public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; + + @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) + private List allowProperties; + + public CreateFilterInput() {} + + public CreateFilterInput integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * The Integration id of the resource. + * + * @return integrationId + */ + @javax.annotation.Nonnull + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public CreateFilterInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether the filter is enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateFilterInput drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Whether the event is dropped. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + + public CreateFilterInput name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the filter. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateFilterInput description(String description) { + + this.description = description; + return this; + } + + /** + * The description of the filter. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateFilterInput _if(String _if) { + + this._if = _if; + return this; + } + + /** + * The \"if\" statement for a filter. + * + * @return _if + */ + @javax.annotation.Nonnull + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public CreateFilterInput propertyDrops(List propertyDrops) { + + this.propertyDrops = propertyDrops; + return this; + } + + public CreateFilterInput addPropertyDropsItem(String propertyDropsItem) { + if (this.propertyDrops == null) { + this.propertyDrops = new ArrayList<>(); + } + this.propertyDrops.add(propertyDropsItem); + return this; + } + + /** + * Describes the properties to be dropped on events that match the \"if\" statement. + * + * @return propertyDrops + */ + @javax.annotation.Nullable + public List getPropertyDrops() { + return propertyDrops; + } + + public void setPropertyDrops(List propertyDrops) { + this.propertyDrops = propertyDrops; + } + + public CreateFilterInput allowProperties(List allowProperties) { + + this.allowProperties = allowProperties; + return this; + } + + public CreateFilterInput addAllowPropertiesItem(String allowPropertiesItem) { + if (this.allowProperties == null) { + this.allowProperties = new ArrayList<>(); + } + this.allowProperties.add(allowPropertiesItem); + return this; + } + + /** + * Describes the properties allowed on events that match the \"if\" statement. + * + * @return allowProperties + */ + @javax.annotation.Nullable + public List getAllowProperties() { + return allowProperties; + } + + public void setAllowProperties(List allowProperties) { + this.allowProperties = allowProperties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilterInput createFilterInput = (CreateFilterInput) o; + return Objects.equals(this.integrationId, createFilterInput.integrationId) + && Objects.equals(this.enabled, createFilterInput.enabled) + && Objects.equals(this.drop, createFilterInput.drop) + && Objects.equals(this.name, createFilterInput.name) + && Objects.equals(this.description, createFilterInput.description) + && Objects.equals(this._if, createFilterInput._if) + && Objects.equals(this.propertyDrops, createFilterInput.propertyDrops) + && Objects.equals(this.allowProperties, createFilterInput.allowProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + integrationId, + enabled, + drop, + name, + description, + _if, + propertyDrops, + allowProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilterInput {\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" propertyDrops: ").append(toIndentedString(propertyDrops)).append("\n"); + sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integrationId"); + openapiFields.add("enabled"); + openapiFields.add("drop"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("if"); + openapiFields.add("propertyDrops"); + openapiFields.add("allowProperties"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("if"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateFilterInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateFilterInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFilterInput is not found in the" + + " empty JSON string", + CreateFilterInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateFilterInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFilterInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFilterInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("propertyDrops") != null + && !jsonObj.get("propertyDrops").isJsonNull() + && !jsonObj.get("propertyDrops").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyDrops` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyDrops").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowProperties") != null + && !jsonObj.get("allowProperties").isJsonNull() + && !jsonObj.get("allowProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowProperties` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("allowProperties").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFilterInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFilterInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFilterInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFilterInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFilterInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFilterInput + * @throws IOException if the JSON string is invalid with respect to CreateFilterInput + */ + public static CreateFilterInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterInput.class); + } + + /** + * Convert an instance of CreateFilterInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterOutput.java b/src/main/java/com/segment/publicapi/models/CreateFilterOutput.java new file mode 100644 index 00000000..b15d2c92 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateFilterOutput.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for CreateFilter. */ +public class CreateFilterOutput { + public static final String SERIALIZED_NAME_FILTER = "filter"; + + @SerializedName(SERIALIZED_NAME_FILTER) + private Filter filter; + + public CreateFilterOutput() {} + + public CreateFilterOutput filter(Filter filter) { + + this.filter = filter; + return this; + } + + /** + * Get filter + * + * @return filter + */ + @javax.annotation.Nonnull + public Filter getFilter() { + return filter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateFilterOutput createFilterOutput = (CreateFilterOutput) o; + return Objects.equals(this.filter, createFilterOutput.filter); + } + + @Override + public int hashCode() { + return Objects.hash(filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateFilterOutput {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filter"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateFilterOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateFilterOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateFilterOutput is not found in the" + + " empty JSON string", + CreateFilterOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateFilterOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateFilterOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateFilterOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `filter` + Filter.validateJsonElement(jsonObj.get("filter")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateFilterOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFilterOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateFilterOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateFilterOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateFilterOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateFilterOutput + * @throws IOException if the JSON string is invalid with respect to CreateFilterOutput + */ + public static CreateFilterOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterOutput.class); + } + + /** + * Convert an instance of CreateFilterOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteFilterById200Response.java b/src/main/java/com/segment/publicapi/models/DeleteFilterById200Response.java new file mode 100644 index 00000000..31fc8c71 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteFilterById200Response.java @@ -0,0 +1,195 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** DeleteFilterById200Response */ +public class DeleteFilterById200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private DeleteFilterByIdOutput data; + + public DeleteFilterById200Response() {} + + public DeleteFilterById200Response data(DeleteFilterByIdOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public DeleteFilterByIdOutput getData() { + return data; + } + + public void setData(DeleteFilterByIdOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteFilterById200Response deleteFilterById200Response = (DeleteFilterById200Response) o; + return Objects.equals(this.data, deleteFilterById200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteFilterById200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DeleteFilterById200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteFilterById200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteFilterById200Response is not" + + " found in the empty JSON string", + DeleteFilterById200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DeleteFilterById200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteFilterById200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + DeleteFilterByIdOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteFilterById200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteFilterById200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteFilterById200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteFilterById200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteFilterById200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteFilterById200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteFilterById200Response + * @throws IOException if the JSON string is invalid with respect to DeleteFilterById200Response + */ + public static DeleteFilterById200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteFilterById200Response.class); + } + + /** + * Convert an instance of DeleteFilterById200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteFilterByIdOutput.java b/src/main/java/com/segment/publicapi/models/DeleteFilterByIdOutput.java new file mode 100644 index 00000000..ce3c15ed --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteFilterByIdOutput.java @@ -0,0 +1,200 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for DeleteFilterById. */ +public class DeleteFilterByIdOutput { + public static final String SERIALIZED_NAME_DELETED = "deleted"; + + @SerializedName(SERIALIZED_NAME_DELETED) + private Boolean deleted; + + public DeleteFilterByIdOutput() {} + + public DeleteFilterByIdOutput deleted(Boolean deleted) { + + this.deleted = deleted; + return this; + } + + /** + * Filter deleted by filter id. + * + * @return deleted + */ + @javax.annotation.Nonnull + public Boolean getDeleted() { + return deleted; + } + + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteFilterByIdOutput deleteFilterByIdOutput = (DeleteFilterByIdOutput) o; + return Objects.equals(this.deleted, deleteFilterByIdOutput.deleted); + } + + @Override + public int hashCode() { + return Objects.hash(deleted); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteFilterByIdOutput {\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("deleted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("deleted"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DeleteFilterByIdOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteFilterByIdOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteFilterByIdOutput is not found in" + + " the empty JSON string", + DeleteFilterByIdOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DeleteFilterByIdOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteFilterByIdOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteFilterByIdOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteFilterByIdOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteFilterByIdOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteFilterByIdOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteFilterByIdOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteFilterByIdOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteFilterByIdOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteFilterByIdOutput + * @throws IOException if the JSON string is invalid with respect to DeleteFilterByIdOutput + */ + public static DeleteFilterByIdOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteFilterByIdOutput.class); + } + + /** + * Convert an instance of DeleteFilterByIdOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java index bd929d94..3e800c92 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java @@ -206,7 +206,7 @@ public DeliveryOverviewDestinationFilterBy addSubscriptionIdItem(String subscrip } /** - * A list of strings of subscriptionIDs for Actions Destinations. + * A list of strings of subscription IDs for Actions Destinations. * * @return subscriptionId */ @@ -262,7 +262,7 @@ public DeliveryOverviewDestinationFilterBy addAudienceIdItem(String audienceIdIt } /** - * A list of strings of audienceIDs for a Linked Audience. + * A list of strings of audience IDs for a Linked Audience. * * @return audienceId */ @@ -290,7 +290,7 @@ public DeliveryOverviewDestinationFilterBy addSpaceIdItem(String spaceIdItem) { } /** - * A list of strings of spaceIDs for a Linked Audience. + * A list of strings of space IDs for a Linked Audience. * * @return spaceId */ diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDatapoint.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDatapoint.java index a1112503..abc510a2 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDatapoint.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDatapoint.java @@ -75,7 +75,7 @@ public DeliveryOverviewMetricsDatapoint count(BigDecimal count) { } /** - * Holds the number of events within the specified granularity and groupBy options. + * Holds the number of events within the specified granularity and group By options. * * @return count */ diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDataset.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDataset.java index b5116430..dfdf38da 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDataset.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewMetricsDataset.java @@ -77,7 +77,7 @@ public DeliveryOverviewMetricsDataset eventName(String eventName) { } /** - * The name of the event if groupBy[] included 'eventName' in the request. + * The name of the event if group By[] included 'event Name' in the request. * * @return eventName */ @@ -97,7 +97,7 @@ public DeliveryOverviewMetricsDataset appVersion(String appVersion) { } /** - * The version of the app if groupBy[] included 'appVersion' in the request. + * The version of the app if group By[] included 'app Version' in the request. * * @return appVersion */ @@ -117,7 +117,7 @@ public DeliveryOverviewMetricsDataset eventType(String eventType) { } /** - * The event type if groupBy[] included 'eventType' in the request. + * The event type if group By[] included 'event Type' in the request. * * @return eventType */ @@ -137,7 +137,7 @@ public DeliveryOverviewMetricsDataset discardReason(String discardReason) { } /** - * The discard reason for dropped events if groupBy[] included 'discardReason' in the + * The discard reason for dropped events if group By[] included 'discard Reason' in the * request. * * @return discardReason @@ -158,7 +158,7 @@ public DeliveryOverviewMetricsDataset total(BigDecimal total) { } /** - * Holds the count of all event counts over the timeframe of the series. + * Holds the count of all event counts over the time frame of the series. * * @return total */ @@ -187,7 +187,7 @@ public DeliveryOverviewMetricsDataset addSeriesItem( } /** - * A list of the event counts broken down by the requested granularity, timeframe, and groupBy + * A list of the event counts broken down by the requested granularity, time frame, and group By * options. * * @return series diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java new file mode 100644 index 00000000..b4f000a5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -0,0 +1,546 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Filter output. */ +public class Filter { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_PROPERTY_DROPS = "propertyDrops"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_DROPS) + private List propertyDrops; + + public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; + + @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) + private List allowProperties; + + public Filter() {} + + public Filter id(String id) { + + this.id = id; + return this; + } + + /** + * The newly created filter id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Filter workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The Workspace id to create the filter. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public Filter integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * The Integration id of the resource. + * + * @return integrationId + */ + @javax.annotation.Nonnull + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public Filter enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether the filter is enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Filter drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Whether the event is dropped. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + + public Filter name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the filter. + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Filter description(String description) { + + this.description = description; + return this; + } + + /** + * The description of the filter. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Filter _if(String _if) { + + this._if = _if; + return this; + } + + /** + * The \"if\" statement for a filter. + * + * @return _if + */ + @javax.annotation.Nullable + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public Filter propertyDrops(List propertyDrops) { + + this.propertyDrops = propertyDrops; + return this; + } + + public Filter addPropertyDropsItem(String propertyDropsItem) { + if (this.propertyDrops == null) { + this.propertyDrops = new ArrayList<>(); + } + this.propertyDrops.add(propertyDropsItem); + return this; + } + + /** + * Describes the properties to be dropped on events that match the \"if\" statement. + * + * @return propertyDrops + */ + @javax.annotation.Nullable + public List getPropertyDrops() { + return propertyDrops; + } + + public void setPropertyDrops(List propertyDrops) { + this.propertyDrops = propertyDrops; + } + + public Filter allowProperties(List allowProperties) { + + this.allowProperties = allowProperties; + return this; + } + + public Filter addAllowPropertiesItem(String allowPropertiesItem) { + if (this.allowProperties == null) { + this.allowProperties = new ArrayList<>(); + } + this.allowProperties.add(allowPropertiesItem); + return this; + } + + /** + * Describes the properties allowed on events that match the \"if\" statement. + * + * @return allowProperties + */ + @javax.annotation.Nullable + public List getAllowProperties() { + return allowProperties; + } + + public void setAllowProperties(List allowProperties) { + this.allowProperties = allowProperties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Filter filter = (Filter) o; + return Objects.equals(this.id, filter.id) + && Objects.equals(this.workspaceId, filter.workspaceId) + && Objects.equals(this.integrationId, filter.integrationId) + && Objects.equals(this.enabled, filter.enabled) + && Objects.equals(this.drop, filter.drop) + && Objects.equals(this.name, filter.name) + && Objects.equals(this.description, filter.description) + && Objects.equals(this._if, filter._if) + && Objects.equals(this.propertyDrops, filter.propertyDrops) + && Objects.equals(this.allowProperties, filter.allowProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + workspaceId, + integrationId, + enabled, + drop, + name, + description, + _if, + propertyDrops, + allowProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Filter {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" propertyDrops: ").append(toIndentedString(propertyDrops)).append("\n"); + sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("workspaceId"); + openapiFields.add("integrationId"); + openapiFields.add("enabled"); + openapiFields.add("drop"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("if"); + openapiFields.add("propertyDrops"); + openapiFields.add("allowProperties"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("integrationId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Filter + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Filter.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Filter is not found in the empty JSON" + + " string", + Filter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Filter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Filter`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Filter.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) + && !jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("propertyDrops") != null + && !jsonObj.get("propertyDrops").isJsonNull() + && !jsonObj.get("propertyDrops").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyDrops` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyDrops").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowProperties") != null + && !jsonObj.get("allowProperties").isJsonNull() + && !jsonObj.get("allowProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowProperties` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("allowProperties").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Filter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Filter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Filter.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Filter value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Filter read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Filter given an JSON string + * + * @param jsonString JSON string + * @return An instance of Filter + * @throws IOException if the JSON string is invalid with respect to Filter + */ + public static Filter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Filter.class); + } + + /** + * Convert an instance of Filter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java index 2bde6143..129523c4 100644 --- a/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java @@ -31,7 +31,7 @@ import java.util.Objects; import java.util.Set; -/** Output of the Delivery Overview public api endpoints. */ +/** Output of the Delivery Overview public API endpoints. */ public class GetDeliveryOverviewMetricsBetaOutput { public static final String SERIALIZED_NAME_TOTAL = "total"; @@ -87,7 +87,7 @@ public GetDeliveryOverviewMetricsBetaOutput addDatasetItem( } /** - * Represents the list of series broken down by the dimensions and timeframe requested. + * Represents the list of series broken down by the dimensions and time frame requested. * * @return dataset */ diff --git a/src/main/java/com/segment/publicapi/models/GetFilterById200Response.java b/src/main/java/com/segment/publicapi/models/GetFilterById200Response.java new file mode 100644 index 00000000..fc89c66b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetFilterById200Response.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetFilterById200Response */ +public class GetFilterById200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetFilterByIdOutput data; + + public GetFilterById200Response() {} + + public GetFilterById200Response data(GetFilterByIdOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetFilterByIdOutput getData() { + return data; + } + + public void setData(GetFilterByIdOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFilterById200Response getFilterById200Response = (GetFilterById200Response) o; + return Objects.equals(this.data, getFilterById200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFilterById200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetFilterById200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetFilterById200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFilterById200Response is not found" + + " in the empty JSON string", + GetFilterById200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetFilterById200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFilterById200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetFilterByIdOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFilterById200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFilterById200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetFilterById200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFilterById200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFilterById200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFilterById200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFilterById200Response + * @throws IOException if the JSON string is invalid with respect to GetFilterById200Response + */ + public static GetFilterById200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFilterById200Response.class); + } + + /** + * Convert an instance of GetFilterById200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetFilterByIdOutput.java b/src/main/java/com/segment/publicapi/models/GetFilterByIdOutput.java new file mode 100644 index 00000000..742903b8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetFilterByIdOutput.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for GetFilterById. */ +public class GetFilterByIdOutput { + public static final String SERIALIZED_NAME_FILTER = "filter"; + + @SerializedName(SERIALIZED_NAME_FILTER) + private Filter filter; + + public GetFilterByIdOutput() {} + + public GetFilterByIdOutput filter(Filter filter) { + + this.filter = filter; + return this; + } + + /** + * Get filter + * + * @return filter + */ + @javax.annotation.Nonnull + public Filter getFilter() { + return filter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFilterByIdOutput getFilterByIdOutput = (GetFilterByIdOutput) o; + return Objects.equals(this.filter, getFilterByIdOutput.filter); + } + + @Override + public int hashCode() { + return Objects.hash(filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFilterByIdOutput {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filter"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetFilterByIdOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetFilterByIdOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetFilterByIdOutput is not found in" + + " the empty JSON string", + GetFilterByIdOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetFilterByIdOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetFilterByIdOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetFilterByIdOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `filter` + Filter.validateJsonElement(jsonObj.get("filter")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFilterByIdOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetFilterByIdOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetFilterByIdOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetFilterByIdOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFilterByIdOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFilterByIdOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFilterByIdOutput + * @throws IOException if the JSON string is invalid with respect to GetFilterByIdOutput + */ + public static GetFilterByIdOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetFilterByIdOutput.class); + } + + /** + * Convert an instance of GetFilterByIdOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java b/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java new file mode 100644 index 00000000..e7eb25f8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListFiltersByIntegrationId200Response */ +public class ListFiltersByIntegrationId200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListFiltersByIntegrationIdOutput data; + + public ListFiltersByIntegrationId200Response() {} + + public ListFiltersByIntegrationId200Response data(ListFiltersByIntegrationIdOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListFiltersByIntegrationIdOutput getData() { + return data; + } + + public void setData(ListFiltersByIntegrationIdOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFiltersByIntegrationId200Response listFiltersByIntegrationId200Response = + (ListFiltersByIntegrationId200Response) o; + return Objects.equals(this.data, listFiltersByIntegrationId200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFiltersByIntegrationId200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListFiltersByIntegrationId200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFiltersByIntegrationId200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListFiltersByIntegrationId200Response" + + " is not found in the empty JSON string", + ListFiltersByIntegrationId200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListFiltersByIntegrationId200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListFiltersByIntegrationId200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListFiltersByIntegrationIdOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFiltersByIntegrationId200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFiltersByIntegrationId200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListFiltersByIntegrationId200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListFiltersByIntegrationId200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFiltersByIntegrationId200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListFiltersByIntegrationId200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFiltersByIntegrationId200Response + * @throws IOException if the JSON string is invalid with respect to + * ListFiltersByIntegrationId200Response + */ + public static ListFiltersByIntegrationId200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListFiltersByIntegrationId200Response.class); + } + + /** + * Convert an instance of ListFiltersByIntegrationId200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java b/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java new file mode 100644 index 00000000..abd423a0 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java @@ -0,0 +1,257 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for ListFiltersByIntegrationId. */ +public class ListFiltersByIntegrationIdOutput { + public static final String SERIALIZED_NAME_FILTERS = "filters"; + + @SerializedName(SERIALIZED_NAME_FILTERS) + private List filters; + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private ListFiltersPaginationOutput pagination; + + public ListFiltersByIntegrationIdOutput() {} + + public ListFiltersByIntegrationIdOutput filters(List filters) { + + this.filters = filters; + return this; + } + + public ListFiltersByIntegrationIdOutput addFiltersItem(Filter filtersItem) { + if (this.filters == null) { + this.filters = new ArrayList<>(); + } + this.filters.add(filtersItem); + return this; + } + + /** + * Filter output. + * + * @return filters + */ + @javax.annotation.Nullable + public List getFilters() { + return filters; + } + + public void setFilters(List filters) { + this.filters = filters; + } + + public ListFiltersByIntegrationIdOutput pagination(ListFiltersPaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + public ListFiltersPaginationOutput getPagination() { + return pagination; + } + + public void setPagination(ListFiltersPaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFiltersByIntegrationIdOutput listFiltersByIntegrationIdOutput = + (ListFiltersByIntegrationIdOutput) o; + return Objects.equals(this.filters, listFiltersByIntegrationIdOutput.filters) + && Objects.equals(this.pagination, listFiltersByIntegrationIdOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(filters, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFiltersByIntegrationIdOutput {\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filters"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListFiltersByIntegrationIdOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFiltersByIntegrationIdOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListFiltersByIntegrationIdOutput is" + + " not found in the empty JSON string", + ListFiltersByIntegrationIdOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListFiltersByIntegrationIdOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListFiltersByIntegrationIdOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + JsonArray jsonArrayfilters = jsonObj.getAsJsonArray("filters"); + if (jsonArrayfilters != null) { + // ensure the json data is an array + if (!jsonObj.get("filters").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filters` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("filters").toString())); + } + + // validate the optional field `filters` (array) + for (int i = 0; i < jsonArrayfilters.size(); i++) { + Filter.validateJsonElement(jsonArrayfilters.get(i)); + } + ; + } + } + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + ListFiltersPaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFiltersByIntegrationIdOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFiltersByIntegrationIdOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListFiltersByIntegrationIdOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFiltersByIntegrationIdOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFiltersByIntegrationIdOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListFiltersByIntegrationIdOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFiltersByIntegrationIdOutput + * @throws IOException if the JSON string is invalid with respect to + * ListFiltersByIntegrationIdOutput + */ + public static ListFiltersByIntegrationIdOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFiltersByIntegrationIdOutput.class); + } + + /** + * Convert an instance of ListFiltersByIntegrationIdOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListFiltersPaginationInput.java new file mode 100644 index 00000000..a1c6cd13 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListFiltersPaginationInput.java @@ -0,0 +1,230 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Pagination for list filters. */ +public class ListFiltersPaginationInput { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private BigDecimal cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public ListFiltersPaginationInput() {} + + public ListFiltersPaginationInput cursor(BigDecimal cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The offset. + * + * @return cursor + */ + @javax.annotation.Nullable + public BigDecimal getCursor() { + return cursor; + } + + public void setCursor(BigDecimal cursor) { + this.cursor = cursor; + } + + public ListFiltersPaginationInput count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 10. + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFiltersPaginationInput listFiltersPaginationInput = (ListFiltersPaginationInput) o; + return Objects.equals(this.cursor, listFiltersPaginationInput.cursor) + && Objects.equals(this.count, listFiltersPaginationInput.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFiltersPaginationInput {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListFiltersPaginationInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFiltersPaginationInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListFiltersPaginationInput is not" + + " found in the empty JSON string", + ListFiltersPaginationInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListFiltersPaginationInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListFiltersPaginationInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListFiltersPaginationInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFiltersPaginationInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFiltersPaginationInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListFiltersPaginationInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFiltersPaginationInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFiltersPaginationInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListFiltersPaginationInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFiltersPaginationInput + * @throws IOException if the JSON string is invalid with respect to ListFiltersPaginationInput + */ + public static ListFiltersPaginationInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFiltersPaginationInput.class); + } + + /** + * Convert an instance of ListFiltersPaginationInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersPaginationOutput.java b/src/main/java/com/segment/publicapi/models/ListFiltersPaginationOutput.java new file mode 100644 index 00000000..fef24704 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListFiltersPaginationOutput.java @@ -0,0 +1,248 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Pagination for list filters. */ +public class ListFiltersPaginationOutput { + public static final String SERIALIZED_NAME_CURRENT = "current"; + + @SerializedName(SERIALIZED_NAME_CURRENT) + private BigDecimal current; + + public static final String SERIALIZED_NAME_NEXT = "next"; + + @SerializedName(SERIALIZED_NAME_NEXT) + private BigDecimal next; + + public static final String SERIALIZED_NAME_TOTAL_ENTRIES = "totalEntries"; + + @SerializedName(SERIALIZED_NAME_TOTAL_ENTRIES) + private BigDecimal totalEntries; + + public ListFiltersPaginationOutput() {} + + public ListFiltersPaginationOutput current(BigDecimal current) { + + this.current = current; + return this; + } + + /** + * Current. + * + * @return current + */ + @javax.annotation.Nullable + public BigDecimal getCurrent() { + return current; + } + + public void setCurrent(BigDecimal current) { + this.current = current; + } + + public ListFiltersPaginationOutput next(BigDecimal next) { + + this.next = next; + return this; + } + + /** + * Next. + * + * @return next + */ + @javax.annotation.Nullable + public BigDecimal getNext() { + return next; + } + + public void setNext(BigDecimal next) { + this.next = next; + } + + public ListFiltersPaginationOutput totalEntries(BigDecimal totalEntries) { + + this.totalEntries = totalEntries; + return this; + } + + /** + * Total entries. + * + * @return totalEntries + */ + @javax.annotation.Nullable + public BigDecimal getTotalEntries() { + return totalEntries; + } + + public void setTotalEntries(BigDecimal totalEntries) { + this.totalEntries = totalEntries; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFiltersPaginationOutput listFiltersPaginationOutput = (ListFiltersPaginationOutput) o; + return Objects.equals(this.current, listFiltersPaginationOutput.current) + && Objects.equals(this.next, listFiltersPaginationOutput.next) + && Objects.equals(this.totalEntries, listFiltersPaginationOutput.totalEntries); + } + + @Override + public int hashCode() { + return Objects.hash(current, next, totalEntries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFiltersPaginationOutput {\n"); + sb.append(" current: ").append(toIndentedString(current)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" totalEntries: ").append(toIndentedString(totalEntries)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("current"); + openapiFields.add("next"); + openapiFields.add("totalEntries"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListFiltersPaginationOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListFiltersPaginationOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListFiltersPaginationOutput is not" + + " found in the empty JSON string", + ListFiltersPaginationOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListFiltersPaginationOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListFiltersPaginationOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFiltersPaginationOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFiltersPaginationOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListFiltersPaginationOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFiltersPaginationOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFiltersPaginationOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListFiltersPaginationOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFiltersPaginationOutput + * @throws IOException if the JSON string is invalid with respect to ListFiltersPaginationOutput + */ + public static ListFiltersPaginationOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFiltersPaginationOutput.class); + } + + /** + * Convert an instance of ListFiltersPaginationOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java index 766d64a1..b72d7436 100644 --- a/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput.java @@ -61,7 +61,7 @@ public ListReverseETLSyncStatusesFromModelAndSubscriptionIdOutput addSyncStatuse } /** - * The reverse ETL sync statuses that were looked up of the subscriptionId. + * The reverse ETL sync statuses that were looked up of the subscription id. * * @return syncStatuses */ diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java index bee34172..11291307 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlPeriodicScheduleConfig.java @@ -43,7 +43,7 @@ public ReverseEtlPeriodicScheduleConfig interval(String interval) { } /** - * Duration is specified as a string, eg: 15m, 3h25m30s. + * Duration is specified as a string, EG: 15m, 3h25m30s. * * @return interval */ diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterById200Response.java b/src/main/java/com/segment/publicapi/models/UpdateFilterById200Response.java new file mode 100644 index 00000000..a03bf7ca --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterById200Response.java @@ -0,0 +1,195 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** UpdateFilterById200Response */ +public class UpdateFilterById200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateFilterByIdOutput data; + + public UpdateFilterById200Response() {} + + public UpdateFilterById200Response data(UpdateFilterByIdOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public UpdateFilterByIdOutput getData() { + return data; + } + + public void setData(UpdateFilterByIdOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateFilterById200Response updateFilterById200Response = (UpdateFilterById200Response) o; + return Objects.equals(this.data, updateFilterById200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateFilterById200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateFilterById200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateFilterById200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateFilterById200Response is not" + + " found in the empty JSON string", + UpdateFilterById200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateFilterById200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateFilterById200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + UpdateFilterByIdOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateFilterById200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateFilterById200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateFilterById200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateFilterById200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateFilterById200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateFilterById200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateFilterById200Response + * @throws IOException if the JSON string is invalid with respect to UpdateFilterById200Response + */ + public static UpdateFilterById200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateFilterById200Response.class); + } + + /** + * Convert an instance of UpdateFilterById200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java new file mode 100644 index 00000000..61e6b84c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java @@ -0,0 +1,473 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input for UpdateFilterById. */ +public class UpdateFilterByIdInput { + public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; + + @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) + private String integrationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_IF = "if"; + + @SerializedName(SERIALIZED_NAME_IF) + private String _if; + + public static final String SERIALIZED_NAME_PROPERTY_DROPS = "propertyDrops"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_DROPS) + private List propertyDrops; + + public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; + + @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) + private List allowProperties; + + public UpdateFilterByIdInput() {} + + public UpdateFilterByIdInput integrationId(String integrationId) { + + this.integrationId = integrationId; + return this; + } + + /** + * The Integration id of the resource. + * + * @return integrationId + */ + @javax.annotation.Nonnull + public String getIntegrationId() { + return integrationId; + } + + public void setIntegrationId(String integrationId) { + this.integrationId = integrationId; + } + + public UpdateFilterByIdInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether the filter is enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateFilterByIdInput drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Whether the event is dropped. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + + public UpdateFilterByIdInput name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the filter. + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateFilterByIdInput description(String description) { + + this.description = description; + return this; + } + + /** + * The description of the filter. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public UpdateFilterByIdInput _if(String _if) { + + this._if = _if; + return this; + } + + /** + * The \"if\" statement for a filter. + * + * @return _if + */ + @javax.annotation.Nullable + public String getIf() { + return _if; + } + + public void setIf(String _if) { + this._if = _if; + } + + public UpdateFilterByIdInput propertyDrops(List propertyDrops) { + + this.propertyDrops = propertyDrops; + return this; + } + + public UpdateFilterByIdInput addPropertyDropsItem(String propertyDropsItem) { + if (this.propertyDrops == null) { + this.propertyDrops = new ArrayList<>(); + } + this.propertyDrops.add(propertyDropsItem); + return this; + } + + /** + * Describes the properties to be dropped on events that match the \"if\" statement. + * + * @return propertyDrops + */ + @javax.annotation.Nullable + public List getPropertyDrops() { + return propertyDrops; + } + + public void setPropertyDrops(List propertyDrops) { + this.propertyDrops = propertyDrops; + } + + public UpdateFilterByIdInput allowProperties(List allowProperties) { + + this.allowProperties = allowProperties; + return this; + } + + public UpdateFilterByIdInput addAllowPropertiesItem(String allowPropertiesItem) { + if (this.allowProperties == null) { + this.allowProperties = new ArrayList<>(); + } + this.allowProperties.add(allowPropertiesItem); + return this; + } + + /** + * Describes the properties allowed on events that match the \"if\" statement. + * + * @return allowProperties + */ + @javax.annotation.Nullable + public List getAllowProperties() { + return allowProperties; + } + + public void setAllowProperties(List allowProperties) { + this.allowProperties = allowProperties; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateFilterByIdInput updateFilterByIdInput = (UpdateFilterByIdInput) o; + return Objects.equals(this.integrationId, updateFilterByIdInput.integrationId) + && Objects.equals(this.enabled, updateFilterByIdInput.enabled) + && Objects.equals(this.drop, updateFilterByIdInput.drop) + && Objects.equals(this.name, updateFilterByIdInput.name) + && Objects.equals(this.description, updateFilterByIdInput.description) + && Objects.equals(this._if, updateFilterByIdInput._if) + && Objects.equals(this.propertyDrops, updateFilterByIdInput.propertyDrops) + && Objects.equals(this.allowProperties, updateFilterByIdInput.allowProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + integrationId, + enabled, + drop, + name, + description, + _if, + propertyDrops, + allowProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateFilterByIdInput {\n"); + sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" propertyDrops: ").append(toIndentedString(propertyDrops)).append("\n"); + sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integrationId"); + openapiFields.add("enabled"); + openapiFields.add("drop"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("if"); + openapiFields.add("propertyDrops"); + openapiFields.add("allowProperties"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("integrationId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateFilterByIdInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateFilterByIdInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateFilterByIdInput is not found in" + + " the empty JSON string", + UpdateFilterByIdInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateFilterByIdInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateFilterByIdInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateFilterByIdInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("integrationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `integrationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("integrationId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if ((jsonObj.get("if") != null && !jsonObj.get("if").isJsonNull()) + && !jsonObj.get("if").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `if` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("if").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("propertyDrops") != null + && !jsonObj.get("propertyDrops").isJsonNull() + && !jsonObj.get("propertyDrops").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `propertyDrops` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("propertyDrops").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowProperties") != null + && !jsonObj.get("allowProperties").isJsonNull() + && !jsonObj.get("allowProperties").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `allowProperties` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("allowProperties").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateFilterByIdInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateFilterByIdInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateFilterByIdInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateFilterByIdInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateFilterByIdInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateFilterByIdInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateFilterByIdInput + * @throws IOException if the JSON string is invalid with respect to UpdateFilterByIdInput + */ + public static UpdateFilterByIdInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateFilterByIdInput.class); + } + + /** + * Convert an instance of UpdateFilterByIdInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterByIdOutput.java b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdOutput.java new file mode 100644 index 00000000..1edaca75 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdOutput.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for UpdateFilterById. */ +public class UpdateFilterByIdOutput { + public static final String SERIALIZED_NAME_FILTER = "filter"; + + @SerializedName(SERIALIZED_NAME_FILTER) + private Filter filter; + + public UpdateFilterByIdOutput() {} + + public UpdateFilterByIdOutput filter(Filter filter) { + + this.filter = filter; + return this; + } + + /** + * Get filter + * + * @return filter + */ + @javax.annotation.Nonnull + public Filter getFilter() { + return filter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateFilterByIdOutput updateFilterByIdOutput = (UpdateFilterByIdOutput) o; + return Objects.equals(this.filter, updateFilterByIdOutput.filter); + } + + @Override + public int hashCode() { + return Objects.hash(filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateFilterByIdOutput {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filter"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateFilterByIdOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateFilterByIdOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateFilterByIdOutput is not found in" + + " the empty JSON string", + UpdateFilterByIdOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateFilterByIdOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateFilterByIdOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateFilterByIdOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `filter` + Filter.validateJsonElement(jsonObj.get("filter")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateFilterByIdOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateFilterByIdOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateFilterByIdOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateFilterByIdOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateFilterByIdOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateFilterByIdOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateFilterByIdOutput + * @throws IOException if the JSON string is invalid with respect to UpdateFilterByIdOutput + */ + public static UpdateFilterByIdOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateFilterByIdOutput.class); + } + + /** + * Convert an instance of UpdateFilterByIdOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From d7cd57203eb0ead055ebc811e9ac7df692f49bb2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Sep 2024 05:20:03 +0000 Subject: [PATCH 342/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6fb94dc6. --- docs/FiltersApi.md | 10 +- .../com/segment/publicapi/api/FiltersApi.java | 101 +++++++++++++----- 2 files changed, 82 insertions(+), 29 deletions(-) diff --git a/docs/FiltersApi.md b/docs/FiltersApi.md index 92f3ec36..2b6028dc 100644 --- a/docs/FiltersApi.md +++ b/docs/FiltersApi.md @@ -18,7 +18,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Filter -Creates a filter. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). +Creates a filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -91,7 +91,7 @@ public class Example { Delete Filter By Id -Deletes a filter by id. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). +Deletes a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -164,7 +164,7 @@ public class Example { Get Filter By Id -Gets a filter by id. +Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -237,7 +237,7 @@ public class Example { List Filters By Integration Id -Lists filters by Integration id. +Lists filters by Integration id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -312,7 +312,7 @@ public class Example { Update Filter By Id -Updates a filter by id. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). +Updates a filter by id and replaces the existing filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). ### Example diff --git a/src/main/java/com/segment/publicapi/api/FiltersApi.java b/src/main/java/com/segment/publicapi/api/FiltersApi.java index 3ef02696..20f29e7b 100644 --- a/src/main/java/com/segment/publicapi/api/FiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/FiltersApi.java @@ -155,8 +155,11 @@ private okhttp3.Call createFilterValidateBeforeCall( } /** - * Create Filter Creates a filter. • When called, this endpoint may generate the `Filter - * Created` event in the [audit trail](/tag/Audit-Trail). + * Create Filter Creates a filter. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out + * to your customer success manager for more information. • When called, this endpoint may + * generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). * * @param createFilterInput (required) * @return CreateFilter200Response @@ -179,8 +182,11 @@ public CreateFilter200Response createFilter(CreateFilterInput createFilterInput) } /** - * Create Filter Creates a filter. • When called, this endpoint may generate the `Filter - * Created` event in the [audit trail](/tag/Audit-Trail). + * Create Filter Creates a filter. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out + * to your customer success manager for more information. • When called, this endpoint may + * generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). * * @param createFilterInput (required) * @return ApiResponse<CreateFilter200Response> @@ -203,8 +209,12 @@ public ApiResponse createFilterWithHttpInfo( } /** - * Create Filter (asynchronously) Creates a filter. • When called, this endpoint may generate - * the `Filter Created` event in the [audit trail](/tag/Audit-Trail). + * Create Filter (asynchronously) Creates a filter. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Filters feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Filter Created` event in the [audit + * trail](/tag/Audit-Trail). * * @param createFilterInput (required) * @param _callback The callback to be executed when the API call finishes @@ -318,8 +328,11 @@ private okhttp3.Call deleteFilterByIdValidateBeforeCall(String id, final ApiCall } /** - * Delete Filter By Id Deletes a filter by id. • When called, this endpoint may generate the - * `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please + * reach out to your customer success manager for more information. • When called, this endpoint + * may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) * @return DeleteFilterById200Response @@ -340,8 +353,11 @@ public DeleteFilterById200Response deleteFilterById(String id) throws ApiExcepti } /** - * Delete Filter By Id Deletes a filter by id. • When called, this endpoint may generate the - * `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please + * reach out to your customer success manager for more information. • When called, this endpoint + * may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) * @return ApiResponse<DeleteFilterById200Response> @@ -364,8 +380,12 @@ public ApiResponse deleteFilterByIdWithHttpInfo(Str } /** - * Delete Filter By Id (asynchronously) Deletes a filter by id. • When called, this endpoint may - * generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * Delete Filter By Id (asynchronously) Deletes a filter by id. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Filters feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Filter Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param id (required) * @param _callback The callback to be executed when the API call finishes @@ -478,7 +498,10 @@ private okhttp3.Call getFilterByIdValidateBeforeCall(String id, final ApiCallbac } /** - * Get Filter By Id Gets a filter by id. + * Get Filter By Id Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out + * to your customer success manager for more information. * * @param id (required) * @return GetFilterById200Response @@ -499,7 +522,10 @@ public GetFilterById200Response getFilterById(String id) throws ApiException { } /** - * Get Filter By Id Gets a filter by id. + * Get Filter By Id Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out + * to your customer success manager for more information. * * @param id (required) * @return ApiResponse<GetFilterById200Response> @@ -522,7 +548,10 @@ public ApiResponse getFilterByIdWithHttpInfo(String id } /** - * Get Filter By Id (asynchronously) Gets a filter by id. + * Get Filter By Id (asynchronously) Gets a filter by id. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Filters feature + * enabled. Please reach out to your customer success manager for more information. * * @param id (required) * @param _callback The callback to be executed when the API call finishes @@ -650,7 +679,11 @@ private okhttp3.Call listFiltersByIntegrationIdValidateBeforeCall( } /** - * List Filters By Integration Id Lists filters by Integration id. + * List Filters By Integration Id Lists filters by Integration id. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Filters feature enabled. Please reach out to your customer success manager for more + * information. * * @param integrationId The integration id used to fetch filters. This parameter exists in * alpha. (required) @@ -675,7 +708,11 @@ public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( } /** - * List Filters By Integration Id Lists filters by Integration id. + * List Filters By Integration Id Lists filters by Integration id. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Filters feature enabled. Please reach out to your customer success manager for more + * information. * * @param integrationId The integration id used to fetch filters. This parameter exists in * alpha. (required) @@ -704,7 +741,11 @@ public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( } /** - * List Filters By Integration Id (asynchronously) Lists filters by Integration id. + * List Filters By Integration Id (asynchronously) Lists filters by Integration id. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Filters feature enabled. Please reach out to your customer success manager + * for more information. * * @param integrationId The integration id used to fetch filters. This parameter exists in * alpha. (required) @@ -833,8 +874,12 @@ private okhttp3.Call updateFilterByIdValidateBeforeCall( } /** - * Update Filter By Id Updates a filter by id. • When called, this endpoint may generate the - * `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + * Update Filter By Id Updates a filter by id and replaces the existing filter. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Filters feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Filter + * Updated` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) * @param updateFilterByIdInput (required) @@ -858,8 +903,12 @@ public UpdateFilterById200Response updateFilterById( } /** - * Update Filter By Id Updates a filter by id. • When called, this endpoint may generate the - * `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + * Update Filter By Id Updates a filter by id and replaces the existing filter. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Filters feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Filter + * Updated` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) * @param updateFilterByIdInput (required) @@ -884,8 +933,12 @@ public ApiResponse updateFilterByIdWithHttpInfo( } /** - * Update Filter By Id (asynchronously) Updates a filter by id. • When called, this endpoint may - * generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). + * Update Filter By Id (asynchronously) Updates a filter by id and replaces the existing filter. + * • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Filters feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Filter + * Updated` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) * @param updateFilterByIdInput (required) From acedac4cdd232a55c9a47928a786cfd9a796fac3 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Sep 2024 15:02:38 +0000 Subject: [PATCH 343/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d3872c96. From 17131ca456411bbd726f0b2afb635222373e6ce8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Sep 2024 17:27:03 +0000 Subject: [PATCH 344/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@428ad8a7. --- docs/{FiltersApi.md => SpaceFiltersApi.md} | 52 ++++++------- .../{FiltersApi.java => SpaceFiltersApi.java} | 76 ++++++++++--------- 2 files changed, 65 insertions(+), 63 deletions(-) rename docs/{FiltersApi.md => SpaceFiltersApi.md} (82%) rename src/main/java/com/segment/publicapi/api/{FiltersApi.java => SpaceFiltersApi.java} (94%) diff --git a/docs/FiltersApi.md b/docs/SpaceFiltersApi.md similarity index 82% rename from docs/FiltersApi.md rename to docs/SpaceFiltersApi.md index 2b6028dc..2969ff6a 100644 --- a/docs/FiltersApi.md +++ b/docs/SpaceFiltersApi.md @@ -1,14 +1,14 @@ -# FiltersApi +# SpaceFiltersApi All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**createFilter**](FiltersApi.md#createFilter) | **POST** /filters | Create Filter | -| [**deleteFilterById**](FiltersApi.md#deleteFilterById) | **DELETE** /filters/{id} | Delete Filter By Id | -| [**getFilterById**](FiltersApi.md#getFilterById) | **GET** /filters/{id} | Get Filter By Id | -| [**listFiltersByIntegrationId**](FiltersApi.md#listFiltersByIntegrationId) | **GET** /filters | List Filters By Integration Id | -| [**updateFilterById**](FiltersApi.md#updateFilterById) | **PATCH** /filters/{id} | Update Filter By Id | +| [**createFilter**](SpaceFiltersApi.md#createFilter) | **POST** /filters | Create Filter | +| [**deleteFilterById**](SpaceFiltersApi.md#deleteFilterById) | **DELETE** /filters/{id} | Delete Filter By Id | +| [**getFilterById**](SpaceFiltersApi.md#getFilterById) | **GET** /filters/{id} | Get Filter By Id | +| [**listFiltersByIntegrationId**](SpaceFiltersApi.md#listFiltersByIntegrationId) | **GET** /filters | List Filters By Integration Id | +| [**updateFilterById**](SpaceFiltersApi.md#updateFilterById) | **PATCH** /filters/{id} | Update Filter By Id | @@ -18,7 +18,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Filter -Creates a filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). +Creates a filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -29,7 +29,7 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.FiltersApi; +import com.segment.publicapi.api.SpaceFiltersApi; public class Example { public static void main(String[] args) { @@ -39,13 +39,13 @@ public class Example { HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); token.setBearerToken("BEARER TOKEN"); - FiltersApi apiInstance = new FiltersApi(defaultClient); + SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); CreateFilterInput createFilterInput = new CreateFilterInput(); // CreateFilterInput | try { CreateFilter200Response result = apiInstance.createFilter(createFilterInput); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FiltersApi#createFilter"); + System.err.println("Exception when calling SpaceFiltersApi#createFilter"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -91,7 +91,7 @@ public class Example { Delete Filter By Id -Deletes a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). +Deletes a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -102,7 +102,7 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.FiltersApi; +import com.segment.publicapi.api.SpaceFiltersApi; public class Example { public static void main(String[] args) { @@ -112,13 +112,13 @@ public class Example { HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); token.setBearerToken("BEARER TOKEN"); - FiltersApi apiInstance = new FiltersApi(defaultClient); + SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); String id = ""; // String | try { DeleteFilterById200Response result = apiInstance.deleteFilterById(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FiltersApi#deleteFilterById"); + System.err.println("Exception when calling SpaceFiltersApi#deleteFilterById"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -164,7 +164,7 @@ public class Example { Get Filter By Id -Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. +Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -175,7 +175,7 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.FiltersApi; +import com.segment.publicapi.api.SpaceFiltersApi; public class Example { public static void main(String[] args) { @@ -185,13 +185,13 @@ public class Example { HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); token.setBearerToken("BEARER TOKEN"); - FiltersApi apiInstance = new FiltersApi(defaultClient); + SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); String id = ""; // String | try { GetFilterById200Response result = apiInstance.getFilterById(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FiltersApi#getFilterById"); + System.err.println("Exception when calling SpaceFiltersApi#getFilterById"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -237,7 +237,7 @@ public class Example { List Filters By Integration Id -Lists filters by Integration id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. +Lists filters by Integration id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -248,7 +248,7 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.FiltersApi; +import com.segment.publicapi.api.SpaceFiltersApi; public class Example { public static void main(String[] args) { @@ -258,14 +258,14 @@ public class Example { HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); token.setBearerToken("BEARER TOKEN"); - FiltersApi apiInstance = new FiltersApi(defaultClient); + SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); String integrationId = ""; // String | The integration id used to fetch filters. This parameter exists in alpha. ListFiltersPaginationInput pagination = new ListFiltersPaginationInput(); // ListFiltersPaginationInput | Pagination parameters. This parameter exists in alpha. try { ListFiltersByIntegrationId200Response result = apiInstance.listFiltersByIntegrationId(integrationId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FiltersApi#listFiltersByIntegrationId"); + System.err.println("Exception when calling SpaceFiltersApi#listFiltersByIntegrationId"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -312,7 +312,7 @@ public class Example { Update Filter By Id -Updates a filter by id and replaces the existing filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). +Updates a filter by id and replaces the existing filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -323,7 +323,7 @@ import com.segment.publicapi.ApiException; import com.segment.publicapi.Configuration; import com.segment.publicapi.auth.*; import com.segment.publicapi.models.*; -import com.segment.publicapi.api.FiltersApi; +import com.segment.publicapi.api.SpaceFiltersApi; public class Example { public static void main(String[] args) { @@ -333,14 +333,14 @@ public class Example { HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); token.setBearerToken("BEARER TOKEN"); - FiltersApi apiInstance = new FiltersApi(defaultClient); + SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); String id = ""; // String | UpdateFilterByIdInput updateFilterByIdInput = new UpdateFilterByIdInput(); // UpdateFilterByIdInput | try { UpdateFilterById200Response result = apiInstance.updateFilterById(id, updateFilterByIdInput); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FiltersApi#updateFilterById"); + System.err.println("Exception when calling SpaceFiltersApi#updateFilterById"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); diff --git a/src/main/java/com/segment/publicapi/api/FiltersApi.java b/src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java similarity index 94% rename from src/main/java/com/segment/publicapi/api/FiltersApi.java rename to src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java index 20f29e7b..e49a37e6 100644 --- a/src/main/java/com/segment/publicapi/api/FiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java @@ -32,16 +32,16 @@ import java.util.List; import java.util.Map; -public class FiltersApi { +public class SpaceFiltersApi { private ApiClient localVarApiClient; private int localHostIndex; private String localCustomBaseUrl; - public FiltersApi() { + public SpaceFiltersApi() { this(Configuration.getDefaultApiClient()); } - public FiltersApi(ApiClient apiClient) { + public SpaceFiltersApi(ApiClient apiClient) { this.localVarApiClient = apiClient; } @@ -157,9 +157,9 @@ private okhttp3.Call createFilterValidateBeforeCall( /** * Create Filter Creates a filter. • This endpoint is in **Alpha** testing. Please submit any * feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out - * to your customer success manager for more information. • When called, this endpoint may - * generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). + * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please + * reach out to your customer success manager for more information. • When called, this endpoint + * may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). * * @param createFilterInput (required) * @return CreateFilter200Response @@ -184,9 +184,9 @@ public CreateFilter200Response createFilter(CreateFilterInput createFilterInput) /** * Create Filter Creates a filter. • This endpoint is in **Alpha** testing. Please submit any * feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out - * to your customer success manager for more information. • When called, this endpoint may - * generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). + * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please + * reach out to your customer success manager for more information. • When called, this endpoint + * may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). * * @param createFilterInput (required) * @return ApiResponse<CreateFilter200Response> @@ -211,9 +211,9 @@ public ApiResponse createFilterWithHttpInfo( /** * Create Filter (asynchronously) Creates a filter. • This endpoint is in **Alpha** testing. * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Filters feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Filter Created` event in the [audit + * successfully call this endpoint, the specified Workspace needs to have the Space Filters + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Filter Created` event in the [audit * trail](/tag/Audit-Trail). * * @param createFilterInput (required) @@ -330,9 +330,10 @@ private okhttp3.Call deleteFilterByIdValidateBeforeCall(String id, final ApiCall /** * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Alpha** testing. Please * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please - * reach out to your customer success manager for more information. • When called, this endpoint - * may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Filter Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param id (required) * @return DeleteFilterById200Response @@ -355,9 +356,10 @@ public DeleteFilterById200Response deleteFilterById(String id) throws ApiExcepti /** * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Alpha** testing. Please * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Filters feature enabled. Please - * reach out to your customer success manager for more information. • When called, this endpoint - * may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). + * call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Filter Deleted` event in the [audit + * trail](/tag/Audit-Trail). * * @param id (required) * @return ApiResponse<DeleteFilterById200Response> @@ -382,9 +384,9 @@ public ApiResponse deleteFilterByIdWithHttpInfo(Str /** * Delete Filter By Id (asynchronously) Deletes a filter by id. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Filters feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Filter Deleted` event in the [audit + * successfully call this endpoint, the specified Workspace needs to have the Space Filters + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Filter Deleted` event in the [audit * trail](/tag/Audit-Trail). * * @param id (required) @@ -500,8 +502,8 @@ private okhttp3.Call getFilterByIdValidateBeforeCall(String id, final ApiCallbac /** * Get Filter By Id Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out - * to your customer success manager for more information. + * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please + * reach out to your customer success manager for more information. * * @param id (required) * @return GetFilterById200Response @@ -524,8 +526,8 @@ public GetFilterById200Response getFilterById(String id) throws ApiException { /** * Get Filter By Id Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Filters feature enabled. Please reach out - * to your customer success manager for more information. + * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please + * reach out to your customer success manager for more information. * * @param id (required) * @return ApiResponse<GetFilterById200Response> @@ -550,8 +552,8 @@ public ApiResponse getFilterByIdWithHttpInfo(String id /** * Get Filter By Id (asynchronously) Gets a filter by id. • This endpoint is in **Alpha** * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Filters feature - * enabled. Please reach out to your customer success manager for more information. + * successfully call this endpoint, the specified Workspace needs to have the Space Filters + * feature enabled. Please reach out to your customer success manager for more information. * * @param id (required) * @param _callback The callback to be executed when the API call finishes @@ -681,7 +683,7 @@ private okhttp3.Call listFiltersByIntegrationIdValidateBeforeCall( /** * List Filters By Integration Id Lists filters by Integration id. • This endpoint is in * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the + * In order to successfully call this endpoint, the specified Workspace needs to have the Space * Filters feature enabled. Please reach out to your customer success manager for more * information. * @@ -710,7 +712,7 @@ public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( /** * List Filters By Integration Id Lists filters by Integration id. • This endpoint is in * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the + * In order to successfully call this endpoint, the specified Workspace needs to have the Space * Filters feature enabled. Please reach out to your customer success manager for more * information. * @@ -744,8 +746,8 @@ public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( * List Filters By Integration Id (asynchronously) Lists filters by Integration id. • This * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Filters feature enabled. Please reach out to your customer success manager - * for more information. + * needs to have the Space Filters feature enabled. Please reach out to your customer success + * manager for more information. * * @param integrationId The integration id used to fetch filters. This parameter exists in * alpha. (required) @@ -877,8 +879,8 @@ private okhttp3.Call updateFilterByIdValidateBeforeCall( * Update Filter By Id Updates a filter by id and replaces the existing filter. • This endpoint * is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Filters feature enabled. Please reach out to your customer success manager - * for more information. • When called, this endpoint may generate the `Filter + * needs to have the Space Filters feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Filter * Updated` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) @@ -906,8 +908,8 @@ public UpdateFilterById200Response updateFilterById( * Update Filter By Id Updates a filter by id and replaces the existing filter. • This endpoint * is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Filters feature enabled. Please reach out to your customer success manager - * for more information. • When called, this endpoint may generate the `Filter + * needs to have the Space Filters feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Filter * Updated` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) @@ -936,8 +938,8 @@ public ApiResponse updateFilterByIdWithHttpInfo( * Update Filter By Id (asynchronously) Updates a filter by id and replaces the existing filter. * • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Filters feature enabled. Please reach out to your customer success manager - * for more information. • When called, this endpoint may generate the `Filter + * needs to have the Space Filters feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Filter * Updated` event in the [audit trail](/tag/Audit-Trail). * * @param id (required) From 09dab36e76f3ae2bc75ea66375799bc875ce11aa Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 11 Sep 2024 18:05:20 +0000 Subject: [PATCH 345/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4af74c84. --- README.md | 8 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 3 + .../com/segment/publicapi/models/Config.java | 85 +++++- .../models/ReverseEtlCronScheduleConfig.java | 248 ++++++++++++++++++ .../models/ReverseEtlScheduleConfig.java | 86 +++++- .../publicapi/models/ScheduleConfig.java | 85 +++++- 9 files changed, 490 insertions(+), 31 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java diff --git a/README.md b/README.md index a4f7cb27..1cf70252 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 54.2.0 +Latest API and SDK version: 54.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 54.2.0 + 54.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:54.2.0" + implementation "com.segment.publicapi:segment-publicapi:54.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-54.2.0.jar` +* `target/segment-publicapi-54.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 94873b40..d483c809 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 54.2.0 + 54.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9f6ad7fe..3344eb27 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 54.2.0 (Java)"); + setUserAgent("Public API SDK 54.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 2f9e98c0..ee0b0c2f 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "54.2.0"; + public static final String VERSION = "54.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 09ec404d..5c2ea9a5 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1320,6 +1320,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseETLSyncStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlCronScheduleConfig + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index b70fcf4a..fed0fbe5 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -46,6 +46,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -78,8 +81,19 @@ public void write(JsonWriter out, Config value) throws IOException { elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -137,6 +151,27 @@ public Config read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } throw new IOException( String.format( @@ -156,6 +191,11 @@ public Config() { super("anyOf", Boolean.TRUE); } + public Config(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + public Config(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -170,6 +210,7 @@ public Config(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -179,8 +220,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -201,16 +242,21 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -242,6 +288,18 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -275,10 +333,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java new file mode 100644 index 00000000..c21c24df --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java @@ -0,0 +1,248 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ReverseEtlCronScheduleConfig */ +public class ReverseEtlCronScheduleConfig { + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private String spec; + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; + + public ReverseEtlCronScheduleConfig() {} + + public ReverseEtlCronScheduleConfig spec(String spec) { + + this.spec = spec; + return this; + } + + /** + * 5 field cron string expression. The cron expression must be larger than 15 minutes. + * + * @return spec + */ + @javax.annotation.Nonnull + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public ReverseEtlCronScheduleConfig timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Timezone for the specified times. + * + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlCronScheduleConfig reverseEtlCronScheduleConfig = + (ReverseEtlCronScheduleConfig) o; + return Objects.equals(this.spec, reverseEtlCronScheduleConfig.spec) + && Objects.equals(this.timezone, reverseEtlCronScheduleConfig.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(spec, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlCronScheduleConfig {\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("spec"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("spec"); + openapiRequiredFields.add("timezone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlCronScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlCronScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlCronScheduleConfig is not" + + " found in the empty JSON string", + ReverseEtlCronScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlCronScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlCronScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlCronScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("spec").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spec` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spec").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlCronScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlCronScheduleConfig' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlCronScheduleConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlCronScheduleConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlCronScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlCronScheduleConfig + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlCronScheduleConfig + */ + public static ReverseEtlCronScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlCronScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlCronScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java index 656a63b4..47909984 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java @@ -47,6 +47,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -80,8 +83,19 @@ public void write(JsonWriter out, ReverseEtlScheduleConfig value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -139,6 +153,27 @@ public ReverseEtlScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } throw new IOException( String.format( @@ -159,6 +194,11 @@ public ReverseEtlScheduleConfig() { super("anyOf", Boolean.FALSE); } + public ReverseEtlScheduleConfig(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + public ReverseEtlScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.FALSE); setActualInstance(o); @@ -173,6 +213,7 @@ public ReverseEtlScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -182,8 +223,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -199,16 +240,21 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -240,6 +286,18 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -273,10 +331,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" - + " schemas: ReverseEtlPeriodicScheduleConfig," + + " schemas: ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java index 3b527dda..8796cd2a 100644 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -46,6 +46,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -78,8 +81,19 @@ public void write(JsonWriter out, ScheduleConfig value) throws IOException { elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -137,6 +151,27 @@ public ScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + ScheduleConfig ret = new ScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } throw new IOException( String.format( @@ -157,6 +192,11 @@ public ScheduleConfig() { super("anyOf", Boolean.TRUE); } + public ScheduleConfig(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -171,6 +211,7 @@ public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -180,8 +221,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -202,16 +243,21 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -243,6 +289,18 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -276,10 +334,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for ScheduleConfig with anyOf schemas:" - + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", From 73537b1c1c707e3408ca792590b837eaf3ba6d72 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Sep 2024 19:23:05 +0000 Subject: [PATCH 346/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@334ba264. From fde0ced57b0ce8fd54f92964a5258022afa8b6c6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 19 Sep 2024 18:30:16 +0000 Subject: [PATCH 347/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7808dfd9. --- README.md | 8 +- docs/SpaceFiltersApi.md | 64 ++--- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 19 +- .../publicapi/api/SpaceFiltersApi.java | 223 ++++++++-------- .../com/segment/publicapi/models/Config.java | 85 +----- ...a => CreateFilterForSpace200Response.java} | 67 ++--- ...ut.java => CreateFilterForSpaceInput.java} | 183 ++++++------- ...t.java => CreateFilterForSpaceOutput.java} | 55 ++-- .../com/segment/publicapi/models/Filter.java | 104 ++++---- ...va => ListFiltersForSpace200Response.java} | 70 +++-- ...ut.java => ListFiltersForSpaceOutput.java} | 65 +++-- .../models/ReverseEtlCronScheduleConfig.java | 248 ------------------ .../models/ReverseEtlScheduleConfig.java | 86 +----- .../publicapi/models/ScheduleConfig.java | 85 +----- .../models/UpdateFilterByIdInput.java | 104 ++++---- 18 files changed, 514 insertions(+), 958 deletions(-) rename src/main/java/com/segment/publicapi/models/{CreateFilter200Response.java => CreateFilterForSpace200Response.java} (70%) rename src/main/java/com/segment/publicapi/models/{CreateFilterInput.java => CreateFilterForSpaceInput.java} (76%) rename src/main/java/com/segment/publicapi/models/{CreateFilterOutput.java => CreateFilterForSpaceOutput.java} (77%) rename src/main/java/com/segment/publicapi/models/{ListFiltersByIntegrationId200Response.java => ListFiltersForSpace200Response.java} (68%) rename src/main/java/com/segment/publicapi/models/{ListFiltersByIntegrationIdOutput.java => ListFiltersForSpaceOutput.java} (76%) delete mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java diff --git a/README.md b/README.md index 1cf70252..a4f7cb27 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 54.3.0 +Latest API and SDK version: 54.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 54.3.0 + 54.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:54.3.0" + implementation "com.segment.publicapi:segment-publicapi:54.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-54.3.0.jar` +* `target/segment-publicapi-54.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/SpaceFiltersApi.md b/docs/SpaceFiltersApi.md index 2969ff6a..3c2cf5a4 100644 --- a/docs/SpaceFiltersApi.md +++ b/docs/SpaceFiltersApi.md @@ -4,21 +4,21 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**createFilter**](SpaceFiltersApi.md#createFilter) | **POST** /filters | Create Filter | +| [**createFilterForSpace**](SpaceFiltersApi.md#createFilterForSpace) | **POST** /filters | Create Filter for Space | | [**deleteFilterById**](SpaceFiltersApi.md#deleteFilterById) | **DELETE** /filters/{id} | Delete Filter By Id | | [**getFilterById**](SpaceFiltersApi.md#getFilterById) | **GET** /filters/{id} | Get Filter By Id | -| [**listFiltersByIntegrationId**](SpaceFiltersApi.md#listFiltersByIntegrationId) | **GET** /filters | List Filters By Integration Id | +| [**listFiltersForSpace**](SpaceFiltersApi.md#listFiltersForSpace) | **GET** /filters | List Filters for Space | | [**updateFilterById**](SpaceFiltersApi.md#updateFilterById) | **PATCH** /filters/{id} | Update Filter By Id | -## Operation: createFilter +## Operation: createFilterForSpace -> CreateFilter200Response createFilter(createFilterInput) +> CreateFilterForSpace200Response createFilterForSpace(createFilterForSpaceInput) -Create Filter +Create Filter for Space -Creates a filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). +Creates a filter for a space. A space filter applies to events coming from all Sources connected to a space. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -40,12 +40,12 @@ public class Example { token.setBearerToken("BEARER TOKEN"); SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); - CreateFilterInput createFilterInput = new CreateFilterInput(); // CreateFilterInput | + CreateFilterForSpaceInput createFilterForSpaceInput = new CreateFilterForSpaceInput(); // CreateFilterForSpaceInput | try { - CreateFilter200Response result = apiInstance.createFilter(createFilterInput); + CreateFilterForSpace200Response result = apiInstance.createFilterForSpace(createFilterForSpaceInput); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling SpaceFiltersApi#createFilter"); + System.err.println("Exception when calling SpaceFiltersApi#createFilterForSpace"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -60,11 +60,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **createFilterInput** | [**CreateFilterInput**](CreateFilterInput.md)| | | +| **createFilterForSpaceInput** | [**CreateFilterForSpaceInput**](CreateFilterForSpaceInput.md)| | | ### Return type -[**CreateFilter200Response**](CreateFilter200Response.md) +[**CreateFilterForSpace200Response**](CreateFilterForSpace200Response.md) ### Authorization @@ -72,8 +72,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -91,7 +91,7 @@ public class Example { Delete Filter By Id -Deletes a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). +Deletes a filter by id. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Deleted` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -146,7 +146,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -164,7 +164,7 @@ public class Example { Get Filter By Id -Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. +Gets a filter by id. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -219,7 +219,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -231,13 +231,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listFiltersByIntegrationId +## Operation: listFiltersForSpace -> ListFiltersByIntegrationId200Response listFiltersByIntegrationId(integrationId, pagination) +> ListFiltersForSpace200Response listFiltersForSpace(integrationId, pagination) -List Filters By Integration Id +List Filters for Space -Lists filters by Integration id. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. +Lists filters for a space. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -259,13 +259,13 @@ public class Example { token.setBearerToken("BEARER TOKEN"); SpaceFiltersApi apiInstance = new SpaceFiltersApi(defaultClient); - String integrationId = ""; // String | The integration id used to fetch filters. This parameter exists in alpha. - ListFiltersPaginationInput pagination = new ListFiltersPaginationInput(); // ListFiltersPaginationInput | Pagination parameters. This parameter exists in alpha. + String integrationId = ""; // String | The Space Id for which to fetch filters This parameter exists in beta. + ListFiltersPaginationInput pagination = new ListFiltersPaginationInput(); // ListFiltersPaginationInput | Pagination parameters. This parameter exists in beta. try { - ListFiltersByIntegrationId200Response result = apiInstance.listFiltersByIntegrationId(integrationId, pagination); + ListFiltersForSpace200Response result = apiInstance.listFiltersForSpace(integrationId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling SpaceFiltersApi#listFiltersByIntegrationId"); + System.err.println("Exception when calling SpaceFiltersApi#listFiltersForSpace"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -280,12 +280,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **integrationId** | **String**| The integration id used to fetch filters. This parameter exists in alpha. | | -| **pagination** | [**ListFiltersPaginationInput**](.md)| Pagination parameters. This parameter exists in alpha. | [optional] | +| **integrationId** | **String**| The Space Id for which to fetch filters This parameter exists in beta. | | +| **pagination** | [**ListFiltersPaginationInput**](.md)| Pagination parameters. This parameter exists in beta. | [optional] | ### Return type -[**ListFiltersByIntegrationId200Response**](ListFiltersByIntegrationId200Response.md) +[**ListFiltersForSpace200Response**](ListFiltersForSpace200Response.md) ### Authorization @@ -294,7 +294,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -312,7 +312,7 @@ public class Example { Update Filter By Id -Updates a filter by id and replaces the existing filter. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). +Updates a filter by id and replaces the existing filter. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Filter Updated` event in the [audit trail](/tag/Audit-Trail). ### Example @@ -368,8 +368,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details diff --git a/pom.xml b/pom.xml index d483c809..94873b40 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 54.3.0 + 54.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 3344eb27..9f6ad7fe 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 54.3.0 (Java)"); + setUserAgent("Public API SDK 54.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ee0b0c2f..2f9e98c0 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "54.3.0"; + public static final String VERSION = "54.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 5c2ea9a5..f16a4cec 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -250,9 +250,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateEdgeFunctionsAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateFilter200Response - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFilterForDestination200Response .CustomTypeAdapterFactory()); @@ -263,9 +260,14 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateFilterForDestinationV1Output .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateFilterInput.CustomTypeAdapterFactory()); + new com.segment.publicapi.models.CreateFilterForSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateFilterForSpaceInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateFilterOutput.CustomTypeAdapterFactory()); + new com.segment.publicapi.models.CreateFilterForSpaceOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateFunction200Response .CustomTypeAdapterFactory()); @@ -908,10 +910,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.ListDestinationsV1Output .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListFiltersByIntegrationId200Response + new com.segment.publicapi.models.ListFiltersForSpace200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListFiltersByIntegrationIdOutput + new com.segment.publicapi.models.ListFiltersForSpaceOutput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListFiltersFromDestination200Response @@ -1320,9 +1322,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseETLSyncStatus.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReverseEtlCronScheduleConfig - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java b/src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java index e49a37e6..c1180690 100644 --- a/src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java +++ b/src/main/java/com/segment/publicapi/api/SpaceFiltersApi.java @@ -18,11 +18,11 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.models.CreateFilter200Response; -import com.segment.publicapi.models.CreateFilterInput; +import com.segment.publicapi.models.CreateFilterForSpace200Response; +import com.segment.publicapi.models.CreateFilterForSpaceInput; import com.segment.publicapi.models.DeleteFilterById200Response; import com.segment.publicapi.models.GetFilterById200Response; -import com.segment.publicapi.models.ListFiltersByIntegrationId200Response; +import com.segment.publicapi.models.ListFiltersForSpace200Response; import com.segment.publicapi.models.ListFiltersPaginationInput; import com.segment.publicapi.models.UpdateFilterById200Response; import com.segment.publicapi.models.UpdateFilterByIdInput; @@ -70,9 +70,9 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for createFilter + * Build call for createFilterForSpace * - * @param createFilterInput (required) + * @param createFilterForSpaceInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -85,8 +85,9 @@ public void setCustomBaseUrl(String customBaseUrl) { * 429 Too many requests - * */ - public okhttp3.Call createFilterCall( - CreateFilterInput createFilterInput, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createFilterForSpaceCall( + CreateFilterForSpaceInput createFilterForSpaceInput, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -100,7 +101,7 @@ public okhttp3.Call createFilterCall( basePath = null; } - Object localVarPostBody = createFilterInput; + Object localVarPostBody = createFilterForSpaceInput; // create path and map variables String localVarPath = "/filters"; @@ -112,14 +113,18 @@ public okhttp3.Call createFilterCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String[] localVarContentTypes = { + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -142,27 +147,29 @@ public okhttp3.Call createFilterCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call createFilterValidateBeforeCall( - CreateFilterInput createFilterInput, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'createFilterInput' is set - if (createFilterInput == null) { + private okhttp3.Call createFilterForSpaceValidateBeforeCall( + CreateFilterForSpaceInput createFilterForSpaceInput, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createFilterForSpaceInput' is set + if (createFilterForSpaceInput == null) { throw new ApiException( - "Missing the required parameter 'createFilterInput' when calling" - + " createFilter(Async)"); + "Missing the required parameter 'createFilterForSpaceInput' when calling" + + " createFilterForSpace(Async)"); } - return createFilterCall(createFilterInput, _callback); + return createFilterForSpaceCall(createFilterForSpaceInput, _callback); } /** - * Create Filter Creates a filter. • This endpoint is in **Alpha** testing. Please submit any - * feedback by sending an email to friends@segment.com. • In order to successfully call this + * Create Filter for Space Creates a filter for a space. A space filter applies to events coming + * from all Sources connected to a space. • This endpoint is in **Beta** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please * reach out to your customer success manager for more information. • When called, this endpoint * may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). * - * @param createFilterInput (required) - * @return CreateFilter200Response + * @param createFilterForSpaceInput (required) + * @return CreateFilterForSpace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -174,22 +181,23 @@ private okhttp3.Call createFilterValidateBeforeCall( * 429 Too many requests - * */ - public CreateFilter200Response createFilter(CreateFilterInput createFilterInput) - throws ApiException { - ApiResponse localVarResp = - createFilterWithHttpInfo(createFilterInput); + public CreateFilterForSpace200Response createFilterForSpace( + CreateFilterForSpaceInput createFilterForSpaceInput) throws ApiException { + ApiResponse localVarResp = + createFilterForSpaceWithHttpInfo(createFilterForSpaceInput); return localVarResp.getData(); } /** - * Create Filter Creates a filter. • This endpoint is in **Alpha** testing. Please submit any - * feedback by sending an email to friends@segment.com. • In order to successfully call this + * Create Filter for Space Creates a filter for a space. A space filter applies to events coming + * from all Sources connected to a space. • This endpoint is in **Beta** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please * reach out to your customer success manager for more information. • When called, this endpoint * may generate the `Filter Created` event in the [audit trail](/tag/Audit-Trail). * - * @param createFilterInput (required) - * @return ApiResponse<CreateFilter200Response> + * @param createFilterForSpaceInput (required) + * @return ApiResponse<CreateFilterForSpace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -201,22 +209,24 @@ public CreateFilter200Response createFilter(CreateFilterInput createFilterInput) * 429 Too many requests - * */ - public ApiResponse createFilterWithHttpInfo( - CreateFilterInput createFilterInput) throws ApiException { - okhttp3.Call localVarCall = createFilterValidateBeforeCall(createFilterInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse createFilterForSpaceWithHttpInfo( + CreateFilterForSpaceInput createFilterForSpaceInput) throws ApiException { + okhttp3.Call localVarCall = + createFilterForSpaceValidateBeforeCall(createFilterForSpaceInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Create Filter (asynchronously) Creates a filter. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to + * Create Filter for Space (asynchronously) Creates a filter for a space. A space filter applies + * to events coming from all Sources connected to a space. • This endpoint is in **Beta** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Space Filters * feature enabled. Please reach out to your customer success manager for more information. • * When called, this endpoint may generate the `Filter Created` event in the [audit * trail](/tag/Audit-Trail). * - * @param createFilterInput (required) + * @param createFilterForSpaceInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -230,13 +240,14 @@ public ApiResponse createFilterWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call createFilterAsync( - CreateFilterInput createFilterInput, - final ApiCallback _callback) + public okhttp3.Call createFilterForSpaceAsync( + CreateFilterForSpaceInput createFilterForSpaceInput, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createFilterValidateBeforeCall(createFilterInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = + createFilterForSpaceValidateBeforeCall(createFilterForSpaceInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -286,7 +297,9 @@ public okhttp3.Call deleteFilterByIdCall(String id, final ApiCallback _callback) Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -328,7 +341,7 @@ private okhttp3.Call deleteFilterByIdValidateBeforeCall(String id, final ApiCall } /** - * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Alpha** testing. Please + * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Beta** testing. Please * submit any feedback by sending an email to friends@segment.com. • In order to successfully * call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. * Please reach out to your customer success manager for more information. • When called, this @@ -354,7 +367,7 @@ public DeleteFilterById200Response deleteFilterById(String id) throws ApiExcepti } /** - * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Alpha** testing. Please + * Delete Filter By Id Deletes a filter by id. • This endpoint is in **Beta** testing. Please * submit any feedback by sending an email to friends@segment.com. • In order to successfully * call this endpoint, the specified Workspace needs to have the Space Filters feature enabled. * Please reach out to your customer success manager for more information. • When called, this @@ -382,7 +395,7 @@ public ApiResponse deleteFilterByIdWithHttpInfo(Str } /** - * Delete Filter By Id (asynchronously) Deletes a filter by id. • This endpoint is in **Alpha** + * Delete Filter By Id (asynchronously) Deletes a filter by id. • This endpoint is in **Beta** * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Space Filters * feature enabled. Please reach out to your customer success manager for more information. • @@ -458,7 +471,9 @@ public okhttp3.Call getFilterByIdCall(String id, final ApiCallback _callback) Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -500,7 +515,7 @@ private okhttp3.Call getFilterByIdValidateBeforeCall(String id, final ApiCallbac } /** - * Get Filter By Id Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit + * Get Filter By Id Gets a filter by id. • This endpoint is in **Beta** testing. Please submit * any feedback by sending an email to friends@segment.com. • In order to successfully call this * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please * reach out to your customer success manager for more information. @@ -524,7 +539,7 @@ public GetFilterById200Response getFilterById(String id) throws ApiException { } /** - * Get Filter By Id Gets a filter by id. • This endpoint is in **Alpha** testing. Please submit + * Get Filter By Id Gets a filter by id. • This endpoint is in **Beta** testing. Please submit * any feedback by sending an email to friends@segment.com. • In order to successfully call this * endpoint, the specified Workspace needs to have the Space Filters feature enabled. Please * reach out to your customer success manager for more information. @@ -550,7 +565,7 @@ public ApiResponse getFilterByIdWithHttpInfo(String id } /** - * Get Filter By Id (asynchronously) Gets a filter by id. • This endpoint is in **Alpha** + * Get Filter By Id (asynchronously) Gets a filter by id. • This endpoint is in **Beta** * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Space Filters * feature enabled. Please reach out to your customer success manager for more information. @@ -579,11 +594,11 @@ public okhttp3.Call getFilterByIdAsync( } /** - * Build call for listFiltersByIntegrationId + * Build call for listFiltersForSpace * - * @param integrationId The integration id used to fetch filters. This parameter exists in - * alpha. (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (optional) + * @param integrationId The Space Id for which to fetch filters This parameter exists in beta. + * (required) + * @param pagination Pagination parameters. This parameter exists in beta. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -596,7 +611,7 @@ public okhttp3.Call getFilterByIdAsync( * 429 Too many requests - * */ - public okhttp3.Call listFiltersByIntegrationIdCall( + public okhttp3.Call listFiltersForSpaceCall( String integrationId, ListFiltersPaginationInput pagination, final ApiCallback _callback) @@ -635,7 +650,9 @@ public okhttp3.Call listFiltersByIntegrationIdCall( } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -665,7 +682,7 @@ public okhttp3.Call listFiltersByIntegrationIdCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listFiltersByIntegrationIdValidateBeforeCall( + private okhttp3.Call listFiltersForSpaceValidateBeforeCall( String integrationId, ListFiltersPaginationInput pagination, final ApiCallback _callback) @@ -674,23 +691,22 @@ private okhttp3.Call listFiltersByIntegrationIdValidateBeforeCall( if (integrationId == null) { throw new ApiException( "Missing the required parameter 'integrationId' when calling" - + " listFiltersByIntegrationId(Async)"); + + " listFiltersForSpace(Async)"); } - return listFiltersByIntegrationIdCall(integrationId, pagination, _callback); + return listFiltersForSpaceCall(integrationId, pagination, _callback); } /** - * List Filters By Integration Id Lists filters by Integration id. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the Space - * Filters feature enabled. Please reach out to your customer success manager for more - * information. + * List Filters for Space Lists filters for a space. • This endpoint is in **Beta** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Space Filters + * feature enabled. Please reach out to your customer success manager for more information. * - * @param integrationId The integration id used to fetch filters. This parameter exists in - * alpha. (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (optional) - * @return ListFiltersByIntegrationId200Response + * @param integrationId The Space Id for which to fetch filters This parameter exists in beta. + * (required) + * @param pagination Pagination parameters. This parameter exists in beta. (optional) + * @return ListFiltersForSpace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -702,24 +718,23 @@ private okhttp3.Call listFiltersByIntegrationIdValidateBeforeCall( * 429 Too many requests - * */ - public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( + public ListFiltersForSpace200Response listFiltersForSpace( String integrationId, ListFiltersPaginationInput pagination) throws ApiException { - ApiResponse localVarResp = - listFiltersByIntegrationIdWithHttpInfo(integrationId, pagination); + ApiResponse localVarResp = + listFiltersForSpaceWithHttpInfo(integrationId, pagination); return localVarResp.getData(); } /** - * List Filters By Integration Id Lists filters by Integration id. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the Space - * Filters feature enabled. Please reach out to your customer success manager for more - * information. + * List Filters for Space Lists filters for a space. • This endpoint is in **Beta** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Space Filters + * feature enabled. Please reach out to your customer success manager for more information. * - * @param integrationId The integration id used to fetch filters. This parameter exists in - * alpha. (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (optional) - * @return ApiResponse<ListFiltersByIntegrationId200Response> + * @param integrationId The Space Id for which to fetch filters This parameter exists in beta. + * (required) + * @param pagination Pagination parameters. This parameter exists in beta. (optional) + * @return ApiResponse<ListFiltersForSpace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -731,27 +746,24 @@ public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( * 429 Too many requests - * */ - public ApiResponse - listFiltersByIntegrationIdWithHttpInfo( - String integrationId, ListFiltersPaginationInput pagination) - throws ApiException { + public ApiResponse listFiltersForSpaceWithHttpInfo( + String integrationId, ListFiltersPaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = - listFiltersByIntegrationIdValidateBeforeCall(integrationId, pagination, null); - Type localVarReturnType = - new TypeToken() {}.getType(); + listFiltersForSpaceValidateBeforeCall(integrationId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Filters By Integration Id (asynchronously) Lists filters by Integration id. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Space Filters feature enabled. Please reach out to your customer success - * manager for more information. + * List Filters for Space (asynchronously) Lists filters for a space. • This endpoint is in + * **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Space + * Filters feature enabled. Please reach out to your customer success manager for more + * information. * - * @param integrationId The integration id used to fetch filters. This parameter exists in - * alpha. (required) - * @param pagination Pagination parameters. This parameter exists in alpha. (optional) + * @param integrationId The Space Id for which to fetch filters This parameter exists in beta. + * (required) + * @param pagination Pagination parameters. This parameter exists in beta. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -765,16 +777,15 @@ public ListFiltersByIntegrationId200Response listFiltersByIntegrationId( * 429 Too many requests - * */ - public okhttp3.Call listFiltersByIntegrationIdAsync( + public okhttp3.Call listFiltersForSpaceAsync( String integrationId, ListFiltersPaginationInput pagination, - final ApiCallback _callback) + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listFiltersByIntegrationIdValidateBeforeCall(integrationId, pagination, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); + listFiltersForSpaceValidateBeforeCall(integrationId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -826,14 +837,18 @@ public okhttp3.Call updateFilterByIdCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String[] localVarContentTypes = { + "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json" + }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -877,7 +892,7 @@ private okhttp3.Call updateFilterByIdValidateBeforeCall( /** * Update Filter By Id Updates a filter by id and replaces the existing filter. • This endpoint - * is in **Alpha** testing. Please submit any feedback by sending an email to + * is in **Beta** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Space Filters feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Filter @@ -906,7 +921,7 @@ public UpdateFilterById200Response updateFilterById( /** * Update Filter By Id Updates a filter by id and replaces the existing filter. • This endpoint - * is in **Alpha** testing. Please submit any feedback by sending an email to + * is in **Beta** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Space Filters feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Filter @@ -936,7 +951,7 @@ public ApiResponse updateFilterByIdWithHttpInfo( /** * Update Filter By Id (asynchronously) Updates a filter by id and replaces the existing filter. - * • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Space Filters feature enabled. Please reach out to your customer success * manager for more information. • When called, this endpoint may generate the `Filter diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index fed0fbe5..b70fcf4a 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -46,9 +46,6 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -81,19 +78,8 @@ public void write(JsonWriter out, Config value) throws IOException { elementAdapter.write(out, element); return; } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -151,27 +137,6 @@ public Config read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } throw new IOException( String.format( @@ -191,11 +156,6 @@ public Config() { super("anyOf", Boolean.TRUE); } - public Config(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - public Config(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -210,7 +170,6 @@ public Config(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -220,8 +179,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -242,21 +201,16 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ReverseEtlCronScheduleConfig) { - super.setActualInstance(instance); - return; - } - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -288,18 +242,6 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } - /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` - */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - /** * Validates the JSON Element and throws an exception if issues found * @@ -333,21 +275,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } - // validate the json string with ReverseEtlCronScheduleConfig - try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", - e.getMessage())); - // continue to the next one - } throw new IOException( String.format( "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/CreateFilter200Response.java b/src/main/java/com/segment/publicapi/models/CreateFilterForSpace200Response.java similarity index 70% rename from src/main/java/com/segment/publicapi/models/CreateFilter200Response.java rename to src/main/java/com/segment/publicapi/models/CreateFilterForSpace200Response.java index 6afb6664..587158e9 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilter200Response.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForSpace200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** CreateFilter200Response */ -public class CreateFilter200Response { +/** CreateFilterForSpace200Response */ +public class CreateFilterForSpace200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private CreateFilterOutput data; + private CreateFilterForSpaceOutput data; - public CreateFilter200Response() {} + public CreateFilterForSpace200Response() {} - public CreateFilter200Response data(CreateFilterOutput data) { + public CreateFilterForSpace200Response data(CreateFilterForSpaceOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public CreateFilter200Response data(CreateFilterOutput data) { * @return data */ @javax.annotation.Nullable - public CreateFilterOutput getData() { + public CreateFilterForSpaceOutput getData() { return data; } - public void setData(CreateFilterOutput data) { + public void setData(CreateFilterForSpaceOutput data) { this.data = data; } @@ -64,8 +64,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateFilter200Response createFilter200Response = (CreateFilter200Response) o; - return Objects.equals(this.data, createFilter200Response.data); + CreateFilterForSpace200Response createFilterForSpace200Response = + (CreateFilterForSpace200Response) o; + return Objects.equals(this.data, createFilterForSpace200Response.data); } @Override @@ -76,7 +77,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateFilter200Response {\n"); + sb.append("class CreateFilterForSpace200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -109,35 +110,36 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateFilter200Response + * @throws IOException if the JSON Element is invalid with respect to + * CreateFilterForSpace200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CreateFilter200Response.openapiRequiredFields + if (!CreateFilterForSpace200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CreateFilter200Response is not found" - + " in the empty JSON string", - CreateFilter200Response.openapiRequiredFields.toString())); + "The required field(s) %s in CreateFilterForSpace200Response is not" + + " found in the empty JSON string", + CreateFilterForSpace200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!CreateFilter200Response.openapiFields.contains(entry.getKey())) { + if (!CreateFilterForSpace200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `CreateFilter200Response` properties. JSON: %s", + + " `CreateFilterForSpace200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CreateFilterOutput.validateJsonElement(jsonObj.get("data")); + CreateFilterForSpaceOutput.validateJsonElement(jsonObj.get("data")); } } @@ -145,25 +147,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFilter200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFilter200Response' and its + if (!CreateFilterForSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterForSpace200Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateFilter200Response.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateFilterForSpace200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateFilter200Response value) + public void write(JsonWriter out, CreateFilterForSpace200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CreateFilter200Response read(JsonReader in) throws IOException { + public CreateFilterForSpace200Response read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -173,18 +177,19 @@ public CreateFilter200Response read(JsonReader in) throws IOException { } /** - * Create an instance of CreateFilter200Response given an JSON string + * Create an instance of CreateFilterForSpace200Response given an JSON string * * @param jsonString JSON string - * @return An instance of CreateFilter200Response - * @throws IOException if the JSON string is invalid with respect to CreateFilter200Response + * @return An instance of CreateFilterForSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateFilterForSpace200Response */ - public static CreateFilter200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFilter200Response.class); + public static CreateFilterForSpace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterForSpace200Response.class); } /** - * Convert an instance of CreateFilter200Response to an JSON string + * Convert an instance of CreateFilterForSpace200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterInput.java b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java similarity index 76% rename from src/main/java/com/segment/publicapi/models/CreateFilterInput.java rename to src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java index 76a52c5b..6f6f7693 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java @@ -30,7 +30,7 @@ import java.util.Set; /** Input for CreateFilter. */ -public class CreateFilterInput { +public class CreateFilterForSpaceInput { public static final String SERIALIZED_NAME_INTEGRATION_ID = "integrationId"; @SerializedName(SERIALIZED_NAME_INTEGRATION_ID) @@ -41,11 +41,6 @@ public class CreateFilterInput { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public static final String SERIALIZED_NAME_DROP = "drop"; - - @SerializedName(SERIALIZED_NAME_DROP) - private Boolean drop; - public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -61,26 +56,31 @@ public class CreateFilterInput { @SerializedName(SERIALIZED_NAME_IF) private String _if; - public static final String SERIALIZED_NAME_PROPERTY_DROPS = "propertyDrops"; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; - @SerializedName(SERIALIZED_NAME_PROPERTY_DROPS) - private List propertyDrops; + public static final String SERIALIZED_NAME_DROP_PROPERTIES = "dropProperties"; + + @SerializedName(SERIALIZED_NAME_DROP_PROPERTIES) + private List dropProperties; public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) private List allowProperties; - public CreateFilterInput() {} + public CreateFilterForSpaceInput() {} - public CreateFilterInput integrationId(String integrationId) { + public CreateFilterForSpaceInput integrationId(String integrationId) { this.integrationId = integrationId; return this; } /** - * The Integration id of the resource. + * The Space id to filer on. * * @return integrationId */ @@ -93,7 +93,7 @@ public void setIntegrationId(String integrationId) { this.integrationId = integrationId; } - public CreateFilterInput enabled(Boolean enabled) { + public CreateFilterForSpaceInput enabled(Boolean enabled) { this.enabled = enabled; return this; @@ -113,27 +113,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public CreateFilterInput drop(Boolean drop) { - - this.drop = drop; - return this; - } - - /** - * Whether the event is dropped. - * - * @return drop - */ - @javax.annotation.Nullable - public Boolean getDrop() { - return drop; - } - - public void setDrop(Boolean drop) { - this.drop = drop; - } - - public CreateFilterInput name(String name) { + public CreateFilterForSpaceInput name(String name) { this.name = name; return this; @@ -153,7 +133,7 @@ public void setName(String name) { this.name = name; } - public CreateFilterInput description(String description) { + public CreateFilterForSpaceInput description(String description) { this.description = description; return this; @@ -173,7 +153,7 @@ public void setDescription(String description) { this.description = description; } - public CreateFilterInput _if(String _if) { + public CreateFilterForSpaceInput _if(String _if) { this._if = _if; return this; @@ -193,41 +173,61 @@ public void setIf(String _if) { this._if = _if; } - public CreateFilterInput propertyDrops(List propertyDrops) { + public CreateFilterForSpaceInput drop(Boolean drop) { - this.propertyDrops = propertyDrops; + this.drop = drop; return this; } - public CreateFilterInput addPropertyDropsItem(String propertyDropsItem) { - if (this.propertyDrops == null) { - this.propertyDrops = new ArrayList<>(); + /** + * Whether the event is dropped. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + + public CreateFilterForSpaceInput dropProperties(List dropProperties) { + + this.dropProperties = dropProperties; + return this; + } + + public CreateFilterForSpaceInput addDropPropertiesItem(String dropPropertiesItem) { + if (this.dropProperties == null) { + this.dropProperties = new ArrayList<>(); } - this.propertyDrops.add(propertyDropsItem); + this.dropProperties.add(dropPropertiesItem); return this; } /** * Describes the properties to be dropped on events that match the \"if\" statement. * - * @return propertyDrops + * @return dropProperties */ @javax.annotation.Nullable - public List getPropertyDrops() { - return propertyDrops; + public List getDropProperties() { + return dropProperties; } - public void setPropertyDrops(List propertyDrops) { - this.propertyDrops = propertyDrops; + public void setDropProperties(List dropProperties) { + this.dropProperties = dropProperties; } - public CreateFilterInput allowProperties(List allowProperties) { + public CreateFilterForSpaceInput allowProperties(List allowProperties) { this.allowProperties = allowProperties; return this; } - public CreateFilterInput addAllowPropertiesItem(String allowPropertiesItem) { + public CreateFilterForSpaceInput addAllowPropertiesItem(String allowPropertiesItem) { if (this.allowProperties == null) { this.allowProperties = new ArrayList<>(); } @@ -257,15 +257,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateFilterInput createFilterInput = (CreateFilterInput) o; - return Objects.equals(this.integrationId, createFilterInput.integrationId) - && Objects.equals(this.enabled, createFilterInput.enabled) - && Objects.equals(this.drop, createFilterInput.drop) - && Objects.equals(this.name, createFilterInput.name) - && Objects.equals(this.description, createFilterInput.description) - && Objects.equals(this._if, createFilterInput._if) - && Objects.equals(this.propertyDrops, createFilterInput.propertyDrops) - && Objects.equals(this.allowProperties, createFilterInput.allowProperties); + CreateFilterForSpaceInput createFilterForSpaceInput = (CreateFilterForSpaceInput) o; + return Objects.equals(this.integrationId, createFilterForSpaceInput.integrationId) + && Objects.equals(this.enabled, createFilterForSpaceInput.enabled) + && Objects.equals(this.name, createFilterForSpaceInput.name) + && Objects.equals(this.description, createFilterForSpaceInput.description) + && Objects.equals(this._if, createFilterForSpaceInput._if) + && Objects.equals(this.drop, createFilterForSpaceInput.drop) + && Objects.equals(this.dropProperties, createFilterForSpaceInput.dropProperties) + && Objects.equals(this.allowProperties, createFilterForSpaceInput.allowProperties); } @Override @@ -273,25 +273,25 @@ public int hashCode() { return Objects.hash( integrationId, enabled, - drop, name, description, _if, - propertyDrops, + drop, + dropProperties, allowProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateFilterInput {\n"); + sb.append("class CreateFilterForSpaceInput {\n"); sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" propertyDrops: ").append(toIndentedString(propertyDrops)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -316,11 +316,11 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("integrationId"); openapiFields.add("enabled"); - openapiFields.add("drop"); openapiFields.add("name"); openapiFields.add("description"); openapiFields.add("if"); - openapiFields.add("propertyDrops"); + openapiFields.add("drop"); + openapiFields.add("dropProperties"); openapiFields.add("allowProperties"); // a set of required properties/fields (JSON key names) @@ -334,34 +334,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateFilterInput + * @throws IOException if the JSON Element is invalid with respect to CreateFilterForSpaceInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CreateFilterInput.openapiRequiredFields + if (!CreateFilterForSpaceInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CreateFilterInput is not found in the" - + " empty JSON string", - CreateFilterInput.openapiRequiredFields.toString())); + "The required field(s) %s in CreateFilterForSpaceInput is not found" + + " in the empty JSON string", + CreateFilterForSpaceInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!CreateFilterInput.openapiFields.contains(entry.getKey())) { + if (!CreateFilterForSpaceInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `CreateFilterInput` properties. JSON: %s", + + " `CreateFilterForSpaceInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFilterInput.openapiRequiredFields) { + for (String requiredField : CreateFilterForSpaceInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -400,14 +400,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("if").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("propertyDrops") != null - && !jsonObj.get("propertyDrops").isJsonNull() - && !jsonObj.get("propertyDrops").isJsonArray()) { + if (jsonObj.get("dropProperties") != null + && !jsonObj.get("dropProperties").isJsonNull() + && !jsonObj.get("dropProperties").isJsonArray()) { throw new IllegalArgumentException( String.format( - "Expected the field `propertyDrops` to be an array in the JSON string" + "Expected the field `dropProperties` to be an array in the JSON string" + " but got `%s`", - jsonObj.get("propertyDrops").toString())); + jsonObj.get("dropProperties").toString())); } // ensure the optional json data is an array if present if (jsonObj.get("allowProperties") != null @@ -425,24 +425,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFilterInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFilterInput' and its subtypes + if (!CreateFilterForSpaceInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterForSpaceInput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateFilterInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFilterForSpaceInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateFilterInput value) + public void write(JsonWriter out, CreateFilterForSpaceInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CreateFilterInput read(JsonReader in) throws IOException { + public CreateFilterForSpaceInput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -452,18 +453,18 @@ public CreateFilterInput read(JsonReader in) throws IOException { } /** - * Create an instance of CreateFilterInput given an JSON string + * Create an instance of CreateFilterForSpaceInput given an JSON string * * @param jsonString JSON string - * @return An instance of CreateFilterInput - * @throws IOException if the JSON string is invalid with respect to CreateFilterInput + * @return An instance of CreateFilterForSpaceInput + * @throws IOException if the JSON string is invalid with respect to CreateFilterForSpaceInput */ - public static CreateFilterInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFilterInput.class); + public static CreateFilterForSpaceInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterForSpaceInput.class); } /** - * Convert an instance of CreateFilterInput to an JSON string + * Convert an instance of CreateFilterForSpaceInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterOutput.java b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceOutput.java similarity index 77% rename from src/main/java/com/segment/publicapi/models/CreateFilterOutput.java rename to src/main/java/com/segment/publicapi/models/CreateFilterForSpaceOutput.java index b15d2c92..56b87d51 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterOutput.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceOutput.java @@ -28,15 +28,15 @@ import java.util.Set; /** Output for CreateFilter. */ -public class CreateFilterOutput { +public class CreateFilterForSpaceOutput { public static final String SERIALIZED_NAME_FILTER = "filter"; @SerializedName(SERIALIZED_NAME_FILTER) private Filter filter; - public CreateFilterOutput() {} + public CreateFilterForSpaceOutput() {} - public CreateFilterOutput filter(Filter filter) { + public CreateFilterForSpaceOutput filter(Filter filter) { this.filter = filter; return this; @@ -64,8 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateFilterOutput createFilterOutput = (CreateFilterOutput) o; - return Objects.equals(this.filter, createFilterOutput.filter); + CreateFilterForSpaceOutput createFilterForSpaceOutput = (CreateFilterForSpaceOutput) o; + return Objects.equals(this.filter, createFilterForSpaceOutput.filter); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateFilterOutput {\n"); + sb.append("class CreateFilterForSpaceOutput {\n"); sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,34 +110,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateFilterOutput + * @throws IOException if the JSON Element is invalid with respect to CreateFilterForSpaceOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CreateFilterOutput.openapiRequiredFields + if (!CreateFilterForSpaceOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CreateFilterOutput is not found in the" - + " empty JSON string", - CreateFilterOutput.openapiRequiredFields.toString())); + "The required field(s) %s in CreateFilterForSpaceOutput is not" + + " found in the empty JSON string", + CreateFilterForSpaceOutput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!CreateFilterOutput.openapiFields.contains(entry.getKey())) { + if (!CreateFilterForSpaceOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `CreateFilterOutput` properties. JSON: %s", + + " `CreateFilterForSpaceOutput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateFilterOutput.openapiRequiredFields) { + for (String requiredField : CreateFilterForSpaceOutput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -154,24 +154,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateFilterOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateFilterOutput' and its subtypes + if (!CreateFilterForSpaceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateFilterForSpaceOutput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateFilterOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateFilterForSpaceOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateFilterOutput value) + public void write(JsonWriter out, CreateFilterForSpaceOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CreateFilterOutput read(JsonReader in) throws IOException { + public CreateFilterForSpaceOutput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -181,18 +182,18 @@ public CreateFilterOutput read(JsonReader in) throws IOException { } /** - * Create an instance of CreateFilterOutput given an JSON string + * Create an instance of CreateFilterForSpaceOutput given an JSON string * * @param jsonString JSON string - * @return An instance of CreateFilterOutput - * @throws IOException if the JSON string is invalid with respect to CreateFilterOutput + * @return An instance of CreateFilterForSpaceOutput + * @throws IOException if the JSON string is invalid with respect to CreateFilterForSpaceOutput */ - public static CreateFilterOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateFilterOutput.class); + public static CreateFilterForSpaceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateFilterForSpaceOutput.class); } /** - * Convert an instance of CreateFilterOutput to an JSON string + * Convert an instance of CreateFilterForSpaceOutput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index b4f000a5..a650b1dd 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -51,11 +51,6 @@ public class Filter { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public static final String SERIALIZED_NAME_DROP = "drop"; - - @SerializedName(SERIALIZED_NAME_DROP) - private Boolean drop; - public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -71,10 +66,15 @@ public class Filter { @SerializedName(SERIALIZED_NAME_IF) private String _if; - public static final String SERIALIZED_NAME_PROPERTY_DROPS = "propertyDrops"; + public static final String SERIALIZED_NAME_DROP = "drop"; - @SerializedName(SERIALIZED_NAME_PROPERTY_DROPS) - private List propertyDrops; + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + + public static final String SERIALIZED_NAME_DROP_PROPERTIES = "dropProperties"; + + @SerializedName(SERIALIZED_NAME_DROP_PROPERTIES) + private List dropProperties; public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; @@ -163,26 +163,6 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public Filter drop(Boolean drop) { - - this.drop = drop; - return this; - } - - /** - * Whether the event is dropped. - * - * @return drop - */ - @javax.annotation.Nullable - public Boolean getDrop() { - return drop; - } - - public void setDrop(Boolean drop) { - this.drop = drop; - } - public Filter name(String name) { this.name = name; @@ -243,32 +223,52 @@ public void setIf(String _if) { this._if = _if; } - public Filter propertyDrops(List propertyDrops) { + public Filter drop(Boolean drop) { - this.propertyDrops = propertyDrops; + this.drop = drop; return this; } - public Filter addPropertyDropsItem(String propertyDropsItem) { - if (this.propertyDrops == null) { - this.propertyDrops = new ArrayList<>(); + /** + * Whether the event is dropped. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + + public Filter dropProperties(List dropProperties) { + + this.dropProperties = dropProperties; + return this; + } + + public Filter addDropPropertiesItem(String dropPropertiesItem) { + if (this.dropProperties == null) { + this.dropProperties = new ArrayList<>(); } - this.propertyDrops.add(propertyDropsItem); + this.dropProperties.add(dropPropertiesItem); return this; } /** * Describes the properties to be dropped on events that match the \"if\" statement. * - * @return propertyDrops + * @return dropProperties */ @javax.annotation.Nullable - public List getPropertyDrops() { - return propertyDrops; + public List getDropProperties() { + return dropProperties; } - public void setPropertyDrops(List propertyDrops) { - this.propertyDrops = propertyDrops; + public void setDropProperties(List dropProperties) { + this.dropProperties = dropProperties; } public Filter allowProperties(List allowProperties) { @@ -312,11 +312,11 @@ public boolean equals(Object o) { && Objects.equals(this.workspaceId, filter.workspaceId) && Objects.equals(this.integrationId, filter.integrationId) && Objects.equals(this.enabled, filter.enabled) - && Objects.equals(this.drop, filter.drop) && Objects.equals(this.name, filter.name) && Objects.equals(this.description, filter.description) && Objects.equals(this._if, filter._if) - && Objects.equals(this.propertyDrops, filter.propertyDrops) + && Objects.equals(this.drop, filter.drop) + && Objects.equals(this.dropProperties, filter.dropProperties) && Objects.equals(this.allowProperties, filter.allowProperties); } @@ -327,11 +327,11 @@ public int hashCode() { workspaceId, integrationId, enabled, - drop, name, description, _if, - propertyDrops, + drop, + dropProperties, allowProperties); } @@ -343,11 +343,11 @@ public String toString() { sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" propertyDrops: ").append(toIndentedString(propertyDrops)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -374,11 +374,11 @@ private String toIndentedString(Object o) { openapiFields.add("workspaceId"); openapiFields.add("integrationId"); openapiFields.add("enabled"); - openapiFields.add("drop"); openapiFields.add("name"); openapiFields.add("description"); openapiFields.add("if"); - openapiFields.add("propertyDrops"); + openapiFields.add("drop"); + openapiFields.add("dropProperties"); openapiFields.add("allowProperties"); // a set of required properties/fields (JSON key names) @@ -474,14 +474,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("if").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("propertyDrops") != null - && !jsonObj.get("propertyDrops").isJsonNull() - && !jsonObj.get("propertyDrops").isJsonArray()) { + if (jsonObj.get("dropProperties") != null + && !jsonObj.get("dropProperties").isJsonNull() + && !jsonObj.get("dropProperties").isJsonArray()) { throw new IllegalArgumentException( String.format( - "Expected the field `propertyDrops` to be an array in the JSON string" + "Expected the field `dropProperties` to be an array in the JSON string" + " but got `%s`", - jsonObj.get("propertyDrops").toString())); + jsonObj.get("dropProperties").toString())); } // ensure the optional json data is an array if present if (jsonObj.get("allowProperties") != null diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java b/src/main/java/com/segment/publicapi/models/ListFiltersForSpace200Response.java similarity index 68% rename from src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java rename to src/main/java/com/segment/publicapi/models/ListFiltersForSpace200Response.java index e7eb25f8..fec1030f 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationId200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersForSpace200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** ListFiltersByIntegrationId200Response */ -public class ListFiltersByIntegrationId200Response { +/** ListFiltersForSpace200Response */ +public class ListFiltersForSpace200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListFiltersByIntegrationIdOutput data; + private ListFiltersForSpaceOutput data; - public ListFiltersByIntegrationId200Response() {} + public ListFiltersForSpace200Response() {} - public ListFiltersByIntegrationId200Response data(ListFiltersByIntegrationIdOutput data) { + public ListFiltersForSpace200Response data(ListFiltersForSpaceOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public ListFiltersByIntegrationId200Response data(ListFiltersByIntegrationIdOutp * @return data */ @javax.annotation.Nullable - public ListFiltersByIntegrationIdOutput getData() { + public ListFiltersForSpaceOutput getData() { return data; } - public void setData(ListFiltersByIntegrationIdOutput data) { + public void setData(ListFiltersForSpaceOutput data) { this.data = data; } @@ -64,9 +64,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ListFiltersByIntegrationId200Response listFiltersByIntegrationId200Response = - (ListFiltersByIntegrationId200Response) o; - return Objects.equals(this.data, listFiltersByIntegrationId200Response.data); + ListFiltersForSpace200Response listFiltersForSpace200Response = + (ListFiltersForSpace200Response) o; + return Objects.equals(this.data, listFiltersForSpace200Response.data); } @Override @@ -77,7 +77,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ListFiltersByIntegrationId200Response {\n"); + sb.append("class ListFiltersForSpace200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -111,37 +111,35 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * ListFiltersByIntegrationId200Response + * ListFiltersForSpace200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ListFiltersByIntegrationId200Response.openapiRequiredFields + if (!ListFiltersForSpace200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ListFiltersByIntegrationId200Response" - + " is not found in the empty JSON string", - ListFiltersByIntegrationId200Response.openapiRequiredFields - .toString())); + "The required field(s) %s in ListFiltersForSpace200Response is not" + + " found in the empty JSON string", + ListFiltersForSpace200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ListFiltersByIntegrationId200Response.openapiFields.contains(entry.getKey())) { + if (!ListFiltersForSpace200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ListFiltersByIntegrationId200Response` properties. JSON:" - + " %s", + + " `ListFiltersForSpace200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ListFiltersByIntegrationIdOutput.validateJsonElement(jsonObj.get("data")); + ListFiltersForSpaceOutput.validateJsonElement(jsonObj.get("data")); } } @@ -149,27 +147,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListFiltersByIntegrationId200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListFiltersByIntegrationId200Response' - // and its subtypes + if (!ListFiltersForSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFiltersForSpace200Response' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(ListFiltersByIntegrationId200Response.class)); + this, TypeToken.get(ListFiltersForSpace200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, ListFiltersByIntegrationId200Response value) + public void write(JsonWriter out, ListFiltersForSpace200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ListFiltersByIntegrationId200Response read(JsonReader in) + public ListFiltersForSpace200Response read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); @@ -180,20 +177,19 @@ public ListFiltersByIntegrationId200Response read(JsonReader in) } /** - * Create an instance of ListFiltersByIntegrationId200Response given an JSON string + * Create an instance of ListFiltersForSpace200Response given an JSON string * * @param jsonString JSON string - * @return An instance of ListFiltersByIntegrationId200Response + * @return An instance of ListFiltersForSpace200Response * @throws IOException if the JSON string is invalid with respect to - * ListFiltersByIntegrationId200Response + * ListFiltersForSpace200Response */ - public static ListFiltersByIntegrationId200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, ListFiltersByIntegrationId200Response.class); + public static ListFiltersForSpace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFiltersForSpace200Response.class); } /** - * Convert an instance of ListFiltersByIntegrationId200Response to an JSON string + * Convert an instance of ListFiltersForSpace200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java b/src/main/java/com/segment/publicapi/models/ListFiltersForSpaceOutput.java similarity index 76% rename from src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java rename to src/main/java/com/segment/publicapi/models/ListFiltersForSpaceOutput.java index abd423a0..6105815e 100644 --- a/src/main/java/com/segment/publicapi/models/ListFiltersByIntegrationIdOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListFiltersForSpaceOutput.java @@ -31,7 +31,7 @@ import java.util.Set; /** Output for ListFiltersByIntegrationId. */ -public class ListFiltersByIntegrationIdOutput { +public class ListFiltersForSpaceOutput { public static final String SERIALIZED_NAME_FILTERS = "filters"; @SerializedName(SERIALIZED_NAME_FILTERS) @@ -42,15 +42,15 @@ public class ListFiltersByIntegrationIdOutput { @SerializedName(SERIALIZED_NAME_PAGINATION) private ListFiltersPaginationOutput pagination; - public ListFiltersByIntegrationIdOutput() {} + public ListFiltersForSpaceOutput() {} - public ListFiltersByIntegrationIdOutput filters(List filters) { + public ListFiltersForSpaceOutput filters(List filters) { this.filters = filters; return this; } - public ListFiltersByIntegrationIdOutput addFiltersItem(Filter filtersItem) { + public ListFiltersForSpaceOutput addFiltersItem(Filter filtersItem) { if (this.filters == null) { this.filters = new ArrayList<>(); } @@ -72,7 +72,7 @@ public void setFilters(List filters) { this.filters = filters; } - public ListFiltersByIntegrationIdOutput pagination(ListFiltersPaginationOutput pagination) { + public ListFiltersForSpaceOutput pagination(ListFiltersPaginationOutput pagination) { this.pagination = pagination; return this; @@ -100,10 +100,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ListFiltersByIntegrationIdOutput listFiltersByIntegrationIdOutput = - (ListFiltersByIntegrationIdOutput) o; - return Objects.equals(this.filters, listFiltersByIntegrationIdOutput.filters) - && Objects.equals(this.pagination, listFiltersByIntegrationIdOutput.pagination); + ListFiltersForSpaceOutput listFiltersForSpaceOutput = (ListFiltersForSpaceOutput) o; + return Objects.equals(this.filters, listFiltersForSpaceOutput.filters) + && Objects.equals(this.pagination, listFiltersForSpaceOutput.pagination); } @Override @@ -114,7 +113,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ListFiltersByIntegrationIdOutput {\n"); + sb.append("class ListFiltersForSpaceOutput {\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -149,29 +148,28 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListFiltersByIntegrationIdOutput + * @throws IOException if the JSON Element is invalid with respect to ListFiltersForSpaceOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ListFiltersByIntegrationIdOutput.openapiRequiredFields + if (!ListFiltersForSpaceOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ListFiltersByIntegrationIdOutput is" - + " not found in the empty JSON string", - ListFiltersByIntegrationIdOutput.openapiRequiredFields.toString())); + "The required field(s) %s in ListFiltersForSpaceOutput is not found" + + " in the empty JSON string", + ListFiltersForSpaceOutput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ListFiltersByIntegrationIdOutput.openapiFields.contains(entry.getKey())) { + if (!ListFiltersForSpaceOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ListFiltersByIntegrationIdOutput` properties. JSON: %s", + + " `ListFiltersForSpaceOutput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -205,27 +203,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListFiltersByIntegrationIdOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListFiltersByIntegrationIdOutput' and - // its subtypes + if (!ListFiltersForSpaceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFiltersForSpaceOutput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListFiltersByIntegrationIdOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListFiltersForSpaceOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ListFiltersByIntegrationIdOutput value) + public void write(JsonWriter out, ListFiltersForSpaceOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ListFiltersByIntegrationIdOutput read(JsonReader in) - throws IOException { + public ListFiltersForSpaceOutput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -235,19 +231,18 @@ public ListFiltersByIntegrationIdOutput read(JsonReader in) } /** - * Create an instance of ListFiltersByIntegrationIdOutput given an JSON string + * Create an instance of ListFiltersForSpaceOutput given an JSON string * * @param jsonString JSON string - * @return An instance of ListFiltersByIntegrationIdOutput - * @throws IOException if the JSON string is invalid with respect to - * ListFiltersByIntegrationIdOutput + * @return An instance of ListFiltersForSpaceOutput + * @throws IOException if the JSON string is invalid with respect to ListFiltersForSpaceOutput */ - public static ListFiltersByIntegrationIdOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListFiltersByIntegrationIdOutput.class); + public static ListFiltersForSpaceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFiltersForSpaceOutput.class); } /** - * Convert an instance of ListFiltersByIntegrationIdOutput to an JSON string + * Convert an instance of ListFiltersForSpaceOutput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java deleted file mode 100644 index c21c24df..00000000 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ReverseEtlCronScheduleConfig */ -public class ReverseEtlCronScheduleConfig { - public static final String SERIALIZED_NAME_SPEC = "spec"; - - @SerializedName(SERIALIZED_NAME_SPEC) - private String spec; - - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - - @SerializedName(SERIALIZED_NAME_TIMEZONE) - private String timezone; - - public ReverseEtlCronScheduleConfig() {} - - public ReverseEtlCronScheduleConfig spec(String spec) { - - this.spec = spec; - return this; - } - - /** - * 5 field cron string expression. The cron expression must be larger than 15 minutes. - * - * @return spec - */ - @javax.annotation.Nonnull - public String getSpec() { - return spec; - } - - public void setSpec(String spec) { - this.spec = spec; - } - - public ReverseEtlCronScheduleConfig timezone(String timezone) { - - this.timezone = timezone; - return this; - } - - /** - * Timezone for the specified times. - * - * @return timezone - */ - @javax.annotation.Nonnull - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReverseEtlCronScheduleConfig reverseEtlCronScheduleConfig = - (ReverseEtlCronScheduleConfig) o; - return Objects.equals(this.spec, reverseEtlCronScheduleConfig.spec) - && Objects.equals(this.timezone, reverseEtlCronScheduleConfig.timezone); - } - - @Override - public int hashCode() { - return Objects.hash(spec, timezone); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReverseEtlCronScheduleConfig {\n"); - sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("spec"); - openapiFields.add("timezone"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("spec"); - openapiRequiredFields.add("timezone"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReverseEtlCronScheduleConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReverseEtlCronScheduleConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReverseEtlCronScheduleConfig is not" - + " found in the empty JSON string", - ReverseEtlCronScheduleConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReverseEtlCronScheduleConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReverseEtlCronScheduleConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReverseEtlCronScheduleConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("spec").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spec` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spec").toString())); - } - if (!jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `timezone` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("timezone").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReverseEtlCronScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReverseEtlCronScheduleConfig' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReverseEtlCronScheduleConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReverseEtlCronScheduleConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReverseEtlCronScheduleConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReverseEtlCronScheduleConfig - * @throws IOException if the JSON string is invalid with respect to - * ReverseEtlCronScheduleConfig - */ - public static ReverseEtlCronScheduleConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReverseEtlCronScheduleConfig.class); - } - - /** - * Convert an instance of ReverseEtlCronScheduleConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java index 47909984..656a63b4 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java @@ -47,9 +47,6 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -83,19 +80,8 @@ public void write(JsonWriter out, ReverseEtlScheduleConfig value) elementAdapter.write(out, element); return; } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -153,27 +139,6 @@ public ReverseEtlScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } throw new IOException( String.format( @@ -194,11 +159,6 @@ public ReverseEtlScheduleConfig() { super("anyOf", Boolean.FALSE); } - public ReverseEtlScheduleConfig(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - public ReverseEtlScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.FALSE); setActualInstance(o); @@ -213,7 +173,6 @@ public ReverseEtlScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -223,8 +182,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -240,21 +199,16 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ReverseEtlCronScheduleConfig) { - super.setActualInstance(instance); - return; - } - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -286,18 +240,6 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } - /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` - */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - /** * Validates the JSON Element and throws an exception if issues found * @@ -331,22 +273,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } - // validate the json string with ReverseEtlCronScheduleConfig - try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", - e.getMessage())); - // continue to the next one - } throw new IOException( String.format( "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" - + " schemas: ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," + + " schemas: ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java index 8796cd2a..3b527dda 100644 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -46,9 +46,6 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -81,19 +78,8 @@ public void write(JsonWriter out, ScheduleConfig value) throws IOException { elementAdapter.write(out, element); return; } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -151,27 +137,6 @@ public ScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - ScheduleConfig ret = new ScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } throw new IOException( String.format( @@ -192,11 +157,6 @@ public ScheduleConfig() { super("anyOf", Boolean.TRUE); } - public ScheduleConfig(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -211,7 +171,6 @@ public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -221,8 +180,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -243,21 +202,16 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ReverseEtlCronScheduleConfig) { - super.setActualInstance(instance); - return; - } - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -289,18 +243,6 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } - /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` - */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - /** * Validates the JSON Element and throws an exception if issues found * @@ -334,21 +276,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } - // validate the json string with ReverseEtlCronScheduleConfig - try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", - e.getMessage())); - // continue to the next one - } throw new IOException( String.format( "The JSON string is invalid for ScheduleConfig with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java index 61e6b84c..e6899100 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java @@ -41,11 +41,6 @@ public class UpdateFilterByIdInput { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public static final String SERIALIZED_NAME_DROP = "drop"; - - @SerializedName(SERIALIZED_NAME_DROP) - private Boolean drop; - public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -61,10 +56,15 @@ public class UpdateFilterByIdInput { @SerializedName(SERIALIZED_NAME_IF) private String _if; - public static final String SERIALIZED_NAME_PROPERTY_DROPS = "propertyDrops"; + public static final String SERIALIZED_NAME_DROP = "drop"; - @SerializedName(SERIALIZED_NAME_PROPERTY_DROPS) - private List propertyDrops; + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + + public static final String SERIALIZED_NAME_DROP_PROPERTIES = "dropProperties"; + + @SerializedName(SERIALIZED_NAME_DROP_PROPERTIES) + private List dropProperties; public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; @@ -113,26 +113,6 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public UpdateFilterByIdInput drop(Boolean drop) { - - this.drop = drop; - return this; - } - - /** - * Whether the event is dropped. - * - * @return drop - */ - @javax.annotation.Nullable - public Boolean getDrop() { - return drop; - } - - public void setDrop(Boolean drop) { - this.drop = drop; - } - public UpdateFilterByIdInput name(String name) { this.name = name; @@ -193,32 +173,52 @@ public void setIf(String _if) { this._if = _if; } - public UpdateFilterByIdInput propertyDrops(List propertyDrops) { + public UpdateFilterByIdInput drop(Boolean drop) { - this.propertyDrops = propertyDrops; + this.drop = drop; return this; } - public UpdateFilterByIdInput addPropertyDropsItem(String propertyDropsItem) { - if (this.propertyDrops == null) { - this.propertyDrops = new ArrayList<>(); + /** + * Whether the event is dropped. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + + public UpdateFilterByIdInput dropProperties(List dropProperties) { + + this.dropProperties = dropProperties; + return this; + } + + public UpdateFilterByIdInput addDropPropertiesItem(String dropPropertiesItem) { + if (this.dropProperties == null) { + this.dropProperties = new ArrayList<>(); } - this.propertyDrops.add(propertyDropsItem); + this.dropProperties.add(dropPropertiesItem); return this; } /** * Describes the properties to be dropped on events that match the \"if\" statement. * - * @return propertyDrops + * @return dropProperties */ @javax.annotation.Nullable - public List getPropertyDrops() { - return propertyDrops; + public List getDropProperties() { + return dropProperties; } - public void setPropertyDrops(List propertyDrops) { - this.propertyDrops = propertyDrops; + public void setDropProperties(List dropProperties) { + this.dropProperties = dropProperties; } public UpdateFilterByIdInput allowProperties(List allowProperties) { @@ -260,11 +260,11 @@ public boolean equals(Object o) { UpdateFilterByIdInput updateFilterByIdInput = (UpdateFilterByIdInput) o; return Objects.equals(this.integrationId, updateFilterByIdInput.integrationId) && Objects.equals(this.enabled, updateFilterByIdInput.enabled) - && Objects.equals(this.drop, updateFilterByIdInput.drop) && Objects.equals(this.name, updateFilterByIdInput.name) && Objects.equals(this.description, updateFilterByIdInput.description) && Objects.equals(this._if, updateFilterByIdInput._if) - && Objects.equals(this.propertyDrops, updateFilterByIdInput.propertyDrops) + && Objects.equals(this.drop, updateFilterByIdInput.drop) + && Objects.equals(this.dropProperties, updateFilterByIdInput.dropProperties) && Objects.equals(this.allowProperties, updateFilterByIdInput.allowProperties); } @@ -273,11 +273,11 @@ public int hashCode() { return Objects.hash( integrationId, enabled, - drop, name, description, _if, - propertyDrops, + drop, + dropProperties, allowProperties); } @@ -287,11 +287,11 @@ public String toString() { sb.append("class UpdateFilterByIdInput {\n"); sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); - sb.append(" propertyDrops: ").append(toIndentedString(propertyDrops)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); + sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); sb.append("}"); return sb.toString(); @@ -316,11 +316,11 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("integrationId"); openapiFields.add("enabled"); - openapiFields.add("drop"); openapiFields.add("name"); openapiFields.add("description"); openapiFields.add("if"); - openapiFields.add("propertyDrops"); + openapiFields.add("drop"); + openapiFields.add("dropProperties"); openapiFields.add("allowProperties"); // a set of required properties/fields (JSON key names) @@ -400,14 +400,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("if").toString())); } // ensure the optional json data is an array if present - if (jsonObj.get("propertyDrops") != null - && !jsonObj.get("propertyDrops").isJsonNull() - && !jsonObj.get("propertyDrops").isJsonArray()) { + if (jsonObj.get("dropProperties") != null + && !jsonObj.get("dropProperties").isJsonNull() + && !jsonObj.get("dropProperties").isJsonArray()) { throw new IllegalArgumentException( String.format( - "Expected the field `propertyDrops` to be an array in the JSON string" + "Expected the field `dropProperties` to be an array in the JSON string" + " but got `%s`", - jsonObj.get("propertyDrops").toString())); + jsonObj.get("dropProperties").toString())); } // ensure the optional json data is an array if present if (jsonObj.get("allowProperties") != null From 1142e8ae55a150c1ddde35f9c34f044e33995726 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 20 Sep 2024 20:14:37 +0000 Subject: [PATCH 348/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7808dfd9. From b0588c87bdc29309496d8a3cb48d02560db348c5 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 23 Sep 2024 20:53:13 +0000 Subject: [PATCH 349/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7a467631. From e1dc24b5b02e05185097d6c07d9ba64d0422d2f8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 23 Sep 2024 21:01:47 +0000 Subject: [PATCH 350/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@448dafdc. From 5e224403c421310636f41cbeee9168b63f4f7e61 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 25 Sep 2024 04:04:43 +0000 Subject: [PATCH 351/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9e9dd1be. --- .../models/CreateFilterForSpaceInput.java | 2 +- .../com/segment/publicapi/models/Filter.java | 78 ++++++++++++++++++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java index 6f6f7693..2990b636 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java @@ -80,7 +80,7 @@ public CreateFilterForSpaceInput integrationId(String integrationId) { } /** - * The Space id to filer on. + * The Space id to filter on. * * @return integrationId */ diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index a650b1dd..42e72e56 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -81,6 +81,16 @@ public class Filter { @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) private List allowProperties; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + public Filter() {} public Filter id(String id) { @@ -299,6 +309,46 @@ public void setAllowProperties(List allowProperties) { this.allowProperties = allowProperties; } + public Filter createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp of this filter's creation. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Filter updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp of this filter's last change. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -317,7 +367,9 @@ public boolean equals(Object o) { && Objects.equals(this._if, filter._if) && Objects.equals(this.drop, filter.drop) && Objects.equals(this.dropProperties, filter.dropProperties) - && Objects.equals(this.allowProperties, filter.allowProperties); + && Objects.equals(this.allowProperties, filter.allowProperties) + && Objects.equals(this.createdAt, filter.createdAt) + && Objects.equals(this.updatedAt, filter.updatedAt); } @Override @@ -332,7 +384,9 @@ public int hashCode() { _if, drop, dropProperties, - allowProperties); + allowProperties, + createdAt, + updatedAt); } @Override @@ -349,6 +403,8 @@ public String toString() { sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -380,12 +436,16 @@ private String toIndentedString(Object o) { openapiFields.add("drop"); openapiFields.add("dropProperties"); openapiFields.add("allowProperties"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); openapiRequiredFields.add("workspaceId"); openapiRequiredFields.add("integrationId"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); } /** @@ -493,6 +553,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("allowProperties").toString())); } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From d37069f2cc3ba6e7daef732579a8fbfdb47024ca Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 30 Sep 2024 11:28:18 +0000 Subject: [PATCH 352/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@67bd1bbd. --- LICENSE | 2 +- docs/FunctionsApi.md | 2 +- .../com/segment/publicapi/models/CreateFunctionV1Input.java | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 2fa576b6..fe736a4c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright © 2023 Twilio, Inc. +Copyright © 2024 Twilio, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index 15a621a8..b35be929 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | ### Return type diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 8ce751b4..2d938849 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,6 +60,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; From 558300a68a70ba1cd5909e03e8224838a801f240 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Oct 2024 06:36:55 +0000 Subject: [PATCH 353/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ff45c14b. --- .../models/DestinationMetadataV1.java | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 2b2071cf..136424e8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -192,6 +192,12 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) private List regionEndpoints; + public static final String SERIALIZED_NAME_MULTI_INSTANCE_SUPPORTED_VERSION = + "multiInstanceSupportedVersion"; + + @SerializedName(SERIALIZED_NAME_MULTI_INSTANCE_SUPPORTED_VERSION) + private String multiInstanceSupportedVersion; + public DestinationMetadataV1() {} public DestinationMetadataV1 id(String id) { @@ -670,6 +676,27 @@ public void setRegionEndpoints(List regionEndpoints) { this.regionEndpoints = regionEndpoints; } + public DestinationMetadataV1 multiInstanceSupportedVersion( + String multiInstanceSupportedVersion) { + + this.multiInstanceSupportedVersion = multiInstanceSupportedVersion; + return this; + } + + /** + * This Destination's support for multiple instance types. + * + * @return multiInstanceSupportedVersion + */ + @javax.annotation.Nullable + public String getMultiInstanceSupportedVersion() { + return multiInstanceSupportedVersion; + } + + public void setMultiInstanceSupportedVersion(String multiInstanceSupportedVersion) { + this.multiInstanceSupportedVersion = multiInstanceSupportedVersion; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -698,7 +725,10 @@ public boolean equals(Object o) { && Objects.equals(this.contacts, destinationMetadataV1.contacts) && Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned) && Objects.equals(this.supportedRegions, destinationMetadataV1.supportedRegions) - && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints); + && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints) + && Objects.equals( + this.multiInstanceSupportedVersion, + destinationMetadataV1.multiInstanceSupportedVersion); } @Override @@ -723,7 +753,8 @@ public int hashCode() { contacts, partnerOwned, supportedRegions, - regionEndpoints); + regionEndpoints, + multiInstanceSupportedVersion); } @Override @@ -754,6 +785,9 @@ public String toString() { sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); + sb.append(" multiInstanceSupportedVersion: ") + .append(toIndentedString(multiInstanceSupportedVersion)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -795,6 +829,7 @@ private String toIndentedString(Object o) { openapiFields.add("partnerOwned"); openapiFields.add("supportedRegions"); openapiFields.add("regionEndpoints"); + openapiFields.add("multiInstanceSupportedVersion"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1029,6 +1064,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("regionEndpoints").toString())); } + if ((jsonObj.get("multiInstanceSupportedVersion") != null + && !jsonObj.get("multiInstanceSupportedVersion").isJsonNull()) + && !jsonObj.get("multiInstanceSupportedVersion").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiInstanceSupportedVersion` to be a primitive" + + " type in the JSON string but got `%s`", + jsonObj.get("multiInstanceSupportedVersion").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 1d4be9cbefb9fd3fff576c785df609805d82c40a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Oct 2024 23:28:10 +0000 Subject: [PATCH 354/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0fb20e7d. --- README.md | 8 +- docs/ReverseEtlApi.md | 78 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 12 + .../segment/publicapi/api/ReverseEtlApi.java | 221 ++++++++++++++ ...ncelReverseETLSyncForModel200Response.java | 205 +++++++++++++ .../CancelReverseETLSyncForModelInput.java | 201 +++++++++++++ .../CancelReverseETLSyncForModelOutput.java | 283 ++++++++++++++++++ .../com/segment/publicapi/models/Config.java | 85 +++++- .../models/CreateTransformationV1Input.java | 30 ++ .../models/ReverseEtlCronScheduleConfig.java | 248 +++++++++++++++ .../models/ReverseEtlScheduleConfig.java | 86 +++++- .../publicapi/models/ScheduleConfig.java | 85 +++++- .../publicapi/models/TransformationV1.java | 30 ++ .../models/UpdateTransformationV1Input.java | 30 ++ 17 files changed, 1577 insertions(+), 31 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java diff --git a/README.md b/README.md index a4f7cb27..b1e72e52 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 54.2.0 +Latest API and SDK version: 55.1.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 54.2.0 + 55.1.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:54.2.0" + implementation "com.segment.publicapi:segment-publicapi:55.1.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-54.2.0.jar` +* `target/segment-publicapi-55.1.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index ea4e4f9d..6757d505 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**cancelReverseETLSyncForModel**](ReverseEtlApi.md#cancelReverseETLSyncForModel) | **POST** /reverse-etl-models/{modelId}/syncs/{syncId}/cancel | Cancel Reverse ETL Sync for Model | | [**createReverseETLManualSync**](ReverseEtlApi.md#createReverseETLManualSync) | **POST** /reverse-etl-syncs | Create Reverse ETL Manual Sync | | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | @@ -15,6 +16,83 @@ All URIs are relative to *https://api.segmentapis.com* +## Operation: cancelReverseETLSyncForModel + +> CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput) + +Cancel Reverse ETL Sync for Model + +Cancels a sync for a Reverse ETL Connection. It might take a few seconds to completely cancel the sync. Will return an error if the sync is already completed or cancelled. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ReverseEtlApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); + String modelId = "modelId"; // String | + String syncId = "1"; // String | + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = new CancelReverseETLSyncForModelInput(); // CancelReverseETLSyncForModelInput | + try { + CancelReverseETLSyncForModel200Response result = apiInstance.cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReverseEtlApi#cancelReverseETLSyncForModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **modelId** | **String**| | | +| **syncId** | **String**| | | +| **cancelReverseETLSyncForModelInput** | [**CancelReverseETLSyncForModelInput**](CancelReverseETLSyncForModelInput.md)| | | + +### Return type + +[**CancelReverseETLSyncForModel200Response**](CancelReverseETLSyncForModel200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: createReverseETLManualSync > CreateReverseETLManualSync200Response createReverseETLManualSync(createReverseETLManualSyncInput) diff --git a/pom.xml b/pom.xml index 94873b40..a165e19a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 54.2.0 + 55.1.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9f6ad7fe..c1ad2955 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 54.2.0 (Java)"); + setUserAgent("Public API SDK 55.1.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 2f9e98c0..11f457be 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "54.2.0"; + public static final String VERSION = "55.1.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index f16a4cec..1c33e9cd 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -185,6 +185,15 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModelInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1322,6 +1331,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseETLSyncStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlCronScheduleConfig + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 816d05cc..0352a333 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -18,6 +18,8 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CancelReverseETLSyncForModel200Response; +import com.segment.publicapi.models.CancelReverseETLSyncForModelInput; import com.segment.publicapi.models.CreateReverseETLManualSync200Response; import com.segment.publicapi.models.CreateReverseETLManualSyncInput; import com.segment.publicapi.models.CreateReverseEtlModel201Response; @@ -74,6 +76,225 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for cancelReverseETLSyncForModel + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call cancelReverseETLSyncForModelCall( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = cancelReverseETLSyncForModelInput; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}/syncs/{syncId}/cancel" + .replace( + "{" + "modelId" + "}", + localVarApiClient.escapeString(modelId.toString())) + .replace( + "{" + "syncId" + "}", + localVarApiClient.escapeString(syncId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelReverseETLSyncForModelValidateBeforeCall( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " cancelReverseETLSyncForModel(Async)"); + } + + // verify the required parameter 'syncId' is set + if (syncId == null) { + throw new ApiException( + "Missing the required parameter 'syncId' when calling" + + " cancelReverseETLSyncForModel(Async)"); + } + + // verify the required parameter 'cancelReverseETLSyncForModelInput' is set + if (cancelReverseETLSyncForModelInput == null) { + throw new ApiException( + "Missing the required parameter 'cancelReverseETLSyncForModelInput' when" + + " calling cancelReverseETLSyncForModel(Async)"); + } + + return cancelReverseETLSyncForModelCall( + modelId, syncId, cancelReverseETLSyncForModelInput, _callback); + } + + /** + * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take + * a few seconds to completely cancel the sync. Will return an error if the sync is already + * completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @return CancelReverseETLSyncForModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) + throws ApiException { + ApiResponse localVarResp = + cancelReverseETLSyncForModelWithHttpInfo( + modelId, syncId, cancelReverseETLSyncForModelInput); + return localVarResp.getData(); + } + + /** + * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take + * a few seconds to completely cancel the sync. Will return an error if the sync is already + * completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @return ApiResponse<CancelReverseETLSyncForModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + cancelReverseETLSyncForModelWithHttpInfo( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) + throws ApiException { + okhttp3.Call localVarCall = + cancelReverseETLSyncForModelValidateBeforeCall( + modelId, syncId, cancelReverseETLSyncForModelInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel Reverse ETL Sync for Model (asynchronously) Cancels a sync for a Reverse ETL + * Connection. It might take a few seconds to completely cancel the sync. Will return an error + * if the sync is already completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call cancelReverseETLSyncForModelAsync( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + cancelReverseETLSyncForModelValidateBeforeCall( + modelId, syncId, cancelReverseETLSyncForModelInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for createReverseETLManualSync * diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java new file mode 100644 index 00000000..0bcd926f --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CancelReverseETLSyncForModel200Response */ +public class CancelReverseETLSyncForModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CancelReverseETLSyncForModelOutput data; + + public CancelReverseETLSyncForModel200Response() {} + + public CancelReverseETLSyncForModel200Response data(CancelReverseETLSyncForModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CancelReverseETLSyncForModelOutput getData() { + return data; + } + + public void setData(CancelReverseETLSyncForModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel200Response = + (CancelReverseETLSyncForModel200Response) o; + return Objects.equals(this.data, cancelReverseETLSyncForModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModel200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CancelReverseETLSyncForModel200Response is not found in the" + + " empty JSON string", + CancelReverseETLSyncForModel200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModel200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CancelReverseETLSyncForModelOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModel200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModel200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CancelReverseETLSyncForModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModel200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModel200Response + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModel200Response + */ + public static CancelReverseETLSyncForModel200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModel200Response.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java new file mode 100644 index 00000000..e9ada082 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java @@ -0,0 +1,201 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines the parameters needed to cancel a sync for a RETL connection. */ +public class CancelReverseETLSyncForModelInput { + public static final String SERIALIZED_NAME_REASON_FOR_CANCELING = "reasonForCanceling"; + + @SerializedName(SERIALIZED_NAME_REASON_FOR_CANCELING) + private BigDecimal reasonForCanceling; + + public CancelReverseETLSyncForModelInput() {} + + public CancelReverseETLSyncForModelInput reasonForCanceling(BigDecimal reasonForCanceling) { + + this.reasonForCanceling = reasonForCanceling; + return this; + } + + /** + * The reason of canceling the sync. - IncorrectModel = 0 - IncorrectDest = 1 - + * IncorrectKeys = 2 - IncorrectMapping = 3 - Other = 4 + * + * @return reasonForCanceling + */ + @javax.annotation.Nullable + public BigDecimal getReasonForCanceling() { + return reasonForCanceling; + } + + public void setReasonForCanceling(BigDecimal reasonForCanceling) { + this.reasonForCanceling = reasonForCanceling; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = + (CancelReverseETLSyncForModelInput) o; + return Objects.equals( + this.reasonForCanceling, cancelReverseETLSyncForModelInput.reasonForCanceling); + } + + @Override + public int hashCode() { + return Objects.hash(reasonForCanceling); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModelInput {\n"); + sb.append(" reasonForCanceling: ") + .append(toIndentedString(reasonForCanceling)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reasonForCanceling"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModelInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModelInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelReverseETLSyncForModelInput is" + + " not found in the empty JSON string", + CancelReverseETLSyncForModelInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModelInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModelInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModelInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModelInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModelInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelReverseETLSyncForModelInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModelInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModelInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModelInput + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModelInput + */ + public static CancelReverseETLSyncForModelInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelInput.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModelInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java new file mode 100644 index 00000000..fce7c461 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java @@ -0,0 +1,283 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * CancelReverseETLSyncForModelOutput either will return an error or a \"CANCELLING\" + * status. + */ +public class CancelReverseETLSyncForModelOutput { + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; + + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public CancelReverseETLSyncForModelOutput() {} + + public CancelReverseETLSyncForModelOutput errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * A place holder for a machine-friendly category for an error, if applicable. - + * \"SyncAlreadyCanceled\" - \"SyncFinishedCannotCancel\" + * + * @return errorCode + */ + @javax.annotation.Nullable + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public CancelReverseETLSyncForModelOutput errorMessage(String errorMessage) { + + this.errorMessage = errorMessage; + return this; + } + + /** + * A place holder for a human-readable description of the error, if applicable. - \"sync + * already canceled\" - \"sync already finished\". + * + * @return errorMessage + */ + @javax.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public CancelReverseETLSyncForModelOutput status(String status) { + + this.status = status; + return this; + } + + /** + * If no error, status will be CANCELLING, as the extract/load might take some time to cancel. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModelOutput cancelReverseETLSyncForModelOutput = + (CancelReverseETLSyncForModelOutput) o; + return Objects.equals(this.errorCode, cancelReverseETLSyncForModelOutput.errorCode) + && Objects.equals( + this.errorMessage, cancelReverseETLSyncForModelOutput.errorMessage) + && Objects.equals(this.status, cancelReverseETLSyncForModelOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, errorMessage, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModelOutput {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errorCode"); + openapiFields.add("errorMessage"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModelOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelReverseETLSyncForModelOutput is" + + " not found in the empty JSON string", + CancelReverseETLSyncForModelOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModelOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonNull()) + && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorCode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorCode").toString())); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) + && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorMessage` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorMessage").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModelOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelReverseETLSyncForModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModelOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModelOutput + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModelOutput + */ + public static CancelReverseETLSyncForModelOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelOutput.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index b70fcf4a..fed0fbe5 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -46,6 +46,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -78,8 +81,19 @@ public void write(JsonWriter out, Config value) throws IOException { elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -137,6 +151,27 @@ public Config read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } throw new IOException( String.format( @@ -156,6 +191,11 @@ public Config() { super("anyOf", Boolean.TRUE); } + public Config(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + public Config(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -170,6 +210,7 @@ public Config(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -179,8 +220,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -201,16 +242,21 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -242,6 +288,18 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -275,10 +333,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java index 09b1758c..ae2ef47d 100644 --- a/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateTransformationV1Input.java @@ -57,6 +57,11 @@ public class CreateTransformationV1Input { @SerializedName(SERIALIZED_NAME_IF) private String _if; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -195,6 +200,27 @@ public void setIf(String _if) { this._if = _if; } + public CreateTransformationV1Input drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Optional boolean value if the Transformation should drop the event entirely when the if + * statement matches, ignores all other transforms. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + public CreateTransformationV1Input newEventName(String newEventName) { this.newEventName = newEventName; @@ -373,6 +399,7 @@ public boolean equals(Object o) { createTransformationV1Input.destinationMetadataId) && Objects.equals(this.enabled, createTransformationV1Input.enabled) && Objects.equals(this._if, createTransformationV1Input._if) + && Objects.equals(this.drop, createTransformationV1Input.drop) && Objects.equals(this.newEventName, createTransformationV1Input.newEventName) && Objects.equals(this.propertyRenames, createTransformationV1Input.propertyRenames) && Objects.equals( @@ -394,6 +421,7 @@ public int hashCode() { destinationMetadataId, enabled, _if, + drop, newEventName, propertyRenames, propertyValueTransformations, @@ -413,6 +441,7 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -451,6 +480,7 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); + openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java new file mode 100644 index 00000000..c21c24df --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java @@ -0,0 +1,248 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ReverseEtlCronScheduleConfig */ +public class ReverseEtlCronScheduleConfig { + public static final String SERIALIZED_NAME_SPEC = "spec"; + + @SerializedName(SERIALIZED_NAME_SPEC) + private String spec; + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; + + public ReverseEtlCronScheduleConfig() {} + + public ReverseEtlCronScheduleConfig spec(String spec) { + + this.spec = spec; + return this; + } + + /** + * 5 field cron string expression. The cron expression must be larger than 15 minutes. + * + * @return spec + */ + @javax.annotation.Nonnull + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public ReverseEtlCronScheduleConfig timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Timezone for the specified times. + * + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlCronScheduleConfig reverseEtlCronScheduleConfig = + (ReverseEtlCronScheduleConfig) o; + return Objects.equals(this.spec, reverseEtlCronScheduleConfig.spec) + && Objects.equals(this.timezone, reverseEtlCronScheduleConfig.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(spec, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlCronScheduleConfig {\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("spec"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("spec"); + openapiRequiredFields.add("timezone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlCronScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlCronScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlCronScheduleConfig is not" + + " found in the empty JSON string", + ReverseEtlCronScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlCronScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlCronScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlCronScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("spec").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spec` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spec").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlCronScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlCronScheduleConfig' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlCronScheduleConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlCronScheduleConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlCronScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlCronScheduleConfig + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlCronScheduleConfig + */ + public static ReverseEtlCronScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlCronScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlCronScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java index 656a63b4..47909984 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java @@ -47,6 +47,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -80,8 +83,19 @@ public void write(JsonWriter out, ReverseEtlScheduleConfig value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -139,6 +153,27 @@ public ReverseEtlScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } throw new IOException( String.format( @@ -159,6 +194,11 @@ public ReverseEtlScheduleConfig() { super("anyOf", Boolean.FALSE); } + public ReverseEtlScheduleConfig(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + public ReverseEtlScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.FALSE); setActualInstance(o); @@ -173,6 +213,7 @@ public ReverseEtlScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -182,8 +223,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -199,16 +240,21 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -240,6 +286,18 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -273,10 +331,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" - + " schemas: ReverseEtlPeriodicScheduleConfig," + + " schemas: ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java index 3b527dda..8796cd2a 100644 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java @@ -46,6 +46,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -78,8 +81,19 @@ public void write(JsonWriter out, ScheduleConfig value) throws IOException { elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -137,6 +151,27 @@ public ScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlSpecificTimeScheduleConfig'", e); } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + ScheduleConfig ret = new ScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } throw new IOException( String.format( @@ -157,6 +192,11 @@ public ScheduleConfig() { super("anyOf", Boolean.TRUE); } + public ScheduleConfig(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -171,6 +211,7 @@ public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); } @Override @@ -180,8 +221,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -202,16 +243,21 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlPeriodicScheduleConfig, + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, * ReverseEtlSpecificTimeScheduleConfig) */ @Override @@ -243,6 +289,18 @@ public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleCon return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -276,10 +334,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for ScheduleConfig with anyOf schemas:" - + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/TransformationV1.java b/src/main/java/com/segment/publicapi/models/TransformationV1.java index 7d9380a7..6bbc7712 100644 --- a/src/main/java/com/segment/publicapi/models/TransformationV1.java +++ b/src/main/java/com/segment/publicapi/models/TransformationV1.java @@ -62,6 +62,11 @@ public class TransformationV1 { @SerializedName(SERIALIZED_NAME_IF) private String _if; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -220,6 +225,27 @@ public void setIf(String _if) { this._if = _if; } + public TransformationV1 drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Optional boolean value if the Transformation should drop the event entirely when the if + * statement matches, ignores all other transforms. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + public TransformationV1 newEventName(String newEventName) { this.newEventName = newEventName; @@ -395,6 +421,7 @@ public boolean equals(Object o) { this.destinationMetadataId, transformationV1.destinationMetadataId) && Objects.equals(this.enabled, transformationV1.enabled) && Objects.equals(this._if, transformationV1._if) + && Objects.equals(this.drop, transformationV1.drop) && Objects.equals(this.newEventName, transformationV1.newEventName) && Objects.equals(this.propertyRenames, transformationV1.propertyRenames) && Objects.equals( @@ -416,6 +443,7 @@ public int hashCode() { destinationMetadataId, enabled, _if, + drop, newEventName, propertyRenames, propertyValueTransformations, @@ -436,6 +464,7 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -475,6 +504,7 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); + openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); diff --git a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java index 3e0c1231..ff9bacae 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/UpdateTransformationV1Input.java @@ -57,6 +57,11 @@ public class UpdateTransformationV1Input { @SerializedName(SERIALIZED_NAME_IF) private String _if; + public static final String SERIALIZED_NAME_DROP = "drop"; + + @SerializedName(SERIALIZED_NAME_DROP) + private Boolean drop; + public static final String SERIALIZED_NAME_NEW_EVENT_NAME = "newEventName"; @SerializedName(SERIALIZED_NAME_NEW_EVENT_NAME) @@ -195,6 +200,27 @@ public void setIf(String _if) { this._if = _if; } + public UpdateTransformationV1Input drop(Boolean drop) { + + this.drop = drop; + return this; + } + + /** + * Optional boolean value if the Transformation should drop the event entirely when the if + * statement matches, ignores all other transforms. + * + * @return drop + */ + @javax.annotation.Nullable + public Boolean getDrop() { + return drop; + } + + public void setDrop(Boolean drop) { + this.drop = drop; + } + public UpdateTransformationV1Input newEventName(String newEventName) { this.newEventName = newEventName; @@ -373,6 +399,7 @@ public boolean equals(Object o) { updateTransformationV1Input.destinationMetadataId) && Objects.equals(this.enabled, updateTransformationV1Input.enabled) && Objects.equals(this._if, updateTransformationV1Input._if) + && Objects.equals(this.drop, updateTransformationV1Input.drop) && Objects.equals(this.newEventName, updateTransformationV1Input.newEventName) && Objects.equals(this.propertyRenames, updateTransformationV1Input.propertyRenames) && Objects.equals( @@ -394,6 +421,7 @@ public int hashCode() { destinationMetadataId, enabled, _if, + drop, newEventName, propertyRenames, propertyValueTransformations, @@ -413,6 +441,7 @@ public String toString() { .append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); + sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); sb.append(" newEventName: ").append(toIndentedString(newEventName)).append("\n"); sb.append(" propertyRenames: ").append(toIndentedString(propertyRenames)).append("\n"); sb.append(" propertyValueTransformations: ") @@ -451,6 +480,7 @@ private String toIndentedString(Object o) { openapiFields.add("destinationMetadataId"); openapiFields.add("enabled"); openapiFields.add("if"); + openapiFields.add("drop"); openapiFields.add("newEventName"); openapiFields.add("propertyRenames"); openapiFields.add("propertyValueTransformations"); From 98d74edb1a905dff61bf04de98f40070e7f49e57 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 16 Oct 2024 00:27:59 +0000 Subject: [PATCH 355/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@26527c72. --- docs/FunctionsApi.md | 2 +- .../models/CreateFunctionV1Input.java | 2 - .../models/DestinationMetadataV1.java | 48 +------------------ 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index b35be929..15a621a8 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | ### Return type diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 2d938849..8ce751b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,8 +60,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 136424e8..2b2071cf 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -192,12 +192,6 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) private List regionEndpoints; - public static final String SERIALIZED_NAME_MULTI_INSTANCE_SUPPORTED_VERSION = - "multiInstanceSupportedVersion"; - - @SerializedName(SERIALIZED_NAME_MULTI_INSTANCE_SUPPORTED_VERSION) - private String multiInstanceSupportedVersion; - public DestinationMetadataV1() {} public DestinationMetadataV1 id(String id) { @@ -676,27 +670,6 @@ public void setRegionEndpoints(List regionEndpoints) { this.regionEndpoints = regionEndpoints; } - public DestinationMetadataV1 multiInstanceSupportedVersion( - String multiInstanceSupportedVersion) { - - this.multiInstanceSupportedVersion = multiInstanceSupportedVersion; - return this; - } - - /** - * This Destination's support for multiple instance types. - * - * @return multiInstanceSupportedVersion - */ - @javax.annotation.Nullable - public String getMultiInstanceSupportedVersion() { - return multiInstanceSupportedVersion; - } - - public void setMultiInstanceSupportedVersion(String multiInstanceSupportedVersion) { - this.multiInstanceSupportedVersion = multiInstanceSupportedVersion; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -725,10 +698,7 @@ public boolean equals(Object o) { && Objects.equals(this.contacts, destinationMetadataV1.contacts) && Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned) && Objects.equals(this.supportedRegions, destinationMetadataV1.supportedRegions) - && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints) - && Objects.equals( - this.multiInstanceSupportedVersion, - destinationMetadataV1.multiInstanceSupportedVersion); + && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints); } @Override @@ -753,8 +723,7 @@ public int hashCode() { contacts, partnerOwned, supportedRegions, - regionEndpoints, - multiInstanceSupportedVersion); + regionEndpoints); } @Override @@ -785,9 +754,6 @@ public String toString() { sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); - sb.append(" multiInstanceSupportedVersion: ") - .append(toIndentedString(multiInstanceSupportedVersion)) - .append("\n"); sb.append("}"); return sb.toString(); } @@ -829,7 +795,6 @@ private String toIndentedString(Object o) { openapiFields.add("partnerOwned"); openapiFields.add("supportedRegions"); openapiFields.add("regionEndpoints"); - openapiFields.add("multiInstanceSupportedVersion"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1064,15 +1029,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("regionEndpoints").toString())); } - if ((jsonObj.get("multiInstanceSupportedVersion") != null - && !jsonObj.get("multiInstanceSupportedVersion").isJsonNull()) - && !jsonObj.get("multiInstanceSupportedVersion").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `multiInstanceSupportedVersion` to be a primitive" - + " type in the JSON string but got `%s`", - jsonObj.get("multiInstanceSupportedVersion").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 43e21466f4f0a00d55946dc8792f1c373712adec Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 17 Oct 2024 03:48:17 +0000 Subject: [PATCH 356/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2ed76755. --- docs/FunctionsApi.md | 2 +- .../com/segment/publicapi/models/CreateFunctionV1Input.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index 15a621a8..b35be929 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | ### Return type diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 8ce751b4..2d938849 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,6 +60,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; From 6c59809a071226bca2330db26e567b24dd9f13cc Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 18 Oct 2024 16:09:53 +0000 Subject: [PATCH 357/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@38c7a89f. From a8a407bd8dc6e2bc3d17d332ccc8231af64496cb Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 18 Oct 2024 20:14:31 +0000 Subject: [PATCH 358/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@17dfc1d2. --- docs/DestinationsApi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/DestinationsApi.md b/docs/DestinationsApi.md index 13a79486..c34b93ba 100644 --- a/docs/DestinationsApi.md +++ b/docs/DestinationsApi.md @@ -794,8 +794,8 @@ public class Example { token.setBearerToken("BEARER TOKEN"); DestinationsApi apiInstance = new DestinationsApi(defaultClient); - String destinationId = "fP7qoQw2HTWt9WdMr718gn"; // String | - String id = "3ELMSracBm5MMikXBYfo1c"; // String | + String destinationId = "qtiZHLLqqsHmpvLXNtP5du"; // String | + String id = "pJtn52LjrcD1TrQcm2ZSwp"; // String | UpdateSubscriptionForDestinationAlphaInput updateSubscriptionForDestinationAlphaInput = new UpdateSubscriptionForDestinationAlphaInput(); // UpdateSubscriptionForDestinationAlphaInput | try { UpdateSubscriptionForDestination200Response result = apiInstance.updateSubscriptionForDestination(destinationId, id, updateSubscriptionForDestinationAlphaInput); From 3ab1f911dc9e461840cee02acd0a12c8cba564b6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 24 Oct 2024 17:44:16 +0000 Subject: [PATCH 359/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6ca66053. --- docs/DestinationsApi.md | 6 +- docs/ReverseEtlApi.md | 4 +- src/main/java/com/segment/publicapi/JSON.java | 2 - .../publicapi/api/DestinationsApi.java | 45 ++- .../models/CreateReverseEtlModelInput.java | 139 +------ .../models/ReverseEtlCronScheduleConfig.java | 3 +- .../publicapi/models/ReverseEtlModel.java | 99 +---- .../models/ReverseEtlScheduleDefinition.java | 6 +- .../publicapi/models/ScheduleConfig.java | 377 ------------------ .../models/UpdateReverseEtlModelInput.java | 138 +------ 10 files changed, 50 insertions(+), 769 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/ScheduleConfig.java diff --git a/docs/DestinationsApi.md b/docs/DestinationsApi.md index c34b93ba..22361c8e 100644 --- a/docs/DestinationsApi.md +++ b/docs/DestinationsApi.md @@ -97,7 +97,7 @@ public class Example { Create Destination Subscription -Creates a new Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. +Creates a new Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 50 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -622,7 +622,7 @@ public class Example { Remove Subscription from Destination -Deletes an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. +Deletes an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 50 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -772,7 +772,7 @@ public class Example { Update Subscription for Destination -Updates an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. +Updates an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 50 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index 6757d505..ae378ca8 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -415,7 +415,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "dY1JLx4HgWHKUNsB76tEU"; // String | + String modelId = "jSAVzDH3z89geNDZwoNY9V"; // String | try { GetReverseEtlModel200Response result = apiInstance.getReverseEtlModel(modelId); System.out.println(result); @@ -640,7 +640,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "gFBTkmP2ENiu6BQRmdHBkr"; // String | + String modelId = "6BthE21tPsXyA2cK3QPQFQ"; // String | UpdateReverseEtlModelInput updateReverseEtlModelInput = new UpdateReverseEtlModelInput(); // UpdateReverseEtlModelInput | try { UpdateReverseEtlModel200Response result = apiInstance.updateReverseEtlModel(modelId, updateReverseEtlModelInput); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 1c33e9cd..e46ae2cf 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1354,8 +1354,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ScheduleConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index fd503388..c911715c 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -361,7 +361,10 @@ private okhttp3.Call createDestinationSubscriptionValidateBeforeCall( * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the * Destination Subscriptions feature enabled. Please reach out to your customer success manager - * for more information. + * for more information. The rate limit for this endpoint is 50 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -392,7 +395,10 @@ public CreateDestinationSubscription200Response createDestinationSubscription( * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the * Destination Subscriptions feature enabled. Please reach out to your customer success manager - * for more information. + * for more information. The rate limit for this endpoint is 50 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -426,7 +432,10 @@ public CreateDestinationSubscription200Response createDestinationSubscription( * This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. + * customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -1724,7 +1733,10 @@ private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall( * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. + * customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -1752,7 +1764,10 @@ public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestin * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. + * customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -1783,7 +1798,10 @@ public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestin * subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending * an email to friends@segment.com. • In order to successfully call this endpoint, the specified * Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to - * your customer success manager for more information. + * your customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -2147,7 +2165,10 @@ private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall( * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. + * customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -2180,7 +2201,10 @@ public UpdateSubscriptionForDestination200Response updateSubscriptionForDestinat * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. + * customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -2217,7 +2241,10 @@ public UpdateSubscriptionForDestination200Response updateSubscriptionForDestinat * subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending * an email to friends@segment.com. • In order to successfully call this endpoint, the specified * Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to - * your customer success manager for more information. + * your customer success manager for more information. The rate limit for this endpoint is 50 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) diff --git a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java index 50e3b39a..a1457b7c 100644 --- a/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateReverseEtlModelInput.java @@ -16,14 +16,12 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; @@ -51,67 +49,6 @@ public class CreateReverseEtlModelInput { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - /** - * Determines the strategy used for triggering syncs, which will be used in conjunction with - * scheduleConfig. - */ - @JsonAdapter(ScheduleStrategyEnum.Adapter.class) - public enum ScheduleStrategyEnum { - MANUAL("MANUAL"), - - PERIODIC("PERIODIC"), - - SPECIFIC_DAYS("SPECIFIC_DAYS"); - - private String value; - - ScheduleStrategyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ScheduleStrategyEnum fromValue(String value) { - for (ScheduleStrategyEnum b : ScheduleStrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ScheduleStrategyEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ScheduleStrategyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ScheduleStrategyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) - private ScheduleStrategyEnum scheduleStrategy; - - public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) - private Map scheduleConfig; - public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @@ -205,56 +142,6 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public CreateReverseEtlModelInput scheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { - - this.scheduleStrategy = scheduleStrategy; - return this; - } - - /** - * Determines the strategy used for triggering syncs, which will be used in conjunction with - * scheduleConfig. - * - * @return scheduleStrategy - */ - @javax.annotation.Nonnull - public ScheduleStrategyEnum getScheduleStrategy() { - return scheduleStrategy; - } - - public void setScheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { - this.scheduleStrategy = scheduleStrategy; - } - - public CreateReverseEtlModelInput scheduleConfig(Map scheduleConfig) { - - this.scheduleConfig = scheduleConfig; - return this; - } - - public CreateReverseEtlModelInput putScheduleConfigItem(String key, Object scheduleConfigItem) { - if (this.scheduleConfig == null) { - this.scheduleConfig = new HashMap<>(); - } - this.scheduleConfig.put(key, scheduleConfigItem); - return this; - } - - /** - * Defines a configuration object used for scheduling, which can vary depending on the - * configured strategy, but must always be an object with at least 1 level of keys. - * - * @return scheduleConfig - */ - @javax.annotation.Nonnull - public Map getScheduleConfig() { - return scheduleConfig; - } - - public void setScheduleConfig(Map scheduleConfig) { - this.scheduleConfig = scheduleConfig; - } - public CreateReverseEtlModelInput query(String query) { this.query = query; @@ -309,9 +196,6 @@ public boolean equals(Object o) { && Objects.equals(this.name, createReverseEtlModelInput.name) && Objects.equals(this.description, createReverseEtlModelInput.description) && Objects.equals(this.enabled, createReverseEtlModelInput.enabled) - && Objects.equals( - this.scheduleStrategy, createReverseEtlModelInput.scheduleStrategy) - && Objects.equals(this.scheduleConfig, createReverseEtlModelInput.scheduleConfig) && Objects.equals(this.query, createReverseEtlModelInput.query) && Objects.equals( this.queryIdentifierColumn, @@ -320,15 +204,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash( - sourceId, - name, - description, - enabled, - scheduleStrategy, - scheduleConfig, - query, - queryIdentifierColumn); + return Objects.hash(sourceId, name, description, enabled, query, queryIdentifierColumn); } @Override @@ -339,8 +215,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); - sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" queryIdentifierColumn: ") .append(toIndentedString(queryIdentifierColumn)) @@ -370,8 +244,6 @@ private String toIndentedString(Object o) { openapiFields.add("name"); openapiFields.add("description"); openapiFields.add("enabled"); - openapiFields.add("scheduleStrategy"); - openapiFields.add("scheduleConfig"); openapiFields.add("query"); openapiFields.add("queryIdentifierColumn"); @@ -381,8 +253,6 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("description"); openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("scheduleStrategy"); - openapiRequiredFields.add("scheduleConfig"); openapiRequiredFields.add("query"); openapiRequiredFields.add("queryIdentifierColumn"); } @@ -448,13 +318,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("description").toString())); } - if (!jsonObj.get("scheduleStrategy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `scheduleStrategy` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("scheduleStrategy").toString())); - } if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java index c21c24df..7f64d715 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlCronScheduleConfig.java @@ -68,7 +68,8 @@ public ReverseEtlCronScheduleConfig timezone(String timezone) { } /** - * Timezone for the specified times. + * Timezone respected by the cron string. Format must be in IANA Timezone Identifier. Example: + * 'America/Los_Angeles'. * * @return timezone */ diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java index c2a61a5a..0d32f78f 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlModel.java @@ -22,12 +22,10 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; /** Defines a Reverse ETL Model. */ public class ReverseEtlModel { @@ -56,16 +54,6 @@ public class ReverseEtlModel { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) - private String scheduleStrategy; - - public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) - private ScheduleConfig scheduleConfig; - public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @@ -179,48 +167,6 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ReverseEtlModel scheduleStrategy(String scheduleStrategy) { - - this.scheduleStrategy = scheduleStrategy; - return this; - } - - /** - * Determines the strategy used for triggering syncs, which will be used in conjunction with - * scheduleConfig. Possible values: \"manual\", \"periodic\", - * \"specific_days\". - * - * @return scheduleStrategy - */ - @javax.annotation.Nonnull - public String getScheduleStrategy() { - return scheduleStrategy; - } - - public void setScheduleStrategy(String scheduleStrategy) { - this.scheduleStrategy = scheduleStrategy; - } - - public ReverseEtlModel scheduleConfig(ScheduleConfig scheduleConfig) { - - this.scheduleConfig = scheduleConfig; - return this; - } - - /** - * Get scheduleConfig - * - * @return scheduleConfig - */ - @javax.annotation.Nullable - public ScheduleConfig getScheduleConfig() { - return scheduleConfig; - } - - public void setScheduleConfig(ScheduleConfig scheduleConfig) { - this.scheduleConfig = scheduleConfig; - } - public ReverseEtlModel query(String query) { this.query = query; @@ -276,41 +222,14 @@ public boolean equals(Object o) { && Objects.equals(this.name, reverseEtlModel.name) && Objects.equals(this.description, reverseEtlModel.description) && Objects.equals(this.enabled, reverseEtlModel.enabled) - && Objects.equals(this.scheduleStrategy, reverseEtlModel.scheduleStrategy) - && Objects.equals(this.scheduleConfig, reverseEtlModel.scheduleConfig) && Objects.equals(this.query, reverseEtlModel.query) && Objects.equals( this.queryIdentifierColumn, reverseEtlModel.queryIdentifierColumn); } - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - @Override public int hashCode() { - return Objects.hash( - id, - sourceId, - name, - description, - enabled, - scheduleStrategy, - scheduleConfig, - query, - queryIdentifierColumn); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + return Objects.hash(id, sourceId, name, description, enabled, query, queryIdentifierColumn); } @Override @@ -322,8 +241,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); - sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" queryIdentifierColumn: ") .append(toIndentedString(queryIdentifierColumn)) @@ -354,8 +271,6 @@ private String toIndentedString(Object o) { openapiFields.add("name"); openapiFields.add("description"); openapiFields.add("enabled"); - openapiFields.add("scheduleStrategy"); - openapiFields.add("scheduleConfig"); openapiFields.add("query"); openapiFields.add("queryIdentifierColumn"); @@ -366,7 +281,6 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("description"); openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("scheduleStrategy"); openapiRequiredFields.add("query"); openapiRequiredFields.add("queryIdentifierColumn"); } @@ -439,17 +353,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("description").toString())); } - if (!jsonObj.get("scheduleStrategy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `scheduleStrategy` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("scheduleStrategy").toString())); - } - // validate the optional field `scheduleConfig` - if (jsonObj.get("scheduleConfig") != null && !jsonObj.get("scheduleConfig").isJsonNull()) { - ScheduleConfig.validateJsonElement(jsonObj.get("scheduleConfig")); - } if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java index 8a222746..ba4eae98 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -35,9 +35,11 @@ * strategy. */ public class ReverseEtlScheduleDefinition { - /** Strategy supports three modes: Periodic, Specific Days, or Manual. */ + /** Strategy supports: Periodic, Specific Days, Manual, CRON. */ @JsonAdapter(StrategyEnum.Adapter.class) public enum StrategyEnum { + CRON("CRON"), + MANUAL("MANUAL"), PERIODIC("PERIODIC"), @@ -102,7 +104,7 @@ public ReverseEtlScheduleDefinition strategy(StrategyEnum strategy) { } /** - * Strategy supports three modes: Periodic, Specific Days, or Manual. + * Strategy supports: Periodic, Specific Days, Manual, CRON. * * @return strategy */ diff --git a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ScheduleConfig.java deleted file mode 100644 index 8796cd2a..00000000 --- a/src/main/java/com/segment/publicapi/models/ScheduleConfig.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class ScheduleConfig extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(ScheduleConfig.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ScheduleConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ScheduleConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ScheduleConfig value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { - JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { - JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } - - @Override - public ScheduleConfig read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize ReverseEtlPeriodicScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; - ScheduleConfig ret = new ScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", - e); - } - // deserialize ReverseEtlSpecificTimeScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; - ScheduleConfig ret = new ScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - ScheduleConfig ret = new ScheduleConfig(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for ScheduleConfig: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public ScheduleConfig() { - super("anyOf", Boolean.TRUE); - } - - public ScheduleConfig(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public ScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public ScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); - } - - @Override - public Map> getSchemas() { - return ScheduleConfig.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance == null) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlCronScheduleConfig) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); - } - - /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig - * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` - */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` - */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ScheduleConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlCronScheduleConfig - try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for ScheduleConfig with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of ScheduleConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ScheduleConfig - * @throws IOException if the JSON string is invalid with respect to ScheduleConfig - */ - public static ScheduleConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ScheduleConfig.class); - } - - /** - * Convert an instance of ScheduleConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java index cafc53b0..fac4a9aa 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateReverseEtlModelInput.java @@ -16,14 +16,12 @@ import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; @@ -46,67 +44,6 @@ public class UpdateReverseEtlModelInput { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - /** - * Determines the strategy used for triggering syncs, which will be used in conjunction with - * scheduleConfig. - */ - @JsonAdapter(ScheduleStrategyEnum.Adapter.class) - public enum ScheduleStrategyEnum { - MANUAL("MANUAL"), - - PERIODIC("PERIODIC"), - - SPECIFIC_DAYS("SPECIFIC_DAYS"); - - private String value; - - ScheduleStrategyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ScheduleStrategyEnum fromValue(String value) { - for (ScheduleStrategyEnum b : ScheduleStrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ScheduleStrategyEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ScheduleStrategyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ScheduleStrategyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_SCHEDULE_STRATEGY = "scheduleStrategy"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE_STRATEGY) - private ScheduleStrategyEnum scheduleStrategy; - - public static final String SERIALIZED_NAME_SCHEDULE_CONFIG = "scheduleConfig"; - - @SerializedName(SERIALIZED_NAME_SCHEDULE_CONFIG) - private Map scheduleConfig; - public static final String SERIALIZED_NAME_QUERY = "query"; @SerializedName(SERIALIZED_NAME_QUERY) @@ -180,56 +117,6 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public UpdateReverseEtlModelInput scheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { - - this.scheduleStrategy = scheduleStrategy; - return this; - } - - /** - * Determines the strategy used for triggering syncs, which will be used in conjunction with - * scheduleConfig. - * - * @return scheduleStrategy - */ - @javax.annotation.Nullable - public ScheduleStrategyEnum getScheduleStrategy() { - return scheduleStrategy; - } - - public void setScheduleStrategy(ScheduleStrategyEnum scheduleStrategy) { - this.scheduleStrategy = scheduleStrategy; - } - - public UpdateReverseEtlModelInput scheduleConfig(Map scheduleConfig) { - - this.scheduleConfig = scheduleConfig; - return this; - } - - public UpdateReverseEtlModelInput putScheduleConfigItem(String key, Object scheduleConfigItem) { - if (this.scheduleConfig == null) { - this.scheduleConfig = new HashMap<>(); - } - this.scheduleConfig.put(key, scheduleConfigItem); - return this; - } - - /** - * Defines a configuration object used for scheduling, which can vary depending on the - * configured strategy, but must always be an object with at least 1 level of keys. - * - * @return scheduleConfig - */ - @javax.annotation.Nullable - public Map getScheduleConfig() { - return scheduleConfig; - } - - public void setScheduleConfig(Map scheduleConfig) { - this.scheduleConfig = scheduleConfig; - } - public UpdateReverseEtlModelInput query(String query) { this.query = query; @@ -283,9 +170,6 @@ public boolean equals(Object o) { return Objects.equals(this.name, updateReverseEtlModelInput.name) && Objects.equals(this.description, updateReverseEtlModelInput.description) && Objects.equals(this.enabled, updateReverseEtlModelInput.enabled) - && Objects.equals( - this.scheduleStrategy, updateReverseEtlModelInput.scheduleStrategy) - && Objects.equals(this.scheduleConfig, updateReverseEtlModelInput.scheduleConfig) && Objects.equals(this.query, updateReverseEtlModelInput.query) && Objects.equals( this.queryIdentifierColumn, @@ -294,14 +178,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash( - name, - description, - enabled, - scheduleStrategy, - scheduleConfig, - query, - queryIdentifierColumn); + return Objects.hash(name, description, enabled, query, queryIdentifierColumn); } @Override @@ -311,8 +188,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" scheduleStrategy: ").append(toIndentedString(scheduleStrategy)).append("\n"); - sb.append(" scheduleConfig: ").append(toIndentedString(scheduleConfig)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" queryIdentifierColumn: ") .append(toIndentedString(queryIdentifierColumn)) @@ -341,8 +216,6 @@ private String toIndentedString(Object o) { openapiFields.add("name"); openapiFields.add("description"); openapiFields.add("enabled"); - openapiFields.add("scheduleStrategy"); - openapiFields.add("scheduleConfig"); openapiFields.add("query"); openapiFields.add("queryIdentifierColumn"); @@ -396,15 +269,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("description").toString())); } - if ((jsonObj.get("scheduleStrategy") != null - && !jsonObj.get("scheduleStrategy").isJsonNull()) - && !jsonObj.get("scheduleStrategy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `scheduleStrategy` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("scheduleStrategy").toString())); - } if ((jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) && !jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( From 26e51adfa44bcc4cc8be749672d76cb908918e8c Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 24 Oct 2024 18:02:40 +0000 Subject: [PATCH 360/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b9c5190a. From c791c6b763cd406558c9b43fdaf4199e1317202e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 24 Oct 2024 18:25:20 +0000 Subject: [PATCH 361/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0939d9cb. --- docs/WorkspacesApi.md | 2 +- .../com/segment/publicapi/api/WorkspacesApi.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md index 436cb2a5..15d1b428 100644 --- a/docs/WorkspacesApi.md +++ b/docs/WorkspacesApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Get Workspace -Returns the Workspace associated with the token used to access this resource. +Returns the Workspace associated with the token used to access this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index c4a0dc0c..3a25ae88 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -143,6 +143,10 @@ private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) /** * Get Workspace Returns the Workspace associated with the token used to access this resource. + * The rate limit for this endpoint is 5 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @return GetWorkspace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -163,6 +167,10 @@ public GetWorkspace200Response getWorkspace() throws ApiException { /** * Get Workspace Returns the Workspace associated with the token used to access this resource. + * The rate limit for this endpoint is 5 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @return ApiResponse<GetWorkspace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -184,7 +192,10 @@ public ApiResponse getWorkspaceWithHttpInfo() throws Ap /** * Get Workspace (asynchronously) Returns the Workspace associated with the token used to access - * this resource. + * this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param _callback The callback to be executed when the API call finishes * @return The request call From 2178c2e558c5078ec3d784ebf921cc11bbc2fd1a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 5 Nov 2024 20:15:31 +0000 Subject: [PATCH 362/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@198abe30. --- docs/DeliveryOverviewApi.md | 100 +++- docs/DestinationsApi.md | 6 +- src/main/java/com/segment/publicapi/JSON.java | 3 + .../publicapi/api/DeliveryOverviewApi.java | 472 ++++++++++++++++-- .../publicapi/api/DestinationsApi.java | 48 +- .../DeliveryOverviewAudienceFilterBy.java | 403 +++++++++++++++ .../DeliveryOverviewDestinationFilterBy.java | 4 +- .../DestinationMetadataPlatformsV1.java | 33 +- .../GetDeliveryOverviewMetricsBetaOutput.java | 2 +- 9 files changed, 993 insertions(+), 78 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index dc4089a6..2d07cf68 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -10,6 +10,7 @@ All URIs are relative to *https://api.segmentapis.com* | [**getFilteredAtSourceMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getFilteredAtSourceMetricsFromDeliveryOverview) | **GET** /delivery-overview/filtered-at-source | Get Filtered At Source Metrics from Delivery Overview | | [**getIngressFailedMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getIngressFailedMetricsFromDeliveryOverview) | **GET** /delivery-overview/failed-on-ingest | Get Ingress Failed Metrics from Delivery Overview | | [**getIngressSuccessMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getIngressSuccessMetricsFromDeliveryOverview) | **GET** /delivery-overview/successfully-received | Get Ingress Success Metrics from Delivery Overview | +| [**getLinkedAudienceSuccessMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getLinkedAudienceSuccessMetricsFromDeliveryOverview) | **GET** /delivery-overview/audience/success | Get Linked Audience Success Metrics from Delivery Overview | @@ -132,9 +133,9 @@ public class Example { String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `appVersion`, `subscription Id`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `group By`. If you would like to view retry attempts for a successful delivery, you can filter `discard Reason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getEgressSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -159,9 +160,9 @@ public class Example { | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `appVersion`, `subscription Id`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `group By`. If you would like to view retry attempts for a successful delivery, you can filter `discard Reason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -221,7 +222,7 @@ public class Example { String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -248,7 +249,7 @@ public class Example { | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | | **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -528,3 +529,90 @@ public class Example { | **422** | Validation failure | - | | **429** | Too many requests | - | + +## Operation: getLinkedAudienceSuccessMetricsFromDeliveryOverview + +> GetEgressFailedMetricsFromDeliveryOverview200Response getLinkedAudienceSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination) + +Get Linked Audience Success Metrics from Delivery Overview + +Get events successfully delivered for Linked Audiences. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.DeliveryOverviewApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); + String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. + String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. + String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. + String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. + DeliveryOverviewAudienceFilterBy filter = new DeliveryOverviewAudienceFilterBy(); // DeliveryOverviewAudienceFilterBy | An optional filter for `eventName`, `eventType`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. + try { + GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getLinkedAudienceSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DeliveryOverviewApi#getLinkedAudienceSuccessMetricsFromDeliveryOverview"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | +| **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | +| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | +| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | +| **filter** | [**DeliveryOverviewAudienceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | + +### Return type + +[**GetEgressFailedMetricsFromDeliveryOverview200Response**](GetEgressFailedMetricsFromDeliveryOverview200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1beta+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/docs/DestinationsApi.md b/docs/DestinationsApi.md index 22361c8e..6022c56b 100644 --- a/docs/DestinationsApi.md +++ b/docs/DestinationsApi.md @@ -97,7 +97,7 @@ public class Example { Create Destination Subscription -Creates a new Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 50 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Creates a new Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -622,7 +622,7 @@ public class Example { Remove Subscription from Destination -Deletes an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 50 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Deletes an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -772,7 +772,7 @@ public class Example { Update Subscription for Destination -Updates an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 50 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Updates an existing Destination subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index e46ae2cf..43636cf7 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -523,6 +523,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryMetricsSummaryBeta .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeliveryOverviewAudienceFilterBy + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryOverviewDestinationFilterBy .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index 236e3df9..3a560542 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -18,6 +18,7 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; +import com.segment.publicapi.models.DeliveryOverviewAudienceFilterBy; import com.segment.publicapi.models.DeliveryOverviewDestinationFilterBy; import com.segment.publicapi.models.DeliveryOverviewSourceFilterBy; import com.segment.publicapi.models.DeliveryOverviewSuccessfullyReceivedFilterBy; @@ -476,8 +477,8 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * the result by. Valid options are: `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -486,11 +487,11 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `appVersion`, `subscription Id`, - * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `group By`. If you would like to view retry attempts - * for a successful delivery, you can filter `discard Reason` from + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -678,8 +679,8 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * the result by. Valid options are: `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -688,11 +689,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `appVersion`, `subscription Id`, - * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `group By`. If you would like to view retry attempts - * for a successful delivery, you can filter `discard Reason` from + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -745,8 +746,8 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * the result by. Valid options are: `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -755,11 +756,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `appVersion`, `subscription Id`, - * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `group By`. If you would like to view retry attempts - * for a successful delivery, you can filter `discard Reason` from + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -815,8 +816,8 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * the result by. Valid options are: `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -825,11 +826,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `appVersion`, `subscription Id`, - * `activationId`, `audienceId`, or `spaceId` that can be - * applied in addition to a `group By`. If you would like to view retry attempts - * for a successful delivery, you can filter `discard Reason` from + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. If you would like to view retry attempts + * for a successful delivery, you can filter `discardReason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -897,10 +898,10 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `group By`. This parameter exists in beta. (optional) + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback Callback for upload/download progress @@ -1096,10 +1097,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `group By`. This parameter exists in beta. (optional) + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1160,10 +1161,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `group By`. This parameter exists in beta. (optional) + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1227,10 +1228,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `event Name`, `event Type`, - * `discard Reason`, `app Version`, `subscription Id`, + * @param filter An optional filter for `eventName`, `eventType`, + * `discardReason`, `appVersion`, `subscriptionId`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `group By`. This parameter exists in beta. (optional) + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback The callback to be executed when the API call finishes @@ -2315,4 +2316,395 @@ public okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + + /** + * Build call for getLinkedAudienceSuccessMetricsFromDeliveryOverview + * + * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) + * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in + * beta. (required) + * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the + * requested timeframe, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested + * timeframe, noninclusive. This parameter exists in beta. (required) + * @param groupBy A comma-delimited list of strings representing one or more dimensions to group + * the result by. Valid options are: `eventName`, `eventType`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) + * @param granularity The size of each bucket in the requested window. Based on the granularity + * chosen, there are restrictions on the time range you can query: **Minute**: - Max time + * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time + * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time + * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in + * beta. (required) + * @param filter An optional filter for `eventName`, `eventType`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * @param pagination Params to specify the page cursor and count. This parameter exists in beta. + * (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getLinkedAudienceSuccessMetricsFromDeliveryOverviewCall( + String sourceId, + String destinationConfigId, + String startTime, + String endTime, + List groupBy, + String granularity, + DeliveryOverviewAudienceFilterBy filter, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/delivery-overview/audience/success"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sourceId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sourceId", sourceId)); + } + + if (destinationConfigId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("destinationConfigId", destinationConfigId)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (groupBy != null) { + localVarCollectionQueryParams.addAll( + localVarApiClient.parameterToPairs("multi", "groupBy", groupBy)); + } + + if (granularity != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("granularity", granularity)); + } + + if (filter != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); + } + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1beta+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getLinkedAudienceSuccessMetricsFromDeliveryOverviewValidateBeforeCall( + String sourceId, + String destinationConfigId, + String startTime, + String endTime, + List groupBy, + String granularity, + DeliveryOverviewAudienceFilterBy filter, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'sourceId' is set + if (sourceId == null) { + throw new ApiException( + "Missing the required parameter 'sourceId' when calling" + + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); + } + + // verify the required parameter 'destinationConfigId' is set + if (destinationConfigId == null) { + throw new ApiException( + "Missing the required parameter 'destinationConfigId' when calling" + + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); + } + + // verify the required parameter 'startTime' is set + if (startTime == null) { + throw new ApiException( + "Missing the required parameter 'startTime' when calling" + + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); + } + + // verify the required parameter 'endTime' is set + if (endTime == null) { + throw new ApiException( + "Missing the required parameter 'endTime' when calling" + + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); + } + + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException( + "Missing the required parameter 'granularity' when calling" + + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); + } + + return getLinkedAudienceSuccessMetricsFromDeliveryOverviewCall( + sourceId, + destinationConfigId, + startTime, + endTime, + groupBy, + granularity, + filter, + pagination, + _callback); + } + + /** + * Get Linked Audience Success Metrics from Delivery Overview Get events successfully delivered + * for Linked Audiences. + * + * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) + * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in + * beta. (required) + * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the + * requested timeframe, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested + * timeframe, noninclusive. This parameter exists in beta. (required) + * @param groupBy A comma-delimited list of strings representing one or more dimensions to group + * the result by. Valid options are: `eventName`, `eventType`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) + * @param granularity The size of each bucket in the requested window. Based on the granularity + * chosen, there are restrictions on the time range you can query: **Minute**: - Max time + * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time + * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time + * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in + * beta. (required) + * @param filter An optional filter for `eventName`, `eventType`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * @param pagination Params to specify the page cursor and count. This parameter exists in beta. + * (optional) + * @return GetEgressFailedMetricsFromDeliveryOverview200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetEgressFailedMetricsFromDeliveryOverview200Response + getLinkedAudienceSuccessMetricsFromDeliveryOverview( + String sourceId, + String destinationConfigId, + String startTime, + String endTime, + List groupBy, + String granularity, + DeliveryOverviewAudienceFilterBy filter, + PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + getLinkedAudienceSuccessMetricsFromDeliveryOverviewWithHttpInfo( + sourceId, + destinationConfigId, + startTime, + endTime, + groupBy, + granularity, + filter, + pagination); + return localVarResp.getData(); + } + + /** + * Get Linked Audience Success Metrics from Delivery Overview Get events successfully delivered + * for Linked Audiences. + * + * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) + * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in + * beta. (required) + * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the + * requested timeframe, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested + * timeframe, noninclusive. This parameter exists in beta. (required) + * @param groupBy A comma-delimited list of strings representing one or more dimensions to group + * the result by. Valid options are: `eventName`, `eventType`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) + * @param granularity The size of each bucket in the requested window. Based on the granularity + * chosen, there are restrictions on the time range you can query: **Minute**: - Max time + * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time + * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time + * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in + * beta. (required) + * @param filter An optional filter for `eventName`, `eventType`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * @param pagination Params to specify the page cursor and count. This parameter exists in beta. + * (optional) + * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + getLinkedAudienceSuccessMetricsFromDeliveryOverviewWithHttpInfo( + String sourceId, + String destinationConfigId, + String startTime, + String endTime, + List groupBy, + String granularity, + DeliveryOverviewAudienceFilterBy filter, + PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + getLinkedAudienceSuccessMetricsFromDeliveryOverviewValidateBeforeCall( + sourceId, + destinationConfigId, + startTime, + endTime, + groupBy, + granularity, + filter, + pagination, + null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Linked Audience Success Metrics from Delivery Overview (asynchronously) Get events + * successfully delivered for Linked Audiences. + * + * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) + * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in + * beta. (required) + * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the + * requested timeframe, inclusive. This parameter exists in beta. (required) + * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested + * timeframe, noninclusive. This parameter exists in beta. (required) + * @param groupBy A comma-delimited list of strings representing one or more dimensions to group + * the result by. Valid options are: `eventName`, `eventType`, + * `activationId`, `audienceId`, and `spaceId`. This parameter + * exists in beta. (optional) + * @param granularity The size of each bucket in the requested window. Based on the granularity + * chosen, there are restrictions on the time range you can query: **Minute**: - Max time + * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time + * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time + * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in + * beta. (required) + * @param filter An optional filter for `eventName`, `eventType`, + * `activationId`, `audienceId`, and/or `spaceId` that can be + * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * @param pagination Params to specify the page cursor and count. This parameter exists in beta. + * (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getLinkedAudienceSuccessMetricsFromDeliveryOverviewAsync( + String sourceId, + String destinationConfigId, + String startTime, + String endTime, + List groupBy, + String granularity, + DeliveryOverviewAudienceFilterBy filter, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getLinkedAudienceSuccessMetricsFromDeliveryOverviewValidateBeforeCall( + sourceId, + destinationConfigId, + startTime, + endTime, + groupBy, + granularity, + filter, + pagination, + _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/segment/publicapi/api/DestinationsApi.java b/src/main/java/com/segment/publicapi/api/DestinationsApi.java index c911715c..4709a0f8 100644 --- a/src/main/java/com/segment/publicapi/api/DestinationsApi.java +++ b/src/main/java/com/segment/publicapi/api/DestinationsApi.java @@ -361,7 +361,7 @@ private okhttp3.Call createDestinationSubscriptionValidateBeforeCall( * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the * Destination Subscriptions feature enabled. Please reach out to your customer success manager - * for more information. The rate limit for this endpoint is 50 requests per minute, which is + * for more information. The rate limit for this endpoint is 5 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -395,7 +395,7 @@ public CreateDestinationSubscription200Response createDestinationSubscription( * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • * In order to successfully call this endpoint, the specified Workspace needs to have the * Destination Subscriptions feature enabled. Please reach out to your customer success manager - * for more information. The rate limit for this endpoint is 50 requests per minute, which is + * for more information. The rate limit for this endpoint is 5 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. @@ -432,10 +432,10 @@ public CreateDestinationSubscription200Response createDestinationSubscription( * This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. The rate limit for this endpoint is 50 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * customer success manager for more information. The rate limit for this endpoint is 5 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param createDestinationSubscriptionAlphaInput (required) @@ -1733,10 +1733,10 @@ private okhttp3.Call removeSubscriptionFromDestinationValidateBeforeCall( * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. The rate limit for this endpoint is 50 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * customer success manager for more information. The rate limit for this endpoint is 5 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -1764,10 +1764,10 @@ public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestin * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. The rate limit for this endpoint is 50 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * customer success manager for more information. The rate limit for this endpoint is 5 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -1798,7 +1798,7 @@ public RemoveSubscriptionFromDestination200Response removeSubscriptionFromDestin * subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending * an email to friends@segment.com. • In order to successfully call this endpoint, the specified * Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to - * your customer success manager for more information. The rate limit for this endpoint is 50 + * your customer success manager for more information. The rate limit for this endpoint is 5 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. @@ -2165,10 +2165,10 @@ private okhttp3.Call updateSubscriptionForDestinationValidateBeforeCall( * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. The rate limit for this endpoint is 50 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * customer success manager for more information. The rate limit for this endpoint is 5 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -2201,10 +2201,10 @@ public UpdateSubscriptionForDestination200Response updateSubscriptionForDestinat * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace * needs to have the Destination Subscriptions feature enabled. Please reach out to your - * customer success manager for more information. The rate limit for this endpoint is 50 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * customer success manager for more information. The rate limit for this endpoint is 5 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param destinationId (required) * @param id (required) @@ -2241,7 +2241,7 @@ public UpdateSubscriptionForDestination200Response updateSubscriptionForDestinat * subscription. • This endpoint is in **Alpha** testing. Please submit any feedback by sending * an email to friends@segment.com. • In order to successfully call this endpoint, the specified * Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to - * your customer success manager for more information. The rate limit for this endpoint is 50 + * your customer success manager for more information. The rate limit for this endpoint is 5 * requests per minute, which is lower than the default due to access pattern restrictions. Once * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java new file mode 100644 index 00000000..5790fe7e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java @@ -0,0 +1,403 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * The `DeliveryOverviewAudienceFilterBy` object is a map of the filterable fields and + * their values. + */ +public class DeliveryOverviewAudienceFilterBy { + public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; + + @SerializedName(SERIALIZED_NAME_EVENT_NAME) + private List eventName; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private List eventType; + + public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) + private List activationId; + + public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) + private List audienceId; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private List spaceId; + + public DeliveryOverviewAudienceFilterBy() {} + + public DeliveryOverviewAudienceFilterBy eventName(List eventName) { + + this.eventName = eventName; + return this; + } + + public DeliveryOverviewAudienceFilterBy addEventNameItem(String eventNameItem) { + if (this.eventName == null) { + this.eventName = new ArrayList<>(); + } + this.eventName.add(eventNameItem); + return this; + } + + /** + * A list of strings of event names. + * + * @return eventName + */ + @javax.annotation.Nullable + public List getEventName() { + return eventName; + } + + public void setEventName(List eventName) { + this.eventName = eventName; + } + + public DeliveryOverviewAudienceFilterBy eventType(List eventType) { + + this.eventType = eventType; + return this; + } + + public DeliveryOverviewAudienceFilterBy addEventTypeItem(String eventTypeItem) { + if (this.eventType == null) { + this.eventType = new ArrayList<>(); + } + this.eventType.add(eventTypeItem); + return this; + } + + /** + * A list of strings of event types. Valid options are: `alias`, `group`, + * `identify`, `page`, `screen`, and `track`. + * + * @return eventType + */ + @javax.annotation.Nullable + public List getEventType() { + return eventType; + } + + public void setEventType(List eventType) { + this.eventType = eventType; + } + + public DeliveryOverviewAudienceFilterBy activationId(List activationId) { + + this.activationId = activationId; + return this; + } + + public DeliveryOverviewAudienceFilterBy addActivationIdItem(String activationIdItem) { + if (this.activationId == null) { + this.activationId = new ArrayList<>(); + } + this.activationId.add(activationIdItem); + return this; + } + + /** + * A list of strings of event context IDs from a Linked Audience mapping/activation. + * + * @return activationId + */ + @javax.annotation.Nullable + public List getActivationId() { + return activationId; + } + + public void setActivationId(List activationId) { + this.activationId = activationId; + } + + public DeliveryOverviewAudienceFilterBy audienceId(List audienceId) { + + this.audienceId = audienceId; + return this; + } + + public DeliveryOverviewAudienceFilterBy addAudienceIdItem(String audienceIdItem) { + if (this.audienceId == null) { + this.audienceId = new ArrayList<>(); + } + this.audienceId.add(audienceIdItem); + return this; + } + + /** + * A list of strings of audience IDs for a Linked Audience. + * + * @return audienceId + */ + @javax.annotation.Nullable + public List getAudienceId() { + return audienceId; + } + + public void setAudienceId(List audienceId) { + this.audienceId = audienceId; + } + + public DeliveryOverviewAudienceFilterBy spaceId(List spaceId) { + + this.spaceId = spaceId; + return this; + } + + public DeliveryOverviewAudienceFilterBy addSpaceIdItem(String spaceIdItem) { + if (this.spaceId == null) { + this.spaceId = new ArrayList<>(); + } + this.spaceId.add(spaceIdItem); + return this; + } + + /** + * A list of strings of space IDs for a Linked Audience. + * + * @return spaceId + */ + @javax.annotation.Nullable + public List getSpaceId() { + return spaceId; + } + + public void setSpaceId(List spaceId) { + this.spaceId = spaceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryOverviewAudienceFilterBy deliveryOverviewAudienceFilterBy = + (DeliveryOverviewAudienceFilterBy) o; + return Objects.equals(this.eventName, deliveryOverviewAudienceFilterBy.eventName) + && Objects.equals(this.eventType, deliveryOverviewAudienceFilterBy.eventType) + && Objects.equals(this.activationId, deliveryOverviewAudienceFilterBy.activationId) + && Objects.equals(this.audienceId, deliveryOverviewAudienceFilterBy.audienceId) + && Objects.equals(this.spaceId, deliveryOverviewAudienceFilterBy.spaceId); + } + + @Override + public int hashCode() { + return Objects.hash(eventName, eventType, activationId, audienceId, spaceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryOverviewAudienceFilterBy {\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("eventName"); + openapiFields.add("eventType"); + openapiFields.add("activationId"); + openapiFields.add("audienceId"); + openapiFields.add("spaceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DeliveryOverviewAudienceFilterBy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeliveryOverviewAudienceFilterBy.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeliveryOverviewAudienceFilterBy is" + + " not found in the empty JSON string", + DeliveryOverviewAudienceFilterBy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DeliveryOverviewAudienceFilterBy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeliveryOverviewAudienceFilterBy` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("eventName") != null + && !jsonObj.get("eventName").isJsonNull() + && !jsonObj.get("eventName").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventName` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("eventType") != null + && !jsonObj.get("eventType").isJsonNull() + && !jsonObj.get("eventType").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventType` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("eventType").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("activationId") != null + && !jsonObj.get("activationId").isJsonNull() + && !jsonObj.get("activationId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activationId` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("activationId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("audienceId") != null + && !jsonObj.get("audienceId").isJsonNull() + && !jsonObj.get("audienceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceId` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audienceId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("spaceId") != null + && !jsonObj.get("spaceId").isJsonNull() + && !jsonObj.get("spaceId").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("spaceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeliveryOverviewAudienceFilterBy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeliveryOverviewAudienceFilterBy' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DeliveryOverviewAudienceFilterBy.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeliveryOverviewAudienceFilterBy value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeliveryOverviewAudienceFilterBy read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeliveryOverviewAudienceFilterBy given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeliveryOverviewAudienceFilterBy + * @throws IOException if the JSON string is invalid with respect to + * DeliveryOverviewAudienceFilterBy + */ + public static DeliveryOverviewAudienceFilterBy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeliveryOverviewAudienceFilterBy.class); + } + + /** + * Convert an instance of DeliveryOverviewAudienceFilterBy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java index 3e800c92..102fe006 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java @@ -262,7 +262,7 @@ public DeliveryOverviewDestinationFilterBy addAudienceIdItem(String audienceIdIt } /** - * A list of strings of audience IDs for a Linked Audience. + * A list of strings of audienceIDs for a Linked Audience. * * @return audienceId */ @@ -290,7 +290,7 @@ public DeliveryOverviewDestinationFilterBy addSpaceIdItem(String spaceIdItem) { } /** - * A list of strings of space IDs for a Linked Audience. + * A list of strings of spaceIDs for a Linked Audience. * * @return spaceId */ diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java index a5cc2ff8..2394ad7f 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataPlatformsV1.java @@ -54,6 +54,11 @@ public class DestinationMetadataPlatformsV1 { @SerializedName(SERIALIZED_NAME_CLOUD_APP_OBJECT) private Boolean cloudAppObject; + public static final String SERIALIZED_NAME_LINKED_AUDIENCES = "linkedAudiences"; + + @SerializedName(SERIALIZED_NAME_LINKED_AUDIENCES) + private Boolean linkedAudiences; + public DestinationMetadataPlatformsV1() {} public DestinationMetadataPlatformsV1 browser(Boolean browser) { @@ -156,6 +161,26 @@ public void setCloudAppObject(Boolean cloudAppObject) { this.cloudAppObject = cloudAppObject; } + public DestinationMetadataPlatformsV1 linkedAudiences(Boolean linkedAudiences) { + + this.linkedAudiences = linkedAudiences; + return this; + } + + /** + * Whether this Destination supports linked audiences. + * + * @return linkedAudiences + */ + @javax.annotation.Nullable + public Boolean getLinkedAudiences() { + return linkedAudiences; + } + + public void setLinkedAudiences(Boolean linkedAudiences) { + this.linkedAudiences = linkedAudiences; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -171,12 +196,14 @@ public boolean equals(Object o) { && Objects.equals(this.mobile, destinationMetadataPlatformsV1.mobile) && Objects.equals(this.warehouse, destinationMetadataPlatformsV1.warehouse) && Objects.equals( - this.cloudAppObject, destinationMetadataPlatformsV1.cloudAppObject); + this.cloudAppObject, destinationMetadataPlatformsV1.cloudAppObject) + && Objects.equals( + this.linkedAudiences, destinationMetadataPlatformsV1.linkedAudiences); } @Override public int hashCode() { - return Objects.hash(browser, server, mobile, warehouse, cloudAppObject); + return Objects.hash(browser, server, mobile, warehouse, cloudAppObject, linkedAudiences); } @Override @@ -188,6 +215,7 @@ public String toString() { sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); sb.append(" warehouse: ").append(toIndentedString(warehouse)).append("\n"); sb.append(" cloudAppObject: ").append(toIndentedString(cloudAppObject)).append("\n"); + sb.append(" linkedAudiences: ").append(toIndentedString(linkedAudiences)).append("\n"); sb.append("}"); return sb.toString(); } @@ -214,6 +242,7 @@ private String toIndentedString(Object o) { openapiFields.add("mobile"); openapiFields.add("warehouse"); openapiFields.add("cloudAppObject"); + openapiFields.add("linkedAudiences"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java index 129523c4..c7d7b9f3 100644 --- a/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java @@ -31,7 +31,7 @@ import java.util.Objects; import java.util.Set; -/** Output of the Delivery Overview public API endpoints. */ +/** Output of the Delivery Overview public api endpoints. */ public class GetDeliveryOverviewMetricsBetaOutput { public static final String SERIALIZED_NAME_TOTAL = "total"; From 53e3a504b674d3cec78276c10e55deb3708cff90 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 5 Nov 2024 22:34:05 +0000 Subject: [PATCH 363/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f059f32d. From 5f3fee341fec407627da508f8decc9d39d3debd0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 13 Nov 2024 16:41:31 +0000 Subject: [PATCH 364/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@1b140032. --- README.md | 8 +- docs/DeliveryOverviewApi.md | 100 +--- docs/FunctionsApi.md | 2 +- docs/ReverseEtlApi.md | 78 --- docs/WorkspacesApi.md | 2 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 12 - .../publicapi/api/DeliveryOverviewApi.java | 472 ++---------------- .../segment/publicapi/api/ReverseEtlApi.java | 221 -------- .../segment/publicapi/api/WorkspacesApi.java | 13 +- ...ncelReverseETLSyncForModel200Response.java | 205 -------- .../CancelReverseETLSyncForModelInput.java | 201 -------- .../CancelReverseETLSyncForModelOutput.java | 283 ----------- .../models/CreateFunctionV1Input.java | 2 - .../DeliveryOverviewAudienceFilterBy.java | 403 --------------- .../DeliveryOverviewDestinationFilterBy.java | 4 +- .../models/DestinationMetadataV1.java | 48 +- .../GetDeliveryOverviewMetricsBetaOutput.java | 2 +- 20 files changed, 105 insertions(+), 1957 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java diff --git a/README.md b/README.md index b1e72e52..24c58a11 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 55.1.0 +Latest API and SDK version: 57.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 55.1.0 + 57.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:55.1.0" + implementation "com.segment.publicapi:segment-publicapi:57.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-55.1.0.jar` +* `target/segment-publicapi-57.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/DeliveryOverviewApi.md b/docs/DeliveryOverviewApi.md index 2d07cf68..dc4089a6 100644 --- a/docs/DeliveryOverviewApi.md +++ b/docs/DeliveryOverviewApi.md @@ -10,7 +10,6 @@ All URIs are relative to *https://api.segmentapis.com* | [**getFilteredAtSourceMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getFilteredAtSourceMetricsFromDeliveryOverview) | **GET** /delivery-overview/filtered-at-source | Get Filtered At Source Metrics from Delivery Overview | | [**getIngressFailedMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getIngressFailedMetricsFromDeliveryOverview) | **GET** /delivery-overview/failed-on-ingest | Get Ingress Failed Metrics from Delivery Overview | | [**getIngressSuccessMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getIngressSuccessMetricsFromDeliveryOverview) | **GET** /delivery-overview/successfully-received | Get Ingress Success Metrics from Delivery Overview | -| [**getLinkedAudienceSuccessMetricsFromDeliveryOverview**](DeliveryOverviewApi.md#getLinkedAudienceSuccessMetricsFromDeliveryOverview) | **GET** /delivery-overview/audience/success | Get Linked Audience Success Metrics from Delivery Overview | @@ -133,9 +132,9 @@ public class Example { String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. + List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `appVersion`, `subscription Id`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `group By`. If you would like to view retry attempts for a successful delivery, you can filter `discard Reason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getEgressSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -160,9 +159,9 @@ public class Example { | **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | | **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested time frame, inclusive. This parameter exists in beta. | | | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | +| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. If you would like to view retry attempts for a successful delivery, you can filter `discardReason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `appVersion`, `subscription Id`, `activationId`, `audienceId`, or `spaceId` that can be applied in addition to a `group By`. If you would like to view retry attempts for a successful delivery, you can filter `discard Reason` from `successes.attempt.1` through `successes.attempt.10`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -222,7 +221,7 @@ public class Example { String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. + DeliveryOverviewDestinationFilterBy filter = new DeliveryOverviewDestinationFilterBy(); // DeliveryOverviewDestinationFilterBy | An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. try { GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getFilteredAtDestinationMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); @@ -249,7 +248,7 @@ public class Example { | **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested time frame, noninclusive. This parameter exists in beta. | | | **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | | **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `discardReason`, `appVersion`, `subscriptionId`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | +| **filter** | [**DeliveryOverviewDestinationFilterBy**](.md)| An optional filter for `event Name`, `event Type`, `discard Reason`, `app Version`, `subscription Id`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `group By`. This parameter exists in beta. | [optional] | | **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | ### Return type @@ -529,90 +528,3 @@ public class Example { | **422** | Validation failure | - | | **429** | Too many requests | - | - -## Operation: getLinkedAudienceSuccessMetricsFromDeliveryOverview - -> GetEgressFailedMetricsFromDeliveryOverview200Response getLinkedAudienceSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination) - -Get Linked Audience Success Metrics from Delivery Overview - -Get events successfully delivered for Linked Audiences. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.DeliveryOverviewApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - DeliveryOverviewApi apiInstance = new DeliveryOverviewApi(defaultClient); - String sourceId = "rh5BDZp6QDHvXFCkibm1pR"; // String | The sourceId for the Workspace. This parameter exists in beta. - String destinationConfigId = "fP7qoQw2HTWt9WdMr718gn"; // String | The id tied to a Workspace Destination. This parameter exists in beta. - String startTime = "2024-01-01T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. - String endTime = "2024-01-03T00:00:00Z"; // String | The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. - List groupBy = Arrays.asList(); // List | A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. - String granularity = "DAY"; // String | The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. - DeliveryOverviewAudienceFilterBy filter = new DeliveryOverviewAudienceFilterBy(); // DeliveryOverviewAudienceFilterBy | An optional filter for `eventName`, `eventType`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. - PaginationInput pagination = new PaginationInput(); // PaginationInput | Params to specify the page cursor and count. This parameter exists in beta. - try { - GetEgressFailedMetricsFromDeliveryOverview200Response result = apiInstance.getLinkedAudienceSuccessMetricsFromDeliveryOverview(sourceId, destinationConfigId, startTime, endTime, groupBy, granularity, filter, pagination); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DeliveryOverviewApi#getLinkedAudienceSuccessMetricsFromDeliveryOverview"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **sourceId** | **String**| The sourceId for the Workspace. This parameter exists in beta. | | -| **destinationConfigId** | **String**| The id tied to a Workspace Destination. This parameter exists in beta. | | -| **startTime** | **String**| The ISO8601 formatted timestamp corresponding to the beginning of the requested timeframe, inclusive. This parameter exists in beta. | | -| **endTime** | **String**| The ISO8601 formatted timestamp corresponding to the end of the requested timeframe, noninclusive. This parameter exists in beta. | | -| **groupBy** | [**List<String>**](String.md)| A comma-delimited list of strings representing one or more dimensions to group the result by. Valid options are: `eventName`, `eventType`, `activationId`, `audienceId`, and `spaceId`. This parameter exists in beta. | [optional] | -| **granularity** | **String**| The size of each bucket in the requested window. Based on the granularity chosen, there are restrictions on the time range you can query: **Minute**: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in beta. | [enum: DAY, HOUR, MINUTE] | -| **filter** | [**DeliveryOverviewAudienceFilterBy**](.md)| An optional filter for `eventName`, `eventType`, `activationId`, `audienceId`, and/or `spaceId` that can be applied in addition to a `groupBy`. This parameter exists in beta. | [optional] | -| **pagination** | [**PaginationInput**](.md)| Params to specify the page cursor and count. This parameter exists in beta. | [optional] | - -### Return type - -[**GetEgressFailedMetricsFromDeliveryOverview200Response**](GetEgressFailedMetricsFromDeliveryOverview200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1beta+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index b35be929..15a621a8 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | ### Return type diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index ae378ca8..14c5812d 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -4,7 +4,6 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**cancelReverseETLSyncForModel**](ReverseEtlApi.md#cancelReverseETLSyncForModel) | **POST** /reverse-etl-models/{modelId}/syncs/{syncId}/cancel | Cancel Reverse ETL Sync for Model | | [**createReverseETLManualSync**](ReverseEtlApi.md#createReverseETLManualSync) | **POST** /reverse-etl-syncs | Create Reverse ETL Manual Sync | | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | @@ -16,83 +15,6 @@ All URIs are relative to *https://api.segmentapis.com* -## Operation: cancelReverseETLSyncForModel - -> CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput) - -Cancel Reverse ETL Sync for Model - -Cancels a sync for a Reverse ETL Connection. It might take a few seconds to completely cancel the sync. Will return an error if the sync is already completed or cancelled. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.ReverseEtlApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "modelId"; // String | - String syncId = "1"; // String | - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = new CancelReverseETLSyncForModelInput(); // CancelReverseETLSyncForModelInput | - try { - CancelReverseETLSyncForModel200Response result = apiInstance.cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ReverseEtlApi#cancelReverseETLSyncForModel"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **modelId** | **String**| | | -| **syncId** | **String**| | | -| **cancelReverseETLSyncForModelInput** | [**CancelReverseETLSyncForModelInput**](CancelReverseETLSyncForModelInput.md)| | | - -### Return type - -[**CancelReverseETLSyncForModel200Response**](CancelReverseETLSyncForModel200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - ## Operation: createReverseETLManualSync > CreateReverseETLManualSync200Response createReverseETLManualSync(createReverseETLManualSyncInput) diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md index 15d1b428..436cb2a5 100644 --- a/docs/WorkspacesApi.md +++ b/docs/WorkspacesApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Get Workspace -Returns the Workspace associated with the token used to access this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the Workspace associated with the token used to access this resource. ### Example diff --git a/pom.xml b/pom.xml index a165e19a..f2cd1d79 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 55.1.0 + 57.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index c1ad2955..14a02f36 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 55.1.0 (Java)"); + setUserAgent("Public API SDK 57.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 11f457be..ad2b50dc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "55.1.0"; + public static final String VERSION = "57.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 43636cf7..7956dd00 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -185,15 +185,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CancelReverseETLSyncForModel200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CancelReverseETLSyncForModelInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -523,9 +514,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryMetricsSummaryBeta .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DeliveryOverviewAudienceFilterBy - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryOverviewDestinationFilterBy .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java index 3a560542..236e3df9 100644 --- a/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java +++ b/src/main/java/com/segment/publicapi/api/DeliveryOverviewApi.java @@ -18,7 +18,6 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.models.DeliveryOverviewAudienceFilterBy; import com.segment.publicapi.models.DeliveryOverviewDestinationFilterBy; import com.segment.publicapi.models.DeliveryOverviewSourceFilterBy; import com.segment.publicapi.models.DeliveryOverviewSuccessfullyReceivedFilterBy; @@ -477,8 +476,8 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -487,11 +486,11 @@ public okhttp3.Call getEgressFailedMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -679,8 +678,8 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -689,11 +688,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -746,8 +745,8 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -756,11 +755,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -816,8 +815,8 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested time * frame, noninclusive. This parameter exists in beta. (required) * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * the result by. Valid options are: `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and `spaceId`. This parameter * exists in beta. (optional) * @param granularity The size of each bucket in the requested window. Based on the granularity @@ -826,11 +825,11 @@ private okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewValidateBeforeCa * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. If you would like to view retry attempts - * for a successful delivery, you can filter `discardReason` from + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `appVersion`, `subscription Id`, + * `activationId`, `audienceId`, or `spaceId` that can be + * applied in addition to a `group By`. If you would like to view retry attempts + * for a successful delivery, you can filter `discard Reason` from * `successes.attempt.1` through `successes.attempt.10`. This parameter * exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. @@ -898,10 +897,10 @@ public okhttp3.Call getEgressSuccessMetricsFromDeliveryOverviewAsync( * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback Callback for upload/download progress @@ -1097,10 +1096,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return GetEgressFailedMetricsFromDeliveryOverview200Response @@ -1161,10 +1160,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> @@ -1228,10 +1227,10 @@ private okhttp3.Call getFilteredAtDestinationMetricsFromDeliveryOverviewValidate * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `discardReason`, `appVersion`, `subscriptionId`, + * @param filter An optional filter for `event Name`, `event Type`, + * `discard Reason`, `app Version`, `subscription Id`, * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) + * applied in addition to a `group By`. This parameter exists in beta. (optional) * @param pagination Params to specify the page cursor and count. This parameter exists in beta. * (optional) * @param _callback The callback to be executed when the API call finishes @@ -2316,395 +2315,4 @@ public okhttp3.Call getIngressSuccessMetricsFromDeliveryOverviewAsync( localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - - /** - * Build call for getLinkedAudienceSuccessMetricsFromDeliveryOverview - * - * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) - * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in - * beta. (required) - * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) - * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `activationId`, `audienceId`, and `spaceId`. This parameter - * exists in beta. (optional) - * @param granularity The size of each bucket in the requested window. Based on the granularity - * chosen, there are restrictions on the time range you can query: **Minute**: - Max time - * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time - * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time - * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in - * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) - * @param pagination Params to specify the page cursor and count. This parameter exists in beta. - * (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getLinkedAudienceSuccessMetricsFromDeliveryOverviewCall( - String sourceId, - String destinationConfigId, - String startTime, - String endTime, - List groupBy, - String granularity, - DeliveryOverviewAudienceFilterBy filter, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/delivery-overview/audience/success"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (sourceId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sourceId", sourceId)); - } - - if (destinationConfigId != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("destinationConfigId", destinationConfigId)); - } - - if (startTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); - } - - if (endTime != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); - } - - if (groupBy != null) { - localVarCollectionQueryParams.addAll( - localVarApiClient.parameterToPairs("multi", "groupBy", groupBy)); - } - - if (granularity != null) { - localVarQueryParams.addAll( - localVarApiClient.parameterToPair("granularity", granularity)); - } - - if (filter != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter", filter)); - } - - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1beta+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getLinkedAudienceSuccessMetricsFromDeliveryOverviewValidateBeforeCall( - String sourceId, - String destinationConfigId, - String startTime, - String endTime, - List groupBy, - String granularity, - DeliveryOverviewAudienceFilterBy filter, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'sourceId' is set - if (sourceId == null) { - throw new ApiException( - "Missing the required parameter 'sourceId' when calling" - + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); - } - - // verify the required parameter 'destinationConfigId' is set - if (destinationConfigId == null) { - throw new ApiException( - "Missing the required parameter 'destinationConfigId' when calling" - + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); - } - - // verify the required parameter 'startTime' is set - if (startTime == null) { - throw new ApiException( - "Missing the required parameter 'startTime' when calling" - + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); - } - - // verify the required parameter 'endTime' is set - if (endTime == null) { - throw new ApiException( - "Missing the required parameter 'endTime' when calling" - + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); - } - - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException( - "Missing the required parameter 'granularity' when calling" - + " getLinkedAudienceSuccessMetricsFromDeliveryOverview(Async)"); - } - - return getLinkedAudienceSuccessMetricsFromDeliveryOverviewCall( - sourceId, - destinationConfigId, - startTime, - endTime, - groupBy, - granularity, - filter, - pagination, - _callback); - } - - /** - * Get Linked Audience Success Metrics from Delivery Overview Get events successfully delivered - * for Linked Audiences. - * - * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) - * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in - * beta. (required) - * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) - * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `activationId`, `audienceId`, and `spaceId`. This parameter - * exists in beta. (optional) - * @param granularity The size of each bucket in the requested window. Based on the granularity - * chosen, there are restrictions on the time range you can query: **Minute**: - Max time - * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time - * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time - * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in - * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) - * @param pagination Params to specify the page cursor and count. This parameter exists in beta. - * (optional) - * @return GetEgressFailedMetricsFromDeliveryOverview200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetEgressFailedMetricsFromDeliveryOverview200Response - getLinkedAudienceSuccessMetricsFromDeliveryOverview( - String sourceId, - String destinationConfigId, - String startTime, - String endTime, - List groupBy, - String granularity, - DeliveryOverviewAudienceFilterBy filter, - PaginationInput pagination) - throws ApiException { - ApiResponse localVarResp = - getLinkedAudienceSuccessMetricsFromDeliveryOverviewWithHttpInfo( - sourceId, - destinationConfigId, - startTime, - endTime, - groupBy, - granularity, - filter, - pagination); - return localVarResp.getData(); - } - - /** - * Get Linked Audience Success Metrics from Delivery Overview Get events successfully delivered - * for Linked Audiences. - * - * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) - * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in - * beta. (required) - * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) - * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `activationId`, `audienceId`, and `spaceId`. This parameter - * exists in beta. (optional) - * @param granularity The size of each bucket in the requested window. Based on the granularity - * chosen, there are restrictions on the time range you can query: **Minute**: - Max time - * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time - * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time - * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in - * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) - * @param pagination Params to specify the page cursor and count. This parameter exists in beta. - * (optional) - * @return ApiResponse<GetEgressFailedMetricsFromDeliveryOverview200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - getLinkedAudienceSuccessMetricsFromDeliveryOverviewWithHttpInfo( - String sourceId, - String destinationConfigId, - String startTime, - String endTime, - List groupBy, - String granularity, - DeliveryOverviewAudienceFilterBy filter, - PaginationInput pagination) - throws ApiException { - okhttp3.Call localVarCall = - getLinkedAudienceSuccessMetricsFromDeliveryOverviewValidateBeforeCall( - sourceId, - destinationConfigId, - startTime, - endTime, - groupBy, - granularity, - filter, - pagination, - null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Linked Audience Success Metrics from Delivery Overview (asynchronously) Get events - * successfully delivered for Linked Audiences. - * - * @param sourceId The sourceId for the Workspace. This parameter exists in beta. (required) - * @param destinationConfigId The id tied to a Workspace Destination. This parameter exists in - * beta. (required) - * @param startTime The ISO8601 formatted timestamp corresponding to the beginning of the - * requested timeframe, inclusive. This parameter exists in beta. (required) - * @param endTime The ISO8601 formatted timestamp corresponding to the end of the requested - * timeframe, noninclusive. This parameter exists in beta. (required) - * @param groupBy A comma-delimited list of strings representing one or more dimensions to group - * the result by. Valid options are: `eventName`, `eventType`, - * `activationId`, `audienceId`, and `spaceId`. This parameter - * exists in beta. (optional) - * @param granularity The size of each bucket in the requested window. Based on the granularity - * chosen, there are restrictions on the time range you can query: **Minute**: - Max time - * range: 4 hours - Oldest possible start time: 48 hours in the past **Hour**: - Max Time - * range: 14 days - Oldest possible start time: 30 days in the past **Day**: - Max time - * range: 30 days - Oldest possible start time: 30 days in the past This parameter exists in - * beta. (required) - * @param filter An optional filter for `eventName`, `eventType`, - * `activationId`, `audienceId`, and/or `spaceId` that can be - * applied in addition to a `groupBy`. This parameter exists in beta. (optional) - * @param pagination Params to specify the page cursor and count. This parameter exists in beta. - * (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getLinkedAudienceSuccessMetricsFromDeliveryOverviewAsync( - String sourceId, - String destinationConfigId, - String startTime, - String endTime, - List groupBy, - String granularity, - DeliveryOverviewAudienceFilterBy filter, - PaginationInput pagination, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getLinkedAudienceSuccessMetricsFromDeliveryOverviewValidateBeforeCall( - sourceId, - destinationConfigId, - startTime, - endTime, - groupBy, - granularity, - filter, - pagination, - _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 0352a333..816d05cc 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -18,8 +18,6 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.models.CancelReverseETLSyncForModel200Response; -import com.segment.publicapi.models.CancelReverseETLSyncForModelInput; import com.segment.publicapi.models.CreateReverseETLManualSync200Response; import com.segment.publicapi.models.CreateReverseETLManualSyncInput; import com.segment.publicapi.models.CreateReverseEtlModel201Response; @@ -76,225 +74,6 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for cancelReverseETLSyncForModel - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call cancelReverseETLSyncForModelCall( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = cancelReverseETLSyncForModelInput; - - // create path and map variables - String localVarPath = - "/reverse-etl-models/{modelId}/syncs/{syncId}/cancel" - .replace( - "{" + "modelId" + "}", - localVarApiClient.escapeString(modelId.toString())) - .replace( - "{" + "syncId" + "}", - localVarApiClient.escapeString(syncId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call cancelReverseETLSyncForModelValidateBeforeCall( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'modelId' is set - if (modelId == null) { - throw new ApiException( - "Missing the required parameter 'modelId' when calling" - + " cancelReverseETLSyncForModel(Async)"); - } - - // verify the required parameter 'syncId' is set - if (syncId == null) { - throw new ApiException( - "Missing the required parameter 'syncId' when calling" - + " cancelReverseETLSyncForModel(Async)"); - } - - // verify the required parameter 'cancelReverseETLSyncForModelInput' is set - if (cancelReverseETLSyncForModelInput == null) { - throw new ApiException( - "Missing the required parameter 'cancelReverseETLSyncForModelInput' when" - + " calling cancelReverseETLSyncForModel(Async)"); - } - - return cancelReverseETLSyncForModelCall( - modelId, syncId, cancelReverseETLSyncForModelInput, _callback); - } - - /** - * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take - * a few seconds to completely cancel the sync. Will return an error if the sync is already - * completed or cancelled. - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @return CancelReverseETLSyncForModel200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) - throws ApiException { - ApiResponse localVarResp = - cancelReverseETLSyncForModelWithHttpInfo( - modelId, syncId, cancelReverseETLSyncForModelInput); - return localVarResp.getData(); - } - - /** - * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take - * a few seconds to completely cancel the sync. Will return an error if the sync is already - * completed or cancelled. - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @return ApiResponse<CancelReverseETLSyncForModel200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - cancelReverseETLSyncForModelWithHttpInfo( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) - throws ApiException { - okhttp3.Call localVarCall = - cancelReverseETLSyncForModelValidateBeforeCall( - modelId, syncId, cancelReverseETLSyncForModelInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Cancel Reverse ETL Sync for Model (asynchronously) Cancels a sync for a Reverse ETL - * Connection. It might take a few seconds to completely cancel the sync. Will return an error - * if the sync is already completed or cancelled. - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call cancelReverseETLSyncForModelAsync( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - cancelReverseETLSyncForModelValidateBeforeCall( - modelId, syncId, cancelReverseETLSyncForModelInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for createReverseETLManualSync * diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index 3a25ae88..c4a0dc0c 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -143,10 +143,6 @@ private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) /** * Get Workspace Returns the Workspace associated with the token used to access this resource. - * The rate limit for this endpoint is 5 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. * * @return GetWorkspace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -167,10 +163,6 @@ public GetWorkspace200Response getWorkspace() throws ApiException { /** * Get Workspace Returns the Workspace associated with the token used to access this resource. - * The rate limit for this endpoint is 5 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. * * @return ApiResponse<GetWorkspace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -192,10 +184,7 @@ public ApiResponse getWorkspaceWithHttpInfo() throws Ap /** * Get Workspace (asynchronously) Returns the Workspace associated with the token used to access - * this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * this resource. * * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java deleted file mode 100644 index 0bcd926f..00000000 --- a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** CancelReverseETLSyncForModel200Response */ -public class CancelReverseETLSyncForModel200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CancelReverseETLSyncForModelOutput data; - - public CancelReverseETLSyncForModel200Response() {} - - public CancelReverseETLSyncForModel200Response data(CancelReverseETLSyncForModelOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public CancelReverseETLSyncForModelOutput getData() { - return data; - } - - public void setData(CancelReverseETLSyncForModelOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel200Response = - (CancelReverseETLSyncForModel200Response) o; - return Objects.equals(this.data, cancelReverseETLSyncForModel200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelReverseETLSyncForModel200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CancelReverseETLSyncForModel200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CancelReverseETLSyncForModel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " CancelReverseETLSyncForModel200Response is not found in the" - + " empty JSON string", - CancelReverseETLSyncForModel200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelReverseETLSyncForModel200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelReverseETLSyncForModel200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CancelReverseETLSyncForModelOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelReverseETLSyncForModel200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'CancelReverseETLSyncForModel200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CancelReverseETLSyncForModel200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, CancelReverseETLSyncForModel200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CancelReverseETLSyncForModel200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CancelReverseETLSyncForModel200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CancelReverseETLSyncForModel200Response - * @throws IOException if the JSON string is invalid with respect to - * CancelReverseETLSyncForModel200Response - */ - public static CancelReverseETLSyncForModel200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModel200Response.class); - } - - /** - * Convert an instance of CancelReverseETLSyncForModel200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java deleted file mode 100644 index e9ada082..00000000 --- a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Defines the parameters needed to cancel a sync for a RETL connection. */ -public class CancelReverseETLSyncForModelInput { - public static final String SERIALIZED_NAME_REASON_FOR_CANCELING = "reasonForCanceling"; - - @SerializedName(SERIALIZED_NAME_REASON_FOR_CANCELING) - private BigDecimal reasonForCanceling; - - public CancelReverseETLSyncForModelInput() {} - - public CancelReverseETLSyncForModelInput reasonForCanceling(BigDecimal reasonForCanceling) { - - this.reasonForCanceling = reasonForCanceling; - return this; - } - - /** - * The reason of canceling the sync. - IncorrectModel = 0 - IncorrectDest = 1 - - * IncorrectKeys = 2 - IncorrectMapping = 3 - Other = 4 - * - * @return reasonForCanceling - */ - @javax.annotation.Nullable - public BigDecimal getReasonForCanceling() { - return reasonForCanceling; - } - - public void setReasonForCanceling(BigDecimal reasonForCanceling) { - this.reasonForCanceling = reasonForCanceling; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = - (CancelReverseETLSyncForModelInput) o; - return Objects.equals( - this.reasonForCanceling, cancelReverseETLSyncForModelInput.reasonForCanceling); - } - - @Override - public int hashCode() { - return Objects.hash(reasonForCanceling); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelReverseETLSyncForModelInput {\n"); - sb.append(" reasonForCanceling: ") - .append(toIndentedString(reasonForCanceling)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("reasonForCanceling"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CancelReverseETLSyncForModelInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CancelReverseETLSyncForModelInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CancelReverseETLSyncForModelInput is" - + " not found in the empty JSON string", - CancelReverseETLSyncForModelInput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelReverseETLSyncForModelInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelReverseETLSyncForModelInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelReverseETLSyncForModelInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CancelReverseETLSyncForModelInput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CancelReverseETLSyncForModelInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CancelReverseETLSyncForModelInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CancelReverseETLSyncForModelInput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CancelReverseETLSyncForModelInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CancelReverseETLSyncForModelInput - * @throws IOException if the JSON string is invalid with respect to - * CancelReverseETLSyncForModelInput - */ - public static CancelReverseETLSyncForModelInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelInput.class); - } - - /** - * Convert an instance of CancelReverseETLSyncForModelInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java deleted file mode 100644 index fce7c461..00000000 --- a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * CancelReverseETLSyncForModelOutput either will return an error or a \"CANCELLING\" - * status. - */ -public class CancelReverseETLSyncForModelOutput { - public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; - - @SerializedName(SERIALIZED_NAME_ERROR_CODE) - private String errorCode; - - public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; - - @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) - private String errorMessage; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public CancelReverseETLSyncForModelOutput() {} - - public CancelReverseETLSyncForModelOutput errorCode(String errorCode) { - - this.errorCode = errorCode; - return this; - } - - /** - * A place holder for a machine-friendly category for an error, if applicable. - - * \"SyncAlreadyCanceled\" - \"SyncFinishedCannotCancel\" - * - * @return errorCode - */ - @javax.annotation.Nullable - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - public CancelReverseETLSyncForModelOutput errorMessage(String errorMessage) { - - this.errorMessage = errorMessage; - return this; - } - - /** - * A place holder for a human-readable description of the error, if applicable. - \"sync - * already canceled\" - \"sync already finished\". - * - * @return errorMessage - */ - @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public CancelReverseETLSyncForModelOutput status(String status) { - - this.status = status; - return this; - } - - /** - * If no error, status will be CANCELLING, as the extract/load might take some time to cancel. - * - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CancelReverseETLSyncForModelOutput cancelReverseETLSyncForModelOutput = - (CancelReverseETLSyncForModelOutput) o; - return Objects.equals(this.errorCode, cancelReverseETLSyncForModelOutput.errorCode) - && Objects.equals( - this.errorMessage, cancelReverseETLSyncForModelOutput.errorMessage) - && Objects.equals(this.status, cancelReverseETLSyncForModelOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(errorCode, errorMessage, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelReverseETLSyncForModelOutput {\n"); - sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("errorCode"); - openapiFields.add("errorMessage"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CancelReverseETLSyncForModelOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CancelReverseETLSyncForModelOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CancelReverseETLSyncForModelOutput is" - + " not found in the empty JSON string", - CancelReverseETLSyncForModelOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelReverseETLSyncForModelOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelReverseETLSyncForModelOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonNull()) - && !jsonObj.get("errorCode").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `errorCode` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("errorCode").toString())); - } - if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) - && !jsonObj.get("errorMessage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `errorMessage` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("errorMessage").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelReverseETLSyncForModelOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CancelReverseETLSyncForModelOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CancelReverseETLSyncForModelOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CancelReverseETLSyncForModelOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CancelReverseETLSyncForModelOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CancelReverseETLSyncForModelOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CancelReverseETLSyncForModelOutput - * @throws IOException if the JSON string is invalid with respect to - * CancelReverseETLSyncForModelOutput - */ - public static CancelReverseETLSyncForModelOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelOutput.class); - } - - /** - * Convert an instance of CancelReverseETLSyncForModelOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 2d938849..8ce751b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,8 +60,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java deleted file mode 100644 index 5790fe7e..00000000 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewAudienceFilterBy.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * The `DeliveryOverviewAudienceFilterBy` object is a map of the filterable fields and - * their values. - */ -public class DeliveryOverviewAudienceFilterBy { - public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; - - @SerializedName(SERIALIZED_NAME_EVENT_NAME) - private List eventName; - - public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; - - @SerializedName(SERIALIZED_NAME_EVENT_TYPE) - private List eventType; - - public static final String SERIALIZED_NAME_ACTIVATION_ID = "activationId"; - - @SerializedName(SERIALIZED_NAME_ACTIVATION_ID) - private List activationId; - - public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) - private List audienceId; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private List spaceId; - - public DeliveryOverviewAudienceFilterBy() {} - - public DeliveryOverviewAudienceFilterBy eventName(List eventName) { - - this.eventName = eventName; - return this; - } - - public DeliveryOverviewAudienceFilterBy addEventNameItem(String eventNameItem) { - if (this.eventName == null) { - this.eventName = new ArrayList<>(); - } - this.eventName.add(eventNameItem); - return this; - } - - /** - * A list of strings of event names. - * - * @return eventName - */ - @javax.annotation.Nullable - public List getEventName() { - return eventName; - } - - public void setEventName(List eventName) { - this.eventName = eventName; - } - - public DeliveryOverviewAudienceFilterBy eventType(List eventType) { - - this.eventType = eventType; - return this; - } - - public DeliveryOverviewAudienceFilterBy addEventTypeItem(String eventTypeItem) { - if (this.eventType == null) { - this.eventType = new ArrayList<>(); - } - this.eventType.add(eventTypeItem); - return this; - } - - /** - * A list of strings of event types. Valid options are: `alias`, `group`, - * `identify`, `page`, `screen`, and `track`. - * - * @return eventType - */ - @javax.annotation.Nullable - public List getEventType() { - return eventType; - } - - public void setEventType(List eventType) { - this.eventType = eventType; - } - - public DeliveryOverviewAudienceFilterBy activationId(List activationId) { - - this.activationId = activationId; - return this; - } - - public DeliveryOverviewAudienceFilterBy addActivationIdItem(String activationIdItem) { - if (this.activationId == null) { - this.activationId = new ArrayList<>(); - } - this.activationId.add(activationIdItem); - return this; - } - - /** - * A list of strings of event context IDs from a Linked Audience mapping/activation. - * - * @return activationId - */ - @javax.annotation.Nullable - public List getActivationId() { - return activationId; - } - - public void setActivationId(List activationId) { - this.activationId = activationId; - } - - public DeliveryOverviewAudienceFilterBy audienceId(List audienceId) { - - this.audienceId = audienceId; - return this; - } - - public DeliveryOverviewAudienceFilterBy addAudienceIdItem(String audienceIdItem) { - if (this.audienceId == null) { - this.audienceId = new ArrayList<>(); - } - this.audienceId.add(audienceIdItem); - return this; - } - - /** - * A list of strings of audience IDs for a Linked Audience. - * - * @return audienceId - */ - @javax.annotation.Nullable - public List getAudienceId() { - return audienceId; - } - - public void setAudienceId(List audienceId) { - this.audienceId = audienceId; - } - - public DeliveryOverviewAudienceFilterBy spaceId(List spaceId) { - - this.spaceId = spaceId; - return this; - } - - public DeliveryOverviewAudienceFilterBy addSpaceIdItem(String spaceIdItem) { - if (this.spaceId == null) { - this.spaceId = new ArrayList<>(); - } - this.spaceId.add(spaceIdItem); - return this; - } - - /** - * A list of strings of space IDs for a Linked Audience. - * - * @return spaceId - */ - @javax.annotation.Nullable - public List getSpaceId() { - return spaceId; - } - - public void setSpaceId(List spaceId) { - this.spaceId = spaceId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeliveryOverviewAudienceFilterBy deliveryOverviewAudienceFilterBy = - (DeliveryOverviewAudienceFilterBy) o; - return Objects.equals(this.eventName, deliveryOverviewAudienceFilterBy.eventName) - && Objects.equals(this.eventType, deliveryOverviewAudienceFilterBy.eventType) - && Objects.equals(this.activationId, deliveryOverviewAudienceFilterBy.activationId) - && Objects.equals(this.audienceId, deliveryOverviewAudienceFilterBy.audienceId) - && Objects.equals(this.spaceId, deliveryOverviewAudienceFilterBy.spaceId); - } - - @Override - public int hashCode() { - return Objects.hash(eventName, eventType, activationId, audienceId, spaceId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeliveryOverviewAudienceFilterBy {\n"); - sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); - sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" activationId: ").append(toIndentedString(activationId)).append("\n"); - sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("eventName"); - openapiFields.add("eventType"); - openapiFields.add("activationId"); - openapiFields.add("audienceId"); - openapiFields.add("spaceId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * DeliveryOverviewAudienceFilterBy - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DeliveryOverviewAudienceFilterBy.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DeliveryOverviewAudienceFilterBy is" - + " not found in the empty JSON string", - DeliveryOverviewAudienceFilterBy.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DeliveryOverviewAudienceFilterBy.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DeliveryOverviewAudienceFilterBy` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("eventName") != null - && !jsonObj.get("eventName").isJsonNull() - && !jsonObj.get("eventName").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventName` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("eventName").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("eventType") != null - && !jsonObj.get("eventType").isJsonNull() - && !jsonObj.get("eventType").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventType` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("eventType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("activationId") != null - && !jsonObj.get("activationId").isJsonNull() - && !jsonObj.get("activationId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activationId` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("activationId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("audienceId") != null - && !jsonObj.get("audienceId").isJsonNull() - && !jsonObj.get("audienceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceId` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("audienceId").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("spaceId") != null - && !jsonObj.get("spaceId").isJsonNull() - && !jsonObj.get("spaceId").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("spaceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DeliveryOverviewAudienceFilterBy.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DeliveryOverviewAudienceFilterBy' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(DeliveryOverviewAudienceFilterBy.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DeliveryOverviewAudienceFilterBy value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DeliveryOverviewAudienceFilterBy read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DeliveryOverviewAudienceFilterBy given an JSON string - * - * @param jsonString JSON string - * @return An instance of DeliveryOverviewAudienceFilterBy - * @throws IOException if the JSON string is invalid with respect to - * DeliveryOverviewAudienceFilterBy - */ - public static DeliveryOverviewAudienceFilterBy fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DeliveryOverviewAudienceFilterBy.class); - } - - /** - * Convert an instance of DeliveryOverviewAudienceFilterBy to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java index 102fe006..3e800c92 100644 --- a/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java +++ b/src/main/java/com/segment/publicapi/models/DeliveryOverviewDestinationFilterBy.java @@ -262,7 +262,7 @@ public DeliveryOverviewDestinationFilterBy addAudienceIdItem(String audienceIdIt } /** - * A list of strings of audienceIDs for a Linked Audience. + * A list of strings of audience IDs for a Linked Audience. * * @return audienceId */ @@ -290,7 +290,7 @@ public DeliveryOverviewDestinationFilterBy addSpaceIdItem(String spaceIdItem) { } /** - * A list of strings of spaceIDs for a Linked Audience. + * A list of strings of space IDs for a Linked Audience. * * @return spaceId */ diff --git a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java index 2b2071cf..136424e8 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationMetadataV1.java @@ -192,6 +192,12 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REGION_ENDPOINTS) private List regionEndpoints; + public static final String SERIALIZED_NAME_MULTI_INSTANCE_SUPPORTED_VERSION = + "multiInstanceSupportedVersion"; + + @SerializedName(SERIALIZED_NAME_MULTI_INSTANCE_SUPPORTED_VERSION) + private String multiInstanceSupportedVersion; + public DestinationMetadataV1() {} public DestinationMetadataV1 id(String id) { @@ -670,6 +676,27 @@ public void setRegionEndpoints(List regionEndpoints) { this.regionEndpoints = regionEndpoints; } + public DestinationMetadataV1 multiInstanceSupportedVersion( + String multiInstanceSupportedVersion) { + + this.multiInstanceSupportedVersion = multiInstanceSupportedVersion; + return this; + } + + /** + * This Destination's support for multiple instance types. + * + * @return multiInstanceSupportedVersion + */ + @javax.annotation.Nullable + public String getMultiInstanceSupportedVersion() { + return multiInstanceSupportedVersion; + } + + public void setMultiInstanceSupportedVersion(String multiInstanceSupportedVersion) { + this.multiInstanceSupportedVersion = multiInstanceSupportedVersion; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -698,7 +725,10 @@ public boolean equals(Object o) { && Objects.equals(this.contacts, destinationMetadataV1.contacts) && Objects.equals(this.partnerOwned, destinationMetadataV1.partnerOwned) && Objects.equals(this.supportedRegions, destinationMetadataV1.supportedRegions) - && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints); + && Objects.equals(this.regionEndpoints, destinationMetadataV1.regionEndpoints) + && Objects.equals( + this.multiInstanceSupportedVersion, + destinationMetadataV1.multiInstanceSupportedVersion); } @Override @@ -723,7 +753,8 @@ public int hashCode() { contacts, partnerOwned, supportedRegions, - regionEndpoints); + regionEndpoints, + multiInstanceSupportedVersion); } @Override @@ -754,6 +785,9 @@ public String toString() { sb.append(" partnerOwned: ").append(toIndentedString(partnerOwned)).append("\n"); sb.append(" supportedRegions: ").append(toIndentedString(supportedRegions)).append("\n"); sb.append(" regionEndpoints: ").append(toIndentedString(regionEndpoints)).append("\n"); + sb.append(" multiInstanceSupportedVersion: ") + .append(toIndentedString(multiInstanceSupportedVersion)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -795,6 +829,7 @@ private String toIndentedString(Object o) { openapiFields.add("partnerOwned"); openapiFields.add("supportedRegions"); openapiFields.add("regionEndpoints"); + openapiFields.add("multiInstanceSupportedVersion"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1029,6 +1064,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("regionEndpoints").toString())); } + if ((jsonObj.get("multiInstanceSupportedVersion") != null + && !jsonObj.get("multiInstanceSupportedVersion").isJsonNull()) + && !jsonObj.get("multiInstanceSupportedVersion").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `multiInstanceSupportedVersion` to be a primitive" + + " type in the JSON string but got `%s`", + jsonObj.get("multiInstanceSupportedVersion").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java index c7d7b9f3..129523c4 100644 --- a/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetDeliveryOverviewMetricsBetaOutput.java @@ -31,7 +31,7 @@ import java.util.Objects; import java.util.Set; -/** Output of the Delivery Overview public api endpoints. */ +/** Output of the Delivery Overview public API endpoints. */ public class GetDeliveryOverviewMetricsBetaOutput { public static final String SERIALIZED_NAME_TOTAL = "total"; From bccaeff95c8d775cbdfe1100ee537abdbcb38826 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 13 Nov 2024 16:42:38 +0000 Subject: [PATCH 365/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c36e9704. From 0461efa394913f827f02c7360b9f732b6230f86f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 14 Nov 2024 21:45:58 +0000 Subject: [PATCH 366/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@54d5e636. --- README.md | 8 +- docs/DbtApi.md | 82 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../com/segment/publicapi/api/DbtApi.java | 234 +++++++++++++++ .../CreateDbtModelSyncTrigger200Response.java | 203 +++++++++++++ .../CreateDbtModelSyncTriggerInput.java | 213 +++++++++++++ .../CreateDbtModelSyncTriggerOutput.java | 212 +++++++++++++ .../publicapi/models/DbtModelSyncTrigger.java | 279 ++++++++++++++++++ 11 files changed, 1241 insertions(+), 7 deletions(-) create mode 100644 docs/DbtApi.md create mode 100644 src/main/java/com/segment/publicapi/api/DbtApi.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java diff --git a/README.md b/README.md index 24c58a11..02026526 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.0.0 +Latest API and SDK version: 57.0.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.0.0 + 57.0.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.0.0" + implementation "com.segment.publicapi:segment-publicapi:57.0.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.0.0.jar` +* `target/segment-publicapi-57.0.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/DbtApi.md b/docs/DbtApi.md new file mode 100644 index 00000000..8bfefd13 --- /dev/null +++ b/docs/DbtApi.md @@ -0,0 +1,82 @@ +# DbtApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createDbtModelSyncTrigger**](DbtApi.md#createDbtModelSyncTrigger) | **POST** /dbt-model-syncs/trigger | Create Dbt Model Sync Trigger | + + + +## Operation: createDbtModelSyncTrigger + +> CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger(createDbtModelSyncTriggerInput) + +Create Dbt Model Sync Trigger + +Creates a trigger for a new dbt model sync for a Source. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.DbtApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + DbtApi apiInstance = new DbtApi(defaultClient); + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput = new CreateDbtModelSyncTriggerInput(); // CreateDbtModelSyncTriggerInput | + try { + CreateDbtModelSyncTrigger200Response result = apiInstance.createDbtModelSyncTrigger(createDbtModelSyncTriggerInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DbtApi#createDbtModelSyncTrigger"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **createDbtModelSyncTriggerInput** | [**CreateDbtModelSyncTriggerInput**](CreateDbtModelSyncTriggerInput.md)| | | + +### Return type + +[**CreateDbtModelSyncTrigger200Response**](CreateDbtModelSyncTrigger200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/json, application/vnd.segment.v1+json +- **Accept**: application/vnd.segment.v1+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/pom.xml b/pom.xml index f2cd1d79..2824e329 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.0.0 + 57.0.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 14a02f36..9efc71fc 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.0.0 (Java)"); + setUserAgent("Public API SDK 57.0.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ad2b50dc..4ed19134 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.0.0"; + public static final String VERSION = "57.0.1"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7956dd00..3a5bc983 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -223,6 +223,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateComputedTraitAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDbtModelSyncTrigger200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDbtModelSyncTriggerInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDbtModelSyncTriggerOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateDestination200Response .CustomTypeAdapterFactory()); @@ -418,6 +427,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateWriteKeyForSourceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DbtModelSyncTrigger.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/DbtApi.java b/src/main/java/com/segment/publicapi/api/DbtApi.java new file mode 100644 index 00000000..653e38ef --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/DbtApi.java @@ -0,0 +1,234 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateDbtModelSyncTrigger200Response; +import com.segment.publicapi.models.CreateDbtModelSyncTriggerInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DbtApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DbtApi() { + this(Configuration.getDefaultApiClient()); + } + + public DbtApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createDbtModelSyncTrigger + * + * @param createDbtModelSyncTriggerInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createDbtModelSyncTriggerCall( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createDbtModelSyncTriggerInput; + + // create path and map variables + String localVarPath = "/dbt-model-syncs/trigger"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/vnd.segment.v1+json", "application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", "application/vnd.segment.v1+json" + }; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createDbtModelSyncTriggerValidateBeforeCall( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createDbtModelSyncTriggerInput' is set + if (createDbtModelSyncTriggerInput == null) { + throw new ApiException( + "Missing the required parameter 'createDbtModelSyncTriggerInput' when calling" + + " createDbtModelSyncTrigger(Async)"); + } + + return createDbtModelSyncTriggerCall(createDbtModelSyncTriggerInput, _callback); + } + + /** + * Create Dbt Model Sync Trigger Creates a trigger for a new dbt model sync for a Source. + * + * @param createDbtModelSyncTriggerInput (required) + * @return CreateDbtModelSyncTrigger200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput) throws ApiException { + ApiResponse localVarResp = + createDbtModelSyncTriggerWithHttpInfo(createDbtModelSyncTriggerInput); + return localVarResp.getData(); + } + + /** + * Create Dbt Model Sync Trigger Creates a trigger for a new dbt model sync for a Source. + * + * @param createDbtModelSyncTriggerInput (required) + * @return ApiResponse<CreateDbtModelSyncTrigger200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createDbtModelSyncTriggerWithHttpInfo( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput) throws ApiException { + okhttp3.Call localVarCall = + createDbtModelSyncTriggerValidateBeforeCall(createDbtModelSyncTriggerInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Dbt Model Sync Trigger (asynchronously) Creates a trigger for a new dbt model sync for + * a Source. + * + * @param createDbtModelSyncTriggerInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createDbtModelSyncTriggerAsync( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createDbtModelSyncTriggerValidateBeforeCall( + createDbtModelSyncTriggerInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java new file mode 100644 index 00000000..099dc651 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateDbtModelSyncTrigger200Response */ +public class CreateDbtModelSyncTrigger200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateDbtModelSyncTriggerOutput data; + + public CreateDbtModelSyncTrigger200Response() {} + + public CreateDbtModelSyncTrigger200Response data(CreateDbtModelSyncTriggerOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateDbtModelSyncTriggerOutput getData() { + return data; + } + + public void setData(CreateDbtModelSyncTriggerOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger200Response = + (CreateDbtModelSyncTrigger200Response) o; + return Objects.equals(this.data, createDbtModelSyncTrigger200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDbtModelSyncTrigger200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateDbtModelSyncTrigger200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDbtModelSyncTrigger200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDbtModelSyncTrigger200Response" + + " is not found in the empty JSON string", + CreateDbtModelSyncTrigger200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDbtModelSyncTrigger200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDbtModelSyncTrigger200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateDbtModelSyncTriggerOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDbtModelSyncTrigger200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDbtModelSyncTrigger200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDbtModelSyncTrigger200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateDbtModelSyncTrigger200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDbtModelSyncTrigger200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDbtModelSyncTrigger200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDbtModelSyncTrigger200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateDbtModelSyncTrigger200Response + */ + public static CreateDbtModelSyncTrigger200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTrigger200Response.class); + } + + /** + * Convert an instance of CreateDbtModelSyncTrigger200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java new file mode 100644 index 00000000..cd58fe70 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java @@ -0,0 +1,213 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input for the createDbtModelSyncTriggerBySourceId endpoint. */ +public class CreateDbtModelSyncTriggerInput { + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public CreateDbtModelSyncTriggerInput() {} + + public CreateDbtModelSyncTriggerInput sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source id to trigger a dbt model sync. + * + * @return sourceId + */ + @javax.annotation.Nonnull + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput = + (CreateDbtModelSyncTriggerInput) o; + return Objects.equals(this.sourceId, createDbtModelSyncTriggerInput.sourceId); + } + + @Override + public int hashCode() { + return Objects.hash(sourceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDbtModelSyncTriggerInput {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateDbtModelSyncTriggerInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDbtModelSyncTriggerInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDbtModelSyncTriggerInput is not" + + " found in the empty JSON string", + CreateDbtModelSyncTriggerInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDbtModelSyncTriggerInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDbtModelSyncTriggerInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDbtModelSyncTriggerInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDbtModelSyncTriggerInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDbtModelSyncTriggerInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDbtModelSyncTriggerInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDbtModelSyncTriggerInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDbtModelSyncTriggerInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDbtModelSyncTriggerInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDbtModelSyncTriggerInput + * @throws IOException if the JSON string is invalid with respect to + * CreateDbtModelSyncTriggerInput + */ + public static CreateDbtModelSyncTriggerInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTriggerInput.class); + } + + /** + * Convert an instance of CreateDbtModelSyncTriggerInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java new file mode 100644 index 00000000..4ce68c9b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for the createDbtModelSyncTriggerBySourceId endpoint. */ +public class CreateDbtModelSyncTriggerOutput { + public static final String SERIALIZED_NAME_DBT_MODEL_SYNC_TRIGGER = "dbtModelSyncTrigger"; + + @SerializedName(SERIALIZED_NAME_DBT_MODEL_SYNC_TRIGGER) + private DbtModelSyncTrigger dbtModelSyncTrigger; + + public CreateDbtModelSyncTriggerOutput() {} + + public CreateDbtModelSyncTriggerOutput dbtModelSyncTrigger( + DbtModelSyncTrigger dbtModelSyncTrigger) { + + this.dbtModelSyncTrigger = dbtModelSyncTrigger; + return this; + } + + /** + * Get dbtModelSyncTrigger + * + * @return dbtModelSyncTrigger + */ + @javax.annotation.Nonnull + public DbtModelSyncTrigger getDbtModelSyncTrigger() { + return dbtModelSyncTrigger; + } + + public void setDbtModelSyncTrigger(DbtModelSyncTrigger dbtModelSyncTrigger) { + this.dbtModelSyncTrigger = dbtModelSyncTrigger; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDbtModelSyncTriggerOutput createDbtModelSyncTriggerOutput = + (CreateDbtModelSyncTriggerOutput) o; + return Objects.equals( + this.dbtModelSyncTrigger, createDbtModelSyncTriggerOutput.dbtModelSyncTrigger); + } + + @Override + public int hashCode() { + return Objects.hash(dbtModelSyncTrigger); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDbtModelSyncTriggerOutput {\n"); + sb.append(" dbtModelSyncTrigger: ") + .append(toIndentedString(dbtModelSyncTrigger)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dbtModelSyncTrigger"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("dbtModelSyncTrigger"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateDbtModelSyncTriggerOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDbtModelSyncTriggerOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDbtModelSyncTriggerOutput is not" + + " found in the empty JSON string", + CreateDbtModelSyncTriggerOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDbtModelSyncTriggerOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDbtModelSyncTriggerOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDbtModelSyncTriggerOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `dbtModelSyncTrigger` + DbtModelSyncTrigger.validateJsonElement(jsonObj.get("dbtModelSyncTrigger")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDbtModelSyncTriggerOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDbtModelSyncTriggerOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDbtModelSyncTriggerOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDbtModelSyncTriggerOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDbtModelSyncTriggerOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDbtModelSyncTriggerOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDbtModelSyncTriggerOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateDbtModelSyncTriggerOutput + */ + public static CreateDbtModelSyncTriggerOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTriggerOutput.class); + } + + /** + * Convert an instance of CreateDbtModelSyncTriggerOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java new file mode 100644 index 00000000..8d8555e5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java @@ -0,0 +1,279 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines the DBT Model Sync Trigger. */ +public class DbtModelSyncTrigger { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public DbtModelSyncTrigger() {} + + public DbtModelSyncTrigger id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the DBT Model Sync. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DbtModelSyncTrigger sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source id that was triggered. + * + * @return sourceId + */ + @javax.annotation.Nullable + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public DbtModelSyncTrigger status(String status) { + + this.status = status; + return this; + } + + /** + * The status of the trigger. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DbtModelSyncTrigger dbtModelSyncTrigger = (DbtModelSyncTrigger) o; + return Objects.equals(this.id, dbtModelSyncTrigger.id) + && Objects.equals(this.sourceId, dbtModelSyncTrigger.sourceId) + && Objects.equals(this.status, dbtModelSyncTrigger.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, sourceId, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DbtModelSyncTrigger {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DbtModelSyncTrigger + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DbtModelSyncTrigger.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DbtModelSyncTrigger is not found in" + + " the empty JSON string", + DbtModelSyncTrigger.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DbtModelSyncTrigger.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DbtModelSyncTrigger` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DbtModelSyncTrigger.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DbtModelSyncTrigger.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DbtModelSyncTrigger' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DbtModelSyncTrigger.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DbtModelSyncTrigger value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DbtModelSyncTrigger read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DbtModelSyncTrigger given an JSON string + * + * @param jsonString JSON string + * @return An instance of DbtModelSyncTrigger + * @throws IOException if the JSON string is invalid with respect to DbtModelSyncTrigger + */ + public static DbtModelSyncTrigger fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DbtModelSyncTrigger.class); + } + + /** + * Convert an instance of DbtModelSyncTrigger to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 1ddd06e742dad0372484a3807dccf88d643066c1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 14 Nov 2024 22:28:09 +0000 Subject: [PATCH 367/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@fe523836. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/Configuration.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 02026526..24c58a11 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.0.1 +Latest API and SDK version: 57.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.0.1 + 57.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.0.1" + implementation "com.segment.publicapi:segment-publicapi:57.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.0.1.jar` +* `target/segment-publicapi-57.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 2824e329..f2cd1d79 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.0.1 + 57.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9efc71fc..14a02f36 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.0.1 (Java)"); + setUserAgent("Public API SDK 57.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 4ed19134..ad2b50dc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.0.1"; + public static final String VERSION = "57.0.0"; private static ApiClient defaultApiClient = new ApiClient(); From f830f35ac79fece47ccac4f12dcbc6079e4678e1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 14 Nov 2024 23:27:32 +0000 Subject: [PATCH 368/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e7341f7f. From 936decffe746939b6bebb9d8a11b178d7a83db3a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 14 Nov 2024 23:39:32 +0000 Subject: [PATCH 369/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@eb352064. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/Configuration.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 24c58a11..02026526 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.0.0 +Latest API and SDK version: 57.0.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.0.0 + 57.0.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.0.0" + implementation "com.segment.publicapi:segment-publicapi:57.0.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.0.0.jar` +* `target/segment-publicapi-57.0.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index f2cd1d79..2824e329 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.0.0 + 57.0.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 14a02f36..9efc71fc 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.0.0 (Java)"); + setUserAgent("Public API SDK 57.0.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ad2b50dc..4ed19134 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.0.0"; + public static final String VERSION = "57.0.1"; private static ApiClient defaultApiClient = new ApiClient(); From 4ab5c231f4d9df6a3200fd0e8ec4fe09ff51ce07 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 21 Nov 2024 07:42:54 +0000 Subject: [PATCH 370/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9465b966. --- docs/FunctionsApi.md | 2 +- docs/ReverseEtlApi.md | 78 +++++ docs/WorkspacesApi.md | 2 +- src/main/java/com/segment/publicapi/JSON.java | 9 + .../segment/publicapi/api/ReverseEtlApi.java | 221 ++++++++++++++ .../segment/publicapi/api/WorkspacesApi.java | 13 +- ...ncelReverseETLSyncForModel200Response.java | 205 +++++++++++++ .../CancelReverseETLSyncForModelInput.java | 201 +++++++++++++ .../CancelReverseETLSyncForModelOutput.java | 283 ++++++++++++++++++ .../models/CreateFunctionV1Input.java | 2 + 10 files changed, 1013 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index 15a621a8..b35be929 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | ### Return type diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index 14c5812d..ae378ca8 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**cancelReverseETLSyncForModel**](ReverseEtlApi.md#cancelReverseETLSyncForModel) | **POST** /reverse-etl-models/{modelId}/syncs/{syncId}/cancel | Cancel Reverse ETL Sync for Model | | [**createReverseETLManualSync**](ReverseEtlApi.md#createReverseETLManualSync) | **POST** /reverse-etl-syncs | Create Reverse ETL Manual Sync | | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | @@ -15,6 +16,83 @@ All URIs are relative to *https://api.segmentapis.com* +## Operation: cancelReverseETLSyncForModel + +> CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput) + +Cancel Reverse ETL Sync for Model + +Cancels a sync for a Reverse ETL Connection. It might take a few seconds to completely cancel the sync. Will return an error if the sync is already completed or cancelled. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ReverseEtlApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); + String modelId = "modelId"; // String | + String syncId = "1"; // String | + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = new CancelReverseETLSyncForModelInput(); // CancelReverseETLSyncForModelInput | + try { + CancelReverseETLSyncForModel200Response result = apiInstance.cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReverseEtlApi#cancelReverseETLSyncForModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **modelId** | **String**| | | +| **syncId** | **String**| | | +| **cancelReverseETLSyncForModelInput** | [**CancelReverseETLSyncForModelInput**](CancelReverseETLSyncForModelInput.md)| | | + +### Return type + +[**CancelReverseETLSyncForModel200Response**](CancelReverseETLSyncForModel200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: createReverseETLManualSync > CreateReverseETLManualSync200Response createReverseETLManualSync(createReverseETLManualSyncInput) diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md index 436cb2a5..15d1b428 100644 --- a/docs/WorkspacesApi.md +++ b/docs/WorkspacesApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Get Workspace -Returns the Workspace associated with the token used to access this resource. +Returns the Workspace associated with the token used to access this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 3a5bc983..20c61990 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -185,6 +185,15 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModelInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 816d05cc..0352a333 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -18,6 +18,8 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CancelReverseETLSyncForModel200Response; +import com.segment.publicapi.models.CancelReverseETLSyncForModelInput; import com.segment.publicapi.models.CreateReverseETLManualSync200Response; import com.segment.publicapi.models.CreateReverseETLManualSyncInput; import com.segment.publicapi.models.CreateReverseEtlModel201Response; @@ -74,6 +76,225 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for cancelReverseETLSyncForModel + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call cancelReverseETLSyncForModelCall( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = cancelReverseETLSyncForModelInput; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}/syncs/{syncId}/cancel" + .replace( + "{" + "modelId" + "}", + localVarApiClient.escapeString(modelId.toString())) + .replace( + "{" + "syncId" + "}", + localVarApiClient.escapeString(syncId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelReverseETLSyncForModelValidateBeforeCall( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " cancelReverseETLSyncForModel(Async)"); + } + + // verify the required parameter 'syncId' is set + if (syncId == null) { + throw new ApiException( + "Missing the required parameter 'syncId' when calling" + + " cancelReverseETLSyncForModel(Async)"); + } + + // verify the required parameter 'cancelReverseETLSyncForModelInput' is set + if (cancelReverseETLSyncForModelInput == null) { + throw new ApiException( + "Missing the required parameter 'cancelReverseETLSyncForModelInput' when" + + " calling cancelReverseETLSyncForModel(Async)"); + } + + return cancelReverseETLSyncForModelCall( + modelId, syncId, cancelReverseETLSyncForModelInput, _callback); + } + + /** + * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take + * a few seconds to completely cancel the sync. Will return an error if the sync is already + * completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @return CancelReverseETLSyncForModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) + throws ApiException { + ApiResponse localVarResp = + cancelReverseETLSyncForModelWithHttpInfo( + modelId, syncId, cancelReverseETLSyncForModelInput); + return localVarResp.getData(); + } + + /** + * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take + * a few seconds to completely cancel the sync. Will return an error if the sync is already + * completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @return ApiResponse<CancelReverseETLSyncForModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + cancelReverseETLSyncForModelWithHttpInfo( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) + throws ApiException { + okhttp3.Call localVarCall = + cancelReverseETLSyncForModelValidateBeforeCall( + modelId, syncId, cancelReverseETLSyncForModelInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel Reverse ETL Sync for Model (asynchronously) Cancels a sync for a Reverse ETL + * Connection. It might take a few seconds to completely cancel the sync. Will return an error + * if the sync is already completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call cancelReverseETLSyncForModelAsync( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + cancelReverseETLSyncForModelValidateBeforeCall( + modelId, syncId, cancelReverseETLSyncForModelInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for createReverseETLManualSync * diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index c4a0dc0c..3a25ae88 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -143,6 +143,10 @@ private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) /** * Get Workspace Returns the Workspace associated with the token used to access this resource. + * The rate limit for this endpoint is 5 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @return GetWorkspace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -163,6 +167,10 @@ public GetWorkspace200Response getWorkspace() throws ApiException { /** * Get Workspace Returns the Workspace associated with the token used to access this resource. + * The rate limit for this endpoint is 5 requests per minute, which is lower than the default + * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 + * HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @return ApiResponse<GetWorkspace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -184,7 +192,10 @@ public ApiResponse getWorkspaceWithHttpInfo() throws Ap /** * Get Workspace (asynchronously) Returns the Workspace associated with the token used to access - * this resource. + * this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java new file mode 100644 index 00000000..0bcd926f --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CancelReverseETLSyncForModel200Response */ +public class CancelReverseETLSyncForModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CancelReverseETLSyncForModelOutput data; + + public CancelReverseETLSyncForModel200Response() {} + + public CancelReverseETLSyncForModel200Response data(CancelReverseETLSyncForModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CancelReverseETLSyncForModelOutput getData() { + return data; + } + + public void setData(CancelReverseETLSyncForModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel200Response = + (CancelReverseETLSyncForModel200Response) o; + return Objects.equals(this.data, cancelReverseETLSyncForModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModel200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CancelReverseETLSyncForModel200Response is not found in the" + + " empty JSON string", + CancelReverseETLSyncForModel200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModel200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CancelReverseETLSyncForModelOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModel200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModel200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CancelReverseETLSyncForModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModel200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModel200Response + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModel200Response + */ + public static CancelReverseETLSyncForModel200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModel200Response.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java new file mode 100644 index 00000000..e9ada082 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java @@ -0,0 +1,201 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines the parameters needed to cancel a sync for a RETL connection. */ +public class CancelReverseETLSyncForModelInput { + public static final String SERIALIZED_NAME_REASON_FOR_CANCELING = "reasonForCanceling"; + + @SerializedName(SERIALIZED_NAME_REASON_FOR_CANCELING) + private BigDecimal reasonForCanceling; + + public CancelReverseETLSyncForModelInput() {} + + public CancelReverseETLSyncForModelInput reasonForCanceling(BigDecimal reasonForCanceling) { + + this.reasonForCanceling = reasonForCanceling; + return this; + } + + /** + * The reason of canceling the sync. - IncorrectModel = 0 - IncorrectDest = 1 - + * IncorrectKeys = 2 - IncorrectMapping = 3 - Other = 4 + * + * @return reasonForCanceling + */ + @javax.annotation.Nullable + public BigDecimal getReasonForCanceling() { + return reasonForCanceling; + } + + public void setReasonForCanceling(BigDecimal reasonForCanceling) { + this.reasonForCanceling = reasonForCanceling; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = + (CancelReverseETLSyncForModelInput) o; + return Objects.equals( + this.reasonForCanceling, cancelReverseETLSyncForModelInput.reasonForCanceling); + } + + @Override + public int hashCode() { + return Objects.hash(reasonForCanceling); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModelInput {\n"); + sb.append(" reasonForCanceling: ") + .append(toIndentedString(reasonForCanceling)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reasonForCanceling"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModelInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModelInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelReverseETLSyncForModelInput is" + + " not found in the empty JSON string", + CancelReverseETLSyncForModelInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModelInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModelInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModelInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModelInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModelInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelReverseETLSyncForModelInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModelInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModelInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModelInput + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModelInput + */ + public static CancelReverseETLSyncForModelInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelInput.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModelInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java new file mode 100644 index 00000000..fce7c461 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java @@ -0,0 +1,283 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * CancelReverseETLSyncForModelOutput either will return an error or a \"CANCELLING\" + * status. + */ +public class CancelReverseETLSyncForModelOutput { + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; + + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public CancelReverseETLSyncForModelOutput() {} + + public CancelReverseETLSyncForModelOutput errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * A place holder for a machine-friendly category for an error, if applicable. - + * \"SyncAlreadyCanceled\" - \"SyncFinishedCannotCancel\" + * + * @return errorCode + */ + @javax.annotation.Nullable + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public CancelReverseETLSyncForModelOutput errorMessage(String errorMessage) { + + this.errorMessage = errorMessage; + return this; + } + + /** + * A place holder for a human-readable description of the error, if applicable. - \"sync + * already canceled\" - \"sync already finished\". + * + * @return errorMessage + */ + @javax.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public CancelReverseETLSyncForModelOutput status(String status) { + + this.status = status; + return this; + } + + /** + * If no error, status will be CANCELLING, as the extract/load might take some time to cancel. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModelOutput cancelReverseETLSyncForModelOutput = + (CancelReverseETLSyncForModelOutput) o; + return Objects.equals(this.errorCode, cancelReverseETLSyncForModelOutput.errorCode) + && Objects.equals( + this.errorMessage, cancelReverseETLSyncForModelOutput.errorMessage) + && Objects.equals(this.status, cancelReverseETLSyncForModelOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, errorMessage, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModelOutput {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errorCode"); + openapiFields.add("errorMessage"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModelOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelReverseETLSyncForModelOutput is" + + " not found in the empty JSON string", + CancelReverseETLSyncForModelOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModelOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonNull()) + && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorCode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorCode").toString())); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) + && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorMessage` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorMessage").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModelOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelReverseETLSyncForModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModelOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModelOutput + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModelOutput + */ + public static CancelReverseETLSyncForModelOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelOutput.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 8ce751b4..2d938849 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,6 +60,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; From 2c6da27ccba2b1e6ab4fdb2c379199cf1367c332 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 3 Dec 2024 07:55:40 +0000 Subject: [PATCH 371/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4e311f67. From f942424c602c06fd1dbc2948b8836aaf4f63aa6e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 6 Dec 2024 19:19:01 +0000 Subject: [PATCH 372/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b0caf417. --- README.md | 8 +- docs/AudiencesApi.md | 2 +- docs/ComputedTraitsApi.md | 2 +- docs/DbtApi.md | 82 ----- docs/FunctionsApi.md | 2 +- docs/ReverseEtlApi.md | 78 ----- docs/WorkspacesApi.md | 2 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 20 -- .../segment/publicapi/api/AudiencesApi.java | 48 +-- .../publicapi/api/ComputedTraitsApi.java | 48 +-- .../com/segment/publicapi/api/DbtApi.java | 234 --------------- .../segment/publicapi/api/ReverseEtlApi.java | 221 -------------- .../segment/publicapi/api/WorkspacesApi.java | 13 +- ...ncelReverseETLSyncForModel200Response.java | 205 ------------- .../CancelReverseETLSyncForModelInput.java | 201 ------------- .../CancelReverseETLSyncForModelOutput.java | 283 ------------------ .../CreateDbtModelSyncTrigger200Response.java | 203 ------------- .../CreateDbtModelSyncTriggerInput.java | 213 ------------- .../CreateDbtModelSyncTriggerOutput.java | 212 ------------- .../models/CreateFunctionV1Input.java | 2 - .../publicapi/models/DbtModelSyncTrigger.java | 279 ----------------- 24 files changed, 60 insertions(+), 2304 deletions(-) delete mode 100644 docs/DbtApi.md delete mode 100644 src/main/java/com/segment/publicapi/api/DbtApi.java delete mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java diff --git a/README.md b/README.md index 02026526..24c58a11 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.0.1 +Latest API and SDK version: 57.0.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.0.1 + 57.0.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.0.1" + implementation "com.segment.publicapi:segment-publicapi:57.0.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.0.1.jar` +* `target/segment-publicapi-57.0.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 781dc14e..c8aacab2 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -318,7 +318,7 @@ public class Example { Update Audience for Space -Updates the enabled status for an audience • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). Note: The definition for an Audience updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Updates the Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). Note: The definition for an Audience updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/ComputedTraitsApi.md b/docs/ComputedTraitsApi.md index 302f2fb3..1a06180a 100644 --- a/docs/ComputedTraitsApi.md +++ b/docs/ComputedTraitsApi.md @@ -318,7 +318,7 @@ public class Example { Update Computed Trait for Space -Updates the enabled status for a computed trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a Computed Trait is updated, the Computed Trait will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). Note: The definition for a Computed Trait updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Updates the Computed Trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a Computed Trait is updated, the Computed Trait will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). Note: The definition for a Computed Trait updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/DbtApi.md b/docs/DbtApi.md deleted file mode 100644 index 8bfefd13..00000000 --- a/docs/DbtApi.md +++ /dev/null @@ -1,82 +0,0 @@ -# DbtApi - -All URIs are relative to *https://api.segmentapis.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createDbtModelSyncTrigger**](DbtApi.md#createDbtModelSyncTrigger) | **POST** /dbt-model-syncs/trigger | Create Dbt Model Sync Trigger | - - - -## Operation: createDbtModelSyncTrigger - -> CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger(createDbtModelSyncTriggerInput) - -Create Dbt Model Sync Trigger - -Creates a trigger for a new dbt model sync for a Source. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.DbtApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - DbtApi apiInstance = new DbtApi(defaultClient); - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput = new CreateDbtModelSyncTriggerInput(); // CreateDbtModelSyncTriggerInput | - try { - CreateDbtModelSyncTrigger200Response result = apiInstance.createDbtModelSyncTrigger(createDbtModelSyncTriggerInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling DbtApi#createDbtModelSyncTrigger"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **createDbtModelSyncTriggerInput** | [**CreateDbtModelSyncTriggerInput**](CreateDbtModelSyncTriggerInput.md)| | | - -### Return type - -[**CreateDbtModelSyncTrigger200Response**](CreateDbtModelSyncTrigger200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/json, application/vnd.segment.v1+json -- **Accept**: application/vnd.segment.v1+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index b35be929..15a621a8 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | ### Return type diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index ae378ca8..14c5812d 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -4,7 +4,6 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**cancelReverseETLSyncForModel**](ReverseEtlApi.md#cancelReverseETLSyncForModel) | **POST** /reverse-etl-models/{modelId}/syncs/{syncId}/cancel | Cancel Reverse ETL Sync for Model | | [**createReverseETLManualSync**](ReverseEtlApi.md#createReverseETLManualSync) | **POST** /reverse-etl-syncs | Create Reverse ETL Manual Sync | | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | @@ -16,83 +15,6 @@ All URIs are relative to *https://api.segmentapis.com* -## Operation: cancelReverseETLSyncForModel - -> CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput) - -Cancel Reverse ETL Sync for Model - -Cancels a sync for a Reverse ETL Connection. It might take a few seconds to completely cancel the sync. Will return an error if the sync is already completed or cancelled. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.ReverseEtlApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); - String modelId = "modelId"; // String | - String syncId = "1"; // String | - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = new CancelReverseETLSyncForModelInput(); // CancelReverseETLSyncForModelInput | - try { - CancelReverseETLSyncForModel200Response result = apiInstance.cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ReverseEtlApi#cancelReverseETLSyncForModel"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **modelId** | **String**| | | -| **syncId** | **String**| | | -| **cancelReverseETLSyncForModelInput** | [**CancelReverseETLSyncForModelInput**](CancelReverseETLSyncForModelInput.md)| | | - -### Return type - -[**CancelReverseETLSyncForModel200Response**](CancelReverseETLSyncForModel200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - ## Operation: createReverseETLManualSync > CreateReverseETLManualSync200Response createReverseETLManualSync(createReverseETLManualSyncInput) diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md index 15d1b428..436cb2a5 100644 --- a/docs/WorkspacesApi.md +++ b/docs/WorkspacesApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Get Workspace -Returns the Workspace associated with the token used to access this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the Workspace associated with the token used to access this resource. ### Example diff --git a/pom.xml b/pom.xml index 2824e329..f2cd1d79 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.0.1 + 57.0.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 9efc71fc..14a02f36 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.0.1 (Java)"); + setUserAgent("Public API SDK 57.0.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 4ed19134..ad2b50dc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.0.1"; + public static final String VERSION = "57.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 20c61990..7956dd00 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -185,15 +185,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CancelReverseETLSyncForModel200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CancelReverseETLSyncForModelInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -232,15 +223,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateComputedTraitAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateDbtModelSyncTrigger200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateDbtModelSyncTriggerInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateDbtModelSyncTriggerOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateDestination200Response .CustomTypeAdapterFactory()); @@ -436,8 +418,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateWriteKeyForSourceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DbtModelSyncTrigger.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 381380c0..85a29e83 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -988,14 +988,14 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( } /** - * Update Audience for Space Updates the enabled status for an audience • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. • When called, this endpoint may generate the `Audience Modified` - * event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the - * Audience will be locked from future edits until the changes have been incorporated. You can - * find more information [in the Segment + * Update Audience for Space Updates the Audience. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Modified` event in the [audit + * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be + * locked from future edits until the changes have been incorporated. You can find more + * information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). * Note: The definition for an Audience updated using the API is not editable through the * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than @@ -1027,14 +1027,14 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( } /** - * Update Audience for Space Updates the enabled status for an audience • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. • When called, this endpoint may generate the `Audience Modified` - * event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the - * Audience will be locked from future edits until the changes have been incorporated. You can - * find more information [in the Segment + * Update Audience for Space Updates the Audience. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Modified` event in the [audit + * trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be + * locked from future edits until the changes have been incorporated. You can find more + * information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). * Note: The definition for an Audience updated using the API is not editable through the * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than @@ -1068,14 +1068,14 @@ public ApiResponse updateAudienceForSpaceWith } /** - * Update Audience for Space (asynchronously) Updates the enabled status for an audience • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Audience feature enabled. Please reach out to your customer success manager - * for more information. • When called, this endpoint may generate the `Audience - * Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is - * updated, the Audience will be locked from future edits until the changes have been - * incorporated. You can find more information [in the Segment + * Update Audience for Space (asynchronously) Updates the Audience. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Audience Modified` + * event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the + * Audience will be locked from future edits until the changes have been incorporated. You can + * find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). * Note: The definition for an Audience updated using the API is not editable through the * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than diff --git a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java index 393ee35f..2fe74eab 100644 --- a/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java +++ b/src/main/java/com/segment/publicapi/api/ComputedTraitsApi.java @@ -1005,14 +1005,14 @@ private okhttp3.Call updateComputedTraitForSpaceValidateBeforeCall( } /** - * Update Computed Trait for Space Updates the enabled status for a computed trait. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a - * Computed Trait is updated, the Computed Trait will be locked from future edits until the - * changes have been incorporated. You can find more information [in the Segment + * Update Computed Trait for Space Updates the Computed Trait. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Computed Trait + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Computed Trait Modified` event in the + * [audit trail](/tag/Audit-Trail). • Note that when a Computed Trait is updated, the Computed + * Trait will be locked from future edits until the changes have been incorporated. You can find + * more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). * Note: The definition for a Computed Trait updated using the API is not editable through the * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than @@ -1047,14 +1047,14 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( } /** - * Update Computed Trait for Space Updates the enabled status for a computed trait. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Computed Trait feature enabled. Please reach out to your customer success - * manager for more information. • When called, this endpoint may generate the `Computed - * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a - * Computed Trait is updated, the Computed Trait will be locked from future edits until the - * changes have been incorporated. You can find more information [in the Segment + * Update Computed Trait for Space Updates the Computed Trait. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Computed Trait + * feature enabled. Please reach out to your customer success manager for more information. • + * When called, this endpoint may generate the `Computed Trait Modified` event in the + * [audit trail](/tag/Audit-Trail). • Note that when a Computed Trait is updated, the Computed + * Trait will be locked from future edits until the changes have been incorporated. You can find + * more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). * Note: The definition for a Computed Trait updated using the API is not editable through the * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than @@ -1092,14 +1092,14 @@ public UpdateComputedTraitForSpace200Response updateComputedTraitForSpace( } /** - * Update Computed Trait for Space (asynchronously) Updates the enabled status for a computed - * trait. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Computed Trait feature enabled. Please reach out to your customer - * success manager for more information. • When called, this endpoint may generate the - * `Computed Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that - * when a Computed Trait is updated, the Computed Trait will be locked from future edits until - * the changes have been incorporated. You can find more information [in the Segment + * Update Computed Trait for Space (asynchronously) Updates the Computed Trait. • This endpoint + * is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Computed Trait feature enabled. Please reach out to your customer success + * manager for more information. • When called, this endpoint may generate the `Computed + * Trait Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when a + * Computed Trait is updated, the Computed Trait will be locked from future edits until the + * changes have been incorporated. You can find more information [in the Segment * docs](https://segment-docs.netlify.app/docs/unify/traits/computed-traits/#editing-realtime-traits). * Note: The definition for a Computed Trait updated using the API is not editable through the * Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than diff --git a/src/main/java/com/segment/publicapi/api/DbtApi.java b/src/main/java/com/segment/publicapi/api/DbtApi.java deleted file mode 100644 index 653e38ef..00000000 --- a/src/main/java/com/segment/publicapi/api/DbtApi.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.CreateDbtModelSyncTrigger200Response; -import com.segment.publicapi.models.CreateDbtModelSyncTriggerInput; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DbtApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public DbtApi() { - this(Configuration.getDefaultApiClient()); - } - - public DbtApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createDbtModelSyncTrigger - * - * @param createDbtModelSyncTriggerInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createDbtModelSyncTriggerCall( - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createDbtModelSyncTriggerInput; - - // create path and map variables - String localVarPath = "/dbt-model-syncs/trigger"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/vnd.segment.v1+json", "application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json", "application/vnd.segment.v1+json" - }; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createDbtModelSyncTriggerValidateBeforeCall( - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'createDbtModelSyncTriggerInput' is set - if (createDbtModelSyncTriggerInput == null) { - throw new ApiException( - "Missing the required parameter 'createDbtModelSyncTriggerInput' when calling" - + " createDbtModelSyncTrigger(Async)"); - } - - return createDbtModelSyncTriggerCall(createDbtModelSyncTriggerInput, _callback); - } - - /** - * Create Dbt Model Sync Trigger Creates a trigger for a new dbt model sync for a Source. - * - * @param createDbtModelSyncTriggerInput (required) - * @return CreateDbtModelSyncTrigger200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger( - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput) throws ApiException { - ApiResponse localVarResp = - createDbtModelSyncTriggerWithHttpInfo(createDbtModelSyncTriggerInput); - return localVarResp.getData(); - } - - /** - * Create Dbt Model Sync Trigger Creates a trigger for a new dbt model sync for a Source. - * - * @param createDbtModelSyncTriggerInput (required) - * @return ApiResponse<CreateDbtModelSyncTrigger200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse createDbtModelSyncTriggerWithHttpInfo( - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput) throws ApiException { - okhttp3.Call localVarCall = - createDbtModelSyncTriggerValidateBeforeCall(createDbtModelSyncTriggerInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Dbt Model Sync Trigger (asynchronously) Creates a trigger for a new dbt model sync for - * a Source. - * - * @param createDbtModelSyncTriggerInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createDbtModelSyncTriggerAsync( - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createDbtModelSyncTriggerValidateBeforeCall( - createDbtModelSyncTriggerInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 0352a333..816d05cc 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -18,8 +18,6 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; -import com.segment.publicapi.models.CancelReverseETLSyncForModel200Response; -import com.segment.publicapi.models.CancelReverseETLSyncForModelInput; import com.segment.publicapi.models.CreateReverseETLManualSync200Response; import com.segment.publicapi.models.CreateReverseETLManualSyncInput; import com.segment.publicapi.models.CreateReverseEtlModel201Response; @@ -76,225 +74,6 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } - /** - * Build call for cancelReverseETLSyncForModel - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call cancelReverseETLSyncForModelCall( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = cancelReverseETLSyncForModelInput; - - // create path and map variables - String localVarPath = - "/reverse-etl-models/{modelId}/syncs/{syncId}/cancel" - .replace( - "{" + "modelId" + "}", - localVarApiClient.escapeString(modelId.toString())) - .replace( - "{" + "syncId" + "}", - localVarApiClient.escapeString(syncId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call cancelReverseETLSyncForModelValidateBeforeCall( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'modelId' is set - if (modelId == null) { - throw new ApiException( - "Missing the required parameter 'modelId' when calling" - + " cancelReverseETLSyncForModel(Async)"); - } - - // verify the required parameter 'syncId' is set - if (syncId == null) { - throw new ApiException( - "Missing the required parameter 'syncId' when calling" - + " cancelReverseETLSyncForModel(Async)"); - } - - // verify the required parameter 'cancelReverseETLSyncForModelInput' is set - if (cancelReverseETLSyncForModelInput == null) { - throw new ApiException( - "Missing the required parameter 'cancelReverseETLSyncForModelInput' when" - + " calling cancelReverseETLSyncForModel(Async)"); - } - - return cancelReverseETLSyncForModelCall( - modelId, syncId, cancelReverseETLSyncForModelInput, _callback); - } - - /** - * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take - * a few seconds to completely cancel the sync. Will return an error if the sync is already - * completed or cancelled. - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @return CancelReverseETLSyncForModel200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) - throws ApiException { - ApiResponse localVarResp = - cancelReverseETLSyncForModelWithHttpInfo( - modelId, syncId, cancelReverseETLSyncForModelInput); - return localVarResp.getData(); - } - - /** - * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take - * a few seconds to completely cancel the sync. Will return an error if the sync is already - * completed or cancelled. - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @return ApiResponse<CancelReverseETLSyncForModel200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - cancelReverseETLSyncForModelWithHttpInfo( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) - throws ApiException { - okhttp3.Call localVarCall = - cancelReverseETLSyncForModelValidateBeforeCall( - modelId, syncId, cancelReverseETLSyncForModelInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Cancel Reverse ETL Sync for Model (asynchronously) Cancels a sync for a Reverse ETL - * Connection. It might take a few seconds to completely cancel the sync. Will return an error - * if the sync is already completed or cancelled. - * - * @param modelId (required) - * @param syncId (required) - * @param cancelReverseETLSyncForModelInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call cancelReverseETLSyncForModelAsync( - String modelId, - String syncId, - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - cancelReverseETLSyncForModelValidateBeforeCall( - modelId, syncId, cancelReverseETLSyncForModelInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for createReverseETLManualSync * diff --git a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java index 3a25ae88..c4a0dc0c 100644 --- a/src/main/java/com/segment/publicapi/api/WorkspacesApi.java +++ b/src/main/java/com/segment/publicapi/api/WorkspacesApi.java @@ -143,10 +143,6 @@ private okhttp3.Call getWorkspaceValidateBeforeCall(final ApiCallback _callback) /** * Get Workspace Returns the Workspace associated with the token used to access this resource. - * The rate limit for this endpoint is 5 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. * * @return GetWorkspace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -167,10 +163,6 @@ public GetWorkspace200Response getWorkspace() throws ApiException { /** * Get Workspace Returns the Workspace associated with the token used to access this resource. - * The rate limit for this endpoint is 5 requests per minute, which is lower than the default - * due to access pattern restrictions. Once reached, this endpoint will respond with the 429 - * HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. * * @return ApiResponse<GetWorkspace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -192,10 +184,7 @@ public ApiResponse getWorkspaceWithHttpInfo() throws Ap /** * Get Workspace (asynchronously) Returns the Workspace associated with the token used to access - * this resource. The rate limit for this endpoint is 5 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * this resource. * * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java deleted file mode 100644 index 0bcd926f..00000000 --- a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** CancelReverseETLSyncForModel200Response */ -public class CancelReverseETLSyncForModel200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CancelReverseETLSyncForModelOutput data; - - public CancelReverseETLSyncForModel200Response() {} - - public CancelReverseETLSyncForModel200Response data(CancelReverseETLSyncForModelOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public CancelReverseETLSyncForModelOutput getData() { - return data; - } - - public void setData(CancelReverseETLSyncForModelOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel200Response = - (CancelReverseETLSyncForModel200Response) o; - return Objects.equals(this.data, cancelReverseETLSyncForModel200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelReverseETLSyncForModel200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CancelReverseETLSyncForModel200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CancelReverseETLSyncForModel200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " CancelReverseETLSyncForModel200Response is not found in the" - + " empty JSON string", - CancelReverseETLSyncForModel200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelReverseETLSyncForModel200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelReverseETLSyncForModel200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CancelReverseETLSyncForModelOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelReverseETLSyncForModel200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'CancelReverseETLSyncForModel200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CancelReverseETLSyncForModel200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, CancelReverseETLSyncForModel200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CancelReverseETLSyncForModel200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CancelReverseETLSyncForModel200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CancelReverseETLSyncForModel200Response - * @throws IOException if the JSON string is invalid with respect to - * CancelReverseETLSyncForModel200Response - */ - public static CancelReverseETLSyncForModel200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModel200Response.class); - } - - /** - * Convert an instance of CancelReverseETLSyncForModel200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java deleted file mode 100644 index e9ada082..00000000 --- a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Defines the parameters needed to cancel a sync for a RETL connection. */ -public class CancelReverseETLSyncForModelInput { - public static final String SERIALIZED_NAME_REASON_FOR_CANCELING = "reasonForCanceling"; - - @SerializedName(SERIALIZED_NAME_REASON_FOR_CANCELING) - private BigDecimal reasonForCanceling; - - public CancelReverseETLSyncForModelInput() {} - - public CancelReverseETLSyncForModelInput reasonForCanceling(BigDecimal reasonForCanceling) { - - this.reasonForCanceling = reasonForCanceling; - return this; - } - - /** - * The reason of canceling the sync. - IncorrectModel = 0 - IncorrectDest = 1 - - * IncorrectKeys = 2 - IncorrectMapping = 3 - Other = 4 - * - * @return reasonForCanceling - */ - @javax.annotation.Nullable - public BigDecimal getReasonForCanceling() { - return reasonForCanceling; - } - - public void setReasonForCanceling(BigDecimal reasonForCanceling) { - this.reasonForCanceling = reasonForCanceling; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = - (CancelReverseETLSyncForModelInput) o; - return Objects.equals( - this.reasonForCanceling, cancelReverseETLSyncForModelInput.reasonForCanceling); - } - - @Override - public int hashCode() { - return Objects.hash(reasonForCanceling); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelReverseETLSyncForModelInput {\n"); - sb.append(" reasonForCanceling: ") - .append(toIndentedString(reasonForCanceling)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("reasonForCanceling"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CancelReverseETLSyncForModelInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CancelReverseETLSyncForModelInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CancelReverseETLSyncForModelInput is" - + " not found in the empty JSON string", - CancelReverseETLSyncForModelInput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelReverseETLSyncForModelInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelReverseETLSyncForModelInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelReverseETLSyncForModelInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CancelReverseETLSyncForModelInput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CancelReverseETLSyncForModelInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CancelReverseETLSyncForModelInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CancelReverseETLSyncForModelInput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CancelReverseETLSyncForModelInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CancelReverseETLSyncForModelInput - * @throws IOException if the JSON string is invalid with respect to - * CancelReverseETLSyncForModelInput - */ - public static CancelReverseETLSyncForModelInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelInput.class); - } - - /** - * Convert an instance of CancelReverseETLSyncForModelInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java deleted file mode 100644 index fce7c461..00000000 --- a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * CancelReverseETLSyncForModelOutput either will return an error or a \"CANCELLING\" - * status. - */ -public class CancelReverseETLSyncForModelOutput { - public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; - - @SerializedName(SERIALIZED_NAME_ERROR_CODE) - private String errorCode; - - public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; - - @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) - private String errorMessage; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public CancelReverseETLSyncForModelOutput() {} - - public CancelReverseETLSyncForModelOutput errorCode(String errorCode) { - - this.errorCode = errorCode; - return this; - } - - /** - * A place holder for a machine-friendly category for an error, if applicable. - - * \"SyncAlreadyCanceled\" - \"SyncFinishedCannotCancel\" - * - * @return errorCode - */ - @javax.annotation.Nullable - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - public CancelReverseETLSyncForModelOutput errorMessage(String errorMessage) { - - this.errorMessage = errorMessage; - return this; - } - - /** - * A place holder for a human-readable description of the error, if applicable. - \"sync - * already canceled\" - \"sync already finished\". - * - * @return errorMessage - */ - @javax.annotation.Nullable - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public CancelReverseETLSyncForModelOutput status(String status) { - - this.status = status; - return this; - } - - /** - * If no error, status will be CANCELLING, as the extract/load might take some time to cancel. - * - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CancelReverseETLSyncForModelOutput cancelReverseETLSyncForModelOutput = - (CancelReverseETLSyncForModelOutput) o; - return Objects.equals(this.errorCode, cancelReverseETLSyncForModelOutput.errorCode) - && Objects.equals( - this.errorMessage, cancelReverseETLSyncForModelOutput.errorMessage) - && Objects.equals(this.status, cancelReverseETLSyncForModelOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(errorCode, errorMessage, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CancelReverseETLSyncForModelOutput {\n"); - sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); - sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("errorCode"); - openapiFields.add("errorMessage"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CancelReverseETLSyncForModelOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CancelReverseETLSyncForModelOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CancelReverseETLSyncForModelOutput is" - + " not found in the empty JSON string", - CancelReverseETLSyncForModelOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CancelReverseETLSyncForModelOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CancelReverseETLSyncForModelOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonNull()) - && !jsonObj.get("errorCode").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `errorCode` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("errorCode").toString())); - } - if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) - && !jsonObj.get("errorMessage").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `errorMessage` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("errorMessage").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CancelReverseETLSyncForModelOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CancelReverseETLSyncForModelOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CancelReverseETLSyncForModelOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CancelReverseETLSyncForModelOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CancelReverseETLSyncForModelOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CancelReverseETLSyncForModelOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CancelReverseETLSyncForModelOutput - * @throws IOException if the JSON string is invalid with respect to - * CancelReverseETLSyncForModelOutput - */ - public static CancelReverseETLSyncForModelOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelOutput.class); - } - - /** - * Convert an instance of CancelReverseETLSyncForModelOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java deleted file mode 100644 index 099dc651..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** CreateDbtModelSyncTrigger200Response */ -public class CreateDbtModelSyncTrigger200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CreateDbtModelSyncTriggerOutput data; - - public CreateDbtModelSyncTrigger200Response() {} - - public CreateDbtModelSyncTrigger200Response data(CreateDbtModelSyncTriggerOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public CreateDbtModelSyncTriggerOutput getData() { - return data; - } - - public void setData(CreateDbtModelSyncTriggerOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger200Response = - (CreateDbtModelSyncTrigger200Response) o; - return Objects.equals(this.data, createDbtModelSyncTrigger200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDbtModelSyncTrigger200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateDbtModelSyncTrigger200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateDbtModelSyncTrigger200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateDbtModelSyncTrigger200Response" - + " is not found in the empty JSON string", - CreateDbtModelSyncTrigger200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateDbtModelSyncTrigger200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateDbtModelSyncTrigger200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CreateDbtModelSyncTriggerOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDbtModelSyncTrigger200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDbtModelSyncTrigger200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateDbtModelSyncTrigger200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, CreateDbtModelSyncTrigger200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDbtModelSyncTrigger200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateDbtModelSyncTrigger200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDbtModelSyncTrigger200Response - * @throws IOException if the JSON string is invalid with respect to - * CreateDbtModelSyncTrigger200Response - */ - public static CreateDbtModelSyncTrigger200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTrigger200Response.class); - } - - /** - * Convert an instance of CreateDbtModelSyncTrigger200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java deleted file mode 100644 index cd58fe70..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Input for the createDbtModelSyncTriggerBySourceId endpoint. */ -public class CreateDbtModelSyncTriggerInput { - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public CreateDbtModelSyncTriggerInput() {} - - public CreateDbtModelSyncTriggerInput sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source id to trigger a dbt model sync. - * - * @return sourceId - */ - @javax.annotation.Nonnull - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput = - (CreateDbtModelSyncTriggerInput) o; - return Objects.equals(this.sourceId, createDbtModelSyncTriggerInput.sourceId); - } - - @Override - public int hashCode() { - return Objects.hash(sourceId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDbtModelSyncTriggerInput {\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("sourceId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("sourceId"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateDbtModelSyncTriggerInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateDbtModelSyncTriggerInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateDbtModelSyncTriggerInput is not" - + " found in the empty JSON string", - CreateDbtModelSyncTriggerInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateDbtModelSyncTriggerInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateDbtModelSyncTriggerInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateDbtModelSyncTriggerInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDbtModelSyncTriggerInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDbtModelSyncTriggerInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateDbtModelSyncTriggerInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDbtModelSyncTriggerInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDbtModelSyncTriggerInput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateDbtModelSyncTriggerInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDbtModelSyncTriggerInput - * @throws IOException if the JSON string is invalid with respect to - * CreateDbtModelSyncTriggerInput - */ - public static CreateDbtModelSyncTriggerInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTriggerInput.class); - } - - /** - * Convert an instance of CreateDbtModelSyncTriggerInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java deleted file mode 100644 index 4ce68c9b..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output for the createDbtModelSyncTriggerBySourceId endpoint. */ -public class CreateDbtModelSyncTriggerOutput { - public static final String SERIALIZED_NAME_DBT_MODEL_SYNC_TRIGGER = "dbtModelSyncTrigger"; - - @SerializedName(SERIALIZED_NAME_DBT_MODEL_SYNC_TRIGGER) - private DbtModelSyncTrigger dbtModelSyncTrigger; - - public CreateDbtModelSyncTriggerOutput() {} - - public CreateDbtModelSyncTriggerOutput dbtModelSyncTrigger( - DbtModelSyncTrigger dbtModelSyncTrigger) { - - this.dbtModelSyncTrigger = dbtModelSyncTrigger; - return this; - } - - /** - * Get dbtModelSyncTrigger - * - * @return dbtModelSyncTrigger - */ - @javax.annotation.Nonnull - public DbtModelSyncTrigger getDbtModelSyncTrigger() { - return dbtModelSyncTrigger; - } - - public void setDbtModelSyncTrigger(DbtModelSyncTrigger dbtModelSyncTrigger) { - this.dbtModelSyncTrigger = dbtModelSyncTrigger; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateDbtModelSyncTriggerOutput createDbtModelSyncTriggerOutput = - (CreateDbtModelSyncTriggerOutput) o; - return Objects.equals( - this.dbtModelSyncTrigger, createDbtModelSyncTriggerOutput.dbtModelSyncTrigger); - } - - @Override - public int hashCode() { - return Objects.hash(dbtModelSyncTrigger); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateDbtModelSyncTriggerOutput {\n"); - sb.append(" dbtModelSyncTrigger: ") - .append(toIndentedString(dbtModelSyncTrigger)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("dbtModelSyncTrigger"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("dbtModelSyncTrigger"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateDbtModelSyncTriggerOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateDbtModelSyncTriggerOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateDbtModelSyncTriggerOutput is not" - + " found in the empty JSON string", - CreateDbtModelSyncTriggerOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateDbtModelSyncTriggerOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateDbtModelSyncTriggerOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateDbtModelSyncTriggerOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `dbtModelSyncTrigger` - DbtModelSyncTrigger.validateJsonElement(jsonObj.get("dbtModelSyncTrigger")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateDbtModelSyncTriggerOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateDbtModelSyncTriggerOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateDbtModelSyncTriggerOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateDbtModelSyncTriggerOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateDbtModelSyncTriggerOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateDbtModelSyncTriggerOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateDbtModelSyncTriggerOutput - * @throws IOException if the JSON string is invalid with respect to - * CreateDbtModelSyncTriggerOutput - */ - public static CreateDbtModelSyncTriggerOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTriggerOutput.class); - } - - /** - * Convert an instance of CreateDbtModelSyncTriggerOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 2d938849..8ce751b4 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,8 +60,6 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), - INSERT_SOURCE("INSERT_SOURCE"), - SOURCE("SOURCE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java deleted file mode 100644 index 8d8555e5..00000000 --- a/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Defines the DBT Model Sync Trigger. */ -public class DbtModelSyncTrigger { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; - - @SerializedName(SERIALIZED_NAME_SOURCE_ID) - private String sourceId; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public DbtModelSyncTrigger() {} - - public DbtModelSyncTrigger id(String id) { - - this.id = id; - return this; - } - - /** - * The id of the DBT Model Sync. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public DbtModelSyncTrigger sourceId(String sourceId) { - - this.sourceId = sourceId; - return this; - } - - /** - * The Source id that was triggered. - * - * @return sourceId - */ - @javax.annotation.Nullable - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - - public DbtModelSyncTrigger status(String status) { - - this.status = status; - return this; - } - - /** - * The status of the trigger. - * - * @return status - */ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DbtModelSyncTrigger dbtModelSyncTrigger = (DbtModelSyncTrigger) o; - return Objects.equals(this.id, dbtModelSyncTrigger.id) - && Objects.equals(this.sourceId, dbtModelSyncTrigger.sourceId) - && Objects.equals(this.status, dbtModelSyncTrigger.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, sourceId, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DbtModelSyncTrigger {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("sourceId"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DbtModelSyncTrigger - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DbtModelSyncTrigger.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DbtModelSyncTrigger is not found in" - + " the empty JSON string", - DbtModelSyncTrigger.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DbtModelSyncTrigger.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DbtModelSyncTrigger` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DbtModelSyncTrigger.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) - && !jsonObj.get("sourceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `sourceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("sourceId").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DbtModelSyncTrigger.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DbtModelSyncTrigger' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DbtModelSyncTrigger.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DbtModelSyncTrigger value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DbtModelSyncTrigger read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DbtModelSyncTrigger given an JSON string - * - * @param jsonString JSON string - * @return An instance of DbtModelSyncTrigger - * @throws IOException if the JSON string is invalid with respect to DbtModelSyncTrigger - */ - public static DbtModelSyncTrigger fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DbtModelSyncTrigger.class); - } - - /** - * Convert an instance of DbtModelSyncTrigger to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From df6a90f92fda19ad5d67aa3817ee5921d23996f6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Dec 2024 23:52:32 +0000 Subject: [PATCH 373/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@da349c9e. --- README.md | 8 +- docs/DbtApi.md | 82 ++++ docs/DeletionAndSuppressionApi.md | 2 +- docs/ReverseEtlApi.md | 78 ++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 20 + .../com/segment/publicapi/api/DbtApi.java | 245 ++++++++++++ .../segment/publicapi/api/ReverseEtlApi.java | 221 +++++++++++ ...ncelReverseETLSyncForModel200Response.java | 205 ++++++++++ .../CancelReverseETLSyncForModelInput.java | 201 ++++++++++ .../CancelReverseETLSyncForModelOutput.java | 365 ++++++++++++++++++ .../CreateDbtModelSyncTrigger200Response.java | 203 ++++++++++ .../CreateDbtModelSyncTriggerInput.java | 213 ++++++++++ .../CreateDbtModelSyncTriggerOutput.java | 212 ++++++++++ .../models/CreateSourceRegulationV1Input.java | 4 + .../CreateWorkspaceRegulationV1Input.java | 4 + .../publicapi/models/DbtModelSyncTrigger.java | 279 +++++++++++++ .../models/RegulationListEntryV1.java | 2 + 20 files changed, 2342 insertions(+), 8 deletions(-) create mode 100644 docs/DbtApi.md create mode 100644 src/main/java/com/segment/publicapi/api/DbtApi.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java diff --git a/README.md b/README.md index 24c58a11..da6f8457 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.0.0 +Latest API and SDK version: 57.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.0.0 + 57.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.0.0" + implementation "com.segment.publicapi:segment-publicapi:57.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.0.0.jar` +* `target/segment-publicapi-57.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/DbtApi.md b/docs/DbtApi.md new file mode 100644 index 00000000..08513d9f --- /dev/null +++ b/docs/DbtApi.md @@ -0,0 +1,82 @@ +# DbtApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createDbtModelSyncTrigger**](DbtApi.md#createDbtModelSyncTrigger) | **POST** /dbt-model-syncs/trigger | Create Dbt Model Sync Trigger | + + + +## Operation: createDbtModelSyncTrigger + +> CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger(createDbtModelSyncTriggerInput) + +Create Dbt Model Sync Trigger + +Creates a trigger for a new dbt model sync for a Source. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.DbtApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + DbtApi apiInstance = new DbtApi(defaultClient); + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput = new CreateDbtModelSyncTriggerInput(); // CreateDbtModelSyncTriggerInput | + try { + CreateDbtModelSyncTrigger200Response result = apiInstance.createDbtModelSyncTrigger(createDbtModelSyncTriggerInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DbtApi#createDbtModelSyncTrigger"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **createDbtModelSyncTriggerInput** | [**CreateDbtModelSyncTriggerInput**](CreateDbtModelSyncTriggerInput.md)| | | + +### Return type + +[**CreateDbtModelSyncTrigger200Response**](CreateDbtModelSyncTrigger200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1beta+json +- **Accept**: application/vnd.segment.v1beta+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 45db24a7..dd8df975 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -587,7 +587,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **status** | **String**| The status on which to filter the returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | -| **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | +| **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_ARCHIVE_ONLY, DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | ### Return type diff --git a/docs/ReverseEtlApi.md b/docs/ReverseEtlApi.md index 14c5812d..ae378ca8 100644 --- a/docs/ReverseEtlApi.md +++ b/docs/ReverseEtlApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**cancelReverseETLSyncForModel**](ReverseEtlApi.md#cancelReverseETLSyncForModel) | **POST** /reverse-etl-models/{modelId}/syncs/{syncId}/cancel | Cancel Reverse ETL Sync for Model | | [**createReverseETLManualSync**](ReverseEtlApi.md#createReverseETLManualSync) | **POST** /reverse-etl-syncs | Create Reverse ETL Manual Sync | | [**createReverseEtlModel**](ReverseEtlApi.md#createReverseEtlModel) | **POST** /reverse-etl-models | Create Reverse Etl Model | | [**deleteReverseEtlModel**](ReverseEtlApi.md#deleteReverseEtlModel) | **DELETE** /reverse-etl-models/{modelId} | Delete Reverse Etl Model | @@ -15,6 +16,83 @@ All URIs are relative to *https://api.segmentapis.com* +## Operation: cancelReverseETLSyncForModel + +> CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput) + +Cancel Reverse ETL Sync for Model + +Cancels a sync for a Reverse ETL Connection. It might take a few seconds to completely cancel the sync. Will return an error if the sync is already completed or cancelled. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ReverseEtlApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ReverseEtlApi apiInstance = new ReverseEtlApi(defaultClient); + String modelId = "modelId"; // String | + String syncId = "1"; // String | + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = new CancelReverseETLSyncForModelInput(); // CancelReverseETLSyncForModelInput | + try { + CancelReverseETLSyncForModel200Response result = apiInstance.cancelReverseETLSyncForModel(modelId, syncId, cancelReverseETLSyncForModelInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ReverseEtlApi#cancelReverseETLSyncForModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **modelId** | **String**| | | +| **syncId** | **String**| | | +| **cancelReverseETLSyncForModelInput** | [**CancelReverseETLSyncForModelInput**](CancelReverseETLSyncForModelInput.md)| | | + +### Return type + +[**CancelReverseETLSyncForModel200Response**](CancelReverseETLSyncForModel200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: createReverseETLManualSync > CreateReverseETLManualSync200Response createReverseETLManualSync(createReverseETLManualSyncInput) diff --git a/pom.xml b/pom.xml index f2cd1d79..7495a21d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.0.0 + 57.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 14a02f36..f40f1146 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.0.0 (Java)"); + setUserAgent("Public API SDK 57.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ad2b50dc..df2f582b 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.0.0"; + public static final String VERSION = "57.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7956dd00..20c61990 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -185,6 +185,15 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BreakdownBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModel200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModelInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -223,6 +232,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateComputedTraitAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDbtModelSyncTrigger200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDbtModelSyncTriggerInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDbtModelSyncTriggerOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateDestination200Response .CustomTypeAdapterFactory()); @@ -418,6 +436,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateWriteKeyForSourceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DbtModelSyncTrigger.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/DbtApi.java b/src/main/java/com/segment/publicapi/api/DbtApi.java new file mode 100644 index 00000000..37dc5d6a --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/DbtApi.java @@ -0,0 +1,245 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateDbtModelSyncTrigger200Response; +import com.segment.publicapi.models.CreateDbtModelSyncTriggerInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DbtApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DbtApi() { + this(Configuration.getDefaultApiClient()); + } + + public DbtApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createDbtModelSyncTrigger + * + * @param createDbtModelSyncTriggerInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createDbtModelSyncTriggerCall( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createDbtModelSyncTriggerInput; + + // create path and map variables + String localVarPath = "/dbt-model-syncs/trigger"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1beta+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1beta+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createDbtModelSyncTriggerValidateBeforeCall( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createDbtModelSyncTriggerInput' is set + if (createDbtModelSyncTriggerInput == null) { + throw new ApiException( + "Missing the required parameter 'createDbtModelSyncTriggerInput' when calling" + + " createDbtModelSyncTrigger(Async)"); + } + + return createDbtModelSyncTriggerCall(createDbtModelSyncTriggerInput, _callback); + } + + /** + * Create Dbt Model Sync Trigger Creates a trigger for a new dbt model sync for a Source. The + * rate limit for this endpoint is 10 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param createDbtModelSyncTriggerInput (required) + * @return CreateDbtModelSyncTrigger200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput) throws ApiException { + ApiResponse localVarResp = + createDbtModelSyncTriggerWithHttpInfo(createDbtModelSyncTriggerInput); + return localVarResp.getData(); + } + + /** + * Create Dbt Model Sync Trigger Creates a trigger for a new dbt model sync for a Source. The + * rate limit for this endpoint is 10 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param createDbtModelSyncTriggerInput (required) + * @return ApiResponse<CreateDbtModelSyncTrigger200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createDbtModelSyncTriggerWithHttpInfo( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput) throws ApiException { + okhttp3.Call localVarCall = + createDbtModelSyncTriggerValidateBeforeCall(createDbtModelSyncTriggerInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Dbt Model Sync Trigger (asynchronously) Creates a trigger for a new dbt model sync for + * a Source. The rate limit for this endpoint is 10 requests per minute, which is lower than the + * default due to access pattern restrictions. Once reached, this endpoint will respond with the + * 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param createDbtModelSyncTriggerInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createDbtModelSyncTriggerAsync( + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createDbtModelSyncTriggerValidateBeforeCall( + createDbtModelSyncTriggerInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java index 816d05cc..0352a333 100644 --- a/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java +++ b/src/main/java/com/segment/publicapi/api/ReverseEtlApi.java @@ -18,6 +18,8 @@ import com.segment.publicapi.ApiResponse; import com.segment.publicapi.Configuration; import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CancelReverseETLSyncForModel200Response; +import com.segment.publicapi.models.CancelReverseETLSyncForModelInput; import com.segment.publicapi.models.CreateReverseETLManualSync200Response; import com.segment.publicapi.models.CreateReverseETLManualSyncInput; import com.segment.publicapi.models.CreateReverseEtlModel201Response; @@ -74,6 +76,225 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for cancelReverseETLSyncForModel + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call cancelReverseETLSyncForModelCall( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = cancelReverseETLSyncForModelInput; + + // create path and map variables + String localVarPath = + "/reverse-etl-models/{modelId}/syncs/{syncId}/cancel" + .replace( + "{" + "modelId" + "}", + localVarApiClient.escapeString(modelId.toString())) + .replace( + "{" + "syncId" + "}", + localVarApiClient.escapeString(syncId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cancelReverseETLSyncForModelValidateBeforeCall( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'modelId' is set + if (modelId == null) { + throw new ApiException( + "Missing the required parameter 'modelId' when calling" + + " cancelReverseETLSyncForModel(Async)"); + } + + // verify the required parameter 'syncId' is set + if (syncId == null) { + throw new ApiException( + "Missing the required parameter 'syncId' when calling" + + " cancelReverseETLSyncForModel(Async)"); + } + + // verify the required parameter 'cancelReverseETLSyncForModelInput' is set + if (cancelReverseETLSyncForModelInput == null) { + throw new ApiException( + "Missing the required parameter 'cancelReverseETLSyncForModelInput' when" + + " calling cancelReverseETLSyncForModel(Async)"); + } + + return cancelReverseETLSyncForModelCall( + modelId, syncId, cancelReverseETLSyncForModelInput, _callback); + } + + /** + * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take + * a few seconds to completely cancel the sync. Will return an error if the sync is already + * completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @return CancelReverseETLSyncForModel200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) + throws ApiException { + ApiResponse localVarResp = + cancelReverseETLSyncForModelWithHttpInfo( + modelId, syncId, cancelReverseETLSyncForModelInput); + return localVarResp.getData(); + } + + /** + * Cancel Reverse ETL Sync for Model Cancels a sync for a Reverse ETL Connection. It might take + * a few seconds to completely cancel the sync. Will return an error if the sync is already + * completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @return ApiResponse<CancelReverseETLSyncForModel200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + cancelReverseETLSyncForModelWithHttpInfo( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput) + throws ApiException { + okhttp3.Call localVarCall = + cancelReverseETLSyncForModelValidateBeforeCall( + modelId, syncId, cancelReverseETLSyncForModelInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Cancel Reverse ETL Sync for Model (asynchronously) Cancels a sync for a Reverse ETL + * Connection. It might take a few seconds to completely cancel the sync. Will return an error + * if the sync is already completed or cancelled. + * + * @param modelId (required) + * @param syncId (required) + * @param cancelReverseETLSyncForModelInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call cancelReverseETLSyncForModelAsync( + String modelId, + String syncId, + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + cancelReverseETLSyncForModelValidateBeforeCall( + modelId, syncId, cancelReverseETLSyncForModelInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for createReverseETLManualSync * diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java new file mode 100644 index 00000000..0bcd926f --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModel200Response.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CancelReverseETLSyncForModel200Response */ +public class CancelReverseETLSyncForModel200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CancelReverseETLSyncForModelOutput data; + + public CancelReverseETLSyncForModel200Response() {} + + public CancelReverseETLSyncForModel200Response data(CancelReverseETLSyncForModelOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CancelReverseETLSyncForModelOutput getData() { + return data; + } + + public void setData(CancelReverseETLSyncForModelOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModel200Response cancelReverseETLSyncForModel200Response = + (CancelReverseETLSyncForModel200Response) o; + return Objects.equals(this.data, cancelReverseETLSyncForModel200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModel200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModel200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModel200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " CancelReverseETLSyncForModel200Response is not found in the" + + " empty JSON string", + CancelReverseETLSyncForModel200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModel200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModel200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CancelReverseETLSyncForModelOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModel200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModel200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModel200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CancelReverseETLSyncForModel200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModel200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModel200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModel200Response + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModel200Response + */ + public static CancelReverseETLSyncForModel200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModel200Response.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModel200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java new file mode 100644 index 00000000..72500575 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelInput.java @@ -0,0 +1,201 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines the parameters needed to cancel a sync for a RETL connection. */ +public class CancelReverseETLSyncForModelInput { + public static final String SERIALIZED_NAME_REASON_FOR_CANCELING = "reasonForCanceling"; + + @SerializedName(SERIALIZED_NAME_REASON_FOR_CANCELING) + private BigDecimal reasonForCanceling; + + public CancelReverseETLSyncForModelInput() {} + + public CancelReverseETLSyncForModelInput reasonForCanceling(BigDecimal reasonForCanceling) { + + this.reasonForCanceling = reasonForCanceling; + return this; + } + + /** + * The reason for canceling the sync. - IncorrectModel = 0 - IncorrectDest = 1 - + * IncorrectKeys = 2 - IncorrectMapping = 3 - Other = 4 + * + * @return reasonForCanceling + */ + @javax.annotation.Nullable + public BigDecimal getReasonForCanceling() { + return reasonForCanceling; + } + + public void setReasonForCanceling(BigDecimal reasonForCanceling) { + this.reasonForCanceling = reasonForCanceling; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModelInput cancelReverseETLSyncForModelInput = + (CancelReverseETLSyncForModelInput) o; + return Objects.equals( + this.reasonForCanceling, cancelReverseETLSyncForModelInput.reasonForCanceling); + } + + @Override + public int hashCode() { + return Objects.hash(reasonForCanceling); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModelInput {\n"); + sb.append(" reasonForCanceling: ") + .append(toIndentedString(reasonForCanceling)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("reasonForCanceling"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModelInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModelInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelReverseETLSyncForModelInput is" + + " not found in the empty JSON string", + CancelReverseETLSyncForModelInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModelInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModelInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModelInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModelInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModelInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelReverseETLSyncForModelInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModelInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModelInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModelInput + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModelInput + */ + public static CancelReverseETLSyncForModelInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelInput.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModelInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java new file mode 100644 index 00000000..161f07cb --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CancelReverseETLSyncForModelOutput.java @@ -0,0 +1,365 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * CancelReverseETLSyncForModelOutput either will return an error or a \"CANCELLING\" + * status. + */ +public class CancelReverseETLSyncForModelOutput { + public static final String SERIALIZED_NAME_MODEL_ID = "modelId"; + + @SerializedName(SERIALIZED_NAME_MODEL_ID) + private String modelId; + + public static final String SERIALIZED_NAME_SYNC_ID = "syncId"; + + @SerializedName(SERIALIZED_NAME_SYNC_ID) + private String syncId; + + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; + + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public CancelReverseETLSyncForModelOutput() {} + + public CancelReverseETLSyncForModelOutput modelId(String modelId) { + + this.modelId = modelId; + return this; + } + + /** + * The id of the Model. + * + * @return modelId + */ + @javax.annotation.Nonnull + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + + public CancelReverseETLSyncForModelOutput syncId(String syncId) { + + this.syncId = syncId; + return this; + } + + /** + * The id of the Sync. + * + * @return syncId + */ + @javax.annotation.Nonnull + public String getSyncId() { + return syncId; + } + + public void setSyncId(String syncId) { + this.syncId = syncId; + } + + public CancelReverseETLSyncForModelOutput errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * A place holder for a machine-friendly category for an error, if applicable. - + * \"SyncAlreadyCanceled\" - \"SyncFinishedCannotCancel\" + * + * @return errorCode + */ + @javax.annotation.Nullable + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public CancelReverseETLSyncForModelOutput errorMessage(String errorMessage) { + + this.errorMessage = errorMessage; + return this; + } + + /** + * A place holder for a human-readable description of the error, if applicable. - \"sync + * already canceled\" - \"sync already finished\". + * + * @return errorMessage + */ + @javax.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public CancelReverseETLSyncForModelOutput status(String status) { + + this.status = status; + return this; + } + + /** + * If no error, status will be CANCELLING, as the extract/load might take some time to cancel. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelReverseETLSyncForModelOutput cancelReverseETLSyncForModelOutput = + (CancelReverseETLSyncForModelOutput) o; + return Objects.equals(this.modelId, cancelReverseETLSyncForModelOutput.modelId) + && Objects.equals(this.syncId, cancelReverseETLSyncForModelOutput.syncId) + && Objects.equals(this.errorCode, cancelReverseETLSyncForModelOutput.errorCode) + && Objects.equals( + this.errorMessage, cancelReverseETLSyncForModelOutput.errorMessage) + && Objects.equals(this.status, cancelReverseETLSyncForModelOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(modelId, syncId, errorCode, errorMessage, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelReverseETLSyncForModelOutput {\n"); + sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n"); + sb.append(" syncId: ").append(toIndentedString(syncId)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("modelId"); + openapiFields.add("syncId"); + openapiFields.add("errorCode"); + openapiFields.add("errorMessage"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("modelId"); + openapiRequiredFields.add("syncId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelReverseETLSyncForModelOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelReverseETLSyncForModelOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelReverseETLSyncForModelOutput is" + + " not found in the empty JSON string", + CancelReverseETLSyncForModelOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelReverseETLSyncForModelOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelReverseETLSyncForModelOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CancelReverseETLSyncForModelOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("modelId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `modelId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("modelId").toString())); + } + if (!jsonObj.get("syncId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `syncId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("syncId").toString())); + } + if ((jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonNull()) + && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorCode` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorCode").toString())); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) + && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `errorMessage` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("errorMessage").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelReverseETLSyncForModelOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelReverseETLSyncForModelOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelReverseETLSyncForModelOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelReverseETLSyncForModelOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelReverseETLSyncForModelOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelReverseETLSyncForModelOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelReverseETLSyncForModelOutput + * @throws IOException if the JSON string is invalid with respect to + * CancelReverseETLSyncForModelOutput + */ + public static CancelReverseETLSyncForModelOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelReverseETLSyncForModelOutput.class); + } + + /** + * Convert an instance of CancelReverseETLSyncForModelOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java new file mode 100644 index 00000000..099dc651 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTrigger200Response.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateDbtModelSyncTrigger200Response */ +public class CreateDbtModelSyncTrigger200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateDbtModelSyncTriggerOutput data; + + public CreateDbtModelSyncTrigger200Response() {} + + public CreateDbtModelSyncTrigger200Response data(CreateDbtModelSyncTriggerOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateDbtModelSyncTriggerOutput getData() { + return data; + } + + public void setData(CreateDbtModelSyncTriggerOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDbtModelSyncTrigger200Response createDbtModelSyncTrigger200Response = + (CreateDbtModelSyncTrigger200Response) o; + return Objects.equals(this.data, createDbtModelSyncTrigger200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDbtModelSyncTrigger200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateDbtModelSyncTrigger200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDbtModelSyncTrigger200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDbtModelSyncTrigger200Response" + + " is not found in the empty JSON string", + CreateDbtModelSyncTrigger200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDbtModelSyncTrigger200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDbtModelSyncTrigger200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateDbtModelSyncTriggerOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDbtModelSyncTrigger200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDbtModelSyncTrigger200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDbtModelSyncTrigger200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, CreateDbtModelSyncTrigger200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDbtModelSyncTrigger200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDbtModelSyncTrigger200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDbtModelSyncTrigger200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateDbtModelSyncTrigger200Response + */ + public static CreateDbtModelSyncTrigger200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTrigger200Response.class); + } + + /** + * Convert an instance of CreateDbtModelSyncTrigger200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java new file mode 100644 index 00000000..cd58fe70 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerInput.java @@ -0,0 +1,213 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input for the createDbtModelSyncTriggerBySourceId endpoint. */ +public class CreateDbtModelSyncTriggerInput { + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public CreateDbtModelSyncTriggerInput() {} + + public CreateDbtModelSyncTriggerInput sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source id to trigger a dbt model sync. + * + * @return sourceId + */ + @javax.annotation.Nonnull + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDbtModelSyncTriggerInput createDbtModelSyncTriggerInput = + (CreateDbtModelSyncTriggerInput) o; + return Objects.equals(this.sourceId, createDbtModelSyncTriggerInput.sourceId); + } + + @Override + public int hashCode() { + return Objects.hash(sourceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDbtModelSyncTriggerInput {\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sourceId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateDbtModelSyncTriggerInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDbtModelSyncTriggerInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDbtModelSyncTriggerInput is not" + + " found in the empty JSON string", + CreateDbtModelSyncTriggerInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDbtModelSyncTriggerInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDbtModelSyncTriggerInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDbtModelSyncTriggerInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDbtModelSyncTriggerInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDbtModelSyncTriggerInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDbtModelSyncTriggerInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDbtModelSyncTriggerInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDbtModelSyncTriggerInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDbtModelSyncTriggerInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDbtModelSyncTriggerInput + * @throws IOException if the JSON string is invalid with respect to + * CreateDbtModelSyncTriggerInput + */ + public static CreateDbtModelSyncTriggerInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTriggerInput.class); + } + + /** + * Convert an instance of CreateDbtModelSyncTriggerInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java new file mode 100644 index 00000000..4ce68c9b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDbtModelSyncTriggerOutput.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for the createDbtModelSyncTriggerBySourceId endpoint. */ +public class CreateDbtModelSyncTriggerOutput { + public static final String SERIALIZED_NAME_DBT_MODEL_SYNC_TRIGGER = "dbtModelSyncTrigger"; + + @SerializedName(SERIALIZED_NAME_DBT_MODEL_SYNC_TRIGGER) + private DbtModelSyncTrigger dbtModelSyncTrigger; + + public CreateDbtModelSyncTriggerOutput() {} + + public CreateDbtModelSyncTriggerOutput dbtModelSyncTrigger( + DbtModelSyncTrigger dbtModelSyncTrigger) { + + this.dbtModelSyncTrigger = dbtModelSyncTrigger; + return this; + } + + /** + * Get dbtModelSyncTrigger + * + * @return dbtModelSyncTrigger + */ + @javax.annotation.Nonnull + public DbtModelSyncTrigger getDbtModelSyncTrigger() { + return dbtModelSyncTrigger; + } + + public void setDbtModelSyncTrigger(DbtModelSyncTrigger dbtModelSyncTrigger) { + this.dbtModelSyncTrigger = dbtModelSyncTrigger; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDbtModelSyncTriggerOutput createDbtModelSyncTriggerOutput = + (CreateDbtModelSyncTriggerOutput) o; + return Objects.equals( + this.dbtModelSyncTrigger, createDbtModelSyncTriggerOutput.dbtModelSyncTrigger); + } + + @Override + public int hashCode() { + return Objects.hash(dbtModelSyncTrigger); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDbtModelSyncTriggerOutput {\n"); + sb.append(" dbtModelSyncTrigger: ") + .append(toIndentedString(dbtModelSyncTrigger)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("dbtModelSyncTrigger"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("dbtModelSyncTrigger"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateDbtModelSyncTriggerOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDbtModelSyncTriggerOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDbtModelSyncTriggerOutput is not" + + " found in the empty JSON string", + CreateDbtModelSyncTriggerOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDbtModelSyncTriggerOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDbtModelSyncTriggerOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDbtModelSyncTriggerOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `dbtModelSyncTrigger` + DbtModelSyncTrigger.validateJsonElement(jsonObj.get("dbtModelSyncTrigger")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDbtModelSyncTriggerOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDbtModelSyncTriggerOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateDbtModelSyncTriggerOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDbtModelSyncTriggerOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDbtModelSyncTriggerOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDbtModelSyncTriggerOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDbtModelSyncTriggerOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateDbtModelSyncTriggerOutput + */ + public static CreateDbtModelSyncTriggerOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDbtModelSyncTriggerOutput.class); + } + + /** + * Convert an instance of CreateDbtModelSyncTriggerOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 5760a5a3..04b22aa8 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -35,6 +35,8 @@ public class CreateSourceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { + DELETE_ARCHIVE_ONLY("DELETE_ARCHIVE_ONLY"), + DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), @@ -94,6 +96,8 @@ public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { /** The subject type. */ @JsonAdapter(SubjectTypeEnum.Adapter.class) public enum SubjectTypeEnum { + ANONYMOUS_ID("ANONYMOUS_ID"), + USER_ID("USER_ID"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index 0f9ebe36..a511a8d7 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -35,6 +35,8 @@ public class CreateWorkspaceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { + DELETE_ARCHIVE_ONLY("DELETE_ARCHIVE_ONLY"), + DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), @@ -94,6 +96,8 @@ public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { /** The subject type. Use `objectId` for Cloud Source regulations. */ @JsonAdapter(SubjectTypeEnum.Adapter.class) public enum SubjectTypeEnum { + ANONYMOUS_ID("ANONYMOUS_ID"), + OBJECT_ID("OBJECT_ID"), USER_ID("USER_ID"); diff --git a/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java new file mode 100644 index 00000000..8d8555e5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java @@ -0,0 +1,279 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines the DBT Model Sync Trigger. */ +public class DbtModelSyncTrigger { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SOURCE_ID = "sourceId"; + + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + private String sourceId; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public DbtModelSyncTrigger() {} + + public DbtModelSyncTrigger id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the DBT Model Sync. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DbtModelSyncTrigger sourceId(String sourceId) { + + this.sourceId = sourceId; + return this; + } + + /** + * The Source id that was triggered. + * + * @return sourceId + */ + @javax.annotation.Nullable + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + public DbtModelSyncTrigger status(String status) { + + this.status = status; + return this; + } + + /** + * The status of the trigger. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DbtModelSyncTrigger dbtModelSyncTrigger = (DbtModelSyncTrigger) o; + return Objects.equals(this.id, dbtModelSyncTrigger.id) + && Objects.equals(this.sourceId, dbtModelSyncTrigger.sourceId) + && Objects.equals(this.status, dbtModelSyncTrigger.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, sourceId, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DbtModelSyncTrigger {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("sourceId"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DbtModelSyncTrigger + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DbtModelSyncTrigger.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DbtModelSyncTrigger is not found in" + + " the empty JSON string", + DbtModelSyncTrigger.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DbtModelSyncTrigger.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DbtModelSyncTrigger` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DbtModelSyncTrigger.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if ((jsonObj.get("sourceId") != null && !jsonObj.get("sourceId").isJsonNull()) + && !jsonObj.get("sourceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `sourceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("sourceId").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DbtModelSyncTrigger.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DbtModelSyncTrigger' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DbtModelSyncTrigger.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DbtModelSyncTrigger value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DbtModelSyncTrigger read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DbtModelSyncTrigger given an JSON string + * + * @param jsonString JSON string + * @return An instance of DbtModelSyncTrigger + * @throws IOException if the JSON string is invalid with respect to DbtModelSyncTrigger + */ + public static DbtModelSyncTrigger fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DbtModelSyncTrigger.class); + } + + /** + * Convert an instance of DbtModelSyncTrigger to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index 3918b99f..21f27318 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -116,6 +116,8 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { /** The regulation type. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { + DELETE_ARCHIVE_ONLY("DELETE_ARCHIVE_ONLY"), + DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), From 8e9ca31d75dd7fa8d53f6dfaba776084dff071e9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 12 Dec 2024 21:03:26 +0000 Subject: [PATCH 374/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f6057e9b. From 081766d4c986ab7575ba1d5473afcdd03307d0d7 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 12 Dec 2024 22:06:17 +0000 Subject: [PATCH 375/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@205ffd13. From e648ac616dfe11f5966aefdea5eff487d516e50d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 8 Jan 2025 21:26:11 +0000 Subject: [PATCH 376/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0ca248f8. From b5436c6e24ac664ac625b175c362e4c7d48c7aa4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 8 Jan 2025 23:07:13 +0000 Subject: [PATCH 377/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7a569d8b. From 3a21b3f34e873444d23b2813e015b4674a47e771 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 9 Jan 2025 00:52:03 +0000 Subject: [PATCH 378/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c1e90ae2. From cd928d723a78b28191673aa10019c7e07347da78 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 9 Jan 2025 20:46:38 +0000 Subject: [PATCH 379/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6b54257f. From 090c4e945cfe9ca3fb895ba98558f502a2d1e92e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 10 Jan 2025 18:25:48 +0000 Subject: [PATCH 380/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@816cc0d2. --- src/main/java/com/segment/publicapi/JSON.java | 3 + .../com/segment/publicapi/models/Config.java | 89 ++++++- .../ReverseEtlDbtCloudScheduleConfig.java | 249 ++++++++++++++++++ .../models/ReverseEtlScheduleConfig.java | 88 ++++++- .../models/ReverseEtlScheduleDefinition.java | 6 +- 5 files changed, 421 insertions(+), 14 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 20c61990..9d283993 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -1345,6 +1345,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlCronScheduleConfig .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReverseEtlDbtCloudScheduleConfig + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReverseEtlModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index fed0fbe5..a1455431 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -49,6 +49,10 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter adapterReverseEtlCronScheduleConfig = gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlDbtCloudScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -91,9 +95,21 @@ public void write(JsonWriter out, Config value) throws IOException { elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlDbtCloudScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlDbtCloudScheduleConfig) { + JsonElement element = + adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( + (ReverseEtlDbtCloudScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + " ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -172,6 +188,28 @@ public Config read(JsonReader in) throws IOException { + " 'ReverseEtlCronScheduleConfig'", e); } + // deserialize ReverseEtlDbtCloudScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlDbtCloudScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlDbtCloudScheduleConfig'", + e); + } throw new IOException( String.format( @@ -196,6 +234,11 @@ public Config(ReverseEtlCronScheduleConfig o) { setActualInstance(o); } + public Config(ReverseEtlDbtCloudScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + public Config(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); @@ -211,6 +254,7 @@ public Config(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); + schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); } @Override @@ -221,7 +265,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -247,17 +292,24 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); + + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } /** * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig) + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) */ @Override public Object getActualInstance() { @@ -300,6 +352,18 @@ public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() return (ReverseEtlCronScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not + * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` + */ + public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() + throws ClassCastException { + return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -344,10 +408,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlDbtCloudScheduleConfig + try { + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java new file mode 100644 index 00000000..c5cc1360 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Definition for dbt cloud job event schedule. */ +public class ReverseEtlDbtCloudScheduleConfig { + public static final String SERIALIZED_NAME_JOB_ID = "jobId"; + + @SerializedName(SERIALIZED_NAME_JOB_ID) + private String jobId; + + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public ReverseEtlDbtCloudScheduleConfig() {} + + public ReverseEtlDbtCloudScheduleConfig jobId(String jobId) { + + this.jobId = jobId; + return this; + } + + /** + * The dbt cloud job id used to start a reverse ETL sync. + * + * @return jobId + */ + @javax.annotation.Nonnull + public String getJobId() { + return jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public ReverseEtlDbtCloudScheduleConfig accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * The dbt cloud account id where the job belongs to. + * + * @return accountId + */ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReverseEtlDbtCloudScheduleConfig reverseEtlDbtCloudScheduleConfig = + (ReverseEtlDbtCloudScheduleConfig) o; + return Objects.equals(this.jobId, reverseEtlDbtCloudScheduleConfig.jobId) + && Objects.equals(this.accountId, reverseEtlDbtCloudScheduleConfig.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(jobId, accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReverseEtlDbtCloudScheduleConfig {\n"); + sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jobId"); + openapiFields.add("accountId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jobId"); + openapiRequiredFields.add("accountId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReverseEtlDbtCloudScheduleConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReverseEtlDbtCloudScheduleConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReverseEtlDbtCloudScheduleConfig is" + + " not found in the empty JSON string", + ReverseEtlDbtCloudScheduleConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReverseEtlDbtCloudScheduleConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReverseEtlDbtCloudScheduleConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReverseEtlDbtCloudScheduleConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("jobId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `jobId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("jobId").toString())); + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `accountId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReverseEtlDbtCloudScheduleConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReverseEtlDbtCloudScheduleConfig' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReverseEtlDbtCloudScheduleConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReverseEtlDbtCloudScheduleConfig read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReverseEtlDbtCloudScheduleConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReverseEtlDbtCloudScheduleConfig + * @throws IOException if the JSON string is invalid with respect to + * ReverseEtlDbtCloudScheduleConfig + */ + public static ReverseEtlDbtCloudScheduleConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReverseEtlDbtCloudScheduleConfig.class); + } + + /** + * Convert an instance of ReverseEtlDbtCloudScheduleConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java index 47909984..62a91020 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleConfig.java @@ -50,6 +50,10 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter adapterReverseEtlCronScheduleConfig = gson.getDelegateAdapter( this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlDbtCloudScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -93,9 +97,21 @@ public void write(JsonWriter out, ReverseEtlScheduleConfig value) elementAdapter.write(out, element); return; } + // check if the actual instance is of the type + // `ReverseEtlDbtCloudScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlDbtCloudScheduleConfig) { + JsonElement element = + adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( + (ReverseEtlDbtCloudScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" + " ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig," + " ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig"); } @@ -174,6 +190,28 @@ public ReverseEtlScheduleConfig read(JsonReader in) throws IOException { + " 'ReverseEtlCronScheduleConfig'", e); } + // deserialize ReverseEtlDbtCloudScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; + ReverseEtlScheduleConfig ret = new ReverseEtlScheduleConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlDbtCloudScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlDbtCloudScheduleConfig'", + e); + } throw new IOException( String.format( @@ -199,6 +237,11 @@ public ReverseEtlScheduleConfig(ReverseEtlCronScheduleConfig o) { setActualInstance(o); } + public ReverseEtlScheduleConfig(ReverseEtlDbtCloudScheduleConfig o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + public ReverseEtlScheduleConfig(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.FALSE); setActualInstance(o); @@ -214,6 +257,7 @@ public ReverseEtlScheduleConfig(ReverseEtlSpecificTimeScheduleConfig o) { schemas.put( "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); + schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); } @Override @@ -224,7 +268,8 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -245,17 +290,24 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig"); + + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } /** * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig) + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) */ @Override public Object getActualInstance() { @@ -298,6 +350,18 @@ public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() return (ReverseEtlCronScheduleConfig) super.getActualInstance(); } + /** + * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not + * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` + */ + public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() + throws ClassCastException { + return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); + } + /** * Validates the JSON Element and throws an exception if issues found * @@ -342,11 +406,23 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti e.getMessage())); // continue to the next one } + // validate the json string with ReverseEtlDbtCloudScheduleConfig + try { + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } throw new IOException( String.format( "The JSON string is invalid for ReverseEtlScheduleConfig with anyOf" + " schemas: ReverseEtlCronScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + " expected at least 1. Detailed failure message for anyOf schemas:" + " %s. JSON: %s", diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java index ba4eae98..9b466492 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -35,11 +35,13 @@ * strategy. */ public class ReverseEtlScheduleDefinition { - /** Strategy supports: Periodic, Specific Days, Manual, CRON. */ + /** Strategy supports: Periodic, Specific Days, Manual, CRON and DBT_CLOUD. */ @JsonAdapter(StrategyEnum.Adapter.class) public enum StrategyEnum { CRON("CRON"), + DBT_CLOUD("DBT_CLOUD"), + MANUAL("MANUAL"), PERIODIC("PERIODIC"), @@ -104,7 +106,7 @@ public ReverseEtlScheduleDefinition strategy(StrategyEnum strategy) { } /** - * Strategy supports: Periodic, Specific Days, Manual, CRON. + * Strategy supports: Periodic, Specific Days, Manual, CRON and DBT_CLOUD. * * @return strategy */ From c5a51de52285921b290f75f26d76173e2c88cbf3 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 10 Jan 2025 22:16:28 +0000 Subject: [PATCH 381/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3f51a0ba. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/Configuration.java | 2 +- .../com/segment/publicapi/models/DbtModelSyncTrigger.java | 4 ++-- .../models/ReverseEtlDbtCloudScheduleConfig.java | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index da6f8457..8e0c1bfa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.2.0 +Latest API and SDK version: 57.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.2.0 + 57.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.2.0" + implementation "com.segment.publicapi:segment-publicapi:57.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.2.0.jar` +* `target/segment-publicapi-57.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 7495a21d..79ce76a7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.2.0 + 57.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index f40f1146..6fbf3881 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.2.0 (Java)"); + setUserAgent("Public API SDK 57.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index df2f582b..5048cb9a 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.2.0"; + public static final String VERSION = "57.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java index 8d8555e5..78d96c4b 100644 --- a/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java +++ b/src/main/java/com/segment/publicapi/models/DbtModelSyncTrigger.java @@ -27,7 +27,7 @@ import java.util.Objects; import java.util.Set; -/** Defines the DBT Model Sync Trigger. */ +/** Defines the dbt Model Sync Trigger. */ public class DbtModelSyncTrigger { public static final String SERIALIZED_NAME_ID = "id"; @@ -53,7 +53,7 @@ public DbtModelSyncTrigger id(String id) { } /** - * The id of the DBT Model Sync. + * The id of the dbt model sync. * * @return id */ diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java b/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java index c5cc1360..493daba2 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlDbtCloudScheduleConfig.java @@ -27,7 +27,7 @@ import java.util.Objects; import java.util.Set; -/** Definition for dbt cloud job event schedule. */ +/** Definition for a schedule triggered by dbt Cloud job events. */ public class ReverseEtlDbtCloudScheduleConfig { public static final String SERIALIZED_NAME_JOB_ID = "jobId"; @@ -48,7 +48,7 @@ public ReverseEtlDbtCloudScheduleConfig jobId(String jobId) { } /** - * The dbt cloud job id used to start a reverse ETL sync. + * The dbt Cloud job used to trigger a sync for a Reverse ETL Connection. * * @return jobId */ @@ -68,7 +68,7 @@ public ReverseEtlDbtCloudScheduleConfig accountId(String accountId) { } /** - * The dbt cloud account id where the job belongs to. + * The dbt Cloud account where the job belongs to. * * @return accountId */ From b14c6ce45da87b6b5a2ef5cf6d399eb0217ce0a1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 16 Jan 2025 17:22:46 +0000 Subject: [PATCH 382/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@91356867. --- docs/DeletionAndSuppressionApi.md | 4 +- .../api/DeletionAndSuppressionApi.java | 44 +++++++++++++------ .../models/CreateSourceRegulationV1Input.java | 8 +++- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index dd8df975..14ea6d8d 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -21,7 +21,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Cloud Source Regulation -Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent` +Creates a Source-scoped regulation. Please Note: Suppression rules at the workspace level take precedence over those at the source level. If a user has been suppressed at the workspace level, any attempt to unsuppress them at the source level is not supported and the processing of the request will fail in the Segment Config API omitted fields: - `attributes`, - `userAgent` ### Example @@ -96,7 +96,7 @@ public class Example { Create Source Regulation -Creates a Source-scoped regulation. • When called, this endpoint may generate the `Source Regulation Created` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - `userAgent` +Creates a Source-scoped regulation. Please Note: Suppression rules at the workspace level take precedence over those at the source level. If a user has been suppressed at the workspace level, any attempt to unsuppress them at the source level is not supported and the processing of the request will fail in the Segment • When called, this endpoint may generate the `Source Regulation Created` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - `userAgent` ### Example diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 2e21e1d8..eb67d1fe 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -186,8 +186,11 @@ private okhttp3.Call createCloudSourceRegulationValidateBeforeCall( } /** - * Create Cloud Source Regulation Creates a Source-scoped regulation. Config API omitted fields: - * - `attributes`, - `userAgent` + * Create Cloud Source Regulation Creates a Source-scoped regulation. Please Note: Suppression + * rules at the workspace level take precedence over those at the source level. If a user has + * been suppressed at the workspace level, any attempt to unsuppress them at the source level is + * not supported and the processing of the request will fail in the Segment Config API omitted + * fields: - `attributes`, - `userAgent` * * @param sourceId (required) * @param createCloudSourceRegulationV1Input (required) @@ -213,8 +216,11 @@ public CreateCloudSourceRegulation200Response createCloudSourceRegulation( } /** - * Create Cloud Source Regulation Creates a Source-scoped regulation. Config API omitted fields: - * - `attributes`, - `userAgent` + * Create Cloud Source Regulation Creates a Source-scoped regulation. Please Note: Suppression + * rules at the workspace level take precedence over those at the source level. If a user has + * been suppressed at the workspace level, any attempt to unsuppress them at the source level is + * not supported and the processing of the request will fail in the Segment Config API omitted + * fields: - `attributes`, - `userAgent` * * @param sourceId (required) * @param createCloudSourceRegulationV1Input (required) @@ -244,8 +250,11 @@ public CreateCloudSourceRegulation200Response createCloudSourceRegulation( } /** - * Create Cloud Source Regulation (asynchronously) Creates a Source-scoped regulation. Config - * API omitted fields: - `attributes`, - `userAgent` + * Create Cloud Source Regulation (asynchronously) Creates a Source-scoped regulation. Please + * Note: Suppression rules at the workspace level take precedence over those at the source + * level. If a user has been suppressed at the workspace level, any attempt to unsuppress them + * at the source level is not supported and the processing of the request will fail in the + * Segment Config API omitted fields: - `attributes`, - `userAgent` * * @param sourceId (required) * @param createCloudSourceRegulationV1Input (required) @@ -389,8 +398,11 @@ private okhttp3.Call createSourceRegulationValidateBeforeCall( } /** - * Create Source Regulation Creates a Source-scoped regulation. • When called, this endpoint may - * generate the `Source Regulation Created` event in the [audit + * Create Source Regulation Creates a Source-scoped regulation. Please Note: Suppression rules + * at the workspace level take precedence over those at the source level. If a user has been + * suppressed at the workspace level, any attempt to unsuppress them at the source level is not + * supported and the processing of the request will fail in the Segment • When called, this + * endpoint may generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * @@ -417,8 +429,11 @@ public CreateSourceRegulation200Response createSourceRegulation( } /** - * Create Source Regulation Creates a Source-scoped regulation. • When called, this endpoint may - * generate the `Source Regulation Created` event in the [audit + * Create Source Regulation Creates a Source-scoped regulation. Please Note: Suppression rules + * at the workspace level take precedence over those at the source level. If a user has been + * suppressed at the workspace level, any attempt to unsuppress them at the source level is not + * supported and the processing of the request will fail in the Segment • When called, this + * endpoint may generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * @@ -447,9 +462,12 @@ public ApiResponse createSourceRegulationWith } /** - * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. • When called, - * this endpoint may generate the `Source Regulation Created` event in the [audit - * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - + * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. Please Note: + * Suppression rules at the workspace level take precedence over those at the source level. If a + * user has been suppressed at the workspace level, any attempt to unsuppress them at the source + * level is not supported and the processing of the request will fail in the Segment • When + * called, this endpoint may generate the `Source Regulation Created` event in the + * [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * * @param sourceId (required) diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 04b22aa8..8bfa9987 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -32,7 +32,10 @@ /** The input to create a Source-scoped regulation. */ public class CreateSourceRegulationV1Input { - /** The regulation type to create. */ + /** + * The regulation type to create. Please note that `DELETE_ARCHIVE_ONLY` is only + * supported for limited Workspaces for Source-scoped regulations. + */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { DELETE_ARCHIVE_ONLY("DELETE_ARCHIVE_ONLY"), @@ -158,7 +161,8 @@ public CreateSourceRegulationV1Input regulationType(RegulationTypeEnum regulatio } /** - * The regulation type to create. + * The regulation type to create. Please note that `DELETE_ARCHIVE_ONLY` is only + * supported for limited Workspaces for Source-scoped regulations. * * @return regulationType */ From 0cd96741932d0c8c8a30705b081d9cbc6043f1ed Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 16 Jan 2025 18:11:21 +0000 Subject: [PATCH 383/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b175a77a. From 6527be12ff3e10ebfa0ee772ef0289ce4e08e133 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 16 Jan 2025 19:12:41 +0000 Subject: [PATCH 384/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f5e76f0d. --- docs/DeletionAndSuppressionApi.md | 4 +- .../api/DeletionAndSuppressionApi.java | 50 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 14ea6d8d..f4c255f0 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -21,7 +21,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Cloud Source Regulation -Creates a Source-scoped regulation. Please Note: Suppression rules at the workspace level take precedence over those at the source level. If a user has been suppressed at the workspace level, any attempt to unsuppress them at the source level is not supported and the processing of the request will fail in the Segment Config API omitted fields: - `attributes`, - `userAgent` +Creates a Source-scoped regulation. Please Note: Suppression rules at the Workspace level take precedence over those at the Source level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not supported and the processing of the request will fail in Segment Config API omitted fields: - `attributes`, - `userAgent` ### Example @@ -96,7 +96,7 @@ public class Example { Create Source Regulation -Creates a Source-scoped regulation. Please Note: Suppression rules at the workspace level take precedence over those at the source level. If a user has been suppressed at the workspace level, any attempt to unsuppress them at the source level is not supported and the processing of the request will fail in the Segment • When called, this endpoint may generate the `Source Regulation Created` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - `userAgent` +Creates a Source-scoped regulation. Please Note: Suppression rules at the Workspace level take precedence over those at the Source level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not supported and the processing of the request will fail in Segment • When called, this endpoint may generate the `Source Regulation Created` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - `userAgent` ### Example diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index eb67d1fe..3070d13b 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -187,10 +187,10 @@ private okhttp3.Call createCloudSourceRegulationValidateBeforeCall( /** * Create Cloud Source Regulation Creates a Source-scoped regulation. Please Note: Suppression - * rules at the workspace level take precedence over those at the source level. If a user has - * been suppressed at the workspace level, any attempt to unsuppress them at the source level is - * not supported and the processing of the request will fail in the Segment Config API omitted - * fields: - `attributes`, - `userAgent` + * rules at the Workspace level take precedence over those at the Source level. If a user has + * been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not + * supported and the processing of the request will fail in Segment Config API omitted fields: - + * `attributes`, - `userAgent` * * @param sourceId (required) * @param createCloudSourceRegulationV1Input (required) @@ -217,10 +217,10 @@ public CreateCloudSourceRegulation200Response createCloudSourceRegulation( /** * Create Cloud Source Regulation Creates a Source-scoped regulation. Please Note: Suppression - * rules at the workspace level take precedence over those at the source level. If a user has - * been suppressed at the workspace level, any attempt to unsuppress them at the source level is - * not supported and the processing of the request will fail in the Segment Config API omitted - * fields: - `attributes`, - `userAgent` + * rules at the Workspace level take precedence over those at the Source level. If a user has + * been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not + * supported and the processing of the request will fail in Segment Config API omitted fields: - + * `attributes`, - `userAgent` * * @param sourceId (required) * @param createCloudSourceRegulationV1Input (required) @@ -251,10 +251,10 @@ public CreateCloudSourceRegulation200Response createCloudSourceRegulation( /** * Create Cloud Source Regulation (asynchronously) Creates a Source-scoped regulation. Please - * Note: Suppression rules at the workspace level take precedence over those at the source - * level. If a user has been suppressed at the workspace level, any attempt to unsuppress them - * at the source level is not supported and the processing of the request will fail in the - * Segment Config API omitted fields: - `attributes`, - `userAgent` + * Note: Suppression rules at the Workspace level take precedence over those at the Source + * level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at + * the Source level is not supported and the processing of the request will fail in Segment + * Config API omitted fields: - `attributes`, - `userAgent` * * @param sourceId (required) * @param createCloudSourceRegulationV1Input (required) @@ -399,10 +399,10 @@ private okhttp3.Call createSourceRegulationValidateBeforeCall( /** * Create Source Regulation Creates a Source-scoped regulation. Please Note: Suppression rules - * at the workspace level take precedence over those at the source level. If a user has been - * suppressed at the workspace level, any attempt to unsuppress them at the source level is not - * supported and the processing of the request will fail in the Segment • When called, this - * endpoint may generate the `Source Regulation Created` event in the [audit + * at the Workspace level take precedence over those at the Source level. If a user has been + * suppressed at the Workspace level, any attempt to un-suppress at the Source level is not + * supported and the processing of the request will fail in Segment • When called, this endpoint + * may generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * @@ -430,10 +430,10 @@ public CreateSourceRegulation200Response createSourceRegulation( /** * Create Source Regulation Creates a Source-scoped regulation. Please Note: Suppression rules - * at the workspace level take precedence over those at the source level. If a user has been - * suppressed at the workspace level, any attempt to unsuppress them at the source level is not - * supported and the processing of the request will fail in the Segment • When called, this - * endpoint may generate the `Source Regulation Created` event in the [audit + * at the Workspace level take precedence over those at the Source level. If a user has been + * suppressed at the Workspace level, any attempt to un-suppress at the Source level is not + * supported and the processing of the request will fail in Segment • When called, this endpoint + * may generate the `Source Regulation Created` event in the [audit * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * @@ -463,11 +463,11 @@ public ApiResponse createSourceRegulationWith /** * Create Source Regulation (asynchronously) Creates a Source-scoped regulation. Please Note: - * Suppression rules at the workspace level take precedence over those at the source level. If a - * user has been suppressed at the workspace level, any attempt to unsuppress them at the source - * level is not supported and the processing of the request will fail in the Segment • When - * called, this endpoint may generate the `Source Regulation Created` event in the - * [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - + * Suppression rules at the Workspace level take precedence over those at the Source level. If a + * user has been suppressed at the Workspace level, any attempt to un-suppress at the Source + * level is not supported and the processing of the request will fail in Segment • When called, + * this endpoint may generate the `Source Regulation Created` event in the [audit + * trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - * `userAgent` * * @param sourceId (required) From a052d5c18048e06663a342997cd35a9f831e86a6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 16 Jan 2025 20:21:24 +0000 Subject: [PATCH 385/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f58dbcf9. --- docs/DeletionAndSuppressionApi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index f4c255f0..725d0aae 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -21,7 +21,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Cloud Source Regulation -Creates a Source-scoped regulation. Please Note: Suppression rules at the Workspace level take precedence over those at the Source level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not supported and the processing of the request will fail in Segment Config API omitted fields: - `attributes`, - `userAgent` +Creates a Source-scoped regulation. Please Note: Suppression rules at the Workspace level take precedence over those at the Source level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not supported and the processing of the request will fail in Segment Config API omitted fields: - `attributes`, - `userAgent` ### Example @@ -96,7 +96,7 @@ public class Example { Create Source Regulation -Creates a Source-scoped regulation. Please Note: Suppression rules at the Workspace level take precedence over those at the Source level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not supported and the processing of the request will fail in Segment • When called, this endpoint may generate the `Source Regulation Created` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - `userAgent` +Creates a Source-scoped regulation. Please Note: Suppression rules at the Workspace level take precedence over those at the Source level. If a user has been suppressed at the Workspace level, any attempt to un-suppress at the Source level is not supported and the processing of the request will fail in Segment • When called, this endpoint may generate the `Source Regulation Created` event in the [audit trail](/tag/Audit-Trail). Config API omitted fields: - `attributes`, - `userAgent` ### Example From 0fce99efcb4c24a13cd913e9767a69c1fe9c0f65 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 23 Jan 2025 22:38:01 +0000 Subject: [PATCH 386/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@818f08b0. From d5d8d8d9fcc7aff6a451d4875e313a56ad31e069 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 24 Jan 2025 19:50:52 +0000 Subject: [PATCH 387/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@98fb75e4. From 60ba2c2195a4afb986c9d75f5ec1a66f062a8eab Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 28 Jan 2025 10:29:17 +0000 Subject: [PATCH 388/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6aa52ac2. --- docs/DeletionAndSuppressionApi.md | 4 ++-- .../publicapi/models/CreateWorkspaceRegulationV1Input.java | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 725d0aae..855605d7 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -437,7 +437,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| | | | **status** | **String**| The status on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | -| **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | +| **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_ARCHIVE_ONLY, DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | ### Return type @@ -587,7 +587,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **status** | **String**| The status on which to filter the returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | -| **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_ARCHIVE_ONLY, DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | +| **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | ### Return type diff --git a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java index a511a8d7..0f9ebe36 100644 --- a/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateWorkspaceRegulationV1Input.java @@ -35,8 +35,6 @@ public class CreateWorkspaceRegulationV1Input { /** The regulation type to create. */ @JsonAdapter(RegulationTypeEnum.Adapter.class) public enum RegulationTypeEnum { - DELETE_ARCHIVE_ONLY("DELETE_ARCHIVE_ONLY"), - DELETE_INTERNAL("DELETE_INTERNAL"), DELETE_ONLY("DELETE_ONLY"), @@ -96,8 +94,6 @@ public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { /** The subject type. Use `objectId` for Cloud Source regulations. */ @JsonAdapter(SubjectTypeEnum.Adapter.class) public enum SubjectTypeEnum { - ANONYMOUS_ID("ANONYMOUS_ID"), - OBJECT_ID("OBJECT_ID"), USER_ID("USER_ID"); From f6aa420b7e1463b0773f238802b940b967d55f14 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 30 Jan 2025 04:25:55 +0000 Subject: [PATCH 389/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a0d5c742. --- .../models/CreateSourceRegulationV1Input.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java index 8bfa9987..bf30bf87 100644 --- a/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateSourceRegulationV1Input.java @@ -96,7 +96,11 @@ public RegulationTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REGULATION_TYPE) private RegulationTypeEnum regulationType; - /** The subject type. */ + /** + * The subject type. Note: `ANONYMOUS_ID` is only supported for limited Workspaces for + * Source-scoped regulations. `ANONYMOUS_ID` is only supported when regulationType is + * `DELETE_ARCHIVE_ONLY`. + */ @JsonAdapter(SubjectTypeEnum.Adapter.class) public enum SubjectTypeEnum { ANONYMOUS_ID("ANONYMOUS_ID"), @@ -182,7 +186,9 @@ public CreateSourceRegulationV1Input subjectType(SubjectTypeEnum subjectType) { } /** - * The subject type. + * The subject type. Note: `ANONYMOUS_ID` is only supported for limited Workspaces for + * Source-scoped regulations. `ANONYMOUS_ID` is only supported when regulationType is + * `DELETE_ARCHIVE_ONLY`. * * @return subjectType */ @@ -210,8 +216,8 @@ public CreateSourceRegulationV1Input addSubjectIdsItem(String subjectIdsItem) { } /** - * The list of `userId` or `objectId` values of the subjects to regulate. - * Config API note: equal to `parent` but allows an array. + * The list of `userId` or `objectId` or `anonymousId` values of + * the subjects to regulate. Config API note: equal to `parent` but allows an array. * * @return subjectIds */ From be152558b023f3659edc11d9136fae0f55d64048 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Feb 2025 18:48:59 +0000 Subject: [PATCH 390/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d85de23b. --- docs/DeletionAndSuppressionApi.md | 4 ++-- docs/SourcesApi.md | 2 +- .../com/segment/publicapi/models/DestinationStatusV1.java | 6 +++--- src/main/java/com/segment/publicapi/models/Regulation.java | 6 +++--- .../com/segment/publicapi/models/RegulationListEntryV1.java | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 855605d7..2c29bd83 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -436,7 +436,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| | | -| **status** | **String**| The status on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | +| **status** | **String**| The status on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, IN_PROGRESS, NOT_SUPPORTED, PARTIAL_SUCCESS] | | **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_ARCHIVE_ONLY, DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | @@ -586,7 +586,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **status** | **String**| The status on which to filter the returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | +| **status** | **String**| The status on which to filter the returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, IN_PROGRESS, NOT_SUPPORTED, PARTIAL_SUCCESS] | | **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | diff --git a/docs/SourcesApi.md b/docs/SourcesApi.md index 63f1d518..9b04b091 100644 --- a/docs/SourcesApi.md +++ b/docs/SourcesApi.md @@ -936,7 +936,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); SourcesApi apiInstance = new SourcesApi(defaultClient); - String sourceId = "87jXXk8QSLFPfMDGa6mtS3"; // String | + String sourceId = "44LMHs8Wf5vidxba4kN52J"; // String | UpdateSourceV1Input updateSourceV1Input = new UpdateSourceV1Input(); // UpdateSourceV1Input | try { UpdateSource200Response result = apiInstance.updateSource(sourceId, updateSourceV1Input); diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index ad592d08..728c32fc 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -51,11 +51,11 @@ public enum StatusEnum { INVALID("INVALID"), - NOT_SUPPORTED("NOT_SUPPORTED"), + IN_PROGRESS("IN_PROGRESS"), - PARTIAL_SUCCESS("PARTIAL_SUCCESS"), + NOT_SUPPORTED("NOT_SUPPORTED"), - RUNNING("RUNNING"); + PARTIAL_SUCCESS("PARTIAL_SUCCESS"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index 6bdd1138..576c5cf5 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -54,11 +54,11 @@ public enum OverallStatusEnum { INVALID("INVALID"), - NOT_SUPPORTED("NOT_SUPPORTED"), + IN_PROGRESS("IN_PROGRESS"), - PARTIAL_SUCCESS("PARTIAL_SUCCESS"), + NOT_SUPPORTED("NOT_SUPPORTED"), - RUNNING("RUNNING"); + PARTIAL_SUCCESS("PARTIAL_SUCCESS"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index 21f27318..baa14e8c 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -58,11 +58,11 @@ public enum StatusEnum { INVALID("INVALID"), - NOT_SUPPORTED("NOT_SUPPORTED"), + IN_PROGRESS("IN_PROGRESS"), - PARTIAL_SUCCESS("PARTIAL_SUCCESS"), + NOT_SUPPORTED("NOT_SUPPORTED"), - RUNNING("RUNNING"); + PARTIAL_SUCCESS("PARTIAL_SUCCESS"); private String value; From d5c347995c3dbe336ddfeb5adc4468fa12fffdf5 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 25 Feb 2025 00:46:45 +0000 Subject: [PATCH 391/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6bbbe661. From c8fe0d3c3dcc8a2d413f71969b6c6c0277c919c9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 26 Feb 2025 00:06:44 +0000 Subject: [PATCH 392/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ef68ab58. From 6bb73bacc3386e8c9286a7f9597ae390380d82b1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 26 Feb 2025 17:45:15 +0000 Subject: [PATCH 393/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b10a70ae. --- docs/DeletionAndSuppressionApi.md | 4 ++-- .../com/segment/publicapi/models/DestinationStatusV1.java | 6 +++--- src/main/java/com/segment/publicapi/models/Regulation.java | 6 +++--- .../com/segment/publicapi/models/RegulationListEntryV1.java | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 2c29bd83..855605d7 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -436,7 +436,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **sourceId** | **String**| | | -| **status** | **String**| The status on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, IN_PROGRESS, NOT_SUPPORTED, PARTIAL_SUCCESS] | +| **status** | **String**| The status on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | | **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_ARCHIVE_ONLY, DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | @@ -586,7 +586,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **status** | **String**| The status on which to filter the returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, IN_PROGRESS, NOT_SUPPORTED, PARTIAL_SUCCESS] | +| **status** | **String**| The status on which to filter the returned regulations. This parameter exists in v1. | [optional] [enum: FAILED, FINISHED, INITIALIZED, INVALID, NOT_SUPPORTED, PARTIAL_SUCCESS, RUNNING] | | **regulationTypes** | [**List<String>**](String.md)| The regulation types on which to filter returned regulations. This parameter exists in v1. | [optional] [enum: DELETE_INTERNAL, DELETE_ONLY, SUPPRESS_ONLY, SUPPRESS_WITH_DELETE, SUPPRESS_WITH_DELETE_INTERNAL, UNSUPPRESS] | | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | diff --git a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java index 728c32fc..ad592d08 100644 --- a/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java +++ b/src/main/java/com/segment/publicapi/models/DestinationStatusV1.java @@ -51,11 +51,11 @@ public enum StatusEnum { INVALID("INVALID"), - IN_PROGRESS("IN_PROGRESS"), - NOT_SUPPORTED("NOT_SUPPORTED"), - PARTIAL_SUCCESS("PARTIAL_SUCCESS"); + PARTIAL_SUCCESS("PARTIAL_SUCCESS"), + + RUNNING("RUNNING"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/Regulation.java b/src/main/java/com/segment/publicapi/models/Regulation.java index 576c5cf5..6bdd1138 100644 --- a/src/main/java/com/segment/publicapi/models/Regulation.java +++ b/src/main/java/com/segment/publicapi/models/Regulation.java @@ -54,11 +54,11 @@ public enum OverallStatusEnum { INVALID("INVALID"), - IN_PROGRESS("IN_PROGRESS"), - NOT_SUPPORTED("NOT_SUPPORTED"), - PARTIAL_SUCCESS("PARTIAL_SUCCESS"); + PARTIAL_SUCCESS("PARTIAL_SUCCESS"), + + RUNNING("RUNNING"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java index baa14e8c..21f27318 100644 --- a/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java +++ b/src/main/java/com/segment/publicapi/models/RegulationListEntryV1.java @@ -58,11 +58,11 @@ public enum StatusEnum { INVALID("INVALID"), - IN_PROGRESS("IN_PROGRESS"), - NOT_SUPPORTED("NOT_SUPPORTED"), - PARTIAL_SUCCESS("PARTIAL_SUCCESS"); + PARTIAL_SUCCESS("PARTIAL_SUCCESS"), + + RUNNING("RUNNING"); private String value; From 909dbe885dfe3abdc77120e57747367f7aaca550 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 27 Feb 2025 02:12:45 +0000 Subject: [PATCH 394/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@936f6972. From d2de673755dba65debdd68db23ea575c36e2b4fd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 27 Feb 2025 23:07:05 +0000 Subject: [PATCH 395/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b0c27d2c. From be581745fcaab31dddbdf3a37ec3dbbbe2208732 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 28 Feb 2025 21:20:50 +0000 Subject: [PATCH 396/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6920cc9d. From 8d69d75374a9e84093eb42f763da7fb53db4626f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 3 Mar 2025 11:57:14 +0000 Subject: [PATCH 397/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f214a9ac. --- README.md | 8 +- docs/JourneysApi.md | 554 ++++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 133 ++ .../segment/publicapi/api/JourneysApi.java | 1569 +++++++++++++++++ .../publicapi/models/ActionDefinition.java | 375 ++++ .../segment/publicapi/models/Activation.java | 308 ++++ .../segment/publicapi/models/Analytics.java | 229 +++ .../publicapi/models/AudienceEntryState.java | 374 ++++ .../publicapi/models/AudienceExitRule.java | 518 ++++++ .../segment/publicapi/models/BaseState.java | 341 ++++ .../publicapi/models/ConcurrencyConfig.java | 236 +++ .../publicapi/models/ConditionBranch.java | 324 ++++ .../publicapi/models/ConditionSplitState.java | 338 ++++ .../models/CreateJourney201Response.java | 194 ++ .../models/CreateJourneyAlphaInput.java | 275 +++ .../models/CreateJourneyAlphaOutput.java | 203 +++ .../publicapi/models/DefaultBranch.java | 287 +++ .../segment/publicapi/models/Destination.java | 261 +++ .../publicapi/models/DestinationState.java | 390 ++++ .../segment/publicapi/models/EntryRules.java | 287 +++ .../publicapi/models/EventEntryState.java | 390 ++++ .../publicapi/models/EventExitRule.java | 517 ++++++ .../models/EventSplitWithTimeoutState.java | 339 ++++ .../segment/publicapi/models/ExitRule.java | 484 +++++ .../publicapi/models/ExitRulesConfig.java | 255 +++ .../segment/publicapi/models/ExitState.java | 281 +++ .../models/GetJourney200Response.java | 193 ++ .../models/GetJourneyAlphaOutput.java | 202 +++ .../GetJourneyAnalytics200Response.java | 199 +++ .../GetJourneyAnalyticsAlphaOutput.java | 209 +++ .../publicapi/models/JourneyAnalytics.java | 261 +++ .../publicapi/models/JourneyDefinition.java | 324 ++++ .../publicapi/models/JourneyDetails.java | 225 +++ .../segment/publicapi/models/JourneyInfo.java | 461 +++++ .../publicapi/models/JourneyState.java | 667 +++++++ .../models/JourneyVersionOutput.java | 500 ++++++ .../com/segment/publicapi/models/Key.java | 241 +++ .../models/PropertySelectionsConfig.java | 223 +++ .../publicapi/models/RandomSplitBranch.java | 237 +++ .../publicapi/models/RandomSplitState.java | 342 ++++ .../RemoveJourneyFromSpace200Response.java | 200 +++ .../RemoveJourneyFromSpaceAlphaOutput.java | 259 +++ .../ReplaceStepsForJourney200Response.java | 200 +++ .../ReplaceStepsForJourneyAlphaInput.java | 268 +++ .../ReplaceStepsForJourneyAlphaOutput.java | 234 +++ .../publicapi/models/SimpleDelayState.java | 374 ++++ .../segment/publicapi/models/StatesInner.java | 339 ++++ .../publicapi/models/StepLevelAnalytics.java | 265 +++ .../publicapi/models/TimeOutBranch.java | 323 ++++ .../publicapi/models/TopLevelAnalytics.java | 296 ++++ .../publicapi/models/TransitionState.java | 619 +++++++ .../segment/publicapi/models/Transitions.java | 206 +++ .../publicapi/models/TransitionsInner.java | 275 +++ .../publicapi/models/TransitionsInner1.java | 275 +++ ...dateDestinationsForJourney200Response.java | 206 +++ ...pdateDestinationsForJourneyAlphaInput.java | 241 +++ ...dateDestinationsForJourneyAlphaOutput.java | 306 ++++ .../models/UpdateDestinationsInput.java | 263 +++ .../UpdateStatusForJourney200Response.java | 200 +++ .../UpdateStatusForJourneyAlphaInput.java | 292 +++ .../UpdateStatusForJourneyAlphaOutput.java | 329 ++++ 64 files changed, 19723 insertions(+), 7 deletions(-) create mode 100644 docs/JourneysApi.md create mode 100644 src/main/java/com/segment/publicapi/api/JourneysApi.java create mode 100644 src/main/java/com/segment/publicapi/models/ActionDefinition.java create mode 100644 src/main/java/com/segment/publicapi/models/Activation.java create mode 100644 src/main/java/com/segment/publicapi/models/Analytics.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceEntryState.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceExitRule.java create mode 100644 src/main/java/com/segment/publicapi/models/BaseState.java create mode 100644 src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/ConditionBranch.java create mode 100644 src/main/java/com/segment/publicapi/models/ConditionSplitState.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateJourney201Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DefaultBranch.java create mode 100644 src/main/java/com/segment/publicapi/models/Destination.java create mode 100644 src/main/java/com/segment/publicapi/models/DestinationState.java create mode 100644 src/main/java/com/segment/publicapi/models/EntryRules.java create mode 100644 src/main/java/com/segment/publicapi/models/EventEntryState.java create mode 100644 src/main/java/com/segment/publicapi/models/EventExitRule.java create mode 100644 src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java create mode 100644 src/main/java/com/segment/publicapi/models/ExitRule.java create mode 100644 src/main/java/com/segment/publicapi/models/ExitRulesConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/ExitState.java create mode 100644 src/main/java/com/segment/publicapi/models/GetJourney200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/JourneyAnalytics.java create mode 100644 src/main/java/com/segment/publicapi/models/JourneyDefinition.java create mode 100644 src/main/java/com/segment/publicapi/models/JourneyDetails.java create mode 100644 src/main/java/com/segment/publicapi/models/JourneyInfo.java create mode 100644 src/main/java/com/segment/publicapi/models/JourneyState.java create mode 100644 src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/Key.java create mode 100644 src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/RandomSplitBranch.java create mode 100644 src/main/java/com/segment/publicapi/models/RandomSplitState.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/SimpleDelayState.java create mode 100644 src/main/java/com/segment/publicapi/models/StatesInner.java create mode 100644 src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java create mode 100644 src/main/java/com/segment/publicapi/models/TimeOutBranch.java create mode 100644 src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java create mode 100644 src/main/java/com/segment/publicapi/models/TransitionState.java create mode 100644 src/main/java/com/segment/publicapi/models/Transitions.java create mode 100644 src/main/java/com/segment/publicapi/models/TransitionsInner.java create mode 100644 src/main/java/com/segment/publicapi/models/TransitionsInner1.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java diff --git a/README.md b/README.md index 8e0c1bfa..be26748f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.3.0 +Latest API and SDK version: 57.4.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.3.0 + 57.4.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.3.0" + implementation "com.segment.publicapi:segment-publicapi:57.4.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.3.0.jar` +* `target/segment-publicapi-57.4.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/JourneysApi.md b/docs/JourneysApi.md new file mode 100644 index 00000000..4f9f25bb --- /dev/null +++ b/docs/JourneysApi.md @@ -0,0 +1,554 @@ +# JourneysApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createJourney**](JourneysApi.md#createJourney) | **POST** /spaces/{spaceId}/journeys | Create Journey | +| [**getJourney**](JourneysApi.md#getJourney) | **GET** /spaces/{spaceId}/journeys/{containerId} | Get Journey | +| [**getJourneyAnalytics**](JourneysApi.md#getJourneyAnalytics) | **GET** /spaces/{spaceId}/journeys/{containerId}/analytics | Get Journey Analytics | +| [**removeJourneyFromSpace**](JourneysApi.md#removeJourneyFromSpace) | **DELETE** /spaces/{spaceId}/journeys/{containerId} | Remove Journey from Space | +| [**replaceStepsForJourney**](JourneysApi.md#replaceStepsForJourney) | **PUT** /spaces/{spaceId}/journeys/{containerId}/steps | Replace Steps for Journey | +| [**updateDestinationsForJourney**](JourneysApi.md#updateDestinationsForJourney) | **PATCH** /spaces/{spaceId}/journeys/{containerId}/destinations | Update Destinations for Journey | +| [**updateStatusForJourney**](JourneysApi.md#updateStatusForJourney) | **PATCH** /spaces/{spaceId}/journeys/{containerId}/status | Update Status for Journey | + + + +## Operation: createJourney + +> CreateJourney201Response createJourney(spaceId, createJourneyAlphaInput) + +Create Journey + +Creates Journey. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "space_id"; // String | + CreateJourneyAlphaInput createJourneyAlphaInput = new CreateJourneyAlphaInput(); // CreateJourneyAlphaInput | + try { + CreateJourney201Response result = apiInstance.createJourney(spaceId, createJourneyAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#createJourney"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **createJourneyAlphaInput** | [**CreateJourneyAlphaInput**](CreateJourneyAlphaInput.md)| | | + +### Return type + +[**CreateJourney201Response**](CreateJourney201Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: getJourney + +> GetJourney200Response getJourney(spaceId, containerId) + +Get Journey + +Returns the journey by containerId • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "space_id"; // String | + String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | + try { + GetJourney200Response result = apiInstance.getJourney(spaceId, containerId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#getJourney"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **containerId** | **String**| | | + +### Return type + +[**GetJourney200Response**](GetJourney200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: getJourneyAnalytics + +> GetJourneyAnalytics200Response getJourneyAnalytics(spaceId, containerId, version, fromDate, toDate) + +Get Journey Analytics + +Get Analytics for a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "spaceId"; // String | + String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | + BigDecimal version = new BigDecimal("1"); // BigDecimal | The journey version. This parameter exists in alpha. + String fromDate = "2006-01-02T15:04:05.000Z"; // String | This parameter exists in alpha. + String toDate = "2006-01-02T15:04:05.000Z"; // String | This parameter exists in alpha. + try { + GetJourneyAnalytics200Response result = apiInstance.getJourneyAnalytics(spaceId, containerId, version, fromDate, toDate); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#getJourneyAnalytics"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **containerId** | **String**| | | +| **version** | **BigDecimal**| The journey version. This parameter exists in alpha. | | +| **fromDate** | **String**| This parameter exists in alpha. | | +| **toDate** | **String**| This parameter exists in alpha. | [optional] | + +### Return type + +[**GetJourneyAnalytics200Response**](GetJourneyAnalytics200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: removeJourneyFromSpace + +> RemoveJourneyFromSpace200Response removeJourneyFromSpace(spaceId, containerId, version) + +Remove Journey from Space + +Delete a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "spaceId"; // String | + String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | + BigDecimal version = new BigDecimal("1"); // BigDecimal | The journey version. This parameter exists in alpha. + try { + RemoveJourneyFromSpace200Response result = apiInstance.removeJourneyFromSpace(spaceId, containerId, version); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#removeJourneyFromSpace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **containerId** | **String**| | | +| **version** | **BigDecimal**| The journey version. This parameter exists in alpha. | | + +### Return type + +[**RemoveJourneyFromSpace200Response**](RemoveJourneyFromSpace200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: replaceStepsForJourney + +> ReplaceStepsForJourney200Response replaceStepsForJourney(spaceId, containerId, replaceStepsForJourneyAlphaInput) + +Replace Steps for Journey + +Replace steps for a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "spaceId"; // String | + String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput = new ReplaceStepsForJourneyAlphaInput(); // ReplaceStepsForJourneyAlphaInput | + try { + ReplaceStepsForJourney200Response result = apiInstance.replaceStepsForJourney(spaceId, containerId, replaceStepsForJourneyAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#replaceStepsForJourney"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **containerId** | **String**| | | +| **replaceStepsForJourneyAlphaInput** | [**ReplaceStepsForJourneyAlphaInput**](ReplaceStepsForJourneyAlphaInput.md)| | | + +### Return type + +[**ReplaceStepsForJourney200Response**](ReplaceStepsForJourney200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: updateDestinationsForJourney + +> UpdateDestinationsForJourney200Response updateDestinationsForJourney(spaceId, containerId, updateDestinationsForJourneyAlphaInput) + +Update Destinations for Journey + +Update DESTINATIONS for a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "spaceId"; // String | + String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput = new UpdateDestinationsForJourneyAlphaInput(); // UpdateDestinationsForJourneyAlphaInput | + try { + UpdateDestinationsForJourney200Response result = apiInstance.updateDestinationsForJourney(spaceId, containerId, updateDestinationsForJourneyAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#updateDestinationsForJourney"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **containerId** | **String**| | | +| **updateDestinationsForJourneyAlphaInput** | [**UpdateDestinationsForJourneyAlphaInput**](UpdateDestinationsForJourneyAlphaInput.md)| | | + +### Return type + +[**UpdateDestinationsForJourney200Response**](UpdateDestinationsForJourney200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: updateStatusForJourney + +> UpdateStatusForJourney200Response updateStatusForJourney(spaceId, containerId, updateStatusForJourneyAlphaInput) + +Update Status for Journey + +Update status of the journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.JourneysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + JourneysApi apiInstance = new JourneysApi(defaultClient); + String spaceId = "spaceId"; // String | + String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput = new UpdateStatusForJourneyAlphaInput(); // UpdateStatusForJourneyAlphaInput | + try { + UpdateStatusForJourney200Response result = apiInstance.updateStatusForJourney(spaceId, containerId, updateStatusForJourneyAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JourneysApi#updateStatusForJourney"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **containerId** | **String**| | | +| **updateStatusForJourneyAlphaInput** | [**UpdateStatusForJourneyAlphaInput**](UpdateStatusForJourneyAlphaInput.md)| | | + +### Return type + +[**UpdateStatusForJourney200Response**](UpdateStatusForJourney200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/pom.xml b/pom.xml index 79ce76a7..468fc649 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.3.0 + 57.4.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 6fbf3881..1cb4d823 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.3.0 (Java)"); + setUserAgent("Public API SDK 57.4.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 5048cb9a..31f10cfc 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.3.0"; + public static final String VERSION = "57.4.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 9d283993..dbfdc4bd 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -95,6 +95,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.APICallSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AccessPermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ActionDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Activation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AddConnectionFromSourceToWarehouse201Response .CustomTypeAdapterFactory()); @@ -163,17 +167,25 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Analytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceComputationDefinition .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceEntryState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceExitRule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.BaseState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpace200Response .CustomTypeAdapterFactory()); @@ -201,6 +213,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ComputedTraitsDefinition .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ConcurrencyConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ConditionBranch.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ConditionSplitState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -315,6 +333,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateInvitesV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateInvitesV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateJourney201Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateJourneyAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateJourneyAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateLabel201Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -438,6 +465,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DbtModelSyncTrigger.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DefaultBranch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); @@ -549,6 +578,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryOverviewSuccessfullyReceivedFilterBy .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Destination.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationFilterActionV1 .CustomTypeAdapterFactory()); @@ -577,6 +608,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationMetadataV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -603,8 +636,23 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EntryRules.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EventEntryState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EventExitRule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EventSplitWithTimeoutState + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ExitRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ExitRulesConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ExitState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -727,6 +775,16 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetInsertFunctionInstanceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetJourney200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetJourneyAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetJourneyAnalytics200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetJourneyAnalyticsAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response .CustomTypeAdapterFactory()); @@ -864,6 +922,20 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.InvitePermissionV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.InviteV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.JourneyAnalytics.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.JourneyDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.JourneyDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.JourneyInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.JourneyState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.JourneyVersionOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Key.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1178,12 +1250,19 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PropertySelectionsConfig + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RandomSplitBranch.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RandomSplitState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1206,6 +1285,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveJourneyFromSpace200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveJourneyFromSpaceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response .CustomTypeAdapterFactory()); @@ -1313,6 +1398,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceStepsForJourney200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceStepsForJourneyAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReplaceStepsForJourneyAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReplaceUsersInUserGroup200Response .CustomTypeAdapterFactory()); @@ -1368,6 +1462,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SimpleDelayState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); @@ -1392,6 +1488,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.StatesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.StepLevelAnalytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1404,6 +1504,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.SyncNoticeV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SyncV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TimeOutBranch.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TopLevelAnalytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TrackSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1416,6 +1520,14 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransitionState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Transitions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransitionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.TransitionsInner1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateAudienceForSpace200Response .CustomTypeAdapterFactory()); @@ -1443,6 +1555,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestinationsForJourney200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestinationsForJourneyAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestinationsForJourneyAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateDestinationsInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateFilterById200Response .CustomTypeAdapterFactory()); @@ -1547,6 +1671,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.UpdateSourceV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateSourceV1Output.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateStatusForJourney200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateStatusForJourneyAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateStatusForJourneyAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateSubscriptionForDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/JourneysApi.java b/src/main/java/com/segment/publicapi/api/JourneysApi.java new file mode 100644 index 00000000..8e5cb272 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/JourneysApi.java @@ -0,0 +1,1569 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateJourney201Response; +import com.segment.publicapi.models.CreateJourneyAlphaInput; +import com.segment.publicapi.models.GetJourney200Response; +import com.segment.publicapi.models.GetJourneyAnalytics200Response; +import com.segment.publicapi.models.RemoveJourneyFromSpace200Response; +import com.segment.publicapi.models.ReplaceStepsForJourney200Response; +import com.segment.publicapi.models.ReplaceStepsForJourneyAlphaInput; +import com.segment.publicapi.models.UpdateDestinationsForJourney200Response; +import com.segment.publicapi.models.UpdateDestinationsForJourneyAlphaInput; +import com.segment.publicapi.models.UpdateStatusForJourney200Response; +import com.segment.publicapi.models.UpdateStatusForJourneyAlphaInput; +import java.lang.reflect.Type; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class JourneysApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public JourneysApi() { + this(Configuration.getDefaultApiClient()); + } + + public JourneysApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createJourney + * + * @param spaceId (required) + * @param createJourneyAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createJourneyCall( + String spaceId, + CreateJourneyAlphaInput createJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createJourneyAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createJourneyValidateBeforeCall( + String spaceId, + CreateJourneyAlphaInput createJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling createJourney(Async)"); + } + + // verify the required parameter 'createJourneyAlphaInput' is set + if (createJourneyAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createJourneyAlphaInput' when calling" + + " createJourney(Async)"); + } + + return createJourneyCall(spaceId, createJourneyAlphaInput, _callback); + } + + /** + * Create Journey Creates Journey. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param spaceId (required) + * @param createJourneyAlphaInput (required) + * @return CreateJourney201Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateJourney201Response createJourney( + String spaceId, CreateJourneyAlphaInput createJourneyAlphaInput) throws ApiException { + ApiResponse localVarResp = + createJourneyWithHttpInfo(spaceId, createJourneyAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Journey Creates Journey. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param spaceId (required) + * @param createJourneyAlphaInput (required) + * @return ApiResponse<CreateJourney201Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createJourneyWithHttpInfo( + String spaceId, CreateJourneyAlphaInput createJourneyAlphaInput) throws ApiException { + okhttp3.Call localVarCall = + createJourneyValidateBeforeCall(spaceId, createJourneyAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Journey (asynchronously) Creates Journey. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param createJourneyAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createJourneyAsync( + String spaceId, + CreateJourneyAlphaInput createJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createJourneyValidateBeforeCall(spaceId, createJourneyAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getJourney + * + * @param spaceId (required) + * @param containerId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getJourneyCall( + String spaceId, String containerId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys/{containerId}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "containerId" + "}", + localVarApiClient.escapeString(containerId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJourneyValidateBeforeCall( + String spaceId, String containerId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling getJourney(Async)"); + } + + // verify the required parameter 'containerId' is set + if (containerId == null) { + throw new ApiException( + "Missing the required parameter 'containerId' when calling getJourney(Async)"); + } + + return getJourneyCall(spaceId, containerId, _callback); + } + + /** + * Get Journey Returns the journey by containerId • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @return GetJourney200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetJourney200Response getJourney(String spaceId, String containerId) + throws ApiException { + ApiResponse localVarResp = + getJourneyWithHttpInfo(spaceId, containerId); + return localVarResp.getData(); + } + + /** + * Get Journey Returns the journey by containerId • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @return ApiResponse<GetJourney200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getJourneyWithHttpInfo( + String spaceId, String containerId) throws ApiException { + okhttp3.Call localVarCall = getJourneyValidateBeforeCall(spaceId, containerId, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Journey (asynchronously) Returns the journey by containerId • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Journeys feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param containerId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getJourneyAsync( + String spaceId, String containerId, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getJourneyValidateBeforeCall(spaceId, containerId, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getJourneyAnalytics + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @param fromDate This parameter exists in alpha. (required) + * @param toDate This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getJourneyAnalyticsCall( + String spaceId, + String containerId, + BigDecimal version, + String fromDate, + String toDate, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys/{containerId}/analytics" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "containerId" + "}", + localVarApiClient.escapeString(containerId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (version != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version)); + } + + if (fromDate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromDate", fromDate)); + } + + if (toDate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("toDate", toDate)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJourneyAnalyticsValidateBeforeCall( + String spaceId, + String containerId, + BigDecimal version, + String fromDate, + String toDate, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getJourneyAnalytics(Async)"); + } + + // verify the required parameter 'containerId' is set + if (containerId == null) { + throw new ApiException( + "Missing the required parameter 'containerId' when calling" + + " getJourneyAnalytics(Async)"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + "Missing the required parameter 'version' when calling" + + " getJourneyAnalytics(Async)"); + } + + // verify the required parameter 'fromDate' is set + if (fromDate == null) { + throw new ApiException( + "Missing the required parameter 'fromDate' when calling" + + " getJourneyAnalytics(Async)"); + } + + return getJourneyAnalyticsCall(spaceId, containerId, version, fromDate, toDate, _callback); + } + + /** + * Get Journey Analytics Get Analytics for a journey • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @param fromDate This parameter exists in alpha. (required) + * @param toDate This parameter exists in alpha. (optional) + * @return GetJourneyAnalytics200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetJourneyAnalytics200Response getJourneyAnalytics( + String spaceId, String containerId, BigDecimal version, String fromDate, String toDate) + throws ApiException { + ApiResponse localVarResp = + getJourneyAnalyticsWithHttpInfo(spaceId, containerId, version, fromDate, toDate); + return localVarResp.getData(); + } + + /** + * Get Journey Analytics Get Analytics for a journey • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @param fromDate This parameter exists in alpha. (required) + * @param toDate This parameter exists in alpha. (optional) + * @return ApiResponse<GetJourneyAnalytics200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getJourneyAnalyticsWithHttpInfo( + String spaceId, String containerId, BigDecimal version, String fromDate, String toDate) + throws ApiException { + okhttp3.Call localVarCall = + getJourneyAnalyticsValidateBeforeCall( + spaceId, containerId, version, fromDate, toDate, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Journey Analytics (asynchronously) Get Analytics for a journey • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Journeys feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @param fromDate This parameter exists in alpha. (required) + * @param toDate This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getJourneyAnalyticsAsync( + String spaceId, + String containerId, + BigDecimal version, + String fromDate, + String toDate, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getJourneyAnalyticsValidateBeforeCall( + spaceId, containerId, version, fromDate, toDate, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for removeJourneyFromSpace + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeJourneyFromSpaceCall( + String spaceId, String containerId, BigDecimal version, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys/{containerId}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "containerId" + "}", + localVarApiClient.escapeString(containerId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (version != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeJourneyFromSpaceValidateBeforeCall( + String spaceId, String containerId, BigDecimal version, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeJourneyFromSpace(Async)"); + } + + // verify the required parameter 'containerId' is set + if (containerId == null) { + throw new ApiException( + "Missing the required parameter 'containerId' when calling" + + " removeJourneyFromSpace(Async)"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + "Missing the required parameter 'version' when calling" + + " removeJourneyFromSpace(Async)"); + } + + return removeJourneyFromSpaceCall(spaceId, containerId, version, _callback); + } + + /** + * Remove Journey from Space Delete a journey • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Journeys feature enabled. + * Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @return RemoveJourneyFromSpace200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveJourneyFromSpace200Response removeJourneyFromSpace( + String spaceId, String containerId, BigDecimal version) throws ApiException { + ApiResponse localVarResp = + removeJourneyFromSpaceWithHttpInfo(spaceId, containerId, version); + return localVarResp.getData(); + } + + /** + * Remove Journey from Space Delete a journey • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Journeys feature enabled. + * Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @return ApiResponse<RemoveJourneyFromSpace200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse removeJourneyFromSpaceWithHttpInfo( + String spaceId, String containerId, BigDecimal version) throws ApiException { + okhttp3.Call localVarCall = + removeJourneyFromSpaceValidateBeforeCall(spaceId, containerId, version, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Journey from Space (asynchronously) Delete a journey • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param version The journey version. This parameter exists in alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeJourneyFromSpaceAsync( + String spaceId, + String containerId, + BigDecimal version, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeJourneyFromSpaceValidateBeforeCall(spaceId, containerId, version, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for replaceStepsForJourney + * + * @param spaceId (required) + * @param containerId (required) + * @param replaceStepsForJourneyAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call replaceStepsForJourneyCall( + String spaceId, + String containerId, + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = replaceStepsForJourneyAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys/{containerId}/steps" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "containerId" + "}", + localVarApiClient.escapeString(containerId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call replaceStepsForJourneyValidateBeforeCall( + String spaceId, + String containerId, + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " replaceStepsForJourney(Async)"); + } + + // verify the required parameter 'containerId' is set + if (containerId == null) { + throw new ApiException( + "Missing the required parameter 'containerId' when calling" + + " replaceStepsForJourney(Async)"); + } + + // verify the required parameter 'replaceStepsForJourneyAlphaInput' is set + if (replaceStepsForJourneyAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'replaceStepsForJourneyAlphaInput' when calling" + + " replaceStepsForJourney(Async)"); + } + + return replaceStepsForJourneyCall( + spaceId, containerId, replaceStepsForJourneyAlphaInput, _callback); + } + + /** + * Replace Steps for Journey Replace steps for a journey • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param replaceStepsForJourneyAlphaInput (required) + * @return ReplaceStepsForJourney200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ReplaceStepsForJourney200Response replaceStepsForJourney( + String spaceId, + String containerId, + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput) + throws ApiException { + ApiResponse localVarResp = + replaceStepsForJourneyWithHttpInfo( + spaceId, containerId, replaceStepsForJourneyAlphaInput); + return localVarResp.getData(); + } + + /** + * Replace Steps for Journey Replace steps for a journey • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param replaceStepsForJourneyAlphaInput (required) + * @return ApiResponse<ReplaceStepsForJourney200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse replaceStepsForJourneyWithHttpInfo( + String spaceId, + String containerId, + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + replaceStepsForJourneyValidateBeforeCall( + spaceId, containerId, replaceStepsForJourneyAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Replace Steps for Journey (asynchronously) Replace steps for a journey • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Journeys feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param containerId (required) + * @param replaceStepsForJourneyAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call replaceStepsForJourneyAsync( + String spaceId, + String containerId, + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + replaceStepsForJourneyValidateBeforeCall( + spaceId, containerId, replaceStepsForJourneyAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateDestinationsForJourney + * + * @param spaceId (required) + * @param containerId (required) + * @param updateDestinationsForJourneyAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateDestinationsForJourneyCall( + String spaceId, + String containerId, + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateDestinationsForJourneyAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys/{containerId}/destinations" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "containerId" + "}", + localVarApiClient.escapeString(containerId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateDestinationsForJourneyValidateBeforeCall( + String spaceId, + String containerId, + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateDestinationsForJourney(Async)"); + } + + // verify the required parameter 'containerId' is set + if (containerId == null) { + throw new ApiException( + "Missing the required parameter 'containerId' when calling" + + " updateDestinationsForJourney(Async)"); + } + + // verify the required parameter 'updateDestinationsForJourneyAlphaInput' is set + if (updateDestinationsForJourneyAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateDestinationsForJourneyAlphaInput' when" + + " calling updateDestinationsForJourney(Async)"); + } + + return updateDestinationsForJourneyCall( + spaceId, containerId, updateDestinationsForJourneyAlphaInput, _callback); + } + + /** + * Update Destinations for Journey Update DESTINATIONS for a journey • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Journeys feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param containerId (required) + * @param updateDestinationsForJourneyAlphaInput (required) + * @return UpdateDestinationsForJourney200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateDestinationsForJourney200Response updateDestinationsForJourney( + String spaceId, + String containerId, + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateDestinationsForJourneyWithHttpInfo( + spaceId, containerId, updateDestinationsForJourneyAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Destinations for Journey Update DESTINATIONS for a journey • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Journeys feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param containerId (required) + * @param updateDestinationsForJourneyAlphaInput (required) + * @return ApiResponse<UpdateDestinationsForJourney200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateDestinationsForJourneyWithHttpInfo( + String spaceId, + String containerId, + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateDestinationsForJourneyValidateBeforeCall( + spaceId, containerId, updateDestinationsForJourneyAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Destinations for Journey (asynchronously) Update DESTINATIONS for a journey • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Journeys feature enabled. Please reach out to your customer success manager + * for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param updateDestinationsForJourneyAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateDestinationsForJourneyAsync( + String spaceId, + String containerId, + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateDestinationsForJourneyValidateBeforeCall( + spaceId, containerId, updateDestinationsForJourneyAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateStatusForJourney + * + * @param spaceId (required) + * @param containerId (required) + * @param updateStatusForJourneyAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateStatusForJourneyCall( + String spaceId, + String containerId, + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateStatusForJourneyAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/journeys/{containerId}/status" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "containerId" + "}", + localVarApiClient.escapeString(containerId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateStatusForJourneyValidateBeforeCall( + String spaceId, + String containerId, + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateStatusForJourney(Async)"); + } + + // verify the required parameter 'containerId' is set + if (containerId == null) { + throw new ApiException( + "Missing the required parameter 'containerId' when calling" + + " updateStatusForJourney(Async)"); + } + + // verify the required parameter 'updateStatusForJourneyAlphaInput' is set + if (updateStatusForJourneyAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateStatusForJourneyAlphaInput' when calling" + + " updateStatusForJourney(Async)"); + } + + return updateStatusForJourneyCall( + spaceId, containerId, updateStatusForJourneyAlphaInput, _callback); + } + + /** + * Update Status for Journey Update status of the journey • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param updateStatusForJourneyAlphaInput (required) + * @return UpdateStatusForJourney200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateStatusForJourney200Response updateStatusForJourney( + String spaceId, + String containerId, + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateStatusForJourneyWithHttpInfo( + spaceId, containerId, updateStatusForJourneyAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Status for Journey Update status of the journey • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Journeys feature + * enabled. Please reach out to your customer success manager for more information. + * + * @param spaceId (required) + * @param containerId (required) + * @param updateStatusForJourneyAlphaInput (required) + * @return ApiResponse<UpdateStatusForJourney200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse updateStatusForJourneyWithHttpInfo( + String spaceId, + String containerId, + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateStatusForJourneyValidateBeforeCall( + spaceId, containerId, updateStatusForJourneyAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Status for Journey (asynchronously) Update status of the journey • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Journeys feature enabled. Please reach out to your customer success manager for more + * information. + * + * @param spaceId (required) + * @param containerId (required) + * @param updateStatusForJourneyAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateStatusForJourneyAsync( + String spaceId, + String containerId, + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateStatusForJourneyValidateBeforeCall( + spaceId, containerId, updateStatusForJourneyAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/ActionDefinition.java b/src/main/java/com/segment/publicapi/models/ActionDefinition.java new file mode 100644 index 00000000..6e5de629 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ActionDefinition.java @@ -0,0 +1,375 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ActionDefinition */ +public class ActionDefinition { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_USE_DEFAULT_MAPPINGS = "useDefaultMappings"; + + @SerializedName(SERIALIZED_NAME_USE_DEFAULT_MAPPINGS) + private Boolean useDefaultMappings; + + public static final String SERIALIZED_NAME_MAPPINGS = "mappings"; + + @SerializedName(SERIALIZED_NAME_MAPPINGS) + private Map mappings = new HashMap<>(); + + public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; + + @SerializedName(SERIALIZED_NAME_ACTION_ID) + private String actionId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public ActionDefinition() {} + + public ActionDefinition id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ActionDefinition useDefaultMappings(Boolean useDefaultMappings) { + + this.useDefaultMappings = useDefaultMappings; + return this; + } + + /** + * Get useDefaultMappings + * + * @return useDefaultMappings + */ + @javax.annotation.Nullable + public Boolean getUseDefaultMappings() { + return useDefaultMappings; + } + + public void setUseDefaultMappings(Boolean useDefaultMappings) { + this.useDefaultMappings = useDefaultMappings; + } + + public ActionDefinition mappings(Map mappings) { + + this.mappings = mappings; + return this; + } + + public ActionDefinition putMappingsItem(String key, Object mappingsItem) { + if (this.mappings == null) { + this.mappings = new HashMap<>(); + } + this.mappings.put(key, mappingsItem); + return this; + } + + /** + * Get mappings + * + * @return mappings + */ + @javax.annotation.Nonnull + public Map getMappings() { + return mappings; + } + + public void setMappings(Map mappings) { + this.mappings = mappings; + } + + public ActionDefinition actionId(String actionId) { + + this.actionId = actionId; + return this; + } + + /** + * Get actionId + * + * @return actionId + */ + @javax.annotation.Nonnull + public String getActionId() { + return actionId; + } + + public void setActionId(String actionId) { + this.actionId = actionId; + } + + public ActionDefinition enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ActionDefinition name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActionDefinition actionDefinition = (ActionDefinition) o; + return Objects.equals(this.id, actionDefinition.id) + && Objects.equals(this.useDefaultMappings, actionDefinition.useDefaultMappings) + && Objects.equals(this.mappings, actionDefinition.mappings) + && Objects.equals(this.actionId, actionDefinition.actionId) + && Objects.equals(this.enabled, actionDefinition.enabled) + && Objects.equals(this.name, actionDefinition.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, useDefaultMappings, mappings, actionId, enabled, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActionDefinition {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" useDefaultMappings: ") + .append(toIndentedString(useDefaultMappings)) + .append("\n"); + sb.append(" mappings: ").append(toIndentedString(mappings)).append("\n"); + sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("useDefaultMappings"); + openapiFields.add("mappings"); + openapiFields.add("actionId"); + openapiFields.add("enabled"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("mappings"); + openapiRequiredFields.add("actionId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ActionDefinition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ActionDefinition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ActionDefinition is not found in the" + + " empty JSON string", + ActionDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ActionDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ActionDefinition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ActionDefinition.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("actionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `actionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("actionId").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ActionDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ActionDefinition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ActionDefinition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ActionDefinition value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ActionDefinition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ActionDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActionDefinition + * @throws IOException if the JSON string is invalid with respect to ActionDefinition + */ + public static ActionDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ActionDefinition.class); + } + + /** + * Convert an instance of ActionDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Activation.java b/src/main/java/com/segment/publicapi/models/Activation.java new file mode 100644 index 00000000..f4d78b5a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Activation.java @@ -0,0 +1,308 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Activation */ +public class Activation { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; + + @SerializedName(SERIALIZED_NAME_EVENT_NAME) + private String eventName; + + public static final String SERIALIZED_NAME_ACTION_DEFINITION = "actionDefinition"; + + @SerializedName(SERIALIZED_NAME_ACTION_DEFINITION) + private ActionDefinition actionDefinition; + + public static final String SERIALIZED_NAME_PROPERTY_SELECTIONS = "propertySelections"; + + @SerializedName(SERIALIZED_NAME_PROPERTY_SELECTIONS) + private PropertySelectionsConfig propertySelections; + + public Activation() {} + + public Activation id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Activation eventName(String eventName) { + + this.eventName = eventName; + return this; + } + + /** + * Get eventName + * + * @return eventName + */ + @javax.annotation.Nonnull + public String getEventName() { + return eventName; + } + + public void setEventName(String eventName) { + this.eventName = eventName; + } + + public Activation actionDefinition(ActionDefinition actionDefinition) { + + this.actionDefinition = actionDefinition; + return this; + } + + /** + * Get actionDefinition + * + * @return actionDefinition + */ + @javax.annotation.Nonnull + public ActionDefinition getActionDefinition() { + return actionDefinition; + } + + public void setActionDefinition(ActionDefinition actionDefinition) { + this.actionDefinition = actionDefinition; + } + + public Activation propertySelections(PropertySelectionsConfig propertySelections) { + + this.propertySelections = propertySelections; + return this; + } + + /** + * Get propertySelections + * + * @return propertySelections + */ + @javax.annotation.Nullable + public PropertySelectionsConfig getPropertySelections() { + return propertySelections; + } + + public void setPropertySelections(PropertySelectionsConfig propertySelections) { + this.propertySelections = propertySelections; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Activation activation = (Activation) o; + return Objects.equals(this.id, activation.id) + && Objects.equals(this.eventName, activation.eventName) + && Objects.equals(this.actionDefinition, activation.actionDefinition) + && Objects.equals(this.propertySelections, activation.propertySelections); + } + + @Override + public int hashCode() { + return Objects.hash(id, eventName, actionDefinition, propertySelections); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Activation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" actionDefinition: ").append(toIndentedString(actionDefinition)).append("\n"); + sb.append(" propertySelections: ") + .append(toIndentedString(propertySelections)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("eventName"); + openapiFields.add("actionDefinition"); + openapiFields.add("propertySelections"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("eventName"); + openapiRequiredFields.add("actionDefinition"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Activation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Activation.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Activation is not found in the empty" + + " JSON string", + Activation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Activation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Activation` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Activation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("eventName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `eventName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("eventName").toString())); + } + // validate the required field `actionDefinition` + ActionDefinition.validateJsonElement(jsonObj.get("actionDefinition")); + // validate the optional field `propertySelections` + if (jsonObj.get("propertySelections") != null + && !jsonObj.get("propertySelections").isJsonNull()) { + PropertySelectionsConfig.validateJsonElement(jsonObj.get("propertySelections")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Activation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Activation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Activation.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Activation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Activation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Activation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Activation + * @throws IOException if the JSON string is invalid with respect to Activation + */ + public static Activation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Activation.class); + } + + /** + * Convert an instance of Activation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Analytics.java b/src/main/java/com/segment/publicapi/models/Analytics.java new file mode 100644 index 00000000..18e03d71 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Analytics.java @@ -0,0 +1,229 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Analytics */ +public class Analytics { + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + private BigDecimal total; + + public static final String SERIALIZED_NAME_UNIQUE = "unique"; + + @SerializedName(SERIALIZED_NAME_UNIQUE) + private BigDecimal unique; + + public Analytics() {} + + public Analytics total(BigDecimal total) { + + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @javax.annotation.Nonnull + public BigDecimal getTotal() { + return total; + } + + public void setTotal(BigDecimal total) { + this.total = total; + } + + public Analytics unique(BigDecimal unique) { + + this.unique = unique; + return this; + } + + /** + * Get unique + * + * @return unique + */ + @javax.annotation.Nonnull + public BigDecimal getUnique() { + return unique; + } + + public void setUnique(BigDecimal unique) { + this.unique = unique; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Analytics analytics = (Analytics) o; + return Objects.equals(this.total, analytics.total) + && Objects.equals(this.unique, analytics.unique); + } + + @Override + public int hashCode() { + return Objects.hash(total, unique); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Analytics {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" unique: ").append(toIndentedString(unique)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("total"); + openapiFields.add("unique"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("total"); + openapiRequiredFields.add("unique"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Analytics + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Analytics.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Analytics is not found in the empty" + + " JSON string", + Analytics.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Analytics.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Analytics` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Analytics.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Analytics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Analytics' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Analytics.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Analytics value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Analytics read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Analytics given an JSON string + * + * @param jsonString JSON string + * @return An instance of Analytics + * @throws IOException if the JSON string is invalid with respect to Analytics + */ + public static Analytics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Analytics.class); + } + + /** + * Convert an instance of Analytics to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceEntryState.java b/src/main/java/com/segment/publicapi/models/AudienceEntryState.java new file mode 100644 index 00000000..ccf90e47 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceEntryState.java @@ -0,0 +1,374 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceEntryState */ +public class AudienceEntryState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + AUDIENCE_ENTRY("AUDIENCE_ENTRY"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) + private String audienceId; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public AudienceEntryState() {} + + public AudienceEntryState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public AudienceEntryState audienceId(String audienceId) { + + this.audienceId = audienceId; + return this; + } + + /** + * Get audienceId + * + * @return audienceId + */ + @javax.annotation.Nonnull + public String getAudienceId() { + return audienceId; + } + + public void setAudienceId(String audienceId) { + this.audienceId = audienceId; + } + + public AudienceEntryState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public AudienceEntryState addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public AudienceEntryState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceEntryState audienceEntryState = (AudienceEntryState) o; + return Objects.equals(this.type, audienceEntryState.type) + && Objects.equals(this.audienceId, audienceEntryState.audienceId) + && Objects.equals(this.transitions, audienceEntryState.transitions) + && Objects.equals(this.key, audienceEntryState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, audienceId, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceEntryState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("audienceId"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("audienceId"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceEntryState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceEntryState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceEntryState is not found in the" + + " empty JSON string", + AudienceEntryState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceEntryState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceEntryState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceEntryState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("audienceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceEntryState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceEntryState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceEntryState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceEntryState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceEntryState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceEntryState given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceEntryState + * @throws IOException if the JSON string is invalid with respect to AudienceEntryState + */ + public static AudienceEntryState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceEntryState.class); + } + + /** + * Convert an instance of AudienceEntryState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceExitRule.java b/src/main/java/com/segment/publicapi/models/AudienceExitRule.java new file mode 100644 index 00000000..20b346b9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceExitRule.java @@ -0,0 +1,518 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceExitRule */ +public class AudienceExitRule { + /** Gets or Sets exitType */ + @JsonAdapter(ExitTypeEnum.Adapter.class) + public enum ExitTypeEnum { + AUDIENCE_MEMBERSHIP_CHANGE("AUDIENCE_MEMBERSHIP_CHANGE"); + + private String value; + + ExitTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExitTypeEnum fromValue(String value) { + for (ExitTypeEnum b : ExitTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExitTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExitTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_EXIT_TYPE = "exitType"; + + @SerializedName(SERIALIZED_NAME_EXIT_TYPE) + private ExitTypeEnum exitType; + + public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) + private String audienceId; + + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EXIT_RULE("EXIT_RULE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CONCURRENCY_ENABLED = "concurrencyEnabled"; + + @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) + private Boolean concurrencyEnabled; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public AudienceExitRule() {} + + public AudienceExitRule exitType(ExitTypeEnum exitType) { + + this.exitType = exitType; + return this; + } + + /** + * Get exitType + * + * @return exitType + */ + @javax.annotation.Nonnull + public ExitTypeEnum getExitType() { + return exitType; + } + + public void setExitType(ExitTypeEnum exitType) { + this.exitType = exitType; + } + + public AudienceExitRule audienceId(String audienceId) { + + this.audienceId = audienceId; + return this; + } + + /** + * Get audienceId + * + * @return audienceId + */ + @javax.annotation.Nonnull + public String getAudienceId() { + return audienceId; + } + + public void setAudienceId(String audienceId) { + this.audienceId = audienceId; + } + + public AudienceExitRule type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public AudienceExitRule enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceExitRule concurrencyEnabled(Boolean concurrencyEnabled) { + + this.concurrencyEnabled = concurrencyEnabled; + return this; + } + + /** + * Get concurrencyEnabled + * + * @return concurrencyEnabled + */ + @javax.annotation.Nonnull + public Boolean getConcurrencyEnabled() { + return concurrencyEnabled; + } + + public void setConcurrencyEnabled(Boolean concurrencyEnabled) { + this.concurrencyEnabled = concurrencyEnabled; + } + + public AudienceExitRule transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public AudienceExitRule addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nullable + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public AudienceExitRule key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceExitRule audienceExitRule = (AudienceExitRule) o; + return Objects.equals(this.exitType, audienceExitRule.exitType) + && Objects.equals(this.audienceId, audienceExitRule.audienceId) + && Objects.equals(this.type, audienceExitRule.type) + && Objects.equals(this.enabled, audienceExitRule.enabled) + && Objects.equals(this.concurrencyEnabled, audienceExitRule.concurrencyEnabled) + && Objects.equals(this.transitions, audienceExitRule.transitions) + && Objects.equals(this.key, audienceExitRule.key); + } + + @Override + public int hashCode() { + return Objects.hash( + exitType, audienceId, type, enabled, concurrencyEnabled, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceExitRule {\n"); + sb.append(" exitType: ").append(toIndentedString(exitType)).append("\n"); + sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" concurrencyEnabled: ") + .append(toIndentedString(concurrencyEnabled)) + .append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("exitType"); + openapiFields.add("audienceId"); + openapiFields.add("type"); + openapiFields.add("enabled"); + openapiFields.add("concurrencyEnabled"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("exitType"); + openapiRequiredFields.add("audienceId"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("concurrencyEnabled"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceExitRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceExitRule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceExitRule is not found in the" + + " empty JSON string", + AudienceExitRule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceExitRule.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceExitRule` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceExitRule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("exitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("exitType").toString())); + } + if (!jsonObj.get("audienceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceId").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (jsonObj.get("transitions") != null && !jsonObj.get("transitions").isJsonNull()) { + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + if (jsonArraytransitions != null) { + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("transitions").toString())); + } + + // validate the optional field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + } + } + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceExitRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceExitRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceExitRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceExitRule value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceExitRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceExitRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceExitRule + * @throws IOException if the JSON string is invalid with respect to AudienceExitRule + */ + public static AudienceExitRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceExitRule.class); + } + + /** + * Convert an instance of AudienceExitRule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/BaseState.java b/src/main/java/com/segment/publicapi/models/BaseState.java new file mode 100644 index 00000000..3d5d4e3b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/BaseState.java @@ -0,0 +1,341 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class BaseState extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(BaseState.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BaseState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BaseState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterTransitionState = + gson.getDelegateAdapter(this, TypeToken.get(TransitionState.class)); + final TypeAdapter adapterExitState = + gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); + final TypeAdapter adapterExitRule = + gson.getDelegateAdapter(this, TypeToken.get(ExitRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BaseState value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `TransitionState` + if (value.getActualInstance() instanceof TransitionState) { + JsonElement element = + adapterTransitionState.toJsonTree( + (TransitionState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ExitState` + if (value.getActualInstance() instanceof ExitState) { + JsonElement element = + adapterExitState.toJsonTree( + (ExitState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ExitRule` + if (value.getActualInstance() instanceof ExitRule) { + JsonElement element = + adapterExitRule.toJsonTree( + (ExitRule) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " ExitRule, ExitState, TransitionState"); + } + + @Override + public BaseState read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize TransitionState + try { + // validate the JSON object to see if any exception is thrown + TransitionState.validateJsonElement(jsonElement); + actualAdapter = adapterTransitionState; + match++; + log.log(Level.FINER, "Input data matches schema 'TransitionState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TransitionState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TransitionState'", + e); + } + // deserialize ExitState + try { + // validate the JSON object to see if any exception is thrown + ExitState.validateJsonElement(jsonElement); + actualAdapter = adapterExitState; + match++; + log.log(Level.FINER, "Input data matches schema 'ExitState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExitState failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExitState'", + e); + } + // deserialize ExitRule + try { + // validate the JSON object to see if any exception is thrown + ExitRule.validateJsonElement(jsonElement); + actualAdapter = adapterExitRule; + match++; + log.log(Level.FINER, "Input data matches schema 'ExitRule'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExitRule failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExitRule'", + e); + } + + if (match == 1) { + BaseState ret = new BaseState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for BaseState: %d classes match" + + " result, expected 1. Detailed failure message" + + " for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public BaseState() { + super("oneOf", Boolean.FALSE); + } + + public BaseState(ExitRule o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BaseState(ExitState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BaseState(TransitionState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("TransitionState", TransitionState.class); + schemas.put("ExitState", ExitState.class); + schemas.put("ExitRule", ExitRule.class); + } + + @Override + public Map> getSchemas() { + return BaseState.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ExitRule, ExitState, TransitionState + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof TransitionState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExitState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExitRule) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ExitRule, ExitState, TransitionState"); + } + + /** + * Get the actual instance, which can be the following: ExitRule, ExitState, TransitionState + * + * @return The actual instance (ExitRule, ExitState, TransitionState) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `TransitionState`. If the actual instance is not + * `TransitionState`, the ClassCastException will be thrown. + * + * @return The actual instance of `TransitionState` + * @throws ClassCastException if the instance is not `TransitionState` + */ + public TransitionState getTransitionState() throws ClassCastException { + return (TransitionState) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExitState`. If the actual instance is not `ExitState`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ExitState` + * @throws ClassCastException if the instance is not `ExitState` + */ + public ExitState getExitState() throws ClassCastException { + return (ExitState) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExitRule`. If the actual instance is not `ExitRule`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ExitRule` + * @throws ClassCastException if the instance is not `ExitRule` + */ + public ExitRule getExitRule() throws ClassCastException { + return (ExitRule) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BaseState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with TransitionState + try { + TransitionState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TransitionState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ExitState + try { + ExitState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExitState failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ExitRule + try { + ExitRule.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExitRule failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for BaseState with oneOf schemas: ExitRule," + + " ExitState, TransitionState. %d class(es) match the result," + + " expected 1. Detailed failure message for oneOf schemas: %s." + + " JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of BaseState given an JSON string + * + * @param jsonString JSON string + * @return An instance of BaseState + * @throws IOException if the JSON string is invalid with respect to BaseState + */ + public static BaseState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BaseState.class); + } + + /** + * Convert an instance of BaseState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java b/src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java new file mode 100644 index 00000000..66082926 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java @@ -0,0 +1,236 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ConcurrencyConfig */ +public class ConcurrencyConfig { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CONCURRENCY_KEY = "concurrencyKey"; + + @SerializedName(SERIALIZED_NAME_CONCURRENCY_KEY) + private String concurrencyKey; + + public ConcurrencyConfig() {} + + public ConcurrencyConfig enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ConcurrencyConfig concurrencyKey(String concurrencyKey) { + + this.concurrencyKey = concurrencyKey; + return this; + } + + /** + * Get concurrencyKey + * + * @return concurrencyKey + */ + @javax.annotation.Nullable + public String getConcurrencyKey() { + return concurrencyKey; + } + + public void setConcurrencyKey(String concurrencyKey) { + this.concurrencyKey = concurrencyKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConcurrencyConfig concurrencyConfig = (ConcurrencyConfig) o; + return Objects.equals(this.enabled, concurrencyConfig.enabled) + && Objects.equals(this.concurrencyKey, concurrencyConfig.concurrencyKey); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, concurrencyKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConcurrencyConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" concurrencyKey: ").append(toIndentedString(concurrencyKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + openapiFields.add("concurrencyKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConcurrencyConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConcurrencyConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConcurrencyConfig is not found in the" + + " empty JSON string", + ConcurrencyConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConcurrencyConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConcurrencyConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConcurrencyConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("concurrencyKey") != null && !jsonObj.get("concurrencyKey").isJsonNull()) + && !jsonObj.get("concurrencyKey").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `concurrencyKey` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("concurrencyKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConcurrencyConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConcurrencyConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ConcurrencyConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConcurrencyConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConcurrencyConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConcurrencyConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConcurrencyConfig + * @throws IOException if the JSON string is invalid with respect to ConcurrencyConfig + */ + public static ConcurrencyConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConcurrencyConfig.class); + } + + /** + * Convert an instance of ConcurrencyConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ConditionBranch.java b/src/main/java/com/segment/publicapi/models/ConditionBranch.java new file mode 100644 index 00000000..291e834c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ConditionBranch.java @@ -0,0 +1,324 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ConditionBranch */ +public class ConditionBranch { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CONDITION("CONDITION"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_CONDITION = "condition"; + + @SerializedName(SERIALIZED_NAME_CONDITION) + private String condition; + + public static final String SERIALIZED_NAME_NEXT = "next"; + + @SerializedName(SERIALIZED_NAME_NEXT) + private String next; + + public ConditionBranch() {} + + public ConditionBranch type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public ConditionBranch condition(String condition) { + + this.condition = condition; + return this; + } + + /** + * Get condition + * + * @return condition + */ + @javax.annotation.Nonnull + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public ConditionBranch next(String next) { + + this.next = next; + return this; + } + + /** + * Get next + * + * @return next + */ + @javax.annotation.Nonnull + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionBranch conditionBranch = (ConditionBranch) o; + return Objects.equals(this.type, conditionBranch.type) + && Objects.equals(this.condition, conditionBranch.condition) + && Objects.equals(this.next, conditionBranch.next); + } + + @Override + public int hashCode() { + return Objects.hash(type, condition, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionBranch {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("condition"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("condition"); + openapiRequiredFields.add("next"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConditionBranch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionBranch.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConditionBranch is not found in the" + + " empty JSON string", + ConditionBranch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionBranch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionBranch` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConditionBranch.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("condition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `condition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("condition").toString())); + } + if (!jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `next` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionBranch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionBranch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ConditionBranch.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionBranch value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionBranch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionBranch given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionBranch + * @throws IOException if the JSON string is invalid with respect to ConditionBranch + */ + public static ConditionBranch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionBranch.class); + } + + /** + * Convert an instance of ConditionBranch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ConditionSplitState.java b/src/main/java/com/segment/publicapi/models/ConditionSplitState.java new file mode 100644 index 00000000..5403ff83 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ConditionSplitState.java @@ -0,0 +1,338 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ConditionSplitState */ +public class ConditionSplitState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CONDITION_SPLIT("CONDITION_SPLIT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public ConditionSplitState() {} + + public ConditionSplitState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public ConditionSplitState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public ConditionSplitState addTransitionsItem(TransitionsInner1 transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public ConditionSplitState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionSplitState conditionSplitState = (ConditionSplitState) o; + return Objects.equals(this.type, conditionSplitState.type) + && Objects.equals(this.transitions, conditionSplitState.transitions) + && Objects.equals(this.key, conditionSplitState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionSplitState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConditionSplitState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConditionSplitState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ConditionSplitState is not found in" + + " the empty JSON string", + ConditionSplitState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConditionSplitState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ConditionSplitState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConditionSplitState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + TransitionsInner1.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConditionSplitState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConditionSplitState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ConditionSplitState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ConditionSplitState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConditionSplitState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ConditionSplitState given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionSplitState + * @throws IOException if the JSON string is invalid with respect to ConditionSplitState + */ + public static ConditionSplitState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConditionSplitState.class); + } + + /** + * Convert an instance of ConditionSplitState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateJourney201Response.java b/src/main/java/com/segment/publicapi/models/CreateJourney201Response.java new file mode 100644 index 00000000..9ba97722 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateJourney201Response.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateJourney201Response */ +public class CreateJourney201Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateJourneyAlphaOutput data; + + public CreateJourney201Response() {} + + public CreateJourney201Response data(CreateJourneyAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateJourneyAlphaOutput getData() { + return data; + } + + public void setData(CreateJourneyAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJourney201Response createJourney201Response = (CreateJourney201Response) o; + return Objects.equals(this.data, createJourney201Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJourney201Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateJourney201Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateJourney201Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateJourney201Response is not found" + + " in the empty JSON string", + CreateJourney201Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateJourney201Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateJourney201Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateJourney201Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJourney201Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateJourney201Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateJourney201Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateJourney201Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJourney201Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJourney201Response + * @throws IOException if the JSON string is invalid with respect to CreateJourney201Response + */ + public static CreateJourney201Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJourney201Response.class); + } + + /** + * Convert an instance of CreateJourney201Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java new file mode 100644 index 00000000..3dbe5166 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java @@ -0,0 +1,275 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The journey Create input. */ +public class CreateJourneyAlphaInput { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private JourneyDefinition definition; + + public CreateJourneyAlphaInput() {} + + public CreateJourneyAlphaInput name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the journey. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateJourneyAlphaInput description(String description) { + + this.description = description; + return this; + } + + /** + * The description of the journey. + * + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateJourneyAlphaInput definition(JourneyDefinition definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public JourneyDefinition getDefinition() { + return definition; + } + + public void setDefinition(JourneyDefinition definition) { + this.definition = definition; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJourneyAlphaInput createJourneyAlphaInput = (CreateJourneyAlphaInput) o; + return Objects.equals(this.name, createJourneyAlphaInput.name) + && Objects.equals(this.description, createJourneyAlphaInput.description) + && Objects.equals(this.definition, createJourneyAlphaInput.definition); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, definition); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJourneyAlphaInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("definition"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("definition"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateJourneyAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateJourneyAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateJourneyAlphaInput is not found" + + " in the empty JSON string", + CreateJourneyAlphaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateJourneyAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateJourneyAlphaInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateJourneyAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + // validate the required field `definition` + JourneyDefinition.validateJsonElement(jsonObj.get("definition")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJourneyAlphaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateJourneyAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateJourneyAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateJourneyAlphaInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJourneyAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJourneyAlphaInput + * @throws IOException if the JSON string is invalid with respect to CreateJourneyAlphaInput + */ + public static CreateJourneyAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJourneyAlphaInput.class); + } + + /** + * Convert an instance of CreateJourneyAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java new file mode 100644 index 00000000..71aba1dd --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The journey Create output. */ +public class CreateJourneyAlphaOutput { + public static final String SERIALIZED_NAME_JOURNEY = "journey"; + + @SerializedName(SERIALIZED_NAME_JOURNEY) + private JourneyDetails journey; + + public CreateJourneyAlphaOutput() {} + + public CreateJourneyAlphaOutput journey(JourneyDetails journey) { + + this.journey = journey; + return this; + } + + /** + * Get journey + * + * @return journey + */ + @javax.annotation.Nonnull + public JourneyDetails getJourney() { + return journey; + } + + public void setJourney(JourneyDetails journey) { + this.journey = journey; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJourneyAlphaOutput createJourneyAlphaOutput = (CreateJourneyAlphaOutput) o; + return Objects.equals(this.journey, createJourneyAlphaOutput.journey); + } + + @Override + public int hashCode() { + return Objects.hash(journey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJourneyAlphaOutput {\n"); + sb.append(" journey: ").append(toIndentedString(journey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("journey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("journey"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateJourneyAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateJourneyAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateJourneyAlphaOutput is not found" + + " in the empty JSON string", + CreateJourneyAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateJourneyAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateJourneyAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `journey` + JourneyDetails.validateJsonElement(jsonObj.get("journey")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJourneyAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateJourneyAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateJourneyAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateJourneyAlphaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJourneyAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJourneyAlphaOutput + * @throws IOException if the JSON string is invalid with respect to CreateJourneyAlphaOutput + */ + public static CreateJourneyAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJourneyAlphaOutput.class); + } + + /** + * Convert an instance of CreateJourneyAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DefaultBranch.java b/src/main/java/com/segment/publicapi/models/DefaultBranch.java new file mode 100644 index 00000000..724b74d7 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DefaultBranch.java @@ -0,0 +1,287 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** DefaultBranch */ +public class DefaultBranch { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + DEFAULT("DEFAULT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_NEXT = "next"; + + @SerializedName(SERIALIZED_NAME_NEXT) + private String next; + + public DefaultBranch() {} + + public DefaultBranch type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public DefaultBranch next(String next) { + + this.next = next; + return this; + } + + /** + * Get next + * + * @return next + */ + @javax.annotation.Nonnull + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultBranch defaultBranch = (DefaultBranch) o; + return Objects.equals(this.type, defaultBranch.type) + && Objects.equals(this.next, defaultBranch.next); + } + + @Override + public int hashCode() { + return Objects.hash(type, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultBranch {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("next"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DefaultBranch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DefaultBranch.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DefaultBranch is not found in the" + + " empty JSON string", + DefaultBranch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DefaultBranch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DefaultBranch` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DefaultBranch.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `next` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DefaultBranch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DefaultBranch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DefaultBranch.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DefaultBranch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DefaultBranch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DefaultBranch given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultBranch + * @throws IOException if the JSON string is invalid with respect to DefaultBranch + */ + public static DefaultBranch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DefaultBranch.class); + } + + /** + * Convert an instance of DefaultBranch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java new file mode 100644 index 00000000..738e9876 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Destination.java @@ -0,0 +1,261 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Destination */ +public class Destination { + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; + + public static final String SERIALIZED_NAME_ACTIVATIONS = "activations"; + + @SerializedName(SERIALIZED_NAME_ACTIVATIONS) + private List activations = new ArrayList<>(); + + public Destination() {} + + public Destination destinationId(String destinationId) { + + this.destinationId = destinationId; + return this; + } + + /** + * Get destinationId + * + * @return destinationId + */ + @javax.annotation.Nonnull + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + + public Destination activations(List activations) { + + this.activations = activations; + return this; + } + + public Destination addActivationsItem(Activation activationsItem) { + if (this.activations == null) { + this.activations = new ArrayList<>(); + } + this.activations.add(activationsItem); + return this; + } + + /** + * Get activations + * + * @return activations + */ + @javax.annotation.Nonnull + public List getActivations() { + return activations; + } + + public void setActivations(List activations) { + this.activations = activations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Destination destination = (Destination) o; + return Objects.equals(this.destinationId, destination.destinationId) + && Objects.equals(this.activations, destination.activations); + } + + @Override + public int hashCode() { + return Objects.hash(destinationId, activations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Destination {\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" activations: ").append(toIndentedString(activations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("destinationId"); + openapiFields.add("activations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("activations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Destination + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Destination.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Destination is not found in the empty" + + " JSON string", + Destination.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Destination.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Destination` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Destination.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("activations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activations` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("activations").toString())); + } + + JsonArray jsonArrayactivations = jsonObj.getAsJsonArray("activations"); + // validate the required field `activations` (array) + for (int i = 0; i < jsonArrayactivations.size(); i++) { + Activation.validateJsonElement(jsonArrayactivations.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Destination.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Destination' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Destination.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Destination value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Destination read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Destination given an JSON string + * + * @param jsonString JSON string + * @return An instance of Destination + * @throws IOException if the JSON string is invalid with respect to Destination + */ + public static Destination fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Destination.class); + } + + /** + * Convert an instance of Destination to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationState.java b/src/main/java/com/segment/publicapi/models/DestinationState.java new file mode 100644 index 00000000..89d15123 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DestinationState.java @@ -0,0 +1,390 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** DestinationState */ +public class DestinationState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + DESTINATION("DESTINATION"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; + + @SerializedName(SERIALIZED_NAME_DESTINATIONS) + private List destinations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public DestinationState() {} + + public DestinationState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public DestinationState destinations(List destinations) { + + this.destinations = destinations; + return this; + } + + public DestinationState addDestinationsItem(Destination destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * Get destinations + * + * @return destinations + */ + @javax.annotation.Nonnull + public List getDestinations() { + return destinations; + } + + public void setDestinations(List destinations) { + this.destinations = destinations; + } + + public DestinationState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public DestinationState addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public DestinationState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationState destinationState = (DestinationState) o; + return Objects.equals(this.type, destinationState.type) + && Objects.equals(this.destinations, destinationState.destinations) + && Objects.equals(this.transitions, destinationState.transitions) + && Objects.equals(this.key, destinationState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, destinations, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("destinations"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("destinations"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DestinationState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationState is not found in the" + + " empty JSON string", + DestinationState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DestinationState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("destinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("destinations").toString())); + } + + JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); + // validate the required field `destinations` (array) + for (int i = 0; i < jsonArraydestinations.size(); i++) { + Destination.validateJsonElement(jsonArraydestinations.get(i)); + } + ; + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationState given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationState + * @throws IOException if the JSON string is invalid with respect to DestinationState + */ + public static DestinationState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationState.class); + } + + /** + * Convert an instance of DestinationState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EntryRules.java b/src/main/java/com/segment/publicapi/models/EntryRules.java new file mode 100644 index 00000000..576786eb --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/EntryRules.java @@ -0,0 +1,287 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** EntryRules */ +public class EntryRules { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + MULTIPLE("MULTIPLE"), + + ONCE("ONCE"), + + RE_ENTRY_AFTER_EXIT("RE_ENTRY_AFTER_EXIT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_CONCURRENCY = "concurrency"; + + @SerializedName(SERIALIZED_NAME_CONCURRENCY) + private ConcurrencyConfig concurrency; + + public EntryRules() {} + + public EntryRules type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public EntryRules concurrency(ConcurrencyConfig concurrency) { + + this.concurrency = concurrency; + return this; + } + + /** + * Get concurrency + * + * @return concurrency + */ + @javax.annotation.Nullable + public ConcurrencyConfig getConcurrency() { + return concurrency; + } + + public void setConcurrency(ConcurrencyConfig concurrency) { + this.concurrency = concurrency; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntryRules entryRules = (EntryRules) o; + return Objects.equals(this.type, entryRules.type) + && Objects.equals(this.concurrency, entryRules.concurrency); + } + + @Override + public int hashCode() { + return Objects.hash(type, concurrency); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntryRules {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" concurrency: ").append(toIndentedString(concurrency)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("concurrency"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntryRules + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EntryRules.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EntryRules is not found in the empty" + + " JSON string", + EntryRules.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EntryRules.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EntryRules` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntryRules.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // validate the optional field `concurrency` + if (jsonObj.get("concurrency") != null && !jsonObj.get("concurrency").isJsonNull()) { + ConcurrencyConfig.validateJsonElement(jsonObj.get("concurrency")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EntryRules.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntryRules' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EntryRules.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EntryRules value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EntryRules read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EntryRules given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntryRules + * @throws IOException if the JSON string is invalid with respect to EntryRules + */ + public static EntryRules fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntryRules.class); + } + + /** + * Convert an instance of EntryRules to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EventEntryState.java b/src/main/java/com/segment/publicapi/models/EventEntryState.java new file mode 100644 index 00000000..f9516152 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/EventEntryState.java @@ -0,0 +1,390 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** EventEntryState */ +public class EventEntryState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EVENT_ENTRY("EVENT_ENTRY"), + + AUDIENCE_ENTRY("AUDIENCE_ENTRY"), + + DESTINATION("DESTINATION"), + + SIMPLE_DELAY("SIMPLE_DELAY"), + + EVENT_SPLIT("EVENT_SPLIT"), + + CONDITION_SPLIT("CONDITION_SPLIT"), + + RANDOM_SPLIT("RANDOM_SPLIT"), + + EXIT("EXIT"), + + EXIT_RULE("EXIT_RULE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_CONDITION = "condition"; + + @SerializedName(SERIALIZED_NAME_CONDITION) + private String condition; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public EventEntryState() {} + + public EventEntryState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public EventEntryState condition(String condition) { + + this.condition = condition; + return this; + } + + /** + * Get condition + * + * @return condition + */ + @javax.annotation.Nonnull + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public EventEntryState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public EventEntryState addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public EventEntryState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventEntryState eventEntryState = (EventEntryState) o; + return Objects.equals(this.type, eventEntryState.type) + && Objects.equals(this.condition, eventEntryState.condition) + && Objects.equals(this.transitions, eventEntryState.transitions) + && Objects.equals(this.key, eventEntryState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, condition, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventEntryState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("condition"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("condition"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventEntryState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventEntryState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EventEntryState is not found in the" + + " empty JSON string", + EventEntryState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EventEntryState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EventEntryState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventEntryState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("condition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `condition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("condition").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventEntryState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventEntryState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EventEntryState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EventEntryState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventEntryState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EventEntryState given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventEntryState + * @throws IOException if the JSON string is invalid with respect to EventEntryState + */ + public static EventEntryState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventEntryState.class); + } + + /** + * Convert an instance of EventEntryState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EventExitRule.java b/src/main/java/com/segment/publicapi/models/EventExitRule.java new file mode 100644 index 00000000..ef7a8261 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/EventExitRule.java @@ -0,0 +1,517 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** EventExitRule */ +public class EventExitRule { + /** Gets or Sets exitType */ + @JsonAdapter(ExitTypeEnum.Adapter.class) + public enum ExitTypeEnum { + EVENT_PERFORMED("EVENT_PERFORMED"); + + private String value; + + ExitTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExitTypeEnum fromValue(String value) { + for (ExitTypeEnum b : ExitTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExitTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExitTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_EXIT_TYPE = "exitType"; + + @SerializedName(SERIALIZED_NAME_EXIT_TYPE) + private ExitTypeEnum exitType; + + public static final String SERIALIZED_NAME_CONDITION = "condition"; + + @SerializedName(SERIALIZED_NAME_CONDITION) + private String condition; + + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EXIT_RULE("EXIT_RULE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CONCURRENCY_ENABLED = "concurrencyEnabled"; + + @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) + private Boolean concurrencyEnabled; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public EventExitRule() {} + + public EventExitRule exitType(ExitTypeEnum exitType) { + + this.exitType = exitType; + return this; + } + + /** + * Get exitType + * + * @return exitType + */ + @javax.annotation.Nonnull + public ExitTypeEnum getExitType() { + return exitType; + } + + public void setExitType(ExitTypeEnum exitType) { + this.exitType = exitType; + } + + public EventExitRule condition(String condition) { + + this.condition = condition; + return this; + } + + /** + * Get condition + * + * @return condition + */ + @javax.annotation.Nonnull + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + + public EventExitRule type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public EventExitRule enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public EventExitRule concurrencyEnabled(Boolean concurrencyEnabled) { + + this.concurrencyEnabled = concurrencyEnabled; + return this; + } + + /** + * Get concurrencyEnabled + * + * @return concurrencyEnabled + */ + @javax.annotation.Nonnull + public Boolean getConcurrencyEnabled() { + return concurrencyEnabled; + } + + public void setConcurrencyEnabled(Boolean concurrencyEnabled) { + this.concurrencyEnabled = concurrencyEnabled; + } + + public EventExitRule transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public EventExitRule addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nullable + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public EventExitRule key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventExitRule eventExitRule = (EventExitRule) o; + return Objects.equals(this.exitType, eventExitRule.exitType) + && Objects.equals(this.condition, eventExitRule.condition) + && Objects.equals(this.type, eventExitRule.type) + && Objects.equals(this.enabled, eventExitRule.enabled) + && Objects.equals(this.concurrencyEnabled, eventExitRule.concurrencyEnabled) + && Objects.equals(this.transitions, eventExitRule.transitions) + && Objects.equals(this.key, eventExitRule.key); + } + + @Override + public int hashCode() { + return Objects.hash( + exitType, condition, type, enabled, concurrencyEnabled, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventExitRule {\n"); + sb.append(" exitType: ").append(toIndentedString(exitType)).append("\n"); + sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" concurrencyEnabled: ") + .append(toIndentedString(concurrencyEnabled)) + .append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("exitType"); + openapiFields.add("condition"); + openapiFields.add("type"); + openapiFields.add("enabled"); + openapiFields.add("concurrencyEnabled"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("exitType"); + openapiRequiredFields.add("condition"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("concurrencyEnabled"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventExitRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventExitRule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EventExitRule is not found in the" + + " empty JSON string", + EventExitRule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EventExitRule.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EventExitRule` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventExitRule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("exitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("exitType").toString())); + } + if (!jsonObj.get("condition").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `condition` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("condition").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (jsonObj.get("transitions") != null && !jsonObj.get("transitions").isJsonNull()) { + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + if (jsonArraytransitions != null) { + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("transitions").toString())); + } + + // validate the optional field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + } + } + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventExitRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventExitRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EventExitRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EventExitRule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventExitRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EventExitRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventExitRule + * @throws IOException if the JSON string is invalid with respect to EventExitRule + */ + public static EventExitRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventExitRule.class); + } + + /** + * Convert an instance of EventExitRule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java b/src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java new file mode 100644 index 00000000..669c80b6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java @@ -0,0 +1,339 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** EventSplitWithTimeoutState */ +public class EventSplitWithTimeoutState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EVENT_SPLIT("EVENT_SPLIT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public EventSplitWithTimeoutState() {} + + public EventSplitWithTimeoutState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public EventSplitWithTimeoutState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public EventSplitWithTimeoutState addTransitionsItem(TransitionsInner transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public EventSplitWithTimeoutState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSplitWithTimeoutState eventSplitWithTimeoutState = (EventSplitWithTimeoutState) o; + return Objects.equals(this.type, eventSplitWithTimeoutState.type) + && Objects.equals(this.transitions, eventSplitWithTimeoutState.transitions) + && Objects.equals(this.key, eventSplitWithTimeoutState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSplitWithTimeoutState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventSplitWithTimeoutState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventSplitWithTimeoutState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EventSplitWithTimeoutState is not" + + " found in the empty JSON string", + EventSplitWithTimeoutState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EventSplitWithTimeoutState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EventSplitWithTimeoutState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventSplitWithTimeoutState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + TransitionsInner.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventSplitWithTimeoutState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventSplitWithTimeoutState' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EventSplitWithTimeoutState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EventSplitWithTimeoutState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventSplitWithTimeoutState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EventSplitWithTimeoutState given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventSplitWithTimeoutState + * @throws IOException if the JSON string is invalid with respect to EventSplitWithTimeoutState + */ + public static EventSplitWithTimeoutState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventSplitWithTimeoutState.class); + } + + /** + * Convert an instance of EventSplitWithTimeoutState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ExitRule.java b/src/main/java/com/segment/publicapi/models/ExitRule.java new file mode 100644 index 00000000..d76a472a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ExitRule.java @@ -0,0 +1,484 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ExitRule */ +public class ExitRule { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EXIT_RULE("EXIT_RULE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + /** Gets or Sets exitType */ + @JsonAdapter(ExitTypeEnum.Adapter.class) + public enum ExitTypeEnum { + AUDIENCE_MEMBERSHIP_CHANGE("AUDIENCE_MEMBERSHIP_CHANGE"), + + CONDITION_UNMATCH("CONDITION_UNMATCH"), + + EVENT_PERFORMED("EVENT_PERFORMED"); + + private String value; + + ExitTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExitTypeEnum fromValue(String value) { + for (ExitTypeEnum b : ExitTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExitTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExitTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_EXIT_TYPE = "exitType"; + + @SerializedName(SERIALIZED_NAME_EXIT_TYPE) + private ExitTypeEnum exitType; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_CONCURRENCY_ENABLED = "concurrencyEnabled"; + + @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) + private Boolean concurrencyEnabled; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public ExitRule() {} + + public ExitRule type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public ExitRule exitType(ExitTypeEnum exitType) { + + this.exitType = exitType; + return this; + } + + /** + * Get exitType + * + * @return exitType + */ + @javax.annotation.Nonnull + public ExitTypeEnum getExitType() { + return exitType; + } + + public void setExitType(ExitTypeEnum exitType) { + this.exitType = exitType; + } + + public ExitRule enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ExitRule concurrencyEnabled(Boolean concurrencyEnabled) { + + this.concurrencyEnabled = concurrencyEnabled; + return this; + } + + /** + * Get concurrencyEnabled + * + * @return concurrencyEnabled + */ + @javax.annotation.Nonnull + public Boolean getConcurrencyEnabled() { + return concurrencyEnabled; + } + + public void setConcurrencyEnabled(Boolean concurrencyEnabled) { + this.concurrencyEnabled = concurrencyEnabled; + } + + public ExitRule transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public ExitRule addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nullable + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public ExitRule key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExitRule exitRule = (ExitRule) o; + return Objects.equals(this.type, exitRule.type) + && Objects.equals(this.exitType, exitRule.exitType) + && Objects.equals(this.enabled, exitRule.enabled) + && Objects.equals(this.concurrencyEnabled, exitRule.concurrencyEnabled) + && Objects.equals(this.transitions, exitRule.transitions) + && Objects.equals(this.key, exitRule.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, exitType, enabled, concurrencyEnabled, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExitRule {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" exitType: ").append(toIndentedString(exitType)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" concurrencyEnabled: ") + .append(toIndentedString(concurrencyEnabled)) + .append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("exitType"); + openapiFields.add("enabled"); + openapiFields.add("concurrencyEnabled"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("exitType"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("concurrencyEnabled"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExitRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExitRule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExitRule is not found in the empty" + + " JSON string", + ExitRule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExitRule.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `ExitRule`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ExitRule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("exitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("exitType").toString())); + } + if (jsonObj.get("transitions") != null && !jsonObj.get("transitions").isJsonNull()) { + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + if (jsonArraytransitions != null) { + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("transitions").toString())); + } + + // validate the optional field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + } + } + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExitRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExitRule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExitRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExitRule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExitRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExitRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExitRule + * @throws IOException if the JSON string is invalid with respect to ExitRule + */ + public static ExitRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExitRule.class); + } + + /** + * Convert an instance of ExitRule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java b/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java new file mode 100644 index 00000000..25acdd61 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java @@ -0,0 +1,255 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The exit rules configuration. */ +public class ExitRulesConfig { + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_STATES = "states"; + + @SerializedName(SERIALIZED_NAME_STATES) + private List states = new ArrayList<>(); + + public ExitRulesConfig() {} + + public ExitRulesConfig enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ExitRulesConfig states(List states) { + + this.states = states; + return this; + } + + public ExitRulesConfig addStatesItem(StatesInner statesItem) { + if (this.states == null) { + this.states = new ArrayList<>(); + } + this.states.add(statesItem); + return this; + } + + /** + * Get states + * + * @return states + */ + @javax.annotation.Nonnull + public List getStates() { + return states; + } + + public void setStates(List states) { + this.states = states; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExitRulesConfig exitRulesConfig = (ExitRulesConfig) o; + return Objects.equals(this.enabled, exitRulesConfig.enabled) + && Objects.equals(this.states, exitRulesConfig.states); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, states); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExitRulesConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" states: ").append(toIndentedString(states)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enabled"); + openapiFields.add("states"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("states"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExitRulesConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExitRulesConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExitRulesConfig is not found in the" + + " empty JSON string", + ExitRulesConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExitRulesConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExitRulesConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ExitRulesConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("states").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `states` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("states").toString())); + } + + JsonArray jsonArraystates = jsonObj.getAsJsonArray("states"); + // validate the required field `states` (array) + for (int i = 0; i < jsonArraystates.size(); i++) { + StatesInner.validateJsonElement(jsonArraystates.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExitRulesConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExitRulesConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExitRulesConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExitRulesConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExitRulesConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExitRulesConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExitRulesConfig + * @throws IOException if the JSON string is invalid with respect to ExitRulesConfig + */ + public static ExitRulesConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExitRulesConfig.class); + } + + /** + * Convert an instance of ExitRulesConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ExitState.java b/src/main/java/com/segment/publicapi/models/ExitState.java new file mode 100644 index 00000000..84d16de6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ExitState.java @@ -0,0 +1,281 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ExitState */ +public class ExitState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EXIT("EXIT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public ExitState() {} + + public ExitState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public ExitState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExitState exitState = (ExitState) o; + return Objects.equals(this.type, exitState.type) && Objects.equals(this.key, exitState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExitState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExitState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExitState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExitState is not found in the empty" + + " JSON string", + ExitState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExitState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExitState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ExitState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExitState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExitState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExitState value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExitState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExitState given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExitState + * @throws IOException if the JSON string is invalid with respect to ExitState + */ + public static ExitState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExitState.class); + } + + /** + * Convert an instance of ExitState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetJourney200Response.java b/src/main/java/com/segment/publicapi/models/GetJourney200Response.java new file mode 100644 index 00000000..b04d58c2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetJourney200Response.java @@ -0,0 +1,193 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetJourney200Response */ +public class GetJourney200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetJourneyAlphaOutput data; + + public GetJourney200Response() {} + + public GetJourney200Response data(GetJourneyAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetJourneyAlphaOutput getData() { + return data; + } + + public void setData(GetJourneyAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJourney200Response getJourney200Response = (GetJourney200Response) o; + return Objects.equals(this.data, getJourney200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetJourney200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetJourney200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetJourney200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetJourney200Response is not found in" + + " the empty JSON string", + GetJourney200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetJourney200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetJourney200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetJourney200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetJourney200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetJourney200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetJourney200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetJourney200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetJourney200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetJourney200Response + * @throws IOException if the JSON string is invalid with respect to GetJourney200Response + */ + public static GetJourney200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetJourney200Response.class); + } + + /** + * Convert an instance of GetJourney200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java new file mode 100644 index 00000000..d90e78f3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetJourneyAlphaOutput */ +public class GetJourneyAlphaOutput { + public static final String SERIALIZED_NAME_JOURNEY = "journey"; + + @SerializedName(SERIALIZED_NAME_JOURNEY) + private JourneyInfo journey; + + public GetJourneyAlphaOutput() {} + + public GetJourneyAlphaOutput journey(JourneyInfo journey) { + + this.journey = journey; + return this; + } + + /** + * Get journey + * + * @return journey + */ + @javax.annotation.Nonnull + public JourneyInfo getJourney() { + return journey; + } + + public void setJourney(JourneyInfo journey) { + this.journey = journey; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJourneyAlphaOutput getJourneyAlphaOutput = (GetJourneyAlphaOutput) o; + return Objects.equals(this.journey, getJourneyAlphaOutput.journey); + } + + @Override + public int hashCode() { + return Objects.hash(journey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetJourneyAlphaOutput {\n"); + sb.append(" journey: ").append(toIndentedString(journey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("journey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("journey"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetJourneyAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetJourneyAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetJourneyAlphaOutput is not found in" + + " the empty JSON string", + GetJourneyAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetJourneyAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetJourneyAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `journey` + JourneyInfo.validateJsonElement(jsonObj.get("journey")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetJourneyAlphaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetJourneyAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetJourneyAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetJourneyAlphaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetJourneyAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetJourneyAlphaOutput + * @throws IOException if the JSON string is invalid with respect to GetJourneyAlphaOutput + */ + public static GetJourneyAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetJourneyAlphaOutput.class); + } + + /** + * Convert an instance of GetJourneyAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java b/src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java new file mode 100644 index 00000000..1c753e31 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetJourneyAnalytics200Response */ +public class GetJourneyAnalytics200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetJourneyAnalyticsAlphaOutput data; + + public GetJourneyAnalytics200Response() {} + + public GetJourneyAnalytics200Response data(GetJourneyAnalyticsAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetJourneyAnalyticsAlphaOutput getData() { + return data; + } + + public void setData(GetJourneyAnalyticsAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJourneyAnalytics200Response getJourneyAnalytics200Response = + (GetJourneyAnalytics200Response) o; + return Objects.equals(this.data, getJourneyAnalytics200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetJourneyAnalytics200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetJourneyAnalytics200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetJourneyAnalytics200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetJourneyAnalytics200Response is not" + + " found in the empty JSON string", + GetJourneyAnalytics200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetJourneyAnalytics200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetJourneyAnalytics200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetJourneyAnalyticsAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetJourneyAnalytics200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetJourneyAnalytics200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetJourneyAnalytics200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetJourneyAnalytics200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetJourneyAnalytics200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetJourneyAnalytics200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetJourneyAnalytics200Response + * @throws IOException if the JSON string is invalid with respect to + * GetJourneyAnalytics200Response + */ + public static GetJourneyAnalytics200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetJourneyAnalytics200Response.class); + } + + /** + * Convert an instance of GetJourneyAnalytics200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java new file mode 100644 index 00000000..bfc0a92d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Get journey analytics input. */ +public class GetJourneyAnalyticsAlphaOutput { + public static final String SERIALIZED_NAME_JOURNEY_ANALYTICS = "journeyAnalytics"; + + @SerializedName(SERIALIZED_NAME_JOURNEY_ANALYTICS) + private JourneyAnalytics journeyAnalytics; + + public GetJourneyAnalyticsAlphaOutput() {} + + public GetJourneyAnalyticsAlphaOutput journeyAnalytics(JourneyAnalytics journeyAnalytics) { + + this.journeyAnalytics = journeyAnalytics; + return this; + } + + /** + * Get journeyAnalytics + * + * @return journeyAnalytics + */ + @javax.annotation.Nonnull + public JourneyAnalytics getJourneyAnalytics() { + return journeyAnalytics; + } + + public void setJourneyAnalytics(JourneyAnalytics journeyAnalytics) { + this.journeyAnalytics = journeyAnalytics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJourneyAnalyticsAlphaOutput getJourneyAnalyticsAlphaOutput = + (GetJourneyAnalyticsAlphaOutput) o; + return Objects.equals( + this.journeyAnalytics, getJourneyAnalyticsAlphaOutput.journeyAnalytics); + } + + @Override + public int hashCode() { + return Objects.hash(journeyAnalytics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetJourneyAnalyticsAlphaOutput {\n"); + sb.append(" journeyAnalytics: ").append(toIndentedString(journeyAnalytics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("journeyAnalytics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("journeyAnalytics"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetJourneyAnalyticsAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetJourneyAnalyticsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetJourneyAnalyticsAlphaOutput is not" + + " found in the empty JSON string", + GetJourneyAnalyticsAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetJourneyAnalyticsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetJourneyAnalyticsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetJourneyAnalyticsAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `journeyAnalytics` + JourneyAnalytics.validateJsonElement(jsonObj.get("journeyAnalytics")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetJourneyAnalyticsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetJourneyAnalyticsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetJourneyAnalyticsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetJourneyAnalyticsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetJourneyAnalyticsAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetJourneyAnalyticsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetJourneyAnalyticsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetJourneyAnalyticsAlphaOutput + */ + public static GetJourneyAnalyticsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetJourneyAnalyticsAlphaOutput.class); + } + + /** + * Convert an instance of GetJourneyAnalyticsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/JourneyAnalytics.java b/src/main/java/com/segment/publicapi/models/JourneyAnalytics.java new file mode 100644 index 00000000..e880fad4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/JourneyAnalytics.java @@ -0,0 +1,261 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** JourneyAnalytics */ +public class JourneyAnalytics { + public static final String SERIALIZED_NAME_TOP_LEVEL_ANALYTICS = "topLevelAnalytics"; + + @SerializedName(SERIALIZED_NAME_TOP_LEVEL_ANALYTICS) + private TopLevelAnalytics topLevelAnalytics; + + public static final String SERIALIZED_NAME_STEP_LEVEL_ANALYTICS = "stepLevelAnalytics"; + + @SerializedName(SERIALIZED_NAME_STEP_LEVEL_ANALYTICS) + private List stepLevelAnalytics = new ArrayList<>(); + + public JourneyAnalytics() {} + + public JourneyAnalytics topLevelAnalytics(TopLevelAnalytics topLevelAnalytics) { + + this.topLevelAnalytics = topLevelAnalytics; + return this; + } + + /** + * Get topLevelAnalytics + * + * @return topLevelAnalytics + */ + @javax.annotation.Nonnull + public TopLevelAnalytics getTopLevelAnalytics() { + return topLevelAnalytics; + } + + public void setTopLevelAnalytics(TopLevelAnalytics topLevelAnalytics) { + this.topLevelAnalytics = topLevelAnalytics; + } + + public JourneyAnalytics stepLevelAnalytics(List stepLevelAnalytics) { + + this.stepLevelAnalytics = stepLevelAnalytics; + return this; + } + + public JourneyAnalytics addStepLevelAnalyticsItem(StepLevelAnalytics stepLevelAnalyticsItem) { + if (this.stepLevelAnalytics == null) { + this.stepLevelAnalytics = new ArrayList<>(); + } + this.stepLevelAnalytics.add(stepLevelAnalyticsItem); + return this; + } + + /** + * Get stepLevelAnalytics + * + * @return stepLevelAnalytics + */ + @javax.annotation.Nonnull + public List getStepLevelAnalytics() { + return stepLevelAnalytics; + } + + public void setStepLevelAnalytics(List stepLevelAnalytics) { + this.stepLevelAnalytics = stepLevelAnalytics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyAnalytics journeyAnalytics = (JourneyAnalytics) o; + return Objects.equals(this.topLevelAnalytics, journeyAnalytics.topLevelAnalytics) + && Objects.equals(this.stepLevelAnalytics, journeyAnalytics.stepLevelAnalytics); + } + + @Override + public int hashCode() { + return Objects.hash(topLevelAnalytics, stepLevelAnalytics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyAnalytics {\n"); + sb.append(" topLevelAnalytics: ") + .append(toIndentedString(topLevelAnalytics)) + .append("\n"); + sb.append(" stepLevelAnalytics: ") + .append(toIndentedString(stepLevelAnalytics)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("topLevelAnalytics"); + openapiFields.add("stepLevelAnalytics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("topLevelAnalytics"); + openapiRequiredFields.add("stepLevelAnalytics"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JourneyAnalytics + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JourneyAnalytics.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in JourneyAnalytics is not found in the" + + " empty JSON string", + JourneyAnalytics.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JourneyAnalytics.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `JourneyAnalytics` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JourneyAnalytics.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `topLevelAnalytics` + TopLevelAnalytics.validateJsonElement(jsonObj.get("topLevelAnalytics")); + // ensure the json data is an array + if (!jsonObj.get("stepLevelAnalytics").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stepLevelAnalytics` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("stepLevelAnalytics").toString())); + } + + JsonArray jsonArraystepLevelAnalytics = jsonObj.getAsJsonArray("stepLevelAnalytics"); + // validate the required field `stepLevelAnalytics` (array) + for (int i = 0; i < jsonArraystepLevelAnalytics.size(); i++) { + StepLevelAnalytics.validateJsonElement(jsonArraystepLevelAnalytics.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyAnalytics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyAnalytics' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(JourneyAnalytics.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyAnalytics value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyAnalytics read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyAnalytics given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyAnalytics + * @throws IOException if the JSON string is invalid with respect to JourneyAnalytics + */ + public static JourneyAnalytics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyAnalytics.class); + } + + /** + * Convert an instance of JourneyAnalytics to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/JourneyDefinition.java b/src/main/java/com/segment/publicapi/models/JourneyDefinition.java new file mode 100644 index 00000000..2938e601 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/JourneyDefinition.java @@ -0,0 +1,324 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The journey definition. */ +public class JourneyDefinition { + public static final String SERIALIZED_NAME_INITIAL_STATE = "initialState"; + + @SerializedName(SERIALIZED_NAME_INITIAL_STATE) + private String initialState; + + public static final String SERIALIZED_NAME_ENTRY_RULES = "entryRules"; + + @SerializedName(SERIALIZED_NAME_ENTRY_RULES) + private EntryRules entryRules; + + public static final String SERIALIZED_NAME_EXIT_RULES = "exitRules"; + + @SerializedName(SERIALIZED_NAME_EXIT_RULES) + private ExitRulesConfig exitRules; + + public static final String SERIALIZED_NAME_STATES = "states"; + + @SerializedName(SERIALIZED_NAME_STATES) + private List states = new ArrayList<>(); + + public JourneyDefinition() {} + + public JourneyDefinition initialState(String initialState) { + + this.initialState = initialState; + return this; + } + + /** + * The initial state of the journey. + * + * @return initialState + */ + @javax.annotation.Nonnull + public String getInitialState() { + return initialState; + } + + public void setInitialState(String initialState) { + this.initialState = initialState; + } + + public JourneyDefinition entryRules(EntryRules entryRules) { + + this.entryRules = entryRules; + return this; + } + + /** + * Get entryRules + * + * @return entryRules + */ + @javax.annotation.Nonnull + public EntryRules getEntryRules() { + return entryRules; + } + + public void setEntryRules(EntryRules entryRules) { + this.entryRules = entryRules; + } + + public JourneyDefinition exitRules(ExitRulesConfig exitRules) { + + this.exitRules = exitRules; + return this; + } + + /** + * Get exitRules + * + * @return exitRules + */ + @javax.annotation.Nonnull + public ExitRulesConfig getExitRules() { + return exitRules; + } + + public void setExitRules(ExitRulesConfig exitRules) { + this.exitRules = exitRules; + } + + public JourneyDefinition states(List states) { + + this.states = states; + return this; + } + + public JourneyDefinition addStatesItem(JourneyState statesItem) { + if (this.states == null) { + this.states = new ArrayList<>(); + } + this.states.add(statesItem); + return this; + } + + /** + * The states of the journey. + * + * @return states + */ + @javax.annotation.Nonnull + public List getStates() { + return states; + } + + public void setStates(List states) { + this.states = states; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyDefinition journeyDefinition = (JourneyDefinition) o; + return Objects.equals(this.initialState, journeyDefinition.initialState) + && Objects.equals(this.entryRules, journeyDefinition.entryRules) + && Objects.equals(this.exitRules, journeyDefinition.exitRules) + && Objects.equals(this.states, journeyDefinition.states); + } + + @Override + public int hashCode() { + return Objects.hash(initialState, entryRules, exitRules, states); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyDefinition {\n"); + sb.append(" initialState: ").append(toIndentedString(initialState)).append("\n"); + sb.append(" entryRules: ").append(toIndentedString(entryRules)).append("\n"); + sb.append(" exitRules: ").append(toIndentedString(exitRules)).append("\n"); + sb.append(" states: ").append(toIndentedString(states)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("initialState"); + openapiFields.add("entryRules"); + openapiFields.add("exitRules"); + openapiFields.add("states"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("initialState"); + openapiRequiredFields.add("entryRules"); + openapiRequiredFields.add("exitRules"); + openapiRequiredFields.add("states"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JourneyDefinition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JourneyDefinition.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in JourneyDefinition is not found in the" + + " empty JSON string", + JourneyDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JourneyDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `JourneyDefinition` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JourneyDefinition.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("initialState").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `initialState` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("initialState").toString())); + } + // validate the required field `entryRules` + EntryRules.validateJsonElement(jsonObj.get("entryRules")); + // validate the required field `exitRules` + ExitRulesConfig.validateJsonElement(jsonObj.get("exitRules")); + // ensure the json data is an array + if (!jsonObj.get("states").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `states` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("states").toString())); + } + + JsonArray jsonArraystates = jsonObj.getAsJsonArray("states"); + // validate the required field `states` (array) + for (int i = 0; i < jsonArraystates.size(); i++) { + JourneyState.validateJsonElement(jsonArraystates.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyDefinition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(JourneyDefinition.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyDefinition value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyDefinition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyDefinition + * @throws IOException if the JSON string is invalid with respect to JourneyDefinition + */ + public static JourneyDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyDefinition.class); + } + + /** + * Convert an instance of JourneyDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/JourneyDetails.java b/src/main/java/com/segment/publicapi/models/JourneyDetails.java new file mode 100644 index 00000000..5d398568 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/JourneyDetails.java @@ -0,0 +1,225 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** JourneyDetails */ +public class JourneyDetails { + public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_ID) + private String containerId; + + public static final String SERIALIZED_NAME_VERSION_NUMBER = "versionNumber"; + + @SerializedName(SERIALIZED_NAME_VERSION_NUMBER) + private BigDecimal versionNumber; + + public JourneyDetails() {} + + public JourneyDetails containerId(String containerId) { + + this.containerId = containerId; + return this; + } + + /** + * Get containerId + * + * @return containerId + */ + @javax.annotation.Nullable + public String getContainerId() { + return containerId; + } + + public void setContainerId(String containerId) { + this.containerId = containerId; + } + + public JourneyDetails versionNumber(BigDecimal versionNumber) { + + this.versionNumber = versionNumber; + return this; + } + + /** + * Get versionNumber + * + * @return versionNumber + */ + @javax.annotation.Nullable + public BigDecimal getVersionNumber() { + return versionNumber; + } + + public void setVersionNumber(BigDecimal versionNumber) { + this.versionNumber = versionNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyDetails journeyDetails = (JourneyDetails) o; + return Objects.equals(this.containerId, journeyDetails.containerId) + && Objects.equals(this.versionNumber, journeyDetails.versionNumber); + } + + @Override + public int hashCode() { + return Objects.hash(containerId, versionNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyDetails {\n"); + sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); + sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("containerId"); + openapiFields.add("versionNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JourneyDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JourneyDetails.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in JourneyDetails is not found in the" + + " empty JSON string", + JourneyDetails.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JourneyDetails.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `JourneyDetails` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("containerId") != null && !jsonObj.get("containerId").isJsonNull()) + && !jsonObj.get("containerId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `containerId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("containerId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(JourneyDetails.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyDetails + * @throws IOException if the JSON string is invalid with respect to JourneyDetails + */ + public static JourneyDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyDetails.class); + } + + /** + * Convert an instance of JourneyDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/JourneyInfo.java b/src/main/java/com/segment/publicapi/models/JourneyInfo.java new file mode 100644 index 00000000..bdb8dc80 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/JourneyInfo.java @@ -0,0 +1,461 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** JourneyInfo */ +public class JourneyInfo { + public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_ID) + private String containerId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private JourneyVersionOutput version; + + public JourneyInfo() {} + + public JourneyInfo containerId(String containerId) { + + this.containerId = containerId; + return this; + } + + /** + * The journey id. + * + * @return containerId + */ + @javax.annotation.Nonnull + public String getContainerId() { + return containerId; + } + + public void setContainerId(String containerId) { + this.containerId = containerId; + } + + public JourneyInfo name(String name) { + + this.name = name; + return this; + } + + /** + * The journey name. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public JourneyInfo description(String description) { + + this.description = description; + return this; + } + + /** + * The journey description. + * + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public JourneyInfo createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public JourneyInfo updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public JourneyInfo createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public JourneyInfo updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * Get updatedBy + * + * @return updatedBy + */ + @javax.annotation.Nullable + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public JourneyInfo version(JourneyVersionOutput version) { + + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + */ + @javax.annotation.Nonnull + public JourneyVersionOutput getVersion() { + return version; + } + + public void setVersion(JourneyVersionOutput version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyInfo journeyInfo = (JourneyInfo) o; + return Objects.equals(this.containerId, journeyInfo.containerId) + && Objects.equals(this.name, journeyInfo.name) + && Objects.equals(this.description, journeyInfo.description) + && Objects.equals(this.createdAt, journeyInfo.createdAt) + && Objects.equals(this.updatedAt, journeyInfo.updatedAt) + && Objects.equals(this.createdBy, journeyInfo.createdBy) + && Objects.equals(this.updatedBy, journeyInfo.updatedBy) + && Objects.equals(this.version, journeyInfo.version); + } + + @Override + public int hashCode() { + return Objects.hash( + containerId, + name, + description, + createdAt, + updatedAt, + createdBy, + updatedBy, + version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyInfo {\n"); + sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("containerId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("containerId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JourneyInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JourneyInfo.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in JourneyInfo is not found in the empty" + + " JSON string", + JourneyInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JourneyInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `JourneyInfo` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JourneyInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("containerId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `containerId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("containerId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("updatedBy") != null && !jsonObj.get("updatedBy").isJsonNull()) + && !jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + // validate the required field `version` + JourneyVersionOutput.validateJsonElement(jsonObj.get("version")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(JourneyInfo.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyInfo + * @throws IOException if the JSON string is invalid with respect to JourneyInfo + */ + public static JourneyInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyInfo.class); + } + + /** + * Convert an instance of JourneyInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/JourneyState.java b/src/main/java/com/segment/publicapi/models/JourneyState.java new file mode 100644 index 00000000..895cb653 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/JourneyState.java @@ -0,0 +1,667 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class JourneyState extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(JourneyState.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterEventEntryState = + gson.getDelegateAdapter(this, TypeToken.get(EventEntryState.class)); + final TypeAdapter adapterAudienceEntryState = + gson.getDelegateAdapter(this, TypeToken.get(AudienceEntryState.class)); + final TypeAdapter adapterExitState = + gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); + final TypeAdapter adapterDestinationState = + gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); + final TypeAdapter adapterSimpleDelayState = + gson.getDelegateAdapter(this, TypeToken.get(SimpleDelayState.class)); + final TypeAdapter adapterEventSplitWithTimeoutState = + gson.getDelegateAdapter(this, TypeToken.get(EventSplitWithTimeoutState.class)); + final TypeAdapter adapterConditionSplitState = + gson.getDelegateAdapter(this, TypeToken.get(ConditionSplitState.class)); + final TypeAdapter adapterRandomSplitState = + gson.getDelegateAdapter(this, TypeToken.get(RandomSplitState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyState value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `EventEntryState` + if (value.getActualInstance() instanceof EventEntryState) { + JsonElement element = + adapterEventEntryState.toJsonTree( + (EventEntryState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AudienceEntryState` + if (value.getActualInstance() instanceof AudienceEntryState) { + JsonElement element = + adapterAudienceEntryState.toJsonTree( + (AudienceEntryState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ExitState` + if (value.getActualInstance() instanceof ExitState) { + JsonElement element = + adapterExitState.toJsonTree( + (ExitState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DestinationState` + if (value.getActualInstance() instanceof DestinationState) { + JsonElement element = + adapterDestinationState.toJsonTree( + (DestinationState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `SimpleDelayState` + if (value.getActualInstance() instanceof SimpleDelayState) { + JsonElement element = + adapterSimpleDelayState.toJsonTree( + (SimpleDelayState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `EventSplitWithTimeoutState` + if (value.getActualInstance() instanceof EventSplitWithTimeoutState) { + JsonElement element = + adapterEventSplitWithTimeoutState.toJsonTree( + (EventSplitWithTimeoutState) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ConditionSplitState` + if (value.getActualInstance() instanceof ConditionSplitState) { + JsonElement element = + adapterConditionSplitState.toJsonTree( + (ConditionSplitState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RandomSplitState` + if (value.getActualInstance() instanceof RandomSplitState) { + JsonElement element = + adapterRandomSplitState.toJsonTree( + (RandomSplitState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " AudienceEntryState, ConditionSplitState," + + " DestinationState, EventEntryState," + + " EventSplitWithTimeoutState, ExitState," + + " RandomSplitState, SimpleDelayState"); + } + + @Override + public JourneyState read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize EventEntryState + try { + // validate the JSON object to see if any exception is thrown + EventEntryState.validateJsonElement(jsonElement); + actualAdapter = adapterEventEntryState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for EventEntryState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'EventEntryState'", + e); + } + // deserialize AudienceEntryState + try { + // validate the JSON object to see if any exception is thrown + AudienceEntryState.validateJsonElement(jsonElement); + actualAdapter = adapterAudienceEntryState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudienceEntryState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AudienceEntryState'", + e); + } + // deserialize ExitState + try { + // validate the JSON object to see if any exception is thrown + ExitState.validateJsonElement(jsonElement); + actualAdapter = adapterExitState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExitState failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExitState'", + e); + } + // deserialize DestinationState + try { + // validate the JSON object to see if any exception is thrown + DestinationState.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationState'", + e); + } + // deserialize SimpleDelayState + try { + // validate the JSON object to see if any exception is thrown + SimpleDelayState.validateJsonElement(jsonElement); + actualAdapter = adapterSimpleDelayState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for SimpleDelayState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'SimpleDelayState'", + e); + } + // deserialize EventSplitWithTimeoutState + try { + // validate the JSON object to see if any exception is thrown + EventSplitWithTimeoutState.validateJsonElement(jsonElement); + actualAdapter = adapterEventSplitWithTimeoutState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for EventSplitWithTimeoutState" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'EventSplitWithTimeoutState'", + e); + } + // deserialize ConditionSplitState + try { + // validate the JSON object to see if any exception is thrown + ConditionSplitState.validateJsonElement(jsonElement); + actualAdapter = adapterConditionSplitState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ConditionSplitState failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ConditionSplitState'", + e); + } + // deserialize RandomSplitState + try { + // validate the JSON object to see if any exception is thrown + RandomSplitState.validateJsonElement(jsonElement); + actualAdapter = adapterRandomSplitState; + JourneyState ret = new JourneyState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for RandomSplitState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'RandomSplitState'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for JourneyState: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public JourneyState() { + super("anyOf", Boolean.FALSE); + } + + public JourneyState(AudienceEntryState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(ConditionSplitState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(DestinationState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(EventEntryState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(EventSplitWithTimeoutState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(ExitState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(RandomSplitState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public JourneyState(SimpleDelayState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EventEntryState", EventEntryState.class); + schemas.put("AudienceEntryState", AudienceEntryState.class); + schemas.put("ExitState", ExitState.class); + schemas.put("DestinationState", DestinationState.class); + schemas.put("SimpleDelayState", SimpleDelayState.class); + schemas.put("EventSplitWithTimeoutState", EventSplitWithTimeoutState.class); + schemas.put("ConditionSplitState", ConditionSplitState.class); + schemas.put("RandomSplitState", RandomSplitState.class); + } + + @Override + public Map> getSchemas() { + return JourneyState.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: AudienceEntryState, ConditionSplitState, DestinationState, + * EventEntryState, EventSplitWithTimeoutState, ExitState, RandomSplitState, SimpleDelayState + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof EventEntryState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AudienceEntryState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExitState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DestinationState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SimpleDelayState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventSplitWithTimeoutState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ConditionSplitState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RandomSplitState) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AudienceEntryState, ConditionSplitState," + + " DestinationState, EventEntryState, EventSplitWithTimeoutState, ExitState," + + " RandomSplitState, SimpleDelayState"); + } + + /** + * Get the actual instance, which can be the following: AudienceEntryState, ConditionSplitState, + * DestinationState, EventEntryState, EventSplitWithTimeoutState, ExitState, RandomSplitState, + * SimpleDelayState + * + * @return The actual instance (AudienceEntryState, ConditionSplitState, DestinationState, + * EventEntryState, EventSplitWithTimeoutState, ExitState, RandomSplitState, + * SimpleDelayState) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EventEntryState`. If the actual instance is not + * `EventEntryState`, the ClassCastException will be thrown. + * + * @return The actual instance of `EventEntryState` + * @throws ClassCastException if the instance is not `EventEntryState` + */ + public EventEntryState getEventEntryState() throws ClassCastException { + return (EventEntryState) super.getActualInstance(); + } + + /** + * Get the actual instance of `AudienceEntryState`. If the actual instance is not + * `AudienceEntryState`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudienceEntryState` + * @throws ClassCastException if the instance is not `AudienceEntryState` + */ + public AudienceEntryState getAudienceEntryState() throws ClassCastException { + return (AudienceEntryState) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExitState`. If the actual instance is not `ExitState`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ExitState` + * @throws ClassCastException if the instance is not `ExitState` + */ + public ExitState getExitState() throws ClassCastException { + return (ExitState) super.getActualInstance(); + } + + /** + * Get the actual instance of `DestinationState`. If the actual instance is not + * `DestinationState`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationState` + * @throws ClassCastException if the instance is not `DestinationState` + */ + public DestinationState getDestinationState() throws ClassCastException { + return (DestinationState) super.getActualInstance(); + } + + /** + * Get the actual instance of `SimpleDelayState`. If the actual instance is not + * `SimpleDelayState`, the ClassCastException will be thrown. + * + * @return The actual instance of `SimpleDelayState` + * @throws ClassCastException if the instance is not `SimpleDelayState` + */ + public SimpleDelayState getSimpleDelayState() throws ClassCastException { + return (SimpleDelayState) super.getActualInstance(); + } + + /** + * Get the actual instance of `EventSplitWithTimeoutState`. If the actual instance is not + * `EventSplitWithTimeoutState`, the ClassCastException will be thrown. + * + * @return The actual instance of `EventSplitWithTimeoutState` + * @throws ClassCastException if the instance is not `EventSplitWithTimeoutState` + */ + public EventSplitWithTimeoutState getEventSplitWithTimeoutState() throws ClassCastException { + return (EventSplitWithTimeoutState) super.getActualInstance(); + } + + /** + * Get the actual instance of `ConditionSplitState`. If the actual instance is not + * `ConditionSplitState`, the ClassCastException will be thrown. + * + * @return The actual instance of `ConditionSplitState` + * @throws ClassCastException if the instance is not `ConditionSplitState` + */ + public ConditionSplitState getConditionSplitState() throws ClassCastException { + return (ConditionSplitState) super.getActualInstance(); + } + + /** + * Get the actual instance of `RandomSplitState`. If the actual instance is not + * `RandomSplitState`, the ClassCastException will be thrown. + * + * @return The actual instance of `RandomSplitState` + * @throws ClassCastException if the instance is not `RandomSplitState` + */ + public RandomSplitState getRandomSplitState() throws ClassCastException { + return (RandomSplitState) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JourneyState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with EventEntryState + try { + EventEntryState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for EventEntryState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AudienceEntryState + try { + AudienceEntryState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AudienceEntryState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ExitState + try { + ExitState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExitState failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DestinationState + try { + DestinationState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with SimpleDelayState + try { + SimpleDelayState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for SimpleDelayState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with EventSplitWithTimeoutState + try { + EventSplitWithTimeoutState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for EventSplitWithTimeoutState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ConditionSplitState + try { + ConditionSplitState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ConditionSplitState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with RandomSplitState + try { + RandomSplitState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for RandomSplitState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for JourneyState with anyOf schemas:" + + " AudienceEntryState, ConditionSplitState, DestinationState," + + " EventEntryState, EventSplitWithTimeoutState, ExitState," + + " RandomSplitState, SimpleDelayState. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of JourneyState given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyState + * @throws IOException if the JSON string is invalid with respect to JourneyState + */ + public static JourneyState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyState.class); + } + + /** + * Convert an instance of JourneyState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java b/src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java new file mode 100644 index 00000000..61f5a18b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java @@ -0,0 +1,500 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** JourneyVersionOutput */ +public class JourneyVersionOutput { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; + + /** Gets or Sets status */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ARCHIVED("ARCHIVED"), + + DRAFT("DRAFT"), + + ENTRY_PAUSED("ENTRY_PAUSED"), + + PUBLISHED("PUBLISHED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private JourneyDefinition definition; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public JourneyVersionOutput() {} + + public JourneyVersionOutput id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public JourneyVersionOutput version(BigDecimal version) { + + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + */ + @javax.annotation.Nonnull + public BigDecimal getVersion() { + return version; + } + + public void setVersion(BigDecimal version) { + this.version = version; + } + + public JourneyVersionOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public JourneyVersionOutput definition(JourneyDefinition definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public JourneyDefinition getDefinition() { + return definition; + } + + public void setDefinition(JourneyDefinition definition) { + this.definition = definition; + } + + public JourneyVersionOutput createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public JourneyVersionOutput updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * + * @return updatedAt + */ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public JourneyVersionOutput createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public JourneyVersionOutput updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * Get updatedBy + * + * @return updatedBy + */ + @javax.annotation.Nullable + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JourneyVersionOutput journeyVersionOutput = (JourneyVersionOutput) o; + return Objects.equals(this.id, journeyVersionOutput.id) + && Objects.equals(this.version, journeyVersionOutput.version) + && Objects.equals(this.status, journeyVersionOutput.status) + && Objects.equals(this.definition, journeyVersionOutput.definition) + && Objects.equals(this.createdAt, journeyVersionOutput.createdAt) + && Objects.equals(this.updatedAt, journeyVersionOutput.updatedAt) + && Objects.equals(this.createdBy, journeyVersionOutput.createdBy) + && Objects.equals(this.updatedBy, journeyVersionOutput.updatedBy); + } + + @Override + public int hashCode() { + return Objects.hash( + id, version, status, definition, createdAt, updatedAt, createdBy, updatedBy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JourneyVersionOutput {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("version"); + openapiFields.add("status"); + openapiFields.add("definition"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("createdBy"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JourneyVersionOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JourneyVersionOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in JourneyVersionOutput is not found in" + + " the empty JSON string", + JourneyVersionOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JourneyVersionOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `JourneyVersionOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JourneyVersionOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + // validate the required field `definition` + JourneyDefinition.validateJsonElement(jsonObj.get("definition")); + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) + && !jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("updatedBy") != null && !jsonObj.get("updatedBy").isJsonNull()) + && !jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JourneyVersionOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JourneyVersionOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(JourneyVersionOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, JourneyVersionOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JourneyVersionOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of JourneyVersionOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of JourneyVersionOutput + * @throws IOException if the JSON string is invalid with respect to JourneyVersionOutput + */ + public static JourneyVersionOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JourneyVersionOutput.class); + } + + /** + * Convert an instance of JourneyVersionOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Key.java b/src/main/java/com/segment/publicapi/models/Key.java new file mode 100644 index 00000000..d516cf0d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Key.java @@ -0,0 +1,241 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Key */ +public class Key { + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public Key() {} + + public Key name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Key id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Key key = (Key) o; + return Objects.equals(this.name, key.name) && Objects.equals(this.id, key.id); + } + + @Override + public int hashCode() { + return Objects.hash(name, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Key {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Key + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Key.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Key is not found in the empty JSON" + + " string", + Key.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Key.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Key`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Key.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) + && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Key.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Key' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Key.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Key value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Key read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Key given an JSON string + * + * @param jsonString JSON string + * @return An instance of Key + * @throws IOException if the JSON string is invalid with respect to Key + */ + public static Key fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Key.class); + } + + /** + * Convert an instance of Key to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java b/src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java new file mode 100644 index 00000000..094dd7d8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java @@ -0,0 +1,223 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** PropertySelectionsConfig */ +public class PropertySelectionsConfig { + public static final String SERIALIZED_NAME_PROFILE = "profile"; + + @SerializedName(SERIALIZED_NAME_PROFILE) + private List profile = new ArrayList<>(); + + public PropertySelectionsConfig() {} + + public PropertySelectionsConfig profile(List profile) { + + this.profile = profile; + return this; + } + + public PropertySelectionsConfig addProfileItem(String profileItem) { + if (this.profile == null) { + this.profile = new ArrayList<>(); + } + this.profile.add(profileItem); + return this; + } + + /** + * Get profile + * + * @return profile + */ + @javax.annotation.Nonnull + public List getProfile() { + return profile; + } + + public void setProfile(List profile) { + this.profile = profile; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PropertySelectionsConfig propertySelectionsConfig = (PropertySelectionsConfig) o; + return Objects.equals(this.profile, propertySelectionsConfig.profile); + } + + @Override + public int hashCode() { + return Objects.hash(profile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PropertySelectionsConfig {\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("profile"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("profile"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PropertySelectionsConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PropertySelectionsConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PropertySelectionsConfig is not found" + + " in the empty JSON string", + PropertySelectionsConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PropertySelectionsConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PropertySelectionsConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PropertySelectionsConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("profile") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("profile").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `profile` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("profile").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PropertySelectionsConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PropertySelectionsConfig' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PropertySelectionsConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PropertySelectionsConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PropertySelectionsConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PropertySelectionsConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of PropertySelectionsConfig + * @throws IOException if the JSON string is invalid with respect to PropertySelectionsConfig + */ + public static PropertySelectionsConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PropertySelectionsConfig.class); + } + + /** + * Convert an instance of PropertySelectionsConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RandomSplitBranch.java b/src/main/java/com/segment/publicapi/models/RandomSplitBranch.java new file mode 100644 index 00000000..75dddcf8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RandomSplitBranch.java @@ -0,0 +1,237 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** RandomSplitBranch */ +public class RandomSplitBranch { + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private BigDecimal percentage; + + public static final String SERIALIZED_NAME_NEXT = "next"; + + @SerializedName(SERIALIZED_NAME_NEXT) + private String next; + + public RandomSplitBranch() {} + + public RandomSplitBranch percentage(BigDecimal percentage) { + + this.percentage = percentage; + return this; + } + + /** + * Get percentage + * + * @return percentage + */ + @javax.annotation.Nonnull + public BigDecimal getPercentage() { + return percentage; + } + + public void setPercentage(BigDecimal percentage) { + this.percentage = percentage; + } + + public RandomSplitBranch next(String next) { + + this.next = next; + return this; + } + + /** + * Get next + * + * @return next + */ + @javax.annotation.Nonnull + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RandomSplitBranch randomSplitBranch = (RandomSplitBranch) o; + return Objects.equals(this.percentage, randomSplitBranch.percentage) + && Objects.equals(this.next, randomSplitBranch.next); + } + + @Override + public int hashCode() { + return Objects.hash(percentage, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RandomSplitBranch {\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("percentage"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("percentage"); + openapiRequiredFields.add("next"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RandomSplitBranch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RandomSplitBranch.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RandomSplitBranch is not found in the" + + " empty JSON string", + RandomSplitBranch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RandomSplitBranch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RandomSplitBranch` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RandomSplitBranch.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `next` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RandomSplitBranch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RandomSplitBranch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RandomSplitBranch.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RandomSplitBranch value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RandomSplitBranch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RandomSplitBranch given an JSON string + * + * @param jsonString JSON string + * @return An instance of RandomSplitBranch + * @throws IOException if the JSON string is invalid with respect to RandomSplitBranch + */ + public static RandomSplitBranch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RandomSplitBranch.class); + } + + /** + * Convert an instance of RandomSplitBranch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RandomSplitState.java b/src/main/java/com/segment/publicapi/models/RandomSplitState.java new file mode 100644 index 00000000..34ef2e01 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RandomSplitState.java @@ -0,0 +1,342 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** RandomSplitState */ +public class RandomSplitState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + RANDOM_SPLIT("RANDOM_SPLIT"), + + EXIT("EXIT"), + + EXIT_RULE("EXIT_RULE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public RandomSplitState() {} + + public RandomSplitState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public RandomSplitState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public RandomSplitState addTransitionsItem(RandomSplitBranch transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public RandomSplitState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RandomSplitState randomSplitState = (RandomSplitState) o; + return Objects.equals(this.type, randomSplitState.type) + && Objects.equals(this.transitions, randomSplitState.transitions) + && Objects.equals(this.key, randomSplitState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RandomSplitState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RandomSplitState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RandomSplitState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RandomSplitState is not found in the" + + " empty JSON string", + RandomSplitState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RandomSplitState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RandomSplitState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RandomSplitState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + RandomSplitBranch.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RandomSplitState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RandomSplitState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RandomSplitState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RandomSplitState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RandomSplitState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RandomSplitState given an JSON string + * + * @param jsonString JSON string + * @return An instance of RandomSplitState + * @throws IOException if the JSON string is invalid with respect to RandomSplitState + */ + public static RandomSplitState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RandomSplitState.class); + } + + /** + * Convert an instance of RandomSplitState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java new file mode 100644 index 00000000..6ca11ab2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java @@ -0,0 +1,200 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** RemoveJourneyFromSpace200Response */ +public class RemoveJourneyFromSpace200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveJourneyFromSpaceAlphaOutput data; + + public RemoveJourneyFromSpace200Response() {} + + public RemoveJourneyFromSpace200Response data(RemoveJourneyFromSpaceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public RemoveJourneyFromSpaceAlphaOutput getData() { + return data; + } + + public void setData(RemoveJourneyFromSpaceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveJourneyFromSpace200Response removeJourneyFromSpace200Response = + (RemoveJourneyFromSpace200Response) o; + return Objects.equals(this.data, removeJourneyFromSpace200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveJourneyFromSpace200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RemoveJourneyFromSpace200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RemoveJourneyFromSpace200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveJourneyFromSpace200Response is" + + " not found in the empty JSON string", + RemoveJourneyFromSpace200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RemoveJourneyFromSpace200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveJourneyFromSpace200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + RemoveJourneyFromSpaceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveJourneyFromSpace200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveJourneyFromSpace200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveJourneyFromSpace200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveJourneyFromSpace200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveJourneyFromSpace200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveJourneyFromSpace200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveJourneyFromSpace200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveJourneyFromSpace200Response + */ + public static RemoveJourneyFromSpace200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveJourneyFromSpace200Response.class); + } + + /** + * Convert an instance of RemoveJourneyFromSpace200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java new file mode 100644 index 00000000..d2e8c3b8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java @@ -0,0 +1,259 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Delete journey output. */ +public class RemoveJourneyFromSpaceAlphaOutput { + /** Journey status. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("SUCCESS"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public RemoveJourneyFromSpaceAlphaOutput() {} + + public RemoveJourneyFromSpaceAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Journey status. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveJourneyFromSpaceAlphaOutput removeJourneyFromSpaceAlphaOutput = + (RemoveJourneyFromSpaceAlphaOutput) o; + return Objects.equals(this.status, removeJourneyFromSpaceAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveJourneyFromSpaceAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RemoveJourneyFromSpaceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RemoveJourneyFromSpaceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveJourneyFromSpaceAlphaOutput is" + + " not found in the empty JSON string", + RemoveJourneyFromSpaceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RemoveJourneyFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveJourneyFromSpaceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveJourneyFromSpaceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveJourneyFromSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveJourneyFromSpaceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveJourneyFromSpaceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveJourneyFromSpaceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveJourneyFromSpaceAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveJourneyFromSpaceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveJourneyFromSpaceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveJourneyFromSpaceAlphaOutput + */ + public static RemoveJourneyFromSpaceAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveJourneyFromSpaceAlphaOutput.class); + } + + /** + * Convert an instance of RemoveJourneyFromSpaceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java new file mode 100644 index 00000000..48ba7b46 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java @@ -0,0 +1,200 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ReplaceStepsForJourney200Response */ +public class ReplaceStepsForJourney200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ReplaceStepsForJourneyAlphaOutput data; + + public ReplaceStepsForJourney200Response() {} + + public ReplaceStepsForJourney200Response data(ReplaceStepsForJourneyAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ReplaceStepsForJourneyAlphaOutput getData() { + return data; + } + + public void setData(ReplaceStepsForJourneyAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReplaceStepsForJourney200Response replaceStepsForJourney200Response = + (ReplaceStepsForJourney200Response) o; + return Objects.equals(this.data, replaceStepsForJourney200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReplaceStepsForJourney200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReplaceStepsForJourney200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReplaceStepsForJourney200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReplaceStepsForJourney200Response is" + + " not found in the empty JSON string", + ReplaceStepsForJourney200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReplaceStepsForJourney200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReplaceStepsForJourney200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ReplaceStepsForJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReplaceStepsForJourney200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReplaceStepsForJourney200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReplaceStepsForJourney200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReplaceStepsForJourney200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReplaceStepsForJourney200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReplaceStepsForJourney200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReplaceStepsForJourney200Response + * @throws IOException if the JSON string is invalid with respect to + * ReplaceStepsForJourney200Response + */ + public static ReplaceStepsForJourney200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReplaceStepsForJourney200Response.class); + } + + /** + * Convert an instance of ReplaceStepsForJourney200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java new file mode 100644 index 00000000..5f271af7 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java @@ -0,0 +1,268 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Replace steps for a journey input. */ +public class ReplaceStepsForJourneyAlphaInput { + public static final String SERIALIZED_NAME_INITIAL_STATE = "initialState"; + + @SerializedName(SERIALIZED_NAME_INITIAL_STATE) + private String initialState; + + public static final String SERIALIZED_NAME_STATES = "states"; + + @SerializedName(SERIALIZED_NAME_STATES) + private List states = new ArrayList<>(); + + public ReplaceStepsForJourneyAlphaInput() {} + + public ReplaceStepsForJourneyAlphaInput initialState(String initialState) { + + this.initialState = initialState; + return this; + } + + /** + * The Initial state of the journey. + * + * @return initialState + */ + @javax.annotation.Nonnull + public String getInitialState() { + return initialState; + } + + public void setInitialState(String initialState) { + this.initialState = initialState; + } + + public ReplaceStepsForJourneyAlphaInput states(List states) { + + this.states = states; + return this; + } + + public ReplaceStepsForJourneyAlphaInput addStatesItem(JourneyState statesItem) { + if (this.states == null) { + this.states = new ArrayList<>(); + } + this.states.add(statesItem); + return this; + } + + /** + * States of the journey. + * + * @return states + */ + @javax.annotation.Nonnull + public List getStates() { + return states; + } + + public void setStates(List states) { + this.states = states; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput = + (ReplaceStepsForJourneyAlphaInput) o; + return Objects.equals(this.initialState, replaceStepsForJourneyAlphaInput.initialState) + && Objects.equals(this.states, replaceStepsForJourneyAlphaInput.states); + } + + @Override + public int hashCode() { + return Objects.hash(initialState, states); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReplaceStepsForJourneyAlphaInput {\n"); + sb.append(" initialState: ").append(toIndentedString(initialState)).append("\n"); + sb.append(" states: ").append(toIndentedString(states)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("initialState"); + openapiFields.add("states"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("initialState"); + openapiRequiredFields.add("states"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReplaceStepsForJourneyAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReplaceStepsForJourneyAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReplaceStepsForJourneyAlphaInput is" + + " not found in the empty JSON string", + ReplaceStepsForJourneyAlphaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReplaceStepsForJourneyAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReplaceStepsForJourneyAlphaInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReplaceStepsForJourneyAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("initialState").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `initialState` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("initialState").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("states").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `states` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("states").toString())); + } + + JsonArray jsonArraystates = jsonObj.getAsJsonArray("states"); + // validate the required field `states` (array) + for (int i = 0; i < jsonArraystates.size(); i++) { + JourneyState.validateJsonElement(jsonArraystates.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReplaceStepsForJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReplaceStepsForJourneyAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReplaceStepsForJourneyAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReplaceStepsForJourneyAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReplaceStepsForJourneyAlphaInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReplaceStepsForJourneyAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReplaceStepsForJourneyAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * ReplaceStepsForJourneyAlphaInput + */ + public static ReplaceStepsForJourneyAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReplaceStepsForJourneyAlphaInput.class); + } + + /** + * Convert an instance of ReplaceStepsForJourneyAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java new file mode 100644 index 00000000..46b92158 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java @@ -0,0 +1,234 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Replace the steps for a journey output. */ +public class ReplaceStepsForJourneyAlphaOutput { + public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_ID) + private String containerId; + + public static final String SERIALIZED_NAME_VERSION_NUMBER = "versionNumber"; + + @SerializedName(SERIALIZED_NAME_VERSION_NUMBER) + private BigDecimal versionNumber; + + public ReplaceStepsForJourneyAlphaOutput() {} + + public ReplaceStepsForJourneyAlphaOutput containerId(String containerId) { + + this.containerId = containerId; + return this; + } + + /** + * Get containerId + * + * @return containerId + */ + @javax.annotation.Nullable + public String getContainerId() { + return containerId; + } + + public void setContainerId(String containerId) { + this.containerId = containerId; + } + + public ReplaceStepsForJourneyAlphaOutput versionNumber(BigDecimal versionNumber) { + + this.versionNumber = versionNumber; + return this; + } + + /** + * Get versionNumber + * + * @return versionNumber + */ + @javax.annotation.Nullable + public BigDecimal getVersionNumber() { + return versionNumber; + } + + public void setVersionNumber(BigDecimal versionNumber) { + this.versionNumber = versionNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReplaceStepsForJourneyAlphaOutput replaceStepsForJourneyAlphaOutput = + (ReplaceStepsForJourneyAlphaOutput) o; + return Objects.equals(this.containerId, replaceStepsForJourneyAlphaOutput.containerId) + && Objects.equals( + this.versionNumber, replaceStepsForJourneyAlphaOutput.versionNumber); + } + + @Override + public int hashCode() { + return Objects.hash(containerId, versionNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReplaceStepsForJourneyAlphaOutput {\n"); + sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); + sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("containerId"); + openapiFields.add("versionNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ReplaceStepsForJourneyAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReplaceStepsForJourneyAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReplaceStepsForJourneyAlphaOutput is" + + " not found in the empty JSON string", + ReplaceStepsForJourneyAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReplaceStepsForJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReplaceStepsForJourneyAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("containerId") != null && !jsonObj.get("containerId").isJsonNull()) + && !jsonObj.get("containerId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `containerId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("containerId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReplaceStepsForJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReplaceStepsForJourneyAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ReplaceStepsForJourneyAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReplaceStepsForJourneyAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReplaceStepsForJourneyAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReplaceStepsForJourneyAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReplaceStepsForJourneyAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ReplaceStepsForJourneyAlphaOutput + */ + public static ReplaceStepsForJourneyAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReplaceStepsForJourneyAlphaOutput.class); + } + + /** + * Convert an instance of ReplaceStepsForJourneyAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/SimpleDelayState.java b/src/main/java/com/segment/publicapi/models/SimpleDelayState.java new file mode 100644 index 00000000..f6ae9316 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/SimpleDelayState.java @@ -0,0 +1,374 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** SimpleDelayState */ +public class SimpleDelayState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SIMPLE_DELAY("SIMPLE_DELAY"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + + @SerializedName(SERIALIZED_NAME_TRANSITIONS) + private List transitions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public SimpleDelayState() {} + + public SimpleDelayState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public SimpleDelayState duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * Get duration + * + * @return duration + */ + @javax.annotation.Nonnull + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public SimpleDelayState transitions(List transitions) { + + this.transitions = transitions; + return this; + } + + public SimpleDelayState addTransitionsItem(Transitions transitionsItem) { + if (this.transitions == null) { + this.transitions = new ArrayList<>(); + } + this.transitions.add(transitionsItem); + return this; + } + + /** + * Get transitions + * + * @return transitions + */ + @javax.annotation.Nonnull + public List getTransitions() { + return transitions; + } + + public void setTransitions(List transitions) { + this.transitions = transitions; + } + + public SimpleDelayState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleDelayState simpleDelayState = (SimpleDelayState) o; + return Objects.equals(this.type, simpleDelayState.type) + && Objects.equals(this.duration, simpleDelayState.duration) + && Objects.equals(this.transitions, simpleDelayState.transitions) + && Objects.equals(this.key, simpleDelayState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, duration, transitions, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleDelayState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("duration"); + openapiFields.add("transitions"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("duration"); + openapiRequiredFields.add("transitions"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SimpleDelayState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SimpleDelayState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SimpleDelayState is not found in the" + + " empty JSON string", + SimpleDelayState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SimpleDelayState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SimpleDelayState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimpleDelayState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("duration").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `duration` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("duration").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transitions").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transitions` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("transitions").toString())); + } + + JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); + // validate the required field `transitions` (array) + for (int i = 0; i < jsonArraytransitions.size(); i++) { + Transitions.validateJsonElement(jsonArraytransitions.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SimpleDelayState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimpleDelayState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SimpleDelayState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SimpleDelayState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SimpleDelayState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SimpleDelayState given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimpleDelayState + * @throws IOException if the JSON string is invalid with respect to SimpleDelayState + */ + public static SimpleDelayState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimpleDelayState.class); + } + + /** + * Convert an instance of SimpleDelayState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/StatesInner.java b/src/main/java/com/segment/publicapi/models/StatesInner.java new file mode 100644 index 00000000..bfadbd1a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/StatesInner.java @@ -0,0 +1,339 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class StatesInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(StatesInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StatesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterDestinationState = + gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); + final TypeAdapter adapterEventExitRule = + gson.getDelegateAdapter(this, TypeToken.get(EventExitRule.class)); + final TypeAdapter adapterAudienceExitRule = + gson.getDelegateAdapter(this, TypeToken.get(AudienceExitRule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, StatesInner value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `DestinationState` + if (value.getActualInstance() instanceof DestinationState) { + JsonElement element = + adapterDestinationState.toJsonTree( + (DestinationState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EventExitRule` + if (value.getActualInstance() instanceof EventExitRule) { + JsonElement element = + adapterEventExitRule.toJsonTree( + (EventExitRule) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AudienceExitRule` + if (value.getActualInstance() instanceof AudienceExitRule) { + JsonElement element = + adapterAudienceExitRule.toJsonTree( + (AudienceExitRule) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " AudienceExitRule, DestinationState, EventExitRule"); + } + + @Override + public StatesInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize DestinationState + try { + // validate the JSON object to see if any exception is thrown + DestinationState.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationState; + StatesInner ret = new StatesInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationState'", + e); + } + // deserialize EventExitRule + try { + // validate the JSON object to see if any exception is thrown + EventExitRule.validateJsonElement(jsonElement); + actualAdapter = adapterEventExitRule; + StatesInner ret = new StatesInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for EventExitRule failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'EventExitRule'", + e); + } + // deserialize AudienceExitRule + try { + // validate the JSON object to see if any exception is thrown + AudienceExitRule.validateJsonElement(jsonElement); + actualAdapter = adapterAudienceExitRule; + StatesInner ret = new StatesInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudienceExitRule failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AudienceExitRule'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for StatesInner: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public StatesInner() { + super("anyOf", Boolean.FALSE); + } + + public StatesInner(AudienceExitRule o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public StatesInner(DestinationState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public StatesInner(EventExitRule o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("DestinationState", DestinationState.class); + schemas.put("EventExitRule", EventExitRule.class); + schemas.put("AudienceExitRule", AudienceExitRule.class); + } + + @Override + public Map> getSchemas() { + return StatesInner.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: AudienceExitRule, DestinationState, EventExitRule + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof DestinationState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventExitRule) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AudienceExitRule) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AudienceExitRule, DestinationState, EventExitRule"); + } + + /** + * Get the actual instance, which can be the following: AudienceExitRule, DestinationState, + * EventExitRule + * + * @return The actual instance (AudienceExitRule, DestinationState, EventExitRule) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `DestinationState`. If the actual instance is not + * `DestinationState`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationState` + * @throws ClassCastException if the instance is not `DestinationState` + */ + public DestinationState getDestinationState() throws ClassCastException { + return (DestinationState) super.getActualInstance(); + } + + /** + * Get the actual instance of `EventExitRule`. If the actual instance is not `EventExitRule`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventExitRule` + * @throws ClassCastException if the instance is not `EventExitRule` + */ + public EventExitRule getEventExitRule() throws ClassCastException { + return (EventExitRule) super.getActualInstance(); + } + + /** + * Get the actual instance of `AudienceExitRule`. If the actual instance is not + * `AudienceExitRule`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudienceExitRule` + * @throws ClassCastException if the instance is not `AudienceExitRule` + */ + public AudienceExitRule getAudienceExitRule() throws ClassCastException { + return (AudienceExitRule) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StatesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with DestinationState + try { + DestinationState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with EventExitRule + try { + EventExitRule.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for EventExitRule failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AudienceExitRule + try { + AudienceExitRule.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AudienceExitRule failed with `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for StatesInner with anyOf schemas:" + + " AudienceExitRule, DestinationState, EventExitRule. no class match" + + " the result, expected at least 1. Detailed failure message for anyOf" + + " schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of StatesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatesInner + * @throws IOException if the JSON string is invalid with respect to StatesInner + */ + public static StatesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatesInner.class); + } + + /** + * Convert an instance of StatesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java b/src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java new file mode 100644 index 00000000..8cea2864 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java @@ -0,0 +1,265 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** StepLevelAnalytics */ +public class StepLevelAnalytics { + public static final String SERIALIZED_NAME_FROM = "from"; + + @SerializedName(SERIALIZED_NAME_FROM) + private Key from; + + public static final String SERIALIZED_NAME_TO = "to"; + + @SerializedName(SERIALIZED_NAME_TO) + private Key to; + + public static final String SERIALIZED_NAME_ANALYTICS = "analytics"; + + @SerializedName(SERIALIZED_NAME_ANALYTICS) + private Analytics analytics; + + public StepLevelAnalytics() {} + + public StepLevelAnalytics from(Key from) { + + this.from = from; + return this; + } + + /** + * Get from + * + * @return from + */ + @javax.annotation.Nullable + public Key getFrom() { + return from; + } + + public void setFrom(Key from) { + this.from = from; + } + + public StepLevelAnalytics to(Key to) { + + this.to = to; + return this; + } + + /** + * Get to + * + * @return to + */ + @javax.annotation.Nonnull + public Key getTo() { + return to; + } + + public void setTo(Key to) { + this.to = to; + } + + public StepLevelAnalytics analytics(Analytics analytics) { + + this.analytics = analytics; + return this; + } + + /** + * Get analytics + * + * @return analytics + */ + @javax.annotation.Nonnull + public Analytics getAnalytics() { + return analytics; + } + + public void setAnalytics(Analytics analytics) { + this.analytics = analytics; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StepLevelAnalytics stepLevelAnalytics = (StepLevelAnalytics) o; + return Objects.equals(this.from, stepLevelAnalytics.from) + && Objects.equals(this.to, stepLevelAnalytics.to) + && Objects.equals(this.analytics, stepLevelAnalytics.analytics); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, analytics); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StepLevelAnalytics {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" analytics: ").append(toIndentedString(analytics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("analytics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("to"); + openapiRequiredFields.add("analytics"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StepLevelAnalytics + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!StepLevelAnalytics.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in StepLevelAnalytics is not found in the" + + " empty JSON string", + StepLevelAnalytics.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!StepLevelAnalytics.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `StepLevelAnalytics` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StepLevelAnalytics.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + Key.validateJsonElement(jsonObj.get("from")); + } + // validate the required field `to` + Key.validateJsonElement(jsonObj.get("to")); + // validate the required field `analytics` + Analytics.validateJsonElement(jsonObj.get("analytics")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StepLevelAnalytics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StepLevelAnalytics' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(StepLevelAnalytics.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, StepLevelAnalytics value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StepLevelAnalytics read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of StepLevelAnalytics given an JSON string + * + * @param jsonString JSON string + * @return An instance of StepLevelAnalytics + * @throws IOException if the JSON string is invalid with respect to StepLevelAnalytics + */ + public static StepLevelAnalytics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StepLevelAnalytics.class); + } + + /** + * Convert an instance of StepLevelAnalytics to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TimeOutBranch.java b/src/main/java/com/segment/publicapi/models/TimeOutBranch.java new file mode 100644 index 00000000..22ccab3d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TimeOutBranch.java @@ -0,0 +1,323 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** TimeOutBranch */ +public class TimeOutBranch { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TIMEOUT("TIMEOUT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_DURATION = "duration"; + + @SerializedName(SERIALIZED_NAME_DURATION) + private String duration; + + public static final String SERIALIZED_NAME_NEXT = "next"; + + @SerializedName(SERIALIZED_NAME_NEXT) + private String next; + + public TimeOutBranch() {} + + public TimeOutBranch type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public TimeOutBranch duration(String duration) { + + this.duration = duration; + return this; + } + + /** + * Get duration + * + * @return duration + */ + @javax.annotation.Nonnull + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public TimeOutBranch next(String next) { + + this.next = next; + return this; + } + + /** + * Get next + * + * @return next + */ + @javax.annotation.Nonnull + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeOutBranch timeOutBranch = (TimeOutBranch) o; + return Objects.equals(this.type, timeOutBranch.type) + && Objects.equals(this.duration, timeOutBranch.duration) + && Objects.equals(this.next, timeOutBranch.next); + } + + @Override + public int hashCode() { + return Objects.hash(type, duration, next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeOutBranch {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("duration"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("duration"); + openapiRequiredFields.add("next"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TimeOutBranch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TimeOutBranch.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TimeOutBranch is not found in the" + + " empty JSON string", + TimeOutBranch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TimeOutBranch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TimeOutBranch` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TimeOutBranch.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + if (!jsonObj.get("duration").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `duration` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("duration").toString())); + } + if (!jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `next` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TimeOutBranch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TimeOutBranch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TimeOutBranch.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TimeOutBranch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TimeOutBranch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TimeOutBranch given an JSON string + * + * @param jsonString JSON string + * @return An instance of TimeOutBranch + * @throws IOException if the JSON string is invalid with respect to TimeOutBranch + */ + public static TimeOutBranch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TimeOutBranch.class); + } + + /** + * Convert an instance of TimeOutBranch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java b/src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java new file mode 100644 index 00000000..ed89ce6b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java @@ -0,0 +1,296 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** TopLevelAnalytics */ +public class TopLevelAnalytics { + public static final String SERIALIZED_NAME_ENTERED = "entered"; + + @SerializedName(SERIALIZED_NAME_ENTERED) + private Analytics entered; + + public static final String SERIALIZED_NAME_COMPLETED = "completed"; + + @SerializedName(SERIALIZED_NAME_COMPLETED) + private Analytics completed; + + public static final String SERIALIZED_NAME_IN_PROGRESS = "inProgress"; + + @SerializedName(SERIALIZED_NAME_IN_PROGRESS) + private Analytics inProgress; + + public static final String SERIALIZED_NAME_EXITED = "exited"; + + @SerializedName(SERIALIZED_NAME_EXITED) + private Analytics exited; + + public TopLevelAnalytics() {} + + public TopLevelAnalytics entered(Analytics entered) { + + this.entered = entered; + return this; + } + + /** + * Get entered + * + * @return entered + */ + @javax.annotation.Nonnull + public Analytics getEntered() { + return entered; + } + + public void setEntered(Analytics entered) { + this.entered = entered; + } + + public TopLevelAnalytics completed(Analytics completed) { + + this.completed = completed; + return this; + } + + /** + * Get completed + * + * @return completed + */ + @javax.annotation.Nonnull + public Analytics getCompleted() { + return completed; + } + + public void setCompleted(Analytics completed) { + this.completed = completed; + } + + public TopLevelAnalytics inProgress(Analytics inProgress) { + + this.inProgress = inProgress; + return this; + } + + /** + * Get inProgress + * + * @return inProgress + */ + @javax.annotation.Nonnull + public Analytics getInProgress() { + return inProgress; + } + + public void setInProgress(Analytics inProgress) { + this.inProgress = inProgress; + } + + public TopLevelAnalytics exited(Analytics exited) { + + this.exited = exited; + return this; + } + + /** + * Get exited + * + * @return exited + */ + @javax.annotation.Nullable + public Analytics getExited() { + return exited; + } + + public void setExited(Analytics exited) { + this.exited = exited; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TopLevelAnalytics topLevelAnalytics = (TopLevelAnalytics) o; + return Objects.equals(this.entered, topLevelAnalytics.entered) + && Objects.equals(this.completed, topLevelAnalytics.completed) + && Objects.equals(this.inProgress, topLevelAnalytics.inProgress) + && Objects.equals(this.exited, topLevelAnalytics.exited); + } + + @Override + public int hashCode() { + return Objects.hash(entered, completed, inProgress, exited); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TopLevelAnalytics {\n"); + sb.append(" entered: ").append(toIndentedString(entered)).append("\n"); + sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); + sb.append(" inProgress: ").append(toIndentedString(inProgress)).append("\n"); + sb.append(" exited: ").append(toIndentedString(exited)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("entered"); + openapiFields.add("completed"); + openapiFields.add("inProgress"); + openapiFields.add("exited"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("entered"); + openapiRequiredFields.add("completed"); + openapiRequiredFields.add("inProgress"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TopLevelAnalytics + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TopLevelAnalytics.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in TopLevelAnalytics is not found in the" + + " empty JSON string", + TopLevelAnalytics.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TopLevelAnalytics.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `TopLevelAnalytics` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TopLevelAnalytics.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `entered` + Analytics.validateJsonElement(jsonObj.get("entered")); + // validate the required field `completed` + Analytics.validateJsonElement(jsonObj.get("completed")); + // validate the required field `inProgress` + Analytics.validateJsonElement(jsonObj.get("inProgress")); + // validate the optional field `exited` + if (jsonObj.get("exited") != null && !jsonObj.get("exited").isJsonNull()) { + Analytics.validateJsonElement(jsonObj.get("exited")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TopLevelAnalytics.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TopLevelAnalytics' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(TopLevelAnalytics.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TopLevelAnalytics value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TopLevelAnalytics read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of TopLevelAnalytics given an JSON string + * + * @param jsonString JSON string + * @return An instance of TopLevelAnalytics + * @throws IOException if the JSON string is invalid with respect to TopLevelAnalytics + */ + public static TopLevelAnalytics fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TopLevelAnalytics.class); + } + + /** + * Convert an instance of TopLevelAnalytics to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TransitionState.java b/src/main/java/com/segment/publicapi/models/TransitionState.java new file mode 100644 index 00000000..701f4a6a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TransitionState.java @@ -0,0 +1,619 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class TransitionState extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TransitionState.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransitionState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransitionState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterEventEntryState = + gson.getDelegateAdapter(this, TypeToken.get(EventEntryState.class)); + final TypeAdapter adapterAudienceEntryState = + gson.getDelegateAdapter(this, TypeToken.get(AudienceEntryState.class)); + final TypeAdapter adapterDestinationState = + gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); + final TypeAdapter adapterSimpleDelayState = + gson.getDelegateAdapter(this, TypeToken.get(SimpleDelayState.class)); + final TypeAdapter adapterEventSplitWithTimeoutState = + gson.getDelegateAdapter(this, TypeToken.get(EventSplitWithTimeoutState.class)); + final TypeAdapter adapterConditionSplitState = + gson.getDelegateAdapter(this, TypeToken.get(ConditionSplitState.class)); + final TypeAdapter adapterRandomSplitState = + gson.getDelegateAdapter(this, TypeToken.get(RandomSplitState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TransitionState value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `EventEntryState` + if (value.getActualInstance() instanceof EventEntryState) { + JsonElement element = + adapterEventEntryState.toJsonTree( + (EventEntryState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AudienceEntryState` + if (value.getActualInstance() instanceof AudienceEntryState) { + JsonElement element = + adapterAudienceEntryState.toJsonTree( + (AudienceEntryState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DestinationState` + if (value.getActualInstance() instanceof DestinationState) { + JsonElement element = + adapterDestinationState.toJsonTree( + (DestinationState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `SimpleDelayState` + if (value.getActualInstance() instanceof SimpleDelayState) { + JsonElement element = + adapterSimpleDelayState.toJsonTree( + (SimpleDelayState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `EventSplitWithTimeoutState` + if (value.getActualInstance() instanceof EventSplitWithTimeoutState) { + JsonElement element = + adapterEventSplitWithTimeoutState.toJsonTree( + (EventSplitWithTimeoutState) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ConditionSplitState` + if (value.getActualInstance() instanceof ConditionSplitState) { + JsonElement element = + adapterConditionSplitState.toJsonTree( + (ConditionSplitState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RandomSplitState` + if (value.getActualInstance() instanceof RandomSplitState) { + JsonElement element = + adapterRandomSplitState.toJsonTree( + (RandomSplitState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match oneOf schemas:" + + " AudienceEntryState, ConditionSplitState," + + " DestinationState, EventEntryState," + + " EventSplitWithTimeoutState, RandomSplitState," + + " SimpleDelayState"); + } + + @Override + public TransitionState read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize EventEntryState + try { + // validate the JSON object to see if any exception is thrown + EventEntryState.validateJsonElement(jsonElement); + actualAdapter = adapterEventEntryState; + match++; + log.log(Level.FINER, "Input data matches schema 'EventEntryState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for EventEntryState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'EventEntryState'", + e); + } + // deserialize AudienceEntryState + try { + // validate the JSON object to see if any exception is thrown + AudienceEntryState.validateJsonElement(jsonElement); + actualAdapter = adapterAudienceEntryState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'AudienceEntryState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudienceEntryState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'AudienceEntryState'", + e); + } + // deserialize DestinationState + try { + // validate the JSON object to see if any exception is thrown + DestinationState.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'DestinationState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationState'", + e); + } + // deserialize SimpleDelayState + try { + // validate the JSON object to see if any exception is thrown + SimpleDelayState.validateJsonElement(jsonElement); + actualAdapter = adapterSimpleDelayState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'SimpleDelayState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for SimpleDelayState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'SimpleDelayState'", + e); + } + // deserialize EventSplitWithTimeoutState + try { + // validate the JSON object to see if any exception is thrown + EventSplitWithTimeoutState.validateJsonElement(jsonElement); + actualAdapter = adapterEventSplitWithTimeoutState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'EventSplitWithTimeoutState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for EventSplitWithTimeoutState" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'EventSplitWithTimeoutState'", + e); + } + // deserialize ConditionSplitState + try { + // validate the JSON object to see if any exception is thrown + ConditionSplitState.validateJsonElement(jsonElement); + actualAdapter = adapterConditionSplitState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ConditionSplitState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ConditionSplitState failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ConditionSplitState'", + e); + } + // deserialize RandomSplitState + try { + // validate the JSON object to see if any exception is thrown + RandomSplitState.validateJsonElement(jsonElement); + actualAdapter = adapterRandomSplitState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'RandomSplitState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for RandomSplitState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'RandomSplitState'", + e); + } + + if (match == 1) { + TransitionState ret = new TransitionState(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException( + String.format( + "Failed deserialization for TransitionState: %d classes" + + " match result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", + match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public TransitionState() { + super("oneOf", Boolean.FALSE); + } + + public TransitionState(AudienceEntryState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionState(ConditionSplitState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionState(DestinationState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionState(EventEntryState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionState(EventSplitWithTimeoutState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionState(RandomSplitState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionState(SimpleDelayState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EventEntryState", EventEntryState.class); + schemas.put("AudienceEntryState", AudienceEntryState.class); + schemas.put("DestinationState", DestinationState.class); + schemas.put("SimpleDelayState", SimpleDelayState.class); + schemas.put("EventSplitWithTimeoutState", EventSplitWithTimeoutState.class); + schemas.put("ConditionSplitState", ConditionSplitState.class); + schemas.put("RandomSplitState", RandomSplitState.class); + } + + @Override + public Map> getSchemas() { + return TransitionState.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AudienceEntryState, ConditionSplitState, DestinationState, + * EventEntryState, EventSplitWithTimeoutState, RandomSplitState, SimpleDelayState + * + *

It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof EventEntryState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AudienceEntryState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DestinationState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SimpleDelayState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EventSplitWithTimeoutState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ConditionSplitState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RandomSplitState) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be AudienceEntryState, ConditionSplitState," + + " DestinationState, EventEntryState, EventSplitWithTimeoutState," + + " RandomSplitState, SimpleDelayState"); + } + + /** + * Get the actual instance, which can be the following: AudienceEntryState, ConditionSplitState, + * DestinationState, EventEntryState, EventSplitWithTimeoutState, RandomSplitState, + * SimpleDelayState + * + * @return The actual instance (AudienceEntryState, ConditionSplitState, DestinationState, + * EventEntryState, EventSplitWithTimeoutState, RandomSplitState, SimpleDelayState) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EventEntryState`. If the actual instance is not + * `EventEntryState`, the ClassCastException will be thrown. + * + * @return The actual instance of `EventEntryState` + * @throws ClassCastException if the instance is not `EventEntryState` + */ + public EventEntryState getEventEntryState() throws ClassCastException { + return (EventEntryState) super.getActualInstance(); + } + + /** + * Get the actual instance of `AudienceEntryState`. If the actual instance is not + * `AudienceEntryState`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudienceEntryState` + * @throws ClassCastException if the instance is not `AudienceEntryState` + */ + public AudienceEntryState getAudienceEntryState() throws ClassCastException { + return (AudienceEntryState) super.getActualInstance(); + } + + /** + * Get the actual instance of `DestinationState`. If the actual instance is not + * `DestinationState`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationState` + * @throws ClassCastException if the instance is not `DestinationState` + */ + public DestinationState getDestinationState() throws ClassCastException { + return (DestinationState) super.getActualInstance(); + } + + /** + * Get the actual instance of `SimpleDelayState`. If the actual instance is not + * `SimpleDelayState`, the ClassCastException will be thrown. + * + * @return The actual instance of `SimpleDelayState` + * @throws ClassCastException if the instance is not `SimpleDelayState` + */ + public SimpleDelayState getSimpleDelayState() throws ClassCastException { + return (SimpleDelayState) super.getActualInstance(); + } + + /** + * Get the actual instance of `EventSplitWithTimeoutState`. If the actual instance is not + * `EventSplitWithTimeoutState`, the ClassCastException will be thrown. + * + * @return The actual instance of `EventSplitWithTimeoutState` + * @throws ClassCastException if the instance is not `EventSplitWithTimeoutState` + */ + public EventSplitWithTimeoutState getEventSplitWithTimeoutState() throws ClassCastException { + return (EventSplitWithTimeoutState) super.getActualInstance(); + } + + /** + * Get the actual instance of `ConditionSplitState`. If the actual instance is not + * `ConditionSplitState`, the ClassCastException will be thrown. + * + * @return The actual instance of `ConditionSplitState` + * @throws ClassCastException if the instance is not `ConditionSplitState` + */ + public ConditionSplitState getConditionSplitState() throws ClassCastException { + return (ConditionSplitState) super.getActualInstance(); + } + + /** + * Get the actual instance of `RandomSplitState`. If the actual instance is not + * `RandomSplitState`, the ClassCastException will be thrown. + * + * @return The actual instance of `RandomSplitState` + * @throws ClassCastException if the instance is not `RandomSplitState` + */ + public RandomSplitState getRandomSplitState() throws ClassCastException { + return (RandomSplitState) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TransitionState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with EventEntryState + try { + EventEntryState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for EventEntryState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with AudienceEntryState + try { + AudienceEntryState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AudienceEntryState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with DestinationState + try { + DestinationState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with SimpleDelayState + try { + SimpleDelayState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for SimpleDelayState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with EventSplitWithTimeoutState + try { + EventSplitWithTimeoutState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for EventSplitWithTimeoutState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ConditionSplitState + try { + ConditionSplitState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ConditionSplitState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with RandomSplitState + try { + RandomSplitState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for RandomSplitState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException( + String.format( + "The JSON string is invalid for TransitionState with oneOf schemas:" + + " AudienceEntryState, ConditionSplitState, DestinationState," + + " EventEntryState, EventSplitWithTimeoutState, RandomSplitState," + + " SimpleDelayState. %d class(es) match the result, expected 1." + + " Detailed failure message for oneOf schemas: %s. JSON: %s", + validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of TransitionState given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransitionState + * @throws IOException if the JSON string is invalid with respect to TransitionState + */ + public static TransitionState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransitionState.class); + } + + /** + * Convert an instance of TransitionState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Transitions.java b/src/main/java/com/segment/publicapi/models/Transitions.java new file mode 100644 index 00000000..1bc607ee --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Transitions.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Transitions */ +public class Transitions { + public static final String SERIALIZED_NAME_NEXT = "next"; + + @SerializedName(SERIALIZED_NAME_NEXT) + private String next; + + public Transitions() {} + + public Transitions next(String next) { + + this.next = next; + return this; + } + + /** + * Get next + * + * @return next + */ + @javax.annotation.Nonnull + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transitions transitions = (Transitions) o; + return Objects.equals(this.next, transitions.next); + } + + @Override + public int hashCode() { + return Objects.hash(next); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transitions {\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("next"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Transitions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Transitions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Transitions is not found in the empty" + + " JSON string", + Transitions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Transitions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Transitions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Transitions.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `next` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Transitions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Transitions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Transitions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Transitions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Transitions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Transitions given an JSON string + * + * @param jsonString JSON string + * @return An instance of Transitions + * @throws IOException if the JSON string is invalid with respect to Transitions + */ + public static Transitions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Transitions.class); + } + + /** + * Convert an instance of Transitions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TransitionsInner.java b/src/main/java/com/segment/publicapi/models/TransitionsInner.java new file mode 100644 index 00000000..10574ddf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TransitionsInner.java @@ -0,0 +1,275 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class TransitionsInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TransitionsInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransitionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransitionsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterConditionBranch = + gson.getDelegateAdapter(this, TypeToken.get(ConditionBranch.class)); + final TypeAdapter adapterTimeOutBranch = + gson.getDelegateAdapter(this, TypeToken.get(TimeOutBranch.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TransitionsInner value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ConditionBranch` + if (value.getActualInstance() instanceof ConditionBranch) { + JsonElement element = + adapterConditionBranch.toJsonTree( + (ConditionBranch) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `TimeOutBranch` + if (value.getActualInstance() instanceof TimeOutBranch) { + JsonElement element = + adapterTimeOutBranch.toJsonTree( + (TimeOutBranch) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ConditionBranch, TimeOutBranch"); + } + + @Override + public TransitionsInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ConditionBranch + try { + // validate the JSON object to see if any exception is thrown + ConditionBranch.validateJsonElement(jsonElement); + actualAdapter = adapterConditionBranch; + TransitionsInner ret = new TransitionsInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ConditionBranch failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ConditionBranch'", + e); + } + // deserialize TimeOutBranch + try { + // validate the JSON object to see if any exception is thrown + TimeOutBranch.validateJsonElement(jsonElement); + actualAdapter = adapterTimeOutBranch; + TransitionsInner ret = new TransitionsInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for TimeOutBranch failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'TimeOutBranch'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for TransitionsInner: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public TransitionsInner() { + super("anyOf", Boolean.FALSE); + } + + public TransitionsInner(ConditionBranch o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionsInner(TimeOutBranch o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ConditionBranch", ConditionBranch.class); + schemas.put("TimeOutBranch", TimeOutBranch.class); + } + + @Override + public Map> getSchemas() { + return TransitionsInner.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ConditionBranch, TimeOutBranch + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ConditionBranch) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TimeOutBranch) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ConditionBranch, TimeOutBranch"); + } + + /** + * Get the actual instance, which can be the following: ConditionBranch, TimeOutBranch + * + * @return The actual instance (ConditionBranch, TimeOutBranch) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ConditionBranch`. If the actual instance is not + * `ConditionBranch`, the ClassCastException will be thrown. + * + * @return The actual instance of `ConditionBranch` + * @throws ClassCastException if the instance is not `ConditionBranch` + */ + public ConditionBranch getConditionBranch() throws ClassCastException { + return (ConditionBranch) super.getActualInstance(); + } + + /** + * Get the actual instance of `TimeOutBranch`. If the actual instance is not `TimeOutBranch`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TimeOutBranch` + * @throws ClassCastException if the instance is not `TimeOutBranch` + */ + public TimeOutBranch getTimeOutBranch() throws ClassCastException { + return (TimeOutBranch) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TransitionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ConditionBranch + try { + ConditionBranch.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ConditionBranch failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with TimeOutBranch + try { + TimeOutBranch.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for TimeOutBranch failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for TransitionsInner with anyOf schemas:" + + " ConditionBranch, TimeOutBranch. no class match the result, expected" + + " at least 1. Detailed failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of TransitionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransitionsInner + * @throws IOException if the JSON string is invalid with respect to TransitionsInner + */ + public static TransitionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransitionsInner.class); + } + + /** + * Convert an instance of TransitionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/TransitionsInner1.java b/src/main/java/com/segment/publicapi/models/TransitionsInner1.java new file mode 100644 index 00000000..4f0e55ed --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/TransitionsInner1.java @@ -0,0 +1,275 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class TransitionsInner1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TransitionsInner1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransitionsInner1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransitionsInner1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterConditionBranch = + gson.getDelegateAdapter(this, TypeToken.get(ConditionBranch.class)); + final TypeAdapter adapterDefaultBranch = + gson.getDelegateAdapter(this, TypeToken.get(DefaultBranch.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, TransitionsInner1 value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ConditionBranch` + if (value.getActualInstance() instanceof ConditionBranch) { + JsonElement element = + adapterConditionBranch.toJsonTree( + (ConditionBranch) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DefaultBranch` + if (value.getActualInstance() instanceof DefaultBranch) { + JsonElement element = + adapterDefaultBranch.toJsonTree( + (DefaultBranch) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ConditionBranch, DefaultBranch"); + } + + @Override + public TransitionsInner1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ConditionBranch + try { + // validate the JSON object to see if any exception is thrown + ConditionBranch.validateJsonElement(jsonElement); + actualAdapter = adapterConditionBranch; + TransitionsInner1 ret = new TransitionsInner1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ConditionBranch failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ConditionBranch'", + e); + } + // deserialize DefaultBranch + try { + // validate the JSON object to see if any exception is thrown + DefaultBranch.validateJsonElement(jsonElement); + actualAdapter = adapterDefaultBranch; + TransitionsInner1 ret = new TransitionsInner1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for DefaultBranch failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DefaultBranch'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for TransitionsInner1: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public TransitionsInner1() { + super("anyOf", Boolean.FALSE); + } + + public TransitionsInner1(ConditionBranch o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public TransitionsInner1(DefaultBranch o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ConditionBranch", ConditionBranch.class); + schemas.put("DefaultBranch", DefaultBranch.class); + } + + @Override + public Map> getSchemas() { + return TransitionsInner1.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ConditionBranch, DefaultBranch + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ConditionBranch) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DefaultBranch) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ConditionBranch, DefaultBranch"); + } + + /** + * Get the actual instance, which can be the following: ConditionBranch, DefaultBranch + * + * @return The actual instance (ConditionBranch, DefaultBranch) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ConditionBranch`. If the actual instance is not + * `ConditionBranch`, the ClassCastException will be thrown. + * + * @return The actual instance of `ConditionBranch` + * @throws ClassCastException if the instance is not `ConditionBranch` + */ + public ConditionBranch getConditionBranch() throws ClassCastException { + return (ConditionBranch) super.getActualInstance(); + } + + /** + * Get the actual instance of `DefaultBranch`. If the actual instance is not `DefaultBranch`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DefaultBranch` + * @throws ClassCastException if the instance is not `DefaultBranch` + */ + public DefaultBranch getDefaultBranch() throws ClassCastException { + return (DefaultBranch) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TransitionsInner1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ConditionBranch + try { + ConditionBranch.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ConditionBranch failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with DefaultBranch + try { + DefaultBranch.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for DefaultBranch failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for TransitionsInner1 with anyOf schemas:" + + " ConditionBranch, DefaultBranch. no class match the result, expected" + + " at least 1. Detailed failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of TransitionsInner1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransitionsInner1 + * @throws IOException if the JSON string is invalid with respect to TransitionsInner1 + */ + public static TransitionsInner1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransitionsInner1.class); + } + + /** + * Convert an instance of TransitionsInner1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java new file mode 100644 index 00000000..0705b968 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** UpdateDestinationsForJourney200Response */ +public class UpdateDestinationsForJourney200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateDestinationsForJourneyAlphaOutput data; + + public UpdateDestinationsForJourney200Response() {} + + public UpdateDestinationsForJourney200Response data( + UpdateDestinationsForJourneyAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public UpdateDestinationsForJourneyAlphaOutput getData() { + return data; + } + + public void setData(UpdateDestinationsForJourneyAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDestinationsForJourney200Response updateDestinationsForJourney200Response = + (UpdateDestinationsForJourney200Response) o; + return Objects.equals(this.data, updateDestinationsForJourney200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDestinationsForJourney200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateDestinationsForJourney200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateDestinationsForJourney200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateDestinationsForJourney200Response is not found in the" + + " empty JSON string", + UpdateDestinationsForJourney200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateDestinationsForJourney200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateDestinationsForJourney200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + UpdateDestinationsForJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateDestinationsForJourney200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateDestinationsForJourney200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateDestinationsForJourney200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateDestinationsForJourney200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateDestinationsForJourney200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateDestinationsForJourney200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateDestinationsForJourney200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateDestinationsForJourney200Response + */ + public static UpdateDestinationsForJourney200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateDestinationsForJourney200Response.class); + } + + /** + * Convert an instance of UpdateDestinationsForJourney200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java new file mode 100644 index 00000000..b7b196d3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java @@ -0,0 +1,241 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Update DESTINATIONS for a journey. */ +public class UpdateDestinationsForJourneyAlphaInput { + public static final String SERIALIZED_NAME_STATE_DESTINATIONS = "stateDestinations"; + + @SerializedName(SERIALIZED_NAME_STATE_DESTINATIONS) + private List stateDestinations = new ArrayList<>(); + + public UpdateDestinationsForJourneyAlphaInput() {} + + public UpdateDestinationsForJourneyAlphaInput stateDestinations( + List stateDestinations) { + + this.stateDestinations = stateDestinations; + return this; + } + + public UpdateDestinationsForJourneyAlphaInput addStateDestinationsItem( + UpdateDestinationsInput stateDestinationsItem) { + if (this.stateDestinations == null) { + this.stateDestinations = new ArrayList<>(); + } + this.stateDestinations.add(stateDestinationsItem); + return this; + } + + /** + * The updated DESTINATIONS. + * + * @return stateDestinations + */ + @javax.annotation.Nonnull + public List getStateDestinations() { + return stateDestinations; + } + + public void setStateDestinations(List stateDestinations) { + this.stateDestinations = stateDestinations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput = + (UpdateDestinationsForJourneyAlphaInput) o; + return Objects.equals( + this.stateDestinations, updateDestinationsForJourneyAlphaInput.stateDestinations); + } + + @Override + public int hashCode() { + return Objects.hash(stateDestinations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDestinationsForJourneyAlphaInput {\n"); + sb.append(" stateDestinations: ") + .append(toIndentedString(stateDestinations)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stateDestinations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stateDestinations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateDestinationsForJourneyAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateDestinationsForJourneyAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateDestinationsForJourneyAlphaInput" + + " is not found in the empty JSON string", + UpdateDestinationsForJourneyAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateDestinationsForJourneyAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateDestinationsForJourneyAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateDestinationsForJourneyAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stateDestinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stateDestinations` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("stateDestinations").toString())); + } + + JsonArray jsonArraystateDestinations = jsonObj.getAsJsonArray("stateDestinations"); + // validate the required field `stateDestinations` (array) + for (int i = 0; i < jsonArraystateDestinations.size(); i++) { + UpdateDestinationsInput.validateJsonElement(jsonArraystateDestinations.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateDestinationsForJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateDestinationsForJourneyAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateDestinationsForJourneyAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateDestinationsForJourneyAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateDestinationsForJourneyAlphaInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateDestinationsForJourneyAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateDestinationsForJourneyAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateDestinationsForJourneyAlphaInput + */ + public static UpdateDestinationsForJourneyAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateDestinationsForJourneyAlphaInput.class); + } + + /** + * Convert an instance of UpdateDestinationsForJourneyAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java new file mode 100644 index 00000000..5aa701c6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java @@ -0,0 +1,306 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** DESTINATION update response. */ +public class UpdateDestinationsForJourneyAlphaOutput { + public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_ID) + private String containerId; + + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; + + public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; + + @SerializedName(SERIALIZED_NAME_DESTINATIONS) + private List destinations = new ArrayList<>(); + + public UpdateDestinationsForJourneyAlphaOutput() {} + + public UpdateDestinationsForJourneyAlphaOutput containerId(String containerId) { + + this.containerId = containerId; + return this; + } + + /** + * The journey container id. + * + * @return containerId + */ + @javax.annotation.Nonnull + public String getContainerId() { + return containerId; + } + + public void setContainerId(String containerId) { + this.containerId = containerId; + } + + public UpdateDestinationsForJourneyAlphaOutput version(BigDecimal version) { + + this.version = version; + return this; + } + + /** + * The version of journey. + * + * @return version + */ + @javax.annotation.Nullable + public BigDecimal getVersion() { + return version; + } + + public void setVersion(BigDecimal version) { + this.version = version; + } + + public UpdateDestinationsForJourneyAlphaOutput destinations( + List destinations) { + + this.destinations = destinations; + return this; + } + + public UpdateDestinationsForJourneyAlphaOutput addDestinationsItem( + DestinationState destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * The updated DESTINATIONS. + * + * @return destinations + */ + @javax.annotation.Nonnull + public List getDestinations() { + return destinations; + } + + public void setDestinations(List destinations) { + this.destinations = destinations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDestinationsForJourneyAlphaOutput updateDestinationsForJourneyAlphaOutput = + (UpdateDestinationsForJourneyAlphaOutput) o; + return Objects.equals(this.containerId, updateDestinationsForJourneyAlphaOutput.containerId) + && Objects.equals(this.version, updateDestinationsForJourneyAlphaOutput.version) + && Objects.equals( + this.destinations, updateDestinationsForJourneyAlphaOutput.destinations); + } + + @Override + public int hashCode() { + return Objects.hash(containerId, version, destinations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDestinationsForJourneyAlphaOutput {\n"); + sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("containerId"); + openapiFields.add("version"); + openapiFields.add("destinations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("containerId"); + openapiRequiredFields.add("destinations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateDestinationsForJourneyAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateDestinationsForJourneyAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UpdateDestinationsForJourneyAlphaOutput is not found in the" + + " empty JSON string", + UpdateDestinationsForJourneyAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateDestinationsForJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateDestinationsForJourneyAlphaOutput` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateDestinationsForJourneyAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("containerId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `containerId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("containerId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("destinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("destinations").toString())); + } + + JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); + // validate the required field `destinations` (array) + for (int i = 0; i < jsonArraydestinations.size(); i++) { + DestinationState.validateJsonElement(jsonArraydestinations.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateDestinationsForJourneyAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UpdateDestinationsForJourneyAlphaOutput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateDestinationsForJourneyAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateDestinationsForJourneyAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateDestinationsForJourneyAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateDestinationsForJourneyAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateDestinationsForJourneyAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateDestinationsForJourneyAlphaOutput + */ + public static UpdateDestinationsForJourneyAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateDestinationsForJourneyAlphaOutput.class); + } + + /** + * Convert an instance of UpdateDestinationsForJourneyAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java new file mode 100644 index 00000000..acdcbe50 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java @@ -0,0 +1,263 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The DESTINATION and state combination. */ +public class UpdateDestinationsInput { + public static final String SERIALIZED_NAME_STATE_ID = "stateId"; + + @SerializedName(SERIALIZED_NAME_STATE_ID) + private String stateId; + + public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; + + @SerializedName(SERIALIZED_NAME_DESTINATIONS) + private List destinations = new ArrayList<>(); + + public UpdateDestinationsInput() {} + + public UpdateDestinationsInput stateId(String stateId) { + + this.stateId = stateId; + return this; + } + + /** + * Id of the DESTINATION state. + * + * @return stateId + */ + @javax.annotation.Nonnull + public String getStateId() { + return stateId; + } + + public void setStateId(String stateId) { + this.stateId = stateId; + } + + public UpdateDestinationsInput destinations(List destinations) { + + this.destinations = destinations; + return this; + } + + public UpdateDestinationsInput addDestinationsItem(Destination destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * The DESTINATIONS to be replaced. + * + * @return destinations + */ + @javax.annotation.Nonnull + public List getDestinations() { + return destinations; + } + + public void setDestinations(List destinations) { + this.destinations = destinations; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateDestinationsInput updateDestinationsInput = (UpdateDestinationsInput) o; + return Objects.equals(this.stateId, updateDestinationsInput.stateId) + && Objects.equals(this.destinations, updateDestinationsInput.destinations); + } + + @Override + public int hashCode() { + return Objects.hash(stateId, destinations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateDestinationsInput {\n"); + sb.append(" stateId: ").append(toIndentedString(stateId)).append("\n"); + sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stateId"); + openapiFields.add("destinations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stateId"); + openapiRequiredFields.add("destinations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateDestinationsInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateDestinationsInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateDestinationsInput is not found" + + " in the empty JSON string", + UpdateDestinationsInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateDestinationsInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateDestinationsInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateDestinationsInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("stateId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `stateId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("stateId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("destinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("destinations").toString())); + } + + JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); + // validate the required field `destinations` (array) + for (int i = 0; i < jsonArraydestinations.size(); i++) { + Destination.validateJsonElement(jsonArraydestinations.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateDestinationsInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateDestinationsInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(UpdateDestinationsInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateDestinationsInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateDestinationsInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateDestinationsInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateDestinationsInput + * @throws IOException if the JSON string is invalid with respect to UpdateDestinationsInput + */ + public static UpdateDestinationsInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateDestinationsInput.class); + } + + /** + * Convert an instance of UpdateDestinationsInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java new file mode 100644 index 00000000..31daf626 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java @@ -0,0 +1,200 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** UpdateStatusForJourney200Response */ +public class UpdateStatusForJourney200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateStatusForJourneyAlphaOutput data; + + public UpdateStatusForJourney200Response() {} + + public UpdateStatusForJourney200Response data(UpdateStatusForJourneyAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public UpdateStatusForJourneyAlphaOutput getData() { + return data; + } + + public void setData(UpdateStatusForJourneyAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateStatusForJourney200Response updateStatusForJourney200Response = + (UpdateStatusForJourney200Response) o; + return Objects.equals(this.data, updateStatusForJourney200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateStatusForJourney200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateStatusForJourney200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateStatusForJourney200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateStatusForJourney200Response is" + + " not found in the empty JSON string", + UpdateStatusForJourney200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateStatusForJourney200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateStatusForJourney200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + UpdateStatusForJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateStatusForJourney200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateStatusForJourney200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateStatusForJourney200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateStatusForJourney200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateStatusForJourney200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateStatusForJourney200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateStatusForJourney200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateStatusForJourney200Response + */ + public static UpdateStatusForJourney200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateStatusForJourney200Response.class); + } + + /** + * Convert an instance of UpdateStatusForJourney200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java new file mode 100644 index 00000000..44422535 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java @@ -0,0 +1,292 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Update journey status input. */ +public class UpdateStatusForJourneyAlphaInput { + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; + + /** The action to perform for the journey. */ + @JsonAdapter(ActionEnum.Adapter.class) + public enum ActionEnum { + ARCHIVE("ARCHIVE"), + + PAUSE_ENTRY("PAUSE_ENTRY"), + + PUBLISH("PUBLISH"); + + private String value; + + ActionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActionEnum fromValue(String value) { + for (ActionEnum b : ActionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActionEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACTION = "action"; + + @SerializedName(SERIALIZED_NAME_ACTION) + private ActionEnum action; + + public UpdateStatusForJourneyAlphaInput() {} + + public UpdateStatusForJourneyAlphaInput version(BigDecimal version) { + + this.version = version; + return this; + } + + /** + * The journey version. + * + * @return version + */ + @javax.annotation.Nonnull + public BigDecimal getVersion() { + return version; + } + + public void setVersion(BigDecimal version) { + this.version = version; + } + + public UpdateStatusForJourneyAlphaInput action(ActionEnum action) { + + this.action = action; + return this; + } + + /** + * The action to perform for the journey. + * + * @return action + */ + @javax.annotation.Nonnull + public ActionEnum getAction() { + return action; + } + + public void setAction(ActionEnum action) { + this.action = action; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput = + (UpdateStatusForJourneyAlphaInput) o; + return Objects.equals(this.version, updateStatusForJourneyAlphaInput.version) + && Objects.equals(this.action, updateStatusForJourneyAlphaInput.action); + } + + @Override + public int hashCode() { + return Objects.hash(version, action); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateStatusForJourneyAlphaInput {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + openapiFields.add("action"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateStatusForJourneyAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateStatusForJourneyAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateStatusForJourneyAlphaInput is" + + " not found in the empty JSON string", + UpdateStatusForJourneyAlphaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateStatusForJourneyAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateStatusForJourneyAlphaInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateStatusForJourneyAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `action` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("action").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateStatusForJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateStatusForJourneyAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateStatusForJourneyAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateStatusForJourneyAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateStatusForJourneyAlphaInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateStatusForJourneyAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateStatusForJourneyAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateStatusForJourneyAlphaInput + */ + public static UpdateStatusForJourneyAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateStatusForJourneyAlphaInput.class); + } + + /** + * Convert an instance of UpdateStatusForJourneyAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java new file mode 100644 index 00000000..112375bc --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java @@ -0,0 +1,329 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Update journey status output. */ +public class UpdateStatusForJourneyAlphaOutput { + public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; + + @SerializedName(SERIALIZED_NAME_CONTAINER_ID) + private String containerId; + + public static final String SERIALIZED_NAME_VERSION = "version"; + + @SerializedName(SERIALIZED_NAME_VERSION) + private BigDecimal version; + + /** The status of the journey. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ARCHIVED("ARCHIVED"), + + ENTRY_PAUSED("ENTRY_PAUSED"), + + PUBLISHED("PUBLISHED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public UpdateStatusForJourneyAlphaOutput() {} + + public UpdateStatusForJourneyAlphaOutput containerId(String containerId) { + + this.containerId = containerId; + return this; + } + + /** + * The journey container id. + * + * @return containerId + */ + @javax.annotation.Nonnull + public String getContainerId() { + return containerId; + } + + public void setContainerId(String containerId) { + this.containerId = containerId; + } + + public UpdateStatusForJourneyAlphaOutput version(BigDecimal version) { + + this.version = version; + return this; + } + + /** + * The journey version. + * + * @return version + */ + @javax.annotation.Nonnull + public BigDecimal getVersion() { + return version; + } + + public void setVersion(BigDecimal version) { + this.version = version; + } + + public UpdateStatusForJourneyAlphaOutput status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the journey. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateStatusForJourneyAlphaOutput updateStatusForJourneyAlphaOutput = + (UpdateStatusForJourneyAlphaOutput) o; + return Objects.equals(this.containerId, updateStatusForJourneyAlphaOutput.containerId) + && Objects.equals(this.version, updateStatusForJourneyAlphaOutput.version) + && Objects.equals(this.status, updateStatusForJourneyAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(containerId, version, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateStatusForJourneyAlphaOutput {\n"); + sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("containerId"); + openapiFields.add("version"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("containerId"); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateStatusForJourneyAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateStatusForJourneyAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateStatusForJourneyAlphaOutput is" + + " not found in the empty JSON string", + UpdateStatusForJourneyAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateStatusForJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateStatusForJourneyAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateStatusForJourneyAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("containerId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `containerId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("containerId").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateStatusForJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateStatusForJourneyAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateStatusForJourneyAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateStatusForJourneyAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateStatusForJourneyAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateStatusForJourneyAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateStatusForJourneyAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateStatusForJourneyAlphaOutput + */ + public static UpdateStatusForJourneyAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateStatusForJourneyAlphaOutput.class); + } + + /** + * Convert an instance of UpdateStatusForJourneyAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 0bb2f6c9bb10f35cdb622c747ca9ea97dfb6ffc0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Mar 2025 06:57:01 +0000 Subject: [PATCH 398/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@979cf97e. --- src/main/java/com/segment/publicapi/JSON.java | 8 +- .../publicapi/models/AudienceExitRule.java | 75 ++-- .../segment/publicapi/models/BaseState.java | 85 ++++- .../publicapi/models/DestinationsInner.java | 277 ++++++++++++++ .../publicapi/models/EventExitRule.java | 68 ++-- .../models/ExitDestinationState.java | 338 ++++++++++++++++++ .../segment/publicapi/models/ExitRule.java | 69 ++-- .../publicapi/models/ExitRulesConfig.java | 113 ++++-- .../publicapi/models/RandomSplitState.java | 2 + .../{StatesInner.java => RulesInner.java} | 124 ++----- ...dateDestinationsForJourneyAlphaOutput.java | 12 +- 11 files changed, 919 insertions(+), 252 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/DestinationsInner.java create mode 100644 src/main/java/com/segment/publicapi/models/ExitDestinationState.java rename src/main/java/com/segment/publicapi/models/{StatesInner.java => RulesInner.java} (67%) diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index dbfdc4bd..7aab0bbe 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -620,6 +620,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DisableEdgeFunctions200Response .CustomTypeAdapterFactory()); @@ -647,6 +649,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSplitWithTimeoutState .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ExitDestinationState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ExitRule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1462,6 +1466,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RulesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SimpleDelayState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1488,8 +1494,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.StatesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StepLevelAnalytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/models/AudienceExitRule.java b/src/main/java/com/segment/publicapi/models/AudienceExitRule.java index 20b346b9..0439cc0c 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceExitRule.java +++ b/src/main/java/com/segment/publicapi/models/AudienceExitRule.java @@ -12,7 +12,6 @@ package com.segment.publicapi.models; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -146,10 +145,10 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) private Boolean concurrencyEnabled; - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + public static final String SERIALIZED_NAME_CONNECTED_DESTINATIONS = "connectedDestinations"; - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions; + @SerializedName(SERIALIZED_NAME_CONNECTED_DESTINATIONS) + private List connectedDestinations; public static final String SERIALIZED_NAME_KEY = "key"; @@ -258,32 +257,32 @@ public void setConcurrencyEnabled(Boolean concurrencyEnabled) { this.concurrencyEnabled = concurrencyEnabled; } - public AudienceExitRule transitions(List transitions) { + public AudienceExitRule connectedDestinations(List connectedDestinations) { - this.transitions = transitions; + this.connectedDestinations = connectedDestinations; return this; } - public AudienceExitRule addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); + public AudienceExitRule addConnectedDestinationsItem(String connectedDestinationsItem) { + if (this.connectedDestinations == null) { + this.connectedDestinations = new ArrayList<>(); } - this.transitions.add(transitionsItem); + this.connectedDestinations.add(connectedDestinationsItem); return this; } /** - * Get transitions + * Get connectedDestinations * - * @return transitions + * @return connectedDestinations */ @javax.annotation.Nullable - public List getTransitions() { - return transitions; + public List getConnectedDestinations() { + return connectedDestinations; } - public void setTransitions(List transitions) { - this.transitions = transitions; + public void setConnectedDestinations(List connectedDestinations) { + this.connectedDestinations = connectedDestinations; } public AudienceExitRule key(Key key) { @@ -320,14 +319,21 @@ public boolean equals(Object o) { && Objects.equals(this.type, audienceExitRule.type) && Objects.equals(this.enabled, audienceExitRule.enabled) && Objects.equals(this.concurrencyEnabled, audienceExitRule.concurrencyEnabled) - && Objects.equals(this.transitions, audienceExitRule.transitions) + && Objects.equals( + this.connectedDestinations, audienceExitRule.connectedDestinations) && Objects.equals(this.key, audienceExitRule.key); } @Override public int hashCode() { return Objects.hash( - exitType, audienceId, type, enabled, concurrencyEnabled, transitions, key); + exitType, + audienceId, + type, + enabled, + concurrencyEnabled, + connectedDestinations, + key); } @Override @@ -341,7 +347,9 @@ public String toString() { sb.append(" concurrencyEnabled: ") .append(toIndentedString(concurrencyEnabled)) .append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" connectedDestinations: ") + .append(toIndentedString(connectedDestinations)) + .append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append("}"); return sb.toString(); @@ -369,7 +377,7 @@ private String toIndentedString(Object o) { openapiFields.add("type"); openapiFields.add("enabled"); openapiFields.add("concurrencyEnabled"); - openapiFields.add("transitions"); + openapiFields.add("connectedDestinations"); openapiFields.add("key"); // a set of required properties/fields (JSON key names) @@ -443,24 +451,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("type").toString())); } - if (jsonObj.get("transitions") != null && !jsonObj.get("transitions").isJsonNull()) { - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - if (jsonArraytransitions != null) { - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("transitions").toString())); - } - - // validate the optional field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - } + // ensure the optional json data is an array if present + if (jsonObj.get("connectedDestinations") != null + && !jsonObj.get("connectedDestinations").isJsonNull() + && !jsonObj.get("connectedDestinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `connectedDestinations` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("connectedDestinations").toString())); } // validate the required field `key` Key.validateJsonElement(jsonObj.get("key")); diff --git a/src/main/java/com/segment/publicapi/models/BaseState.java b/src/main/java/com/segment/publicapi/models/BaseState.java index 3d5d4e3b..c24e92ea 100644 --- a/src/main/java/com/segment/publicapi/models/BaseState.java +++ b/src/main/java/com/segment/publicapi/models/BaseState.java @@ -41,6 +41,8 @@ public TypeAdapter create(Gson gson, TypeToken type) { gson.getDelegateAdapter(this, TypeToken.get(TransitionState.class)); final TypeAdapter adapterExitState = gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); + final TypeAdapter adapterExitDestinationState = + gson.getDelegateAdapter(this, TypeToken.get(ExitDestinationState.class)); final TypeAdapter adapterExitRule = gson.getDelegateAdapter(this, TypeToken.get(ExitRule.class)); @@ -69,6 +71,14 @@ public void write(JsonWriter out, BaseState value) throws IOException { elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `ExitDestinationState` + if (value.getActualInstance() instanceof ExitDestinationState) { + JsonElement element = + adapterExitDestinationState.toJsonTree( + (ExitDestinationState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } // check if the actual instance is of the type `ExitRule` if (value.getActualInstance() instanceof ExitRule) { JsonElement element = @@ -79,7 +89,8 @@ public void write(JsonWriter out, BaseState value) throws IOException { } throw new IOException( "Failed to serialize as the type doesn't match oneOf schemas:" - + " ExitRule, ExitState, TransitionState"); + + " ExitDestinationState, ExitRule, ExitState," + + " TransitionState"); } @Override @@ -128,6 +139,27 @@ public BaseState read(JsonReader in) throws IOException { "Input data does not match schema 'ExitState'", e); } + // deserialize ExitDestinationState + try { + // validate the JSON object to see if any exception is thrown + ExitDestinationState.validateJsonElement(jsonElement); + actualAdapter = adapterExitDestinationState; + match++; + log.log( + Level.FINER, + "Input data matches schema 'ExitDestinationState'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExitDestinationState failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExitDestinationState'", + e); + } // deserialize ExitRule try { // validate the JSON object to see if any exception is thrown @@ -171,6 +203,11 @@ public BaseState() { super("oneOf", Boolean.FALSE); } + public BaseState(ExitDestinationState o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public BaseState(ExitRule o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -189,6 +226,7 @@ public BaseState(TransitionState o) { static { schemas.put("TransitionState", TransitionState.class); schemas.put("ExitState", ExitState.class); + schemas.put("ExitDestinationState", ExitDestinationState.class); schemas.put("ExitRule", ExitRule.class); } @@ -199,7 +237,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: ExitRule, ExitState, TransitionState + * against the oneOf child schemas: ExitDestinationState, ExitRule, ExitState, TransitionState * *

It could be an instance of the 'oneOf' schemas. */ @@ -215,19 +253,26 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof ExitDestinationState) { + super.setActualInstance(instance); + return; + } + if (instance instanceof ExitRule) { super.setActualInstance(instance); return; } throw new RuntimeException( - "Invalid instance type. Must be ExitRule, ExitState, TransitionState"); + "Invalid instance type. Must be ExitDestinationState, ExitRule, ExitState," + + " TransitionState"); } /** - * Get the actual instance, which can be the following: ExitRule, ExitState, TransitionState + * Get the actual instance, which can be the following: ExitDestinationState, ExitRule, + * ExitState, TransitionState * - * @return The actual instance (ExitRule, ExitState, TransitionState) + * @return The actual instance (ExitDestinationState, ExitRule, ExitState, TransitionState) */ @Override public Object getActualInstance() { @@ -256,6 +301,17 @@ public ExitState getExitState() throws ClassCastException { return (ExitState) super.getActualInstance(); } + /** + * Get the actual instance of `ExitDestinationState`. If the actual instance is not + * `ExitDestinationState`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExitDestinationState` + * @throws ClassCastException if the instance is not `ExitDestinationState` + */ + public ExitDestinationState getExitDestinationState() throws ClassCastException { + return (ExitDestinationState) super.getActualInstance(); + } + /** * Get the actual instance of `ExitRule`. If the actual instance is not `ExitRule`, the * ClassCastException will be thrown. @@ -298,6 +354,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti "Deserialization for ExitState failed with `%s`.", e.getMessage())); // continue to the next one } + // validate the json string with ExitDestinationState + try { + ExitDestinationState.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExitDestinationState failed with `%s`.", + e.getMessage())); + // continue to the next one + } // validate the json string with ExitRule try { ExitRule.validateJsonElement(jsonElement); @@ -311,10 +378,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (validCount != 1) { throw new IOException( String.format( - "The JSON string is invalid for BaseState with oneOf schemas: ExitRule," - + " ExitState, TransitionState. %d class(es) match the result," - + " expected 1. Detailed failure message for oneOf schemas: %s." - + " JSON: %s", + "The JSON string is invalid for BaseState with oneOf schemas:" + + " ExitDestinationState, ExitRule, ExitState, TransitionState. %d" + + " class(es) match the result, expected 1. Detailed failure" + + " message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/com/segment/publicapi/models/DestinationsInner.java b/src/main/java/com/segment/publicapi/models/DestinationsInner.java new file mode 100644 index 00000000..1bcc26b2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DestinationsInner.java @@ -0,0 +1,277 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class DestinationsInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(DestinationsInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterDestinationState = + gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); + final TypeAdapter adapterExitDestinationState = + gson.getDelegateAdapter(this, TypeToken.get(ExitDestinationState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationsInner value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `DestinationState` + if (value.getActualInstance() instanceof DestinationState) { + JsonElement element = + adapterDestinationState.toJsonTree( + (DestinationState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ExitDestinationState` + if (value.getActualInstance() instanceof ExitDestinationState) { + JsonElement element = + adapterExitDestinationState.toJsonTree( + (ExitDestinationState) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " DestinationState, ExitDestinationState"); + } + + @Override + public DestinationsInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize DestinationState + try { + // validate the JSON object to see if any exception is thrown + DestinationState.validateJsonElement(jsonElement); + actualAdapter = adapterDestinationState; + DestinationsInner ret = new DestinationsInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with" + + " `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'DestinationState'", + e); + } + // deserialize ExitDestinationState + try { + // validate the JSON object to see if any exception is thrown + ExitDestinationState.validateJsonElement(jsonElement); + actualAdapter = adapterExitDestinationState; + DestinationsInner ret = new DestinationsInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ExitDestinationState failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'ExitDestinationState'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for DestinationsInner: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public DestinationsInner() { + super("anyOf", Boolean.FALSE); + } + + public DestinationsInner(DestinationState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public DestinationsInner(ExitDestinationState o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("DestinationState", DestinationState.class); + schemas.put("ExitDestinationState", ExitDestinationState.class); + } + + @Override + public Map> getSchemas() { + return DestinationsInner.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: DestinationState, ExitDestinationState + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof DestinationState) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ExitDestinationState) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be DestinationState, ExitDestinationState"); + } + + /** + * Get the actual instance, which can be the following: DestinationState, ExitDestinationState + * + * @return The actual instance (DestinationState, ExitDestinationState) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `DestinationState`. If the actual instance is not + * `DestinationState`, the ClassCastException will be thrown. + * + * @return The actual instance of `DestinationState` + * @throws ClassCastException if the instance is not `DestinationState` + */ + public DestinationState getDestinationState() throws ClassCastException { + return (DestinationState) super.getActualInstance(); + } + + /** + * Get the actual instance of `ExitDestinationState`. If the actual instance is not + * `ExitDestinationState`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExitDestinationState` + * @throws ClassCastException if the instance is not `ExitDestinationState` + */ + public ExitDestinationState getExitDestinationState() throws ClassCastException { + return (ExitDestinationState) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with DestinationState + try { + DestinationState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for DestinationState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ExitDestinationState + try { + ExitDestinationState.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ExitDestinationState failed with `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for DestinationsInner with anyOf schemas:" + + " DestinationState, ExitDestinationState. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of DestinationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationsInner + * @throws IOException if the JSON string is invalid with respect to DestinationsInner + */ + public static DestinationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationsInner.class); + } + + /** + * Convert an instance of DestinationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/EventExitRule.java b/src/main/java/com/segment/publicapi/models/EventExitRule.java index ef7a8261..67e7344e 100644 --- a/src/main/java/com/segment/publicapi/models/EventExitRule.java +++ b/src/main/java/com/segment/publicapi/models/EventExitRule.java @@ -12,7 +12,6 @@ package com.segment.publicapi.models; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -146,10 +145,10 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) private Boolean concurrencyEnabled; - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + public static final String SERIALIZED_NAME_CONNECTED_DESTINATIONS = "connectedDestinations"; - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions; + @SerializedName(SERIALIZED_NAME_CONNECTED_DESTINATIONS) + private List connectedDestinations; public static final String SERIALIZED_NAME_KEY = "key"; @@ -258,32 +257,32 @@ public void setConcurrencyEnabled(Boolean concurrencyEnabled) { this.concurrencyEnabled = concurrencyEnabled; } - public EventExitRule transitions(List transitions) { + public EventExitRule connectedDestinations(List connectedDestinations) { - this.transitions = transitions; + this.connectedDestinations = connectedDestinations; return this; } - public EventExitRule addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); + public EventExitRule addConnectedDestinationsItem(String connectedDestinationsItem) { + if (this.connectedDestinations == null) { + this.connectedDestinations = new ArrayList<>(); } - this.transitions.add(transitionsItem); + this.connectedDestinations.add(connectedDestinationsItem); return this; } /** - * Get transitions + * Get connectedDestinations * - * @return transitions + * @return connectedDestinations */ @javax.annotation.Nullable - public List getTransitions() { - return transitions; + public List getConnectedDestinations() { + return connectedDestinations; } - public void setTransitions(List transitions) { - this.transitions = transitions; + public void setConnectedDestinations(List connectedDestinations) { + this.connectedDestinations = connectedDestinations; } public EventExitRule key(Key key) { @@ -320,14 +319,14 @@ public boolean equals(Object o) { && Objects.equals(this.type, eventExitRule.type) && Objects.equals(this.enabled, eventExitRule.enabled) && Objects.equals(this.concurrencyEnabled, eventExitRule.concurrencyEnabled) - && Objects.equals(this.transitions, eventExitRule.transitions) + && Objects.equals(this.connectedDestinations, eventExitRule.connectedDestinations) && Objects.equals(this.key, eventExitRule.key); } @Override public int hashCode() { return Objects.hash( - exitType, condition, type, enabled, concurrencyEnabled, transitions, key); + exitType, condition, type, enabled, concurrencyEnabled, connectedDestinations, key); } @Override @@ -341,7 +340,9 @@ public String toString() { sb.append(" concurrencyEnabled: ") .append(toIndentedString(concurrencyEnabled)) .append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" connectedDestinations: ") + .append(toIndentedString(connectedDestinations)) + .append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append("}"); return sb.toString(); @@ -369,7 +370,7 @@ private String toIndentedString(Object o) { openapiFields.add("type"); openapiFields.add("enabled"); openapiFields.add("concurrencyEnabled"); - openapiFields.add("transitions"); + openapiFields.add("connectedDestinations"); openapiFields.add("key"); // a set of required properties/fields (JSON key names) @@ -443,24 +444,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("type").toString())); } - if (jsonObj.get("transitions") != null && !jsonObj.get("transitions").isJsonNull()) { - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - if (jsonArraytransitions != null) { - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("transitions").toString())); - } - - // validate the optional field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - } + // ensure the optional json data is an array if present + if (jsonObj.get("connectedDestinations") != null + && !jsonObj.get("connectedDestinations").isJsonNull() + && !jsonObj.get("connectedDestinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `connectedDestinations` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("connectedDestinations").toString())); } // validate the required field `key` Key.validateJsonElement(jsonObj.get("key")); diff --git a/src/main/java/com/segment/publicapi/models/ExitDestinationState.java b/src/main/java/com/segment/publicapi/models/ExitDestinationState.java new file mode 100644 index 00000000..17f9b323 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ExitDestinationState.java @@ -0,0 +1,338 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ExitDestinationState */ +public class ExitDestinationState { + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + DESTINATION("DESTINATION"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; + + @SerializedName(SERIALIZED_NAME_DESTINATIONS) + private List destinations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private Key key; + + public ExitDestinationState() {} + + public ExitDestinationState type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + public ExitDestinationState destinations(List destinations) { + + this.destinations = destinations; + return this; + } + + public ExitDestinationState addDestinationsItem(Destination destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * Get destinations + * + * @return destinations + */ + @javax.annotation.Nonnull + public List getDestinations() { + return destinations; + } + + public void setDestinations(List destinations) { + this.destinations = destinations; + } + + public ExitDestinationState key(Key key) { + + this.key = key; + return this; + } + + /** + * Get key + * + * @return key + */ + @javax.annotation.Nonnull + public Key getKey() { + return key; + } + + public void setKey(Key key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExitDestinationState exitDestinationState = (ExitDestinationState) o; + return Objects.equals(this.type, exitDestinationState.type) + && Objects.equals(this.destinations, exitDestinationState.destinations) + && Objects.equals(this.key, exitDestinationState.key); + } + + @Override + public int hashCode() { + return Objects.hash(type, destinations, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExitDestinationState {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("destinations"); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("destinations"); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExitDestinationState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExitDestinationState.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ExitDestinationState is not found in" + + " the empty JSON string", + ExitDestinationState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExitDestinationState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ExitDestinationState` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ExitDestinationState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("destinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinations` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("destinations").toString())); + } + + JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); + // validate the required field `destinations` (array) + for (int i = 0; i < jsonArraydestinations.size(); i++) { + Destination.validateJsonElement(jsonArraydestinations.get(i)); + } + ; + // validate the required field `key` + Key.validateJsonElement(jsonObj.get("key")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExitDestinationState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExitDestinationState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ExitDestinationState.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ExitDestinationState value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExitDestinationState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ExitDestinationState given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExitDestinationState + * @throws IOException if the JSON string is invalid with respect to ExitDestinationState + */ + public static ExitDestinationState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExitDestinationState.class); + } + + /** + * Convert an instance of ExitDestinationState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ExitRule.java b/src/main/java/com/segment/publicapi/models/ExitRule.java index d76a472a..9e27131c 100644 --- a/src/main/java/com/segment/publicapi/models/ExitRule.java +++ b/src/main/java/com/segment/publicapi/models/ExitRule.java @@ -12,7 +12,6 @@ package com.segment.publicapi.models; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -145,10 +144,10 @@ public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) private Boolean concurrencyEnabled; - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; + public static final String SERIALIZED_NAME_CONNECTED_DESTINATIONS = "connectedDestinations"; - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions; + @SerializedName(SERIALIZED_NAME_CONNECTED_DESTINATIONS) + private List connectedDestinations; public static final String SERIALIZED_NAME_KEY = "key"; @@ -237,32 +236,32 @@ public void setConcurrencyEnabled(Boolean concurrencyEnabled) { this.concurrencyEnabled = concurrencyEnabled; } - public ExitRule transitions(List transitions) { + public ExitRule connectedDestinations(List connectedDestinations) { - this.transitions = transitions; + this.connectedDestinations = connectedDestinations; return this; } - public ExitRule addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); + public ExitRule addConnectedDestinationsItem(String connectedDestinationsItem) { + if (this.connectedDestinations == null) { + this.connectedDestinations = new ArrayList<>(); } - this.transitions.add(transitionsItem); + this.connectedDestinations.add(connectedDestinationsItem); return this; } /** - * Get transitions + * Get connectedDestinations * - * @return transitions + * @return connectedDestinations */ @javax.annotation.Nullable - public List getTransitions() { - return transitions; + public List getConnectedDestinations() { + return connectedDestinations; } - public void setTransitions(List transitions) { - this.transitions = transitions; + public void setConnectedDestinations(List connectedDestinations) { + this.connectedDestinations = connectedDestinations; } public ExitRule key(Key key) { @@ -298,13 +297,14 @@ public boolean equals(Object o) { && Objects.equals(this.exitType, exitRule.exitType) && Objects.equals(this.enabled, exitRule.enabled) && Objects.equals(this.concurrencyEnabled, exitRule.concurrencyEnabled) - && Objects.equals(this.transitions, exitRule.transitions) + && Objects.equals(this.connectedDestinations, exitRule.connectedDestinations) && Objects.equals(this.key, exitRule.key); } @Override public int hashCode() { - return Objects.hash(type, exitType, enabled, concurrencyEnabled, transitions, key); + return Objects.hash( + type, exitType, enabled, concurrencyEnabled, connectedDestinations, key); } @Override @@ -317,7 +317,9 @@ public String toString() { sb.append(" concurrencyEnabled: ") .append(toIndentedString(concurrencyEnabled)) .append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); + sb.append(" connectedDestinations: ") + .append(toIndentedString(connectedDestinations)) + .append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append("}"); return sb.toString(); @@ -344,7 +346,7 @@ private String toIndentedString(Object o) { openapiFields.add("exitType"); openapiFields.add("enabled"); openapiFields.add("concurrencyEnabled"); - openapiFields.add("transitions"); + openapiFields.add("connectedDestinations"); openapiFields.add("key"); // a set of required properties/fields (JSON key names) @@ -410,24 +412,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("exitType").toString())); } - if (jsonObj.get("transitions") != null && !jsonObj.get("transitions").isJsonNull()) { - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - if (jsonArraytransitions != null) { - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("transitions").toString())); - } - - // validate the optional field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - } + // ensure the optional json data is an array if present + if (jsonObj.get("connectedDestinations") != null + && !jsonObj.get("connectedDestinations").isJsonNull() + && !jsonObj.get("connectedDestinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `connectedDestinations` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("connectedDestinations").toString())); } // validate the required field `key` Key.validateJsonElement(jsonObj.get("key")); diff --git a/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java b/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java index 25acdd61..53cad672 100644 --- a/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java +++ b/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java @@ -37,10 +37,15 @@ public class ExitRulesConfig { @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public static final String SERIALIZED_NAME_STATES = "states"; + public static final String SERIALIZED_NAME_RULES = "rules"; - @SerializedName(SERIALIZED_NAME_STATES) - private List states = new ArrayList<>(); + @SerializedName(SERIALIZED_NAME_RULES) + private List rules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_DESTINATIONS = "relatedDestinations"; + + @SerializedName(SERIALIZED_NAME_RELATED_DESTINATIONS) + private List relatedDestinations; public ExitRulesConfig() {} @@ -64,32 +69,61 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public ExitRulesConfig states(List states) { + public ExitRulesConfig rules(List rules) { - this.states = states; + this.rules = rules; return this; } - public ExitRulesConfig addStatesItem(StatesInner statesItem) { - if (this.states == null) { - this.states = new ArrayList<>(); + public ExitRulesConfig addRulesItem(RulesInner rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); } - this.states.add(statesItem); + this.rules.add(rulesItem); return this; } /** - * Get states + * Get rules * - * @return states + * @return rules */ @javax.annotation.Nonnull - public List getStates() { - return states; + public List getRules() { + return rules; + } + + public void setRules(List rules) { + this.rules = rules; + } + + public ExitRulesConfig relatedDestinations(List relatedDestinations) { + + this.relatedDestinations = relatedDestinations; + return this; } - public void setStates(List states) { - this.states = states; + public ExitRulesConfig addRelatedDestinationsItem( + ExitDestinationState relatedDestinationsItem) { + if (this.relatedDestinations == null) { + this.relatedDestinations = new ArrayList<>(); + } + this.relatedDestinations.add(relatedDestinationsItem); + return this; + } + + /** + * Get relatedDestinations + * + * @return relatedDestinations + */ + @javax.annotation.Nullable + public List getRelatedDestinations() { + return relatedDestinations; + } + + public void setRelatedDestinations(List relatedDestinations) { + this.relatedDestinations = relatedDestinations; } @Override @@ -102,12 +136,13 @@ public boolean equals(Object o) { } ExitRulesConfig exitRulesConfig = (ExitRulesConfig) o; return Objects.equals(this.enabled, exitRulesConfig.enabled) - && Objects.equals(this.states, exitRulesConfig.states); + && Objects.equals(this.rules, exitRulesConfig.rules) + && Objects.equals(this.relatedDestinations, exitRulesConfig.relatedDestinations); } @Override public int hashCode() { - return Objects.hash(enabled, states); + return Objects.hash(enabled, rules, relatedDestinations); } @Override @@ -115,7 +150,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ExitRulesConfig {\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" states: ").append(toIndentedString(states)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" relatedDestinations: ") + .append(toIndentedString(relatedDestinations)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -138,12 +176,13 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("enabled"); - openapiFields.add("states"); + openapiFields.add("rules"); + openapiFields.add("relatedDestinations"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("states"); + openapiRequiredFields.add("rules"); } /** @@ -187,20 +226,40 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // ensure the json data is an array - if (!jsonObj.get("states").isJsonArray()) { + if (!jsonObj.get("rules").isJsonArray()) { throw new IllegalArgumentException( String.format( - "Expected the field `states` to be an array in the JSON string but got" + "Expected the field `rules` to be an array in the JSON string but got" + " `%s`", - jsonObj.get("states").toString())); + jsonObj.get("rules").toString())); } - JsonArray jsonArraystates = jsonObj.getAsJsonArray("states"); - // validate the required field `states` (array) - for (int i = 0; i < jsonArraystates.size(); i++) { - StatesInner.validateJsonElement(jsonArraystates.get(i)); + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); + // validate the required field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + RulesInner.validateJsonElement(jsonArrayrules.get(i)); } ; + if (jsonObj.get("relatedDestinations") != null + && !jsonObj.get("relatedDestinations").isJsonNull()) { + JsonArray jsonArrayrelatedDestinations = jsonObj.getAsJsonArray("relatedDestinations"); + if (jsonArrayrelatedDestinations != null) { + // ensure the json data is an array + if (!jsonObj.get("relatedDestinations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `relatedDestinations` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("relatedDestinations").toString())); + } + + // validate the optional field `relatedDestinations` (array) + for (int i = 0; i < jsonArrayrelatedDestinations.size(); i++) { + ExitDestinationState.validateJsonElement(jsonArrayrelatedDestinations.get(i)); + } + ; + } + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/RandomSplitState.java b/src/main/java/com/segment/publicapi/models/RandomSplitState.java index 34ef2e01..fec45f50 100644 --- a/src/main/java/com/segment/publicapi/models/RandomSplitState.java +++ b/src/main/java/com/segment/publicapi/models/RandomSplitState.java @@ -40,6 +40,8 @@ public enum TypeEnum { EXIT("EXIT"), + DESTINATION("DESTINATION"), + EXIT_RULE("EXIT_RULE"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/StatesInner.java b/src/main/java/com/segment/publicapi/models/RulesInner.java similarity index 67% rename from src/main/java/com/segment/publicapi/models/StatesInner.java rename to src/main/java/com/segment/publicapi/models/RulesInner.java index bfadbd1a..507b6875 100644 --- a/src/main/java/com/segment/publicapi/models/StatesInner.java +++ b/src/main/java/com/segment/publicapi/models/RulesInner.java @@ -26,41 +26,31 @@ import java.util.logging.Level; import java.util.logging.Logger; -public class StatesInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(StatesInner.class.getName()); +public class RulesInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RulesInner.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!StatesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StatesInner' and its subtypes + if (!RulesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RulesInner' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterDestinationState = - gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); final TypeAdapter adapterEventExitRule = gson.getDelegateAdapter(this, TypeToken.get(EventExitRule.class)); final TypeAdapter adapterAudienceExitRule = gson.getDelegateAdapter(this, TypeToken.get(AudienceExitRule.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, StatesInner value) throws IOException { + public void write(JsonWriter out, RulesInner value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); return; } - // check if the actual instance is of the type `DestinationState` - if (value.getActualInstance() instanceof DestinationState) { - JsonElement element = - adapterDestinationState.toJsonTree( - (DestinationState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } // check if the actual instance is of the type `EventExitRule` if (value.getActualInstance() instanceof EventExitRule) { JsonElement element = @@ -79,43 +69,23 @@ public void write(JsonWriter out, StatesInner value) throws IOException { } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " AudienceExitRule, DestinationState, EventExitRule"); + + " AudienceExitRule, EventExitRule"); } @Override - public StatesInner read(JsonReader in) throws IOException { + public RulesInner read(JsonReader in) throws IOException { Object deserialized = null; JsonElement jsonElement = elementAdapter.read(in); ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize DestinationState - try { - // validate the JSON object to see if any exception is thrown - DestinationState.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationState; - StatesInner ret = new StatesInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationState'", - e); - } // deserialize EventExitRule try { // validate the JSON object to see if any exception is thrown EventExitRule.validateJsonElement(jsonElement); actualAdapter = adapterEventExitRule; - StatesInner ret = new StatesInner(); + RulesInner ret = new RulesInner(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; } catch (Exception e) { @@ -135,7 +105,7 @@ public StatesInner read(JsonReader in) throws IOException { // validate the JSON object to see if any exception is thrown AudienceExitRule.validateJsonElement(jsonElement); actualAdapter = adapterAudienceExitRule; - StatesInner ret = new StatesInner(); + RulesInner ret = new RulesInner(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; } catch (Exception e) { @@ -153,7 +123,7 @@ public StatesInner read(JsonReader in) throws IOException { throw new IOException( String.format( - "Failed deserialization for StatesInner: no class" + "Failed deserialization for RulesInner: no class" + " matches result, expected at least 1. Detailed" + " failure message for anyOf schemas: %s. JSON:" + " %s", @@ -166,49 +136,38 @@ public StatesInner read(JsonReader in) throws IOException { // store a list of schema names defined in anyOf public static final Map> schemas = new HashMap>(); - public StatesInner() { + public RulesInner() { super("anyOf", Boolean.FALSE); } - public StatesInner(AudienceExitRule o) { + public RulesInner(AudienceExitRule o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public StatesInner(DestinationState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public StatesInner(EventExitRule o) { + public RulesInner(EventExitRule o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("DestinationState", DestinationState.class); schemas.put("EventExitRule", EventExitRule.class); schemas.put("AudienceExitRule", AudienceExitRule.class); } @Override public Map> getSchemas() { - return StatesInner.schemas; + return RulesInner.schemas; } /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: AudienceExitRule, DestinationState, EventExitRule + * against the anyOf child schemas: AudienceExitRule, EventExitRule * *

It could be an instance of the 'anyOf' schemas. */ @Override public void setActualInstance(Object instance) { - if (instance instanceof DestinationState) { - super.setActualInstance(instance); - return; - } - if (instance instanceof EventExitRule) { super.setActualInstance(instance); return; @@ -220,31 +179,19 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( - "Invalid instance type. Must be AudienceExitRule, DestinationState, EventExitRule"); + "Invalid instance type. Must be AudienceExitRule, EventExitRule"); } /** - * Get the actual instance, which can be the following: AudienceExitRule, DestinationState, - * EventExitRule + * Get the actual instance, which can be the following: AudienceExitRule, EventExitRule * - * @return The actual instance (AudienceExitRule, DestinationState, EventExitRule) + * @return The actual instance (AudienceExitRule, EventExitRule) */ @Override public Object getActualInstance() { return super.getActualInstance(); } - /** - * Get the actual instance of `DestinationState`. If the actual instance is not - * `DestinationState`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationState` - * @throws ClassCastException if the instance is not `DestinationState` - */ - public DestinationState getDestinationState() throws ClassCastException { - return (DestinationState) super.getActualInstance(); - } - /** * Get the actual instance of `EventExitRule`. If the actual instance is not `EventExitRule`, * the ClassCastException will be thrown. @@ -271,22 +218,11 @@ public AudienceExitRule getAudienceExitRule() throws ClassCastException { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StatesInner + * @throws IOException if the JSON Element is invalid with respect to RulesInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate anyOf schemas one by one ArrayList errorMessages = new ArrayList<>(); - // validate the json string with DestinationState - try { - DestinationState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with `%s`.", - e.getMessage())); - // continue to the next one - } // validate the json string with EventExitRule try { EventExitRule.validateJsonElement(jsonElement); @@ -310,26 +246,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } throw new IOException( String.format( - "The JSON string is invalid for StatesInner with anyOf schemas:" - + " AudienceExitRule, DestinationState, EventExitRule. no class match" - + " the result, expected at least 1. Detailed failure message for anyOf" - + " schemas: %s. JSON: %s", + "The JSON string is invalid for RulesInner with anyOf schemas:" + + " AudienceExitRule, EventExitRule. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", errorMessages, jsonElement.toString())); } /** - * Create an instance of StatesInner given an JSON string + * Create an instance of RulesInner given an JSON string * * @param jsonString JSON string - * @return An instance of StatesInner - * @throws IOException if the JSON string is invalid with respect to StatesInner + * @return An instance of RulesInner + * @throws IOException if the JSON string is invalid with respect to RulesInner */ - public static StatesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StatesInner.class); + public static RulesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RulesInner.class); } /** - * Convert an instance of StatesInner to an JSON string + * Convert an instance of RulesInner to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java index 5aa701c6..044f943a 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java @@ -46,7 +46,7 @@ public class UpdateDestinationsForJourneyAlphaOutput { public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; @SerializedName(SERIALIZED_NAME_DESTINATIONS) - private List destinations = new ArrayList<>(); + private List destinations = new ArrayList<>(); public UpdateDestinationsForJourneyAlphaOutput() {} @@ -91,14 +91,14 @@ public void setVersion(BigDecimal version) { } public UpdateDestinationsForJourneyAlphaOutput destinations( - List destinations) { + List destinations) { this.destinations = destinations; return this; } public UpdateDestinationsForJourneyAlphaOutput addDestinationsItem( - DestinationState destinationsItem) { + DestinationsInner destinationsItem) { if (this.destinations == null) { this.destinations = new ArrayList<>(); } @@ -112,11 +112,11 @@ public UpdateDestinationsForJourneyAlphaOutput addDestinationsItem( * @return destinations */ @javax.annotation.Nonnull - public List getDestinations() { + public List getDestinations() { return destinations; } - public void setDestinations(List destinations) { + public void setDestinations(List destinations) { this.destinations = destinations; } @@ -242,7 +242,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); // validate the required field `destinations` (array) for (int i = 0; i < jsonArraydestinations.size(); i++) { - DestinationState.validateJsonElement(jsonArraydestinations.get(i)); + DestinationsInner.validateJsonElement(jsonArraydestinations.get(i)); } ; } From 3e4f1ce1a1f16e3ee4ea4e73a562e5914535c9f7 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Mar 2025 18:48:02 +0000 Subject: [PATCH 399/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@74ed4ffc. From 844cdd316ccf1adb2bd974b3ad189797483ff8ec Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Mar 2025 20:39:56 +0000 Subject: [PATCH 400/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2833774c. From 4c5973fd69d67e634dd436487c4ae016f188c692 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 4 Mar 2025 21:29:39 +0000 Subject: [PATCH 401/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d06f93dc. From bab0cbb5d876fde4480340f54ef7b7f23800ca33 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 11 Mar 2025 17:14:34 +0000 Subject: [PATCH 402/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@15682a03. --- .../models/CreateFilterForSpaceInput.java | 106 +----------------- .../com/segment/publicapi/models/Filter.java | 96 ---------------- .../models/UpdateFilterByIdInput.java | 106 +----------------- 3 files changed, 4 insertions(+), 304 deletions(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java index 2990b636..96a84806 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateFilterForSpaceInput.java @@ -22,9 +22,7 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -61,16 +59,6 @@ public class CreateFilterForSpaceInput { @SerializedName(SERIALIZED_NAME_DROP) private Boolean drop; - public static final String SERIALIZED_NAME_DROP_PROPERTIES = "dropProperties"; - - @SerializedName(SERIALIZED_NAME_DROP_PROPERTIES) - private List dropProperties; - - public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; - - @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) - private List allowProperties; - public CreateFilterForSpaceInput() {} public CreateFilterForSpaceInput integrationId(String integrationId) { @@ -193,62 +181,6 @@ public void setDrop(Boolean drop) { this.drop = drop; } - public CreateFilterForSpaceInput dropProperties(List dropProperties) { - - this.dropProperties = dropProperties; - return this; - } - - public CreateFilterForSpaceInput addDropPropertiesItem(String dropPropertiesItem) { - if (this.dropProperties == null) { - this.dropProperties = new ArrayList<>(); - } - this.dropProperties.add(dropPropertiesItem); - return this; - } - - /** - * Describes the properties to be dropped on events that match the \"if\" statement. - * - * @return dropProperties - */ - @javax.annotation.Nullable - public List getDropProperties() { - return dropProperties; - } - - public void setDropProperties(List dropProperties) { - this.dropProperties = dropProperties; - } - - public CreateFilterForSpaceInput allowProperties(List allowProperties) { - - this.allowProperties = allowProperties; - return this; - } - - public CreateFilterForSpaceInput addAllowPropertiesItem(String allowPropertiesItem) { - if (this.allowProperties == null) { - this.allowProperties = new ArrayList<>(); - } - this.allowProperties.add(allowPropertiesItem); - return this; - } - - /** - * Describes the properties allowed on events that match the \"if\" statement. - * - * @return allowProperties - */ - @javax.annotation.Nullable - public List getAllowProperties() { - return allowProperties; - } - - public void setAllowProperties(List allowProperties) { - this.allowProperties = allowProperties; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -263,22 +195,12 @@ public boolean equals(Object o) { && Objects.equals(this.name, createFilterForSpaceInput.name) && Objects.equals(this.description, createFilterForSpaceInput.description) && Objects.equals(this._if, createFilterForSpaceInput._if) - && Objects.equals(this.drop, createFilterForSpaceInput.drop) - && Objects.equals(this.dropProperties, createFilterForSpaceInput.dropProperties) - && Objects.equals(this.allowProperties, createFilterForSpaceInput.allowProperties); + && Objects.equals(this.drop, createFilterForSpaceInput.drop); } @Override public int hashCode() { - return Objects.hash( - integrationId, - enabled, - name, - description, - _if, - drop, - dropProperties, - allowProperties); + return Objects.hash(integrationId, enabled, name, description, _if, drop); } @Override @@ -291,8 +213,6 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); - sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); - sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -320,8 +240,6 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("if"); openapiFields.add("drop"); - openapiFields.add("dropProperties"); - openapiFields.add("allowProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -399,26 +317,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("if").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("dropProperties") != null - && !jsonObj.get("dropProperties").isJsonNull() - && !jsonObj.get("dropProperties").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `dropProperties` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("dropProperties").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("allowProperties") != null - && !jsonObj.get("allowProperties").isJsonNull() - && !jsonObj.get("allowProperties").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `allowProperties` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("allowProperties").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/Filter.java b/src/main/java/com/segment/publicapi/models/Filter.java index 42e72e56..1f034764 100644 --- a/src/main/java/com/segment/publicapi/models/Filter.java +++ b/src/main/java/com/segment/publicapi/models/Filter.java @@ -22,9 +22,7 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -71,16 +69,6 @@ public class Filter { @SerializedName(SERIALIZED_NAME_DROP) private Boolean drop; - public static final String SERIALIZED_NAME_DROP_PROPERTIES = "dropProperties"; - - @SerializedName(SERIALIZED_NAME_DROP_PROPERTIES) - private List dropProperties; - - public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; - - @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) - private List allowProperties; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; @SerializedName(SERIALIZED_NAME_CREATED_AT) @@ -253,62 +241,6 @@ public void setDrop(Boolean drop) { this.drop = drop; } - public Filter dropProperties(List dropProperties) { - - this.dropProperties = dropProperties; - return this; - } - - public Filter addDropPropertiesItem(String dropPropertiesItem) { - if (this.dropProperties == null) { - this.dropProperties = new ArrayList<>(); - } - this.dropProperties.add(dropPropertiesItem); - return this; - } - - /** - * Describes the properties to be dropped on events that match the \"if\" statement. - * - * @return dropProperties - */ - @javax.annotation.Nullable - public List getDropProperties() { - return dropProperties; - } - - public void setDropProperties(List dropProperties) { - this.dropProperties = dropProperties; - } - - public Filter allowProperties(List allowProperties) { - - this.allowProperties = allowProperties; - return this; - } - - public Filter addAllowPropertiesItem(String allowPropertiesItem) { - if (this.allowProperties == null) { - this.allowProperties = new ArrayList<>(); - } - this.allowProperties.add(allowPropertiesItem); - return this; - } - - /** - * Describes the properties allowed on events that match the \"if\" statement. - * - * @return allowProperties - */ - @javax.annotation.Nullable - public List getAllowProperties() { - return allowProperties; - } - - public void setAllowProperties(List allowProperties) { - this.allowProperties = allowProperties; - } - public Filter createdAt(String createdAt) { this.createdAt = createdAt; @@ -366,8 +298,6 @@ public boolean equals(Object o) { && Objects.equals(this.description, filter.description) && Objects.equals(this._if, filter._if) && Objects.equals(this.drop, filter.drop) - && Objects.equals(this.dropProperties, filter.dropProperties) - && Objects.equals(this.allowProperties, filter.allowProperties) && Objects.equals(this.createdAt, filter.createdAt) && Objects.equals(this.updatedAt, filter.updatedAt); } @@ -383,8 +313,6 @@ public int hashCode() { description, _if, drop, - dropProperties, - allowProperties, createdAt, updatedAt); } @@ -401,8 +329,6 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); - sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); - sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); @@ -434,8 +360,6 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("if"); openapiFields.add("drop"); - openapiFields.add("dropProperties"); - openapiFields.add("allowProperties"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); @@ -533,26 +457,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("if").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("dropProperties") != null - && !jsonObj.get("dropProperties").isJsonNull() - && !jsonObj.get("dropProperties").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `dropProperties` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("dropProperties").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("allowProperties") != null - && !jsonObj.get("allowProperties").isJsonNull() - && !jsonObj.get("allowProperties").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `allowProperties` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("allowProperties").toString())); - } if (!jsonObj.get("createdAt").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java index e6899100..bb1cced4 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateFilterByIdInput.java @@ -22,9 +22,7 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -61,16 +59,6 @@ public class UpdateFilterByIdInput { @SerializedName(SERIALIZED_NAME_DROP) private Boolean drop; - public static final String SERIALIZED_NAME_DROP_PROPERTIES = "dropProperties"; - - @SerializedName(SERIALIZED_NAME_DROP_PROPERTIES) - private List dropProperties; - - public static final String SERIALIZED_NAME_ALLOW_PROPERTIES = "allowProperties"; - - @SerializedName(SERIALIZED_NAME_ALLOW_PROPERTIES) - private List allowProperties; - public UpdateFilterByIdInput() {} public UpdateFilterByIdInput integrationId(String integrationId) { @@ -193,62 +181,6 @@ public void setDrop(Boolean drop) { this.drop = drop; } - public UpdateFilterByIdInput dropProperties(List dropProperties) { - - this.dropProperties = dropProperties; - return this; - } - - public UpdateFilterByIdInput addDropPropertiesItem(String dropPropertiesItem) { - if (this.dropProperties == null) { - this.dropProperties = new ArrayList<>(); - } - this.dropProperties.add(dropPropertiesItem); - return this; - } - - /** - * Describes the properties to be dropped on events that match the \"if\" statement. - * - * @return dropProperties - */ - @javax.annotation.Nullable - public List getDropProperties() { - return dropProperties; - } - - public void setDropProperties(List dropProperties) { - this.dropProperties = dropProperties; - } - - public UpdateFilterByIdInput allowProperties(List allowProperties) { - - this.allowProperties = allowProperties; - return this; - } - - public UpdateFilterByIdInput addAllowPropertiesItem(String allowPropertiesItem) { - if (this.allowProperties == null) { - this.allowProperties = new ArrayList<>(); - } - this.allowProperties.add(allowPropertiesItem); - return this; - } - - /** - * Describes the properties allowed on events that match the \"if\" statement. - * - * @return allowProperties - */ - @javax.annotation.Nullable - public List getAllowProperties() { - return allowProperties; - } - - public void setAllowProperties(List allowProperties) { - this.allowProperties = allowProperties; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -263,22 +195,12 @@ public boolean equals(Object o) { && Objects.equals(this.name, updateFilterByIdInput.name) && Objects.equals(this.description, updateFilterByIdInput.description) && Objects.equals(this._if, updateFilterByIdInput._if) - && Objects.equals(this.drop, updateFilterByIdInput.drop) - && Objects.equals(this.dropProperties, updateFilterByIdInput.dropProperties) - && Objects.equals(this.allowProperties, updateFilterByIdInput.allowProperties); + && Objects.equals(this.drop, updateFilterByIdInput.drop); } @Override public int hashCode() { - return Objects.hash( - integrationId, - enabled, - name, - description, - _if, - drop, - dropProperties, - allowProperties); + return Objects.hash(integrationId, enabled, name, description, _if, drop); } @Override @@ -291,8 +213,6 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" _if: ").append(toIndentedString(_if)).append("\n"); sb.append(" drop: ").append(toIndentedString(drop)).append("\n"); - sb.append(" dropProperties: ").append(toIndentedString(dropProperties)).append("\n"); - sb.append(" allowProperties: ").append(toIndentedString(allowProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -320,8 +240,6 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("if"); openapiFields.add("drop"); - openapiFields.add("dropProperties"); - openapiFields.add("allowProperties"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -399,26 +317,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("if").toString())); } - // ensure the optional json data is an array if present - if (jsonObj.get("dropProperties") != null - && !jsonObj.get("dropProperties").isJsonNull() - && !jsonObj.get("dropProperties").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `dropProperties` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("dropProperties").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("allowProperties") != null - && !jsonObj.get("allowProperties").isJsonNull() - && !jsonObj.get("allowProperties").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `allowProperties` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("allowProperties").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From 02a7ca38e225a9b202b637b9d300d9d110e1546a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 11 Mar 2025 18:15:29 +0000 Subject: [PATCH 403/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ac689944. From 9daa0ba4beabe4ab36340419dcf6d7fc4a23b2b6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 12 Mar 2025 17:37:02 +0000 Subject: [PATCH 404/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@81e70d40. From 37bfcde80ce17b35656e97aceadfc51a1cd41663 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 25 Mar 2025 05:23:15 +0000 Subject: [PATCH 405/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@af16735e. --- README.md | 8 +- docs/AudiencesApi.md | 78 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 7 + .../segment/publicapi/api/AudiencesApi.java | 226 ++++++++++++++ ...sumersFromSpaceAndAudience200Response.java | 216 ++++++++++++++ ...ceConsumersFromSpaceAndAudienceOutput.java | 281 ++++++++++++++++++ 9 files changed, 815 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java diff --git a/README.md b/README.md index be26748f..d7ee68e5 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 57.4.0 +Latest API and SDK version: 58.1.1 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 57.4.0 + 58.1.1 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:57.4.0" + implementation "com.segment.publicapi:segment-publicapi:58.1.1" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-57.4.0.jar` +* `target/segment-publicapi-58.1.1.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index c8aacab2..6ad4a41f 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -6,6 +6,7 @@ All URIs are relative to *https://api.segmentapis.com* |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | +| [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/consumers | List Audience Consumers from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -162,6 +163,83 @@ public class Example { | **429** | Too many requests | - | +## Operation: listAudienceConsumersFromSpaceAndAudience + +> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination) + +List Audience Consumers from Space And Audience + +Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "spaceId"; // String | + String id = "id"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + try { + ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **id** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | + +### Return type + +[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: listAudiences > ListAudiences200Response listAudiences(spaceId, pagination) diff --git a/pom.xml b/pom.xml index 468fc649..46ffcd90 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 57.4.0 + 58.1.1 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 1cb4d823..8df3d28f 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 57.4.0 (Java)"); + setUserAgent("Public API SDK 58.1.1 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 31f10cfc..91aefcaf 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "57.4.0"; + public static final String VERSION = "58.1.1"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 7aab0bbe..49ce75a5 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -944,6 +944,13 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListAudienceConsumersFromSpaceAndAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudienceOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 85a29e83..16b7fe52 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -21,6 +21,7 @@ import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; @@ -469,6 +470,231 @@ public okhttp3.Call getAudienceAsync( return localVarCall; } + /** + * Build call for listAudienceConsumersFromSpaceAndAudience + * + * @param spaceId (required) + * @param id (required) + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceCall( + String spaceId, String id, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}/consumers" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall( + String spaceId, String id, PaginationInput pagination, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listAudienceConsumersFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " listAudienceConsumersFromSpaceAndAudience(Async)"); + } + + return listAudienceConsumersFromSpaceAndAudienceCall(spaceId, id, pagination, _callback); + } + + /** + * List Audience Consumers from Space And Audience Returns the list of consumers for the given + * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. The rate limit for this endpoint is 25 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) + * @return ListAudienceConsumersFromSpaceAndAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListAudienceConsumersFromSpaceAndAudience200Response + listAudienceConsumersFromSpaceAndAudience( + String spaceId, String id, PaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listAudienceConsumersFromSpaceAndAudienceWithHttpInfo(spaceId, id, pagination); + return localVarResp.getData(); + } + + /** + * List Audience Consumers from Space And Audience Returns the list of consumers for the given + * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. The rate limit for this endpoint is 25 requests per + * minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) + * @return ApiResponse<ListAudienceConsumersFromSpaceAndAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listAudienceConsumersFromSpaceAndAudienceWithHttpInfo( + String spaceId, String id, PaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = + listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall( + spaceId, id, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audience Consumers from Space And Audience (asynchronously) Returns the list of + * consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( + String spaceId, + String id, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall( + spaceId, id, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudiences * diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java new file mode 100644 index 00000000..0ed0a16a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java @@ -0,0 +1,216 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListAudienceConsumersFromSpaceAndAudience200Response */ +public class ListAudienceConsumersFromSpaceAndAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListAudienceConsumersFromSpaceAndAudienceOutput data; + + public ListAudienceConsumersFromSpaceAndAudience200Response() {} + + public ListAudienceConsumersFromSpaceAndAudience200Response data( + ListAudienceConsumersFromSpaceAndAudienceOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListAudienceConsumersFromSpaceAndAudienceOutput getData() { + return data; + } + + public void setData(ListAudienceConsumersFromSpaceAndAudienceOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudienceConsumersFromSpaceAndAudience200Response + listAudienceConsumersFromSpaceAndAudience200Response = + (ListAudienceConsumersFromSpaceAndAudience200Response) o; + return Objects.equals(this.data, listAudienceConsumersFromSpaceAndAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudienceConsumersFromSpaceAndAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceConsumersFromSpaceAndAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudienceConsumersFromSpaceAndAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListAudienceConsumersFromSpaceAndAudience200Response is not" + + " found in the empty JSON string", + ListAudienceConsumersFromSpaceAndAudience200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudienceConsumersFromSpaceAndAudience200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudienceConsumersFromSpaceAndAudience200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListAudienceConsumersFromSpaceAndAudienceOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudienceConsumersFromSpaceAndAudience200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListAudienceConsumersFromSpaceAndAudience200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListAudienceConsumersFromSpaceAndAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListAudienceConsumersFromSpaceAndAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudienceConsumersFromSpaceAndAudience200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudienceConsumersFromSpaceAndAudience200Response given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of ListAudienceConsumersFromSpaceAndAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceConsumersFromSpaceAndAudience200Response + */ + public static ListAudienceConsumersFromSpaceAndAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListAudienceConsumersFromSpaceAndAudience200Response.class); + } + + /** + * Convert an instance of ListAudienceConsumersFromSpaceAndAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java new file mode 100644 index 00000000..b88d5e92 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java @@ -0,0 +1,281 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** List the audience consumers endpoint output. */ +public class ListAudienceConsumersFromSpaceAndAudienceOutput { + public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; + + @SerializedName(SERIALIZED_NAME_AUDIENCES) + private List audiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationOutput pagination; + + public ListAudienceConsumersFromSpaceAndAudienceOutput() {} + + public ListAudienceConsumersFromSpaceAndAudienceOutput audiences( + List audiences) { + + this.audiences = audiences; + return this; + } + + public ListAudienceConsumersFromSpaceAndAudienceOutput addAudiencesItem( + AudienceSummary audiencesItem) { + if (this.audiences == null) { + this.audiences = new ArrayList<>(); + } + this.audiences.add(audiencesItem); + return this; + } + + /** + * A list of audience summary results. + * + * @return audiences + */ + @javax.annotation.Nonnull + public List getAudiences() { + return audiences; + } + + public void setAudiences(List audiences) { + this.audiences = audiences; + } + + public ListAudienceConsumersFromSpaceAndAudienceOutput pagination(PaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + public PaginationOutput getPagination() { + return pagination; + } + + public void setPagination(PaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudienceConsumersFromSpaceAndAudienceOutput + listAudienceConsumersFromSpaceAndAudienceOutput = + (ListAudienceConsumersFromSpaceAndAudienceOutput) o; + return Objects.equals( + this.audiences, listAudienceConsumersFromSpaceAndAudienceOutput.audiences) + && Objects.equals( + this.pagination, + listAudienceConsumersFromSpaceAndAudienceOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(audiences, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudienceConsumersFromSpaceAndAudienceOutput {\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiences"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiences"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceConsumersFromSpaceAndAudienceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudienceConsumersFromSpaceAndAudienceOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListAudienceConsumersFromSpaceAndAudienceOutput is not" + + " found in the empty JSON string", + ListAudienceConsumersFromSpaceAndAudienceOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudienceConsumersFromSpaceAndAudienceOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudienceConsumersFromSpaceAndAudienceOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + ListAudienceConsumersFromSpaceAndAudienceOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("audiences").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audiences` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audiences").toString())); + } + + JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); + // validate the required field `audiences` (array) + for (int i = 0; i < jsonArrayaudiences.size(); i++) { + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudienceConsumersFromSpaceAndAudienceOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListAudienceConsumersFromSpaceAndAudienceOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(ListAudienceConsumersFromSpaceAndAudienceOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListAudienceConsumersFromSpaceAndAudienceOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudienceConsumersFromSpaceAndAudienceOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudienceConsumersFromSpaceAndAudienceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudienceConsumersFromSpaceAndAudienceOutput + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceConsumersFromSpaceAndAudienceOutput + */ + public static ListAudienceConsumersFromSpaceAndAudienceOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListAudienceConsumersFromSpaceAndAudienceOutput.class); + } + + /** + * Convert an instance of ListAudienceConsumersFromSpaceAndAudienceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 955eaa16964585334cc98e3e8d7053a53ef6c407 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 27 Mar 2025 05:12:40 +0000 Subject: [PATCH 406/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4a0c95b7. --- docs/AudiencesApi.md | 2 +- src/main/java/com/segment/publicapi/api/AudiencesApi.java | 2 +- .../ListAudienceConsumersFromSpaceAndAudienceOutput.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 6ad4a41f..8ca5fabc 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -6,7 +6,7 @@ All URIs are relative to *https://api.segmentapis.com* |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | -| [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/consumers | List Audience Consumers from Space And Audience | +| [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 16b7fe52..2f78ba72 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -510,7 +510,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceCall( // create path and map variables String localVarPath = - "/spaces/{spaceId}/audiences/{id}/consumers" + "/spaces/{spaceId}/audiences/{id}/audience-references" .replace( "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java index b88d5e92..08a13bcc 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java @@ -30,7 +30,7 @@ import java.util.Objects; import java.util.Set; -/** List the audience consumers endpoint output. */ +/** List Audience consumers output. */ public class ListAudienceConsumersFromSpaceAndAudienceOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @@ -61,7 +61,7 @@ public ListAudienceConsumersFromSpaceAndAudienceOutput addAudiencesItem( } /** - * A list of audience summary results. + * The list of audience consumers. * * @return audiences */ From 695e7bbd18a4cca1310da6dd009d6453d56bfce4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 31 Mar 2025 18:59:16 +0000 Subject: [PATCH 407/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@20ed4e80. --- docs/AudiencesApi.md | 4 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../segment/publicapi/api/AudiencesApi.java | 20 +- .../models/AudienceDefinitionBeta.java | 292 ++++++++ .../publicapi/models/AudienceOptionsBeta.java | 225 +++++++ .../publicapi/models/AudienceSummaryBeta.java | 637 ++++++++++++++++++ .../models/GetAudience200Response.java | 10 +- .../models/GetAudience200Response1.java | 194 ++++++ .../models/GetAudienceBetaOutput.java | 202 ++++++ 9 files changed, 1579 insertions(+), 16 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudience200Response1.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 8ca5fabc..766ba489 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -94,7 +94,7 @@ public class Example { Get Audience -Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -151,7 +151,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 49ce75a5..9f3904ca 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -174,14 +174,20 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceDefinitionBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceEntryState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceExitRule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceOptionsBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummaryBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -681,8 +687,13 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudience200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudience200Response1 + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 2f78ba72..db0074ff 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -328,7 +328,9 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -376,7 +378,7 @@ private okhttp3.Call getAudienceValidateBeforeCall( } /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. * Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate @@ -405,7 +407,7 @@ public GetAudience200Response getAudience(String spaceId, String id) throws ApiE } /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Alpha** testing. + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. * Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate @@ -437,12 +439,12 @@ public ApiResponse getAudienceWithHttpInfo(String spaceI /** * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 100 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) diff --git a/src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java b/src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java new file mode 100644 index 00000000..2631f61c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java @@ -0,0 +1,292 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines an audience definition. */ +public class AudienceDefinitionBeta { + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + /** + * The underlying data type being segmented for this audience. Possible values: users, accounts. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceDefinitionBeta() {} + + public AudienceDefinitionBeta query(String query) { + + this.query = query; + return this; + } + + /** + * The query language string defining the audience segmentation criteria. + * + * @return query + */ + @javax.annotation.Nonnull + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public AudienceDefinitionBeta type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The underlying data type being segmented for this audience. Possible values: users, accounts. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceDefinitionBeta audienceDefinitionBeta = (AudienceDefinitionBeta) o; + return Objects.equals(this.query, audienceDefinitionBeta.query) + && Objects.equals(this.type, audienceDefinitionBeta.type); + } + + @Override + public int hashCode() { + return Objects.hash(query, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceDefinitionBeta {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceDefinitionBeta + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceDefinitionBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceDefinitionBeta is not found in" + + " the empty JSON string", + AudienceDefinitionBeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceDefinitionBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceDefinitionBeta` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceDefinitionBeta.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceDefinitionBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceDefinitionBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceDefinitionBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceDefinitionBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceDefinitionBeta read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceDefinitionBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceDefinitionBeta + * @throws IOException if the JSON string is invalid with respect to AudienceDefinitionBeta + */ + public static AudienceDefinitionBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceDefinitionBeta.class); + } + + /** + * Convert an instance of AudienceDefinitionBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java new file mode 100644 index 00000000..ee56810f --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java @@ -0,0 +1,225 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceOptionsBeta */ +public class AudienceOptionsBeta { + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) + private Boolean includeAnonymousUsers; + + public AudienceOptionsBeta() {} + + public AudienceOptionsBeta includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience being created is included when determining + * audience membership. Note that including historical data may be needed in order to properly + * handle the definition specified. In these cases, Segment will automatically handle including + * historical data and the response will return the includeHistoricalData parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nullable + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public AudienceOptionsBeta includeAnonymousUsers(Boolean includeAnonymousUsers) { + + this.includeAnonymousUsers = includeAnonymousUsers; + return this; + } + + /** + * Determines whether anonymous users should be included when determining audience membership. + * + * @return includeAnonymousUsers + */ + @javax.annotation.Nullable + public Boolean getIncludeAnonymousUsers() { + return includeAnonymousUsers; + } + + public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { + this.includeAnonymousUsers = includeAnonymousUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceOptionsBeta audienceOptionsBeta = (AudienceOptionsBeta) o; + return Objects.equals(this.includeHistoricalData, audienceOptionsBeta.includeHistoricalData) + && Objects.equals( + this.includeAnonymousUsers, audienceOptionsBeta.includeAnonymousUsers); + } + + @Override + public int hashCode() { + return Objects.hash(includeHistoricalData, includeAnonymousUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceOptionsBeta {\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" includeAnonymousUsers: ") + .append(toIndentedString(includeAnonymousUsers)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("includeHistoricalData"); + openapiFields.add("includeAnonymousUsers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceOptionsBeta + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceOptionsBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceOptionsBeta is not found in" + + " the empty JSON string", + AudienceOptionsBeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceOptionsBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceOptionsBeta` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceOptionsBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceOptionsBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceOptionsBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceOptionsBeta read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceOptionsBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceOptionsBeta + * @throws IOException if the JSON string is invalid with respect to AudienceOptionsBeta + */ + public static AudienceOptionsBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceOptionsBeta.class); + } + + /** + * Convert an instance of AudienceOptionsBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java new file mode 100644 index 00000000..179c5b83 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java @@ -0,0 +1,637 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Defines an Audience. */ +public class AudienceSummaryBeta { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionBeta definition; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsBeta options; + + public AudienceSummaryBeta() {} + + public AudienceSummaryBeta id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummaryBeta spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummaryBeta name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummaryBeta description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummaryBeta key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummaryBeta enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummaryBeta definition(AudienceDefinitionBeta definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nullable + public AudienceDefinitionBeta getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionBeta definition) { + this.definition = definition; + } + + public AudienceSummaryBeta status(String status) { + + this.status = status; + return this; + } + + /** + * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting + * Destinations, Disabled. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public AudienceSummaryBeta createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummaryBeta updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummaryBeta createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummaryBeta updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public AudienceSummaryBeta options(AudienceOptionsBeta options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable + public AudienceOptionsBeta getOptions() { + return options; + } + + public void setOptions(AudienceOptionsBeta options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummaryBeta audienceSummaryBeta = (AudienceSummaryBeta) o; + return Objects.equals(this.id, audienceSummaryBeta.id) + && Objects.equals(this.spaceId, audienceSummaryBeta.spaceId) + && Objects.equals(this.name, audienceSummaryBeta.name) + && Objects.equals(this.description, audienceSummaryBeta.description) + && Objects.equals(this.key, audienceSummaryBeta.key) + && Objects.equals(this.enabled, audienceSummaryBeta.enabled) + && Objects.equals(this.definition, audienceSummaryBeta.definition) + && Objects.equals(this.status, audienceSummaryBeta.status) + && Objects.equals(this.createdBy, audienceSummaryBeta.createdBy) + && Objects.equals(this.updatedBy, audienceSummaryBeta.updatedBy) + && Objects.equals(this.createdAt, audienceSummaryBeta.createdAt) + && Objects.equals(this.updatedAt, audienceSummaryBeta.updatedAt) + && Objects.equals(this.options, audienceSummaryBeta.options); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + spaceId, + name, + description, + key, + enabled, + definition, + status, + createdBy, + updatedBy, + createdAt, + updatedAt, + options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummaryBeta {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("definition"); + openapiFields.add("status"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSummaryBeta + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSummaryBeta.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSummaryBeta is not found in" + + " the empty JSON string", + AudienceSummaryBeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSummaryBeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummaryBeta` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSummaryBeta.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + // validate the required field `definition` + AudienceDefinitionBeta.validateJsonElement(jsonObj.get("definition")); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + // validate the optional field `options` + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { + AudienceOptionsBeta.validateJsonElement(jsonObj.get("options")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummaryBeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSummaryBeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSummaryBeta.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSummaryBeta value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummaryBeta read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummaryBeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummaryBeta + * @throws IOException if the JSON string is invalid with respect to AudienceSummaryBeta + */ + public static AudienceSummaryBeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSummaryBeta.class); + } + + /** + * Convert an instance of AudienceSummaryBeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java index 3da9de43..5aa99d79 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudience200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAudience200Response.java @@ -32,11 +32,11 @@ public class GetAudience200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetAudienceAlphaOutput data; + private GetAudienceBetaOutput data; public GetAudience200Response() {} - public GetAudience200Response data(GetAudienceAlphaOutput data) { + public GetAudience200Response data(GetAudienceBetaOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public GetAudience200Response data(GetAudienceAlphaOutput data) { * @return data */ @javax.annotation.Nullable - public GetAudienceAlphaOutput getData() { + public GetAudienceBetaOutput getData() { return data; } - public void setData(GetAudienceAlphaOutput data) { + public void setData(GetAudienceBetaOutput data) { this.data = data; } @@ -137,7 +137,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetAudienceAlphaOutput.validateJsonElement(jsonObj.get("data")); + GetAudienceBetaOutput.validateJsonElement(jsonObj.get("data")); } } diff --git a/src/main/java/com/segment/publicapi/models/GetAudience200Response1.java b/src/main/java/com/segment/publicapi/models/GetAudience200Response1.java new file mode 100644 index 00000000..76dfcb8c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudience200Response1.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetAudience200Response1 */ +public class GetAudience200Response1 { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetAudienceAlphaOutput data; + + public GetAudience200Response1() {} + + public GetAudience200Response1 data(GetAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetAudienceAlphaOutput getData() { + return data; + } + + public void setData(GetAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudience200Response1 getAudience200Response1 = (GetAudience200Response1) o; + return Objects.equals(this.data, getAudience200Response1.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudience200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetAudience200Response1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudience200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudience200Response1 is not found" + + " in the empty JSON string", + GetAudience200Response1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudience200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudience200Response1` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAudienceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudience200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudience200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAudience200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudience200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudience200Response1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudience200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudience200Response1 + * @throws IOException if the JSON string is invalid with respect to GetAudience200Response1 + */ + public static GetAudience200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudience200Response1.class); + } + + /** + * Convert an instance of GetAudience200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java new file mode 100644 index 00000000..0f0a46a1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Audience output for get. */ +public class GetAudienceBetaOutput { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE) + private AudienceSummaryBeta audience; + + public GetAudienceBetaOutput() {} + + public GetAudienceBetaOutput audience(AudienceSummaryBeta audience) { + + this.audience = audience; + return this; + } + + /** + * Get audience + * + * @return audience + */ + @javax.annotation.Nonnull + public AudienceSummaryBeta getAudience() { + return audience; + } + + public void setAudience(AudienceSummaryBeta audience) { + this.audience = audience; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceBetaOutput getAudienceBetaOutput = (GetAudienceBetaOutput) o; + return Objects.equals(this.audience, getAudienceBetaOutput.audience); + } + + @Override + public int hashCode() { + return Objects.hash(audience); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceBetaOutput {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audience"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audience"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GetAudienceBetaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudienceBetaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudienceBetaOutput is not found in" + + " the empty JSON string", + GetAudienceBetaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudienceBetaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceBetaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAudienceBetaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audience` + AudienceSummaryBeta.validateJsonElement(jsonObj.get("audience")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceBetaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudienceBetaOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetAudienceBetaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudienceBetaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceBetaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceBetaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceBetaOutput + * @throws IOException if the JSON string is invalid with respect to GetAudienceBetaOutput + */ + public static GetAudienceBetaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudienceBetaOutput.class); + } + + /** + * Convert an instance of GetAudienceBetaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 2b546e7768fc8c6d891d272884a78c6976485db9 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 12 Apr 2025 00:34:58 +0000 Subject: [PATCH 408/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@457f3203. --- docs/AudiencesApi.md | 2 +- docs/JourneysApi.md | 554 ------ src/main/java/com/segment/publicapi/JSON.java | 137 -- .../segment/publicapi/api/JourneysApi.java | 1569 ----------------- .../publicapi/models/ActionDefinition.java | 375 ---- .../segment/publicapi/models/Activation.java | 308 ---- .../segment/publicapi/models/Analytics.java | 229 --- .../publicapi/models/AudienceEntryState.java | 374 ---- .../publicapi/models/AudienceExitRule.java | 517 ------ .../segment/publicapi/models/BaseState.java | 408 ----- .../publicapi/models/ConcurrencyConfig.java | 236 --- .../publicapi/models/ConditionBranch.java | 324 ---- .../publicapi/models/ConditionSplitState.java | 338 ---- .../models/CreateJourney201Response.java | 194 -- .../models/CreateJourneyAlphaInput.java | 275 --- .../models/CreateJourneyAlphaOutput.java | 203 --- .../publicapi/models/DefaultBranch.java | 287 --- .../segment/publicapi/models/Destination.java | 261 --- .../publicapi/models/DestinationState.java | 390 ---- .../publicapi/models/DestinationsInner.java | 277 --- .../segment/publicapi/models/EntryRules.java | 287 --- .../publicapi/models/EventEntryState.java | 390 ---- .../publicapi/models/EventExitRule.java | 509 ------ .../models/EventSplitWithTimeoutState.java | 339 ---- .../models/ExitDestinationState.java | 338 ---- .../segment/publicapi/models/ExitRule.java | 477 ----- .../publicapi/models/ExitRulesConfig.java | 314 ---- .../segment/publicapi/models/ExitState.java | 281 --- .../models/GetJourney200Response.java | 193 -- .../models/GetJourneyAlphaOutput.java | 202 --- .../GetJourneyAnalytics200Response.java | 199 --- .../GetJourneyAnalyticsAlphaOutput.java | 209 --- .../publicapi/models/JourneyAnalytics.java | 261 --- .../publicapi/models/JourneyDefinition.java | 324 ---- .../publicapi/models/JourneyDetails.java | 225 --- .../segment/publicapi/models/JourneyInfo.java | 461 ----- .../publicapi/models/JourneyState.java | 667 ------- .../models/JourneyVersionOutput.java | 500 ------ .../com/segment/publicapi/models/Key.java | 241 --- .../models/PropertySelectionsConfig.java | 223 --- .../publicapi/models/RandomSplitBranch.java | 237 --- .../publicapi/models/RandomSplitState.java | 344 ---- .../RemoveJourneyFromSpace200Response.java | 200 --- .../RemoveJourneyFromSpaceAlphaOutput.java | 259 --- .../ReplaceStepsForJourney200Response.java | 200 --- .../ReplaceStepsForJourneyAlphaInput.java | 268 --- .../ReplaceStepsForJourneyAlphaOutput.java | 234 --- .../segment/publicapi/models/RulesInner.java | 275 --- .../publicapi/models/SimpleDelayState.java | 374 ---- .../publicapi/models/StepLevelAnalytics.java | 265 --- .../publicapi/models/TimeOutBranch.java | 323 ---- .../publicapi/models/TopLevelAnalytics.java | 296 ---- .../publicapi/models/TransitionState.java | 619 ------- .../segment/publicapi/models/Transitions.java | 206 --- .../publicapi/models/TransitionsInner.java | 275 --- .../publicapi/models/TransitionsInner1.java | 275 --- ...dateDestinationsForJourney200Response.java | 206 --- ...pdateDestinationsForJourneyAlphaInput.java | 241 --- ...dateDestinationsForJourneyAlphaOutput.java | 306 ---- .../models/UpdateDestinationsInput.java | 263 --- .../UpdateStatusForJourney200Response.java | 200 --- .../UpdateStatusForJourneyAlphaInput.java | 292 --- .../UpdateStatusForJourneyAlphaOutput.java | 329 ---- 63 files changed, 1 insertion(+), 20384 deletions(-) delete mode 100644 docs/JourneysApi.md delete mode 100644 src/main/java/com/segment/publicapi/api/JourneysApi.java delete mode 100644 src/main/java/com/segment/publicapi/models/ActionDefinition.java delete mode 100644 src/main/java/com/segment/publicapi/models/Activation.java delete mode 100644 src/main/java/com/segment/publicapi/models/Analytics.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceEntryState.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceExitRule.java delete mode 100644 src/main/java/com/segment/publicapi/models/BaseState.java delete mode 100644 src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java delete mode 100644 src/main/java/com/segment/publicapi/models/ConditionBranch.java delete mode 100644 src/main/java/com/segment/publicapi/models/ConditionSplitState.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateJourney201Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/DefaultBranch.java delete mode 100644 src/main/java/com/segment/publicapi/models/Destination.java delete mode 100644 src/main/java/com/segment/publicapi/models/DestinationState.java delete mode 100644 src/main/java/com/segment/publicapi/models/DestinationsInner.java delete mode 100644 src/main/java/com/segment/publicapi/models/EntryRules.java delete mode 100644 src/main/java/com/segment/publicapi/models/EventEntryState.java delete mode 100644 src/main/java/com/segment/publicapi/models/EventExitRule.java delete mode 100644 src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java delete mode 100644 src/main/java/com/segment/publicapi/models/ExitDestinationState.java delete mode 100644 src/main/java/com/segment/publicapi/models/ExitRule.java delete mode 100644 src/main/java/com/segment/publicapi/models/ExitRulesConfig.java delete mode 100644 src/main/java/com/segment/publicapi/models/ExitState.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetJourney200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/JourneyAnalytics.java delete mode 100644 src/main/java/com/segment/publicapi/models/JourneyDefinition.java delete mode 100644 src/main/java/com/segment/publicapi/models/JourneyDetails.java delete mode 100644 src/main/java/com/segment/publicapi/models/JourneyInfo.java delete mode 100644 src/main/java/com/segment/publicapi/models/JourneyState.java delete mode 100644 src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/Key.java delete mode 100644 src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java delete mode 100644 src/main/java/com/segment/publicapi/models/RandomSplitBranch.java delete mode 100644 src/main/java/com/segment/publicapi/models/RandomSplitState.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/RulesInner.java delete mode 100644 src/main/java/com/segment/publicapi/models/SimpleDelayState.java delete mode 100644 src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java delete mode 100644 src/main/java/com/segment/publicapi/models/TimeOutBranch.java delete mode 100644 src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java delete mode 100644 src/main/java/com/segment/publicapi/models/TransitionState.java delete mode 100644 src/main/java/com/segment/publicapi/models/Transitions.java delete mode 100644 src/main/java/com/segment/publicapi/models/TransitionsInner.java delete mode 100644 src/main/java/com/segment/publicapi/models/TransitionsInner1.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java delete mode 100644 src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 766ba489..d6a2e073 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -192,7 +192,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - String id = "id"; // String | + String id = "ReferencedAudienceId"; // String | PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination); diff --git a/docs/JourneysApi.md b/docs/JourneysApi.md deleted file mode 100644 index 4f9f25bb..00000000 --- a/docs/JourneysApi.md +++ /dev/null @@ -1,554 +0,0 @@ -# JourneysApi - -All URIs are relative to *https://api.segmentapis.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**createJourney**](JourneysApi.md#createJourney) | **POST** /spaces/{spaceId}/journeys | Create Journey | -| [**getJourney**](JourneysApi.md#getJourney) | **GET** /spaces/{spaceId}/journeys/{containerId} | Get Journey | -| [**getJourneyAnalytics**](JourneysApi.md#getJourneyAnalytics) | **GET** /spaces/{spaceId}/journeys/{containerId}/analytics | Get Journey Analytics | -| [**removeJourneyFromSpace**](JourneysApi.md#removeJourneyFromSpace) | **DELETE** /spaces/{spaceId}/journeys/{containerId} | Remove Journey from Space | -| [**replaceStepsForJourney**](JourneysApi.md#replaceStepsForJourney) | **PUT** /spaces/{spaceId}/journeys/{containerId}/steps | Replace Steps for Journey | -| [**updateDestinationsForJourney**](JourneysApi.md#updateDestinationsForJourney) | **PATCH** /spaces/{spaceId}/journeys/{containerId}/destinations | Update Destinations for Journey | -| [**updateStatusForJourney**](JourneysApi.md#updateStatusForJourney) | **PATCH** /spaces/{spaceId}/journeys/{containerId}/status | Update Status for Journey | - - - -## Operation: createJourney - -> CreateJourney201Response createJourney(spaceId, createJourneyAlphaInput) - -Create Journey - -Creates Journey. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "space_id"; // String | - CreateJourneyAlphaInput createJourneyAlphaInput = new CreateJourneyAlphaInput(); // CreateJourneyAlphaInput | - try { - CreateJourney201Response result = apiInstance.createJourney(spaceId, createJourneyAlphaInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#createJourney"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **createJourneyAlphaInput** | [**CreateJourneyAlphaInput**](CreateJourneyAlphaInput.md)| | | - -### Return type - -[**CreateJourney201Response**](CreateJourney201Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **201** | Created | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: getJourney - -> GetJourney200Response getJourney(spaceId, containerId) - -Get Journey - -Returns the journey by containerId • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "space_id"; // String | - String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | - try { - GetJourney200Response result = apiInstance.getJourney(spaceId, containerId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#getJourney"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **containerId** | **String**| | | - -### Return type - -[**GetJourney200Response**](GetJourney200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: getJourneyAnalytics - -> GetJourneyAnalytics200Response getJourneyAnalytics(spaceId, containerId, version, fromDate, toDate) - -Get Journey Analytics - -Get Analytics for a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "spaceId"; // String | - String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | - BigDecimal version = new BigDecimal("1"); // BigDecimal | The journey version. This parameter exists in alpha. - String fromDate = "2006-01-02T15:04:05.000Z"; // String | This parameter exists in alpha. - String toDate = "2006-01-02T15:04:05.000Z"; // String | This parameter exists in alpha. - try { - GetJourneyAnalytics200Response result = apiInstance.getJourneyAnalytics(spaceId, containerId, version, fromDate, toDate); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#getJourneyAnalytics"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **containerId** | **String**| | | -| **version** | **BigDecimal**| The journey version. This parameter exists in alpha. | | -| **fromDate** | **String**| This parameter exists in alpha. | | -| **toDate** | **String**| This parameter exists in alpha. | [optional] | - -### Return type - -[**GetJourneyAnalytics200Response**](GetJourneyAnalytics200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: removeJourneyFromSpace - -> RemoveJourneyFromSpace200Response removeJourneyFromSpace(spaceId, containerId, version) - -Remove Journey from Space - -Delete a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "spaceId"; // String | - String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | - BigDecimal version = new BigDecimal("1"); // BigDecimal | The journey version. This parameter exists in alpha. - try { - RemoveJourneyFromSpace200Response result = apiInstance.removeJourneyFromSpace(spaceId, containerId, version); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#removeJourneyFromSpace"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **containerId** | **String**| | | -| **version** | **BigDecimal**| The journey version. This parameter exists in alpha. | | - -### Return type - -[**RemoveJourneyFromSpace200Response**](RemoveJourneyFromSpace200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: replaceStepsForJourney - -> ReplaceStepsForJourney200Response replaceStepsForJourney(spaceId, containerId, replaceStepsForJourneyAlphaInput) - -Replace Steps for Journey - -Replace steps for a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "spaceId"; // String | - String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput = new ReplaceStepsForJourneyAlphaInput(); // ReplaceStepsForJourneyAlphaInput | - try { - ReplaceStepsForJourney200Response result = apiInstance.replaceStepsForJourney(spaceId, containerId, replaceStepsForJourneyAlphaInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#replaceStepsForJourney"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **containerId** | **String**| | | -| **replaceStepsForJourneyAlphaInput** | [**ReplaceStepsForJourneyAlphaInput**](ReplaceStepsForJourneyAlphaInput.md)| | | - -### Return type - -[**ReplaceStepsForJourney200Response**](ReplaceStepsForJourney200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: updateDestinationsForJourney - -> UpdateDestinationsForJourney200Response updateDestinationsForJourney(spaceId, containerId, updateDestinationsForJourneyAlphaInput) - -Update Destinations for Journey - -Update DESTINATIONS for a journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "spaceId"; // String | - String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput = new UpdateDestinationsForJourneyAlphaInput(); // UpdateDestinationsForJourneyAlphaInput | - try { - UpdateDestinationsForJourney200Response result = apiInstance.updateDestinationsForJourney(spaceId, containerId, updateDestinationsForJourneyAlphaInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#updateDestinationsForJourney"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **containerId** | **String**| | | -| **updateDestinationsForJourneyAlphaInput** | [**UpdateDestinationsForJourneyAlphaInput**](UpdateDestinationsForJourneyAlphaInput.md)| | | - -### Return type - -[**UpdateDestinationsForJourney200Response**](UpdateDestinationsForJourney200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: updateStatusForJourney - -> UpdateStatusForJourney200Response updateStatusForJourney(spaceId, containerId, updateStatusForJourneyAlphaInput) - -Update Status for Journey - -Update status of the journey • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.JourneysApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - JourneysApi apiInstance = new JourneysApi(defaultClient); - String spaceId = "spaceId"; // String | - String containerId = "jcon_2tG95HZh4oPsgHfcOlznyfcDDAg"; // String | - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput = new UpdateStatusForJourneyAlphaInput(); // UpdateStatusForJourneyAlphaInput | - try { - UpdateStatusForJourney200Response result = apiInstance.updateStatusForJourney(spaceId, containerId, updateStatusForJourneyAlphaInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling JourneysApi#updateStatusForJourney"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **containerId** | **String**| | | -| **updateStatusForJourneyAlphaInput** | [**UpdateStatusForJourneyAlphaInput**](UpdateStatusForJourneyAlphaInput.md)| | | - -### Return type - -[**UpdateStatusForJourney200Response**](UpdateStatusForJourney200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 9f3904ca..4238781d 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -95,10 +95,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.APICallSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AccessPermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ActionDefinition.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Activation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AddConnectionFromSourceToWarehouse201Response .CustomTypeAdapterFactory()); @@ -167,8 +163,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Analytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceComputationDefinition .CustomTypeAdapterFactory()); @@ -176,10 +170,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinitionBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceEntryState.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceExitRule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -190,8 +180,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.AudienceSummaryBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.BaseState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.BatchQueryMessagingSubscriptionsForSpace200Response .CustomTypeAdapterFactory()); @@ -219,12 +207,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ComputedTraitsDefinition .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ConcurrencyConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ConditionBranch.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ConditionSplitState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -339,15 +321,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.CreateInvitesV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateInvitesV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateJourney201Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateJourneyAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateJourneyAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateLabel201Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -471,8 +444,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DbtModelSyncTrigger.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DefaultBranch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); @@ -584,8 +555,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeliveryOverviewSuccessfullyReceivedFilterBy .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Destination.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationFilterActionV1 .CustomTypeAdapterFactory()); @@ -614,8 +583,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationMetadataV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DestinationState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -626,8 +593,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.DestinationsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DisableEdgeFunctions200Response .CustomTypeAdapterFactory()); @@ -644,25 +609,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EntryRules.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EventEntryState.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EventExitRule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EventSplitWithTimeoutState - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ExitDestinationState.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ExitRule.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ExitRulesConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ExitState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -790,16 +738,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetInsertFunctionInstanceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetJourney200Response.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetJourneyAlphaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetJourneyAnalytics200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetJourneyAnalyticsAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetLatestFromEdgeFunctions200Response .CustomTypeAdapterFactory()); @@ -937,20 +875,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.InvitePermissionV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.InviteV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.JourneyAnalytics.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.JourneyDefinition.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.JourneyDetails.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.JourneyInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.JourneyState.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.JourneyVersionOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Key.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1272,19 +1196,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PropertyRenameBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyRenameV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PropertySelectionsConfig - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationBeta .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RandomSplitBranch.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RandomSplitState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1307,12 +1224,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveFilterFromDestinationV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveJourneyFromSpace200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RemoveJourneyFromSpaceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveProfilesWarehouseFromSpace200Response .CustomTypeAdapterFactory()); @@ -1420,15 +1331,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReplaceRulesInTrackingPlanV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReplaceStepsForJourney200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReplaceStepsForJourneyAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReplaceStepsForJourneyAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ReplaceUsersInUserGroup200Response .CustomTypeAdapterFactory()); @@ -1484,10 +1386,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RulesInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.SimpleDelayState.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); @@ -1512,8 +1410,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.StepLevelAnalytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1526,10 +1422,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.SyncNoticeV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SyncV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TimeOutBranch.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TopLevelAnalytics.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TrackSourceSettingsV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1542,14 +1434,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TransitionState.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Transitions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TransitionsInner.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.TransitionsInner1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateAudienceForSpace200Response .CustomTypeAdapterFactory()); @@ -1577,18 +1461,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateDestinationV1Output .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateDestinationsForJourney200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateDestinationsForJourneyAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateDestinationsForJourneyAlphaOutput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateDestinationsInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateFilterById200Response .CustomTypeAdapterFactory()); @@ -1693,15 +1565,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.UpdateSourceV1Input.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateSourceV1Output.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateStatusForJourney200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateStatusForJourneyAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateStatusForJourneyAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateSubscriptionForDestination200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/JourneysApi.java b/src/main/java/com/segment/publicapi/api/JourneysApi.java deleted file mode 100644 index 8e5cb272..00000000 --- a/src/main/java/com/segment/publicapi/api/JourneysApi.java +++ /dev/null @@ -1,1569 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.api; - -import com.google.gson.reflect.TypeToken; -import com.segment.publicapi.ApiCallback; -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.ApiResponse; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.Pair; -import com.segment.publicapi.models.CreateJourney201Response; -import com.segment.publicapi.models.CreateJourneyAlphaInput; -import com.segment.publicapi.models.GetJourney200Response; -import com.segment.publicapi.models.GetJourneyAnalytics200Response; -import com.segment.publicapi.models.RemoveJourneyFromSpace200Response; -import com.segment.publicapi.models.ReplaceStepsForJourney200Response; -import com.segment.publicapi.models.ReplaceStepsForJourneyAlphaInput; -import com.segment.publicapi.models.UpdateDestinationsForJourney200Response; -import com.segment.publicapi.models.UpdateDestinationsForJourneyAlphaInput; -import com.segment.publicapi.models.UpdateStatusForJourney200Response; -import com.segment.publicapi.models.UpdateStatusForJourneyAlphaInput; -import java.lang.reflect.Type; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class JourneysApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public JourneysApi() { - this(Configuration.getDefaultApiClient()); - } - - public JourneysApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for createJourney - * - * @param spaceId (required) - * @param createJourneyAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createJourneyCall( - String spaceId, - CreateJourneyAlphaInput createJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createJourneyAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createJourneyValidateBeforeCall( - String spaceId, - CreateJourneyAlphaInput createJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling createJourney(Async)"); - } - - // verify the required parameter 'createJourneyAlphaInput' is set - if (createJourneyAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'createJourneyAlphaInput' when calling" - + " createJourney(Async)"); - } - - return createJourneyCall(spaceId, createJourneyAlphaInput, _callback); - } - - /** - * Create Journey Creates Journey. • This endpoint is in **Alpha** testing. Please submit any - * feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach - * out to your customer success manager for more information. - * - * @param spaceId (required) - * @param createJourneyAlphaInput (required) - * @return CreateJourney201Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CreateJourney201Response createJourney( - String spaceId, CreateJourneyAlphaInput createJourneyAlphaInput) throws ApiException { - ApiResponse localVarResp = - createJourneyWithHttpInfo(spaceId, createJourneyAlphaInput); - return localVarResp.getData(); - } - - /** - * Create Journey Creates Journey. • This endpoint is in **Alpha** testing. Please submit any - * feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Journeys feature enabled. Please reach - * out to your customer success manager for more information. - * - * @param spaceId (required) - * @param createJourneyAlphaInput (required) - * @return ApiResponse<CreateJourney201Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse createJourneyWithHttpInfo( - String spaceId, CreateJourneyAlphaInput createJourneyAlphaInput) throws ApiException { - okhttp3.Call localVarCall = - createJourneyValidateBeforeCall(spaceId, createJourneyAlphaInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Journey (asynchronously) Creates Journey. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param createJourneyAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
201 Created -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createJourneyAsync( - String spaceId, - CreateJourneyAlphaInput createJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createJourneyValidateBeforeCall(spaceId, createJourneyAlphaInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getJourney - * - * @param spaceId (required) - * @param containerId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getJourneyCall( - String spaceId, String containerId, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys/{containerId}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "containerId" + "}", - localVarApiClient.escapeString(containerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getJourneyValidateBeforeCall( - String spaceId, String containerId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling getJourney(Async)"); - } - - // verify the required parameter 'containerId' is set - if (containerId == null) { - throw new ApiException( - "Missing the required parameter 'containerId' when calling getJourney(Async)"); - } - - return getJourneyCall(spaceId, containerId, _callback); - } - - /** - * Get Journey Returns the journey by containerId • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @return GetJourney200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetJourney200Response getJourney(String spaceId, String containerId) - throws ApiException { - ApiResponse localVarResp = - getJourneyWithHttpInfo(spaceId, containerId); - return localVarResp.getData(); - } - - /** - * Get Journey Returns the journey by containerId • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @return ApiResponse<GetJourney200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getJourneyWithHttpInfo( - String spaceId, String containerId) throws ApiException { - okhttp3.Call localVarCall = getJourneyValidateBeforeCall(spaceId, containerId, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Journey (asynchronously) Returns the journey by containerId • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Journeys feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param containerId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getJourneyAsync( - String spaceId, String containerId, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getJourneyValidateBeforeCall(spaceId, containerId, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getJourneyAnalytics - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @param fromDate This parameter exists in alpha. (required) - * @param toDate This parameter exists in alpha. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getJourneyAnalyticsCall( - String spaceId, - String containerId, - BigDecimal version, - String fromDate, - String toDate, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys/{containerId}/analytics" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "containerId" + "}", - localVarApiClient.escapeString(containerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (version != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version)); - } - - if (fromDate != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("fromDate", fromDate)); - } - - if (toDate != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("toDate", toDate)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getJourneyAnalyticsValidateBeforeCall( - String spaceId, - String containerId, - BigDecimal version, - String fromDate, - String toDate, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getJourneyAnalytics(Async)"); - } - - // verify the required parameter 'containerId' is set - if (containerId == null) { - throw new ApiException( - "Missing the required parameter 'containerId' when calling" - + " getJourneyAnalytics(Async)"); - } - - // verify the required parameter 'version' is set - if (version == null) { - throw new ApiException( - "Missing the required parameter 'version' when calling" - + " getJourneyAnalytics(Async)"); - } - - // verify the required parameter 'fromDate' is set - if (fromDate == null) { - throw new ApiException( - "Missing the required parameter 'fromDate' when calling" - + " getJourneyAnalytics(Async)"); - } - - return getJourneyAnalyticsCall(spaceId, containerId, version, fromDate, toDate, _callback); - } - - /** - * Get Journey Analytics Get Analytics for a journey • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @param fromDate This parameter exists in alpha. (required) - * @param toDate This parameter exists in alpha. (optional) - * @return GetJourneyAnalytics200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetJourneyAnalytics200Response getJourneyAnalytics( - String spaceId, String containerId, BigDecimal version, String fromDate, String toDate) - throws ApiException { - ApiResponse localVarResp = - getJourneyAnalyticsWithHttpInfo(spaceId, containerId, version, fromDate, toDate); - return localVarResp.getData(); - } - - /** - * Get Journey Analytics Get Analytics for a journey • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @param fromDate This parameter exists in alpha. (required) - * @param toDate This parameter exists in alpha. (optional) - * @return ApiResponse<GetJourneyAnalytics200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getJourneyAnalyticsWithHttpInfo( - String spaceId, String containerId, BigDecimal version, String fromDate, String toDate) - throws ApiException { - okhttp3.Call localVarCall = - getJourneyAnalyticsValidateBeforeCall( - spaceId, containerId, version, fromDate, toDate, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Journey Analytics (asynchronously) Get Analytics for a journey • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Journeys feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @param fromDate This parameter exists in alpha. (required) - * @param toDate This parameter exists in alpha. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getJourneyAnalyticsAsync( - String spaceId, - String containerId, - BigDecimal version, - String fromDate, - String toDate, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - getJourneyAnalyticsValidateBeforeCall( - spaceId, containerId, version, fromDate, toDate, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for removeJourneyFromSpace - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeJourneyFromSpaceCall( - String spaceId, String containerId, BigDecimal version, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys/{containerId}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "containerId" + "}", - localVarApiClient.escapeString(containerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (version != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call removeJourneyFromSpaceValidateBeforeCall( - String spaceId, String containerId, BigDecimal version, final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " removeJourneyFromSpace(Async)"); - } - - // verify the required parameter 'containerId' is set - if (containerId == null) { - throw new ApiException( - "Missing the required parameter 'containerId' when calling" - + " removeJourneyFromSpace(Async)"); - } - - // verify the required parameter 'version' is set - if (version == null) { - throw new ApiException( - "Missing the required parameter 'version' when calling" - + " removeJourneyFromSpace(Async)"); - } - - return removeJourneyFromSpaceCall(spaceId, containerId, version, _callback); - } - - /** - * Remove Journey from Space Delete a journey • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Journeys feature enabled. - * Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @return RemoveJourneyFromSpace200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public RemoveJourneyFromSpace200Response removeJourneyFromSpace( - String spaceId, String containerId, BigDecimal version) throws ApiException { - ApiResponse localVarResp = - removeJourneyFromSpaceWithHttpInfo(spaceId, containerId, version); - return localVarResp.getData(); - } - - /** - * Remove Journey from Space Delete a journey • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Journeys feature enabled. - * Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @return ApiResponse<RemoveJourneyFromSpace200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse removeJourneyFromSpaceWithHttpInfo( - String spaceId, String containerId, BigDecimal version) throws ApiException { - okhttp3.Call localVarCall = - removeJourneyFromSpaceValidateBeforeCall(spaceId, containerId, version, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Remove Journey from Space (asynchronously) Delete a journey • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param version The journey version. This parameter exists in alpha. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call removeJourneyFromSpaceAsync( - String spaceId, - String containerId, - BigDecimal version, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - removeJourneyFromSpaceValidateBeforeCall(spaceId, containerId, version, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for replaceStepsForJourney - * - * @param spaceId (required) - * @param containerId (required) - * @param replaceStepsForJourneyAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call replaceStepsForJourneyCall( - String spaceId, - String containerId, - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = replaceStepsForJourneyAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys/{containerId}/steps" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "containerId" + "}", - localVarApiClient.escapeString(containerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PUT", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call replaceStepsForJourneyValidateBeforeCall( - String spaceId, - String containerId, - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " replaceStepsForJourney(Async)"); - } - - // verify the required parameter 'containerId' is set - if (containerId == null) { - throw new ApiException( - "Missing the required parameter 'containerId' when calling" - + " replaceStepsForJourney(Async)"); - } - - // verify the required parameter 'replaceStepsForJourneyAlphaInput' is set - if (replaceStepsForJourneyAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'replaceStepsForJourneyAlphaInput' when calling" - + " replaceStepsForJourney(Async)"); - } - - return replaceStepsForJourneyCall( - spaceId, containerId, replaceStepsForJourneyAlphaInput, _callback); - } - - /** - * Replace Steps for Journey Replace steps for a journey • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param replaceStepsForJourneyAlphaInput (required) - * @return ReplaceStepsForJourney200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ReplaceStepsForJourney200Response replaceStepsForJourney( - String spaceId, - String containerId, - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput) - throws ApiException { - ApiResponse localVarResp = - replaceStepsForJourneyWithHttpInfo( - spaceId, containerId, replaceStepsForJourneyAlphaInput); - return localVarResp.getData(); - } - - /** - * Replace Steps for Journey Replace steps for a journey • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param replaceStepsForJourneyAlphaInput (required) - * @return ApiResponse<ReplaceStepsForJourney200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse replaceStepsForJourneyWithHttpInfo( - String spaceId, - String containerId, - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - replaceStepsForJourneyValidateBeforeCall( - spaceId, containerId, replaceStepsForJourneyAlphaInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Replace Steps for Journey (asynchronously) Replace steps for a journey • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Journeys feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param containerId (required) - * @param replaceStepsForJourneyAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call replaceStepsForJourneyAsync( - String spaceId, - String containerId, - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - replaceStepsForJourneyValidateBeforeCall( - spaceId, containerId, replaceStepsForJourneyAlphaInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateDestinationsForJourney - * - * @param spaceId (required) - * @param containerId (required) - * @param updateDestinationsForJourneyAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateDestinationsForJourneyCall( - String spaceId, - String containerId, - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateDestinationsForJourneyAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys/{containerId}/destinations" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "containerId" + "}", - localVarApiClient.escapeString(containerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateDestinationsForJourneyValidateBeforeCall( - String spaceId, - String containerId, - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " updateDestinationsForJourney(Async)"); - } - - // verify the required parameter 'containerId' is set - if (containerId == null) { - throw new ApiException( - "Missing the required parameter 'containerId' when calling" - + " updateDestinationsForJourney(Async)"); - } - - // verify the required parameter 'updateDestinationsForJourneyAlphaInput' is set - if (updateDestinationsForJourneyAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'updateDestinationsForJourneyAlphaInput' when" - + " calling updateDestinationsForJourney(Async)"); - } - - return updateDestinationsForJourneyCall( - spaceId, containerId, updateDestinationsForJourneyAlphaInput, _callback); - } - - /** - * Update Destinations for Journey Update DESTINATIONS for a journey • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Journeys feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param containerId (required) - * @param updateDestinationsForJourneyAlphaInput (required) - * @return UpdateDestinationsForJourney200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public UpdateDestinationsForJourney200Response updateDestinationsForJourney( - String spaceId, - String containerId, - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput) - throws ApiException { - ApiResponse localVarResp = - updateDestinationsForJourneyWithHttpInfo( - spaceId, containerId, updateDestinationsForJourneyAlphaInput); - return localVarResp.getData(); - } - - /** - * Update Destinations for Journey Update DESTINATIONS for a journey • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Journeys feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param containerId (required) - * @param updateDestinationsForJourneyAlphaInput (required) - * @return ApiResponse<UpdateDestinationsForJourney200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse - updateDestinationsForJourneyWithHttpInfo( - String spaceId, - String containerId, - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - updateDestinationsForJourneyValidateBeforeCall( - spaceId, containerId, updateDestinationsForJourneyAlphaInput, null); - Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Destinations for Journey (asynchronously) Update DESTINATIONS for a journey • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Journeys feature enabled. Please reach out to your customer success manager - * for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param updateDestinationsForJourneyAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateDestinationsForJourneyAsync( - String spaceId, - String containerId, - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateDestinationsForJourneyValidateBeforeCall( - spaceId, containerId, updateDestinationsForJourneyAlphaInput, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for updateStatusForJourney - * - * @param spaceId (required) - * @param containerId (required) - * @param updateStatusForJourneyAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateStatusForJourneyCall( - String spaceId, - String containerId, - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = updateStatusForJourneyAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/journeys/{containerId}/status" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace( - "{" + "containerId" + "}", - localVarApiClient.escapeString(containerId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PATCH", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call updateStatusForJourneyValidateBeforeCall( - String spaceId, - String containerId, - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " updateStatusForJourney(Async)"); - } - - // verify the required parameter 'containerId' is set - if (containerId == null) { - throw new ApiException( - "Missing the required parameter 'containerId' when calling" - + " updateStatusForJourney(Async)"); - } - - // verify the required parameter 'updateStatusForJourneyAlphaInput' is set - if (updateStatusForJourneyAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'updateStatusForJourneyAlphaInput' when calling" - + " updateStatusForJourney(Async)"); - } - - return updateStatusForJourneyCall( - spaceId, containerId, updateStatusForJourneyAlphaInput, _callback); - } - - /** - * Update Status for Journey Update status of the journey • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param updateStatusForJourneyAlphaInput (required) - * @return UpdateStatusForJourney200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public UpdateStatusForJourney200Response updateStatusForJourney( - String spaceId, - String containerId, - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput) - throws ApiException { - ApiResponse localVarResp = - updateStatusForJourneyWithHttpInfo( - spaceId, containerId, updateStatusForJourneyAlphaInput); - return localVarResp.getData(); - } - - /** - * Update Status for Journey Update status of the journey • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Journeys feature - * enabled. Please reach out to your customer success manager for more information. - * - * @param spaceId (required) - * @param containerId (required) - * @param updateStatusForJourneyAlphaInput (required) - * @return ApiResponse<UpdateStatusForJourney200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse updateStatusForJourneyWithHttpInfo( - String spaceId, - String containerId, - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - updateStatusForJourneyValidateBeforeCall( - spaceId, containerId, updateStatusForJourneyAlphaInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Update Status for Journey (asynchronously) Update status of the journey • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Journeys feature enabled. Please reach out to your customer success manager for more - * information. - * - * @param spaceId (required) - * @param containerId (required) - * @param updateStatusForJourneyAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call updateStatusForJourneyAsync( - String spaceId, - String containerId, - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - updateStatusForJourneyValidateBeforeCall( - spaceId, containerId, updateStatusForJourneyAlphaInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/segment/publicapi/models/ActionDefinition.java b/src/main/java/com/segment/publicapi/models/ActionDefinition.java deleted file mode 100644 index 6e5de629..00000000 --- a/src/main/java/com/segment/publicapi/models/ActionDefinition.java +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ActionDefinition */ -public class ActionDefinition { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_USE_DEFAULT_MAPPINGS = "useDefaultMappings"; - - @SerializedName(SERIALIZED_NAME_USE_DEFAULT_MAPPINGS) - private Boolean useDefaultMappings; - - public static final String SERIALIZED_NAME_MAPPINGS = "mappings"; - - @SerializedName(SERIALIZED_NAME_MAPPINGS) - private Map mappings = new HashMap<>(); - - public static final String SERIALIZED_NAME_ACTION_ID = "actionId"; - - @SerializedName(SERIALIZED_NAME_ACTION_ID) - private String actionId; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public ActionDefinition() {} - - public ActionDefinition id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ActionDefinition useDefaultMappings(Boolean useDefaultMappings) { - - this.useDefaultMappings = useDefaultMappings; - return this; - } - - /** - * Get useDefaultMappings - * - * @return useDefaultMappings - */ - @javax.annotation.Nullable - public Boolean getUseDefaultMappings() { - return useDefaultMappings; - } - - public void setUseDefaultMappings(Boolean useDefaultMappings) { - this.useDefaultMappings = useDefaultMappings; - } - - public ActionDefinition mappings(Map mappings) { - - this.mappings = mappings; - return this; - } - - public ActionDefinition putMappingsItem(String key, Object mappingsItem) { - if (this.mappings == null) { - this.mappings = new HashMap<>(); - } - this.mappings.put(key, mappingsItem); - return this; - } - - /** - * Get mappings - * - * @return mappings - */ - @javax.annotation.Nonnull - public Map getMappings() { - return mappings; - } - - public void setMappings(Map mappings) { - this.mappings = mappings; - } - - public ActionDefinition actionId(String actionId) { - - this.actionId = actionId; - return this; - } - - /** - * Get actionId - * - * @return actionId - */ - @javax.annotation.Nonnull - public String getActionId() { - return actionId; - } - - public void setActionId(String actionId) { - this.actionId = actionId; - } - - public ActionDefinition enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nullable - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ActionDefinition name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ActionDefinition actionDefinition = (ActionDefinition) o; - return Objects.equals(this.id, actionDefinition.id) - && Objects.equals(this.useDefaultMappings, actionDefinition.useDefaultMappings) - && Objects.equals(this.mappings, actionDefinition.mappings) - && Objects.equals(this.actionId, actionDefinition.actionId) - && Objects.equals(this.enabled, actionDefinition.enabled) - && Objects.equals(this.name, actionDefinition.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, useDefaultMappings, mappings, actionId, enabled, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ActionDefinition {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" useDefaultMappings: ") - .append(toIndentedString(useDefaultMappings)) - .append("\n"); - sb.append(" mappings: ").append(toIndentedString(mappings)).append("\n"); - sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("useDefaultMappings"); - openapiFields.add("mappings"); - openapiFields.add("actionId"); - openapiFields.add("enabled"); - openapiFields.add("name"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("mappings"); - openapiRequiredFields.add("actionId"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ActionDefinition - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ActionDefinition.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ActionDefinition is not found in the" - + " empty JSON string", - ActionDefinition.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ActionDefinition.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ActionDefinition` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ActionDefinition.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("actionId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `actionId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("actionId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ActionDefinition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ActionDefinition' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ActionDefinition.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ActionDefinition value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ActionDefinition read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ActionDefinition given an JSON string - * - * @param jsonString JSON string - * @return An instance of ActionDefinition - * @throws IOException if the JSON string is invalid with respect to ActionDefinition - */ - public static ActionDefinition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ActionDefinition.class); - } - - /** - * Convert an instance of ActionDefinition to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Activation.java b/src/main/java/com/segment/publicapi/models/Activation.java deleted file mode 100644 index f4d78b5a..00000000 --- a/src/main/java/com/segment/publicapi/models/Activation.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Activation */ -public class Activation { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_EVENT_NAME = "eventName"; - - @SerializedName(SERIALIZED_NAME_EVENT_NAME) - private String eventName; - - public static final String SERIALIZED_NAME_ACTION_DEFINITION = "actionDefinition"; - - @SerializedName(SERIALIZED_NAME_ACTION_DEFINITION) - private ActionDefinition actionDefinition; - - public static final String SERIALIZED_NAME_PROPERTY_SELECTIONS = "propertySelections"; - - @SerializedName(SERIALIZED_NAME_PROPERTY_SELECTIONS) - private PropertySelectionsConfig propertySelections; - - public Activation() {} - - public Activation id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Activation eventName(String eventName) { - - this.eventName = eventName; - return this; - } - - /** - * Get eventName - * - * @return eventName - */ - @javax.annotation.Nonnull - public String getEventName() { - return eventName; - } - - public void setEventName(String eventName) { - this.eventName = eventName; - } - - public Activation actionDefinition(ActionDefinition actionDefinition) { - - this.actionDefinition = actionDefinition; - return this; - } - - /** - * Get actionDefinition - * - * @return actionDefinition - */ - @javax.annotation.Nonnull - public ActionDefinition getActionDefinition() { - return actionDefinition; - } - - public void setActionDefinition(ActionDefinition actionDefinition) { - this.actionDefinition = actionDefinition; - } - - public Activation propertySelections(PropertySelectionsConfig propertySelections) { - - this.propertySelections = propertySelections; - return this; - } - - /** - * Get propertySelections - * - * @return propertySelections - */ - @javax.annotation.Nullable - public PropertySelectionsConfig getPropertySelections() { - return propertySelections; - } - - public void setPropertySelections(PropertySelectionsConfig propertySelections) { - this.propertySelections = propertySelections; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Activation activation = (Activation) o; - return Objects.equals(this.id, activation.id) - && Objects.equals(this.eventName, activation.eventName) - && Objects.equals(this.actionDefinition, activation.actionDefinition) - && Objects.equals(this.propertySelections, activation.propertySelections); - } - - @Override - public int hashCode() { - return Objects.hash(id, eventName, actionDefinition, propertySelections); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Activation {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); - sb.append(" actionDefinition: ").append(toIndentedString(actionDefinition)).append("\n"); - sb.append(" propertySelections: ") - .append(toIndentedString(propertySelections)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("eventName"); - openapiFields.add("actionDefinition"); - openapiFields.add("propertySelections"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("eventName"); - openapiRequiredFields.add("actionDefinition"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Activation - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Activation.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Activation is not found in the empty" - + " JSON string", - Activation.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Activation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Activation` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Activation.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) - && !jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("eventName").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `eventName` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("eventName").toString())); - } - // validate the required field `actionDefinition` - ActionDefinition.validateJsonElement(jsonObj.get("actionDefinition")); - // validate the optional field `propertySelections` - if (jsonObj.get("propertySelections") != null - && !jsonObj.get("propertySelections").isJsonNull()) { - PropertySelectionsConfig.validateJsonElement(jsonObj.get("propertySelections")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Activation.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Activation' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Activation.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Activation value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Activation read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Activation given an JSON string - * - * @param jsonString JSON string - * @return An instance of Activation - * @throws IOException if the JSON string is invalid with respect to Activation - */ - public static Activation fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Activation.class); - } - - /** - * Convert an instance of Activation to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Analytics.java b/src/main/java/com/segment/publicapi/models/Analytics.java deleted file mode 100644 index 18e03d71..00000000 --- a/src/main/java/com/segment/publicapi/models/Analytics.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Analytics */ -public class Analytics { - public static final String SERIALIZED_NAME_TOTAL = "total"; - - @SerializedName(SERIALIZED_NAME_TOTAL) - private BigDecimal total; - - public static final String SERIALIZED_NAME_UNIQUE = "unique"; - - @SerializedName(SERIALIZED_NAME_UNIQUE) - private BigDecimal unique; - - public Analytics() {} - - public Analytics total(BigDecimal total) { - - this.total = total; - return this; - } - - /** - * Get total - * - * @return total - */ - @javax.annotation.Nonnull - public BigDecimal getTotal() { - return total; - } - - public void setTotal(BigDecimal total) { - this.total = total; - } - - public Analytics unique(BigDecimal unique) { - - this.unique = unique; - return this; - } - - /** - * Get unique - * - * @return unique - */ - @javax.annotation.Nonnull - public BigDecimal getUnique() { - return unique; - } - - public void setUnique(BigDecimal unique) { - this.unique = unique; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Analytics analytics = (Analytics) o; - return Objects.equals(this.total, analytics.total) - && Objects.equals(this.unique, analytics.unique); - } - - @Override - public int hashCode() { - return Objects.hash(total, unique); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Analytics {\n"); - sb.append(" total: ").append(toIndentedString(total)).append("\n"); - sb.append(" unique: ").append(toIndentedString(unique)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("total"); - openapiFields.add("unique"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("total"); - openapiRequiredFields.add("unique"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Analytics - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Analytics.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Analytics is not found in the empty" - + " JSON string", - Analytics.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Analytics.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Analytics` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Analytics.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Analytics.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Analytics' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Analytics.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Analytics value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Analytics read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Analytics given an JSON string - * - * @param jsonString JSON string - * @return An instance of Analytics - * @throws IOException if the JSON string is invalid with respect to Analytics - */ - public static Analytics fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Analytics.class); - } - - /** - * Convert an instance of Analytics to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceEntryState.java b/src/main/java/com/segment/publicapi/models/AudienceEntryState.java deleted file mode 100644 index ccf90e47..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceEntryState.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceEntryState */ -public class AudienceEntryState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - AUDIENCE_ENTRY("AUDIENCE_ENTRY"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) - private String audienceId; - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public AudienceEntryState() {} - - public AudienceEntryState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public AudienceEntryState audienceId(String audienceId) { - - this.audienceId = audienceId; - return this; - } - - /** - * Get audienceId - * - * @return audienceId - */ - @javax.annotation.Nonnull - public String getAudienceId() { - return audienceId; - } - - public void setAudienceId(String audienceId) { - this.audienceId = audienceId; - } - - public AudienceEntryState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public AudienceEntryState addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public AudienceEntryState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceEntryState audienceEntryState = (AudienceEntryState) o; - return Objects.equals(this.type, audienceEntryState.type) - && Objects.equals(this.audienceId, audienceEntryState.audienceId) - && Objects.equals(this.transitions, audienceEntryState.transitions) - && Objects.equals(this.key, audienceEntryState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, audienceId, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceEntryState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("audienceId"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("audienceId"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceEntryState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceEntryState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceEntryState is not found in the" - + " empty JSON string", - AudienceEntryState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceEntryState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceEntryState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceEntryState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("audienceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceEntryState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceEntryState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceEntryState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceEntryState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceEntryState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceEntryState given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceEntryState - * @throws IOException if the JSON string is invalid with respect to AudienceEntryState - */ - public static AudienceEntryState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceEntryState.class); - } - - /** - * Convert an instance of AudienceEntryState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceExitRule.java b/src/main/java/com/segment/publicapi/models/AudienceExitRule.java deleted file mode 100644 index 0439cc0c..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceExitRule.java +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceExitRule */ -public class AudienceExitRule { - /** Gets or Sets exitType */ - @JsonAdapter(ExitTypeEnum.Adapter.class) - public enum ExitTypeEnum { - AUDIENCE_MEMBERSHIP_CHANGE("AUDIENCE_MEMBERSHIP_CHANGE"); - - private String value; - - ExitTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExitTypeEnum fromValue(String value) { - for (ExitTypeEnum b : ExitTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ExitTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ExitTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_EXIT_TYPE = "exitType"; - - @SerializedName(SERIALIZED_NAME_EXIT_TYPE) - private ExitTypeEnum exitType; - - public static final String SERIALIZED_NAME_AUDIENCE_ID = "audienceId"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_ID) - private String audienceId; - - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EXIT_RULE("EXIT_RULE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CONCURRENCY_ENABLED = "concurrencyEnabled"; - - @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) - private Boolean concurrencyEnabled; - - public static final String SERIALIZED_NAME_CONNECTED_DESTINATIONS = "connectedDestinations"; - - @SerializedName(SERIALIZED_NAME_CONNECTED_DESTINATIONS) - private List connectedDestinations; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public AudienceExitRule() {} - - public AudienceExitRule exitType(ExitTypeEnum exitType) { - - this.exitType = exitType; - return this; - } - - /** - * Get exitType - * - * @return exitType - */ - @javax.annotation.Nonnull - public ExitTypeEnum getExitType() { - return exitType; - } - - public void setExitType(ExitTypeEnum exitType) { - this.exitType = exitType; - } - - public AudienceExitRule audienceId(String audienceId) { - - this.audienceId = audienceId; - return this; - } - - /** - * Get audienceId - * - * @return audienceId - */ - @javax.annotation.Nonnull - public String getAudienceId() { - return audienceId; - } - - public void setAudienceId(String audienceId) { - this.audienceId = audienceId; - } - - public AudienceExitRule type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public AudienceExitRule enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceExitRule concurrencyEnabled(Boolean concurrencyEnabled) { - - this.concurrencyEnabled = concurrencyEnabled; - return this; - } - - /** - * Get concurrencyEnabled - * - * @return concurrencyEnabled - */ - @javax.annotation.Nonnull - public Boolean getConcurrencyEnabled() { - return concurrencyEnabled; - } - - public void setConcurrencyEnabled(Boolean concurrencyEnabled) { - this.concurrencyEnabled = concurrencyEnabled; - } - - public AudienceExitRule connectedDestinations(List connectedDestinations) { - - this.connectedDestinations = connectedDestinations; - return this; - } - - public AudienceExitRule addConnectedDestinationsItem(String connectedDestinationsItem) { - if (this.connectedDestinations == null) { - this.connectedDestinations = new ArrayList<>(); - } - this.connectedDestinations.add(connectedDestinationsItem); - return this; - } - - /** - * Get connectedDestinations - * - * @return connectedDestinations - */ - @javax.annotation.Nullable - public List getConnectedDestinations() { - return connectedDestinations; - } - - public void setConnectedDestinations(List connectedDestinations) { - this.connectedDestinations = connectedDestinations; - } - - public AudienceExitRule key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceExitRule audienceExitRule = (AudienceExitRule) o; - return Objects.equals(this.exitType, audienceExitRule.exitType) - && Objects.equals(this.audienceId, audienceExitRule.audienceId) - && Objects.equals(this.type, audienceExitRule.type) - && Objects.equals(this.enabled, audienceExitRule.enabled) - && Objects.equals(this.concurrencyEnabled, audienceExitRule.concurrencyEnabled) - && Objects.equals( - this.connectedDestinations, audienceExitRule.connectedDestinations) - && Objects.equals(this.key, audienceExitRule.key); - } - - @Override - public int hashCode() { - return Objects.hash( - exitType, - audienceId, - type, - enabled, - concurrencyEnabled, - connectedDestinations, - key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceExitRule {\n"); - sb.append(" exitType: ").append(toIndentedString(exitType)).append("\n"); - sb.append(" audienceId: ").append(toIndentedString(audienceId)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" concurrencyEnabled: ") - .append(toIndentedString(concurrencyEnabled)) - .append("\n"); - sb.append(" connectedDestinations: ") - .append(toIndentedString(connectedDestinations)) - .append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exitType"); - openapiFields.add("audienceId"); - openapiFields.add("type"); - openapiFields.add("enabled"); - openapiFields.add("concurrencyEnabled"); - openapiFields.add("connectedDestinations"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("exitType"); - openapiRequiredFields.add("audienceId"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("concurrencyEnabled"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceExitRule - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceExitRule.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceExitRule is not found in the" - + " empty JSON string", - AudienceExitRule.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceExitRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceExitRule` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceExitRule.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("exitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `exitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("exitType").toString())); - } - if (!jsonObj.get("audienceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceId").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("connectedDestinations") != null - && !jsonObj.get("connectedDestinations").isJsonNull() - && !jsonObj.get("connectedDestinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `connectedDestinations` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("connectedDestinations").toString())); - } - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceExitRule.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceExitRule' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceExitRule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceExitRule value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceExitRule read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceExitRule given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceExitRule - * @throws IOException if the JSON string is invalid with respect to AudienceExitRule - */ - public static AudienceExitRule fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceExitRule.class); - } - - /** - * Convert an instance of AudienceExitRule to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/BaseState.java b/src/main/java/com/segment/publicapi/models/BaseState.java deleted file mode 100644 index c24e92ea..00000000 --- a/src/main/java/com/segment/publicapi/models/BaseState.java +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class BaseState extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(BaseState.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!BaseState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BaseState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterTransitionState = - gson.getDelegateAdapter(this, TypeToken.get(TransitionState.class)); - final TypeAdapter adapterExitState = - gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); - final TypeAdapter adapterExitDestinationState = - gson.getDelegateAdapter(this, TypeToken.get(ExitDestinationState.class)); - final TypeAdapter adapterExitRule = - gson.getDelegateAdapter(this, TypeToken.get(ExitRule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, BaseState value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `TransitionState` - if (value.getActualInstance() instanceof TransitionState) { - JsonElement element = - adapterTransitionState.toJsonTree( - (TransitionState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ExitState` - if (value.getActualInstance() instanceof ExitState) { - JsonElement element = - adapterExitState.toJsonTree( - (ExitState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ExitDestinationState` - if (value.getActualInstance() instanceof ExitDestinationState) { - JsonElement element = - adapterExitDestinationState.toJsonTree( - (ExitDestinationState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ExitRule` - if (value.getActualInstance() instanceof ExitRule) { - JsonElement element = - adapterExitRule.toJsonTree( - (ExitRule) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas:" - + " ExitDestinationState, ExitRule, ExitState," - + " TransitionState"); - } - - @Override - public BaseState read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize TransitionState - try { - // validate the JSON object to see if any exception is thrown - TransitionState.validateJsonElement(jsonElement); - actualAdapter = adapterTransitionState; - match++; - log.log(Level.FINER, "Input data matches schema 'TransitionState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for TransitionState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'TransitionState'", - e); - } - // deserialize ExitState - try { - // validate the JSON object to see if any exception is thrown - ExitState.validateJsonElement(jsonElement); - actualAdapter = adapterExitState; - match++; - log.log(Level.FINER, "Input data matches schema 'ExitState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ExitState failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ExitState'", - e); - } - // deserialize ExitDestinationState - try { - // validate the JSON object to see if any exception is thrown - ExitDestinationState.validateJsonElement(jsonElement); - actualAdapter = adapterExitDestinationState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'ExitDestinationState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ExitDestinationState failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ExitDestinationState'", - e); - } - // deserialize ExitRule - try { - // validate the JSON object to see if any exception is thrown - ExitRule.validateJsonElement(jsonElement); - actualAdapter = adapterExitRule; - match++; - log.log(Level.FINER, "Input data matches schema 'ExitRule'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ExitRule failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ExitRule'", - e); - } - - if (match == 1) { - BaseState ret = new BaseState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - "Failed deserialization for BaseState: %d classes match" - + " result, expected 1. Detailed failure message" - + " for oneOf schemas: %s. JSON: %s", - match, errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public BaseState() { - super("oneOf", Boolean.FALSE); - } - - public BaseState(ExitDestinationState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public BaseState(ExitRule o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public BaseState(ExitState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public BaseState(TransitionState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("TransitionState", TransitionState.class); - schemas.put("ExitState", ExitState.class); - schemas.put("ExitDestinationState", ExitDestinationState.class); - schemas.put("ExitRule", ExitRule.class); - } - - @Override - public Map> getSchemas() { - return BaseState.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: ExitDestinationState, ExitRule, ExitState, TransitionState - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof TransitionState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ExitState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ExitDestinationState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ExitRule) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be ExitDestinationState, ExitRule, ExitState," - + " TransitionState"); - } - - /** - * Get the actual instance, which can be the following: ExitDestinationState, ExitRule, - * ExitState, TransitionState - * - * @return The actual instance (ExitDestinationState, ExitRule, ExitState, TransitionState) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `TransitionState`. If the actual instance is not - * `TransitionState`, the ClassCastException will be thrown. - * - * @return The actual instance of `TransitionState` - * @throws ClassCastException if the instance is not `TransitionState` - */ - public TransitionState getTransitionState() throws ClassCastException { - return (TransitionState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ExitState`. If the actual instance is not `ExitState`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `ExitState` - * @throws ClassCastException if the instance is not `ExitState` - */ - public ExitState getExitState() throws ClassCastException { - return (ExitState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ExitDestinationState`. If the actual instance is not - * `ExitDestinationState`, the ClassCastException will be thrown. - * - * @return The actual instance of `ExitDestinationState` - * @throws ClassCastException if the instance is not `ExitDestinationState` - */ - public ExitDestinationState getExitDestinationState() throws ClassCastException { - return (ExitDestinationState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ExitRule`. If the actual instance is not `ExitRule`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `ExitRule` - * @throws ClassCastException if the instance is not `ExitRule` - */ - public ExitRule getExitRule() throws ClassCastException { - return (ExitRule) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BaseState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with TransitionState - try { - TransitionState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for TransitionState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ExitState - try { - ExitState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ExitState failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with ExitDestinationState - try { - ExitDestinationState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ExitDestinationState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ExitRule - try { - ExitRule.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ExitRule failed with `%s`.", e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - "The JSON string is invalid for BaseState with oneOf schemas:" - + " ExitDestinationState, ExitRule, ExitState, TransitionState. %d" - + " class(es) match the result, expected 1. Detailed failure" - + " message for oneOf schemas: %s. JSON: %s", - validCount, errorMessages, jsonElement.toString())); - } - } - - /** - * Create an instance of BaseState given an JSON string - * - * @param jsonString JSON string - * @return An instance of BaseState - * @throws IOException if the JSON string is invalid with respect to BaseState - */ - public static BaseState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BaseState.class); - } - - /** - * Convert an instance of BaseState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java b/src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java deleted file mode 100644 index 66082926..00000000 --- a/src/main/java/com/segment/publicapi/models/ConcurrencyConfig.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ConcurrencyConfig */ -public class ConcurrencyConfig { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CONCURRENCY_KEY = "concurrencyKey"; - - @SerializedName(SERIALIZED_NAME_CONCURRENCY_KEY) - private String concurrencyKey; - - public ConcurrencyConfig() {} - - public ConcurrencyConfig enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ConcurrencyConfig concurrencyKey(String concurrencyKey) { - - this.concurrencyKey = concurrencyKey; - return this; - } - - /** - * Get concurrencyKey - * - * @return concurrencyKey - */ - @javax.annotation.Nullable - public String getConcurrencyKey() { - return concurrencyKey; - } - - public void setConcurrencyKey(String concurrencyKey) { - this.concurrencyKey = concurrencyKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConcurrencyConfig concurrencyConfig = (ConcurrencyConfig) o; - return Objects.equals(this.enabled, concurrencyConfig.enabled) - && Objects.equals(this.concurrencyKey, concurrencyConfig.concurrencyKey); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, concurrencyKey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConcurrencyConfig {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" concurrencyKey: ").append(toIndentedString(concurrencyKey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enabled"); - openapiFields.add("concurrencyKey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("enabled"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConcurrencyConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConcurrencyConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ConcurrencyConfig is not found in the" - + " empty JSON string", - ConcurrencyConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConcurrencyConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ConcurrencyConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ConcurrencyConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("concurrencyKey") != null && !jsonObj.get("concurrencyKey").isJsonNull()) - && !jsonObj.get("concurrencyKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `concurrencyKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("concurrencyKey").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConcurrencyConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConcurrencyConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ConcurrencyConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ConcurrencyConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ConcurrencyConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ConcurrencyConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConcurrencyConfig - * @throws IOException if the JSON string is invalid with respect to ConcurrencyConfig - */ - public static ConcurrencyConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConcurrencyConfig.class); - } - - /** - * Convert an instance of ConcurrencyConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ConditionBranch.java b/src/main/java/com/segment/publicapi/models/ConditionBranch.java deleted file mode 100644 index 291e834c..00000000 --- a/src/main/java/com/segment/publicapi/models/ConditionBranch.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ConditionBranch */ -public class ConditionBranch { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - CONDITION("CONDITION"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_CONDITION = "condition"; - - @SerializedName(SERIALIZED_NAME_CONDITION) - private String condition; - - public static final String SERIALIZED_NAME_NEXT = "next"; - - @SerializedName(SERIALIZED_NAME_NEXT) - private String next; - - public ConditionBranch() {} - - public ConditionBranch type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public ConditionBranch condition(String condition) { - - this.condition = condition; - return this; - } - - /** - * Get condition - * - * @return condition - */ - @javax.annotation.Nonnull - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public ConditionBranch next(String next) { - - this.next = next; - return this; - } - - /** - * Get next - * - * @return next - */ - @javax.annotation.Nonnull - public String getNext() { - return next; - } - - public void setNext(String next) { - this.next = next; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConditionBranch conditionBranch = (ConditionBranch) o; - return Objects.equals(this.type, conditionBranch.type) - && Objects.equals(this.condition, conditionBranch.condition) - && Objects.equals(this.next, conditionBranch.next); - } - - @Override - public int hashCode() { - return Objects.hash(type, condition, next); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConditionBranch {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); - sb.append(" next: ").append(toIndentedString(next)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("condition"); - openapiFields.add("next"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("condition"); - openapiRequiredFields.add("next"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConditionBranch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConditionBranch.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ConditionBranch is not found in the" - + " empty JSON string", - ConditionBranch.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConditionBranch.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ConditionBranch` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ConditionBranch.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("condition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `condition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("condition").toString())); - } - if (!jsonObj.get("next").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `next` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("next").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConditionBranch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConditionBranch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ConditionBranch.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ConditionBranch value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ConditionBranch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ConditionBranch given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConditionBranch - * @throws IOException if the JSON string is invalid with respect to ConditionBranch - */ - public static ConditionBranch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConditionBranch.class); - } - - /** - * Convert an instance of ConditionBranch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ConditionSplitState.java b/src/main/java/com/segment/publicapi/models/ConditionSplitState.java deleted file mode 100644 index 5403ff83..00000000 --- a/src/main/java/com/segment/publicapi/models/ConditionSplitState.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ConditionSplitState */ -public class ConditionSplitState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - CONDITION_SPLIT("CONDITION_SPLIT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public ConditionSplitState() {} - - public ConditionSplitState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public ConditionSplitState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public ConditionSplitState addTransitionsItem(TransitionsInner1 transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public ConditionSplitState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ConditionSplitState conditionSplitState = (ConditionSplitState) o; - return Objects.equals(this.type, conditionSplitState.type) - && Objects.equals(this.transitions, conditionSplitState.transitions) - && Objects.equals(this.key, conditionSplitState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConditionSplitState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConditionSplitState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ConditionSplitState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ConditionSplitState is not found in" - + " the empty JSON string", - ConditionSplitState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ConditionSplitState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ConditionSplitState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ConditionSplitState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - TransitionsInner1.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ConditionSplitState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ConditionSplitState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ConditionSplitState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ConditionSplitState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ConditionSplitState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ConditionSplitState given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConditionSplitState - * @throws IOException if the JSON string is invalid with respect to ConditionSplitState - */ - public static ConditionSplitState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ConditionSplitState.class); - } - - /** - * Convert an instance of ConditionSplitState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateJourney201Response.java b/src/main/java/com/segment/publicapi/models/CreateJourney201Response.java deleted file mode 100644 index 9ba97722..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateJourney201Response.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** CreateJourney201Response */ -public class CreateJourney201Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CreateJourneyAlphaOutput data; - - public CreateJourney201Response() {} - - public CreateJourney201Response data(CreateJourneyAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public CreateJourneyAlphaOutput getData() { - return data; - } - - public void setData(CreateJourneyAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateJourney201Response createJourney201Response = (CreateJourney201Response) o; - return Objects.equals(this.data, createJourney201Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateJourney201Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateJourney201Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateJourney201Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateJourney201Response is not found" - + " in the empty JSON string", - CreateJourney201Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateJourney201Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateJourney201Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CreateJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateJourney201Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateJourney201Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateJourney201Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateJourney201Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateJourney201Response read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateJourney201Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateJourney201Response - * @throws IOException if the JSON string is invalid with respect to CreateJourney201Response - */ - public static CreateJourney201Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateJourney201Response.class); - } - - /** - * Convert an instance of CreateJourney201Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java deleted file mode 100644 index 3dbe5166..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaInput.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The journey Create input. */ -public class CreateJourneyAlphaInput { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private JourneyDefinition definition; - - public CreateJourneyAlphaInput() {} - - public CreateJourneyAlphaInput name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the journey. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CreateJourneyAlphaInput description(String description) { - - this.description = description; - return this; - } - - /** - * The description of the journey. - * - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public CreateJourneyAlphaInput definition(JourneyDefinition definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public JourneyDefinition getDefinition() { - return definition; - } - - public void setDefinition(JourneyDefinition definition) { - this.definition = definition; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateJourneyAlphaInput createJourneyAlphaInput = (CreateJourneyAlphaInput) o; - return Objects.equals(this.name, createJourneyAlphaInput.name) - && Objects.equals(this.description, createJourneyAlphaInput.description) - && Objects.equals(this.definition, createJourneyAlphaInput.definition); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, definition); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateJourneyAlphaInput {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("definition"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("definition"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateJourneyAlphaInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateJourneyAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateJourneyAlphaInput is not found" - + " in the empty JSON string", - CreateJourneyAlphaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateJourneyAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateJourneyAlphaInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateJourneyAlphaInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - // validate the required field `definition` - JourneyDefinition.validateJsonElement(jsonObj.get("definition")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateJourneyAlphaInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateJourneyAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateJourneyAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateJourneyAlphaInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateJourneyAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateJourneyAlphaInput - * @throws IOException if the JSON string is invalid with respect to CreateJourneyAlphaInput - */ - public static CreateJourneyAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateJourneyAlphaInput.class); - } - - /** - * Convert an instance of CreateJourneyAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java deleted file mode 100644 index 71aba1dd..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateJourneyAlphaOutput.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The journey Create output. */ -public class CreateJourneyAlphaOutput { - public static final String SERIALIZED_NAME_JOURNEY = "journey"; - - @SerializedName(SERIALIZED_NAME_JOURNEY) - private JourneyDetails journey; - - public CreateJourneyAlphaOutput() {} - - public CreateJourneyAlphaOutput journey(JourneyDetails journey) { - - this.journey = journey; - return this; - } - - /** - * Get journey - * - * @return journey - */ - @javax.annotation.Nonnull - public JourneyDetails getJourney() { - return journey; - } - - public void setJourney(JourneyDetails journey) { - this.journey = journey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateJourneyAlphaOutput createJourneyAlphaOutput = (CreateJourneyAlphaOutput) o; - return Objects.equals(this.journey, createJourneyAlphaOutput.journey); - } - - @Override - public int hashCode() { - return Objects.hash(journey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateJourneyAlphaOutput {\n"); - sb.append(" journey: ").append(toIndentedString(journey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("journey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("journey"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CreateJourneyAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateJourneyAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateJourneyAlphaOutput is not found" - + " in the empty JSON string", - CreateJourneyAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateJourneyAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateJourneyAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `journey` - JourneyDetails.validateJsonElement(jsonObj.get("journey")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateJourneyAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CreateJourneyAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateJourneyAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateJourneyAlphaOutput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateJourneyAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateJourneyAlphaOutput - * @throws IOException if the JSON string is invalid with respect to CreateJourneyAlphaOutput - */ - public static CreateJourneyAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateJourneyAlphaOutput.class); - } - - /** - * Convert an instance of CreateJourneyAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DefaultBranch.java b/src/main/java/com/segment/publicapi/models/DefaultBranch.java deleted file mode 100644 index 724b74d7..00000000 --- a/src/main/java/com/segment/publicapi/models/DefaultBranch.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** DefaultBranch */ -public class DefaultBranch { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - DEFAULT("DEFAULT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_NEXT = "next"; - - @SerializedName(SERIALIZED_NAME_NEXT) - private String next; - - public DefaultBranch() {} - - public DefaultBranch type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public DefaultBranch next(String next) { - - this.next = next; - return this; - } - - /** - * Get next - * - * @return next - */ - @javax.annotation.Nonnull - public String getNext() { - return next; - } - - public void setNext(String next) { - this.next = next; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DefaultBranch defaultBranch = (DefaultBranch) o; - return Objects.equals(this.type, defaultBranch.type) - && Objects.equals(this.next, defaultBranch.next); - } - - @Override - public int hashCode() { - return Objects.hash(type, next); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DefaultBranch {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" next: ").append(toIndentedString(next)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("next"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("next"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DefaultBranch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DefaultBranch.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DefaultBranch is not found in the" - + " empty JSON string", - DefaultBranch.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DefaultBranch.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DefaultBranch` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DefaultBranch.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("next").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `next` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("next").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DefaultBranch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DefaultBranch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DefaultBranch.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DefaultBranch value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DefaultBranch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DefaultBranch given an JSON string - * - * @param jsonString JSON string - * @return An instance of DefaultBranch - * @throws IOException if the JSON string is invalid with respect to DefaultBranch - */ - public static DefaultBranch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DefaultBranch.class); - } - - /** - * Convert an instance of DefaultBranch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Destination.java b/src/main/java/com/segment/publicapi/models/Destination.java deleted file mode 100644 index 738e9876..00000000 --- a/src/main/java/com/segment/publicapi/models/Destination.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Destination */ -public class Destination { - public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; - - @SerializedName(SERIALIZED_NAME_DESTINATION_ID) - private String destinationId; - - public static final String SERIALIZED_NAME_ACTIVATIONS = "activations"; - - @SerializedName(SERIALIZED_NAME_ACTIVATIONS) - private List activations = new ArrayList<>(); - - public Destination() {} - - public Destination destinationId(String destinationId) { - - this.destinationId = destinationId; - return this; - } - - /** - * Get destinationId - * - * @return destinationId - */ - @javax.annotation.Nonnull - public String getDestinationId() { - return destinationId; - } - - public void setDestinationId(String destinationId) { - this.destinationId = destinationId; - } - - public Destination activations(List activations) { - - this.activations = activations; - return this; - } - - public Destination addActivationsItem(Activation activationsItem) { - if (this.activations == null) { - this.activations = new ArrayList<>(); - } - this.activations.add(activationsItem); - return this; - } - - /** - * Get activations - * - * @return activations - */ - @javax.annotation.Nonnull - public List getActivations() { - return activations; - } - - public void setActivations(List activations) { - this.activations = activations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Destination destination = (Destination) o; - return Objects.equals(this.destinationId, destination.destinationId) - && Objects.equals(this.activations, destination.activations); - } - - @Override - public int hashCode() { - return Objects.hash(destinationId, activations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Destination {\n"); - sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); - sb.append(" activations: ").append(toIndentedString(activations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("destinationId"); - openapiFields.add("activations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("destinationId"); - openapiRequiredFields.add("activations"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Destination - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Destination.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Destination is not found in the empty" - + " JSON string", - Destination.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Destination.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Destination` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Destination.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("destinationId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinationId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("destinationId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("activations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activations` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("activations").toString())); - } - - JsonArray jsonArrayactivations = jsonObj.getAsJsonArray("activations"); - // validate the required field `activations` (array) - for (int i = 0; i < jsonArrayactivations.size(); i++) { - Activation.validateJsonElement(jsonArrayactivations.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Destination.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Destination' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Destination.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Destination value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Destination read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Destination given an JSON string - * - * @param jsonString JSON string - * @return An instance of Destination - * @throws IOException if the JSON string is invalid with respect to Destination - */ - public static Destination fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Destination.class); - } - - /** - * Convert an instance of Destination to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DestinationState.java b/src/main/java/com/segment/publicapi/models/DestinationState.java deleted file mode 100644 index 89d15123..00000000 --- a/src/main/java/com/segment/publicapi/models/DestinationState.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** DestinationState */ -public class DestinationState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - DESTINATION("DESTINATION"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; - - @SerializedName(SERIALIZED_NAME_DESTINATIONS) - private List destinations = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public DestinationState() {} - - public DestinationState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public DestinationState destinations(List destinations) { - - this.destinations = destinations; - return this; - } - - public DestinationState addDestinationsItem(Destination destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * Get destinations - * - * @return destinations - */ - @javax.annotation.Nonnull - public List getDestinations() { - return destinations; - } - - public void setDestinations(List destinations) { - this.destinations = destinations; - } - - public DestinationState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public DestinationState addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public DestinationState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DestinationState destinationState = (DestinationState) o; - return Objects.equals(this.type, destinationState.type) - && Objects.equals(this.destinations, destinationState.destinations) - && Objects.equals(this.transitions, destinationState.transitions) - && Objects.equals(this.key, destinationState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, destinations, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DestinationState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("destinations"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("destinations"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DestinationState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DestinationState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in DestinationState is not found in the" - + " empty JSON string", - DestinationState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DestinationState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `DestinationState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DestinationState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("destinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinations` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("destinations").toString())); - } - - JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); - // validate the required field `destinations` (array) - for (int i = 0; i < jsonArraydestinations.size(); i++) { - Destination.validateJsonElement(jsonArraydestinations.get(i)); - } - ; - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DestinationState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of DestinationState given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationState - * @throws IOException if the JSON string is invalid with respect to DestinationState - */ - public static DestinationState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationState.class); - } - - /** - * Convert an instance of DestinationState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/DestinationsInner.java b/src/main/java/com/segment/publicapi/models/DestinationsInner.java deleted file mode 100644 index 1bcc26b2..00000000 --- a/src/main/java/com/segment/publicapi/models/DestinationsInner.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class DestinationsInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(DestinationsInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DestinationsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DestinationsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterDestinationState = - gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); - final TypeAdapter adapterExitDestinationState = - gson.getDelegateAdapter(this, TypeToken.get(ExitDestinationState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, DestinationsInner value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `DestinationState` - if (value.getActualInstance() instanceof DestinationState) { - JsonElement element = - adapterDestinationState.toJsonTree( - (DestinationState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ExitDestinationState` - if (value.getActualInstance() instanceof ExitDestinationState) { - JsonElement element = - adapterExitDestinationState.toJsonTree( - (ExitDestinationState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " DestinationState, ExitDestinationState"); - } - - @Override - public DestinationsInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize DestinationState - try { - // validate the JSON object to see if any exception is thrown - DestinationState.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationState; - DestinationsInner ret = new DestinationsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationState'", - e); - } - // deserialize ExitDestinationState - try { - // validate the JSON object to see if any exception is thrown - ExitDestinationState.validateJsonElement(jsonElement); - actualAdapter = adapterExitDestinationState; - DestinationsInner ret = new DestinationsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ExitDestinationState failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ExitDestinationState'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for DestinationsInner: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public DestinationsInner() { - super("anyOf", Boolean.FALSE); - } - - public DestinationsInner(DestinationState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public DestinationsInner(ExitDestinationState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("DestinationState", DestinationState.class); - schemas.put("ExitDestinationState", ExitDestinationState.class); - } - - @Override - public Map> getSchemas() { - return DestinationsInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: DestinationState, ExitDestinationState - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof DestinationState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ExitDestinationState) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be DestinationState, ExitDestinationState"); - } - - /** - * Get the actual instance, which can be the following: DestinationState, ExitDestinationState - * - * @return The actual instance (DestinationState, ExitDestinationState) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationState`. If the actual instance is not - * `DestinationState`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationState` - * @throws ClassCastException if the instance is not `DestinationState` - */ - public DestinationState getDestinationState() throws ClassCastException { - return (DestinationState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ExitDestinationState`. If the actual instance is not - * `ExitDestinationState`, the ClassCastException will be thrown. - * - * @return The actual instance of `ExitDestinationState` - * @throws ClassCastException if the instance is not `ExitDestinationState` - */ - public ExitDestinationState getExitDestinationState() throws ClassCastException { - return (ExitDestinationState) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DestinationsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with DestinationState - try { - DestinationState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ExitDestinationState - try { - ExitDestinationState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ExitDestinationState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for DestinationsInner with anyOf schemas:" - + " DestinationState, ExitDestinationState. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of DestinationsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of DestinationsInner - * @throws IOException if the JSON string is invalid with respect to DestinationsInner - */ - public static DestinationsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DestinationsInner.class); - } - - /** - * Convert an instance of DestinationsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/EntryRules.java b/src/main/java/com/segment/publicapi/models/EntryRules.java deleted file mode 100644 index 576786eb..00000000 --- a/src/main/java/com/segment/publicapi/models/EntryRules.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** EntryRules */ -public class EntryRules { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - MULTIPLE("MULTIPLE"), - - ONCE("ONCE"), - - RE_ENTRY_AFTER_EXIT("RE_ENTRY_AFTER_EXIT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_CONCURRENCY = "concurrency"; - - @SerializedName(SERIALIZED_NAME_CONCURRENCY) - private ConcurrencyConfig concurrency; - - public EntryRules() {} - - public EntryRules type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public EntryRules concurrency(ConcurrencyConfig concurrency) { - - this.concurrency = concurrency; - return this; - } - - /** - * Get concurrency - * - * @return concurrency - */ - @javax.annotation.Nullable - public ConcurrencyConfig getConcurrency() { - return concurrency; - } - - public void setConcurrency(ConcurrencyConfig concurrency) { - this.concurrency = concurrency; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EntryRules entryRules = (EntryRules) o; - return Objects.equals(this.type, entryRules.type) - && Objects.equals(this.concurrency, entryRules.concurrency); - } - - @Override - public int hashCode() { - return Objects.hash(type, concurrency); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EntryRules {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" concurrency: ").append(toIndentedString(concurrency)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("concurrency"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EntryRules - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EntryRules.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EntryRules is not found in the empty" - + " JSON string", - EntryRules.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EntryRules.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EntryRules` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EntryRules.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // validate the optional field `concurrency` - if (jsonObj.get("concurrency") != null && !jsonObj.get("concurrency").isJsonNull()) { - ConcurrencyConfig.validateJsonElement(jsonObj.get("concurrency")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EntryRules.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EntryRules' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EntryRules.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EntryRules value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EntryRules read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EntryRules given an JSON string - * - * @param jsonString JSON string - * @return An instance of EntryRules - * @throws IOException if the JSON string is invalid with respect to EntryRules - */ - public static EntryRules fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EntryRules.class); - } - - /** - * Convert an instance of EntryRules to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/EventEntryState.java b/src/main/java/com/segment/publicapi/models/EventEntryState.java deleted file mode 100644 index f9516152..00000000 --- a/src/main/java/com/segment/publicapi/models/EventEntryState.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** EventEntryState */ -public class EventEntryState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EVENT_ENTRY("EVENT_ENTRY"), - - AUDIENCE_ENTRY("AUDIENCE_ENTRY"), - - DESTINATION("DESTINATION"), - - SIMPLE_DELAY("SIMPLE_DELAY"), - - EVENT_SPLIT("EVENT_SPLIT"), - - CONDITION_SPLIT("CONDITION_SPLIT"), - - RANDOM_SPLIT("RANDOM_SPLIT"), - - EXIT("EXIT"), - - EXIT_RULE("EXIT_RULE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_CONDITION = "condition"; - - @SerializedName(SERIALIZED_NAME_CONDITION) - private String condition; - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public EventEntryState() {} - - public EventEntryState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public EventEntryState condition(String condition) { - - this.condition = condition; - return this; - } - - /** - * Get condition - * - * @return condition - */ - @javax.annotation.Nonnull - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public EventEntryState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public EventEntryState addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public EventEntryState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EventEntryState eventEntryState = (EventEntryState) o; - return Objects.equals(this.type, eventEntryState.type) - && Objects.equals(this.condition, eventEntryState.condition) - && Objects.equals(this.transitions, eventEntryState.transitions) - && Objects.equals(this.key, eventEntryState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, condition, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventEntryState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("condition"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("condition"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EventEntryState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EventEntryState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EventEntryState is not found in the" - + " empty JSON string", - EventEntryState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EventEntryState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EventEntryState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EventEntryState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("condition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `condition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("condition").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EventEntryState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EventEntryState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EventEntryState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EventEntryState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EventEntryState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EventEntryState given an JSON string - * - * @param jsonString JSON string - * @return An instance of EventEntryState - * @throws IOException if the JSON string is invalid with respect to EventEntryState - */ - public static EventEntryState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EventEntryState.class); - } - - /** - * Convert an instance of EventEntryState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/EventExitRule.java b/src/main/java/com/segment/publicapi/models/EventExitRule.java deleted file mode 100644 index 67e7344e..00000000 --- a/src/main/java/com/segment/publicapi/models/EventExitRule.java +++ /dev/null @@ -1,509 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** EventExitRule */ -public class EventExitRule { - /** Gets or Sets exitType */ - @JsonAdapter(ExitTypeEnum.Adapter.class) - public enum ExitTypeEnum { - EVENT_PERFORMED("EVENT_PERFORMED"); - - private String value; - - ExitTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExitTypeEnum fromValue(String value) { - for (ExitTypeEnum b : ExitTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ExitTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ExitTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_EXIT_TYPE = "exitType"; - - @SerializedName(SERIALIZED_NAME_EXIT_TYPE) - private ExitTypeEnum exitType; - - public static final String SERIALIZED_NAME_CONDITION = "condition"; - - @SerializedName(SERIALIZED_NAME_CONDITION) - private String condition; - - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EXIT_RULE("EXIT_RULE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CONCURRENCY_ENABLED = "concurrencyEnabled"; - - @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) - private Boolean concurrencyEnabled; - - public static final String SERIALIZED_NAME_CONNECTED_DESTINATIONS = "connectedDestinations"; - - @SerializedName(SERIALIZED_NAME_CONNECTED_DESTINATIONS) - private List connectedDestinations; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public EventExitRule() {} - - public EventExitRule exitType(ExitTypeEnum exitType) { - - this.exitType = exitType; - return this; - } - - /** - * Get exitType - * - * @return exitType - */ - @javax.annotation.Nonnull - public ExitTypeEnum getExitType() { - return exitType; - } - - public void setExitType(ExitTypeEnum exitType) { - this.exitType = exitType; - } - - public EventExitRule condition(String condition) { - - this.condition = condition; - return this; - } - - /** - * Get condition - * - * @return condition - */ - @javax.annotation.Nonnull - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - - public EventExitRule type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public EventExitRule enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public EventExitRule concurrencyEnabled(Boolean concurrencyEnabled) { - - this.concurrencyEnabled = concurrencyEnabled; - return this; - } - - /** - * Get concurrencyEnabled - * - * @return concurrencyEnabled - */ - @javax.annotation.Nonnull - public Boolean getConcurrencyEnabled() { - return concurrencyEnabled; - } - - public void setConcurrencyEnabled(Boolean concurrencyEnabled) { - this.concurrencyEnabled = concurrencyEnabled; - } - - public EventExitRule connectedDestinations(List connectedDestinations) { - - this.connectedDestinations = connectedDestinations; - return this; - } - - public EventExitRule addConnectedDestinationsItem(String connectedDestinationsItem) { - if (this.connectedDestinations == null) { - this.connectedDestinations = new ArrayList<>(); - } - this.connectedDestinations.add(connectedDestinationsItem); - return this; - } - - /** - * Get connectedDestinations - * - * @return connectedDestinations - */ - @javax.annotation.Nullable - public List getConnectedDestinations() { - return connectedDestinations; - } - - public void setConnectedDestinations(List connectedDestinations) { - this.connectedDestinations = connectedDestinations; - } - - public EventExitRule key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EventExitRule eventExitRule = (EventExitRule) o; - return Objects.equals(this.exitType, eventExitRule.exitType) - && Objects.equals(this.condition, eventExitRule.condition) - && Objects.equals(this.type, eventExitRule.type) - && Objects.equals(this.enabled, eventExitRule.enabled) - && Objects.equals(this.concurrencyEnabled, eventExitRule.concurrencyEnabled) - && Objects.equals(this.connectedDestinations, eventExitRule.connectedDestinations) - && Objects.equals(this.key, eventExitRule.key); - } - - @Override - public int hashCode() { - return Objects.hash( - exitType, condition, type, enabled, concurrencyEnabled, connectedDestinations, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventExitRule {\n"); - sb.append(" exitType: ").append(toIndentedString(exitType)).append("\n"); - sb.append(" condition: ").append(toIndentedString(condition)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" concurrencyEnabled: ") - .append(toIndentedString(concurrencyEnabled)) - .append("\n"); - sb.append(" connectedDestinations: ") - .append(toIndentedString(connectedDestinations)) - .append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("exitType"); - openapiFields.add("condition"); - openapiFields.add("type"); - openapiFields.add("enabled"); - openapiFields.add("concurrencyEnabled"); - openapiFields.add("connectedDestinations"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("exitType"); - openapiRequiredFields.add("condition"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("concurrencyEnabled"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EventExitRule - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EventExitRule.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EventExitRule is not found in the" - + " empty JSON string", - EventExitRule.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EventExitRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EventExitRule` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EventExitRule.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("exitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `exitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("exitType").toString())); - } - if (!jsonObj.get("condition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `condition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("condition").toString())); - } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("connectedDestinations") != null - && !jsonObj.get("connectedDestinations").isJsonNull() - && !jsonObj.get("connectedDestinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `connectedDestinations` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("connectedDestinations").toString())); - } - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EventExitRule.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EventExitRule' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EventExitRule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EventExitRule value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EventExitRule read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EventExitRule given an JSON string - * - * @param jsonString JSON string - * @return An instance of EventExitRule - * @throws IOException if the JSON string is invalid with respect to EventExitRule - */ - public static EventExitRule fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EventExitRule.class); - } - - /** - * Convert an instance of EventExitRule to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java b/src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java deleted file mode 100644 index 669c80b6..00000000 --- a/src/main/java/com/segment/publicapi/models/EventSplitWithTimeoutState.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** EventSplitWithTimeoutState */ -public class EventSplitWithTimeoutState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EVENT_SPLIT("EVENT_SPLIT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public EventSplitWithTimeoutState() {} - - public EventSplitWithTimeoutState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public EventSplitWithTimeoutState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public EventSplitWithTimeoutState addTransitionsItem(TransitionsInner transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public EventSplitWithTimeoutState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EventSplitWithTimeoutState eventSplitWithTimeoutState = (EventSplitWithTimeoutState) o; - return Objects.equals(this.type, eventSplitWithTimeoutState.type) - && Objects.equals(this.transitions, eventSplitWithTimeoutState.transitions) - && Objects.equals(this.key, eventSplitWithTimeoutState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventSplitWithTimeoutState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EventSplitWithTimeoutState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EventSplitWithTimeoutState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EventSplitWithTimeoutState is not" - + " found in the empty JSON string", - EventSplitWithTimeoutState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EventSplitWithTimeoutState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EventSplitWithTimeoutState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EventSplitWithTimeoutState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - TransitionsInner.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EventSplitWithTimeoutState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EventSplitWithTimeoutState' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EventSplitWithTimeoutState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EventSplitWithTimeoutState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EventSplitWithTimeoutState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EventSplitWithTimeoutState given an JSON string - * - * @param jsonString JSON string - * @return An instance of EventSplitWithTimeoutState - * @throws IOException if the JSON string is invalid with respect to EventSplitWithTimeoutState - */ - public static EventSplitWithTimeoutState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EventSplitWithTimeoutState.class); - } - - /** - * Convert an instance of EventSplitWithTimeoutState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ExitDestinationState.java b/src/main/java/com/segment/publicapi/models/ExitDestinationState.java deleted file mode 100644 index 17f9b323..00000000 --- a/src/main/java/com/segment/publicapi/models/ExitDestinationState.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ExitDestinationState */ -public class ExitDestinationState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - DESTINATION("DESTINATION"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; - - @SerializedName(SERIALIZED_NAME_DESTINATIONS) - private List destinations = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public ExitDestinationState() {} - - public ExitDestinationState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public ExitDestinationState destinations(List destinations) { - - this.destinations = destinations; - return this; - } - - public ExitDestinationState addDestinationsItem(Destination destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * Get destinations - * - * @return destinations - */ - @javax.annotation.Nonnull - public List getDestinations() { - return destinations; - } - - public void setDestinations(List destinations) { - this.destinations = destinations; - } - - public ExitDestinationState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExitDestinationState exitDestinationState = (ExitDestinationState) o; - return Objects.equals(this.type, exitDestinationState.type) - && Objects.equals(this.destinations, exitDestinationState.destinations) - && Objects.equals(this.key, exitDestinationState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, destinations, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExitDestinationState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("destinations"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("destinations"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExitDestinationState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExitDestinationState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExitDestinationState is not found in" - + " the empty JSON string", - ExitDestinationState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExitDestinationState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExitDestinationState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExitDestinationState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("destinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinations` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("destinations").toString())); - } - - JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); - // validate the required field `destinations` (array) - for (int i = 0; i < jsonArraydestinations.size(); i++) { - Destination.validateJsonElement(jsonArraydestinations.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExitDestinationState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExitDestinationState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExitDestinationState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExitDestinationState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExitDestinationState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExitDestinationState given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExitDestinationState - * @throws IOException if the JSON string is invalid with respect to ExitDestinationState - */ - public static ExitDestinationState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExitDestinationState.class); - } - - /** - * Convert an instance of ExitDestinationState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ExitRule.java b/src/main/java/com/segment/publicapi/models/ExitRule.java deleted file mode 100644 index 9e27131c..00000000 --- a/src/main/java/com/segment/publicapi/models/ExitRule.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ExitRule */ -public class ExitRule { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EXIT_RULE("EXIT_RULE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - /** Gets or Sets exitType */ - @JsonAdapter(ExitTypeEnum.Adapter.class) - public enum ExitTypeEnum { - AUDIENCE_MEMBERSHIP_CHANGE("AUDIENCE_MEMBERSHIP_CHANGE"), - - CONDITION_UNMATCH("CONDITION_UNMATCH"), - - EVENT_PERFORMED("EVENT_PERFORMED"); - - private String value; - - ExitTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExitTypeEnum fromValue(String value) { - for (ExitTypeEnum b : ExitTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ExitTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExitTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ExitTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_EXIT_TYPE = "exitType"; - - @SerializedName(SERIALIZED_NAME_EXIT_TYPE) - private ExitTypeEnum exitType; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_CONCURRENCY_ENABLED = "concurrencyEnabled"; - - @SerializedName(SERIALIZED_NAME_CONCURRENCY_ENABLED) - private Boolean concurrencyEnabled; - - public static final String SERIALIZED_NAME_CONNECTED_DESTINATIONS = "connectedDestinations"; - - @SerializedName(SERIALIZED_NAME_CONNECTED_DESTINATIONS) - private List connectedDestinations; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public ExitRule() {} - - public ExitRule type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public ExitRule exitType(ExitTypeEnum exitType) { - - this.exitType = exitType; - return this; - } - - /** - * Get exitType - * - * @return exitType - */ - @javax.annotation.Nonnull - public ExitTypeEnum getExitType() { - return exitType; - } - - public void setExitType(ExitTypeEnum exitType) { - this.exitType = exitType; - } - - public ExitRule enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ExitRule concurrencyEnabled(Boolean concurrencyEnabled) { - - this.concurrencyEnabled = concurrencyEnabled; - return this; - } - - /** - * Get concurrencyEnabled - * - * @return concurrencyEnabled - */ - @javax.annotation.Nonnull - public Boolean getConcurrencyEnabled() { - return concurrencyEnabled; - } - - public void setConcurrencyEnabled(Boolean concurrencyEnabled) { - this.concurrencyEnabled = concurrencyEnabled; - } - - public ExitRule connectedDestinations(List connectedDestinations) { - - this.connectedDestinations = connectedDestinations; - return this; - } - - public ExitRule addConnectedDestinationsItem(String connectedDestinationsItem) { - if (this.connectedDestinations == null) { - this.connectedDestinations = new ArrayList<>(); - } - this.connectedDestinations.add(connectedDestinationsItem); - return this; - } - - /** - * Get connectedDestinations - * - * @return connectedDestinations - */ - @javax.annotation.Nullable - public List getConnectedDestinations() { - return connectedDestinations; - } - - public void setConnectedDestinations(List connectedDestinations) { - this.connectedDestinations = connectedDestinations; - } - - public ExitRule key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExitRule exitRule = (ExitRule) o; - return Objects.equals(this.type, exitRule.type) - && Objects.equals(this.exitType, exitRule.exitType) - && Objects.equals(this.enabled, exitRule.enabled) - && Objects.equals(this.concurrencyEnabled, exitRule.concurrencyEnabled) - && Objects.equals(this.connectedDestinations, exitRule.connectedDestinations) - && Objects.equals(this.key, exitRule.key); - } - - @Override - public int hashCode() { - return Objects.hash( - type, exitType, enabled, concurrencyEnabled, connectedDestinations, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExitRule {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" exitType: ").append(toIndentedString(exitType)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" concurrencyEnabled: ") - .append(toIndentedString(concurrencyEnabled)) - .append("\n"); - sb.append(" connectedDestinations: ") - .append(toIndentedString(connectedDestinations)) - .append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("exitType"); - openapiFields.add("enabled"); - openapiFields.add("concurrencyEnabled"); - openapiFields.add("connectedDestinations"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("exitType"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("concurrencyEnabled"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExitRule - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExitRule.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExitRule is not found in the empty" - + " JSON string", - ExitRule.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExitRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `ExitRule`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExitRule.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("exitType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `exitType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("exitType").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("connectedDestinations") != null - && !jsonObj.get("connectedDestinations").isJsonNull() - && !jsonObj.get("connectedDestinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `connectedDestinations` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("connectedDestinations").toString())); - } - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExitRule.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExitRule' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExitRule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExitRule value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExitRule read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExitRule given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExitRule - * @throws IOException if the JSON string is invalid with respect to ExitRule - */ - public static ExitRule fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExitRule.class); - } - - /** - * Convert an instance of ExitRule to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java b/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java deleted file mode 100644 index 53cad672..00000000 --- a/src/main/java/com/segment/publicapi/models/ExitRulesConfig.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The exit rules configuration. */ -public class ExitRulesConfig { - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_RULES = "rules"; - - @SerializedName(SERIALIZED_NAME_RULES) - private List rules = new ArrayList<>(); - - public static final String SERIALIZED_NAME_RELATED_DESTINATIONS = "relatedDestinations"; - - @SerializedName(SERIALIZED_NAME_RELATED_DESTINATIONS) - private List relatedDestinations; - - public ExitRulesConfig() {} - - public ExitRulesConfig enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Get enabled - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public ExitRulesConfig rules(List rules) { - - this.rules = rules; - return this; - } - - public ExitRulesConfig addRulesItem(RulesInner rulesItem) { - if (this.rules == null) { - this.rules = new ArrayList<>(); - } - this.rules.add(rulesItem); - return this; - } - - /** - * Get rules - * - * @return rules - */ - @javax.annotation.Nonnull - public List getRules() { - return rules; - } - - public void setRules(List rules) { - this.rules = rules; - } - - public ExitRulesConfig relatedDestinations(List relatedDestinations) { - - this.relatedDestinations = relatedDestinations; - return this; - } - - public ExitRulesConfig addRelatedDestinationsItem( - ExitDestinationState relatedDestinationsItem) { - if (this.relatedDestinations == null) { - this.relatedDestinations = new ArrayList<>(); - } - this.relatedDestinations.add(relatedDestinationsItem); - return this; - } - - /** - * Get relatedDestinations - * - * @return relatedDestinations - */ - @javax.annotation.Nullable - public List getRelatedDestinations() { - return relatedDestinations; - } - - public void setRelatedDestinations(List relatedDestinations) { - this.relatedDestinations = relatedDestinations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExitRulesConfig exitRulesConfig = (ExitRulesConfig) o; - return Objects.equals(this.enabled, exitRulesConfig.enabled) - && Objects.equals(this.rules, exitRulesConfig.rules) - && Objects.equals(this.relatedDestinations, exitRulesConfig.relatedDestinations); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, rules, relatedDestinations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExitRulesConfig {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); - sb.append(" relatedDestinations: ") - .append(toIndentedString(relatedDestinations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("enabled"); - openapiFields.add("rules"); - openapiFields.add("relatedDestinations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("rules"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExitRulesConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExitRulesConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExitRulesConfig is not found in the" - + " empty JSON string", - ExitRulesConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExitRulesConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExitRulesConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExitRulesConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("rules").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `rules` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("rules").toString())); - } - - JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); - // validate the required field `rules` (array) - for (int i = 0; i < jsonArrayrules.size(); i++) { - RulesInner.validateJsonElement(jsonArrayrules.get(i)); - } - ; - if (jsonObj.get("relatedDestinations") != null - && !jsonObj.get("relatedDestinations").isJsonNull()) { - JsonArray jsonArrayrelatedDestinations = jsonObj.getAsJsonArray("relatedDestinations"); - if (jsonArrayrelatedDestinations != null) { - // ensure the json data is an array - if (!jsonObj.get("relatedDestinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `relatedDestinations` to be an array in the" - + " JSON string but got `%s`", - jsonObj.get("relatedDestinations").toString())); - } - - // validate the optional field `relatedDestinations` (array) - for (int i = 0; i < jsonArrayrelatedDestinations.size(); i++) { - ExitDestinationState.validateJsonElement(jsonArrayrelatedDestinations.get(i)); - } - ; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExitRulesConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExitRulesConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExitRulesConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExitRulesConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExitRulesConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExitRulesConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExitRulesConfig - * @throws IOException if the JSON string is invalid with respect to ExitRulesConfig - */ - public static ExitRulesConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExitRulesConfig.class); - } - - /** - * Convert an instance of ExitRulesConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ExitState.java b/src/main/java/com/segment/publicapi/models/ExitState.java deleted file mode 100644 index 84d16de6..00000000 --- a/src/main/java/com/segment/publicapi/models/ExitState.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ExitState */ -public class ExitState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EXIT("EXIT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public ExitState() {} - - public ExitState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public ExitState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExitState exitState = (ExitState) o; - return Objects.equals(this.type, exitState.type) && Objects.equals(this.key, exitState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExitState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExitState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExitState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ExitState is not found in the empty" - + " JSON string", - ExitState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExitState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ExitState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExitState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExitState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExitState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ExitState value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExitState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ExitState given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExitState - * @throws IOException if the JSON string is invalid with respect to ExitState - */ - public static ExitState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExitState.class); - } - - /** - * Convert an instance of ExitState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetJourney200Response.java b/src/main/java/com/segment/publicapi/models/GetJourney200Response.java deleted file mode 100644 index b04d58c2..00000000 --- a/src/main/java/com/segment/publicapi/models/GetJourney200Response.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** GetJourney200Response */ -public class GetJourney200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetJourneyAlphaOutput data; - - public GetJourney200Response() {} - - public GetJourney200Response data(GetJourneyAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public GetJourneyAlphaOutput getData() { - return data; - } - - public void setData(GetJourneyAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetJourney200Response getJourney200Response = (GetJourney200Response) o; - return Objects.equals(this.data, getJourney200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetJourney200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GetJourney200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetJourney200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetJourney200Response is not found in" - + " the empty JSON string", - GetJourney200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetJourney200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetJourney200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetJourney200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetJourney200Response' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetJourney200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetJourney200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetJourney200Response read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetJourney200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetJourney200Response - * @throws IOException if the JSON string is invalid with respect to GetJourney200Response - */ - public static GetJourney200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetJourney200Response.class); - } - - /** - * Convert an instance of GetJourney200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java deleted file mode 100644 index d90e78f3..00000000 --- a/src/main/java/com/segment/publicapi/models/GetJourneyAlphaOutput.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** GetJourneyAlphaOutput */ -public class GetJourneyAlphaOutput { - public static final String SERIALIZED_NAME_JOURNEY = "journey"; - - @SerializedName(SERIALIZED_NAME_JOURNEY) - private JourneyInfo journey; - - public GetJourneyAlphaOutput() {} - - public GetJourneyAlphaOutput journey(JourneyInfo journey) { - - this.journey = journey; - return this; - } - - /** - * Get journey - * - * @return journey - */ - @javax.annotation.Nonnull - public JourneyInfo getJourney() { - return journey; - } - - public void setJourney(JourneyInfo journey) { - this.journey = journey; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetJourneyAlphaOutput getJourneyAlphaOutput = (GetJourneyAlphaOutput) o; - return Objects.equals(this.journey, getJourneyAlphaOutput.journey); - } - - @Override - public int hashCode() { - return Objects.hash(journey); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetJourneyAlphaOutput {\n"); - sb.append(" journey: ").append(toIndentedString(journey)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("journey"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("journey"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GetJourneyAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetJourneyAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetJourneyAlphaOutput is not found in" - + " the empty JSON string", - GetJourneyAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetJourneyAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetJourneyAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `journey` - JourneyInfo.validateJsonElement(jsonObj.get("journey")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetJourneyAlphaOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(GetJourneyAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetJourneyAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetJourneyAlphaOutput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetJourneyAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetJourneyAlphaOutput - * @throws IOException if the JSON string is invalid with respect to GetJourneyAlphaOutput - */ - public static GetJourneyAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetJourneyAlphaOutput.class); - } - - /** - * Convert an instance of GetJourneyAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java b/src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java deleted file mode 100644 index 1c753e31..00000000 --- a/src/main/java/com/segment/publicapi/models/GetJourneyAnalytics200Response.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** GetJourneyAnalytics200Response */ -public class GetJourneyAnalytics200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetJourneyAnalyticsAlphaOutput data; - - public GetJourneyAnalytics200Response() {} - - public GetJourneyAnalytics200Response data(GetJourneyAnalyticsAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public GetJourneyAnalyticsAlphaOutput getData() { - return data; - } - - public void setData(GetJourneyAnalyticsAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetJourneyAnalytics200Response getJourneyAnalytics200Response = - (GetJourneyAnalytics200Response) o; - return Objects.equals(this.data, getJourneyAnalytics200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetJourneyAnalytics200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetJourneyAnalytics200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetJourneyAnalytics200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetJourneyAnalytics200Response is not" - + " found in the empty JSON string", - GetJourneyAnalytics200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetJourneyAnalytics200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetJourneyAnalytics200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetJourneyAnalyticsAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetJourneyAnalytics200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetJourneyAnalytics200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetJourneyAnalytics200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetJourneyAnalytics200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetJourneyAnalytics200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetJourneyAnalytics200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetJourneyAnalytics200Response - * @throws IOException if the JSON string is invalid with respect to - * GetJourneyAnalytics200Response - */ - public static GetJourneyAnalytics200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetJourneyAnalytics200Response.class); - } - - /** - * Convert an instance of GetJourneyAnalytics200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java deleted file mode 100644 index bfc0a92d..00000000 --- a/src/main/java/com/segment/publicapi/models/GetJourneyAnalyticsAlphaOutput.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Get journey analytics input. */ -public class GetJourneyAnalyticsAlphaOutput { - public static final String SERIALIZED_NAME_JOURNEY_ANALYTICS = "journeyAnalytics"; - - @SerializedName(SERIALIZED_NAME_JOURNEY_ANALYTICS) - private JourneyAnalytics journeyAnalytics; - - public GetJourneyAnalyticsAlphaOutput() {} - - public GetJourneyAnalyticsAlphaOutput journeyAnalytics(JourneyAnalytics journeyAnalytics) { - - this.journeyAnalytics = journeyAnalytics; - return this; - } - - /** - * Get journeyAnalytics - * - * @return journeyAnalytics - */ - @javax.annotation.Nonnull - public JourneyAnalytics getJourneyAnalytics() { - return journeyAnalytics; - } - - public void setJourneyAnalytics(JourneyAnalytics journeyAnalytics) { - this.journeyAnalytics = journeyAnalytics; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetJourneyAnalyticsAlphaOutput getJourneyAnalyticsAlphaOutput = - (GetJourneyAnalyticsAlphaOutput) o; - return Objects.equals( - this.journeyAnalytics, getJourneyAnalyticsAlphaOutput.journeyAnalytics); - } - - @Override - public int hashCode() { - return Objects.hash(journeyAnalytics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetJourneyAnalyticsAlphaOutput {\n"); - sb.append(" journeyAnalytics: ").append(toIndentedString(journeyAnalytics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("journeyAnalytics"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("journeyAnalytics"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetJourneyAnalyticsAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetJourneyAnalyticsAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetJourneyAnalyticsAlphaOutput is not" - + " found in the empty JSON string", - GetJourneyAnalyticsAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetJourneyAnalyticsAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetJourneyAnalyticsAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetJourneyAnalyticsAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `journeyAnalytics` - JourneyAnalytics.validateJsonElement(jsonObj.get("journeyAnalytics")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetJourneyAnalyticsAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetJourneyAnalyticsAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetJourneyAnalyticsAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetJourneyAnalyticsAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetJourneyAnalyticsAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetJourneyAnalyticsAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetJourneyAnalyticsAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * GetJourneyAnalyticsAlphaOutput - */ - public static GetJourneyAnalyticsAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetJourneyAnalyticsAlphaOutput.class); - } - - /** - * Convert an instance of GetJourneyAnalyticsAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/JourneyAnalytics.java b/src/main/java/com/segment/publicapi/models/JourneyAnalytics.java deleted file mode 100644 index e880fad4..00000000 --- a/src/main/java/com/segment/publicapi/models/JourneyAnalytics.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** JourneyAnalytics */ -public class JourneyAnalytics { - public static final String SERIALIZED_NAME_TOP_LEVEL_ANALYTICS = "topLevelAnalytics"; - - @SerializedName(SERIALIZED_NAME_TOP_LEVEL_ANALYTICS) - private TopLevelAnalytics topLevelAnalytics; - - public static final String SERIALIZED_NAME_STEP_LEVEL_ANALYTICS = "stepLevelAnalytics"; - - @SerializedName(SERIALIZED_NAME_STEP_LEVEL_ANALYTICS) - private List stepLevelAnalytics = new ArrayList<>(); - - public JourneyAnalytics() {} - - public JourneyAnalytics topLevelAnalytics(TopLevelAnalytics topLevelAnalytics) { - - this.topLevelAnalytics = topLevelAnalytics; - return this; - } - - /** - * Get topLevelAnalytics - * - * @return topLevelAnalytics - */ - @javax.annotation.Nonnull - public TopLevelAnalytics getTopLevelAnalytics() { - return topLevelAnalytics; - } - - public void setTopLevelAnalytics(TopLevelAnalytics topLevelAnalytics) { - this.topLevelAnalytics = topLevelAnalytics; - } - - public JourneyAnalytics stepLevelAnalytics(List stepLevelAnalytics) { - - this.stepLevelAnalytics = stepLevelAnalytics; - return this; - } - - public JourneyAnalytics addStepLevelAnalyticsItem(StepLevelAnalytics stepLevelAnalyticsItem) { - if (this.stepLevelAnalytics == null) { - this.stepLevelAnalytics = new ArrayList<>(); - } - this.stepLevelAnalytics.add(stepLevelAnalyticsItem); - return this; - } - - /** - * Get stepLevelAnalytics - * - * @return stepLevelAnalytics - */ - @javax.annotation.Nonnull - public List getStepLevelAnalytics() { - return stepLevelAnalytics; - } - - public void setStepLevelAnalytics(List stepLevelAnalytics) { - this.stepLevelAnalytics = stepLevelAnalytics; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JourneyAnalytics journeyAnalytics = (JourneyAnalytics) o; - return Objects.equals(this.topLevelAnalytics, journeyAnalytics.topLevelAnalytics) - && Objects.equals(this.stepLevelAnalytics, journeyAnalytics.stepLevelAnalytics); - } - - @Override - public int hashCode() { - return Objects.hash(topLevelAnalytics, stepLevelAnalytics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JourneyAnalytics {\n"); - sb.append(" topLevelAnalytics: ") - .append(toIndentedString(topLevelAnalytics)) - .append("\n"); - sb.append(" stepLevelAnalytics: ") - .append(toIndentedString(stepLevelAnalytics)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("topLevelAnalytics"); - openapiFields.add("stepLevelAnalytics"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("topLevelAnalytics"); - openapiRequiredFields.add("stepLevelAnalytics"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JourneyAnalytics - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!JourneyAnalytics.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in JourneyAnalytics is not found in the" - + " empty JSON string", - JourneyAnalytics.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JourneyAnalytics.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `JourneyAnalytics` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : JourneyAnalytics.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `topLevelAnalytics` - TopLevelAnalytics.validateJsonElement(jsonObj.get("topLevelAnalytics")); - // ensure the json data is an array - if (!jsonObj.get("stepLevelAnalytics").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stepLevelAnalytics` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("stepLevelAnalytics").toString())); - } - - JsonArray jsonArraystepLevelAnalytics = jsonObj.getAsJsonArray("stepLevelAnalytics"); - // validate the required field `stepLevelAnalytics` (array) - for (int i = 0; i < jsonArraystepLevelAnalytics.size(); i++) { - StepLevelAnalytics.validateJsonElement(jsonArraystepLevelAnalytics.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JourneyAnalytics.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JourneyAnalytics' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(JourneyAnalytics.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, JourneyAnalytics value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JourneyAnalytics read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of JourneyAnalytics given an JSON string - * - * @param jsonString JSON string - * @return An instance of JourneyAnalytics - * @throws IOException if the JSON string is invalid with respect to JourneyAnalytics - */ - public static JourneyAnalytics fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JourneyAnalytics.class); - } - - /** - * Convert an instance of JourneyAnalytics to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/JourneyDefinition.java b/src/main/java/com/segment/publicapi/models/JourneyDefinition.java deleted file mode 100644 index 2938e601..00000000 --- a/src/main/java/com/segment/publicapi/models/JourneyDefinition.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The journey definition. */ -public class JourneyDefinition { - public static final String SERIALIZED_NAME_INITIAL_STATE = "initialState"; - - @SerializedName(SERIALIZED_NAME_INITIAL_STATE) - private String initialState; - - public static final String SERIALIZED_NAME_ENTRY_RULES = "entryRules"; - - @SerializedName(SERIALIZED_NAME_ENTRY_RULES) - private EntryRules entryRules; - - public static final String SERIALIZED_NAME_EXIT_RULES = "exitRules"; - - @SerializedName(SERIALIZED_NAME_EXIT_RULES) - private ExitRulesConfig exitRules; - - public static final String SERIALIZED_NAME_STATES = "states"; - - @SerializedName(SERIALIZED_NAME_STATES) - private List states = new ArrayList<>(); - - public JourneyDefinition() {} - - public JourneyDefinition initialState(String initialState) { - - this.initialState = initialState; - return this; - } - - /** - * The initial state of the journey. - * - * @return initialState - */ - @javax.annotation.Nonnull - public String getInitialState() { - return initialState; - } - - public void setInitialState(String initialState) { - this.initialState = initialState; - } - - public JourneyDefinition entryRules(EntryRules entryRules) { - - this.entryRules = entryRules; - return this; - } - - /** - * Get entryRules - * - * @return entryRules - */ - @javax.annotation.Nonnull - public EntryRules getEntryRules() { - return entryRules; - } - - public void setEntryRules(EntryRules entryRules) { - this.entryRules = entryRules; - } - - public JourneyDefinition exitRules(ExitRulesConfig exitRules) { - - this.exitRules = exitRules; - return this; - } - - /** - * Get exitRules - * - * @return exitRules - */ - @javax.annotation.Nonnull - public ExitRulesConfig getExitRules() { - return exitRules; - } - - public void setExitRules(ExitRulesConfig exitRules) { - this.exitRules = exitRules; - } - - public JourneyDefinition states(List states) { - - this.states = states; - return this; - } - - public JourneyDefinition addStatesItem(JourneyState statesItem) { - if (this.states == null) { - this.states = new ArrayList<>(); - } - this.states.add(statesItem); - return this; - } - - /** - * The states of the journey. - * - * @return states - */ - @javax.annotation.Nonnull - public List getStates() { - return states; - } - - public void setStates(List states) { - this.states = states; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JourneyDefinition journeyDefinition = (JourneyDefinition) o; - return Objects.equals(this.initialState, journeyDefinition.initialState) - && Objects.equals(this.entryRules, journeyDefinition.entryRules) - && Objects.equals(this.exitRules, journeyDefinition.exitRules) - && Objects.equals(this.states, journeyDefinition.states); - } - - @Override - public int hashCode() { - return Objects.hash(initialState, entryRules, exitRules, states); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JourneyDefinition {\n"); - sb.append(" initialState: ").append(toIndentedString(initialState)).append("\n"); - sb.append(" entryRules: ").append(toIndentedString(entryRules)).append("\n"); - sb.append(" exitRules: ").append(toIndentedString(exitRules)).append("\n"); - sb.append(" states: ").append(toIndentedString(states)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("initialState"); - openapiFields.add("entryRules"); - openapiFields.add("exitRules"); - openapiFields.add("states"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("initialState"); - openapiRequiredFields.add("entryRules"); - openapiRequiredFields.add("exitRules"); - openapiRequiredFields.add("states"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JourneyDefinition - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!JourneyDefinition.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in JourneyDefinition is not found in the" - + " empty JSON string", - JourneyDefinition.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JourneyDefinition.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `JourneyDefinition` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : JourneyDefinition.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("initialState").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `initialState` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("initialState").toString())); - } - // validate the required field `entryRules` - EntryRules.validateJsonElement(jsonObj.get("entryRules")); - // validate the required field `exitRules` - ExitRulesConfig.validateJsonElement(jsonObj.get("exitRules")); - // ensure the json data is an array - if (!jsonObj.get("states").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `states` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("states").toString())); - } - - JsonArray jsonArraystates = jsonObj.getAsJsonArray("states"); - // validate the required field `states` (array) - for (int i = 0; i < jsonArraystates.size(); i++) { - JourneyState.validateJsonElement(jsonArraystates.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JourneyDefinition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JourneyDefinition' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(JourneyDefinition.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, JourneyDefinition value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JourneyDefinition read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of JourneyDefinition given an JSON string - * - * @param jsonString JSON string - * @return An instance of JourneyDefinition - * @throws IOException if the JSON string is invalid with respect to JourneyDefinition - */ - public static JourneyDefinition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JourneyDefinition.class); - } - - /** - * Convert an instance of JourneyDefinition to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/JourneyDetails.java b/src/main/java/com/segment/publicapi/models/JourneyDetails.java deleted file mode 100644 index 5d398568..00000000 --- a/src/main/java/com/segment/publicapi/models/JourneyDetails.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** JourneyDetails */ -public class JourneyDetails { - public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; - - @SerializedName(SERIALIZED_NAME_CONTAINER_ID) - private String containerId; - - public static final String SERIALIZED_NAME_VERSION_NUMBER = "versionNumber"; - - @SerializedName(SERIALIZED_NAME_VERSION_NUMBER) - private BigDecimal versionNumber; - - public JourneyDetails() {} - - public JourneyDetails containerId(String containerId) { - - this.containerId = containerId; - return this; - } - - /** - * Get containerId - * - * @return containerId - */ - @javax.annotation.Nullable - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public JourneyDetails versionNumber(BigDecimal versionNumber) { - - this.versionNumber = versionNumber; - return this; - } - - /** - * Get versionNumber - * - * @return versionNumber - */ - @javax.annotation.Nullable - public BigDecimal getVersionNumber() { - return versionNumber; - } - - public void setVersionNumber(BigDecimal versionNumber) { - this.versionNumber = versionNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JourneyDetails journeyDetails = (JourneyDetails) o; - return Objects.equals(this.containerId, journeyDetails.containerId) - && Objects.equals(this.versionNumber, journeyDetails.versionNumber); - } - - @Override - public int hashCode() { - return Objects.hash(containerId, versionNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JourneyDetails {\n"); - sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); - sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerId"); - openapiFields.add("versionNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JourneyDetails - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!JourneyDetails.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in JourneyDetails is not found in the" - + " empty JSON string", - JourneyDetails.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JourneyDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `JourneyDetails` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("containerId") != null && !jsonObj.get("containerId").isJsonNull()) - && !jsonObj.get("containerId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `containerId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("containerId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JourneyDetails.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JourneyDetails' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(JourneyDetails.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, JourneyDetails value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JourneyDetails read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of JourneyDetails given an JSON string - * - * @param jsonString JSON string - * @return An instance of JourneyDetails - * @throws IOException if the JSON string is invalid with respect to JourneyDetails - */ - public static JourneyDetails fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JourneyDetails.class); - } - - /** - * Convert an instance of JourneyDetails to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/JourneyInfo.java b/src/main/java/com/segment/publicapi/models/JourneyInfo.java deleted file mode 100644 index bdb8dc80..00000000 --- a/src/main/java/com/segment/publicapi/models/JourneyInfo.java +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** JourneyInfo */ -public class JourneyInfo { - public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; - - @SerializedName(SERIALIZED_NAME_CONTAINER_ID) - private String containerId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private JourneyVersionOutput version; - - public JourneyInfo() {} - - public JourneyInfo containerId(String containerId) { - - this.containerId = containerId; - return this; - } - - /** - * The journey id. - * - * @return containerId - */ - @javax.annotation.Nonnull - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public JourneyInfo name(String name) { - - this.name = name; - return this; - } - - /** - * The journey name. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public JourneyInfo description(String description) { - - this.description = description; - return this; - } - - /** - * The journey description. - * - * @return description - */ - @javax.annotation.Nonnull - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public JourneyInfo createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public JourneyInfo updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nullable - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public JourneyInfo createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * Get createdBy - * - * @return createdBy - */ - @javax.annotation.Nonnull - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public JourneyInfo updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * Get updatedBy - * - * @return updatedBy - */ - @javax.annotation.Nullable - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public JourneyInfo version(JourneyVersionOutput version) { - - this.version = version; - return this; - } - - /** - * Get version - * - * @return version - */ - @javax.annotation.Nonnull - public JourneyVersionOutput getVersion() { - return version; - } - - public void setVersion(JourneyVersionOutput version) { - this.version = version; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JourneyInfo journeyInfo = (JourneyInfo) o; - return Objects.equals(this.containerId, journeyInfo.containerId) - && Objects.equals(this.name, journeyInfo.name) - && Objects.equals(this.description, journeyInfo.description) - && Objects.equals(this.createdAt, journeyInfo.createdAt) - && Objects.equals(this.updatedAt, journeyInfo.updatedAt) - && Objects.equals(this.createdBy, journeyInfo.createdBy) - && Objects.equals(this.updatedBy, journeyInfo.updatedBy) - && Objects.equals(this.version, journeyInfo.version); - } - - @Override - public int hashCode() { - return Objects.hash( - containerId, - name, - description, - createdAt, - updatedAt, - createdBy, - updatedBy, - version); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JourneyInfo {\n"); - sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("version"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("containerId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("description"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("version"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JourneyInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!JourneyInfo.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in JourneyInfo is not found in the empty" - + " JSON string", - JourneyInfo.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JourneyInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `JourneyInfo` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : JourneyInfo.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("containerId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `containerId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("containerId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) - && !jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("updatedBy") != null && !jsonObj.get("updatedBy").isJsonNull()) - && !jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - // validate the required field `version` - JourneyVersionOutput.validateJsonElement(jsonObj.get("version")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JourneyInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JourneyInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(JourneyInfo.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, JourneyInfo value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JourneyInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of JourneyInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of JourneyInfo - * @throws IOException if the JSON string is invalid with respect to JourneyInfo - */ - public static JourneyInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JourneyInfo.class); - } - - /** - * Convert an instance of JourneyInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/JourneyState.java b/src/main/java/com/segment/publicapi/models/JourneyState.java deleted file mode 100644 index 895cb653..00000000 --- a/src/main/java/com/segment/publicapi/models/JourneyState.java +++ /dev/null @@ -1,667 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class JourneyState extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(JourneyState.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JourneyState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JourneyState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterEventEntryState = - gson.getDelegateAdapter(this, TypeToken.get(EventEntryState.class)); - final TypeAdapter adapterAudienceEntryState = - gson.getDelegateAdapter(this, TypeToken.get(AudienceEntryState.class)); - final TypeAdapter adapterExitState = - gson.getDelegateAdapter(this, TypeToken.get(ExitState.class)); - final TypeAdapter adapterDestinationState = - gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); - final TypeAdapter adapterSimpleDelayState = - gson.getDelegateAdapter(this, TypeToken.get(SimpleDelayState.class)); - final TypeAdapter adapterEventSplitWithTimeoutState = - gson.getDelegateAdapter(this, TypeToken.get(EventSplitWithTimeoutState.class)); - final TypeAdapter adapterConditionSplitState = - gson.getDelegateAdapter(this, TypeToken.get(ConditionSplitState.class)); - final TypeAdapter adapterRandomSplitState = - gson.getDelegateAdapter(this, TypeToken.get(RandomSplitState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, JourneyState value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `EventEntryState` - if (value.getActualInstance() instanceof EventEntryState) { - JsonElement element = - adapterEventEntryState.toJsonTree( - (EventEntryState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `AudienceEntryState` - if (value.getActualInstance() instanceof AudienceEntryState) { - JsonElement element = - adapterAudienceEntryState.toJsonTree( - (AudienceEntryState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ExitState` - if (value.getActualInstance() instanceof ExitState) { - JsonElement element = - adapterExitState.toJsonTree( - (ExitState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `DestinationState` - if (value.getActualInstance() instanceof DestinationState) { - JsonElement element = - adapterDestinationState.toJsonTree( - (DestinationState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `SimpleDelayState` - if (value.getActualInstance() instanceof SimpleDelayState) { - JsonElement element = - adapterSimpleDelayState.toJsonTree( - (SimpleDelayState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `EventSplitWithTimeoutState` - if (value.getActualInstance() instanceof EventSplitWithTimeoutState) { - JsonElement element = - adapterEventSplitWithTimeoutState.toJsonTree( - (EventSplitWithTimeoutState) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ConditionSplitState` - if (value.getActualInstance() instanceof ConditionSplitState) { - JsonElement element = - adapterConditionSplitState.toJsonTree( - (ConditionSplitState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `RandomSplitState` - if (value.getActualInstance() instanceof RandomSplitState) { - JsonElement element = - adapterRandomSplitState.toJsonTree( - (RandomSplitState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " AudienceEntryState, ConditionSplitState," - + " DestinationState, EventEntryState," - + " EventSplitWithTimeoutState, ExitState," - + " RandomSplitState, SimpleDelayState"); - } - - @Override - public JourneyState read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize EventEntryState - try { - // validate the JSON object to see if any exception is thrown - EventEntryState.validateJsonElement(jsonElement); - actualAdapter = adapterEventEntryState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for EventEntryState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'EventEntryState'", - e); - } - // deserialize AudienceEntryState - try { - // validate the JSON object to see if any exception is thrown - AudienceEntryState.validateJsonElement(jsonElement); - actualAdapter = adapterAudienceEntryState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for AudienceEntryState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AudienceEntryState'", - e); - } - // deserialize ExitState - try { - // validate the JSON object to see if any exception is thrown - ExitState.validateJsonElement(jsonElement); - actualAdapter = adapterExitState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ExitState failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ExitState'", - e); - } - // deserialize DestinationState - try { - // validate the JSON object to see if any exception is thrown - DestinationState.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationState'", - e); - } - // deserialize SimpleDelayState - try { - // validate the JSON object to see if any exception is thrown - SimpleDelayState.validateJsonElement(jsonElement); - actualAdapter = adapterSimpleDelayState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for SimpleDelayState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'SimpleDelayState'", - e); - } - // deserialize EventSplitWithTimeoutState - try { - // validate the JSON object to see if any exception is thrown - EventSplitWithTimeoutState.validateJsonElement(jsonElement); - actualAdapter = adapterEventSplitWithTimeoutState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for EventSplitWithTimeoutState" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'EventSplitWithTimeoutState'", - e); - } - // deserialize ConditionSplitState - try { - // validate the JSON object to see if any exception is thrown - ConditionSplitState.validateJsonElement(jsonElement); - actualAdapter = adapterConditionSplitState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ConditionSplitState failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ConditionSplitState'", - e); - } - // deserialize RandomSplitState - try { - // validate the JSON object to see if any exception is thrown - RandomSplitState.validateJsonElement(jsonElement); - actualAdapter = adapterRandomSplitState; - JourneyState ret = new JourneyState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for RandomSplitState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'RandomSplitState'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for JourneyState: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public JourneyState() { - super("anyOf", Boolean.FALSE); - } - - public JourneyState(AudienceEntryState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(ConditionSplitState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(DestinationState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(EventEntryState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(EventSplitWithTimeoutState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(ExitState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(RandomSplitState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public JourneyState(SimpleDelayState o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("EventEntryState", EventEntryState.class); - schemas.put("AudienceEntryState", AudienceEntryState.class); - schemas.put("ExitState", ExitState.class); - schemas.put("DestinationState", DestinationState.class); - schemas.put("SimpleDelayState", SimpleDelayState.class); - schemas.put("EventSplitWithTimeoutState", EventSplitWithTimeoutState.class); - schemas.put("ConditionSplitState", ConditionSplitState.class); - schemas.put("RandomSplitState", RandomSplitState.class); - } - - @Override - public Map> getSchemas() { - return JourneyState.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: AudienceEntryState, ConditionSplitState, DestinationState, - * EventEntryState, EventSplitWithTimeoutState, ExitState, RandomSplitState, SimpleDelayState - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof EventEntryState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AudienceEntryState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ExitState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof DestinationState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof SimpleDelayState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof EventSplitWithTimeoutState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ConditionSplitState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof RandomSplitState) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be AudienceEntryState, ConditionSplitState," - + " DestinationState, EventEntryState, EventSplitWithTimeoutState, ExitState," - + " RandomSplitState, SimpleDelayState"); - } - - /** - * Get the actual instance, which can be the following: AudienceEntryState, ConditionSplitState, - * DestinationState, EventEntryState, EventSplitWithTimeoutState, ExitState, RandomSplitState, - * SimpleDelayState - * - * @return The actual instance (AudienceEntryState, ConditionSplitState, DestinationState, - * EventEntryState, EventSplitWithTimeoutState, ExitState, RandomSplitState, - * SimpleDelayState) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `EventEntryState`. If the actual instance is not - * `EventEntryState`, the ClassCastException will be thrown. - * - * @return The actual instance of `EventEntryState` - * @throws ClassCastException if the instance is not `EventEntryState` - */ - public EventEntryState getEventEntryState() throws ClassCastException { - return (EventEntryState) super.getActualInstance(); - } - - /** - * Get the actual instance of `AudienceEntryState`. If the actual instance is not - * `AudienceEntryState`, the ClassCastException will be thrown. - * - * @return The actual instance of `AudienceEntryState` - * @throws ClassCastException if the instance is not `AudienceEntryState` - */ - public AudienceEntryState getAudienceEntryState() throws ClassCastException { - return (AudienceEntryState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ExitState`. If the actual instance is not `ExitState`, the - * ClassCastException will be thrown. - * - * @return The actual instance of `ExitState` - * @throws ClassCastException if the instance is not `ExitState` - */ - public ExitState getExitState() throws ClassCastException { - return (ExitState) super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationState`. If the actual instance is not - * `DestinationState`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationState` - * @throws ClassCastException if the instance is not `DestinationState` - */ - public DestinationState getDestinationState() throws ClassCastException { - return (DestinationState) super.getActualInstance(); - } - - /** - * Get the actual instance of `SimpleDelayState`. If the actual instance is not - * `SimpleDelayState`, the ClassCastException will be thrown. - * - * @return The actual instance of `SimpleDelayState` - * @throws ClassCastException if the instance is not `SimpleDelayState` - */ - public SimpleDelayState getSimpleDelayState() throws ClassCastException { - return (SimpleDelayState) super.getActualInstance(); - } - - /** - * Get the actual instance of `EventSplitWithTimeoutState`. If the actual instance is not - * `EventSplitWithTimeoutState`, the ClassCastException will be thrown. - * - * @return The actual instance of `EventSplitWithTimeoutState` - * @throws ClassCastException if the instance is not `EventSplitWithTimeoutState` - */ - public EventSplitWithTimeoutState getEventSplitWithTimeoutState() throws ClassCastException { - return (EventSplitWithTimeoutState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ConditionSplitState`. If the actual instance is not - * `ConditionSplitState`, the ClassCastException will be thrown. - * - * @return The actual instance of `ConditionSplitState` - * @throws ClassCastException if the instance is not `ConditionSplitState` - */ - public ConditionSplitState getConditionSplitState() throws ClassCastException { - return (ConditionSplitState) super.getActualInstance(); - } - - /** - * Get the actual instance of `RandomSplitState`. If the actual instance is not - * `RandomSplitState`, the ClassCastException will be thrown. - * - * @return The actual instance of `RandomSplitState` - * @throws ClassCastException if the instance is not `RandomSplitState` - */ - public RandomSplitState getRandomSplitState() throws ClassCastException { - return (RandomSplitState) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JourneyState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with EventEntryState - try { - EventEntryState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for EventEntryState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with AudienceEntryState - try { - AudienceEntryState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for AudienceEntryState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ExitState - try { - ExitState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ExitState failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with DestinationState - try { - DestinationState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with SimpleDelayState - try { - SimpleDelayState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for SimpleDelayState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with EventSplitWithTimeoutState - try { - EventSplitWithTimeoutState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for EventSplitWithTimeoutState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ConditionSplitState - try { - ConditionSplitState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ConditionSplitState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with RandomSplitState - try { - RandomSplitState.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for RandomSplitState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for JourneyState with anyOf schemas:" - + " AudienceEntryState, ConditionSplitState, DestinationState," - + " EventEntryState, EventSplitWithTimeoutState, ExitState," - + " RandomSplitState, SimpleDelayState. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of JourneyState given an JSON string - * - * @param jsonString JSON string - * @return An instance of JourneyState - * @throws IOException if the JSON string is invalid with respect to JourneyState - */ - public static JourneyState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JourneyState.class); - } - - /** - * Convert an instance of JourneyState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java b/src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java deleted file mode 100644 index 61f5a18b..00000000 --- a/src/main/java/com/segment/publicapi/models/JourneyVersionOutput.java +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** JourneyVersionOutput */ -public class JourneyVersionOutput { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; - - /** Gets or Sets status */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ARCHIVED("ARCHIVED"), - - DRAFT("DRAFT"), - - ENTRY_PAUSED("ENTRY_PAUSED"), - - PUBLISHED("PUBLISHED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private JourneyDefinition definition; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public JourneyVersionOutput() {} - - public JourneyVersionOutput id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public JourneyVersionOutput version(BigDecimal version) { - - this.version = version; - return this; - } - - /** - * Get version - * - * @return version - */ - @javax.annotation.Nonnull - public BigDecimal getVersion() { - return version; - } - - public void setVersion(BigDecimal version) { - this.version = version; - } - - public JourneyVersionOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public JourneyVersionOutput definition(JourneyDefinition definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public JourneyDefinition getDefinition() { - return definition; - } - - public void setDefinition(JourneyDefinition definition) { - this.definition = definition; - } - - public JourneyVersionOutput createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public JourneyVersionOutput updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * - * @return updatedAt - */ - @javax.annotation.Nullable - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public JourneyVersionOutput createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * Get createdBy - * - * @return createdBy - */ - @javax.annotation.Nonnull - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public JourneyVersionOutput updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * Get updatedBy - * - * @return updatedBy - */ - @javax.annotation.Nullable - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JourneyVersionOutput journeyVersionOutput = (JourneyVersionOutput) o; - return Objects.equals(this.id, journeyVersionOutput.id) - && Objects.equals(this.version, journeyVersionOutput.version) - && Objects.equals(this.status, journeyVersionOutput.status) - && Objects.equals(this.definition, journeyVersionOutput.definition) - && Objects.equals(this.createdAt, journeyVersionOutput.createdAt) - && Objects.equals(this.updatedAt, journeyVersionOutput.updatedAt) - && Objects.equals(this.createdBy, journeyVersionOutput.createdBy) - && Objects.equals(this.updatedBy, journeyVersionOutput.updatedBy); - } - - @Override - public int hashCode() { - return Objects.hash( - id, version, status, definition, createdAt, updatedAt, createdBy, updatedBy); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JourneyVersionOutput {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("version"); - openapiFields.add("status"); - openapiFields.add("definition"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("version"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("createdBy"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to JourneyVersionOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!JourneyVersionOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in JourneyVersionOutput is not found in" - + " the empty JSON string", - JourneyVersionOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!JourneyVersionOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `JourneyVersionOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : JourneyVersionOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - // validate the required field `definition` - JourneyDefinition.validateJsonElement(jsonObj.get("definition")); - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if ((jsonObj.get("updatedAt") != null && !jsonObj.get("updatedAt").isJsonNull()) - && !jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if ((jsonObj.get("updatedBy") != null && !jsonObj.get("updatedBy").isJsonNull()) - && !jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JourneyVersionOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JourneyVersionOutput' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(JourneyVersionOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, JourneyVersionOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JourneyVersionOutput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of JourneyVersionOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of JourneyVersionOutput - * @throws IOException if the JSON string is invalid with respect to JourneyVersionOutput - */ - public static JourneyVersionOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JourneyVersionOutput.class); - } - - /** - * Convert an instance of JourneyVersionOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Key.java b/src/main/java/com/segment/publicapi/models/Key.java deleted file mode 100644 index d516cf0d..00000000 --- a/src/main/java/com/segment/publicapi/models/Key.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Key */ -public class Key { - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public Key() {} - - public Key name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * - * @return name - */ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Key id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Key key = (Key) o; - return Objects.equals(this.name, key.name) && Objects.equals(this.id, key.id); - } - - @Override - public int hashCode() { - return Objects.hash(name, id); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Key {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("id"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Key - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Key.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Key is not found in the empty JSON" - + " string", - Key.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Key.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the `Key`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Key.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) - && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Key.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Key' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Key.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Key value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Key read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Key given an JSON string - * - * @param jsonString JSON string - * @return An instance of Key - * @throws IOException if the JSON string is invalid with respect to Key - */ - public static Key fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Key.class); - } - - /** - * Convert an instance of Key to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java b/src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java deleted file mode 100644 index 094dd7d8..00000000 --- a/src/main/java/com/segment/publicapi/models/PropertySelectionsConfig.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** PropertySelectionsConfig */ -public class PropertySelectionsConfig { - public static final String SERIALIZED_NAME_PROFILE = "profile"; - - @SerializedName(SERIALIZED_NAME_PROFILE) - private List profile = new ArrayList<>(); - - public PropertySelectionsConfig() {} - - public PropertySelectionsConfig profile(List profile) { - - this.profile = profile; - return this; - } - - public PropertySelectionsConfig addProfileItem(String profileItem) { - if (this.profile == null) { - this.profile = new ArrayList<>(); - } - this.profile.add(profileItem); - return this; - } - - /** - * Get profile - * - * @return profile - */ - @javax.annotation.Nonnull - public List getProfile() { - return profile; - } - - public void setProfile(List profile) { - this.profile = profile; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PropertySelectionsConfig propertySelectionsConfig = (PropertySelectionsConfig) o; - return Objects.equals(this.profile, propertySelectionsConfig.profile); - } - - @Override - public int hashCode() { - return Objects.hash(profile); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PropertySelectionsConfig {\n"); - sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("profile"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("profile"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PropertySelectionsConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PropertySelectionsConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in PropertySelectionsConfig is not found" - + " in the empty JSON string", - PropertySelectionsConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PropertySelectionsConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `PropertySelectionsConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PropertySelectionsConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("profile") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("profile").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `profile` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("profile").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PropertySelectionsConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PropertySelectionsConfig' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PropertySelectionsConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, PropertySelectionsConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PropertySelectionsConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of PropertySelectionsConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of PropertySelectionsConfig - * @throws IOException if the JSON string is invalid with respect to PropertySelectionsConfig - */ - public static PropertySelectionsConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PropertySelectionsConfig.class); - } - - /** - * Convert an instance of PropertySelectionsConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RandomSplitBranch.java b/src/main/java/com/segment/publicapi/models/RandomSplitBranch.java deleted file mode 100644 index 75dddcf8..00000000 --- a/src/main/java/com/segment/publicapi/models/RandomSplitBranch.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** RandomSplitBranch */ -public class RandomSplitBranch { - public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; - - @SerializedName(SERIALIZED_NAME_PERCENTAGE) - private BigDecimal percentage; - - public static final String SERIALIZED_NAME_NEXT = "next"; - - @SerializedName(SERIALIZED_NAME_NEXT) - private String next; - - public RandomSplitBranch() {} - - public RandomSplitBranch percentage(BigDecimal percentage) { - - this.percentage = percentage; - return this; - } - - /** - * Get percentage - * - * @return percentage - */ - @javax.annotation.Nonnull - public BigDecimal getPercentage() { - return percentage; - } - - public void setPercentage(BigDecimal percentage) { - this.percentage = percentage; - } - - public RandomSplitBranch next(String next) { - - this.next = next; - return this; - } - - /** - * Get next - * - * @return next - */ - @javax.annotation.Nonnull - public String getNext() { - return next; - } - - public void setNext(String next) { - this.next = next; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RandomSplitBranch randomSplitBranch = (RandomSplitBranch) o; - return Objects.equals(this.percentage, randomSplitBranch.percentage) - && Objects.equals(this.next, randomSplitBranch.next); - } - - @Override - public int hashCode() { - return Objects.hash(percentage, next); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RandomSplitBranch {\n"); - sb.append(" percentage: ").append(toIndentedString(percentage)).append("\n"); - sb.append(" next: ").append(toIndentedString(next)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("percentage"); - openapiFields.add("next"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("percentage"); - openapiRequiredFields.add("next"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RandomSplitBranch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RandomSplitBranch.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RandomSplitBranch is not found in the" - + " empty JSON string", - RandomSplitBranch.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RandomSplitBranch.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RandomSplitBranch` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RandomSplitBranch.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("next").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `next` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("next").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RandomSplitBranch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RandomSplitBranch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RandomSplitBranch.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RandomSplitBranch value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RandomSplitBranch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RandomSplitBranch given an JSON string - * - * @param jsonString JSON string - * @return An instance of RandomSplitBranch - * @throws IOException if the JSON string is invalid with respect to RandomSplitBranch - */ - public static RandomSplitBranch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RandomSplitBranch.class); - } - - /** - * Convert an instance of RandomSplitBranch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RandomSplitState.java b/src/main/java/com/segment/publicapi/models/RandomSplitState.java deleted file mode 100644 index fec45f50..00000000 --- a/src/main/java/com/segment/publicapi/models/RandomSplitState.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** RandomSplitState */ -public class RandomSplitState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - RANDOM_SPLIT("RANDOM_SPLIT"), - - EXIT("EXIT"), - - DESTINATION("DESTINATION"), - - EXIT_RULE("EXIT_RULE"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public RandomSplitState() {} - - public RandomSplitState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public RandomSplitState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public RandomSplitState addTransitionsItem(RandomSplitBranch transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public RandomSplitState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RandomSplitState randomSplitState = (RandomSplitState) o; - return Objects.equals(this.type, randomSplitState.type) - && Objects.equals(this.transitions, randomSplitState.transitions) - && Objects.equals(this.key, randomSplitState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RandomSplitState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RandomSplitState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RandomSplitState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RandomSplitState is not found in the" - + " empty JSON string", - RandomSplitState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RandomSplitState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RandomSplitState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RandomSplitState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - RandomSplitBranch.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RandomSplitState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RandomSplitState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RandomSplitState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RandomSplitState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RandomSplitState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RandomSplitState given an JSON string - * - * @param jsonString JSON string - * @return An instance of RandomSplitState - * @throws IOException if the JSON string is invalid with respect to RandomSplitState - */ - public static RandomSplitState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RandomSplitState.class); - } - - /** - * Convert an instance of RandomSplitState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java b/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java deleted file mode 100644 index 6ca11ab2..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpace200Response.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** RemoveJourneyFromSpace200Response */ -public class RemoveJourneyFromSpace200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private RemoveJourneyFromSpaceAlphaOutput data; - - public RemoveJourneyFromSpace200Response() {} - - public RemoveJourneyFromSpace200Response data(RemoveJourneyFromSpaceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public RemoveJourneyFromSpaceAlphaOutput getData() { - return data; - } - - public void setData(RemoveJourneyFromSpaceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveJourneyFromSpace200Response removeJourneyFromSpace200Response = - (RemoveJourneyFromSpace200Response) o; - return Objects.equals(this.data, removeJourneyFromSpace200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveJourneyFromSpace200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * RemoveJourneyFromSpace200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RemoveJourneyFromSpace200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RemoveJourneyFromSpace200Response is" - + " not found in the empty JSON string", - RemoveJourneyFromSpace200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RemoveJourneyFromSpace200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveJourneyFromSpace200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - RemoveJourneyFromSpaceAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveJourneyFromSpace200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RemoveJourneyFromSpace200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveJourneyFromSpace200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RemoveJourneyFromSpace200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveJourneyFromSpace200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveJourneyFromSpace200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveJourneyFromSpace200Response - * @throws IOException if the JSON string is invalid with respect to - * RemoveJourneyFromSpace200Response - */ - public static RemoveJourneyFromSpace200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RemoveJourneyFromSpace200Response.class); - } - - /** - * Convert an instance of RemoveJourneyFromSpace200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java deleted file mode 100644 index d2e8c3b8..00000000 --- a/src/main/java/com/segment/publicapi/models/RemoveJourneyFromSpaceAlphaOutput.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Delete journey output. */ -public class RemoveJourneyFromSpaceAlphaOutput { - /** Journey status. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("SUCCESS"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public RemoveJourneyFromSpaceAlphaOutput() {} - - public RemoveJourneyFromSpaceAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Journey status. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoveJourneyFromSpaceAlphaOutput removeJourneyFromSpaceAlphaOutput = - (RemoveJourneyFromSpaceAlphaOutput) o; - return Objects.equals(this.status, removeJourneyFromSpaceAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RemoveJourneyFromSpaceAlphaOutput {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * RemoveJourneyFromSpaceAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RemoveJourneyFromSpaceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RemoveJourneyFromSpaceAlphaOutput is" - + " not found in the empty JSON string", - RemoveJourneyFromSpaceAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RemoveJourneyFromSpaceAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RemoveJourneyFromSpaceAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RemoveJourneyFromSpaceAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemoveJourneyFromSpaceAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RemoveJourneyFromSpaceAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RemoveJourneyFromSpaceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RemoveJourneyFromSpaceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RemoveJourneyFromSpaceAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RemoveJourneyFromSpaceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of RemoveJourneyFromSpaceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * RemoveJourneyFromSpaceAlphaOutput - */ - public static RemoveJourneyFromSpaceAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RemoveJourneyFromSpaceAlphaOutput.class); - } - - /** - * Convert an instance of RemoveJourneyFromSpaceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java deleted file mode 100644 index 48ba7b46..00000000 --- a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourney200Response.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ReplaceStepsForJourney200Response */ -public class ReplaceStepsForJourney200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ReplaceStepsForJourneyAlphaOutput data; - - public ReplaceStepsForJourney200Response() {} - - public ReplaceStepsForJourney200Response data(ReplaceStepsForJourneyAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public ReplaceStepsForJourneyAlphaOutput getData() { - return data; - } - - public void setData(ReplaceStepsForJourneyAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReplaceStepsForJourney200Response replaceStepsForJourney200Response = - (ReplaceStepsForJourney200Response) o; - return Objects.equals(this.data, replaceStepsForJourney200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReplaceStepsForJourney200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReplaceStepsForJourney200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReplaceStepsForJourney200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReplaceStepsForJourney200Response is" - + " not found in the empty JSON string", - ReplaceStepsForJourney200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReplaceStepsForJourney200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReplaceStepsForJourney200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ReplaceStepsForJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReplaceStepsForJourney200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReplaceStepsForJourney200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReplaceStepsForJourney200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReplaceStepsForJourney200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReplaceStepsForJourney200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReplaceStepsForJourney200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReplaceStepsForJourney200Response - * @throws IOException if the JSON string is invalid with respect to - * ReplaceStepsForJourney200Response - */ - public static ReplaceStepsForJourney200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReplaceStepsForJourney200Response.class); - } - - /** - * Convert an instance of ReplaceStepsForJourney200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java deleted file mode 100644 index 5f271af7..00000000 --- a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaInput.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Replace steps for a journey input. */ -public class ReplaceStepsForJourneyAlphaInput { - public static final String SERIALIZED_NAME_INITIAL_STATE = "initialState"; - - @SerializedName(SERIALIZED_NAME_INITIAL_STATE) - private String initialState; - - public static final String SERIALIZED_NAME_STATES = "states"; - - @SerializedName(SERIALIZED_NAME_STATES) - private List states = new ArrayList<>(); - - public ReplaceStepsForJourneyAlphaInput() {} - - public ReplaceStepsForJourneyAlphaInput initialState(String initialState) { - - this.initialState = initialState; - return this; - } - - /** - * The Initial state of the journey. - * - * @return initialState - */ - @javax.annotation.Nonnull - public String getInitialState() { - return initialState; - } - - public void setInitialState(String initialState) { - this.initialState = initialState; - } - - public ReplaceStepsForJourneyAlphaInput states(List states) { - - this.states = states; - return this; - } - - public ReplaceStepsForJourneyAlphaInput addStatesItem(JourneyState statesItem) { - if (this.states == null) { - this.states = new ArrayList<>(); - } - this.states.add(statesItem); - return this; - } - - /** - * States of the journey. - * - * @return states - */ - @javax.annotation.Nonnull - public List getStates() { - return states; - } - - public void setStates(List states) { - this.states = states; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReplaceStepsForJourneyAlphaInput replaceStepsForJourneyAlphaInput = - (ReplaceStepsForJourneyAlphaInput) o; - return Objects.equals(this.initialState, replaceStepsForJourneyAlphaInput.initialState) - && Objects.equals(this.states, replaceStepsForJourneyAlphaInput.states); - } - - @Override - public int hashCode() { - return Objects.hash(initialState, states); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReplaceStepsForJourneyAlphaInput {\n"); - sb.append(" initialState: ").append(toIndentedString(initialState)).append("\n"); - sb.append(" states: ").append(toIndentedString(states)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("initialState"); - openapiFields.add("states"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("initialState"); - openapiRequiredFields.add("states"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReplaceStepsForJourneyAlphaInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReplaceStepsForJourneyAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReplaceStepsForJourneyAlphaInput is" - + " not found in the empty JSON string", - ReplaceStepsForJourneyAlphaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReplaceStepsForJourneyAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReplaceStepsForJourneyAlphaInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReplaceStepsForJourneyAlphaInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("initialState").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `initialState` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("initialState").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("states").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `states` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("states").toString())); - } - - JsonArray jsonArraystates = jsonObj.getAsJsonArray("states"); - // validate the required field `states` (array) - for (int i = 0; i < jsonArraystates.size(); i++) { - JourneyState.validateJsonElement(jsonArraystates.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReplaceStepsForJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReplaceStepsForJourneyAlphaInput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReplaceStepsForJourneyAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReplaceStepsForJourneyAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReplaceStepsForJourneyAlphaInput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReplaceStepsForJourneyAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReplaceStepsForJourneyAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * ReplaceStepsForJourneyAlphaInput - */ - public static ReplaceStepsForJourneyAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReplaceStepsForJourneyAlphaInput.class); - } - - /** - * Convert an instance of ReplaceStepsForJourneyAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java deleted file mode 100644 index 46b92158..00000000 --- a/src/main/java/com/segment/publicapi/models/ReplaceStepsForJourneyAlphaOutput.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Replace the steps for a journey output. */ -public class ReplaceStepsForJourneyAlphaOutput { - public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; - - @SerializedName(SERIALIZED_NAME_CONTAINER_ID) - private String containerId; - - public static final String SERIALIZED_NAME_VERSION_NUMBER = "versionNumber"; - - @SerializedName(SERIALIZED_NAME_VERSION_NUMBER) - private BigDecimal versionNumber; - - public ReplaceStepsForJourneyAlphaOutput() {} - - public ReplaceStepsForJourneyAlphaOutput containerId(String containerId) { - - this.containerId = containerId; - return this; - } - - /** - * Get containerId - * - * @return containerId - */ - @javax.annotation.Nullable - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public ReplaceStepsForJourneyAlphaOutput versionNumber(BigDecimal versionNumber) { - - this.versionNumber = versionNumber; - return this; - } - - /** - * Get versionNumber - * - * @return versionNumber - */ - @javax.annotation.Nullable - public BigDecimal getVersionNumber() { - return versionNumber; - } - - public void setVersionNumber(BigDecimal versionNumber) { - this.versionNumber = versionNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReplaceStepsForJourneyAlphaOutput replaceStepsForJourneyAlphaOutput = - (ReplaceStepsForJourneyAlphaOutput) o; - return Objects.equals(this.containerId, replaceStepsForJourneyAlphaOutput.containerId) - && Objects.equals( - this.versionNumber, replaceStepsForJourneyAlphaOutput.versionNumber); - } - - @Override - public int hashCode() { - return Objects.hash(containerId, versionNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReplaceStepsForJourneyAlphaOutput {\n"); - sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); - sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerId"); - openapiFields.add("versionNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ReplaceStepsForJourneyAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReplaceStepsForJourneyAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReplaceStepsForJourneyAlphaOutput is" - + " not found in the empty JSON string", - ReplaceStepsForJourneyAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReplaceStepsForJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReplaceStepsForJourneyAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("containerId") != null && !jsonObj.get("containerId").isJsonNull()) - && !jsonObj.get("containerId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `containerId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("containerId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReplaceStepsForJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReplaceStepsForJourneyAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ReplaceStepsForJourneyAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReplaceStepsForJourneyAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReplaceStepsForJourneyAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReplaceStepsForJourneyAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReplaceStepsForJourneyAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * ReplaceStepsForJourneyAlphaOutput - */ - public static ReplaceStepsForJourneyAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReplaceStepsForJourneyAlphaOutput.class); - } - - /** - * Convert an instance of ReplaceStepsForJourneyAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RulesInner.java b/src/main/java/com/segment/publicapi/models/RulesInner.java deleted file mode 100644 index 507b6875..00000000 --- a/src/main/java/com/segment/publicapi/models/RulesInner.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class RulesInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(RulesInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RulesInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RulesInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterEventExitRule = - gson.getDelegateAdapter(this, TypeToken.get(EventExitRule.class)); - final TypeAdapter adapterAudienceExitRule = - gson.getDelegateAdapter(this, TypeToken.get(AudienceExitRule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RulesInner value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `EventExitRule` - if (value.getActualInstance() instanceof EventExitRule) { - JsonElement element = - adapterEventExitRule.toJsonTree( - (EventExitRule) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `AudienceExitRule` - if (value.getActualInstance() instanceof AudienceExitRule) { - JsonElement element = - adapterAudienceExitRule.toJsonTree( - (AudienceExitRule) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " AudienceExitRule, EventExitRule"); - } - - @Override - public RulesInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize EventExitRule - try { - // validate the JSON object to see if any exception is thrown - EventExitRule.validateJsonElement(jsonElement); - actualAdapter = adapterEventExitRule; - RulesInner ret = new RulesInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for EventExitRule failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'EventExitRule'", - e); - } - // deserialize AudienceExitRule - try { - // validate the JSON object to see if any exception is thrown - AudienceExitRule.validateJsonElement(jsonElement); - actualAdapter = adapterAudienceExitRule; - RulesInner ret = new RulesInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for AudienceExitRule failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AudienceExitRule'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for RulesInner: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public RulesInner() { - super("anyOf", Boolean.FALSE); - } - - public RulesInner(AudienceExitRule o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public RulesInner(EventExitRule o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("EventExitRule", EventExitRule.class); - schemas.put("AudienceExitRule", AudienceExitRule.class); - } - - @Override - public Map> getSchemas() { - return RulesInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: AudienceExitRule, EventExitRule - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof EventExitRule) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AudienceExitRule) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be AudienceExitRule, EventExitRule"); - } - - /** - * Get the actual instance, which can be the following: AudienceExitRule, EventExitRule - * - * @return The actual instance (AudienceExitRule, EventExitRule) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `EventExitRule`. If the actual instance is not `EventExitRule`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `EventExitRule` - * @throws ClassCastException if the instance is not `EventExitRule` - */ - public EventExitRule getEventExitRule() throws ClassCastException { - return (EventExitRule) super.getActualInstance(); - } - - /** - * Get the actual instance of `AudienceExitRule`. If the actual instance is not - * `AudienceExitRule`, the ClassCastException will be thrown. - * - * @return The actual instance of `AudienceExitRule` - * @throws ClassCastException if the instance is not `AudienceExitRule` - */ - public AudienceExitRule getAudienceExitRule() throws ClassCastException { - return (AudienceExitRule) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RulesInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with EventExitRule - try { - EventExitRule.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for EventExitRule failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with AudienceExitRule - try { - AudienceExitRule.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for AudienceExitRule failed with `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for RulesInner with anyOf schemas:" - + " AudienceExitRule, EventExitRule. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of RulesInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of RulesInner - * @throws IOException if the JSON string is invalid with respect to RulesInner - */ - public static RulesInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RulesInner.class); - } - - /** - * Convert an instance of RulesInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/SimpleDelayState.java b/src/main/java/com/segment/publicapi/models/SimpleDelayState.java deleted file mode 100644 index f6ae9316..00000000 --- a/src/main/java/com/segment/publicapi/models/SimpleDelayState.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** SimpleDelayState */ -public class SimpleDelayState { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - SIMPLE_DELAY("SIMPLE_DELAY"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_TRANSITIONS = "transitions"; - - @SerializedName(SERIALIZED_NAME_TRANSITIONS) - private List transitions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private Key key; - - public SimpleDelayState() {} - - public SimpleDelayState type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public SimpleDelayState duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * Get duration - * - * @return duration - */ - @javax.annotation.Nonnull - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public SimpleDelayState transitions(List transitions) { - - this.transitions = transitions; - return this; - } - - public SimpleDelayState addTransitionsItem(Transitions transitionsItem) { - if (this.transitions == null) { - this.transitions = new ArrayList<>(); - } - this.transitions.add(transitionsItem); - return this; - } - - /** - * Get transitions - * - * @return transitions - */ - @javax.annotation.Nonnull - public List getTransitions() { - return transitions; - } - - public void setTransitions(List transitions) { - this.transitions = transitions; - } - - public SimpleDelayState key(Key key) { - - this.key = key; - return this; - } - - /** - * Get key - * - * @return key - */ - @javax.annotation.Nonnull - public Key getKey() { - return key; - } - - public void setKey(Key key) { - this.key = key; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SimpleDelayState simpleDelayState = (SimpleDelayState) o; - return Objects.equals(this.type, simpleDelayState.type) - && Objects.equals(this.duration, simpleDelayState.duration) - && Objects.equals(this.transitions, simpleDelayState.transitions) - && Objects.equals(this.key, simpleDelayState.key); - } - - @Override - public int hashCode() { - return Objects.hash(type, duration, transitions, key); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SimpleDelayState {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" transitions: ").append(toIndentedString(transitions)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("duration"); - openapiFields.add("transitions"); - openapiFields.add("key"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("duration"); - openapiRequiredFields.add("transitions"); - openapiRequiredFields.add("key"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SimpleDelayState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SimpleDelayState.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in SimpleDelayState is not found in the" - + " empty JSON string", - SimpleDelayState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SimpleDelayState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SimpleDelayState` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SimpleDelayState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("duration").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `duration` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("duration").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("transitions").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transitions` to be an array in the JSON string but" - + " got `%s`", - jsonObj.get("transitions").toString())); - } - - JsonArray jsonArraytransitions = jsonObj.getAsJsonArray("transitions"); - // validate the required field `transitions` (array) - for (int i = 0; i < jsonArraytransitions.size(); i++) { - Transitions.validateJsonElement(jsonArraytransitions.get(i)); - } - ; - // validate the required field `key` - Key.validateJsonElement(jsonObj.get("key")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SimpleDelayState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SimpleDelayState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(SimpleDelayState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, SimpleDelayState value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SimpleDelayState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of SimpleDelayState given an JSON string - * - * @param jsonString JSON string - * @return An instance of SimpleDelayState - * @throws IOException if the JSON string is invalid with respect to SimpleDelayState - */ - public static SimpleDelayState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SimpleDelayState.class); - } - - /** - * Convert an instance of SimpleDelayState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java b/src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java deleted file mode 100644 index 8cea2864..00000000 --- a/src/main/java/com/segment/publicapi/models/StepLevelAnalytics.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** StepLevelAnalytics */ -public class StepLevelAnalytics { - public static final String SERIALIZED_NAME_FROM = "from"; - - @SerializedName(SERIALIZED_NAME_FROM) - private Key from; - - public static final String SERIALIZED_NAME_TO = "to"; - - @SerializedName(SERIALIZED_NAME_TO) - private Key to; - - public static final String SERIALIZED_NAME_ANALYTICS = "analytics"; - - @SerializedName(SERIALIZED_NAME_ANALYTICS) - private Analytics analytics; - - public StepLevelAnalytics() {} - - public StepLevelAnalytics from(Key from) { - - this.from = from; - return this; - } - - /** - * Get from - * - * @return from - */ - @javax.annotation.Nullable - public Key getFrom() { - return from; - } - - public void setFrom(Key from) { - this.from = from; - } - - public StepLevelAnalytics to(Key to) { - - this.to = to; - return this; - } - - /** - * Get to - * - * @return to - */ - @javax.annotation.Nonnull - public Key getTo() { - return to; - } - - public void setTo(Key to) { - this.to = to; - } - - public StepLevelAnalytics analytics(Analytics analytics) { - - this.analytics = analytics; - return this; - } - - /** - * Get analytics - * - * @return analytics - */ - @javax.annotation.Nonnull - public Analytics getAnalytics() { - return analytics; - } - - public void setAnalytics(Analytics analytics) { - this.analytics = analytics; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StepLevelAnalytics stepLevelAnalytics = (StepLevelAnalytics) o; - return Objects.equals(this.from, stepLevelAnalytics.from) - && Objects.equals(this.to, stepLevelAnalytics.to) - && Objects.equals(this.analytics, stepLevelAnalytics.analytics); - } - - @Override - public int hashCode() { - return Objects.hash(from, to, analytics); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StepLevelAnalytics {\n"); - sb.append(" from: ").append(toIndentedString(from)).append("\n"); - sb.append(" to: ").append(toIndentedString(to)).append("\n"); - sb.append(" analytics: ").append(toIndentedString(analytics)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("from"); - openapiFields.add("to"); - openapiFields.add("analytics"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("to"); - openapiRequiredFields.add("analytics"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StepLevelAnalytics - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!StepLevelAnalytics.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in StepLevelAnalytics is not found in the" - + " empty JSON string", - StepLevelAnalytics.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!StepLevelAnalytics.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `StepLevelAnalytics` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : StepLevelAnalytics.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `from` - if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { - Key.validateJsonElement(jsonObj.get("from")); - } - // validate the required field `to` - Key.validateJsonElement(jsonObj.get("to")); - // validate the required field `analytics` - Analytics.validateJsonElement(jsonObj.get("analytics")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!StepLevelAnalytics.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StepLevelAnalytics' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(StepLevelAnalytics.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, StepLevelAnalytics value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public StepLevelAnalytics read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of StepLevelAnalytics given an JSON string - * - * @param jsonString JSON string - * @return An instance of StepLevelAnalytics - * @throws IOException if the JSON string is invalid with respect to StepLevelAnalytics - */ - public static StepLevelAnalytics fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StepLevelAnalytics.class); - } - - /** - * Convert an instance of StepLevelAnalytics to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TimeOutBranch.java b/src/main/java/com/segment/publicapi/models/TimeOutBranch.java deleted file mode 100644 index 22ccab3d..00000000 --- a/src/main/java/com/segment/publicapi/models/TimeOutBranch.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** TimeOutBranch */ -public class TimeOutBranch { - /** Gets or Sets type */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - TIMEOUT("TIMEOUT"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_DURATION = "duration"; - - @SerializedName(SERIALIZED_NAME_DURATION) - private String duration; - - public static final String SERIALIZED_NAME_NEXT = "next"; - - @SerializedName(SERIALIZED_NAME_NEXT) - private String next; - - public TimeOutBranch() {} - - public TimeOutBranch type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - public TimeOutBranch duration(String duration) { - - this.duration = duration; - return this; - } - - /** - * Get duration - * - * @return duration - */ - @javax.annotation.Nonnull - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public TimeOutBranch next(String next) { - - this.next = next; - return this; - } - - /** - * Get next - * - * @return next - */ - @javax.annotation.Nonnull - public String getNext() { - return next; - } - - public void setNext(String next) { - this.next = next; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TimeOutBranch timeOutBranch = (TimeOutBranch) o; - return Objects.equals(this.type, timeOutBranch.type) - && Objects.equals(this.duration, timeOutBranch.duration) - && Objects.equals(this.next, timeOutBranch.next); - } - - @Override - public int hashCode() { - return Objects.hash(type, duration, next); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TimeOutBranch {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); - sb.append(" next: ").append(toIndentedString(next)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("duration"); - openapiFields.add("next"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("duration"); - openapiRequiredFields.add("next"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TimeOutBranch - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TimeOutBranch.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in TimeOutBranch is not found in the" - + " empty JSON string", - TimeOutBranch.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TimeOutBranch.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TimeOutBranch` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TimeOutBranch.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if (!jsonObj.get("duration").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `duration` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("duration").toString())); - } - if (!jsonObj.get("next").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `next` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("next").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TimeOutBranch.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TimeOutBranch' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(TimeOutBranch.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TimeOutBranch value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TimeOutBranch read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TimeOutBranch given an JSON string - * - * @param jsonString JSON string - * @return An instance of TimeOutBranch - * @throws IOException if the JSON string is invalid with respect to TimeOutBranch - */ - public static TimeOutBranch fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TimeOutBranch.class); - } - - /** - * Convert an instance of TimeOutBranch to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java b/src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java deleted file mode 100644 index ed89ce6b..00000000 --- a/src/main/java/com/segment/publicapi/models/TopLevelAnalytics.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** TopLevelAnalytics */ -public class TopLevelAnalytics { - public static final String SERIALIZED_NAME_ENTERED = "entered"; - - @SerializedName(SERIALIZED_NAME_ENTERED) - private Analytics entered; - - public static final String SERIALIZED_NAME_COMPLETED = "completed"; - - @SerializedName(SERIALIZED_NAME_COMPLETED) - private Analytics completed; - - public static final String SERIALIZED_NAME_IN_PROGRESS = "inProgress"; - - @SerializedName(SERIALIZED_NAME_IN_PROGRESS) - private Analytics inProgress; - - public static final String SERIALIZED_NAME_EXITED = "exited"; - - @SerializedName(SERIALIZED_NAME_EXITED) - private Analytics exited; - - public TopLevelAnalytics() {} - - public TopLevelAnalytics entered(Analytics entered) { - - this.entered = entered; - return this; - } - - /** - * Get entered - * - * @return entered - */ - @javax.annotation.Nonnull - public Analytics getEntered() { - return entered; - } - - public void setEntered(Analytics entered) { - this.entered = entered; - } - - public TopLevelAnalytics completed(Analytics completed) { - - this.completed = completed; - return this; - } - - /** - * Get completed - * - * @return completed - */ - @javax.annotation.Nonnull - public Analytics getCompleted() { - return completed; - } - - public void setCompleted(Analytics completed) { - this.completed = completed; - } - - public TopLevelAnalytics inProgress(Analytics inProgress) { - - this.inProgress = inProgress; - return this; - } - - /** - * Get inProgress - * - * @return inProgress - */ - @javax.annotation.Nonnull - public Analytics getInProgress() { - return inProgress; - } - - public void setInProgress(Analytics inProgress) { - this.inProgress = inProgress; - } - - public TopLevelAnalytics exited(Analytics exited) { - - this.exited = exited; - return this; - } - - /** - * Get exited - * - * @return exited - */ - @javax.annotation.Nullable - public Analytics getExited() { - return exited; - } - - public void setExited(Analytics exited) { - this.exited = exited; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TopLevelAnalytics topLevelAnalytics = (TopLevelAnalytics) o; - return Objects.equals(this.entered, topLevelAnalytics.entered) - && Objects.equals(this.completed, topLevelAnalytics.completed) - && Objects.equals(this.inProgress, topLevelAnalytics.inProgress) - && Objects.equals(this.exited, topLevelAnalytics.exited); - } - - @Override - public int hashCode() { - return Objects.hash(entered, completed, inProgress, exited); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TopLevelAnalytics {\n"); - sb.append(" entered: ").append(toIndentedString(entered)).append("\n"); - sb.append(" completed: ").append(toIndentedString(completed)).append("\n"); - sb.append(" inProgress: ").append(toIndentedString(inProgress)).append("\n"); - sb.append(" exited: ").append(toIndentedString(exited)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("entered"); - openapiFields.add("completed"); - openapiFields.add("inProgress"); - openapiFields.add("exited"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("entered"); - openapiRequiredFields.add("completed"); - openapiRequiredFields.add("inProgress"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TopLevelAnalytics - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TopLevelAnalytics.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in TopLevelAnalytics is not found in the" - + " empty JSON string", - TopLevelAnalytics.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TopLevelAnalytics.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `TopLevelAnalytics` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TopLevelAnalytics.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `entered` - Analytics.validateJsonElement(jsonObj.get("entered")); - // validate the required field `completed` - Analytics.validateJsonElement(jsonObj.get("completed")); - // validate the required field `inProgress` - Analytics.validateJsonElement(jsonObj.get("inProgress")); - // validate the optional field `exited` - if (jsonObj.get("exited") != null && !jsonObj.get("exited").isJsonNull()) { - Analytics.validateJsonElement(jsonObj.get("exited")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TopLevelAnalytics.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TopLevelAnalytics' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(TopLevelAnalytics.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TopLevelAnalytics value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TopLevelAnalytics read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TopLevelAnalytics given an JSON string - * - * @param jsonString JSON string - * @return An instance of TopLevelAnalytics - * @throws IOException if the JSON string is invalid with respect to TopLevelAnalytics - */ - public static TopLevelAnalytics fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TopLevelAnalytics.class); - } - - /** - * Convert an instance of TopLevelAnalytics to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TransitionState.java b/src/main/java/com/segment/publicapi/models/TransitionState.java deleted file mode 100644 index 701f4a6a..00000000 --- a/src/main/java/com/segment/publicapi/models/TransitionState.java +++ /dev/null @@ -1,619 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class TransitionState extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(TransitionState.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransitionState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TransitionState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterEventEntryState = - gson.getDelegateAdapter(this, TypeToken.get(EventEntryState.class)); - final TypeAdapter adapterAudienceEntryState = - gson.getDelegateAdapter(this, TypeToken.get(AudienceEntryState.class)); - final TypeAdapter adapterDestinationState = - gson.getDelegateAdapter(this, TypeToken.get(DestinationState.class)); - final TypeAdapter adapterSimpleDelayState = - gson.getDelegateAdapter(this, TypeToken.get(SimpleDelayState.class)); - final TypeAdapter adapterEventSplitWithTimeoutState = - gson.getDelegateAdapter(this, TypeToken.get(EventSplitWithTimeoutState.class)); - final TypeAdapter adapterConditionSplitState = - gson.getDelegateAdapter(this, TypeToken.get(ConditionSplitState.class)); - final TypeAdapter adapterRandomSplitState = - gson.getDelegateAdapter(this, TypeToken.get(RandomSplitState.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TransitionState value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `EventEntryState` - if (value.getActualInstance() instanceof EventEntryState) { - JsonElement element = - adapterEventEntryState.toJsonTree( - (EventEntryState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `AudienceEntryState` - if (value.getActualInstance() instanceof AudienceEntryState) { - JsonElement element = - adapterAudienceEntryState.toJsonTree( - (AudienceEntryState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `DestinationState` - if (value.getActualInstance() instanceof DestinationState) { - JsonElement element = - adapterDestinationState.toJsonTree( - (DestinationState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `SimpleDelayState` - if (value.getActualInstance() instanceof SimpleDelayState) { - JsonElement element = - adapterSimpleDelayState.toJsonTree( - (SimpleDelayState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `EventSplitWithTimeoutState` - if (value.getActualInstance() instanceof EventSplitWithTimeoutState) { - JsonElement element = - adapterEventSplitWithTimeoutState.toJsonTree( - (EventSplitWithTimeoutState) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `ConditionSplitState` - if (value.getActualInstance() instanceof ConditionSplitState) { - JsonElement element = - adapterConditionSplitState.toJsonTree( - (ConditionSplitState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `RandomSplitState` - if (value.getActualInstance() instanceof RandomSplitState) { - JsonElement element = - adapterRandomSplitState.toJsonTree( - (RandomSplitState) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match oneOf schemas:" - + " AudienceEntryState, ConditionSplitState," - + " DestinationState, EventEntryState," - + " EventSplitWithTimeoutState, RandomSplitState," - + " SimpleDelayState"); - } - - @Override - public TransitionState read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize EventEntryState - try { - // validate the JSON object to see if any exception is thrown - EventEntryState.validateJsonElement(jsonElement); - actualAdapter = adapterEventEntryState; - match++; - log.log(Level.FINER, "Input data matches schema 'EventEntryState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for EventEntryState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'EventEntryState'", - e); - } - // deserialize AudienceEntryState - try { - // validate the JSON object to see if any exception is thrown - AudienceEntryState.validateJsonElement(jsonElement); - actualAdapter = adapterAudienceEntryState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'AudienceEntryState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for AudienceEntryState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'AudienceEntryState'", - e); - } - // deserialize DestinationState - try { - // validate the JSON object to see if any exception is thrown - DestinationState.validateJsonElement(jsonElement); - actualAdapter = adapterDestinationState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'DestinationState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DestinationState'", - e); - } - // deserialize SimpleDelayState - try { - // validate the JSON object to see if any exception is thrown - SimpleDelayState.validateJsonElement(jsonElement); - actualAdapter = adapterSimpleDelayState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'SimpleDelayState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for SimpleDelayState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'SimpleDelayState'", - e); - } - // deserialize EventSplitWithTimeoutState - try { - // validate the JSON object to see if any exception is thrown - EventSplitWithTimeoutState.validateJsonElement(jsonElement); - actualAdapter = adapterEventSplitWithTimeoutState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'EventSplitWithTimeoutState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for EventSplitWithTimeoutState" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'EventSplitWithTimeoutState'", - e); - } - // deserialize ConditionSplitState - try { - // validate the JSON object to see if any exception is thrown - ConditionSplitState.validateJsonElement(jsonElement); - actualAdapter = adapterConditionSplitState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'ConditionSplitState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ConditionSplitState failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ConditionSplitState'", - e); - } - // deserialize RandomSplitState - try { - // validate the JSON object to see if any exception is thrown - RandomSplitState.validateJsonElement(jsonElement); - actualAdapter = adapterRandomSplitState; - match++; - log.log( - Level.FINER, - "Input data matches schema 'RandomSplitState'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for RandomSplitState failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'RandomSplitState'", - e); - } - - if (match == 1) { - TransitionState ret = new TransitionState(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException( - String.format( - "Failed deserialization for TransitionState: %d classes" - + " match result, expected 1. Detailed failure" - + " message for oneOf schemas: %s. JSON: %s", - match, errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public TransitionState() { - super("oneOf", Boolean.FALSE); - } - - public TransitionState(AudienceEntryState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionState(ConditionSplitState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionState(DestinationState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionState(EventEntryState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionState(EventSplitWithTimeoutState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionState(RandomSplitState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionState(SimpleDelayState o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("EventEntryState", EventEntryState.class); - schemas.put("AudienceEntryState", AudienceEntryState.class); - schemas.put("DestinationState", DestinationState.class); - schemas.put("SimpleDelayState", SimpleDelayState.class); - schemas.put("EventSplitWithTimeoutState", EventSplitWithTimeoutState.class); - schemas.put("ConditionSplitState", ConditionSplitState.class); - schemas.put("RandomSplitState", RandomSplitState.class); - } - - @Override - public Map> getSchemas() { - return TransitionState.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: AudienceEntryState, ConditionSplitState, DestinationState, - * EventEntryState, EventSplitWithTimeoutState, RandomSplitState, SimpleDelayState - * - *

It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof EventEntryState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AudienceEntryState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof DestinationState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof SimpleDelayState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof EventSplitWithTimeoutState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ConditionSplitState) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof RandomSplitState) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be AudienceEntryState, ConditionSplitState," - + " DestinationState, EventEntryState, EventSplitWithTimeoutState," - + " RandomSplitState, SimpleDelayState"); - } - - /** - * Get the actual instance, which can be the following: AudienceEntryState, ConditionSplitState, - * DestinationState, EventEntryState, EventSplitWithTimeoutState, RandomSplitState, - * SimpleDelayState - * - * @return The actual instance (AudienceEntryState, ConditionSplitState, DestinationState, - * EventEntryState, EventSplitWithTimeoutState, RandomSplitState, SimpleDelayState) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `EventEntryState`. If the actual instance is not - * `EventEntryState`, the ClassCastException will be thrown. - * - * @return The actual instance of `EventEntryState` - * @throws ClassCastException if the instance is not `EventEntryState` - */ - public EventEntryState getEventEntryState() throws ClassCastException { - return (EventEntryState) super.getActualInstance(); - } - - /** - * Get the actual instance of `AudienceEntryState`. If the actual instance is not - * `AudienceEntryState`, the ClassCastException will be thrown. - * - * @return The actual instance of `AudienceEntryState` - * @throws ClassCastException if the instance is not `AudienceEntryState` - */ - public AudienceEntryState getAudienceEntryState() throws ClassCastException { - return (AudienceEntryState) super.getActualInstance(); - } - - /** - * Get the actual instance of `DestinationState`. If the actual instance is not - * `DestinationState`, the ClassCastException will be thrown. - * - * @return The actual instance of `DestinationState` - * @throws ClassCastException if the instance is not `DestinationState` - */ - public DestinationState getDestinationState() throws ClassCastException { - return (DestinationState) super.getActualInstance(); - } - - /** - * Get the actual instance of `SimpleDelayState`. If the actual instance is not - * `SimpleDelayState`, the ClassCastException will be thrown. - * - * @return The actual instance of `SimpleDelayState` - * @throws ClassCastException if the instance is not `SimpleDelayState` - */ - public SimpleDelayState getSimpleDelayState() throws ClassCastException { - return (SimpleDelayState) super.getActualInstance(); - } - - /** - * Get the actual instance of `EventSplitWithTimeoutState`. If the actual instance is not - * `EventSplitWithTimeoutState`, the ClassCastException will be thrown. - * - * @return The actual instance of `EventSplitWithTimeoutState` - * @throws ClassCastException if the instance is not `EventSplitWithTimeoutState` - */ - public EventSplitWithTimeoutState getEventSplitWithTimeoutState() throws ClassCastException { - return (EventSplitWithTimeoutState) super.getActualInstance(); - } - - /** - * Get the actual instance of `ConditionSplitState`. If the actual instance is not - * `ConditionSplitState`, the ClassCastException will be thrown. - * - * @return The actual instance of `ConditionSplitState` - * @throws ClassCastException if the instance is not `ConditionSplitState` - */ - public ConditionSplitState getConditionSplitState() throws ClassCastException { - return (ConditionSplitState) super.getActualInstance(); - } - - /** - * Get the actual instance of `RandomSplitState`. If the actual instance is not - * `RandomSplitState`, the ClassCastException will be thrown. - * - * @return The actual instance of `RandomSplitState` - * @throws ClassCastException if the instance is not `RandomSplitState` - */ - public RandomSplitState getRandomSplitState() throws ClassCastException { - return (RandomSplitState) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TransitionState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with EventEntryState - try { - EventEntryState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for EventEntryState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with AudienceEntryState - try { - AudienceEntryState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for AudienceEntryState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with DestinationState - try { - DestinationState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for DestinationState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with SimpleDelayState - try { - SimpleDelayState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for SimpleDelayState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with EventSplitWithTimeoutState - try { - EventSplitWithTimeoutState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for EventSplitWithTimeoutState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ConditionSplitState - try { - ConditionSplitState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ConditionSplitState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with RandomSplitState - try { - RandomSplitState.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for RandomSplitState failed with `%s`.", - e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException( - String.format( - "The JSON string is invalid for TransitionState with oneOf schemas:" - + " AudienceEntryState, ConditionSplitState, DestinationState," - + " EventEntryState, EventSplitWithTimeoutState, RandomSplitState," - + " SimpleDelayState. %d class(es) match the result, expected 1." - + " Detailed failure message for oneOf schemas: %s. JSON: %s", - validCount, errorMessages, jsonElement.toString())); - } - } - - /** - * Create an instance of TransitionState given an JSON string - * - * @param jsonString JSON string - * @return An instance of TransitionState - * @throws IOException if the JSON string is invalid with respect to TransitionState - */ - public static TransitionState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TransitionState.class); - } - - /** - * Convert an instance of TransitionState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/Transitions.java b/src/main/java/com/segment/publicapi/models/Transitions.java deleted file mode 100644 index 1bc607ee..00000000 --- a/src/main/java/com/segment/publicapi/models/Transitions.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Transitions */ -public class Transitions { - public static final String SERIALIZED_NAME_NEXT = "next"; - - @SerializedName(SERIALIZED_NAME_NEXT) - private String next; - - public Transitions() {} - - public Transitions next(String next) { - - this.next = next; - return this; - } - - /** - * Get next - * - * @return next - */ - @javax.annotation.Nonnull - public String getNext() { - return next; - } - - public void setNext(String next) { - this.next = next; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Transitions transitions = (Transitions) o; - return Objects.equals(this.next, transitions.next); - } - - @Override - public int hashCode() { - return Objects.hash(next); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Transitions {\n"); - sb.append(" next: ").append(toIndentedString(next)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("next"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("next"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Transitions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Transitions.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in Transitions is not found in the empty" - + " JSON string", - Transitions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Transitions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `Transitions` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Transitions.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("next").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `next` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("next").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Transitions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Transitions' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Transitions.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Transitions value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Transitions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of Transitions given an JSON string - * - * @param jsonString JSON string - * @return An instance of Transitions - * @throws IOException if the JSON string is invalid with respect to Transitions - */ - public static Transitions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Transitions.class); - } - - /** - * Convert an instance of Transitions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TransitionsInner.java b/src/main/java/com/segment/publicapi/models/TransitionsInner.java deleted file mode 100644 index 10574ddf..00000000 --- a/src/main/java/com/segment/publicapi/models/TransitionsInner.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class TransitionsInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(TransitionsInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransitionsInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TransitionsInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterConditionBranch = - gson.getDelegateAdapter(this, TypeToken.get(ConditionBranch.class)); - final TypeAdapter adapterTimeOutBranch = - gson.getDelegateAdapter(this, TypeToken.get(TimeOutBranch.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TransitionsInner value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `ConditionBranch` - if (value.getActualInstance() instanceof ConditionBranch) { - JsonElement element = - adapterConditionBranch.toJsonTree( - (ConditionBranch) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `TimeOutBranch` - if (value.getActualInstance() instanceof TimeOutBranch) { - JsonElement element = - adapterTimeOutBranch.toJsonTree( - (TimeOutBranch) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ConditionBranch, TimeOutBranch"); - } - - @Override - public TransitionsInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize ConditionBranch - try { - // validate the JSON object to see if any exception is thrown - ConditionBranch.validateJsonElement(jsonElement); - actualAdapter = adapterConditionBranch; - TransitionsInner ret = new TransitionsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ConditionBranch failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ConditionBranch'", - e); - } - // deserialize TimeOutBranch - try { - // validate the JSON object to see if any exception is thrown - TimeOutBranch.validateJsonElement(jsonElement); - actualAdapter = adapterTimeOutBranch; - TransitionsInner ret = new TransitionsInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for TimeOutBranch failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'TimeOutBranch'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for TransitionsInner: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public TransitionsInner() { - super("anyOf", Boolean.FALSE); - } - - public TransitionsInner(ConditionBranch o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionsInner(TimeOutBranch o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("ConditionBranch", ConditionBranch.class); - schemas.put("TimeOutBranch", TimeOutBranch.class); - } - - @Override - public Map> getSchemas() { - return TransitionsInner.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ConditionBranch, TimeOutBranch - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof ConditionBranch) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof TimeOutBranch) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be ConditionBranch, TimeOutBranch"); - } - - /** - * Get the actual instance, which can be the following: ConditionBranch, TimeOutBranch - * - * @return The actual instance (ConditionBranch, TimeOutBranch) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `ConditionBranch`. If the actual instance is not - * `ConditionBranch`, the ClassCastException will be thrown. - * - * @return The actual instance of `ConditionBranch` - * @throws ClassCastException if the instance is not `ConditionBranch` - */ - public ConditionBranch getConditionBranch() throws ClassCastException { - return (ConditionBranch) super.getActualInstance(); - } - - /** - * Get the actual instance of `TimeOutBranch`. If the actual instance is not `TimeOutBranch`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `TimeOutBranch` - * @throws ClassCastException if the instance is not `TimeOutBranch` - */ - public TimeOutBranch getTimeOutBranch() throws ClassCastException { - return (TimeOutBranch) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TransitionsInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ConditionBranch - try { - ConditionBranch.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ConditionBranch failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with TimeOutBranch - try { - TimeOutBranch.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for TimeOutBranch failed with `%s`.", e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for TransitionsInner with anyOf schemas:" - + " ConditionBranch, TimeOutBranch. no class match the result, expected" - + " at least 1. Detailed failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of TransitionsInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of TransitionsInner - * @throws IOException if the JSON string is invalid with respect to TransitionsInner - */ - public static TransitionsInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TransitionsInner.class); - } - - /** - * Convert an instance of TransitionsInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/TransitionsInner1.java b/src/main/java/com/segment/publicapi/models/TransitionsInner1.java deleted file mode 100644 index 4f0e55ed..00000000 --- a/src/main/java/com/segment/publicapi/models/TransitionsInner1.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class TransitionsInner1 extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(TransitionsInner1.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransitionsInner1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TransitionsInner1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterConditionBranch = - gson.getDelegateAdapter(this, TypeToken.get(ConditionBranch.class)); - final TypeAdapter adapterDefaultBranch = - gson.getDelegateAdapter(this, TypeToken.get(DefaultBranch.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, TransitionsInner1 value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `ConditionBranch` - if (value.getActualInstance() instanceof ConditionBranch) { - JsonElement element = - adapterConditionBranch.toJsonTree( - (ConditionBranch) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `DefaultBranch` - if (value.getActualInstance() instanceof DefaultBranch) { - JsonElement element = - adapterDefaultBranch.toJsonTree( - (DefaultBranch) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ConditionBranch, DefaultBranch"); - } - - @Override - public TransitionsInner1 read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize ConditionBranch - try { - // validate the JSON object to see if any exception is thrown - ConditionBranch.validateJsonElement(jsonElement); - actualAdapter = adapterConditionBranch; - TransitionsInner1 ret = new TransitionsInner1(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ConditionBranch failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'ConditionBranch'", - e); - } - // deserialize DefaultBranch - try { - // validate the JSON object to see if any exception is thrown - DefaultBranch.validateJsonElement(jsonElement); - actualAdapter = adapterDefaultBranch; - TransitionsInner1 ret = new TransitionsInner1(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for DefaultBranch failed with" - + " `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'DefaultBranch'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for TransitionsInner1: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public TransitionsInner1() { - super("anyOf", Boolean.FALSE); - } - - public TransitionsInner1(ConditionBranch o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public TransitionsInner1(DefaultBranch o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("ConditionBranch", ConditionBranch.class); - schemas.put("DefaultBranch", DefaultBranch.class); - } - - @Override - public Map> getSchemas() { - return TransitionsInner1.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ConditionBranch, DefaultBranch - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof ConditionBranch) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof DefaultBranch) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be ConditionBranch, DefaultBranch"); - } - - /** - * Get the actual instance, which can be the following: ConditionBranch, DefaultBranch - * - * @return The actual instance (ConditionBranch, DefaultBranch) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `ConditionBranch`. If the actual instance is not - * `ConditionBranch`, the ClassCastException will be thrown. - * - * @return The actual instance of `ConditionBranch` - * @throws ClassCastException if the instance is not `ConditionBranch` - */ - public ConditionBranch getConditionBranch() throws ClassCastException { - return (ConditionBranch) super.getActualInstance(); - } - - /** - * Get the actual instance of `DefaultBranch`. If the actual instance is not `DefaultBranch`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `DefaultBranch` - * @throws ClassCastException if the instance is not `DefaultBranch` - */ - public DefaultBranch getDefaultBranch() throws ClassCastException { - return (DefaultBranch) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TransitionsInner1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ConditionBranch - try { - ConditionBranch.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ConditionBranch failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with DefaultBranch - try { - DefaultBranch.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for DefaultBranch failed with `%s`.", e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for TransitionsInner1 with anyOf schemas:" - + " ConditionBranch, DefaultBranch. no class match the result, expected" - + " at least 1. Detailed failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of TransitionsInner1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of TransitionsInner1 - * @throws IOException if the JSON string is invalid with respect to TransitionsInner1 - */ - public static TransitionsInner1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TransitionsInner1.class); - } - - /** - * Convert an instance of TransitionsInner1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java deleted file mode 100644 index 0705b968..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourney200Response.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** UpdateDestinationsForJourney200Response */ -public class UpdateDestinationsForJourney200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private UpdateDestinationsForJourneyAlphaOutput data; - - public UpdateDestinationsForJourney200Response() {} - - public UpdateDestinationsForJourney200Response data( - UpdateDestinationsForJourneyAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public UpdateDestinationsForJourneyAlphaOutput getData() { - return data; - } - - public void setData(UpdateDestinationsForJourneyAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateDestinationsForJourney200Response updateDestinationsForJourney200Response = - (UpdateDestinationsForJourney200Response) o; - return Objects.equals(this.data, updateDestinationsForJourney200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateDestinationsForJourney200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateDestinationsForJourney200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateDestinationsForJourney200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " UpdateDestinationsForJourney200Response is not found in the" - + " empty JSON string", - UpdateDestinationsForJourney200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateDestinationsForJourney200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateDestinationsForJourney200Response` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - UpdateDestinationsForJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateDestinationsForJourney200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'UpdateDestinationsForJourney200Response' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateDestinationsForJourney200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateDestinationsForJourney200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateDestinationsForJourney200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateDestinationsForJourney200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateDestinationsForJourney200Response - * @throws IOException if the JSON string is invalid with respect to - * UpdateDestinationsForJourney200Response - */ - public static UpdateDestinationsForJourney200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateDestinationsForJourney200Response.class); - } - - /** - * Convert an instance of UpdateDestinationsForJourney200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java deleted file mode 100644 index b7b196d3..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaInput.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Update DESTINATIONS for a journey. */ -public class UpdateDestinationsForJourneyAlphaInput { - public static final String SERIALIZED_NAME_STATE_DESTINATIONS = "stateDestinations"; - - @SerializedName(SERIALIZED_NAME_STATE_DESTINATIONS) - private List stateDestinations = new ArrayList<>(); - - public UpdateDestinationsForJourneyAlphaInput() {} - - public UpdateDestinationsForJourneyAlphaInput stateDestinations( - List stateDestinations) { - - this.stateDestinations = stateDestinations; - return this; - } - - public UpdateDestinationsForJourneyAlphaInput addStateDestinationsItem( - UpdateDestinationsInput stateDestinationsItem) { - if (this.stateDestinations == null) { - this.stateDestinations = new ArrayList<>(); - } - this.stateDestinations.add(stateDestinationsItem); - return this; - } - - /** - * The updated DESTINATIONS. - * - * @return stateDestinations - */ - @javax.annotation.Nonnull - public List getStateDestinations() { - return stateDestinations; - } - - public void setStateDestinations(List stateDestinations) { - this.stateDestinations = stateDestinations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateDestinationsForJourneyAlphaInput updateDestinationsForJourneyAlphaInput = - (UpdateDestinationsForJourneyAlphaInput) o; - return Objects.equals( - this.stateDestinations, updateDestinationsForJourneyAlphaInput.stateDestinations); - } - - @Override - public int hashCode() { - return Objects.hash(stateDestinations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateDestinationsForJourneyAlphaInput {\n"); - sb.append(" stateDestinations: ") - .append(toIndentedString(stateDestinations)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stateDestinations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stateDestinations"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateDestinationsForJourneyAlphaInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateDestinationsForJourneyAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateDestinationsForJourneyAlphaInput" - + " is not found in the empty JSON string", - UpdateDestinationsForJourneyAlphaInput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateDestinationsForJourneyAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateDestinationsForJourneyAlphaInput` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateDestinationsForJourneyAlphaInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stateDestinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stateDestinations` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("stateDestinations").toString())); - } - - JsonArray jsonArraystateDestinations = jsonObj.getAsJsonArray("stateDestinations"); - // validate the required field `stateDestinations` (array) - for (int i = 0; i < jsonArraystateDestinations.size(); i++) { - UpdateDestinationsInput.validateJsonElement(jsonArraystateDestinations.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateDestinationsForJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateDestinationsForJourneyAlphaInput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateDestinationsForJourneyAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateDestinationsForJourneyAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateDestinationsForJourneyAlphaInput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateDestinationsForJourneyAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateDestinationsForJourneyAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * UpdateDestinationsForJourneyAlphaInput - */ - public static UpdateDestinationsForJourneyAlphaInput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateDestinationsForJourneyAlphaInput.class); - } - - /** - * Convert an instance of UpdateDestinationsForJourneyAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java deleted file mode 100644 index 044f943a..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationsForJourneyAlphaOutput.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** DESTINATION update response. */ -public class UpdateDestinationsForJourneyAlphaOutput { - public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; - - @SerializedName(SERIALIZED_NAME_CONTAINER_ID) - private String containerId; - - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; - - public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; - - @SerializedName(SERIALIZED_NAME_DESTINATIONS) - private List destinations = new ArrayList<>(); - - public UpdateDestinationsForJourneyAlphaOutput() {} - - public UpdateDestinationsForJourneyAlphaOutput containerId(String containerId) { - - this.containerId = containerId; - return this; - } - - /** - * The journey container id. - * - * @return containerId - */ - @javax.annotation.Nonnull - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public UpdateDestinationsForJourneyAlphaOutput version(BigDecimal version) { - - this.version = version; - return this; - } - - /** - * The version of journey. - * - * @return version - */ - @javax.annotation.Nullable - public BigDecimal getVersion() { - return version; - } - - public void setVersion(BigDecimal version) { - this.version = version; - } - - public UpdateDestinationsForJourneyAlphaOutput destinations( - List destinations) { - - this.destinations = destinations; - return this; - } - - public UpdateDestinationsForJourneyAlphaOutput addDestinationsItem( - DestinationsInner destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * The updated DESTINATIONS. - * - * @return destinations - */ - @javax.annotation.Nonnull - public List getDestinations() { - return destinations; - } - - public void setDestinations(List destinations) { - this.destinations = destinations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateDestinationsForJourneyAlphaOutput updateDestinationsForJourneyAlphaOutput = - (UpdateDestinationsForJourneyAlphaOutput) o; - return Objects.equals(this.containerId, updateDestinationsForJourneyAlphaOutput.containerId) - && Objects.equals(this.version, updateDestinationsForJourneyAlphaOutput.version) - && Objects.equals( - this.destinations, updateDestinationsForJourneyAlphaOutput.destinations); - } - - @Override - public int hashCode() { - return Objects.hash(containerId, version, destinations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateDestinationsForJourneyAlphaOutput {\n"); - sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerId"); - openapiFields.add("version"); - openapiFields.add("destinations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("containerId"); - openapiRequiredFields.add("destinations"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateDestinationsForJourneyAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateDestinationsForJourneyAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " UpdateDestinationsForJourneyAlphaOutput is not found in the" - + " empty JSON string", - UpdateDestinationsForJourneyAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateDestinationsForJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateDestinationsForJourneyAlphaOutput` properties. JSON:" - + " %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateDestinationsForJourneyAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("containerId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `containerId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("containerId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("destinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinations` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("destinations").toString())); - } - - JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); - // validate the required field `destinations` (array) - for (int i = 0; i < jsonArraydestinations.size(); i++) { - DestinationsInner.validateJsonElement(jsonArraydestinations.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateDestinationsForJourneyAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'UpdateDestinationsForJourneyAlphaOutput' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateDestinationsForJourneyAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, UpdateDestinationsForJourneyAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateDestinationsForJourneyAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateDestinationsForJourneyAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateDestinationsForJourneyAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * UpdateDestinationsForJourneyAlphaOutput - */ - public static UpdateDestinationsForJourneyAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateDestinationsForJourneyAlphaOutput.class); - } - - /** - * Convert an instance of UpdateDestinationsForJourneyAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java b/src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java deleted file mode 100644 index acdcbe50..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateDestinationsInput.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** The DESTINATION and state combination. */ -public class UpdateDestinationsInput { - public static final String SERIALIZED_NAME_STATE_ID = "stateId"; - - @SerializedName(SERIALIZED_NAME_STATE_ID) - private String stateId; - - public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; - - @SerializedName(SERIALIZED_NAME_DESTINATIONS) - private List destinations = new ArrayList<>(); - - public UpdateDestinationsInput() {} - - public UpdateDestinationsInput stateId(String stateId) { - - this.stateId = stateId; - return this; - } - - /** - * Id of the DESTINATION state. - * - * @return stateId - */ - @javax.annotation.Nonnull - public String getStateId() { - return stateId; - } - - public void setStateId(String stateId) { - this.stateId = stateId; - } - - public UpdateDestinationsInput destinations(List destinations) { - - this.destinations = destinations; - return this; - } - - public UpdateDestinationsInput addDestinationsItem(Destination destinationsItem) { - if (this.destinations == null) { - this.destinations = new ArrayList<>(); - } - this.destinations.add(destinationsItem); - return this; - } - - /** - * The DESTINATIONS to be replaced. - * - * @return destinations - */ - @javax.annotation.Nonnull - public List getDestinations() { - return destinations; - } - - public void setDestinations(List destinations) { - this.destinations = destinations; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateDestinationsInput updateDestinationsInput = (UpdateDestinationsInput) o; - return Objects.equals(this.stateId, updateDestinationsInput.stateId) - && Objects.equals(this.destinations, updateDestinationsInput.destinations); - } - - @Override - public int hashCode() { - return Objects.hash(stateId, destinations); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateDestinationsInput {\n"); - sb.append(" stateId: ").append(toIndentedString(stateId)).append("\n"); - sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stateId"); - openapiFields.add("destinations"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stateId"); - openapiRequiredFields.add("destinations"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateDestinationsInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateDestinationsInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateDestinationsInput is not found" - + " in the empty JSON string", - UpdateDestinationsInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateDestinationsInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateDestinationsInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateDestinationsInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("stateId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stateId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("stateId").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("destinations").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `destinations` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("destinations").toString())); - } - - JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); - // validate the required field `destinations` (array) - for (int i = 0; i < jsonArraydestinations.size(); i++) { - Destination.validateJsonElement(jsonArraydestinations.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateDestinationsInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateDestinationsInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateDestinationsInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateDestinationsInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateDestinationsInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateDestinationsInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateDestinationsInput - * @throws IOException if the JSON string is invalid with respect to UpdateDestinationsInput - */ - public static UpdateDestinationsInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateDestinationsInput.class); - } - - /** - * Convert an instance of UpdateDestinationsInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java deleted file mode 100644 index 31daf626..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourney200Response.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** UpdateStatusForJourney200Response */ -public class UpdateStatusForJourney200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private UpdateStatusForJourneyAlphaOutput data; - - public UpdateStatusForJourney200Response() {} - - public UpdateStatusForJourney200Response data(UpdateStatusForJourneyAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public UpdateStatusForJourneyAlphaOutput getData() { - return data; - } - - public void setData(UpdateStatusForJourneyAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateStatusForJourney200Response updateStatusForJourney200Response = - (UpdateStatusForJourney200Response) o; - return Objects.equals(this.data, updateStatusForJourney200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateStatusForJourney200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateStatusForJourney200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateStatusForJourney200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateStatusForJourney200Response is" - + " not found in the empty JSON string", - UpdateStatusForJourney200Response.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateStatusForJourney200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateStatusForJourney200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - UpdateStatusForJourneyAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateStatusForJourney200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateStatusForJourney200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateStatusForJourney200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateStatusForJourney200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateStatusForJourney200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateStatusForJourney200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateStatusForJourney200Response - * @throws IOException if the JSON string is invalid with respect to - * UpdateStatusForJourney200Response - */ - public static UpdateStatusForJourney200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateStatusForJourney200Response.class); - } - - /** - * Convert an instance of UpdateStatusForJourney200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java deleted file mode 100644 index 44422535..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaInput.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Update journey status input. */ -public class UpdateStatusForJourneyAlphaInput { - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; - - /** The action to perform for the journey. */ - @JsonAdapter(ActionEnum.Adapter.class) - public enum ActionEnum { - ARCHIVE("ARCHIVE"), - - PAUSE_ENTRY("PAUSE_ENTRY"), - - PUBLISH("PUBLISH"); - - private String value; - - ActionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ActionEnum fromValue(String value) { - for (ActionEnum b : ActionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ActionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ActionEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_ACTION = "action"; - - @SerializedName(SERIALIZED_NAME_ACTION) - private ActionEnum action; - - public UpdateStatusForJourneyAlphaInput() {} - - public UpdateStatusForJourneyAlphaInput version(BigDecimal version) { - - this.version = version; - return this; - } - - /** - * The journey version. - * - * @return version - */ - @javax.annotation.Nonnull - public BigDecimal getVersion() { - return version; - } - - public void setVersion(BigDecimal version) { - this.version = version; - } - - public UpdateStatusForJourneyAlphaInput action(ActionEnum action) { - - this.action = action; - return this; - } - - /** - * The action to perform for the journey. - * - * @return action - */ - @javax.annotation.Nonnull - public ActionEnum getAction() { - return action; - } - - public void setAction(ActionEnum action) { - this.action = action; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateStatusForJourneyAlphaInput updateStatusForJourneyAlphaInput = - (UpdateStatusForJourneyAlphaInput) o; - return Objects.equals(this.version, updateStatusForJourneyAlphaInput.version) - && Objects.equals(this.action, updateStatusForJourneyAlphaInput.action); - } - - @Override - public int hashCode() { - return Objects.hash(version, action); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateStatusForJourneyAlphaInput {\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("version"); - openapiFields.add("action"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("version"); - openapiRequiredFields.add("action"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateStatusForJourneyAlphaInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateStatusForJourneyAlphaInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateStatusForJourneyAlphaInput is" - + " not found in the empty JSON string", - UpdateStatusForJourneyAlphaInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateStatusForJourneyAlphaInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateStatusForJourneyAlphaInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateStatusForJourneyAlphaInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("action").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `action` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("action").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateStatusForJourneyAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateStatusForJourneyAlphaInput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateStatusForJourneyAlphaInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateStatusForJourneyAlphaInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateStatusForJourneyAlphaInput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateStatusForJourneyAlphaInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateStatusForJourneyAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * UpdateStatusForJourneyAlphaInput - */ - public static UpdateStatusForJourneyAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateStatusForJourneyAlphaInput.class); - } - - /** - * Convert an instance of UpdateStatusForJourneyAlphaInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java b/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java deleted file mode 100644 index 112375bc..00000000 --- a/src/main/java/com/segment/publicapi/models/UpdateStatusForJourneyAlphaOutput.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Update journey status output. */ -public class UpdateStatusForJourneyAlphaOutput { - public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId"; - - @SerializedName(SERIALIZED_NAME_CONTAINER_ID) - private String containerId; - - public static final String SERIALIZED_NAME_VERSION = "version"; - - @SerializedName(SERIALIZED_NAME_VERSION) - private BigDecimal version; - - /** The status of the journey. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ARCHIVED("ARCHIVED"), - - ENTRY_PAUSED("ENTRY_PAUSED"), - - PUBLISHED("PUBLISHED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public UpdateStatusForJourneyAlphaOutput() {} - - public UpdateStatusForJourneyAlphaOutput containerId(String containerId) { - - this.containerId = containerId; - return this; - } - - /** - * The journey container id. - * - * @return containerId - */ - @javax.annotation.Nonnull - public String getContainerId() { - return containerId; - } - - public void setContainerId(String containerId) { - this.containerId = containerId; - } - - public UpdateStatusForJourneyAlphaOutput version(BigDecimal version) { - - this.version = version; - return this; - } - - /** - * The journey version. - * - * @return version - */ - @javax.annotation.Nonnull - public BigDecimal getVersion() { - return version; - } - - public void setVersion(BigDecimal version) { - this.version = version; - } - - public UpdateStatusForJourneyAlphaOutput status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The status of the journey. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateStatusForJourneyAlphaOutput updateStatusForJourneyAlphaOutput = - (UpdateStatusForJourneyAlphaOutput) o; - return Objects.equals(this.containerId, updateStatusForJourneyAlphaOutput.containerId) - && Objects.equals(this.version, updateStatusForJourneyAlphaOutput.version) - && Objects.equals(this.status, updateStatusForJourneyAlphaOutput.status); - } - - @Override - public int hashCode() { - return Objects.hash(containerId, version, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateStatusForJourneyAlphaOutput {\n"); - sb.append(" containerId: ").append(toIndentedString(containerId)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("containerId"); - openapiFields.add("version"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("containerId"); - openapiRequiredFields.add("version"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * UpdateStatusForJourneyAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UpdateStatusForJourneyAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in UpdateStatusForJourneyAlphaOutput is" - + " not found in the empty JSON string", - UpdateStatusForJourneyAlphaOutput.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UpdateStatusForJourneyAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `UpdateStatusForJourneyAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateStatusForJourneyAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("containerId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `containerId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("containerId").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateStatusForJourneyAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateStatusForJourneyAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(UpdateStatusForJourneyAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, UpdateStatusForJourneyAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UpdateStatusForJourneyAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of UpdateStatusForJourneyAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateStatusForJourneyAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * UpdateStatusForJourneyAlphaOutput - */ - public static UpdateStatusForJourneyAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateStatusForJourneyAlphaOutput.class); - } - - /** - * Convert an instance of UpdateStatusForJourneyAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 7f0c6abb5745ef6bbc0f87f600a136fffe51ec29 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Sat, 12 Apr 2025 00:36:19 +0000 Subject: [PATCH 409/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b41b1eca. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 6 + .../segment/publicapi/api/AudiencesApi.java | 10 +- .../models/ListAudiences200Response.java | 10 +- .../models/ListAudiences200Response1.java | 194 +++++++++++++ .../models/ListAudiencesBetaOutput.java | 258 ++++++++++++++++++ 10 files changed, 478 insertions(+), 18 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiences200Response1.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java diff --git a/README.md b/README.md index d7ee68e5..2d31c471 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.1.1 +Latest API and SDK version: 58.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.1.1 + 58.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.1.1" + implementation "com.segment.publicapi:segment-publicapi:58.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.1.1.jar` +* `target/segment-publicapi-58.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index d6a2e073..ae7a633f 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -246,7 +246,7 @@ public class Example { List Audiences -Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -303,7 +303,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details diff --git a/pom.xml b/pom.xml index 46ffcd90..51bd6343 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.1.1 + 58.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 8df3d28f..5a626474 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.1.1 (Java)"); + setUserAgent("Public API SDK 58.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 91aefcaf..363ed0b3 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.1.1"; + public static final String VERSION = "58.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 4238781d..1510a13e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -889,9 +889,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiences200Response1 + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesBetaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index db0074ff..60a7836f 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -752,7 +752,9 @@ public okhttp3.Call listAudiencesCall( } final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -795,7 +797,7 @@ private okhttp3.Call listAudiencesValidateBeforeCall( } /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please * submit any feedback by sending an email to friends@segment.com. • In order to successfully * call this endpoint, the specified Workspace needs to have the Audience feature enabled. * Please reach out to your customer success manager for more information. The rate limit for @@ -828,7 +830,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa } /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Alpha** testing. Please + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please * submit any feedback by sending an email to friends@segment.com. • In order to successfully * call this endpoint, the specified Workspace needs to have the Audience feature enabled. * Please reach out to your customer success manager for more information. The rate limit for @@ -861,7 +863,7 @@ public ApiResponse listAudiencesWithHttpInfo( } /** - * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Alpha** + * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Beta** * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate diff --git a/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java index e1e21d50..428bf42d 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiences200Response.java @@ -32,11 +32,11 @@ public class ListAudiences200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListAudiencesAlphaOutput data; + private ListAudiencesBetaOutput data; public ListAudiences200Response() {} - public ListAudiences200Response data(ListAudiencesAlphaOutput data) { + public ListAudiences200Response data(ListAudiencesBetaOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public ListAudiences200Response data(ListAudiencesAlphaOutput data) { * @return data */ @javax.annotation.Nullable - public ListAudiencesAlphaOutput getData() { + public ListAudiencesBetaOutput getData() { return data; } - public void setData(ListAudiencesAlphaOutput data) { + public void setData(ListAudiencesBetaOutput data) { this.data = data; } @@ -137,7 +137,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ListAudiencesAlphaOutput.validateJsonElement(jsonObj.get("data")); + ListAudiencesBetaOutput.validateJsonElement(jsonObj.get("data")); } } diff --git a/src/main/java/com/segment/publicapi/models/ListAudiences200Response1.java b/src/main/java/com/segment/publicapi/models/ListAudiences200Response1.java new file mode 100644 index 00000000..bd4a25db --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiences200Response1.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListAudiences200Response1 */ +public class ListAudiences200Response1 { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListAudiencesAlphaOutput data; + + public ListAudiences200Response1() {} + + public ListAudiences200Response1 data(ListAudiencesAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListAudiencesAlphaOutput getData() { + return data; + } + + public void setData(ListAudiencesAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiences200Response1 listAudiences200Response1 = (ListAudiences200Response1) o; + return Objects.equals(this.data, listAudiences200Response1.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiences200Response1 {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListAudiences200Response1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudiences200Response1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiences200Response1 is not found" + + " in the empty JSON string", + ListAudiences200Response1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudiences200Response1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiences200Response1` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListAudiencesAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiences200Response1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiences200Response1' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudiences200Response1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiences200Response1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiences200Response1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiences200Response1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiences200Response1 + * @throws IOException if the JSON string is invalid with respect to ListAudiences200Response1 + */ + public static ListAudiences200Response1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiences200Response1.class); + } + + /** + * Convert an instance of ListAudiences200Response1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java new file mode 100644 index 00000000..e8147ed5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -0,0 +1,258 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** List audiences endpoint output. */ +public class ListAudiencesBetaOutput { + public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; + + @SerializedName(SERIALIZED_NAME_AUDIENCES) + private List audiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationOutput pagination; + + public ListAudiencesBetaOutput() {} + + public ListAudiencesBetaOutput audiences(List audiences) { + + this.audiences = audiences; + return this; + } + + public ListAudiencesBetaOutput addAudiencesItem(AudienceSummaryBeta audiencesItem) { + if (this.audiences == null) { + this.audiences = new ArrayList<>(); + } + this.audiences.add(audiencesItem); + return this; + } + + /** + * A list of audience summary results. + * + * @return audiences + */ + @javax.annotation.Nonnull + public List getAudiences() { + return audiences; + } + + public void setAudiences(List audiences) { + this.audiences = audiences; + } + + public ListAudiencesBetaOutput pagination(PaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nonnull + public PaginationOutput getPagination() { + return pagination; + } + + public void setPagination(PaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesBetaOutput listAudiencesBetaOutput = (ListAudiencesBetaOutput) o; + return Objects.equals(this.audiences, listAudiencesBetaOutput.audiences) + && Objects.equals(this.pagination, listAudiencesBetaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(audiences, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesBetaOutput {\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiences"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiences"); + openapiRequiredFields.add("pagination"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListAudiencesBetaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudiencesBetaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesBetaOutput is not found" + + " in the empty JSON string", + ListAudiencesBetaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudiencesBetaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesBetaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesBetaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("audiences").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audiences` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("audiences").toString())); + } + + JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); + // validate the required field `audiences` (array) + for (int i = 0; i < jsonArrayaudiences.size(); i++) { + AudienceSummaryBeta.validateJsonElement(jsonArrayaudiences.get(i)); + } + ; + // validate the required field `pagination` + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesBetaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesBetaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudiencesBetaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesBetaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesBetaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesBetaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesBetaOutput + * @throws IOException if the JSON string is invalid with respect to ListAudiencesBetaOutput + */ + public static ListAudiencesBetaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesBetaOutput.class); + } + + /** + * Convert an instance of ListAudiencesBetaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 50a641a54b619c587e4de37d5df95b903b1c6f42 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 21 Apr 2025 08:59:27 +0000 Subject: [PATCH 410/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@0998b384. --- docs/FunctionsApi.md | 2 +- .../com/segment/publicapi/models/CreateFunctionV1Input.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/FunctionsApi.md b/docs/FunctionsApi.md index 15a621a8..b35be929 100644 --- a/docs/FunctionsApi.md +++ b/docs/FunctionsApi.md @@ -732,7 +732,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pagination** | [**PaginationInput**](.md)| Pagination parameters. This parameter exists in v1. | [optional] | -| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, SOURCE] | +| **resourceType** | **String**| The Function type. Config API note: equal to `type`. This parameter exists in v1. | [enum: DESTINATION, INSERT_DESTINATION, INSERT_SOURCE, SOURCE] | ### Return type diff --git a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java index 8ce751b4..2d938849 100644 --- a/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java +++ b/src/main/java/com/segment/publicapi/models/CreateFunctionV1Input.java @@ -60,6 +60,8 @@ public enum ResourceTypeEnum { INSERT_DESTINATION("INSERT_DESTINATION"), + INSERT_SOURCE("INSERT_SOURCE"), + SOURCE("SOURCE"); private String value; From fac6c6b27b19b55b73c09d9b690af7ac6538a5ec Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 21 Apr 2025 19:22:54 +0000 Subject: [PATCH 411/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@50e42bf5. --- docs/AudiencesApi.md | 16 +- src/main/java/com/segment/publicapi/JSON.java | 22 +- .../segment/publicapi/api/AudiencesApi.java | 98 ++- .../publicapi/models/AudienceDefinition.java | 70 +- .../publicapi/models/AudienceOptionsBeta.java | 225 ------- .../publicapi/models/AudienceSummaryBeta.java | 637 ------------------ .../models/CreateAudienceAlphaInput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- ...sumersFromSpaceAndAudience200Response.java | 10 +- ...umersFromSpaceAndAudienceAlphaOutput.java} | 71 +- ... => ListAudienceConsumersSearchInput.java} | 132 ++-- ...va => ListAudienceConsumersSortInput.java} | 204 +++--- .../models/ListAudiencesBetaOutput.java | 12 +- ... => UpdateAudienceForSpaceAlphaInput.java} | 78 ++- 14 files changed, 420 insertions(+), 1175 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java rename src/main/java/com/segment/publicapi/models/{ListAudienceConsumersFromSpaceAndAudienceOutput.java => ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.java} (81%) rename src/main/java/com/segment/publicapi/models/{AudienceDefinitionBeta.java => ListAudienceConsumersSearchInput.java} (75%) rename src/main/java/com/segment/publicapi/models/{AudienceComputationDefinition.java => ListAudienceConsumersSortInput.java} (53%) rename src/main/java/com/segment/publicapi/models/{UpdateAudienceForSpaceInput.java => UpdateAudienceForSpaceAlphaInput.java} (78%) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index ae7a633f..3a042268 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -165,7 +165,7 @@ public class Example { ## Operation: listAudienceConsumersFromSpaceAndAudience -> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination) +> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) List Audience Consumers from Space And Audience @@ -194,8 +194,10 @@ public class Example { String spaceId = "spaceId"; // String | String id = "ReferencedAudienceId"; // String | PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. + ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. try { - ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination); + ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); @@ -216,6 +218,8 @@ public class Example { | **spaceId** | **String**| | | | **id** | **String**| | | | **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | +| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type @@ -392,7 +396,7 @@ public class Example { ## Operation: updateAudienceForSpace -> UpdateAudienceForSpace200Response updateAudienceForSpace(spaceId, id, updateAudienceForSpaceInput) +> UpdateAudienceForSpace200Response updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput) Update Audience for Space @@ -420,9 +424,9 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | String id = "id"; // String | - UpdateAudienceForSpaceInput updateAudienceForSpaceInput = new UpdateAudienceForSpaceInput(); // UpdateAudienceForSpaceInput | + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { - UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceInput); + UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#updateAudienceForSpace"); @@ -442,7 +446,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **updateAudienceForSpaceInput** | [**UpdateAudienceForSpaceInput**](UpdateAudienceForSpaceInput.md)| | | +| **updateAudienceForSpaceAlphaInput** | [**UpdateAudienceForSpaceAlphaInput**](UpdateAudienceForSpaceAlphaInput.md)| | | ### Return type diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 1510a13e..3d116090 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,21 +163,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceComputationDefinition - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceDefinitionBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceOptionsBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSummaryBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -884,7 +875,14 @@ private static Class getClassByDiscriminator( .ListAudienceConsumersFromSpaceAndAudience200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudienceOutput + new com.segment.publicapi.models + .ListAudienceConsumersFromSpaceAndAudienceAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudienceConsumersSearchInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudienceConsumersSortInput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response @@ -1444,10 +1442,10 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.UpdateAudienceForSpace200Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateAudienceForSpaceAlphaOutput + new com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.UpdateAudienceForSpaceInput + new com.segment.publicapi.models.UpdateAudienceForSpaceAlphaOutput .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateComputedTraitForSpace200Response diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 60a7836f..d42e82d5 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -22,11 +22,13 @@ import com.segment.publicapi.models.CreateAudienceAlphaInput; import com.segment.publicapi.models.GetAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; +import com.segment.publicapi.models.ListAudienceConsumersSearchInput; +import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; -import com.segment.publicapi.models.UpdateAudienceForSpaceInput; +import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; @@ -480,6 +482,8 @@ public okhttp3.Call getAudienceAsync( * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param search Optional search criteria This parameter exists in alpha. (optional) + * @param sort Optional sort criteria This parameter exists in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -493,7 +497,12 @@ public okhttp3.Call getAudienceAsync( * */ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceCall( - String spaceId, String id, PaginationInput pagination, final ApiCallback _callback) + String spaceId, + String id, + PaginationInput pagination, + ListAudienceConsumersSearchInput search, + ListAudienceConsumersSortInput sort, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -528,6 +537,14 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + final String[] localVarAccepts = { "application/vnd.segment.v1alpha+json", "application/json" }; @@ -560,7 +577,12 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall( - String spaceId, String id, PaginationInput pagination, final ApiCallback _callback) + String spaceId, + String id, + PaginationInput pagination, + ListAudienceConsumersSearchInput search, + ListAudienceConsumersSortInput sort, + final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -576,7 +598,8 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall + " listAudienceConsumersFromSpaceAndAudience(Async)"); } - return listAudienceConsumersFromSpaceAndAudienceCall(spaceId, id, pagination, _callback); + return listAudienceConsumersFromSpaceAndAudienceCall( + spaceId, id, pagination, search, sort, _callback); } /** @@ -594,6 +617,8 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param search Optional search criteria This parameter exists in alpha. (optional) + * @param sort Optional sort criteria This parameter exists in alpha. (optional) * @return ListAudienceConsumersFromSpaceAndAudience200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -608,9 +633,15 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall */ public ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience( - String spaceId, String id, PaginationInput pagination) throws ApiException { + String spaceId, + String id, + PaginationInput pagination, + ListAudienceConsumersSearchInput search, + ListAudienceConsumersSortInput sort) + throws ApiException { ApiResponse localVarResp = - listAudienceConsumersFromSpaceAndAudienceWithHttpInfo(spaceId, id, pagination); + listAudienceConsumersFromSpaceAndAudienceWithHttpInfo( + spaceId, id, pagination, search, sort); return localVarResp.getData(); } @@ -629,6 +660,8 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param search Optional search criteria This parameter exists in alpha. (optional) + * @param sort Optional sort criteria This parameter exists in alpha. (optional) * @return ApiResponse<ListAudienceConsumersFromSpaceAndAudience200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -643,10 +676,15 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall */ public ApiResponse listAudienceConsumersFromSpaceAndAudienceWithHttpInfo( - String spaceId, String id, PaginationInput pagination) throws ApiException { + String spaceId, + String id, + PaginationInput pagination, + ListAudienceConsumersSearchInput search, + ListAudienceConsumersSortInput sort) + throws ApiException { okhttp3.Call localVarCall = listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall( - spaceId, id, pagination, null); + spaceId, id, pagination, search, sort, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -668,6 +706,8 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param search Optional search criteria This parameter exists in alpha. (optional) + * @param sort Optional sort criteria This parameter exists in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -685,12 +725,14 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( String spaceId, String id, PaginationInput pagination, + ListAudienceConsumersSearchInput search, + ListAudienceConsumersSortInput sort, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall( - spaceId, id, pagination, _callback); + spaceId, id, pagination, search, sort, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); @@ -1108,7 +1150,7 @@ public okhttp3.Call removeAudienceFromSpaceAsync( * * @param spaceId (required) * @param id (required) - * @param updateAudienceForSpaceInput (required) + * @param updateAudienceForSpaceAlphaInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1124,7 +1166,7 @@ public okhttp3.Call removeAudienceFromSpaceAsync( public okhttp3.Call updateAudienceForSpaceCall( String spaceId, String id, - UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -1140,7 +1182,7 @@ public okhttp3.Call updateAudienceForSpaceCall( basePath = null; } - Object localVarPostBody = updateAudienceForSpaceInput; + Object localVarPostBody = updateAudienceForSpaceAlphaInput; // create path and map variables String localVarPath = @@ -1190,7 +1232,7 @@ public okhttp3.Call updateAudienceForSpaceCall( private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( String spaceId, String id, - UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set @@ -1207,14 +1249,14 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( + " updateAudienceForSpace(Async)"); } - // verify the required parameter 'updateAudienceForSpaceInput' is set - if (updateAudienceForSpaceInput == null) { + // verify the required parameter 'updateAudienceForSpaceAlphaInput' is set + if (updateAudienceForSpaceAlphaInput == null) { throw new ApiException( - "Missing the required parameter 'updateAudienceForSpaceInput' when calling" + "Missing the required parameter 'updateAudienceForSpaceAlphaInput' when calling" + " updateAudienceForSpace(Async)"); } - return updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceInput, _callback); + return updateAudienceForSpaceCall(spaceId, id, updateAudienceForSpaceAlphaInput, _callback); } /** @@ -1235,7 +1277,7 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( * * @param spaceId (required) * @param id (required) - * @param updateAudienceForSpaceInput (required) + * @param updateAudienceForSpaceAlphaInput (required) * @return UpdateAudienceForSpace200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1249,10 +1291,12 @@ private okhttp3.Call updateAudienceForSpaceValidateBeforeCall( * */ public UpdateAudienceForSpace200Response updateAudienceForSpace( - String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) + String spaceId, + String id, + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput) throws ApiException { ApiResponse localVarResp = - updateAudienceForSpaceWithHttpInfo(spaceId, id, updateAudienceForSpaceInput); + updateAudienceForSpaceWithHttpInfo(spaceId, id, updateAudienceForSpaceAlphaInput); return localVarResp.getData(); } @@ -1274,7 +1318,7 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( * * @param spaceId (required) * @param id (required) - * @param updateAudienceForSpaceInput (required) + * @param updateAudienceForSpaceAlphaInput (required) * @return ApiResponse<UpdateAudienceForSpace200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1288,11 +1332,13 @@ public UpdateAudienceForSpace200Response updateAudienceForSpace( * */ public ApiResponse updateAudienceForSpaceWithHttpInfo( - String spaceId, String id, UpdateAudienceForSpaceInput updateAudienceForSpaceInput) + String spaceId, + String id, + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput) throws ApiException { okhttp3.Call localVarCall = updateAudienceForSpaceValidateBeforeCall( - spaceId, id, updateAudienceForSpaceInput, null); + spaceId, id, updateAudienceForSpaceAlphaInput, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1315,7 +1361,7 @@ public ApiResponse updateAudienceForSpaceWith * * @param spaceId (required) * @param id (required) - * @param updateAudienceForSpaceInput (required) + * @param updateAudienceForSpaceAlphaInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1332,13 +1378,13 @@ public ApiResponse updateAudienceForSpaceWith public okhttp3.Call updateAudienceForSpaceAsync( String spaceId, String id, - UpdateAudienceForSpaceInput updateAudienceForSpaceInput, + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateAudienceForSpaceValidateBeforeCall( - spaceId, id, updateAudienceForSpaceInput, _callback); + spaceId, id, updateAudienceForSpaceAlphaInput, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/AudienceDefinition.java b/src/main/java/com/segment/publicapi/models/AudienceDefinition.java index d544d73d..575c8342 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceDefinition.java +++ b/src/main/java/com/segment/publicapi/models/AudienceDefinition.java @@ -28,13 +28,8 @@ import java.util.Objects; import java.util.Set; -/** Defines an audience definition. */ +/** AudienceDefinition */ public class AudienceDefinition { - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; - /** * The underlying data type being segmented for this audience. Possible values: users, accounts. */ @@ -88,46 +83,53 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type; + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + public AudienceDefinition() {} - public AudienceDefinition query(String query) { + public AudienceDefinition type(TypeEnum type) { - this.query = query; + this.type = type; return this; } /** - * The query language string defining the audience segmentation criteria. + * The underlying data type being segmented for this audience. Possible values: users, accounts. * - * @return query + * @return type */ @javax.annotation.Nonnull - public String getQuery() { - return query; + public TypeEnum getType() { + return type; } - public void setQuery(String query) { - this.query = query; + public void setType(TypeEnum type) { + this.type = type; } - public AudienceDefinition type(TypeEnum type) { + public AudienceDefinition query(String query) { - this.type = type; + this.query = query; return this; } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * The query language string defining the audience segmentation criteria. For guidance on using + * the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). * - * @return type + * @return query */ @javax.annotation.Nonnull - public TypeEnum getType() { - return type; + public String getQuery() { + return query; } - public void setType(TypeEnum type) { - this.type = type; + public void setQuery(String query) { + this.query = query; } @Override @@ -139,21 +141,21 @@ public boolean equals(Object o) { return false; } AudienceDefinition audienceDefinition = (AudienceDefinition) o; - return Objects.equals(this.query, audienceDefinition.query) - && Objects.equals(this.type, audienceDefinition.type); + return Objects.equals(this.type, audienceDefinition.type) + && Objects.equals(this.query, audienceDefinition.query); } @Override public int hashCode() { - return Objects.hash(query, type); + return Objects.hash(type, query); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AudienceDefinition {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append("}"); return sb.toString(); } @@ -175,13 +177,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("query"); openapiFields.add("type"); + openapiFields.add("query"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("query"); openapiRequiredFields.add("type"); + openapiRequiredFields.add("query"); } /** @@ -224,19 +226,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("query").isJsonPrimitive()) { + if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `query` to be a primitive type in the JSON string" + "Expected the field `type` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("query").toString())); + jsonObj.get("type").toString())); } - if (!jsonObj.get("type").isJsonPrimitive()) { + if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `type` to be a primitive type in the JSON string" + "Expected the field `query` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("type").toString())); + jsonObj.get("query").toString())); } } diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java deleted file mode 100644 index ee56810f..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceOptionsBeta.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceOptionsBeta */ -public class AudienceOptionsBeta { - public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) - private Boolean includeHistoricalData; - - public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) - private Boolean includeAnonymousUsers; - - public AudienceOptionsBeta() {} - - public AudienceOptionsBeta includeHistoricalData(Boolean includeHistoricalData) { - - this.includeHistoricalData = includeHistoricalData; - return this; - } - - /** - * Determines whether data prior to the audience being created is included when determining - * audience membership. Note that including historical data may be needed in order to properly - * handle the definition specified. In these cases, Segment will automatically handle including - * historical data and the response will return the includeHistoricalData parameter as true. - * - * @return includeHistoricalData - */ - @javax.annotation.Nullable - public Boolean getIncludeHistoricalData() { - return includeHistoricalData; - } - - public void setIncludeHistoricalData(Boolean includeHistoricalData) { - this.includeHistoricalData = includeHistoricalData; - } - - public AudienceOptionsBeta includeAnonymousUsers(Boolean includeAnonymousUsers) { - - this.includeAnonymousUsers = includeAnonymousUsers; - return this; - } - - /** - * Determines whether anonymous users should be included when determining audience membership. - * - * @return includeAnonymousUsers - */ - @javax.annotation.Nullable - public Boolean getIncludeAnonymousUsers() { - return includeAnonymousUsers; - } - - public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { - this.includeAnonymousUsers = includeAnonymousUsers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceOptionsBeta audienceOptionsBeta = (AudienceOptionsBeta) o; - return Objects.equals(this.includeHistoricalData, audienceOptionsBeta.includeHistoricalData) - && Objects.equals( - this.includeAnonymousUsers, audienceOptionsBeta.includeAnonymousUsers); - } - - @Override - public int hashCode() { - return Objects.hash(includeHistoricalData, includeAnonymousUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceOptionsBeta {\n"); - sb.append(" includeHistoricalData: ") - .append(toIndentedString(includeHistoricalData)) - .append("\n"); - sb.append(" includeAnonymousUsers: ") - .append(toIndentedString(includeAnonymousUsers)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("includeHistoricalData"); - openapiFields.add("includeAnonymousUsers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceOptionsBeta - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceOptionsBeta.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceOptionsBeta is not found in" - + " the empty JSON string", - AudienceOptionsBeta.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceOptionsBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceOptionsBeta` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceOptionsBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceOptionsBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsBeta.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceOptionsBeta value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceOptionsBeta read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceOptionsBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceOptionsBeta - * @throws IOException if the JSON string is invalid with respect to AudienceOptionsBeta - */ - public static AudienceOptionsBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceOptionsBeta.class); - } - - /** - * Convert an instance of AudienceOptionsBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java deleted file mode 100644 index 179c5b83..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryBeta.java +++ /dev/null @@ -1,637 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Defines an Audience. */ -public class AudienceSummaryBeta { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionBeta definition; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsBeta options; - - public AudienceSummaryBeta() {} - - public AudienceSummaryBeta id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudienceSummaryBeta spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public AudienceSummaryBeta name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public AudienceSummaryBeta description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public AudienceSummaryBeta key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AudienceSummaryBeta enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceSummaryBeta definition(AudienceDefinitionBeta definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nullable - public AudienceDefinitionBeta getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionBeta definition) { - this.definition = definition; - } - - public AudienceSummaryBeta status(String status) { - - this.status = status; - return this; - } - - /** - * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting - * Destinations, Disabled. - * - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public AudienceSummaryBeta createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public AudienceSummaryBeta updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public AudienceSummaryBeta createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public AudienceSummaryBeta updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public AudienceSummaryBeta options(AudienceOptionsBeta options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable - public AudienceOptionsBeta getOptions() { - return options; - } - - public void setOptions(AudienceOptionsBeta options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSummaryBeta audienceSummaryBeta = (AudienceSummaryBeta) o; - return Objects.equals(this.id, audienceSummaryBeta.id) - && Objects.equals(this.spaceId, audienceSummaryBeta.spaceId) - && Objects.equals(this.name, audienceSummaryBeta.name) - && Objects.equals(this.description, audienceSummaryBeta.description) - && Objects.equals(this.key, audienceSummaryBeta.key) - && Objects.equals(this.enabled, audienceSummaryBeta.enabled) - && Objects.equals(this.definition, audienceSummaryBeta.definition) - && Objects.equals(this.status, audienceSummaryBeta.status) - && Objects.equals(this.createdBy, audienceSummaryBeta.createdBy) - && Objects.equals(this.updatedBy, audienceSummaryBeta.updatedBy) - && Objects.equals(this.createdAt, audienceSummaryBeta.createdAt) - && Objects.equals(this.updatedAt, audienceSummaryBeta.updatedAt) - && Objects.equals(this.options, audienceSummaryBeta.options); - } - - @Override - public int hashCode() { - return Objects.hash( - id, - spaceId, - name, - description, - key, - enabled, - definition, - status, - createdBy, - updatedBy, - createdAt, - updatedAt, - options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSummaryBeta {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("definition"); - openapiFields.add("status"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceSummaryBeta - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSummaryBeta.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceSummaryBeta is not found in" - + " the empty JSON string", - AudienceSummaryBeta.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSummaryBeta.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSummaryBeta` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceSummaryBeta.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - // validate the required field `definition` - AudienceDefinitionBeta.validateJsonElement(jsonObj.get("definition")); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - // validate the optional field `options` - if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsBeta.validateJsonElement(jsonObj.get("options")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSummaryBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceSummaryBeta' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceSummaryBeta.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceSummaryBeta value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSummaryBeta read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSummaryBeta given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSummaryBeta - * @throws IOException if the JSON string is invalid with respect to AudienceSummaryBeta - */ - public static AudienceSummaryBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceSummaryBeta.class); - } - - /** - * Convert an instance of AudienceSummaryBeta to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudienceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateAudienceAlphaInput.java index aa425e69..ed7e8906 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudienceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudienceAlphaInput.java @@ -47,7 +47,7 @@ public class CreateAudienceAlphaInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceComputationDefinition definition; + private AudienceDefinition definition; public static final String SERIALIZED_NAME_OPTIONS = "options"; @@ -116,7 +116,7 @@ public void setDescription(String description) { this.description = description; } - public CreateAudienceAlphaInput definition(AudienceComputationDefinition definition) { + public CreateAudienceAlphaInput definition(AudienceDefinition definition) { this.definition = definition; return this; @@ -128,11 +128,11 @@ public CreateAudienceAlphaInput definition(AudienceComputationDefinition definit * @return definition */ @javax.annotation.Nonnull - public AudienceComputationDefinition getDefinition() { + public AudienceDefinition getDefinition() { return definition; } - public void setDefinition(AudienceComputationDefinition definition) { + public void setDefinition(AudienceDefinition definition) { this.definition = definition; } @@ -275,7 +275,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti jsonObj.get("description").toString())); } // validate the required field `definition` - AudienceComputationDefinition.validateJsonElement(jsonObj.get("definition")); + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptions.validateJsonElement(jsonObj.get("options")); diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 0f0a46a1..7ad6f044 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryBeta audience; + private AudienceSummary audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummaryBeta audience) { + public GetAudienceBetaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummaryBeta audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryBeta getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryBeta audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryBeta.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java index 0ed0a16a..66b4bce0 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudience200Response.java @@ -32,12 +32,12 @@ public class ListAudienceConsumersFromSpaceAndAudience200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private ListAudienceConsumersFromSpaceAndAudienceOutput data; + private ListAudienceConsumersFromSpaceAndAudienceAlphaOutput data; public ListAudienceConsumersFromSpaceAndAudience200Response() {} public ListAudienceConsumersFromSpaceAndAudience200Response data( - ListAudienceConsumersFromSpaceAndAudienceOutput data) { + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput data) { this.data = data; return this; @@ -49,11 +49,11 @@ public ListAudienceConsumersFromSpaceAndAudience200Response data( * @return data */ @javax.annotation.Nullable - public ListAudienceConsumersFromSpaceAndAudienceOutput getData() { + public ListAudienceConsumersFromSpaceAndAudienceAlphaOutput getData() { return data; } - public void setData(ListAudienceConsumersFromSpaceAndAudienceOutput data) { + public void setData(ListAudienceConsumersFromSpaceAndAudienceAlphaOutput data) { this.data = data; } @@ -146,7 +146,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ListAudienceConsumersFromSpaceAndAudienceOutput.validateJsonElement( + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.validateJsonElement( jsonObj.get("data")); } } diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.java similarity index 81% rename from src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java rename to src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.java index 08a13bcc..a48ec554 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.java @@ -31,7 +31,7 @@ import java.util.Set; /** List Audience consumers output. */ -public class ListAudienceConsumersFromSpaceAndAudienceOutput { +public class ListAudienceConsumersFromSpaceAndAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) @@ -42,16 +42,16 @@ public class ListAudienceConsumersFromSpaceAndAudienceOutput { @SerializedName(SERIALIZED_NAME_PAGINATION) private PaginationOutput pagination; - public ListAudienceConsumersFromSpaceAndAudienceOutput() {} + public ListAudienceConsumersFromSpaceAndAudienceAlphaOutput() {} - public ListAudienceConsumersFromSpaceAndAudienceOutput audiences( + public ListAudienceConsumersFromSpaceAndAudienceAlphaOutput audiences( List audiences) { this.audiences = audiences; return this; } - public ListAudienceConsumersFromSpaceAndAudienceOutput addAudiencesItem( + public ListAudienceConsumersFromSpaceAndAudienceAlphaOutput addAudiencesItem( AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); @@ -74,7 +74,8 @@ public void setAudiences(List audiences) { this.audiences = audiences; } - public ListAudienceConsumersFromSpaceAndAudienceOutput pagination(PaginationOutput pagination) { + public ListAudienceConsumersFromSpaceAndAudienceAlphaOutput pagination( + PaginationOutput pagination) { this.pagination = pagination; return this; @@ -102,14 +103,15 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ListAudienceConsumersFromSpaceAndAudienceOutput - listAudienceConsumersFromSpaceAndAudienceOutput = - (ListAudienceConsumersFromSpaceAndAudienceOutput) o; + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput + listAudienceConsumersFromSpaceAndAudienceAlphaOutput = + (ListAudienceConsumersFromSpaceAndAudienceAlphaOutput) o; return Objects.equals( - this.audiences, listAudienceConsumersFromSpaceAndAudienceOutput.audiences) + this.audiences, + listAudienceConsumersFromSpaceAndAudienceAlphaOutput.audiences) && Objects.equals( this.pagination, - listAudienceConsumersFromSpaceAndAudienceOutput.pagination); + listAudienceConsumersFromSpaceAndAudienceAlphaOutput.pagination); } @Override @@ -120,7 +122,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ListAudienceConsumersFromSpaceAndAudienceOutput {\n"); + sb.append("class ListAudienceConsumersFromSpaceAndAudienceAlphaOutput {\n"); sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); sb.append("}"); @@ -158,18 +160,18 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * ListAudienceConsumersFromSpaceAndAudienceOutput + * ListAudienceConsumersFromSpaceAndAudienceAlphaOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ListAudienceConsumersFromSpaceAndAudienceOutput.openapiRequiredFields + if (!ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" - + " ListAudienceConsumersFromSpaceAndAudienceOutput is not" - + " found in the empty JSON string", - ListAudienceConsumersFromSpaceAndAudienceOutput + + " ListAudienceConsumersFromSpaceAndAudienceAlphaOutput is not" + + " found in the empty JSON string", + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput .openapiRequiredFields .toString())); } @@ -178,12 +180,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ListAudienceConsumersFromSpaceAndAudienceOutput.openapiFields.contains( + if (!ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.openapiFields.contains( entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ListAudienceConsumersFromSpaceAndAudienceOutput`" + + " `ListAudienceConsumersFromSpaceAndAudienceAlphaOutput`" + " properties. JSON: %s", entry.getKey(), jsonElement.toString())); } @@ -191,7 +193,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // check to make sure all required properties/fields are present in the JSON string for (String requiredField : - ListAudienceConsumersFromSpaceAndAudienceOutput.openapiRequiredFields) { + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -223,31 +225,33 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudienceConsumersFromSpaceAndAudienceOutput.class.isAssignableFrom( + if (!ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( type.getRawType())) { return null; // this class only serializes - // 'ListAudienceConsumersFromSpaceAndAudienceOutput' and its subtypes + // 'ListAudienceConsumersFromSpaceAndAudienceAlphaOutput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( this, - TypeToken.get(ListAudienceConsumersFromSpaceAndAudienceOutput.class)); + TypeToken.get( + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override public void write( JsonWriter out, - ListAudienceConsumersFromSpaceAndAudienceOutput value) + ListAudienceConsumersFromSpaceAndAudienceAlphaOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ListAudienceConsumersFromSpaceAndAudienceOutput read(JsonReader in) - throws IOException { + public ListAudienceConsumersFromSpaceAndAudienceAlphaOutput read( + JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -257,21 +261,22 @@ public ListAudienceConsumersFromSpaceAndAudienceOutput read(JsonReader in) } /** - * Create an instance of ListAudienceConsumersFromSpaceAndAudienceOutput given an JSON string + * Create an instance of ListAudienceConsumersFromSpaceAndAudienceAlphaOutput given an JSON + * string * * @param jsonString JSON string - * @return An instance of ListAudienceConsumersFromSpaceAndAudienceOutput + * @return An instance of ListAudienceConsumersFromSpaceAndAudienceAlphaOutput * @throws IOException if the JSON string is invalid with respect to - * ListAudienceConsumersFromSpaceAndAudienceOutput + * ListAudienceConsumersFromSpaceAndAudienceAlphaOutput */ - public static ListAudienceConsumersFromSpaceAndAudienceOutput fromJson(String jsonString) + public static ListAudienceConsumersFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) throws IOException { return JSON.getGson() - .fromJson(jsonString, ListAudienceConsumersFromSpaceAndAudienceOutput.class); + .fromJson(jsonString, ListAudienceConsumersFromSpaceAndAudienceAlphaOutput.class); } /** - * Convert an instance of ListAudienceConsumersFromSpaceAndAudienceOutput to an JSON string + * Convert an instance of ListAudienceConsumersFromSpaceAndAudienceAlphaOutput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersSearchInput.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java rename to src/main/java/com/segment/publicapi/models/ListAudienceConsumersSearchInput.java index 2631f61c..c230adf7 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceDefinitionBeta.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersSearchInput.java @@ -28,21 +28,14 @@ import java.util.Objects; import java.util.Set; -/** Defines an audience definition. */ -public class AudienceDefinitionBeta { - public static final String SERIALIZED_NAME_QUERY = "query"; - - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; - - /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. - */ +/** Search criteria input for list audience consumers. */ +public class ListAudienceConsumersSearchInput { + /** Field to filter by. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), + DEFINITION("DEFINITION"), - USERS("USERS"); + NAME("NAME"); private String value; @@ -88,46 +81,51 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type; - public AudienceDefinitionBeta() {} + public static final String SERIALIZED_NAME_QUERY = "query"; - public AudienceDefinitionBeta query(String query) { + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; - this.query = query; + public ListAudienceConsumersSearchInput() {} + + public ListAudienceConsumersSearchInput type(TypeEnum type) { + + this.type = type; return this; } /** - * The query language string defining the audience segmentation criteria. + * Field to filter by. * - * @return query + * @return type */ @javax.annotation.Nonnull - public String getQuery() { - return query; + public TypeEnum getType() { + return type; } - public void setQuery(String query) { - this.query = query; + public void setType(TypeEnum type) { + this.type = type; } - public AudienceDefinitionBeta type(TypeEnum type) { + public ListAudienceConsumersSearchInput query(String query) { - this.type = type; + this.query = query; return this; } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * Text to match the field value. * - * @return type + * @return query */ @javax.annotation.Nonnull - public TypeEnum getType() { - return type; + public String getQuery() { + return query; } - public void setType(TypeEnum type) { - this.type = type; + public void setQuery(String query) { + this.query = query; } @Override @@ -138,22 +136,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AudienceDefinitionBeta audienceDefinitionBeta = (AudienceDefinitionBeta) o; - return Objects.equals(this.query, audienceDefinitionBeta.query) - && Objects.equals(this.type, audienceDefinitionBeta.type); + ListAudienceConsumersSearchInput listAudienceConsumersSearchInput = + (ListAudienceConsumersSearchInput) o; + return Objects.equals(this.type, listAudienceConsumersSearchInput.type) + && Objects.equals(this.query, listAudienceConsumersSearchInput.query); } @Override public int hashCode() { - return Objects.hash(query, type); + return Objects.hash(type, query); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AudienceDefinitionBeta {\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("class ListAudienceConsumersSearchInput {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append("}"); return sb.toString(); } @@ -175,47 +174,48 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("query"); openapiFields.add("type"); + openapiFields.add("query"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("query"); openapiRequiredFields.add("type"); + openapiRequiredFields.add("query"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceDefinitionBeta + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceConsumersSearchInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AudienceDefinitionBeta.openapiRequiredFields + if (!ListAudienceConsumersSearchInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AudienceDefinitionBeta is not found in" - + " the empty JSON string", - AudienceDefinitionBeta.openapiRequiredFields.toString())); + "The required field(s) %s in ListAudienceConsumersSearchInput is" + + " not found in the empty JSON string", + ListAudienceConsumersSearchInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AudienceDefinitionBeta.openapiFields.contains(entry.getKey())) { + if (!ListAudienceConsumersSearchInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AudienceDefinitionBeta` properties. JSON: %s", + + " `ListAudienceConsumersSearchInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceDefinitionBeta.openapiRequiredFields) { + for (String requiredField : ListAudienceConsumersSearchInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -224,19 +224,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("query").isJsonPrimitive()) { + if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `query` to be a primitive type in the JSON string" + "Expected the field `type` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("query").toString())); + jsonObj.get("type").toString())); } - if (!jsonObj.get("type").isJsonPrimitive()) { + if (!jsonObj.get("query").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `type` to be a primitive type in the JSON string" + "Expected the field `query` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("type").toString())); + jsonObj.get("query").toString())); } } @@ -244,24 +244,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceDefinitionBeta.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceDefinitionBeta' and its subtypes + if (!ListAudienceConsumersSearchInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudienceConsumersSearchInput' and + // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceDefinitionBeta.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListAudienceConsumersSearchInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AudienceDefinitionBeta value) + public void write(JsonWriter out, ListAudienceConsumersSearchInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AudienceDefinitionBeta read(JsonReader in) throws IOException { + public ListAudienceConsumersSearchInput read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -271,18 +274,19 @@ public AudienceDefinitionBeta read(JsonReader in) throws IOException { } /** - * Create an instance of AudienceDefinitionBeta given an JSON string + * Create an instance of ListAudienceConsumersSearchInput given an JSON string * * @param jsonString JSON string - * @return An instance of AudienceDefinitionBeta - * @throws IOException if the JSON string is invalid with respect to AudienceDefinitionBeta + * @return An instance of ListAudienceConsumersSearchInput + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceConsumersSearchInput */ - public static AudienceDefinitionBeta fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceDefinitionBeta.class); + public static ListAudienceConsumersSearchInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudienceConsumersSearchInput.class); } /** - * Convert an instance of AudienceDefinitionBeta to an JSON string + * Convert an instance of ListAudienceConsumersSearchInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputationDefinition.java b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersSortInput.java similarity index 53% rename from src/main/java/com/segment/publicapi/models/AudienceComputationDefinition.java rename to src/main/java/com/segment/publicapi/models/ListAudienceConsumersSortInput.java index e58a9a0d..e9cfc154 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceComputationDefinition.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceConsumersSortInput.java @@ -28,20 +28,20 @@ import java.util.Objects; import java.util.Set; -/** AudienceComputationDefinition */ -public class AudienceComputationDefinition { - /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), +/** Sort criteria input for list audience consumers. */ +public class ListAudienceConsumersSortInput { + /** Field to sort by. */ + @JsonAdapter(FieldEnum.Adapter.class) + public enum FieldEnum { + CREATED_AT("CREATED_AT"), + + NAME("NAME"), - USERS("USERS"); + UPDATED_AT("UPDATED_AT"); private String value; - TypeEnum(String value) { + FieldEnum(String value) { this.value = value; } @@ -54,8 +54,8 @@ public String toString() { return String.valueOf(value); } - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { + public static FieldEnum fromValue(String value) { + for (FieldEnum b : FieldEnum.values()) { if (b.value.equals(value)) { return b; } @@ -63,73 +63,117 @@ public static TypeEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + public void write(final JsonWriter jsonWriter, final FieldEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { + public FieldEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); + return FieldEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_TYPE = "type"; + public static final String SERIALIZED_NAME_FIELD = "field"; + + @SerializedName(SERIALIZED_NAME_FIELD) + private FieldEnum field; + + /** Sort direction (ascending or descending). */ + @JsonAdapter(DirectionEnum.Adapter.class) + public enum DirectionEnum { + ASC("ASC"), + + DESC("DESC"); + + private String value; + + DirectionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DirectionEnum fromValue(String value) { + for (DirectionEnum b : DirectionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DirectionEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_QUERY = "query"; + @Override + public DirectionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DirectionEnum.fromValue(value); + } + } + } - @SerializedName(SERIALIZED_NAME_QUERY) - private String query; + public static final String SERIALIZED_NAME_DIRECTION = "direction"; - public AudienceComputationDefinition() {} + @SerializedName(SERIALIZED_NAME_DIRECTION) + private DirectionEnum direction; - public AudienceComputationDefinition type(TypeEnum type) { + public ListAudienceConsumersSortInput() {} - this.type = type; + public ListAudienceConsumersSortInput field(FieldEnum field) { + + this.field = field; return this; } /** - * The underlying data type being segmented for this audience. Possible values: users, accounts. + * Field to sort by. * - * @return type + * @return field */ @javax.annotation.Nonnull - public TypeEnum getType() { - return type; + public FieldEnum getField() { + return field; } - public void setType(TypeEnum type) { - this.type = type; + public void setField(FieldEnum field) { + this.field = field; } - public AudienceComputationDefinition query(String query) { + public ListAudienceConsumersSortInput direction(DirectionEnum direction) { - this.query = query; + this.direction = direction; return this; } /** - * The query language string defining the audience segmentation criteria. For guidance on using - * the query language, see the [Segment documentation - * site](https://segment.com/docs/api/public-api/query-language). + * Sort direction (ascending or descending). * - * @return query + * @return direction */ @javax.annotation.Nonnull - public String getQuery() { - return query; + public DirectionEnum getDirection() { + return direction; } - public void setQuery(String query) { - this.query = query; + public void setDirection(DirectionEnum direction) { + this.direction = direction; } @Override @@ -140,23 +184,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AudienceComputationDefinition audienceComputationDefinition = - (AudienceComputationDefinition) o; - return Objects.equals(this.type, audienceComputationDefinition.type) - && Objects.equals(this.query, audienceComputationDefinition.query); + ListAudienceConsumersSortInput listAudienceConsumersSortInput = + (ListAudienceConsumersSortInput) o; + return Objects.equals(this.field, listAudienceConsumersSortInput.field) + && Objects.equals(this.direction, listAudienceConsumersSortInput.direction); } @Override public int hashCode() { - return Objects.hash(type, query); + return Objects.hash(field, direction); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AudienceComputationDefinition {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("class ListAudienceConsumersSortInput {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); sb.append("}"); return sb.toString(); } @@ -178,13 +222,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("query"); + openapiFields.add("field"); + openapiFields.add("direction"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("query"); + openapiRequiredFields.add("field"); + openapiRequiredFields.add("direction"); } /** @@ -192,34 +236,34 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * AudienceComputationDefinition + * ListAudienceConsumersSortInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AudienceComputationDefinition.openapiRequiredFields + if (!ListAudienceConsumersSortInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AudienceComputationDefinition is not" + "The required field(s) %s in ListAudienceConsumersSortInput is not" + " found in the empty JSON string", - AudienceComputationDefinition.openapiRequiredFields.toString())); + ListAudienceConsumersSortInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AudienceComputationDefinition.openapiFields.contains(entry.getKey())) { + if (!ListAudienceConsumersSortInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AudienceComputationDefinition` properties. JSON: %s", + + " `ListAudienceConsumersSortInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceComputationDefinition.openapiRequiredFields) { + for (String requiredField : ListAudienceConsumersSortInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -228,19 +272,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { + if (!jsonObj.get("field").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `type` to be a primitive type in the JSON string" + "Expected the field `field` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("type").toString())); + jsonObj.get("field").toString())); } - if (!jsonObj.get("query").isJsonPrimitive()) { + if (!jsonObj.get("direction").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `query` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("query").toString())); + "Expected the field `direction` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("direction").toString())); } } @@ -248,26 +292,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceComputationDefinition.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceComputationDefinition' and its + if (!ListAudienceConsumersSortInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudienceConsumersSortInput' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(AudienceComputationDefinition.class)); + this, TypeToken.get(ListAudienceConsumersSortInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AudienceComputationDefinition value) + public void write(JsonWriter out, ListAudienceConsumersSortInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AudienceComputationDefinition read(JsonReader in) + public ListAudienceConsumersSortInput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); @@ -278,19 +322,19 @@ public AudienceComputationDefinition read(JsonReader in) } /** - * Create an instance of AudienceComputationDefinition given an JSON string + * Create an instance of ListAudienceConsumersSortInput given an JSON string * * @param jsonString JSON string - * @return An instance of AudienceComputationDefinition + * @return An instance of ListAudienceConsumersSortInput * @throws IOException if the JSON string is invalid with respect to - * AudienceComputationDefinition + * ListAudienceConsumersSortInput */ - public static AudienceComputationDefinition fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceComputationDefinition.class); + public static ListAudienceConsumersSortInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudienceConsumersSortInput.class); } /** - * Convert an instance of AudienceComputationDefinition to an JSON string + * Convert an instance of ListAudienceConsumersSortInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index e8147ed5..0956d915 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,13 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences(List audiences) { + public ListAudiencesBetaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem(AudienceSummaryBeta audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +64,11 @@ public ListAudiencesBetaOutput addAudiencesItem(AudienceSummaryBeta audiencesIte * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryBeta.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaInput.java similarity index 78% rename from src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java rename to src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaInput.java index 94f7892e..e4e822e2 100644 --- a/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceInput.java +++ b/src/main/java/com/segment/publicapi/models/UpdateAudienceForSpaceAlphaInput.java @@ -28,7 +28,7 @@ import java.util.Set; /** Input to update an audience. */ -public class UpdateAudienceForSpaceInput { +public class UpdateAudienceForSpaceAlphaInput { public static final String SERIALIZED_NAME_ENABLED = "enabled"; @SerializedName(SERIALIZED_NAME_ENABLED) @@ -47,11 +47,11 @@ public class UpdateAudienceForSpaceInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceComputationDefinition definition; + private AudienceDefinition definition; - public UpdateAudienceForSpaceInput() {} + public UpdateAudienceForSpaceAlphaInput() {} - public UpdateAudienceForSpaceInput enabled(Boolean enabled) { + public UpdateAudienceForSpaceAlphaInput enabled(Boolean enabled) { this.enabled = enabled; return this; @@ -71,7 +71,7 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public UpdateAudienceForSpaceInput name(String name) { + public UpdateAudienceForSpaceAlphaInput name(String name) { this.name = name; return this; @@ -91,7 +91,7 @@ public void setName(String name) { this.name = name; } - public UpdateAudienceForSpaceInput description(String description) { + public UpdateAudienceForSpaceAlphaInput description(String description) { this.description = description; return this; @@ -111,7 +111,7 @@ public void setDescription(String description) { this.description = description; } - public UpdateAudienceForSpaceInput definition(AudienceComputationDefinition definition) { + public UpdateAudienceForSpaceAlphaInput definition(AudienceDefinition definition) { this.definition = definition; return this; @@ -123,11 +123,11 @@ public UpdateAudienceForSpaceInput definition(AudienceComputationDefinition defi * @return definition */ @javax.annotation.Nullable - public AudienceComputationDefinition getDefinition() { + public AudienceDefinition getDefinition() { return definition; } - public void setDefinition(AudienceComputationDefinition definition) { + public void setDefinition(AudienceDefinition definition) { this.definition = definition; } @@ -139,11 +139,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UpdateAudienceForSpaceInput updateAudienceForSpaceInput = (UpdateAudienceForSpaceInput) o; - return Objects.equals(this.enabled, updateAudienceForSpaceInput.enabled) - && Objects.equals(this.name, updateAudienceForSpaceInput.name) - && Objects.equals(this.description, updateAudienceForSpaceInput.description) - && Objects.equals(this.definition, updateAudienceForSpaceInput.definition); + UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = + (UpdateAudienceForSpaceAlphaInput) o; + return Objects.equals(this.enabled, updateAudienceForSpaceAlphaInput.enabled) + && Objects.equals(this.name, updateAudienceForSpaceAlphaInput.name) + && Objects.equals(this.description, updateAudienceForSpaceAlphaInput.description) + && Objects.equals(this.definition, updateAudienceForSpaceAlphaInput.definition); } @Override @@ -154,7 +155,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UpdateAudienceForSpaceInput {\n"); + sb.append("class UpdateAudienceForSpaceAlphaInput {\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); @@ -194,28 +195,28 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * UpdateAudienceForSpaceInput + * UpdateAudienceForSpaceAlphaInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!UpdateAudienceForSpaceInput.openapiRequiredFields + if (!UpdateAudienceForSpaceAlphaInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in UpdateAudienceForSpaceInput is not" - + " found in the empty JSON string", - UpdateAudienceForSpaceInput.openapiRequiredFields.toString())); + "The required field(s) %s in UpdateAudienceForSpaceAlphaInput is" + + " not found in the empty JSON string", + UpdateAudienceForSpaceAlphaInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!UpdateAudienceForSpaceInput.openapiFields.contains(entry.getKey())) { + if (!UpdateAudienceForSpaceAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `UpdateAudienceForSpaceInput` properties. JSON: %s", + + " `UpdateAudienceForSpaceAlphaInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -238,7 +239,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `definition` if (jsonObj.get("definition") != null && !jsonObj.get("definition").isJsonNull()) { - AudienceComputationDefinition.validateJsonElement(jsonObj.get("definition")); + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); } } @@ -246,25 +247,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!UpdateAudienceForSpaceInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UpdateAudienceForSpaceInput' and its - // subtypes + if (!UpdateAudienceForSpaceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAudienceForSpaceAlphaInput' and + // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(UpdateAudienceForSpaceInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateAudienceForSpaceAlphaInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, UpdateAudienceForSpaceInput value) + public void write(JsonWriter out, UpdateAudienceForSpaceAlphaInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public UpdateAudienceForSpaceInput read(JsonReader in) throws IOException { + public UpdateAudienceForSpaceAlphaInput read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -274,18 +277,19 @@ public UpdateAudienceForSpaceInput read(JsonReader in) throws IOException { } /** - * Create an instance of UpdateAudienceForSpaceInput given an JSON string + * Create an instance of UpdateAudienceForSpaceAlphaInput given an JSON string * * @param jsonString JSON string - * @return An instance of UpdateAudienceForSpaceInput - * @throws IOException if the JSON string is invalid with respect to UpdateAudienceForSpaceInput + * @return An instance of UpdateAudienceForSpaceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateAudienceForSpaceAlphaInput */ - public static UpdateAudienceForSpaceInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceInput.class); + public static UpdateAudienceForSpaceAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAudienceForSpaceAlphaInput.class); } /** - * Convert an instance of UpdateAudienceForSpaceInput to an JSON string + * Convert an instance of UpdateAudienceForSpaceAlphaInput to an JSON string * * @return JSON string */ From a60d4fe6eee79b3b7ed1fb62569326e4401ff6dc Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 21 Apr 2025 21:21:17 +0000 Subject: [PATCH 412/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@1cb4b6e1. From 76575ca36289336db4e5500932e973832d296487 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 22 Apr 2025 17:10:45 +0000 Subject: [PATCH 413/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ea84cd1e. From 0586ab9e18e71eada81afb87249e1cf08d78c736 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 23 Apr 2025 18:58:55 +0000 Subject: [PATCH 414/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5d60dba4. From 9ace6f36cc6dd96b534f16d4efdc492800eff66a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 24 Apr 2025 17:01:28 +0000 Subject: [PATCH 415/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8b6671d1. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ++++++ .../models/AudienceOptionsWithLookback.java | 337 ++++++++ ...nceSummaryWithAudienceTypeAndLookback.java | 780 ++++++++++++++++++ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ++++++ 15 files changed, 1681 insertions(+), 37 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index 2d31c471..fbb1ac29 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.2.0 +Latest API and SDK version: 58.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.2.0 + 58.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.2.0" + implementation "com.segment.publicapi:segment-publicapi:58.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.2.0.jar` +* `target/segment-publicapi-58.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 3a042268..2d2c4b60 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index 51bd6343..a4684c76 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.2.0 + 58.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 5a626474..d632be35 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.2.0 (Java)"); + setUserAgent("Public API SDK 58.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 363ed0b3..fe02ca4a 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.2.0"; + public static final String VERSION = "58.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 3d116090..837be0d2 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,12 +163,20 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceOptionsWithLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -896,6 +904,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesPaginationInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index d42e82d5..3304709a 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,6 +25,7 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; +import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -759,7 +760,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -827,7 +828,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -864,8 +865,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) - throws ApiException { + public ListAudiences200Response listAudiences( + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -898,7 +899,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, PaginationInput pagination) throws ApiException { + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -933,7 +934,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - PaginationInput pagination, + ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java new file mode 100644 index 00000000..331b83cf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java @@ -0,0 +1,260 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceComputeCadence */ +public class AudienceComputeCadence { + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BATCH("BATCH"), + + REALTIME("REALTIME"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceComputeCadence() {} + + public AudienceComputeCadence type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; + return Objects.equals(this.type, audienceComputeCadence.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceComputeCadence {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceComputeCadence.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceComputeCadence is not found in" + + " the empty JSON string", + AudienceComputeCadence.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceComputeCadence` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceComputeCadence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceComputeCadence value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceComputeCadence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceComputeCadence given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceComputeCadence + * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence + */ + public static AudienceComputeCadence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); + } + + /** + * Convert an instance of AudienceComputeCadence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java new file mode 100644 index 00000000..8d3e0565 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java @@ -0,0 +1,337 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceOptionsWithLookback */ +public class AudienceOptionsWithLookback { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) + private Boolean includeAnonymousUsers; + + public AudienceOptionsWithLookback() {} + + public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience membership. Profiles + * will only be considered for audience membership if the profile has at least one external id + * whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days, specified from the date + * the audience was created, that event data will be included from when determining audience + * membership. If unspecified, defer to the value of `includeHistoricalData` to + * determine whether historical data is either entirely included or entirely excluded when + * determining audience membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience being created is included when determining + * audience membership. Note that including historical data may be needed in order to properly + * handle the definition specified. In these cases, Segment will automatically handle including + * historical data and the response will return the includeHistoricalData parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nullable + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { + + this.includeAnonymousUsers = includeAnonymousUsers; + return this; + } + + /** + * Determines whether anonymous users should be included when determining audience membership. + * + * @return includeAnonymousUsers + */ + @javax.annotation.Nullable + public Boolean getIncludeAnonymousUsers() { + return includeAnonymousUsers; + } + + public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { + this.includeAnonymousUsers = includeAnonymousUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; + return Objects.equals( + this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, + audienceOptionsWithLookback.backfillEventDataDays) + && Objects.equals( + this.includeHistoricalData, + audienceOptionsWithLookback.includeHistoricalData) + && Objects.equals( + this.includeAnonymousUsers, + audienceOptionsWithLookback.includeAnonymousUsers); + } + + @Override + public int hashCode() { + return Objects.hash( + filterByExternalIds, + backfillEventDataDays, + includeHistoricalData, + includeAnonymousUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceOptionsWithLookback {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" includeAnonymousUsers: ") + .append(toIndentedString(includeAnonymousUsers)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("includeAnonymousUsers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceOptionsWithLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceOptionsWithLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceOptionsWithLookback is not" + + " found in the empty JSON string", + AudienceOptionsWithLookback.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceOptionsWithLookback` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceOptionsWithLookback' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceOptionsWithLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceOptionsWithLookback read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceOptionsWithLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceOptionsWithLookback + * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback + */ + public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); + } + + /** + * Convert an instance of AudienceOptionsWithLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java new file mode 100644 index 00000000..88b7b297 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -0,0 +1,780 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSummaryWithAudienceTypeAndLookback */ +public class AudienceSummaryWithAudienceTypeAndLookback { + /** Discriminator denoting the audience's product type. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + LINKED("LINKED"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; + + @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) + private AudienceComputeCadence computeCadence; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinition definition; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public AudienceSummaryWithAudienceTypeAndLookback() {} + + public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * Discriminator denoting the audience's product type. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudienceSummaryWithAudienceTypeAndLookback computeCadence( + AudienceComputeCadence computeCadence) { + + this.computeCadence = computeCadence; + return this; + } + + /** + * Get computeCadence + * + * @return computeCadence + */ + @javax.annotation.Nonnull + public AudienceComputeCadence getComputeCadence() { + return computeCadence; + } + + public void setComputeCadence(AudienceComputeCadence computeCadence) { + this.computeCadence = computeCadence; + } + + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + public AudienceSummaryWithAudienceTypeAndLookback id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummaryWithAudienceTypeAndLookback name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummaryWithAudienceTypeAndLookback description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummaryWithAudienceTypeAndLookback key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nullable + public AudienceDefinition getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinition definition) { + this.definition = definition; + } + + public AudienceSummaryWithAudienceTypeAndLookback status(String status) { + + this.status = status; + return this; + } + + /** + * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting + * Destinations, Disabled. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = + (AudienceSummaryWithAudienceTypeAndLookback) o; + return Objects.equals( + this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) + && Objects.equals( + this.computeCadence, + audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) + && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) + && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) + && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) + && Objects.equals( + this.description, audienceSummaryWithAudienceTypeAndLookback.description) + && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) + && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) + && Objects.equals( + this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) + && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) + && Objects.equals( + this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) + && Objects.equals( + this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) + && Objects.equals( + this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) + && Objects.equals( + this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + audienceType, + computeCadence, + options, + id, + spaceId, + name, + description, + key, + enabled, + definition, + status, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceType"); + openapiFields.add("computeCadence"); + openapiFields.add("options"); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("definition"); + openapiFields.add("status"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("computeCadence"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AudienceSummaryWithAudienceTypeAndLookback is not found in" + + " the empty JSON string", + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummaryWithAudienceTypeAndLookback` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `computeCadence` + AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `options` + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + // validate the required field `definition` + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummaryWithAudienceTypeAndLookback + * @throws IOException if the JSON string is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); + } + + /** + * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 298a66a0..10e9179d 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummary audience) { + public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 7ad6f044..0ff36009 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummary audience) { + public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a709f3e..5a8aeb61 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences(List audiences) { + public ListAudiencesAlphaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 0956d915..85d0c6f2 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences(List audiences) { + public ListAudiencesBetaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java new file mode 100644 index 00000000..5a1abf02 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination + * parameters. Every resource that returns a list of items in its `Output` object may + * contain a `PaginationInput` in its `Input` object. Required, though some of + * its fields are optional. + */ +public class ListAudiencesPaginationInput { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public ListAudiencesPaginationInput() {} + + public ListAudiencesPaginationInput cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public ListAudiencesPaginationInput count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesPaginationInput listAudiencesPaginationInput = + (ListAudiencesPaginationInput) o; + return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) + && Objects.equals(this.count, listAudiencesPaginationInput.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesPaginationInput {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudiencesPaginationInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudiencesPaginationInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesPaginationInput is not" + + " found in the empty JSON string", + ListAudiencesPaginationInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesPaginationInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesPaginationInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListAudiencesPaginationInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesPaginationInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesPaginationInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesPaginationInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesPaginationInput + * @throws IOException if the JSON string is invalid with respect to + * ListAudiencesPaginationInput + */ + public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); + } + + /** + * Convert an instance of ListAudiencesPaginationInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From b0fb7f999cac7373b26c5e5d268e0c4e69969e22 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 24 Apr 2025 21:09:09 +0000 Subject: [PATCH 416/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e306cc2a. From 757910b6592fbf50a4dcc51b665e92c128a7286b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 28 Apr 2025 14:10:06 +0000 Subject: [PATCH 417/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@df9248d7. From 245370650aa81d0c1a0995d81436f8726d36b2c1 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 28 Apr 2025 14:59:14 +0000 Subject: [PATCH 418/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@300dd1ad. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 - .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ------ .../models/AudienceOptionsWithLookback.java | 337 -------- ...nceSummaryWithAudienceTypeAndLookback.java | 780 ------------------ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ------ 15 files changed, 37 insertions(+), 1681 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index fbb1ac29..2d31c471 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.3.0 +Latest API and SDK version: 58.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.3.0 + 58.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.3.0" + implementation "com.segment.publicapi:segment-publicapi:58.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.3.0.jar` +* `target/segment-publicapi-58.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 2d2c4b60..3a042268 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index a4684c76..51bd6343 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.3.0 + 58.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d632be35..5a626474 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.3.0 (Java)"); + setUserAgent("Public API SDK 58.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index fe02ca4a..363ed0b3 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.3.0"; + public static final String VERSION = "58.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 837be0d2..3d116090 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,20 +163,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceOptionsWithLookback - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -904,9 +896,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudiencesPaginationInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 3304709a..d42e82d5 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,7 +25,6 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; -import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -760,7 +759,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -828,7 +827,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -865,8 +864,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) + throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -899,7 +898,7 @@ public ListAudiences200Response listAudiences( * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + String spaceId, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -934,7 +933,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - ListAudiencesPaginationInput pagination, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java deleted file mode 100644 index 331b83cf..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceComputeCadence */ -public class AudienceComputeCadence { - /** - * The cadence type on which the audience's membership is computed. If 'BATCH', the - * audience is computed on a periodic basis. If 'REALTIME', the audience is continously - * computed. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - BATCH("BATCH"), - - REALTIME("REALTIME"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public AudienceComputeCadence() {} - - public AudienceComputeCadence type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The cadence type on which the audience's membership is computed. If 'BATCH', the - * audience is computed on a periodic basis. If 'REALTIME', the audience is continously - * computed. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; - return Objects.equals(this.type, audienceComputeCadence.type); - } - - @Override - public int hashCode() { - return Objects.hash(type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceComputeCadence {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceComputeCadence.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceComputeCadence is not found in" - + " the empty JSON string", - AudienceComputeCadence.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceComputeCadence` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceComputeCadence' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceComputeCadence value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceComputeCadence read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceComputeCadence given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceComputeCadence - * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence - */ - public static AudienceComputeCadence fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); - } - - /** - * Convert an instance of AudienceComputeCadence to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java deleted file mode 100644 index 8d3e0565..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceOptionsWithLookback */ -public class AudienceOptionsWithLookback { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) - private Boolean includeHistoricalData; - - public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) - private Boolean includeAnonymousUsers; - - public AudienceOptionsWithLookback() {} - - public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience membership. Profiles - * will only be considered for audience membership if the profile has at least one external id - * whose key matches a value in this set. - * - * @return filterByExternalIds - */ - @javax.annotation.Nonnull - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days, specified from the date - * the audience was created, that event data will be included from when determining audience - * membership. If unspecified, defer to the value of `includeHistoricalData` to - * determine whether historical data is either entirely included or entirely excluded when - * determining audience membership. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { - - this.includeHistoricalData = includeHistoricalData; - return this; - } - - /** - * Determines whether data prior to the audience being created is included when determining - * audience membership. Note that including historical data may be needed in order to properly - * handle the definition specified. In these cases, Segment will automatically handle including - * historical data and the response will return the includeHistoricalData parameter as true. - * - * @return includeHistoricalData - */ - @javax.annotation.Nullable - public Boolean getIncludeHistoricalData() { - return includeHistoricalData; - } - - public void setIncludeHistoricalData(Boolean includeHistoricalData) { - this.includeHistoricalData = includeHistoricalData; - } - - public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { - - this.includeAnonymousUsers = includeAnonymousUsers; - return this; - } - - /** - * Determines whether anonymous users should be included when determining audience membership. - * - * @return includeAnonymousUsers - */ - @javax.annotation.Nullable - public Boolean getIncludeAnonymousUsers() { - return includeAnonymousUsers; - } - - public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { - this.includeAnonymousUsers = includeAnonymousUsers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; - return Objects.equals( - this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) - && Objects.equals( - this.backfillEventDataDays, - audienceOptionsWithLookback.backfillEventDataDays) - && Objects.equals( - this.includeHistoricalData, - audienceOptionsWithLookback.includeHistoricalData) - && Objects.equals( - this.includeAnonymousUsers, - audienceOptionsWithLookback.includeAnonymousUsers); - } - - @Override - public int hashCode() { - return Objects.hash( - filterByExternalIds, - backfillEventDataDays, - includeHistoricalData, - includeAnonymousUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceOptionsWithLookback {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append(" includeHistoricalData: ") - .append(toIndentedString(includeHistoricalData)) - .append("\n"); - sb.append(" includeAnonymousUsers: ") - .append(toIndentedString(includeAnonymousUsers)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("backfillEventDataDays"); - openapiFields.add("includeHistoricalData"); - openapiFields.add("includeAnonymousUsers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filterByExternalIds"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudienceOptionsWithLookback - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceOptionsWithLookback.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceOptionsWithLookback is not" - + " found in the empty JSON string", - AudienceOptionsWithLookback.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceOptionsWithLookback` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("filterByExternalIds") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceOptionsWithLookback' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceOptionsWithLookback value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceOptionsWithLookback read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceOptionsWithLookback given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceOptionsWithLookback - * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback - */ - public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); - } - - /** - * Convert an instance of AudienceOptionsWithLookback to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java deleted file mode 100644 index 88b7b297..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ /dev/null @@ -1,780 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceSummaryWithAudienceTypeAndLookback */ -public class AudienceSummaryWithAudienceTypeAndLookback { - /** Discriminator denoting the audience's product type. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - LINKED("LINKED"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; - - @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) - private AudienceComputeCadence computeCadence; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinition definition; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public AudienceSummaryWithAudienceTypeAndLookback() {} - - public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * Discriminator denoting the audience's product type. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudienceSummaryWithAudienceTypeAndLookback computeCadence( - AudienceComputeCadence computeCadence) { - - this.computeCadence = computeCadence; - return this; - } - - /** - * Get computeCadence - * - * @return computeCadence - */ - @javax.annotation.Nonnull - public AudienceComputeCadence getComputeCadence() { - return computeCadence; - } - - public void setComputeCadence(AudienceComputeCadence computeCadence) { - this.computeCadence = computeCadence; - } - - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable - public AudienceOptionsWithLookback getOptions() { - return options; - } - - public void setOptions(AudienceOptionsWithLookback options) { - this.options = options; - } - - public AudienceSummaryWithAudienceTypeAndLookback id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public AudienceSummaryWithAudienceTypeAndLookback name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public AudienceSummaryWithAudienceTypeAndLookback description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public AudienceSummaryWithAudienceTypeAndLookback key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nullable - public AudienceDefinition getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinition definition) { - this.definition = definition; - } - - public AudienceSummaryWithAudienceTypeAndLookback status(String status) { - - this.status = status; - return this; - } - - /** - * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting - * Destinations, Disabled. - * - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = - (AudienceSummaryWithAudienceTypeAndLookback) o; - return Objects.equals( - this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) - && Objects.equals( - this.computeCadence, - audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) - && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) - && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) - && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) - && Objects.equals( - this.description, audienceSummaryWithAudienceTypeAndLookback.description) - && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) - && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) - && Objects.equals( - this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) - && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) - && Objects.equals( - this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) - && Objects.equals( - this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) - && Objects.equals( - this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) - && Objects.equals( - this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - audienceType, - computeCadence, - options, - id, - spaceId, - name, - description, - key, - enabled, - definition, - status, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audienceType"); - openapiFields.add("computeCadence"); - openapiFields.add("options"); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("definition"); - openapiFields.add("status"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("computeCadence"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudienceSummaryWithAudienceTypeAndLookback - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " AudienceSummaryWithAudienceTypeAndLookback is not found in" - + " the empty JSON string", - AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSummaryWithAudienceTypeAndLookback` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `computeCadence` - AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `options` - if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - // validate the required field `definition` - AudienceDefinition.validateJsonElement(jsonObj.get("definition")); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSummaryWithAudienceTypeAndLookback - * @throws IOException if the JSON string is invalid with respect to - * AudienceSummaryWithAudienceTypeAndLookback - */ - public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); - } - - /** - * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 10e9179d..298a66a0 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryWithAudienceTypeAndLookback audience; + private AudienceSummary audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public GetAudienceAlphaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookbac * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryWithAudienceTypeAndLookback getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 0ff36009..7ad6f044 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryWithAudienceTypeAndLookback audience; + private AudienceSummary audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public GetAudienceBetaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryWithAudienceTypeAndLookback getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a8aeb61..5a709f3e 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,15 +44,13 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences( - List audiences) { + public ListAudiencesAlphaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem( - AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -66,11 +64,11 @@ public ListAudiencesAlphaOutput addAudiencesItem( * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -200,8 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( - jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 85d0c6f2..0956d915 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,15 +44,13 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences( - List audiences) { + public ListAudiencesBetaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem( - AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -66,11 +64,11 @@ public ListAudiencesBetaOutput addAudiencesItem( * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -200,8 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( - jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java deleted file mode 100644 index 5a1abf02..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination - * parameters. Every resource that returns a list of items in its `Output` object may - * contain a `PaginationInput` in its `Input` object. Required, though some of - * its fields are optional. - */ -public class ListAudiencesPaginationInput { - public static final String SERIALIZED_NAME_CURSOR = "cursor"; - - @SerializedName(SERIALIZED_NAME_CURSOR) - private String cursor; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - public ListAudiencesPaginationInput() {} - - public ListAudiencesPaginationInput cursor(String cursor) { - - this.cursor = cursor; - return this; - } - - /** - * The page to request. Acceptable values to use here are in PaginationOutput objects, in the - * `current`, `next`, and `previous` keys. Consumers of the API - * must treat this value as opaque. - * - * @return cursor - */ - @javax.annotation.Nullable - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - public ListAudiencesPaginationInput count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The number of items to retrieve in a page, between 1 and 200. - * - * @return count - */ - @javax.annotation.Nonnull - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudiencesPaginationInput listAudiencesPaginationInput = - (ListAudiencesPaginationInput) o; - return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) - && Objects.equals(this.count, listAudiencesPaginationInput.count); - } - - @Override - public int hashCode() { - return Objects.hash(cursor, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudiencesPaginationInput {\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cursor"); - openapiFields.add("count"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListAudiencesPaginationInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListAudiencesPaginationInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListAudiencesPaginationInput is not" - + " found in the empty JSON string", - ListAudiencesPaginationInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudiencesPaginationInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) - && !jsonObj.get("cursor").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cursor` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("cursor").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListAudiencesPaginationInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListAudiencesPaginationInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListAudiencesPaginationInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudiencesPaginationInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudiencesPaginationInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListAudiencesPaginationInput - * @throws IOException if the JSON string is invalid with respect to - * ListAudiencesPaginationInput - */ - public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); - } - - /** - * Convert an instance of ListAudiencesPaginationInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 2755b1693e431e5270e058543b544d6d3e778b99 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 28 Apr 2025 17:16:23 +0000 Subject: [PATCH 419/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@df2ee4cb. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ++++++ .../models/AudienceOptionsWithLookback.java | 337 ++++++++ ...nceSummaryWithAudienceTypeAndLookback.java | 780 ++++++++++++++++++ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ++++++ 15 files changed, 1681 insertions(+), 37 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index 2d31c471..fbb1ac29 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.2.0 +Latest API and SDK version: 58.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.2.0 + 58.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.2.0" + implementation "com.segment.publicapi:segment-publicapi:58.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.2.0.jar` +* `target/segment-publicapi-58.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 3a042268..2d2c4b60 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index 51bd6343..a4684c76 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.2.0 + 58.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 5a626474..d632be35 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.2.0 (Java)"); + setUserAgent("Public API SDK 58.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 363ed0b3..fe02ca4a 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.2.0"; + public static final String VERSION = "58.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 3d116090..837be0d2 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,12 +163,20 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceOptionsWithLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -896,6 +904,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesPaginationInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index d42e82d5..3304709a 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,6 +25,7 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; +import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -759,7 +760,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -827,7 +828,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -864,8 +865,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) - throws ApiException { + public ListAudiences200Response listAudiences( + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -898,7 +899,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, PaginationInput pagination) throws ApiException { + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -933,7 +934,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - PaginationInput pagination, + ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java new file mode 100644 index 00000000..331b83cf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java @@ -0,0 +1,260 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceComputeCadence */ +public class AudienceComputeCadence { + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BATCH("BATCH"), + + REALTIME("REALTIME"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceComputeCadence() {} + + public AudienceComputeCadence type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; + return Objects.equals(this.type, audienceComputeCadence.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceComputeCadence {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceComputeCadence.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceComputeCadence is not found in" + + " the empty JSON string", + AudienceComputeCadence.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceComputeCadence` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceComputeCadence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceComputeCadence value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceComputeCadence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceComputeCadence given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceComputeCadence + * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence + */ + public static AudienceComputeCadence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); + } + + /** + * Convert an instance of AudienceComputeCadence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java new file mode 100644 index 00000000..8d3e0565 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java @@ -0,0 +1,337 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceOptionsWithLookback */ +public class AudienceOptionsWithLookback { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) + private Boolean includeAnonymousUsers; + + public AudienceOptionsWithLookback() {} + + public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience membership. Profiles + * will only be considered for audience membership if the profile has at least one external id + * whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days, specified from the date + * the audience was created, that event data will be included from when determining audience + * membership. If unspecified, defer to the value of `includeHistoricalData` to + * determine whether historical data is either entirely included or entirely excluded when + * determining audience membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience being created is included when determining + * audience membership. Note that including historical data may be needed in order to properly + * handle the definition specified. In these cases, Segment will automatically handle including + * historical data and the response will return the includeHistoricalData parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nullable + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { + + this.includeAnonymousUsers = includeAnonymousUsers; + return this; + } + + /** + * Determines whether anonymous users should be included when determining audience membership. + * + * @return includeAnonymousUsers + */ + @javax.annotation.Nullable + public Boolean getIncludeAnonymousUsers() { + return includeAnonymousUsers; + } + + public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { + this.includeAnonymousUsers = includeAnonymousUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; + return Objects.equals( + this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, + audienceOptionsWithLookback.backfillEventDataDays) + && Objects.equals( + this.includeHistoricalData, + audienceOptionsWithLookback.includeHistoricalData) + && Objects.equals( + this.includeAnonymousUsers, + audienceOptionsWithLookback.includeAnonymousUsers); + } + + @Override + public int hashCode() { + return Objects.hash( + filterByExternalIds, + backfillEventDataDays, + includeHistoricalData, + includeAnonymousUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceOptionsWithLookback {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" includeAnonymousUsers: ") + .append(toIndentedString(includeAnonymousUsers)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("includeAnonymousUsers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceOptionsWithLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceOptionsWithLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceOptionsWithLookback is not" + + " found in the empty JSON string", + AudienceOptionsWithLookback.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceOptionsWithLookback` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceOptionsWithLookback' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceOptionsWithLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceOptionsWithLookback read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceOptionsWithLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceOptionsWithLookback + * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback + */ + public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); + } + + /** + * Convert an instance of AudienceOptionsWithLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java new file mode 100644 index 00000000..88b7b297 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -0,0 +1,780 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSummaryWithAudienceTypeAndLookback */ +public class AudienceSummaryWithAudienceTypeAndLookback { + /** Discriminator denoting the audience's product type. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + LINKED("LINKED"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; + + @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) + private AudienceComputeCadence computeCadence; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinition definition; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public AudienceSummaryWithAudienceTypeAndLookback() {} + + public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * Discriminator denoting the audience's product type. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudienceSummaryWithAudienceTypeAndLookback computeCadence( + AudienceComputeCadence computeCadence) { + + this.computeCadence = computeCadence; + return this; + } + + /** + * Get computeCadence + * + * @return computeCadence + */ + @javax.annotation.Nonnull + public AudienceComputeCadence getComputeCadence() { + return computeCadence; + } + + public void setComputeCadence(AudienceComputeCadence computeCadence) { + this.computeCadence = computeCadence; + } + + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + public AudienceSummaryWithAudienceTypeAndLookback id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummaryWithAudienceTypeAndLookback name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummaryWithAudienceTypeAndLookback description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummaryWithAudienceTypeAndLookback key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nullable + public AudienceDefinition getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinition definition) { + this.definition = definition; + } + + public AudienceSummaryWithAudienceTypeAndLookback status(String status) { + + this.status = status; + return this; + } + + /** + * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting + * Destinations, Disabled. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = + (AudienceSummaryWithAudienceTypeAndLookback) o; + return Objects.equals( + this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) + && Objects.equals( + this.computeCadence, + audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) + && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) + && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) + && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) + && Objects.equals( + this.description, audienceSummaryWithAudienceTypeAndLookback.description) + && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) + && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) + && Objects.equals( + this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) + && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) + && Objects.equals( + this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) + && Objects.equals( + this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) + && Objects.equals( + this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) + && Objects.equals( + this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + audienceType, + computeCadence, + options, + id, + spaceId, + name, + description, + key, + enabled, + definition, + status, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceType"); + openapiFields.add("computeCadence"); + openapiFields.add("options"); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("definition"); + openapiFields.add("status"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("computeCadence"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AudienceSummaryWithAudienceTypeAndLookback is not found in" + + " the empty JSON string", + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummaryWithAudienceTypeAndLookback` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `computeCadence` + AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `options` + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + // validate the required field `definition` + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummaryWithAudienceTypeAndLookback + * @throws IOException if the JSON string is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); + } + + /** + * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 298a66a0..10e9179d 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummary audience) { + public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 7ad6f044..0ff36009 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummary audience) { + public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a709f3e..5a8aeb61 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences(List audiences) { + public ListAudiencesAlphaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 0956d915..85d0c6f2 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences(List audiences) { + public ListAudiencesBetaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java new file mode 100644 index 00000000..5a1abf02 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination + * parameters. Every resource that returns a list of items in its `Output` object may + * contain a `PaginationInput` in its `Input` object. Required, though some of + * its fields are optional. + */ +public class ListAudiencesPaginationInput { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public ListAudiencesPaginationInput() {} + + public ListAudiencesPaginationInput cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public ListAudiencesPaginationInput count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesPaginationInput listAudiencesPaginationInput = + (ListAudiencesPaginationInput) o; + return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) + && Objects.equals(this.count, listAudiencesPaginationInput.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesPaginationInput {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudiencesPaginationInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudiencesPaginationInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesPaginationInput is not" + + " found in the empty JSON string", + ListAudiencesPaginationInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesPaginationInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesPaginationInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListAudiencesPaginationInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesPaginationInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesPaginationInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesPaginationInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesPaginationInput + * @throws IOException if the JSON string is invalid with respect to + * ListAudiencesPaginationInput + */ + public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); + } + + /** + * Convert an instance of ListAudiencesPaginationInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 3a746ddbe7ecf87adf54e2d83f932d6860610858 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 29 Apr 2025 15:27:13 +0000 Subject: [PATCH 420/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d6d6dd38. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 - .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ------ .../models/AudienceOptionsWithLookback.java | 337 -------- ...nceSummaryWithAudienceTypeAndLookback.java | 780 ------------------ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ------ 15 files changed, 37 insertions(+), 1681 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index fbb1ac29..2d31c471 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.3.0 +Latest API and SDK version: 58.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.3.0 + 58.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.3.0" + implementation "com.segment.publicapi:segment-publicapi:58.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.3.0.jar` +* `target/segment-publicapi-58.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 2d2c4b60..3a042268 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index a4684c76..51bd6343 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.3.0 + 58.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d632be35..5a626474 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.3.0 (Java)"); + setUserAgent("Public API SDK 58.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index fe02ca4a..363ed0b3 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.3.0"; + public static final String VERSION = "58.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 837be0d2..3d116090 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,20 +163,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceOptionsWithLookback - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -904,9 +896,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudiencesPaginationInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 3304709a..d42e82d5 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,7 +25,6 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; -import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -760,7 +759,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -828,7 +827,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -865,8 +864,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) + throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -899,7 +898,7 @@ public ListAudiences200Response listAudiences( * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + String spaceId, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -934,7 +933,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - ListAudiencesPaginationInput pagination, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java deleted file mode 100644 index 331b83cf..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceComputeCadence */ -public class AudienceComputeCadence { - /** - * The cadence type on which the audience's membership is computed. If 'BATCH', the - * audience is computed on a periodic basis. If 'REALTIME', the audience is continously - * computed. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - BATCH("BATCH"), - - REALTIME("REALTIME"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public AudienceComputeCadence() {} - - public AudienceComputeCadence type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The cadence type on which the audience's membership is computed. If 'BATCH', the - * audience is computed on a periodic basis. If 'REALTIME', the audience is continously - * computed. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; - return Objects.equals(this.type, audienceComputeCadence.type); - } - - @Override - public int hashCode() { - return Objects.hash(type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceComputeCadence {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceComputeCadence.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceComputeCadence is not found in" - + " the empty JSON string", - AudienceComputeCadence.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceComputeCadence` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceComputeCadence' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceComputeCadence value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceComputeCadence read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceComputeCadence given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceComputeCadence - * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence - */ - public static AudienceComputeCadence fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); - } - - /** - * Convert an instance of AudienceComputeCadence to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java deleted file mode 100644 index 8d3e0565..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceOptionsWithLookback */ -public class AudienceOptionsWithLookback { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) - private Boolean includeHistoricalData; - - public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) - private Boolean includeAnonymousUsers; - - public AudienceOptionsWithLookback() {} - - public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience membership. Profiles - * will only be considered for audience membership if the profile has at least one external id - * whose key matches a value in this set. - * - * @return filterByExternalIds - */ - @javax.annotation.Nonnull - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days, specified from the date - * the audience was created, that event data will be included from when determining audience - * membership. If unspecified, defer to the value of `includeHistoricalData` to - * determine whether historical data is either entirely included or entirely excluded when - * determining audience membership. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { - - this.includeHistoricalData = includeHistoricalData; - return this; - } - - /** - * Determines whether data prior to the audience being created is included when determining - * audience membership. Note that including historical data may be needed in order to properly - * handle the definition specified. In these cases, Segment will automatically handle including - * historical data and the response will return the includeHistoricalData parameter as true. - * - * @return includeHistoricalData - */ - @javax.annotation.Nullable - public Boolean getIncludeHistoricalData() { - return includeHistoricalData; - } - - public void setIncludeHistoricalData(Boolean includeHistoricalData) { - this.includeHistoricalData = includeHistoricalData; - } - - public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { - - this.includeAnonymousUsers = includeAnonymousUsers; - return this; - } - - /** - * Determines whether anonymous users should be included when determining audience membership. - * - * @return includeAnonymousUsers - */ - @javax.annotation.Nullable - public Boolean getIncludeAnonymousUsers() { - return includeAnonymousUsers; - } - - public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { - this.includeAnonymousUsers = includeAnonymousUsers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; - return Objects.equals( - this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) - && Objects.equals( - this.backfillEventDataDays, - audienceOptionsWithLookback.backfillEventDataDays) - && Objects.equals( - this.includeHistoricalData, - audienceOptionsWithLookback.includeHistoricalData) - && Objects.equals( - this.includeAnonymousUsers, - audienceOptionsWithLookback.includeAnonymousUsers); - } - - @Override - public int hashCode() { - return Objects.hash( - filterByExternalIds, - backfillEventDataDays, - includeHistoricalData, - includeAnonymousUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceOptionsWithLookback {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append(" includeHistoricalData: ") - .append(toIndentedString(includeHistoricalData)) - .append("\n"); - sb.append(" includeAnonymousUsers: ") - .append(toIndentedString(includeAnonymousUsers)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("backfillEventDataDays"); - openapiFields.add("includeHistoricalData"); - openapiFields.add("includeAnonymousUsers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filterByExternalIds"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudienceOptionsWithLookback - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceOptionsWithLookback.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceOptionsWithLookback is not" - + " found in the empty JSON string", - AudienceOptionsWithLookback.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceOptionsWithLookback` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("filterByExternalIds") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceOptionsWithLookback' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceOptionsWithLookback value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceOptionsWithLookback read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceOptionsWithLookback given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceOptionsWithLookback - * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback - */ - public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); - } - - /** - * Convert an instance of AudienceOptionsWithLookback to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java deleted file mode 100644 index 88b7b297..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ /dev/null @@ -1,780 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceSummaryWithAudienceTypeAndLookback */ -public class AudienceSummaryWithAudienceTypeAndLookback { - /** Discriminator denoting the audience's product type. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - LINKED("LINKED"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; - - @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) - private AudienceComputeCadence computeCadence; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinition definition; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public AudienceSummaryWithAudienceTypeAndLookback() {} - - public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * Discriminator denoting the audience's product type. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudienceSummaryWithAudienceTypeAndLookback computeCadence( - AudienceComputeCadence computeCadence) { - - this.computeCadence = computeCadence; - return this; - } - - /** - * Get computeCadence - * - * @return computeCadence - */ - @javax.annotation.Nonnull - public AudienceComputeCadence getComputeCadence() { - return computeCadence; - } - - public void setComputeCadence(AudienceComputeCadence computeCadence) { - this.computeCadence = computeCadence; - } - - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable - public AudienceOptionsWithLookback getOptions() { - return options; - } - - public void setOptions(AudienceOptionsWithLookback options) { - this.options = options; - } - - public AudienceSummaryWithAudienceTypeAndLookback id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public AudienceSummaryWithAudienceTypeAndLookback name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public AudienceSummaryWithAudienceTypeAndLookback description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public AudienceSummaryWithAudienceTypeAndLookback key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nullable - public AudienceDefinition getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinition definition) { - this.definition = definition; - } - - public AudienceSummaryWithAudienceTypeAndLookback status(String status) { - - this.status = status; - return this; - } - - /** - * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting - * Destinations, Disabled. - * - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = - (AudienceSummaryWithAudienceTypeAndLookback) o; - return Objects.equals( - this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) - && Objects.equals( - this.computeCadence, - audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) - && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) - && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) - && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) - && Objects.equals( - this.description, audienceSummaryWithAudienceTypeAndLookback.description) - && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) - && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) - && Objects.equals( - this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) - && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) - && Objects.equals( - this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) - && Objects.equals( - this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) - && Objects.equals( - this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) - && Objects.equals( - this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - audienceType, - computeCadence, - options, - id, - spaceId, - name, - description, - key, - enabled, - definition, - status, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audienceType"); - openapiFields.add("computeCadence"); - openapiFields.add("options"); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("definition"); - openapiFields.add("status"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("computeCadence"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudienceSummaryWithAudienceTypeAndLookback - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " AudienceSummaryWithAudienceTypeAndLookback is not found in" - + " the empty JSON string", - AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSummaryWithAudienceTypeAndLookback` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `computeCadence` - AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `options` - if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - // validate the required field `definition` - AudienceDefinition.validateJsonElement(jsonObj.get("definition")); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSummaryWithAudienceTypeAndLookback - * @throws IOException if the JSON string is invalid with respect to - * AudienceSummaryWithAudienceTypeAndLookback - */ - public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); - } - - /** - * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 10e9179d..298a66a0 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryWithAudienceTypeAndLookback audience; + private AudienceSummary audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public GetAudienceAlphaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookbac * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryWithAudienceTypeAndLookback getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 0ff36009..7ad6f044 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryWithAudienceTypeAndLookback audience; + private AudienceSummary audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public GetAudienceBetaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryWithAudienceTypeAndLookback getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a8aeb61..5a709f3e 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,15 +44,13 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences( - List audiences) { + public ListAudiencesAlphaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem( - AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -66,11 +64,11 @@ public ListAudiencesAlphaOutput addAudiencesItem( * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -200,8 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( - jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 85d0c6f2..0956d915 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,15 +44,13 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences( - List audiences) { + public ListAudiencesBetaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem( - AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -66,11 +64,11 @@ public ListAudiencesBetaOutput addAudiencesItem( * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -200,8 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( - jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java deleted file mode 100644 index 5a1abf02..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination - * parameters. Every resource that returns a list of items in its `Output` object may - * contain a `PaginationInput` in its `Input` object. Required, though some of - * its fields are optional. - */ -public class ListAudiencesPaginationInput { - public static final String SERIALIZED_NAME_CURSOR = "cursor"; - - @SerializedName(SERIALIZED_NAME_CURSOR) - private String cursor; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - public ListAudiencesPaginationInput() {} - - public ListAudiencesPaginationInput cursor(String cursor) { - - this.cursor = cursor; - return this; - } - - /** - * The page to request. Acceptable values to use here are in PaginationOutput objects, in the - * `current`, `next`, and `previous` keys. Consumers of the API - * must treat this value as opaque. - * - * @return cursor - */ - @javax.annotation.Nullable - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - public ListAudiencesPaginationInput count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The number of items to retrieve in a page, between 1 and 200. - * - * @return count - */ - @javax.annotation.Nonnull - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudiencesPaginationInput listAudiencesPaginationInput = - (ListAudiencesPaginationInput) o; - return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) - && Objects.equals(this.count, listAudiencesPaginationInput.count); - } - - @Override - public int hashCode() { - return Objects.hash(cursor, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudiencesPaginationInput {\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cursor"); - openapiFields.add("count"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListAudiencesPaginationInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListAudiencesPaginationInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListAudiencesPaginationInput is not" - + " found in the empty JSON string", - ListAudiencesPaginationInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudiencesPaginationInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) - && !jsonObj.get("cursor").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cursor` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("cursor").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListAudiencesPaginationInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListAudiencesPaginationInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListAudiencesPaginationInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudiencesPaginationInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudiencesPaginationInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListAudiencesPaginationInput - * @throws IOException if the JSON string is invalid with respect to - * ListAudiencesPaginationInput - */ - public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); - } - - /** - * Convert an instance of ListAudiencesPaginationInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From d654cf4a013a104b00a00ea9b35b8d2d279c7c2e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 29 Apr 2025 19:35:28 +0000 Subject: [PATCH 421/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ec447283. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ++++++ .../models/AudienceOptionsWithLookback.java | 337 ++++++++ ...nceSummaryWithAudienceTypeAndLookback.java | 780 ++++++++++++++++++ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ++++++ 15 files changed, 1681 insertions(+), 37 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index 2d31c471..fbb1ac29 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.2.0 +Latest API and SDK version: 58.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.2.0 + 58.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.2.0" + implementation "com.segment.publicapi:segment-publicapi:58.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.2.0.jar` +* `target/segment-publicapi-58.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 3a042268..2d2c4b60 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index 51bd6343..a4684c76 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.2.0 + 58.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 5a626474..d632be35 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.2.0 (Java)"); + setUserAgent("Public API SDK 58.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 363ed0b3..fe02ca4a 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.2.0"; + public static final String VERSION = "58.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 3d116090..837be0d2 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,12 +163,20 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceOptionsWithLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -896,6 +904,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesPaginationInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index d42e82d5..3304709a 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,6 +25,7 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; +import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -759,7 +760,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -827,7 +828,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -864,8 +865,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) - throws ApiException { + public ListAudiences200Response listAudiences( + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -898,7 +899,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, PaginationInput pagination) throws ApiException { + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -933,7 +934,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - PaginationInput pagination, + ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java new file mode 100644 index 00000000..331b83cf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java @@ -0,0 +1,260 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceComputeCadence */ +public class AudienceComputeCadence { + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BATCH("BATCH"), + + REALTIME("REALTIME"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceComputeCadence() {} + + public AudienceComputeCadence type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; + return Objects.equals(this.type, audienceComputeCadence.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceComputeCadence {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceComputeCadence.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceComputeCadence is not found in" + + " the empty JSON string", + AudienceComputeCadence.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceComputeCadence` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceComputeCadence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceComputeCadence value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceComputeCadence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceComputeCadence given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceComputeCadence + * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence + */ + public static AudienceComputeCadence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); + } + + /** + * Convert an instance of AudienceComputeCadence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java new file mode 100644 index 00000000..8d3e0565 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java @@ -0,0 +1,337 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceOptionsWithLookback */ +public class AudienceOptionsWithLookback { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) + private Boolean includeAnonymousUsers; + + public AudienceOptionsWithLookback() {} + + public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience membership. Profiles + * will only be considered for audience membership if the profile has at least one external id + * whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days, specified from the date + * the audience was created, that event data will be included from when determining audience + * membership. If unspecified, defer to the value of `includeHistoricalData` to + * determine whether historical data is either entirely included or entirely excluded when + * determining audience membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience being created is included when determining + * audience membership. Note that including historical data may be needed in order to properly + * handle the definition specified. In these cases, Segment will automatically handle including + * historical data and the response will return the includeHistoricalData parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nullable + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { + + this.includeAnonymousUsers = includeAnonymousUsers; + return this; + } + + /** + * Determines whether anonymous users should be included when determining audience membership. + * + * @return includeAnonymousUsers + */ + @javax.annotation.Nullable + public Boolean getIncludeAnonymousUsers() { + return includeAnonymousUsers; + } + + public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { + this.includeAnonymousUsers = includeAnonymousUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; + return Objects.equals( + this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, + audienceOptionsWithLookback.backfillEventDataDays) + && Objects.equals( + this.includeHistoricalData, + audienceOptionsWithLookback.includeHistoricalData) + && Objects.equals( + this.includeAnonymousUsers, + audienceOptionsWithLookback.includeAnonymousUsers); + } + + @Override + public int hashCode() { + return Objects.hash( + filterByExternalIds, + backfillEventDataDays, + includeHistoricalData, + includeAnonymousUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceOptionsWithLookback {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" includeAnonymousUsers: ") + .append(toIndentedString(includeAnonymousUsers)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("includeAnonymousUsers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceOptionsWithLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceOptionsWithLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceOptionsWithLookback is not" + + " found in the empty JSON string", + AudienceOptionsWithLookback.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceOptionsWithLookback` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceOptionsWithLookback' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceOptionsWithLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceOptionsWithLookback read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceOptionsWithLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceOptionsWithLookback + * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback + */ + public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); + } + + /** + * Convert an instance of AudienceOptionsWithLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java new file mode 100644 index 00000000..88b7b297 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -0,0 +1,780 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSummaryWithAudienceTypeAndLookback */ +public class AudienceSummaryWithAudienceTypeAndLookback { + /** Discriminator denoting the audience's product type. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + LINKED("LINKED"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; + + @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) + private AudienceComputeCadence computeCadence; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinition definition; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public AudienceSummaryWithAudienceTypeAndLookback() {} + + public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * Discriminator denoting the audience's product type. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudienceSummaryWithAudienceTypeAndLookback computeCadence( + AudienceComputeCadence computeCadence) { + + this.computeCadence = computeCadence; + return this; + } + + /** + * Get computeCadence + * + * @return computeCadence + */ + @javax.annotation.Nonnull + public AudienceComputeCadence getComputeCadence() { + return computeCadence; + } + + public void setComputeCadence(AudienceComputeCadence computeCadence) { + this.computeCadence = computeCadence; + } + + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + public AudienceSummaryWithAudienceTypeAndLookback id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummaryWithAudienceTypeAndLookback name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummaryWithAudienceTypeAndLookback description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummaryWithAudienceTypeAndLookback key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nullable + public AudienceDefinition getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinition definition) { + this.definition = definition; + } + + public AudienceSummaryWithAudienceTypeAndLookback status(String status) { + + this.status = status; + return this; + } + + /** + * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting + * Destinations, Disabled. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = + (AudienceSummaryWithAudienceTypeAndLookback) o; + return Objects.equals( + this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) + && Objects.equals( + this.computeCadence, + audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) + && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) + && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) + && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) + && Objects.equals( + this.description, audienceSummaryWithAudienceTypeAndLookback.description) + && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) + && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) + && Objects.equals( + this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) + && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) + && Objects.equals( + this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) + && Objects.equals( + this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) + && Objects.equals( + this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) + && Objects.equals( + this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + audienceType, + computeCadence, + options, + id, + spaceId, + name, + description, + key, + enabled, + definition, + status, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceType"); + openapiFields.add("computeCadence"); + openapiFields.add("options"); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("definition"); + openapiFields.add("status"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("computeCadence"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AudienceSummaryWithAudienceTypeAndLookback is not found in" + + " the empty JSON string", + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummaryWithAudienceTypeAndLookback` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `computeCadence` + AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `options` + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + // validate the required field `definition` + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummaryWithAudienceTypeAndLookback + * @throws IOException if the JSON string is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); + } + + /** + * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 298a66a0..10e9179d 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummary audience) { + public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 7ad6f044..0ff36009 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummary audience) { + public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a709f3e..5a8aeb61 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences(List audiences) { + public ListAudiencesAlphaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 0956d915..85d0c6f2 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences(List audiences) { + public ListAudiencesBetaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java new file mode 100644 index 00000000..5a1abf02 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination + * parameters. Every resource that returns a list of items in its `Output` object may + * contain a `PaginationInput` in its `Input` object. Required, though some of + * its fields are optional. + */ +public class ListAudiencesPaginationInput { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public ListAudiencesPaginationInput() {} + + public ListAudiencesPaginationInput cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public ListAudiencesPaginationInput count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesPaginationInput listAudiencesPaginationInput = + (ListAudiencesPaginationInput) o; + return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) + && Objects.equals(this.count, listAudiencesPaginationInput.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesPaginationInput {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudiencesPaginationInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudiencesPaginationInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesPaginationInput is not" + + " found in the empty JSON string", + ListAudiencesPaginationInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesPaginationInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesPaginationInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListAudiencesPaginationInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesPaginationInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesPaginationInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesPaginationInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesPaginationInput + * @throws IOException if the JSON string is invalid with respect to + * ListAudiencesPaginationInput + */ + public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); + } + + /** + * Convert an instance of ListAudiencesPaginationInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From a7cbe7ca031aaa4ae8539b1be3bd0997be1413f8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 1 May 2025 20:37:49 +0000 Subject: [PATCH 422/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@39a662fa. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 - .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ------ .../models/AudienceOptionsWithLookback.java | 337 -------- ...nceSummaryWithAudienceTypeAndLookback.java | 780 ------------------ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ------ 15 files changed, 37 insertions(+), 1681 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index fbb1ac29..2d31c471 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.3.0 +Latest API and SDK version: 58.2.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.3.0 + 58.2.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.3.0" + implementation "com.segment.publicapi:segment-publicapi:58.2.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.3.0.jar` +* `target/segment-publicapi-58.2.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 2d2c4b60..3a042268 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index a4684c76..51bd6343 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.3.0 + 58.2.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d632be35..5a626474 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.3.0 (Java)"); + setUserAgent("Public API SDK 58.2.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index fe02ca4a..363ed0b3 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.3.0"; + public static final String VERSION = "58.2.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 837be0d2..3d116090 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,20 +163,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceOptionsWithLookback - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -904,9 +896,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudiencesPaginationInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 3304709a..d42e82d5 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,7 +25,6 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; -import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -760,7 +759,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -828,7 +827,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, PaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -865,8 +864,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) + throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -899,7 +898,7 @@ public ListAudiences200Response listAudiences( * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + String spaceId, PaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -934,7 +933,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - ListAudiencesPaginationInput pagination, + PaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java deleted file mode 100644 index 331b83cf..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceComputeCadence */ -public class AudienceComputeCadence { - /** - * The cadence type on which the audience's membership is computed. If 'BATCH', the - * audience is computed on a periodic basis. If 'REALTIME', the audience is continously - * computed. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - BATCH("BATCH"), - - REALTIME("REALTIME"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public AudienceComputeCadence() {} - - public AudienceComputeCadence type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The cadence type on which the audience's membership is computed. If 'BATCH', the - * audience is computed on a periodic basis. If 'REALTIME', the audience is continously - * computed. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; - return Objects.equals(this.type, audienceComputeCadence.type); - } - - @Override - public int hashCode() { - return Objects.hash(type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceComputeCadence {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceComputeCadence.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceComputeCadence is not found in" - + " the empty JSON string", - AudienceComputeCadence.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceComputeCadence` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceComputeCadence' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceComputeCadence value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceComputeCadence read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceComputeCadence given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceComputeCadence - * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence - */ - public static AudienceComputeCadence fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); - } - - /** - * Convert an instance of AudienceComputeCadence to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java deleted file mode 100644 index 8d3e0565..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceOptionsWithLookback */ -public class AudienceOptionsWithLookback { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) - private Boolean includeHistoricalData; - - public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) - private Boolean includeAnonymousUsers; - - public AudienceOptionsWithLookback() {} - - public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience membership. Profiles - * will only be considered for audience membership if the profile has at least one external id - * whose key matches a value in this set. - * - * @return filterByExternalIds - */ - @javax.annotation.Nonnull - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days, specified from the date - * the audience was created, that event data will be included from when determining audience - * membership. If unspecified, defer to the value of `includeHistoricalData` to - * determine whether historical data is either entirely included or entirely excluded when - * determining audience membership. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { - - this.includeHistoricalData = includeHistoricalData; - return this; - } - - /** - * Determines whether data prior to the audience being created is included when determining - * audience membership. Note that including historical data may be needed in order to properly - * handle the definition specified. In these cases, Segment will automatically handle including - * historical data and the response will return the includeHistoricalData parameter as true. - * - * @return includeHistoricalData - */ - @javax.annotation.Nullable - public Boolean getIncludeHistoricalData() { - return includeHistoricalData; - } - - public void setIncludeHistoricalData(Boolean includeHistoricalData) { - this.includeHistoricalData = includeHistoricalData; - } - - public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { - - this.includeAnonymousUsers = includeAnonymousUsers; - return this; - } - - /** - * Determines whether anonymous users should be included when determining audience membership. - * - * @return includeAnonymousUsers - */ - @javax.annotation.Nullable - public Boolean getIncludeAnonymousUsers() { - return includeAnonymousUsers; - } - - public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { - this.includeAnonymousUsers = includeAnonymousUsers; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; - return Objects.equals( - this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) - && Objects.equals( - this.backfillEventDataDays, - audienceOptionsWithLookback.backfillEventDataDays) - && Objects.equals( - this.includeHistoricalData, - audienceOptionsWithLookback.includeHistoricalData) - && Objects.equals( - this.includeAnonymousUsers, - audienceOptionsWithLookback.includeAnonymousUsers); - } - - @Override - public int hashCode() { - return Objects.hash( - filterByExternalIds, - backfillEventDataDays, - includeHistoricalData, - includeAnonymousUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceOptionsWithLookback {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append(" includeHistoricalData: ") - .append(toIndentedString(includeHistoricalData)) - .append("\n"); - sb.append(" includeAnonymousUsers: ") - .append(toIndentedString(includeAnonymousUsers)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("backfillEventDataDays"); - openapiFields.add("includeHistoricalData"); - openapiFields.add("includeAnonymousUsers"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filterByExternalIds"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudienceOptionsWithLookback - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceOptionsWithLookback.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceOptionsWithLookback is not" - + " found in the empty JSON string", - AudienceOptionsWithLookback.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceOptionsWithLookback` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("filterByExternalIds") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceOptionsWithLookback' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceOptionsWithLookback value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceOptionsWithLookback read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceOptionsWithLookback given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceOptionsWithLookback - * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback - */ - public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); - } - - /** - * Convert an instance of AudienceOptionsWithLookback to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java deleted file mode 100644 index 88b7b297..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ /dev/null @@ -1,780 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceSummaryWithAudienceTypeAndLookback */ -public class AudienceSummaryWithAudienceTypeAndLookback { - /** Discriminator denoting the audience's product type. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - LINKED("LINKED"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; - - @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) - private AudienceComputeCadence computeCadence; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; - - @SerializedName(SERIALIZED_NAME_SPACE_ID) - private String spaceId; - - public static final String SERIALIZED_NAME_NAME = "name"; - - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_KEY = "key"; - - @SerializedName(SERIALIZED_NAME_KEY) - private String key; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinition definition; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; - - @SerializedName(SERIALIZED_NAME_CREATED_BY) - private String createdBy; - - public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; - - @SerializedName(SERIALIZED_NAME_UPDATED_BY) - private String updatedBy; - - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public AudienceSummaryWithAudienceTypeAndLookback() {} - - public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * Discriminator denoting the audience's product type. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudienceSummaryWithAudienceTypeAndLookback computeCadence( - AudienceComputeCadence computeCadence) { - - this.computeCadence = computeCadence; - return this; - } - - /** - * Get computeCadence - * - * @return computeCadence - */ - @javax.annotation.Nonnull - public AudienceComputeCadence getComputeCadence() { - return computeCadence; - } - - public void setComputeCadence(AudienceComputeCadence computeCadence) { - this.computeCadence = computeCadence; - } - - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nullable - public AudienceOptionsWithLookback getOptions() { - return options; - } - - public void setOptions(AudienceOptionsWithLookback options) { - this.options = options; - } - - public AudienceSummaryWithAudienceTypeAndLookback id(String id) { - - this.id = id; - return this; - } - - /** - * Audience id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { - - this.spaceId = spaceId; - return this; - } - - /** - * Space id for the audience. - * - * @return spaceId - */ - @javax.annotation.Nonnull - public String getSpaceId() { - return spaceId; - } - - public void setSpaceId(String spaceId) { - this.spaceId = spaceId; - } - - public AudienceSummaryWithAudienceTypeAndLookback name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the audience. - * - * @return name - */ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public AudienceSummaryWithAudienceTypeAndLookback description(String description) { - - this.description = description; - return this; - } - - /** - * Description of the audience. - * - * @return description - */ - @javax.annotation.Nullable - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public AudienceSummaryWithAudienceTypeAndLookback key(String key) { - - this.key = key; - return this; - } - - /** - * Key for the audience. - * - * @return key - */ - @javax.annotation.Nonnull - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Enabled/disabled status for the audience. - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nullable - public AudienceDefinition getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinition definition) { - this.definition = definition; - } - - public AudienceSummaryWithAudienceTypeAndLookback status(String status) { - - this.status = status; - return this; - } - - /** - * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting - * Destinations, Disabled. - * - * @return status - */ - @javax.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { - - this.createdBy = createdBy; - return this; - } - - /** - * User id who created the audience. - * - * @return createdBy - */ - @javax.annotation.Nonnull - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { - - this.updatedBy = updatedBy; - return this; - } - - /** - * User id who last updated the audience. - * - * @return updatedBy - */ - @javax.annotation.Nonnull - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { - - this.createdAt = createdAt; - return this; - } - - /** - * Date the audience was created. - * - * @return createdAt - */ - @javax.annotation.Nonnull - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { - - this.updatedAt = updatedAt; - return this; - } - - /** - * Date the audience was last updated. - * - * @return updatedAt - */ - @javax.annotation.Nonnull - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = - (AudienceSummaryWithAudienceTypeAndLookback) o; - return Objects.equals( - this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) - && Objects.equals( - this.computeCadence, - audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) - && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) - && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) - && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) - && Objects.equals( - this.description, audienceSummaryWithAudienceTypeAndLookback.description) - && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) - && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) - && Objects.equals( - this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) - && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) - && Objects.equals( - this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) - && Objects.equals( - this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) - && Objects.equals( - this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) - && Objects.equals( - this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); - } - - @Override - public int hashCode() { - return Objects.hash( - audienceType, - computeCadence, - options, - id, - spaceId, - name, - description, - key, - enabled, - definition, - status, - createdBy, - updatedBy, - createdAt, - updatedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); - sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audienceType"); - openapiFields.add("computeCadence"); - openapiFields.add("options"); - openapiFields.add("id"); - openapiFields.add("spaceId"); - openapiFields.add("name"); - openapiFields.add("description"); - openapiFields.add("key"); - openapiFields.add("enabled"); - openapiFields.add("definition"); - openapiFields.add("status"); - openapiFields.add("createdBy"); - openapiFields.add("updatedBy"); - openapiFields.add("createdAt"); - openapiFields.add("updatedAt"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("computeCadence"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("spaceId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("key"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("createdBy"); - openapiRequiredFields.add("updatedBy"); - openapiRequiredFields.add("createdAt"); - openapiRequiredFields.add("updatedAt"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudienceSummaryWithAudienceTypeAndLookback - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " AudienceSummaryWithAudienceTypeAndLookback is not found in" - + " the empty JSON string", - AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSummaryWithAudienceTypeAndLookback` properties." - + " JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `computeCadence` - AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `options` - if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("spaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `spaceId` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("spaceId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `name` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("name").toString())); - } - if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) - && !jsonObj.get("description").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `description` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("description").toString())); - } - if (!jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `key` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("key").toString())); - } - // validate the required field `definition` - AudienceDefinition.validateJsonElement(jsonObj.get("definition")); - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("createdBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdBy").toString())); - } - if (!jsonObj.get("updatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedBy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedBy").toString())); - } - if (!jsonObj.get("createdAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `createdAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("createdAt").toString())); - } - if (!jsonObj.get("updatedAt").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `updatedAt` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("updatedAt").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSummaryWithAudienceTypeAndLookback - * @throws IOException if the JSON string is invalid with respect to - * AudienceSummaryWithAudienceTypeAndLookback - */ - public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); - } - - /** - * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 10e9179d..298a66a0 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryWithAudienceTypeAndLookback audience; + private AudienceSummary audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public GetAudienceAlphaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookbac * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryWithAudienceTypeAndLookback getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 0ff36009..7ad6f044 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummaryWithAudienceTypeAndLookback audience; + private AudienceSummary audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public GetAudienceBetaOutput audience(AudienceSummary audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback * @return audience */ @javax.annotation.Nonnull - public AudienceSummaryWithAudienceTypeAndLookback getAudience() { + public AudienceSummary getAudience() { return audience; } - public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { + public void setAudience(AudienceSummary audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); + AudienceSummary.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a8aeb61..5a709f3e 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,15 +44,13 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences( - List audiences) { + public ListAudiencesAlphaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem( - AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -66,11 +64,11 @@ public ListAudiencesAlphaOutput addAudiencesItem( * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -200,8 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( - jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 85d0c6f2..0956d915 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,15 +44,13 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences( - List audiences) { + public ListAudiencesBetaOutput audiences(List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem( - AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -66,11 +64,11 @@ public ListAudiencesBetaOutput addAudiencesItem( * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -200,8 +198,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( - jsonArrayaudiences.get(i)); + AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java deleted file mode 100644 index 5a1abf02..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination - * parameters. Every resource that returns a list of items in its `Output` object may - * contain a `PaginationInput` in its `Input` object. Required, though some of - * its fields are optional. - */ -public class ListAudiencesPaginationInput { - public static final String SERIALIZED_NAME_CURSOR = "cursor"; - - @SerializedName(SERIALIZED_NAME_CURSOR) - private String cursor; - - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - public ListAudiencesPaginationInput() {} - - public ListAudiencesPaginationInput cursor(String cursor) { - - this.cursor = cursor; - return this; - } - - /** - * The page to request. Acceptable values to use here are in PaginationOutput objects, in the - * `current`, `next`, and `previous` keys. Consumers of the API - * must treat this value as opaque. - * - * @return cursor - */ - @javax.annotation.Nullable - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; - } - - public ListAudiencesPaginationInput count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The number of items to retrieve in a page, between 1 and 200. - * - * @return count - */ - @javax.annotation.Nonnull - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudiencesPaginationInput listAudiencesPaginationInput = - (ListAudiencesPaginationInput) o; - return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) - && Objects.equals(this.count, listAudiencesPaginationInput.count); - } - - @Override - public int hashCode() { - return Objects.hash(cursor, count); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudiencesPaginationInput {\n"); - sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("cursor"); - openapiFields.add("count"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListAudiencesPaginationInput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListAudiencesPaginationInput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ListAudiencesPaginationInput is not" - + " found in the empty JSON string", - ListAudiencesPaginationInput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudiencesPaginationInput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) - && !jsonObj.get("cursor").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cursor` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("cursor").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListAudiencesPaginationInput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListAudiencesPaginationInput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ListAudiencesPaginationInput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudiencesPaginationInput read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudiencesPaginationInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of ListAudiencesPaginationInput - * @throws IOException if the JSON string is invalid with respect to - * ListAudiencesPaginationInput - */ - public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); - } - - /** - * Convert an instance of ListAudiencesPaginationInput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From d75275b3a9b06a9f83947684c1054ae8990dacfa Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 5 May 2025 21:17:01 +0000 Subject: [PATCH 423/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f9cd868c. --- README.md | 8 +- docs/AudiencesApi.md | 4 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../segment/publicapi/api/AudiencesApi.java | 13 +- .../models/AudienceComputeCadence.java | 260 ++++++ .../models/AudienceOptionsWithLookback.java | 337 ++++++++ ...nceSummaryWithAudienceTypeAndLookback.java | 780 ++++++++++++++++++ .../models/GetAudienceAlphaOutput.java | 10 +- .../models/GetAudienceBetaOutput.java | 10 +- .../models/ListAudiencesAlphaOutput.java | 15 +- .../models/ListAudiencesBetaOutput.java | 15 +- .../models/ListAudiencesPaginationInput.java | 249 ++++++ 15 files changed, 1681 insertions(+), 37 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java diff --git a/README.md b/README.md index 2d31c471..fbb1ac29 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.2.0 +Latest API and SDK version: 58.3.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.2.0 + 58.3.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.2.0" + implementation "com.segment.publicapi:segment-publicapi:58.3.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.2.0.jar` +* `target/segment-publicapi-58.3.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 3a042268..2d2c4b60 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -273,7 +273,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "spaceId"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); @@ -294,7 +294,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index 51bd6343..a4684c76 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.2.0 + 58.3.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 5a626474..d632be35 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.2.0 (Java)"); + setUserAgent("Public API SDK 58.3.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 363ed0b3..fe02ca4a 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.2.0"; + public static final String VERSION = "58.3.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 3d116090..837be0d2 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -163,12 +163,20 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AllowedLabelBeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceOptionsWithLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSummaryWithAudienceTypeAndLookback + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AuditEventV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -896,6 +904,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiencesBetaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudiencesPaginationInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAuditEvents200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index d42e82d5..3304709a 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -25,6 +25,7 @@ import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; +import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; @@ -759,7 +760,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -827,7 +828,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, PaginationInput pagination, final ApiCallback _callback) + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -864,8 +865,8 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences(String spaceId, PaginationInput pagination) - throws ApiException { + public ListAudiences200Response listAudiences( + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { ApiResponse localVarResp = listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); @@ -898,7 +899,7 @@ public ListAudiences200Response listAudiences(String spaceId, PaginationInput pa * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, PaginationInput pagination) throws ApiException { + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -933,7 +934,7 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, - PaginationInput pagination, + ListAudiencesPaginationInput pagination, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java new file mode 100644 index 00000000..331b83cf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceComputeCadence.java @@ -0,0 +1,260 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceComputeCadence */ +public class AudienceComputeCadence { + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BATCH("BATCH"), + + REALTIME("REALTIME"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceComputeCadence() {} + + public AudienceComputeCadence type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The cadence type on which the audience's membership is computed. If 'BATCH', the + * audience is computed on a periodic basis. If 'REALTIME', the audience is continously + * computed. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceComputeCadence audienceComputeCadence = (AudienceComputeCadence) o; + return Objects.equals(this.type, audienceComputeCadence.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceComputeCadence {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceComputeCadence + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceComputeCadence.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceComputeCadence is not found in" + + " the empty JSON string", + AudienceComputeCadence.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceComputeCadence.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceComputeCadence` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceComputeCadence.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceComputeCadence.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceComputeCadence' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceComputeCadence.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceComputeCadence value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceComputeCadence read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceComputeCadence given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceComputeCadence + * @throws IOException if the JSON string is invalid with respect to AudienceComputeCadence + */ + public static AudienceComputeCadence fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceComputeCadence.class); + } + + /** + * Convert an instance of AudienceComputeCadence to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java new file mode 100644 index 00000000..8d3e0565 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceOptionsWithLookback.java @@ -0,0 +1,337 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceOptionsWithLookback */ +public class AudienceOptionsWithLookback { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS = "includeAnonymousUsers"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_ANONYMOUS_USERS) + private Boolean includeAnonymousUsers; + + public AudienceOptionsWithLookback() {} + + public AudienceOptionsWithLookback filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public AudienceOptionsWithLookback addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience membership. Profiles + * will only be considered for audience membership if the profile has at least one external id + * whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public AudienceOptionsWithLookback backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days, specified from the date + * the audience was created, that event data will be included from when determining audience + * membership. If unspecified, defer to the value of `includeHistoricalData` to + * determine whether historical data is either entirely included or entirely excluded when + * determining audience membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + public AudienceOptionsWithLookback includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience being created is included when determining + * audience membership. Note that including historical data may be needed in order to properly + * handle the definition specified. In these cases, Segment will automatically handle including + * historical data and the response will return the includeHistoricalData parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nullable + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public AudienceOptionsWithLookback includeAnonymousUsers(Boolean includeAnonymousUsers) { + + this.includeAnonymousUsers = includeAnonymousUsers; + return this; + } + + /** + * Determines whether anonymous users should be included when determining audience membership. + * + * @return includeAnonymousUsers + */ + @javax.annotation.Nullable + public Boolean getIncludeAnonymousUsers() { + return includeAnonymousUsers; + } + + public void setIncludeAnonymousUsers(Boolean includeAnonymousUsers) { + this.includeAnonymousUsers = includeAnonymousUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceOptionsWithLookback audienceOptionsWithLookback = (AudienceOptionsWithLookback) o; + return Objects.equals( + this.filterByExternalIds, audienceOptionsWithLookback.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, + audienceOptionsWithLookback.backfillEventDataDays) + && Objects.equals( + this.includeHistoricalData, + audienceOptionsWithLookback.includeHistoricalData) + && Objects.equals( + this.includeAnonymousUsers, + audienceOptionsWithLookback.includeAnonymousUsers); + } + + @Override + public int hashCode() { + return Objects.hash( + filterByExternalIds, + backfillEventDataDays, + includeHistoricalData, + includeAnonymousUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceOptionsWithLookback {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" includeAnonymousUsers: ") + .append(toIndentedString(includeAnonymousUsers)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("includeAnonymousUsers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceOptionsWithLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceOptionsWithLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceOptionsWithLookback is not" + + " found in the empty JSON string", + AudienceOptionsWithLookback.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceOptionsWithLookback.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceOptionsWithLookback` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceOptionsWithLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceOptionsWithLookback.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceOptionsWithLookback' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceOptionsWithLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceOptionsWithLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceOptionsWithLookback read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceOptionsWithLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceOptionsWithLookback + * @throws IOException if the JSON string is invalid with respect to AudienceOptionsWithLookback + */ + public static AudienceOptionsWithLookback fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceOptionsWithLookback.class); + } + + /** + * Convert an instance of AudienceOptionsWithLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java new file mode 100644 index 00000000..88b7b297 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -0,0 +1,780 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSummaryWithAudienceTypeAndLookback */ +public class AudienceSummaryWithAudienceTypeAndLookback { + /** Discriminator denoting the audience's product type. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + LINKED("LINKED"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_COMPUTE_CADENCE = "computeCadence"; + + @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) + private AudienceComputeCadence computeCadence; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SPACE_ID = "spaceId"; + + @SerializedName(SERIALIZED_NAME_SPACE_ID) + private String spaceId; + + public static final String SERIALIZED_NAME_NAME = "name"; + + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_KEY = "key"; + + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinition definition; + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy"; + + @SerializedName(SERIALIZED_NAME_UPDATED_BY) + private String updatedBy; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public AudienceSummaryWithAudienceTypeAndLookback() {} + + public AudienceSummaryWithAudienceTypeAndLookback audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * Discriminator denoting the audience's product type. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudienceSummaryWithAudienceTypeAndLookback computeCadence( + AudienceComputeCadence computeCadence) { + + this.computeCadence = computeCadence; + return this; + } + + /** + * Get computeCadence + * + * @return computeCadence + */ + @javax.annotation.Nonnull + public AudienceComputeCadence getComputeCadence() { + return computeCadence; + } + + public void setComputeCadence(AudienceComputeCadence computeCadence) { + this.computeCadence = computeCadence; + } + + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + public AudienceSummaryWithAudienceTypeAndLookback id(String id) { + + this.id = id; + return this; + } + + /** + * Audience id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSummaryWithAudienceTypeAndLookback spaceId(String spaceId) { + + this.spaceId = spaceId; + return this; + } + + /** + * Space id for the audience. + * + * @return spaceId + */ + @javax.annotation.Nonnull + public String getSpaceId() { + return spaceId; + } + + public void setSpaceId(String spaceId) { + this.spaceId = spaceId; + } + + public AudienceSummaryWithAudienceTypeAndLookback name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the audience. + * + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AudienceSummaryWithAudienceTypeAndLookback description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the audience. + * + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AudienceSummaryWithAudienceTypeAndLookback key(String key) { + + this.key = key; + return this; + } + + /** + * Key for the audience. + * + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public AudienceSummaryWithAudienceTypeAndLookback enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Enabled/disabled status for the audience. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSummaryWithAudienceTypeAndLookback definition(AudienceDefinition definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nullable + public AudienceDefinition getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinition definition) { + this.definition = definition; + } + + public AudienceSummaryWithAudienceTypeAndLookback status(String status) { + + this.status = status; + return this; + } + + /** + * Status for the audience. Possible values: Backfilling, Computing, Failed, Live, Awaiting + * Destinations, Disabled. + * + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdBy(String createdBy) { + + this.createdBy = createdBy; + return this; + } + + /** + * User id who created the audience. + * + * @return createdBy + */ + @javax.annotation.Nonnull + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedBy(String updatedBy) { + + this.updatedBy = updatedBy; + return this; + } + + /** + * User id who last updated the audience. + * + * @return updatedBy + */ + @javax.annotation.Nonnull + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public AudienceSummaryWithAudienceTypeAndLookback createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Date the audience was created. + * + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public AudienceSummaryWithAudienceTypeAndLookback updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Date the audience was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSummaryWithAudienceTypeAndLookback audienceSummaryWithAudienceTypeAndLookback = + (AudienceSummaryWithAudienceTypeAndLookback) o; + return Objects.equals( + this.audienceType, audienceSummaryWithAudienceTypeAndLookback.audienceType) + && Objects.equals( + this.computeCadence, + audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) + && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) + && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) + && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) + && Objects.equals( + this.description, audienceSummaryWithAudienceTypeAndLookback.description) + && Objects.equals(this.key, audienceSummaryWithAudienceTypeAndLookback.key) + && Objects.equals(this.enabled, audienceSummaryWithAudienceTypeAndLookback.enabled) + && Objects.equals( + this.definition, audienceSummaryWithAudienceTypeAndLookback.definition) + && Objects.equals(this.status, audienceSummaryWithAudienceTypeAndLookback.status) + && Objects.equals( + this.createdBy, audienceSummaryWithAudienceTypeAndLookback.createdBy) + && Objects.equals( + this.updatedBy, audienceSummaryWithAudienceTypeAndLookback.updatedBy) + && Objects.equals( + this.createdAt, audienceSummaryWithAudienceTypeAndLookback.createdAt) + && Objects.equals( + this.updatedAt, audienceSummaryWithAudienceTypeAndLookback.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + audienceType, + computeCadence, + options, + id, + spaceId, + name, + description, + key, + enabled, + definition, + status, + createdBy, + updatedBy, + createdAt, + updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceType"); + openapiFields.add("computeCadence"); + openapiFields.add("options"); + openapiFields.add("id"); + openapiFields.add("spaceId"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("key"); + openapiFields.add("enabled"); + openapiFields.add("definition"); + openapiFields.add("status"); + openapiFields.add("createdBy"); + openapiFields.add("updatedBy"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("computeCadence"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("spaceId"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("createdBy"); + openapiRequiredFields.add("updatedBy"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("updatedAt"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " AudienceSummaryWithAudienceTypeAndLookback is not found in" + + " the empty JSON string", + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSummaryWithAudienceTypeAndLookback.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSummaryWithAudienceTypeAndLookback` properties." + + " JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + AudienceSummaryWithAudienceTypeAndLookback.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `computeCadence` + AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `options` + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("spaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `spaceId` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("spaceId").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `name` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) + && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `description` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("description").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `key` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("key").toString())); + } + // validate the required field `definition` + AudienceDefinition.validateJsonElement(jsonObj.get("definition")); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdBy").toString())); + } + if (!jsonObj.get("updatedBy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedBy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedBy").toString())); + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `createdAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("createdAt").toString())); + } + if (!jsonObj.get("updatedAt").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `updatedAt` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("updatedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSummaryWithAudienceTypeAndLookback.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'AudienceSummaryWithAudienceTypeAndLookback' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudienceSummaryWithAudienceTypeAndLookback.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, AudienceSummaryWithAudienceTypeAndLookback value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSummaryWithAudienceTypeAndLookback read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSummaryWithAudienceTypeAndLookback given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSummaryWithAudienceTypeAndLookback + * @throws IOException if the JSON string is invalid with respect to + * AudienceSummaryWithAudienceTypeAndLookback + */ + public static AudienceSummaryWithAudienceTypeAndLookback fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, AudienceSummaryWithAudienceTypeAndLookback.class); + } + + /** + * Convert an instance of AudienceSummaryWithAudienceTypeAndLookback to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java index 298a66a0..10e9179d 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceAlphaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceAlphaOutput() {} - public GetAudienceAlphaOutput audience(AudienceSummary audience) { + public GetAudienceAlphaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceAlphaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java index 7ad6f044..0ff36009 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/GetAudienceBetaOutput.java @@ -32,11 +32,11 @@ public class GetAudienceBetaOutput { public static final String SERIALIZED_NAME_AUDIENCE = "audience"; @SerializedName(SERIALIZED_NAME_AUDIENCE) - private AudienceSummary audience; + private AudienceSummaryWithAudienceTypeAndLookback audience; public GetAudienceBetaOutput() {} - public GetAudienceBetaOutput audience(AudienceSummary audience) { + public GetAudienceBetaOutput audience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; return this; @@ -48,11 +48,11 @@ public GetAudienceBetaOutput audience(AudienceSummary audience) { * @return audience */ @javax.annotation.Nonnull - public AudienceSummary getAudience() { + public AudienceSummaryWithAudienceTypeAndLookback getAudience() { return audience; } - public void setAudience(AudienceSummary audience) { + public void setAudience(AudienceSummaryWithAudienceTypeAndLookback audience) { this.audience = audience; } @@ -147,7 +147,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `audience` - AudienceSummary.validateJsonElement(jsonObj.get("audience")); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement(jsonObj.get("audience")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java index 5a709f3e..5a8aeb61 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesAlphaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesAlphaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesAlphaOutput { public ListAudiencesAlphaOutput() {} - public ListAudiencesAlphaOutput audiences(List audiences) { + public ListAudiencesAlphaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesAlphaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesAlphaOutput addAudiencesItem(AudienceSummary audiencesItem) * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java index 0956d915..85d0c6f2 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesBetaOutput.java @@ -35,7 +35,7 @@ public class ListAudiencesBetaOutput { public static final String SERIALIZED_NAME_AUDIENCES = "audiences"; @SerializedName(SERIALIZED_NAME_AUDIENCES) - private List audiences = new ArrayList<>(); + private List audiences = new ArrayList<>(); public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @@ -44,13 +44,15 @@ public class ListAudiencesBetaOutput { public ListAudiencesBetaOutput() {} - public ListAudiencesBetaOutput audiences(List audiences) { + public ListAudiencesBetaOutput audiences( + List audiences) { this.audiences = audiences; return this; } - public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { + public ListAudiencesBetaOutput addAudiencesItem( + AudienceSummaryWithAudienceTypeAndLookback audiencesItem) { if (this.audiences == null) { this.audiences = new ArrayList<>(); } @@ -64,11 +66,11 @@ public ListAudiencesBetaOutput addAudiencesItem(AudienceSummary audiencesItem) { * @return audiences */ @javax.annotation.Nonnull - public List getAudiences() { + public List getAudiences() { return audiences; } - public void setAudiences(List audiences) { + public void setAudiences(List audiences) { this.audiences = audiences; } @@ -198,7 +200,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray jsonArrayaudiences = jsonObj.getAsJsonArray("audiences"); // validate the required field `audiences` (array) for (int i = 0; i < jsonArrayaudiences.size(); i++) { - AudienceSummary.validateJsonElement(jsonArrayaudiences.get(i)); + AudienceSummaryWithAudienceTypeAndLookback.validateJsonElement( + jsonArrayaudiences.get(i)); } ; // validate the required field `pagination` diff --git a/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java new file mode 100644 index 00000000..5a1abf02 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudiencesPaginationInput.java @@ -0,0 +1,249 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Fork of Autobahn's PaginationInput. Count is limited to 200 in this fork. Pagination + * parameters. Every resource that returns a list of items in its `Output` object may + * contain a `PaginationInput` in its `Input` object. Required, though some of + * its fields are optional. + */ +public class ListAudiencesPaginationInput { + public static final String SERIALIZED_NAME_CURSOR = "cursor"; + + @SerializedName(SERIALIZED_NAME_CURSOR) + private String cursor; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + public ListAudiencesPaginationInput() {} + + public ListAudiencesPaginationInput cursor(String cursor) { + + this.cursor = cursor; + return this; + } + + /** + * The page to request. Acceptable values to use here are in PaginationOutput objects, in the + * `current`, `next`, and `previous` keys. Consumers of the API + * must treat this value as opaque. + * + * @return cursor + */ + @javax.annotation.Nullable + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public ListAudiencesPaginationInput count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The number of items to retrieve in a page, between 1 and 200. + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudiencesPaginationInput listAudiencesPaginationInput = + (ListAudiencesPaginationInput) o; + return Objects.equals(this.cursor, listAudiencesPaginationInput.cursor) + && Objects.equals(this.count, listAudiencesPaginationInput.count); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudiencesPaginationInput {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cursor"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudiencesPaginationInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudiencesPaginationInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListAudiencesPaginationInput is not" + + " found in the empty JSON string", + ListAudiencesPaginationInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudiencesPaginationInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudiencesPaginationInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListAudiencesPaginationInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cursor") != null && !jsonObj.get("cursor").isJsonNull()) + && !jsonObj.get("cursor").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cursor` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cursor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudiencesPaginationInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudiencesPaginationInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListAudiencesPaginationInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListAudiencesPaginationInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudiencesPaginationInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudiencesPaginationInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListAudiencesPaginationInput + * @throws IOException if the JSON string is invalid with respect to + * ListAudiencesPaginationInput + */ + public static ListAudiencesPaginationInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudiencesPaginationInput.class); + } + + /** + * Convert an instance of ListAudiencesPaginationInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 9375168fdf1db367ed45e6fca2e64653c84fd7f7 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 6 May 2025 13:34:47 +0000 Subject: [PATCH 424/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@82576f7c. From 63b9d534eb0f11c08dc4f2e41abbe6f3369fc5d4 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 20 May 2025 06:09:48 +0000 Subject: [PATCH 425/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@95882b05. --- docs/DeletionAndSuppressionApi.md | 2 +- .../api/DeletionAndSuppressionApi.java | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 855605d7..0409b8fa 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -244,7 +244,7 @@ public class Example { Delete Regulation -Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). +Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: this endpoint has been deprecated according to the guidelines, and may experience reduced SLA guarantees. ### Example diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 3070d13b..1d56031c 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -699,7 +699,10 @@ public okhttp3.Call createWorkspaceRegulationAsync( * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -763,6 +766,7 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { @@ -779,7 +783,9 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @return DeleteRegulation200Response @@ -793,7 +799,10 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public DeleteRegulation200Response deleteRegulation(String regulateId) throws ApiException { ApiResponse localVarResp = deleteRegulationWithHttpInfo(regulateId); @@ -803,7 +812,9 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -817,7 +828,10 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public ApiResponse deleteRegulationWithHttpInfo(String regulateId) throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, null); @@ -828,7 +842,9 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation * must be in the initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes @@ -843,7 +859,10 @@ public ApiResponse deleteRegulationWithHttpInfo(Str * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public okhttp3.Call deleteRegulationAsync( String regulateId, final ApiCallback _callback) throws ApiException { From bac1eda49b011efb96afeb9e9df35acdd74fdb16 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 20 May 2025 16:38:52 +0000 Subject: [PATCH 426/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3dbe0b4f. From df9303c888103755814545feaa0873474216b368 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 22 May 2025 15:47:00 +0000 Subject: [PATCH 427/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9894d5ff. --- docs/DeletionAndSuppressionApi.md | 2 +- .../api/DeletionAndSuppressionApi.java | 25 +++---------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 0409b8fa..855605d7 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -244,7 +244,7 @@ public class Example { Delete Regulation -Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: this endpoint has been deprecated according to the guidelines, and may experience reduced SLA guarantees. +Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). ### Example diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 1d56031c..3070d13b 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -699,10 +699,7 @@ public okhttp3.Call createWorkspaceRegulationAsync( * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -766,7 +763,6 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c _callback); } - @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { @@ -783,9 +779,7 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: - * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA - * guarantees. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return DeleteRegulation200Response @@ -799,10 +793,7 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public DeleteRegulation200Response deleteRegulation(String regulateId) throws ApiException { ApiResponse localVarResp = deleteRegulationWithHttpInfo(regulateId); @@ -812,9 +803,7 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: - * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA - * guarantees. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -828,10 +817,7 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public ApiResponse deleteRegulationWithHttpInfo(String regulateId) throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, null); @@ -842,9 +828,7 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation * must be in the initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: - * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA - * guarantees. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes @@ -859,10 +843,7 @@ public ApiResponse deleteRegulationWithHttpInfo(Str * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public okhttp3.Call deleteRegulationAsync( String regulateId, final ApiCallback _callback) throws ApiException { From 402da8457c2a61510b6d6c8e45b2bcb96be8a9a0 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 22 May 2025 15:48:20 +0000 Subject: [PATCH 428/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@d2e64d94. --- README.md | 8 +- docs/AudiencesApi.md | 76 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 12 + .../segment/publicapi/api/AudiencesApi.java | 195 +++++++++++ .../models/AudienceDefinitionWithoutType.java | 215 ++++++++++++ .../com/segment/publicapi/models/Preview.java | 206 ++++++++++++ .../models/PreviewAudience200Response.java | 194 +++++++++++ .../models/PreviewAudienceInput.java | 317 ++++++++++++++++++ .../models/PreviewAudienceOutput.java | 202 +++++++++++ 12 files changed, 1424 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceDefinitionWithoutType.java create mode 100644 src/main/java/com/segment/publicapi/models/Preview.java create mode 100644 src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java create mode 100644 src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java diff --git a/README.md b/README.md index fbb1ac29..5a87389a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.3.0 +Latest API and SDK version: 58.4.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.3.0 + 58.4.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.3.0" + implementation "com.segment.publicapi:segment-publicapi:58.4.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.3.0.jar` +* `target/segment-publicapi-58.4.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 2d2c4b60..9a48ffbb 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -8,6 +8,7 @@ All URIs are relative to *https://api.segmentapis.com* | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | +| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -319,6 +320,81 @@ public class Example { | **429** | Too many requests | - | +## Operation: previewAudience + +> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput) + +Preview Audience + +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "spaceId"; // String | + PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | + try { + PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#previewAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | | + +### Return type + +[**PreviewAudience200Response**](PreviewAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: removeAudienceFromSpace > RemoveAudienceFromSpace200Response removeAudienceFromSpace(spaceId, id) diff --git a/pom.xml b/pom.xml index a4684c76..5e7c0de0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.3.0 + 58.4.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d632be35..1b2f8da0 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.3.0 (Java)"); + setUserAgent("Public API SDK 58.4.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index fe02ca4a..43218976 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.3.0"; + public static final String VERSION = "58.4.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 837be0d2..a9e8b2aa 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -167,6 +167,9 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.AudienceComputeCadence.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceDefinitionWithoutType + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1193,6 +1196,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilter200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 3304709a..9f660e26 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -27,6 +27,8 @@ import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.PreviewAudience200Response; +import com.segment.publicapi.models.PreviewAudienceInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; @@ -944,6 +946,199 @@ public okhttp3.Call listAudiencesAsync( return localVarCall; } + /** + * Build call for previewAudience + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call previewAudienceCall( + String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = previewAudienceInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call previewAudienceValidateBeforeCall( + String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling previewAudience(Async)"); + } + + // verify the required parameter 'previewAudienceInput' is set + if (previewAudienceInput == null) { + throw new ApiException( + "Missing the required parameter 'previewAudienceInput' when calling" + + " previewAudience(Async)"); + } + + return previewAudienceCall(spaceId, previewAudienceInput, _callback); + } + + /** + * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. • When called, this endpoint may + * generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @return PreviewAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public PreviewAudience200Response previewAudience( + String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { + ApiResponse localVarResp = + previewAudienceWithHttpInfo(spaceId, previewAudienceInput); + return localVarResp.getData(); + } + + /** + * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. • When called, this endpoint may + * generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @return ApiResponse<PreviewAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse previewAudienceWithHttpInfo( + String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { + okhttp3.Call localVarCall = + previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Preview Created` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call previewAudienceAsync( + String spaceId, + PreviewAudienceInput previewAudienceInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for removeAudienceFromSpace * diff --git a/src/main/java/com/segment/publicapi/models/AudienceDefinitionWithoutType.java b/src/main/java/com/segment/publicapi/models/AudienceDefinitionWithoutType.java new file mode 100644 index 00000000..7130a1dd --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceDefinitionWithoutType.java @@ -0,0 +1,215 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceDefinitionWithoutType */ +public class AudienceDefinitionWithoutType { + public static final String SERIALIZED_NAME_QUERY = "query"; + + @SerializedName(SERIALIZED_NAME_QUERY) + private String query; + + public AudienceDefinitionWithoutType() {} + + public AudienceDefinitionWithoutType query(String query) { + + this.query = query; + return this; + } + + /** + * The query language string defining the audience segmentation criteria. For guidance on using + * the query language, see the [Segment documentation + * site](https://segment.com/docs/api/public-api/query-language). + * + * @return query + */ + @javax.annotation.Nonnull + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceDefinitionWithoutType audienceDefinitionWithoutType = + (AudienceDefinitionWithoutType) o; + return Objects.equals(this.query, audienceDefinitionWithoutType.query); + } + + @Override + public int hashCode() { + return Objects.hash(query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceDefinitionWithoutType {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudienceDefinitionWithoutType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceDefinitionWithoutType.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceDefinitionWithoutType is not" + + " found in the empty JSON string", + AudienceDefinitionWithoutType.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceDefinitionWithoutType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceDefinitionWithoutType` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceDefinitionWithoutType.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `query` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("query").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceDefinitionWithoutType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceDefinitionWithoutType' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudienceDefinitionWithoutType.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceDefinitionWithoutType value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceDefinitionWithoutType read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceDefinitionWithoutType given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceDefinitionWithoutType + * @throws IOException if the JSON string is invalid with respect to + * AudienceDefinitionWithoutType + */ + public static AudienceDefinitionWithoutType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceDefinitionWithoutType.class); + } + + /** + * Convert an instance of AudienceDefinitionWithoutType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Preview.java b/src/main/java/com/segment/publicapi/models/Preview.java new file mode 100644 index 00000000..a1b63f84 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Preview.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Preview */ +public class Preview { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public Preview() {} + + public Preview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of the preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Preview preview = (Preview) o; + return Objects.equals(this.id, preview.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Preview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Preview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Preview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Preview is not found in the empty JSON" + + " string", + Preview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Preview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Preview`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Preview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Preview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Preview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Preview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Preview value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Preview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Preview given an JSON string + * + * @param jsonString JSON string + * @return An instance of Preview + * @throws IOException if the JSON string is invalid with respect to Preview + */ + public static Preview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Preview.class); + } + + /** + * Convert an instance of Preview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java b/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java new file mode 100644 index 00000000..da007f6e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** PreviewAudience200Response */ +public class PreviewAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private PreviewAudienceOutput data; + + public PreviewAudience200Response() {} + + public PreviewAudience200Response data(PreviewAudienceOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public PreviewAudienceOutput getData() { + return data; + } + + public void setData(PreviewAudienceOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviewAudience200Response previewAudience200Response = (PreviewAudience200Response) o; + return Objects.equals(this.data, previewAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PreviewAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PreviewAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PreviewAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PreviewAudience200Response is not" + + " found in the empty JSON string", + PreviewAudience200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PreviewAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PreviewAudience200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + PreviewAudienceOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PreviewAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudience200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PreviewAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PreviewAudience200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PreviewAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of PreviewAudience200Response + * @throws IOException if the JSON string is invalid with respect to PreviewAudience200Response + */ + public static PreviewAudience200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudience200Response.class); + } + + /** + * Convert an instance of PreviewAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java b/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java new file mode 100644 index 00000000..b38d1ddf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java @@ -0,0 +1,317 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input to preview an audience. */ +public class PreviewAudienceInput { + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + /** Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public PreviewAudienceInput() {} + + public PreviewAudienceInput definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public PreviewAudienceInput audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public PreviewAudienceInput options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviewAudienceInput previewAudienceInput = (PreviewAudienceInput) o; + return Objects.equals(this.definition, previewAudienceInput.definition) + && Objects.equals(this.audienceType, previewAudienceInput.audienceType) + && Objects.equals(this.options, previewAudienceInput.options); + } + + @Override + public int hashCode() { + return Objects.hash(definition, audienceType, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PreviewAudienceInput {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("definition"); + openapiFields.add("audienceType"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("audienceType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PreviewAudienceInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PreviewAudienceInput is not found in" + + " the empty JSON string", + PreviewAudienceInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PreviewAudienceInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PreviewAudienceInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PreviewAudienceInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the optional field `options` + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PreviewAudienceInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudienceInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PreviewAudienceInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PreviewAudienceInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PreviewAudienceInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of PreviewAudienceInput + * @throws IOException if the JSON string is invalid with respect to PreviewAudienceInput + */ + public static PreviewAudienceInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudienceInput.class); + } + + /** + * Convert an instance of PreviewAudienceInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java b/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java new file mode 100644 index 00000000..fefc0eb9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java @@ -0,0 +1,202 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** PreviewAudienceOutput */ +public class PreviewAudienceOutput { + public static final String SERIALIZED_NAME_PREVIEW = "preview"; + + @SerializedName(SERIALIZED_NAME_PREVIEW) + private Preview preview; + + public PreviewAudienceOutput() {} + + public PreviewAudienceOutput preview(Preview preview) { + + this.preview = preview; + return this; + } + + /** + * Get preview + * + * @return preview + */ + @javax.annotation.Nonnull + public Preview getPreview() { + return preview; + } + + public void setPreview(Preview preview) { + this.preview = preview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PreviewAudienceOutput previewAudienceOutput = (PreviewAudienceOutput) o; + return Objects.equals(this.preview, previewAudienceOutput.preview); + } + + @Override + public int hashCode() { + return Objects.hash(preview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PreviewAudienceOutput {\n"); + sb.append(" preview: ").append(toIndentedString(preview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("preview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("preview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PreviewAudienceOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PreviewAudienceOutput is not found in" + + " the empty JSON string", + PreviewAudienceOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PreviewAudienceOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PreviewAudienceOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PreviewAudienceOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `preview` + Preview.validateJsonElement(jsonObj.get("preview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PreviewAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudienceOutput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PreviewAudienceOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PreviewAudienceOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PreviewAudienceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of PreviewAudienceOutput + * @throws IOException if the JSON string is invalid with respect to PreviewAudienceOutput + */ + public static PreviewAudienceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudienceOutput.class); + } + + /** + * Convert an instance of PreviewAudienceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 13e36c8ea49c6f610a12ca29b339a3cc35cb6abd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 23 May 2025 17:02:32 +0000 Subject: [PATCH 429/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e9504e85. --- README.md | 8 +- docs/CustomerInsightsApi.md | 82 +++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 11 + .../publicapi/api/CustomerInsightsApi.java | 238 +++++++++++++++ .../models/CreateDownload200Response.java | 194 ++++++++++++ .../models/CreateDownloadAlphaInput.java | 281 ++++++++++++++++++ .../models/CreateDownloadAlphaOutput.java | 203 +++++++++++++ .../segment/publicapi/models/Download.java | 221 ++++++++++++++ 11 files changed, 1237 insertions(+), 7 deletions(-) create mode 100644 docs/CustomerInsightsApi.md create mode 100644 src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDownload200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateDownloadAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/Download.java diff --git a/README.md b/README.md index 5a87389a..80e58f08 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.4.0 +Latest API and SDK version: 58.5.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.4.0 + 58.5.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.4.0" + implementation "com.segment.publicapi:segment-publicapi:58.5.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.4.0.jar` +* `target/segment-publicapi-58.5.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/CustomerInsightsApi.md b/docs/CustomerInsightsApi.md new file mode 100644 index 00000000..27ef841b --- /dev/null +++ b/docs/CustomerInsightsApi.md @@ -0,0 +1,82 @@ +# CustomerInsightsApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createDownload**](CustomerInsightsApi.md#createDownload) | **POST** /customer-insights/download | Create Download | + + + +## Operation: createDownload + +> CreateDownload200Response createDownload(createDownloadAlphaInput) + +Create Download + +Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.CustomerInsightsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + CustomerInsightsApi apiInstance = new CustomerInsightsApi(defaultClient); + CreateDownloadAlphaInput createDownloadAlphaInput = new CreateDownloadAlphaInput(); // CreateDownloadAlphaInput | + try { + CreateDownload200Response result = apiInstance.createDownload(createDownloadAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CustomerInsightsApi#createDownload"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **createDownloadAlphaInput** | [**CreateDownloadAlphaInput**](CreateDownloadAlphaInput.md)| | | + +### Return type + +[**CreateDownload200Response**](CreateDownload200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/pom.xml b/pom.xml index 5e7c0de0..d8adf89e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.4.0 + 58.5.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 1b2f8da0..889ebbb0 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.4.0 (Java)"); + setUserAgent("Public API SDK 58.5.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 43218976..5cc89fca 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.4.0"; + public static final String VERSION = "58.5.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index a9e8b2aa..9a4de509 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -267,6 +267,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateDestinationV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDownload200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDownloadAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateDownloadAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateEdgeFunctions200Response .CustomTypeAdapterFactory()); @@ -601,6 +610,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DisableEdgeFunctionsAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Download.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Echo200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java new file mode 100644 index 00000000..2cd26214 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java @@ -0,0 +1,238 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.CreateDownload200Response; +import com.segment.publicapi.models.CreateDownloadAlphaInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CustomerInsightsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CustomerInsightsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CustomerInsightsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createDownload + * + * @param createDownloadAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createDownloadCall( + CreateDownloadAlphaInput createDownloadAlphaInput, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createDownloadAlphaInput; + + // create path and map variables + String localVarPath = "/customer-insights/download"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createDownloadValidateBeforeCall( + CreateDownloadAlphaInput createDownloadAlphaInput, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'createDownloadAlphaInput' is set + if (createDownloadAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createDownloadAlphaInput' when calling" + + " createDownload(Async)"); + } + + return createDownloadCall(createDownloadAlphaInput, _callback); + } + + /** + * Create Download Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param createDownloadAlphaInput (required) + * @return CreateDownload200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateDownload200Response createDownload( + CreateDownloadAlphaInput createDownloadAlphaInput) throws ApiException { + ApiResponse localVarResp = + createDownloadWithHttpInfo(createDownloadAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Download Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param createDownloadAlphaInput (required) + * @return ApiResponse<CreateDownload200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createDownloadWithHttpInfo( + CreateDownloadAlphaInput createDownloadAlphaInput) throws ApiException { + okhttp3.Call localVarCall = + createDownloadValidateBeforeCall(createDownloadAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Download (asynchronously) Create Customer Insights Presigned URLs The rate limit for + * this endpoint is 1 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param createDownloadAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createDownloadAsync( + CreateDownloadAlphaInput createDownloadAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createDownloadValidateBeforeCall(createDownloadAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDownload200Response.java b/src/main/java/com/segment/publicapi/models/CreateDownload200Response.java new file mode 100644 index 00000000..7911e721 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDownload200Response.java @@ -0,0 +1,194 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateDownload200Response */ +public class CreateDownload200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateDownloadAlphaOutput data; + + public CreateDownload200Response() {} + + public CreateDownload200Response data(CreateDownloadAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateDownloadAlphaOutput getData() { + return data; + } + + public void setData(CreateDownloadAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDownload200Response createDownload200Response = (CreateDownload200Response) o; + return Objects.equals(this.data, createDownload200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDownload200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateDownload200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDownload200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDownload200Response is not found" + + " in the empty JSON string", + CreateDownload200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDownload200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDownload200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateDownloadAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDownload200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDownload200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateDownload200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDownload200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDownload200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDownload200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDownload200Response + * @throws IOException if the JSON string is invalid with respect to CreateDownload200Response + */ + public static CreateDownload200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDownload200Response.class); + } + + /** + * Convert an instance of CreateDownload200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java new file mode 100644 index 00000000..cc6766cb --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java @@ -0,0 +1,281 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input to create presigned URLs for Granular Observability Collection logs. */ +public class CreateDownloadAlphaInput { + public static final String SERIALIZED_NAME_COLLECTION_ID = "collectionId"; + + @SerializedName(SERIALIZED_NAME_COLLECTION_ID) + private String collectionId; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_START_TIME = "startTime"; + + @SerializedName(SERIALIZED_NAME_START_TIME) + private String startTime; + + public CreateDownloadAlphaInput() {} + + public CreateDownloadAlphaInput collectionId(String collectionId) { + + this.collectionId = collectionId; + return this; + } + + /** + * The collection's unique id. + * + * @return collectionId + */ + @javax.annotation.Nonnull + public String getCollectionId() { + return collectionId; + } + + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + public CreateDownloadAlphaInput workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The Workspace id for the collection. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public CreateDownloadAlphaInput startTime(String startTime) { + + this.startTime = startTime; + return this; + } + + /** + * The ISO8601 formatted timestamp corresponding to the beginning of the time range. Currently, + * there is a month of data retained. + * + * @return startTime + */ + @javax.annotation.Nonnull + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDownloadAlphaInput createDownloadAlphaInput = (CreateDownloadAlphaInput) o; + return Objects.equals(this.collectionId, createDownloadAlphaInput.collectionId) + && Objects.equals(this.workspaceId, createDownloadAlphaInput.workspaceId) + && Objects.equals(this.startTime, createDownloadAlphaInput.startTime); + } + + @Override + public int hashCode() { + return Objects.hash(collectionId, workspaceId, startTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDownloadAlphaInput {\n"); + sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("collectionId"); + openapiFields.add("workspaceId"); + openapiFields.add("startTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("collectionId"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("startTime"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateDownloadAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDownloadAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDownloadAlphaInput is not found" + + " in the empty JSON string", + CreateDownloadAlphaInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDownloadAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDownloadAlphaInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDownloadAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("collectionId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `collectionId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("collectionId").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("startTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `startTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("startTime").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDownloadAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDownloadAlphaInput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateDownloadAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDownloadAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDownloadAlphaInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDownloadAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDownloadAlphaInput + * @throws IOException if the JSON string is invalid with respect to CreateDownloadAlphaInput + */ + public static CreateDownloadAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDownloadAlphaInput.class); + } + + /** + * Convert an instance of CreateDownloadAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaOutput.java new file mode 100644 index 00000000..520da262 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaOutput.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateDownloadAlphaOutput */ +public class CreateDownloadAlphaOutput { + public static final String SERIALIZED_NAME_DOWNLOAD = "download"; + + @SerializedName(SERIALIZED_NAME_DOWNLOAD) + private Download download; + + public CreateDownloadAlphaOutput() {} + + public CreateDownloadAlphaOutput download(Download download) { + + this.download = download; + return this; + } + + /** + * Get download + * + * @return download + */ + @javax.annotation.Nonnull + public Download getDownload() { + return download; + } + + public void setDownload(Download download) { + this.download = download; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDownloadAlphaOutput createDownloadAlphaOutput = (CreateDownloadAlphaOutput) o; + return Objects.equals(this.download, createDownloadAlphaOutput.download); + } + + @Override + public int hashCode() { + return Objects.hash(download); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDownloadAlphaOutput {\n"); + sb.append(" download: ").append(toIndentedString(download)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("download"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("download"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateDownloadAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateDownloadAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateDownloadAlphaOutput is not found" + + " in the empty JSON string", + CreateDownloadAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateDownloadAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateDownloadAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDownloadAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `download` + Download.validateJsonElement(jsonObj.get("download")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDownloadAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDownloadAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CreateDownloadAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDownloadAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDownloadAlphaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDownloadAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDownloadAlphaOutput + * @throws IOException if the JSON string is invalid with respect to CreateDownloadAlphaOutput + */ + public static CreateDownloadAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDownloadAlphaOutput.class); + } + + /** + * Convert an instance of CreateDownloadAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Download.java b/src/main/java/com/segment/publicapi/models/Download.java new file mode 100644 index 00000000..24c314e3 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Download.java @@ -0,0 +1,221 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Download */ +public class Download { + public static final String SERIALIZED_NAME_URLS = "urls"; + + @SerializedName(SERIALIZED_NAME_URLS) + private List urls = new ArrayList<>(); + + public Download() {} + + public Download urls(List urls) { + + this.urls = urls; + return this; + } + + public Download addUrlsItem(String urlsItem) { + if (this.urls == null) { + this.urls = new ArrayList<>(); + } + this.urls.add(urlsItem); + return this; + } + + /** + * List of presigned URLs from S3. + * + * @return urls + */ + @javax.annotation.Nonnull + public List getUrls() { + return urls; + } + + public void setUrls(List urls) { + this.urls = urls; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Download download = (Download) o; + return Objects.equals(this.urls, download.urls); + } + + @Override + public int hashCode() { + return Objects.hash(urls); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Download {\n"); + sb.append(" urls: ").append(toIndentedString(urls)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("urls"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("urls"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Download + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Download.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Download is not found in the empty" + + " JSON string", + Download.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Download.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the `Download`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Download.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("urls") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("urls").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `urls` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("urls").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Download.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Download' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Download.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Download value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Download read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Download given an JSON string + * + * @param jsonString JSON string + * @return An instance of Download + * @throws IOException if the JSON string is invalid with respect to Download + */ + public static Download fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Download.class); + } + + /** + * Convert an instance of Download to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From bea116281046b25b501fa09e8d964c1fcefcbac8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 27 May 2025 21:56:26 +0000 Subject: [PATCH 430/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@cd950cbb. From d1b30e2adc560cb9ac36fa268c374b0fbf8aa009 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Jun 2025 20:05:01 +0000 Subject: [PATCH 431/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@96bc189d. --- docs/AudiencesApi.md | 20 ++++----- .../models/CreateDownloadAlphaInput.java | 42 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 9a48ffbb..3ea1a026 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -42,7 +42,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | CreateAudienceAlphaInput createAudienceAlphaInput = new CreateAudienceAlphaInput(); // CreateAudienceAlphaInput | try { CreateAudience200Response result = apiInstance.createAudience(spaceId, createAudienceAlphaInput); @@ -117,7 +117,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | String id = "id"; // String | try { GetAudience200Response result = apiInstance.getAudience(spaceId, id); @@ -192,8 +192,8 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | - String id = "ReferencedAudienceId"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. @@ -273,7 +273,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); @@ -348,7 +348,7 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | try { PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); @@ -423,8 +423,8 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | - String id = "id"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -498,8 +498,8 @@ public class Example { token.setBearerToken("BEARER TOKEN"); AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "spaceId"; // String | - String id = "id"; // String | + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java index cc6766cb..3ba1b5ad 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java @@ -39,10 +39,10 @@ public class CreateDownloadAlphaInput { @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) private String workspaceId; - public static final String SERIALIZED_NAME_START_TIME = "startTime"; + public static final String SERIALIZED_NAME_HOUR = "hour"; - @SerializedName(SERIALIZED_NAME_START_TIME) - private String startTime; + @SerializedName(SERIALIZED_NAME_HOUR) + private String hour; public CreateDownloadAlphaInput() {} @@ -86,25 +86,25 @@ public void setWorkspaceId(String workspaceId) { this.workspaceId = workspaceId; } - public CreateDownloadAlphaInput startTime(String startTime) { + public CreateDownloadAlphaInput hour(String hour) { - this.startTime = startTime; + this.hour = hour; return this; } /** - * The ISO8601 formatted timestamp corresponding to the beginning of the time range. Currently, - * there is a month of data retained. + * The ISO8601 formatted timestamp corresponding to a specific hour and day to retrieve data + * for. E.g.: 2025-05-07T23:00:00Z Objects are bucketed by hour and a month of data is retained. * - * @return startTime + * @return hour */ @javax.annotation.Nonnull - public String getStartTime() { - return startTime; + public String getHour() { + return hour; } - public void setStartTime(String startTime) { - this.startTime = startTime; + public void setHour(String hour) { + this.hour = hour; } @Override @@ -118,12 +118,12 @@ public boolean equals(Object o) { CreateDownloadAlphaInput createDownloadAlphaInput = (CreateDownloadAlphaInput) o; return Objects.equals(this.collectionId, createDownloadAlphaInput.collectionId) && Objects.equals(this.workspaceId, createDownloadAlphaInput.workspaceId) - && Objects.equals(this.startTime, createDownloadAlphaInput.startTime); + && Objects.equals(this.hour, createDownloadAlphaInput.hour); } @Override public int hashCode() { - return Objects.hash(collectionId, workspaceId, startTime); + return Objects.hash(collectionId, workspaceId, hour); } @Override @@ -132,7 +132,7 @@ public String toString() { sb.append("class CreateDownloadAlphaInput {\n"); sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); - sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" hour: ").append(toIndentedString(hour)).append("\n"); sb.append("}"); return sb.toString(); } @@ -156,13 +156,13 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("collectionId"); openapiFields.add("workspaceId"); - openapiFields.add("startTime"); + openapiFields.add("hour"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("collectionId"); openapiRequiredFields.add("workspaceId"); - openapiRequiredFields.add("startTime"); + openapiRequiredFields.add("hour"); } /** @@ -219,12 +219,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("workspaceId").toString())); } - if (!jsonObj.get("startTime").isJsonPrimitive()) { + if (!jsonObj.get("hour").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `startTime` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("startTime").toString())); + "Expected the field `hour` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("hour").toString())); } } From 1b7fe2d92312246fedaf257efb0948e905654b26 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Jun 2025 20:05:54 +0000 Subject: [PATCH 432/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9695be54. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/Configuration.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 80e58f08..9af6d601 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.5.0 +Latest API and SDK version: 58.6.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.5.0 + 58.6.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.5.0" + implementation "com.segment.publicapi:segment-publicapi:58.6.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.5.0.jar` +* `target/segment-publicapi-58.6.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index d8adf89e..15cc847b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.5.0 + 58.6.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 889ebbb0..7737bb6e 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.5.0 (Java)"); + setUserAgent("Public API SDK 58.6.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 5cc89fca..799812c9 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.5.0"; + public static final String VERSION = "58.6.0"; private static ApiClient defaultApiClient = new ApiClient(); From 95aa991183fe14cda2b217106e4556c65e04631e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 10 Jun 2025 21:44:44 +0000 Subject: [PATCH 433/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@34e21c65. --- README.md | 8 +- docs/AudiencesApi.md | 148 +++-- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 42 +- .../segment/publicapi/api/AudiencesApi.java | 594 ++++++++++++------ .../publicapi/models/AudiencePreview.java | 348 ++++++++++ ...ut.java => AudiencePreviewIdentifier.java} | 94 +-- ...review.java => AudiencePreviewResult.java} | 61 +- .../publicapi/models/AudienceSize.java | 284 +++++++++ .../models/CommonAudiencePreview.java | 352 +++++++++++ .../models/CompletedAudiencePreview.java | 519 +++++++++++++++ .../CreateAudiencePreview200Response.java | 199 ++++++ ...a => CreateAudiencePreviewAlphaInput.java} | 70 ++- .../CreateAudiencePreviewAlphaOutput.java | 210 +++++++ .../models/FailedAudiencePreview.java | 468 ++++++++++++++ ...ava => GetAudiencePreview200Response.java} | 65 +- .../models/GetAudiencePreviewAlphaOutput.java | 208 ++++++ .../models/RunningAudiencePreview.java | 432 +++++++++++++ 20 files changed, 3725 insertions(+), 383 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreview.java rename src/main/java/com/segment/publicapi/models/{PreviewAudienceOutput.java => AudiencePreviewIdentifier.java} (64%) rename src/main/java/com/segment/publicapi/models/{Preview.java => AudiencePreviewResult.java} (75%) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSize.java create mode 100644 src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java create mode 100644 src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java rename src/main/java/com/segment/publicapi/models/{PreviewAudienceInput.java => CreateAudiencePreviewAlphaInput.java} (77%) create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java rename src/main/java/com/segment/publicapi/models/{PreviewAudience200Response.java => GetAudiencePreview200Response.java} (69%) create mode 100644 src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java diff --git a/README.md b/README.md index 9af6d601..87d966f8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.6.0 +Latest API and SDK version: 58.7.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.6.0 + 58.7.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.6.0" + implementation "com.segment.publicapi:segment-publicapi:58.7.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.6.0.jar` +* `target/segment-publicapi-58.7.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 3ea1a026..901dfcb3 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -5,10 +5,11 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | +| [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | +| [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | -| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -89,6 +90,81 @@ public class Example { | **429** | Too many requests | - | +## Operation: createAudiencePreview + +> CreateAudiencePreview200Response createAudiencePreview(spaceId, createAudiencePreviewAlphaInput) + +Create Audience Preview + +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = new CreateAudiencePreviewAlphaInput(); // CreateAudiencePreviewAlphaInput | + try { + CreateAudiencePreview200Response result = apiInstance.createAudiencePreview(spaceId, createAudiencePreviewAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#createAudiencePreview"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **createAudiencePreviewAlphaInput** | [**CreateAudiencePreviewAlphaInput**](CreateAudiencePreviewAlphaInput.md)| | | + +### Return type + +[**CreateAudiencePreview200Response**](CreateAudiencePreview200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: getAudience > GetAudience200Response getAudience(spaceId, id) @@ -164,13 +240,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudienceConsumersFromSpaceAndAudience +## Operation: getAudiencePreview -> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) +> GetAudiencePreview200Response getAudiencePreview(spaceId, id) -List Audience Consumers from Space And Audience +Get Audience Preview -Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Reads the results of an audience preview. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -193,15 +269,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. - ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. + String id = "2yKFfGeS62yzGxQSAieVOvsPOha-compute_preview_execution-dws3UdTNsppL5dRGsagFpP-compute_preview_execution"; // String | try { - ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); + GetAudiencePreview200Response result = apiInstance.getAudiencePreview(spaceId, id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#getAudiencePreview"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -218,13 +291,10 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | -| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type -[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) +[**GetAudiencePreview200Response**](GetAudiencePreview200Response.md) ### Authorization @@ -245,13 +315,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudiences +## Operation: listAudienceConsumersFromSpaceAndAudience -> ListAudiences200Response listAudiences(spaceId, pagination) +> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) -List Audiences +List Audience Consumers from Space And Audience -Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -274,12 +344,15 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. + ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); + ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudiences"); + System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -295,11 +368,14 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **id** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | +| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type -[**ListAudiences200Response**](ListAudiences200Response.md) +[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) ### Authorization @@ -308,7 +384,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -320,13 +396,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: previewAudience +## Operation: listAudiences -> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput) +> ListAudiences200Response listAudiences(spaceId, pagination) -Preview Audience +List Audiences -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). +Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -349,12 +425,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { - PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#previewAudience"); + System.err.println("Exception when calling AudiencesApi#listAudiences"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -370,11 +446,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type -[**PreviewAudience200Response**](PreviewAudience200Response.md) +[**ListAudiences200Response**](ListAudiences200Response.md) ### Authorization @@ -382,8 +458,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details diff --git a/pom.xml b/pom.xml index 15cc847b..6a340ede 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.6.0 + 58.7.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 7737bb6e..d731c05a 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.6.0 (Java)"); + setUserAgent("Public API SDK 58.7.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 799812c9..f95a82b6 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.6.0"; + public static final String VERSION = "58.7.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 9a4de509..8d1092af 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -175,6 +175,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptionsWithLookback .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewIdentifier + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSize.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -202,8 +211,13 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CommonAudiencePreview.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CompletedAudiencePreview + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ComputedTraitSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -222,6 +236,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateAudienceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreview200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateCloudSourceRegulation200Response .CustomTypeAdapterFactory()); @@ -626,6 +649,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.FailedAudiencePreview.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -655,6 +680,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudiencePreview200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudiencePreviewAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); @@ -1207,15 +1238,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudience200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilter200Response .CustomTypeAdapterFactory()); @@ -1424,6 +1446,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RunningAudiencePreview.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 9f660e26..64a2d6cc 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -20,15 +20,16 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; +import com.segment.publicapi.models.CreateAudiencePreview200Response; +import com.segment.publicapi.models.CreateAudiencePreviewAlphaInput; import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.GetAudiencePreview200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.PreviewAudience200Response; -import com.segment.publicapi.models.PreviewAudienceInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; @@ -284,6 +285,208 @@ public okhttp3.Call createAudienceAsync( return localVarCall; } + /** + * Build call for createAudiencePreview + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createAudiencePreviewCall( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createAudiencePreviewAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAudiencePreviewValidateBeforeCall( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " createAudiencePreview(Async)"); + } + + // verify the required parameter 'createAudiencePreviewAlphaInput' is set + if (createAudiencePreviewAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createAudiencePreviewAlphaInput' when calling" + + " createAudiencePreview(Async)"); + } + + return createAudiencePreviewCall(spaceId, createAudiencePreviewAlphaInput, _callback); + } + + /** + * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @return CreateAudiencePreview200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateAudiencePreview200Response createAudiencePreview( + String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createAudiencePreviewWithHttpInfo(spaceId, createAudiencePreviewAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @return ApiResponse<CreateAudiencePreview200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createAudiencePreviewWithHttpInfo( + String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createAudiencePreviewValidateBeforeCall( + spaceId, createAudiencePreviewAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Audience Preview (asynchronously) Previews Audience. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Preview Created` event in the + * [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createAudiencePreviewAsync( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createAudiencePreviewValidateBeforeCall( + spaceId, createAudiencePreviewAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for getAudience * @@ -477,6 +680,200 @@ public okhttp3.Call getAudienceAsync( return localVarCall; } + /** + * Build call for getAudiencePreview + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudiencePreviewCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews/{id}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudiencePreviewValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getAudiencePreview(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getAudiencePreview(Async)"); + } + + return getAudiencePreviewCall(spaceId, id, _callback); + } + + /** + * Get Audience Preview Reads the results of an audience preview. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return GetAudiencePreview200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudiencePreview200Response getAudiencePreview(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + getAudiencePreviewWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Get Audience Preview Reads the results of an audience preview. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<GetAudiencePreview200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getAudiencePreviewWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience Preview (asynchronously) Reads the results of an audience preview. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. The rate limit for this endpoint is 100 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudiencePreviewAsync( + String spaceId, String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudienceConsumersFromSpaceAndAudience * @@ -946,199 +1343,6 @@ public okhttp3.Call listAudiencesAsync( return localVarCall; } - /** - * Build call for previewAudience - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call previewAudienceCall( - String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = previewAudienceInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call previewAudienceValidateBeforeCall( - String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling previewAudience(Async)"); - } - - // verify the required parameter 'previewAudienceInput' is set - if (previewAudienceInput == null) { - throw new ApiException( - "Missing the required parameter 'previewAudienceInput' when calling" - + " previewAudience(Async)"); - } - - return previewAudienceCall(spaceId, previewAudienceInput, _callback); - } - - /** - * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit - * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. • When called, this endpoint may - * generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @return PreviewAudience200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public PreviewAudience200Response previewAudience( - String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { - ApiResponse localVarResp = - previewAudienceWithHttpInfo(spaceId, previewAudienceInput); - return localVarResp.getData(); - } - - /** - * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit - * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. • When called, this endpoint may - * generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @return ApiResponse<PreviewAudience200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse previewAudienceWithHttpInfo( - String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { - okhttp3.Call localVarCall = - previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Audience Preview Created` event in the - * [audit trail](/tag/Audit-Trail). - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call previewAudienceAsync( - String spaceId, - PreviewAudienceInput previewAudienceInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for removeAudienceFromSpace * diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java new file mode 100644 index 00000000..d982756c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -0,0 +1,348 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class AudiencePreview extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AudiencePreview.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCompletedAudiencePreview = + gson.getDelegateAdapter(this, TypeToken.get(CompletedAudiencePreview.class)); + final TypeAdapter adapterRunningAudiencePreview = + gson.getDelegateAdapter(this, TypeToken.get(RunningAudiencePreview.class)); + final TypeAdapter adapterFailedAudiencePreview = + gson.getDelegateAdapter(this, TypeToken.get(FailedAudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreview value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `CompletedAudiencePreview` + if (value.getActualInstance() instanceof CompletedAudiencePreview) { + JsonElement element = + adapterCompletedAudiencePreview.toJsonTree( + (CompletedAudiencePreview) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `RunningAudiencePreview` + if (value.getActualInstance() instanceof RunningAudiencePreview) { + JsonElement element = + adapterRunningAudiencePreview.toJsonTree( + (RunningAudiencePreview) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `FailedAudiencePreview` + if (value.getActualInstance() instanceof FailedAudiencePreview) { + JsonElement element = + adapterFailedAudiencePreview.toJsonTree( + (FailedAudiencePreview) value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " CompletedAudiencePreview, FailedAudiencePreview," + + " RunningAudiencePreview"); + } + + @Override + public AudiencePreview read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CompletedAudiencePreview + try { + // validate the JSON object to see if any exception is thrown + CompletedAudiencePreview.validateJsonElement(jsonElement); + actualAdapter = adapterCompletedAudiencePreview; + AudiencePreview ret = new AudiencePreview(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for CompletedAudiencePreview" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'CompletedAudiencePreview'", + e); + } + // deserialize RunningAudiencePreview + try { + // validate the JSON object to see if any exception is thrown + RunningAudiencePreview.validateJsonElement(jsonElement); + actualAdapter = adapterRunningAudiencePreview; + AudiencePreview ret = new AudiencePreview(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for RunningAudiencePreview failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'RunningAudiencePreview'", + e); + } + // deserialize FailedAudiencePreview + try { + // validate the JSON object to see if any exception is thrown + FailedAudiencePreview.validateJsonElement(jsonElement); + actualAdapter = adapterFailedAudiencePreview; + AudiencePreview ret = new AudiencePreview(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for FailedAudiencePreview failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema 'FailedAudiencePreview'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for AudiencePreview: no class" + + " matches result, expected at least 1. Detailed" + + " failure message for anyOf schemas: %s. JSON:" + + " %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public AudiencePreview() { + super("anyOf", Boolean.FALSE); + } + + public AudiencePreview(CompletedAudiencePreview o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public AudiencePreview(FailedAudiencePreview o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public AudiencePreview(RunningAudiencePreview o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CompletedAudiencePreview", CompletedAudiencePreview.class); + schemas.put("RunningAudiencePreview", RunningAudiencePreview.class); + schemas.put("FailedAudiencePreview", FailedAudiencePreview.class); + } + + @Override + public Map> getSchemas() { + return AudiencePreview.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: CompletedAudiencePreview, FailedAudiencePreview, + * RunningAudiencePreview + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CompletedAudiencePreview) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RunningAudiencePreview) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof FailedAudiencePreview) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be CompletedAudiencePreview, FailedAudiencePreview," + + " RunningAudiencePreview"); + } + + /** + * Get the actual instance, which can be the following: CompletedAudiencePreview, + * FailedAudiencePreview, RunningAudiencePreview + * + * @return The actual instance (CompletedAudiencePreview, FailedAudiencePreview, + * RunningAudiencePreview) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CompletedAudiencePreview`. If the actual instance is not + * `CompletedAudiencePreview`, the ClassCastException will be thrown. + * + * @return The actual instance of `CompletedAudiencePreview` + * @throws ClassCastException if the instance is not `CompletedAudiencePreview` + */ + public CompletedAudiencePreview getCompletedAudiencePreview() throws ClassCastException { + return (CompletedAudiencePreview) super.getActualInstance(); + } + + /** + * Get the actual instance of `RunningAudiencePreview`. If the actual instance is not + * `RunningAudiencePreview`, the ClassCastException will be thrown. + * + * @return The actual instance of `RunningAudiencePreview` + * @throws ClassCastException if the instance is not `RunningAudiencePreview` + */ + public RunningAudiencePreview getRunningAudiencePreview() throws ClassCastException { + return (RunningAudiencePreview) super.getActualInstance(); + } + + /** + * Get the actual instance of `FailedAudiencePreview`. If the actual instance is not + * `FailedAudiencePreview`, the ClassCastException will be thrown. + * + * @return The actual instance of `FailedAudiencePreview` + * @throws ClassCastException if the instance is not `FailedAudiencePreview` + */ + public FailedAudiencePreview getFailedAudiencePreview() throws ClassCastException { + return (FailedAudiencePreview) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with CompletedAudiencePreview + try { + CompletedAudiencePreview.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for CompletedAudiencePreview failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with RunningAudiencePreview + try { + RunningAudiencePreview.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for RunningAudiencePreview failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with FailedAudiencePreview + try { + FailedAudiencePreview.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for FailedAudiencePreview failed with `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for AudiencePreview with anyOf schemas:" + + " CompletedAudiencePreview, FailedAudiencePreview," + + " RunningAudiencePreview. no class match the result, expected at" + + " least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of AudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreview + * @throws IOException if the JSON string is invalid with respect to AudiencePreview + */ + public static AudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreview.class); + } + + /** + * Convert an instance of AudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java similarity index 64% rename from src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java rename to src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java index fefc0eb9..5fadb72a 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java @@ -27,33 +27,33 @@ import java.util.Objects; import java.util.Set; -/** PreviewAudienceOutput */ -public class PreviewAudienceOutput { - public static final String SERIALIZED_NAME_PREVIEW = "preview"; +/** Identifier for an audience preview. */ +public class AudiencePreviewIdentifier { + public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_PREVIEW) - private Preview preview; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public PreviewAudienceOutput() {} + public AudiencePreviewIdentifier() {} - public PreviewAudienceOutput preview(Preview preview) { + public AudiencePreviewIdentifier id(String id) { - this.preview = preview; + this.id = id; return this; } /** - * Get preview + * Unique identifier for tracking and retrieving results of an audience preview. * - * @return preview + * @return id */ @javax.annotation.Nonnull - public Preview getPreview() { - return preview; + public String getId() { + return id; } - public void setPreview(Preview preview) { - this.preview = preview; + public void setId(String id) { + this.id = id; } @Override @@ -64,20 +64,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudienceOutput previewAudienceOutput = (PreviewAudienceOutput) o; - return Objects.equals(this.preview, previewAudienceOutput.preview); + AudiencePreviewIdentifier audiencePreviewIdentifier = (AudiencePreviewIdentifier) o; + return Objects.equals(this.id, audiencePreviewIdentifier.id); } @Override public int hashCode() { - return Objects.hash(preview); + return Objects.hash(id); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudienceOutput {\n"); - sb.append(" preview: ").append(toIndentedString(preview)).append("\n"); + sb.append("class AudiencePreviewIdentifier {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); } @@ -99,45 +99,45 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("preview"); + openapiFields.add("id"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("preview"); + openapiRequiredFields.add("id"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceOutput + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewIdentifier */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudienceOutput.openapiRequiredFields + if (!AudiencePreviewIdentifier.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudienceOutput is not found in" - + " the empty JSON string", - PreviewAudienceOutput.openapiRequiredFields.toString())); + "The required field(s) %s in AudiencePreviewIdentifier is not found" + + " in the empty JSON string", + AudiencePreviewIdentifier.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudienceOutput.openapiFields.contains(entry.getKey())) { + if (!AudiencePreviewIdentifier.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudienceOutput` properties. JSON: %s", + + " `AudiencePreviewIdentifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PreviewAudienceOutput.openapiRequiredFields) { + for (String requiredField : AudiencePreviewIdentifier.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -146,32 +146,38 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `preview` - Preview.validateJsonElement(jsonObj.get("preview")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudienceOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudienceOutput' and its subtypes + if (!AudiencePreviewIdentifier.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewIdentifier' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewIdentifier.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudienceOutput value) + public void write(JsonWriter out, AudiencePreviewIdentifier value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudienceOutput read(JsonReader in) throws IOException { + public AudiencePreviewIdentifier read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -181,18 +187,18 @@ public PreviewAudienceOutput read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudienceOutput given an JSON string + * Create an instance of AudiencePreviewIdentifier given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudienceOutput - * @throws IOException if the JSON string is invalid with respect to PreviewAudienceOutput + * @return An instance of AudiencePreviewIdentifier + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewIdentifier */ - public static PreviewAudienceOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudienceOutput.class); + public static AudiencePreviewIdentifier fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewIdentifier.class); } /** - * Convert an instance of PreviewAudienceOutput to an JSON string + * Convert an instance of AudiencePreviewIdentifier to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/Preview.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/Preview.java rename to src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java index a1b63f84..ce5cbfb0 100644 --- a/src/main/java/com/segment/publicapi/models/Preview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java @@ -27,23 +27,23 @@ import java.util.Objects; import java.util.Set; -/** Preview */ -public class Preview { +/** Result membership object for an audience preview. */ +public class AudiencePreviewResult { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; - public Preview() {} + public AudiencePreviewResult() {} - public Preview id(String id) { + public AudiencePreviewResult id(String id) { this.id = id; return this; } /** - * Unique identifier for tracking and retrieving results of the preview. + * Segment id or account id. * * @return id */ @@ -64,8 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Preview preview = (Preview) o; - return Objects.equals(this.id, preview.id); + AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; + return Objects.equals(this.id, audiencePreviewResult.id); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Preview {\n"); + sb.append("class AudiencePreviewResult {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,34 +110,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Preview + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Preview.openapiRequiredFields + if (!AudiencePreviewResult.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in Preview is not found in the empty JSON" - + " string", - Preview.openapiRequiredFields.toString())); + "The required field(s) %s in AudiencePreviewResult is not found in" + + " the empty JSON string", + AudiencePreviewResult.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!Preview.openapiFields.contains(entry.getKey())) { + if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( - "The field `%s` in the JSON string is not defined in the `Preview`" - + " properties. JSON: %s", + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Preview.openapiRequiredFields) { + for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -159,23 +159,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Preview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Preview' and its subtypes + if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewResult' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Preview.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, Preview value) throws IOException { + public void write(JsonWriter out, AudiencePreviewResult value) + throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public Preview read(JsonReader in) throws IOException { + public AudiencePreviewResult read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -185,18 +186,18 @@ public Preview read(JsonReader in) throws IOException { } /** - * Create an instance of Preview given an JSON string + * Create an instance of AudiencePreviewResult given an JSON string * * @param jsonString JSON string - * @return An instance of Preview - * @throws IOException if the JSON string is invalid with respect to Preview + * @return An instance of AudiencePreviewResult + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewResult */ - public static Preview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Preview.class); + public static AudiencePreviewResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewResult.class); } /** - * Convert an instance of Preview to an JSON string + * Convert an instance of AudiencePreviewResult to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/AudienceSize.java b/src/main/java/com/segment/publicapi/models/AudienceSize.java new file mode 100644 index 00000000..51d2a3af --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSize.java @@ -0,0 +1,284 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSize */ +public class AudienceSize { + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + /** The unit type for the count(s) being returned. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceSize() {} + + public AudienceSize count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The total audience membership count. Refer to the type field to determine the unit for this + * field (profiles, accounts, etc). + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + public AudienceSize type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The unit type for the count(s) being returned. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSize audienceSize = (AudienceSize) o; + return Objects.equals(this.count, audienceSize.count) + && Objects.equals(this.type, audienceSize.type); + } + + @Override + public int hashCode() { + return Objects.hash(count, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSize {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("count"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSize + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSize.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSize is not found in the empty" + + " JSON string", + AudienceSize.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSize.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSize` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSize.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSize.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSize' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSize.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSize value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSize read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSize given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSize + * @throws IOException if the JSON string is invalid with respect to AudienceSize + */ + public static AudienceSize fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSize.class); + } + + /** + * Convert an instance of AudienceSize to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java b/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java new file mode 100644 index 00000000..b88798e5 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java @@ -0,0 +1,352 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Fields common to an audience preview regardless of the status. */ +public class CommonAudiencePreview { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public CommonAudiencePreview() {} + + public CommonAudiencePreview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CommonAudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public CommonAudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public CommonAudiencePreview options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommonAudiencePreview commonAudiencePreview = (CommonAudiencePreview) o; + return Objects.equals(this.id, commonAudiencePreview.id) + && Objects.equals(this.audienceType, commonAudiencePreview.audienceType) + && Objects.equals(this.definition, commonAudiencePreview.definition) + && Objects.equals(this.options, commonAudiencePreview.options); + } + + @Override + public int hashCode() { + return Objects.hash(id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommonAudiencePreview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommonAudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommonAudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CommonAudiencePreview is not found in" + + " the empty JSON string", + CommonAudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CommonAudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CommonAudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommonAudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommonAudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommonAudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CommonAudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CommonAudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommonAudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CommonAudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommonAudiencePreview + * @throws IOException if the JSON string is invalid with respect to CommonAudiencePreview + */ + public static CommonAudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommonAudiencePreview.class); + } + + /** + * Convert an instance of CommonAudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java b/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java new file mode 100644 index 00000000..b9ca00b8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java @@ -0,0 +1,519 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Audience preview that has been completed. */ +public class CompletedAudiencePreview { + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + COMPLETED("COMPLETED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public CompletedAudiencePreview() {} + + public CompletedAudiencePreview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public CompletedAudiencePreview results(List results) { + + this.results = results; + return this; + } + + public CompletedAudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Sampled result membership for the audience preview. + * + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public CompletedAudiencePreview size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nonnull + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + + public CompletedAudiencePreview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CompletedAudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public CompletedAudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public CompletedAudiencePreview options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompletedAudiencePreview completedAudiencePreview = (CompletedAudiencePreview) o; + return Objects.equals(this.status, completedAudiencePreview.status) + && Objects.equals(this.results, completedAudiencePreview.results) + && Objects.equals(this.size, completedAudiencePreview.size) + && Objects.equals(this.id, completedAudiencePreview.id) + && Objects.equals(this.audienceType, completedAudiencePreview.audienceType) + && Objects.equals(this.definition, completedAudiencePreview.definition) + && Objects.equals(this.options, completedAudiencePreview.options); + } + + @Override + public int hashCode() { + return Objects.hash(status, results, size, id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompletedAudiencePreview {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("results"); + openapiFields.add("size"); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("results"); + openapiRequiredFields.add("size"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CompletedAudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CompletedAudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CompletedAudiencePreview is not found" + + " in the empty JSON string", + CompletedAudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CompletedAudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CompletedAudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CompletedAudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `results` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); + } + ; + // validate the required field `size` + AudienceSize.validateJsonElement(jsonObj.get("size")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CompletedAudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CompletedAudiencePreview' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(CompletedAudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CompletedAudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CompletedAudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CompletedAudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of CompletedAudiencePreview + * @throws IOException if the JSON string is invalid with respect to CompletedAudiencePreview + */ + public static CompletedAudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CompletedAudiencePreview.class); + } + + /** + * Convert an instance of CompletedAudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java new file mode 100644 index 00000000..bdbd349b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateAudiencePreview200Response */ +public class CreateAudiencePreview200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateAudiencePreviewAlphaOutput data; + + public CreateAudiencePreview200Response() {} + + public CreateAudiencePreview200Response data(CreateAudiencePreviewAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateAudiencePreviewAlphaOutput getData() { + return data; + } + + public void setData(CreateAudiencePreviewAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreview200Response createAudiencePreview200Response = + (CreateAudiencePreview200Response) o; + return Objects.equals(this.data, createAudiencePreview200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreview200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreview200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreview200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreview200Response is" + + " not found in the empty JSON string", + CreateAudiencePreview200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreview200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreview200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreview200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreview200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreview200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreview200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreview200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreview200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreview200Response + */ + public static CreateAudiencePreview200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreview200Response.class); + } + + /** + * Convert an instance of CreateAudiencePreview200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java similarity index 77% rename from src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java rename to src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index b38d1ddf..54bc5b54 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -28,8 +28,8 @@ import java.util.Objects; import java.util.Set; -/** Input to preview an audience. */ -public class PreviewAudienceInput { +/** Input to create an audience preview. */ +public class CreateAudiencePreviewAlphaInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) @@ -91,9 +91,9 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OPTIONS) private AudienceOptionsWithLookback options; - public PreviewAudienceInput() {} + public CreateAudiencePreviewAlphaInput() {} - public PreviewAudienceInput definition(AudienceDefinitionWithoutType definition) { + public CreateAudiencePreviewAlphaInput definition(AudienceDefinitionWithoutType definition) { this.definition = definition; return this; @@ -113,7 +113,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public PreviewAudienceInput audienceType(AudienceTypeEnum audienceType) { + public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; return this; @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public PreviewAudienceInput options(AudienceOptionsWithLookback options) { + public CreateAudiencePreviewAlphaInput options(AudienceOptionsWithLookback options) { this.options = options; return this; @@ -161,10 +161,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudienceInput previewAudienceInput = (PreviewAudienceInput) o; - return Objects.equals(this.definition, previewAudienceInput.definition) - && Objects.equals(this.audienceType, previewAudienceInput.audienceType) - && Objects.equals(this.options, previewAudienceInput.options); + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = + (CreateAudiencePreviewAlphaInput) o; + return Objects.equals(this.definition, createAudiencePreviewAlphaInput.definition) + && Objects.equals(this.audienceType, createAudiencePreviewAlphaInput.audienceType) + && Objects.equals(this.options, createAudiencePreviewAlphaInput.options); } @Override @@ -175,7 +176,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudienceInput {\n"); + sb.append("class CreateAudiencePreviewAlphaInput {\n"); sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); @@ -214,34 +215,35 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceInput + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewAlphaInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudienceInput.openapiRequiredFields + if (!CreateAudiencePreviewAlphaInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudienceInput is not found in" - + " the empty JSON string", - PreviewAudienceInput.openapiRequiredFields.toString())); + "The required field(s) %s in CreateAudiencePreviewAlphaInput is not" + + " found in the empty JSON string", + CreateAudiencePreviewAlphaInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudienceInput.openapiFields.contains(entry.getKey())) { + if (!CreateAudiencePreviewAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudienceInput` properties. JSON: %s", + + " `CreateAudiencePreviewAlphaInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PreviewAudienceInput.openapiRequiredFields) { + for (String requiredField : CreateAudiencePreviewAlphaInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -269,24 +271,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudienceInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudienceInput' and its subtypes + if (!CreateAudiencePreviewAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewAlphaInput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewAlphaInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudienceInput value) + public void write(JsonWriter out, CreateAudiencePreviewAlphaInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudienceInput read(JsonReader in) throws IOException { + public CreateAudiencePreviewAlphaInput read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -296,18 +301,19 @@ public PreviewAudienceInput read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudienceInput given an JSON string + * Create an instance of CreateAudiencePreviewAlphaInput given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudienceInput - * @throws IOException if the JSON string is invalid with respect to PreviewAudienceInput + * @return An instance of CreateAudiencePreviewAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewAlphaInput */ - public static PreviewAudienceInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudienceInput.class); + public static CreateAudiencePreviewAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaInput.class); } /** - * Convert an instance of PreviewAudienceInput to an JSON string + * Convert an instance of CreateAudiencePreviewAlphaInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java new file mode 100644 index 00000000..efae7afe --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output when creating an audience preview. */ +public class CreateAudiencePreviewAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) + private AudiencePreviewIdentifier audiencePreview; + + public CreateAudiencePreviewAlphaOutput() {} + + public CreateAudiencePreviewAlphaOutput audiencePreview( + AudiencePreviewIdentifier audiencePreview) { + + this.audiencePreview = audiencePreview; + return this; + } + + /** + * Get audiencePreview + * + * @return audiencePreview + */ + @javax.annotation.Nonnull + public AudiencePreviewIdentifier getAudiencePreview() { + return audiencePreview; + } + + public void setAudiencePreview(AudiencePreviewIdentifier audiencePreview) { + this.audiencePreview = audiencePreview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreviewAlphaOutput createAudiencePreviewAlphaOutput = + (CreateAudiencePreviewAlphaOutput) o; + return Objects.equals( + this.audiencePreview, createAudiencePreviewAlphaOutput.audiencePreview); + } + + @Override + public int hashCode() { + return Objects.hash(audiencePreview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreviewAlphaOutput {\n"); + sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiencePreview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiencePreview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreviewAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreviewAlphaOutput is" + + " not found in the empty JSON string", + CreateAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreviewAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAudiencePreviewAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audiencePreview` + AudiencePreviewIdentifier.validateJsonElement(jsonObj.get("audiencePreview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreviewAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreviewAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreviewAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreviewAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewAlphaOutput + */ + public static CreateAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaOutput.class); + } + + /** + * Convert an instance of CreateAudiencePreviewAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java b/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java new file mode 100644 index 00000000..b179b84a --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java @@ -0,0 +1,468 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** FailedAudiencePreview */ +public class FailedAudiencePreview { + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + FAILED("FAILED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; + + @SerializedName(SERIALIZED_NAME_FAILURE_REASON) + private String failureReason; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public FailedAudiencePreview() {} + + public FailedAudiencePreview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public FailedAudiencePreview failureReason(String failureReason) { + + this.failureReason = failureReason; + return this; + } + + /** + * Explanation of why the audience preview failed, if available. + * + * @return failureReason + */ + @javax.annotation.Nullable + public String getFailureReason() { + return failureReason; + } + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + public FailedAudiencePreview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FailedAudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public FailedAudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public FailedAudiencePreview options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FailedAudiencePreview failedAudiencePreview = (FailedAudiencePreview) o; + return Objects.equals(this.status, failedAudiencePreview.status) + && Objects.equals(this.failureReason, failedAudiencePreview.failureReason) + && Objects.equals(this.id, failedAudiencePreview.id) + && Objects.equals(this.audienceType, failedAudiencePreview.audienceType) + && Objects.equals(this.definition, failedAudiencePreview.definition) + && Objects.equals(this.options, failedAudiencePreview.options); + } + + @Override + public int hashCode() { + return Objects.hash(status, failureReason, id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FailedAudiencePreview {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("failureReason"); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FailedAudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FailedAudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in FailedAudiencePreview is not found in" + + " the empty JSON string", + FailedAudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FailedAudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `FailedAudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FailedAudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) + && !jsonObj.get("failureReason").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `failureReason` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("failureReason").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FailedAudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FailedAudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(FailedAudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, FailedAudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FailedAudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of FailedAudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of FailedAudiencePreview + * @throws IOException if the JSON string is invalid with respect to FailedAudiencePreview + */ + public static FailedAudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FailedAudiencePreview.class); + } + + /** + * Convert an instance of FailedAudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java similarity index 69% rename from src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java rename to src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java index da007f6e..e5b85f5b 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** PreviewAudience200Response */ -public class PreviewAudience200Response { +/** GetAudiencePreview200Response */ +public class GetAudiencePreview200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private PreviewAudienceOutput data; + private GetAudiencePreviewAlphaOutput data; - public PreviewAudience200Response() {} + public GetAudiencePreview200Response() {} - public PreviewAudience200Response data(PreviewAudienceOutput data) { + public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public PreviewAudience200Response data(PreviewAudienceOutput data) { * @return data */ @javax.annotation.Nullable - public PreviewAudienceOutput getData() { + public GetAudiencePreviewAlphaOutput getData() { return data; } - public void setData(PreviewAudienceOutput data) { + public void setData(GetAudiencePreviewAlphaOutput data) { this.data = data; } @@ -64,8 +64,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudience200Response previewAudience200Response = (PreviewAudience200Response) o; - return Objects.equals(this.data, previewAudience200Response.data); + GetAudiencePreview200Response getAudiencePreview200Response = + (GetAudiencePreview200Response) o; + return Objects.equals(this.data, getAudiencePreview200Response.data); } @Override @@ -76,7 +77,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudience200Response {\n"); + sb.append("class GetAudiencePreview200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -109,35 +110,36 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudience200Response + * @throws IOException if the JSON Element is invalid with respect to + * GetAudiencePreview200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudience200Response.openapiRequiredFields + if (!GetAudiencePreview200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudience200Response is not" + "The required field(s) %s in GetAudiencePreview200Response is not" + " found in the empty JSON string", - PreviewAudience200Response.openapiRequiredFields.toString())); + GetAudiencePreview200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudience200Response.openapiFields.contains(entry.getKey())) { + if (!GetAudiencePreview200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudience200Response` properties. JSON: %s", + + " `GetAudiencePreview200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - PreviewAudienceOutput.validateJsonElement(jsonObj.get("data")); + GetAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); } } @@ -145,25 +147,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudience200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudience200Response' and its + if (!GetAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudiencePreview200Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudience200Response.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAudiencePreview200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudience200Response value) + public void write(JsonWriter out, GetAudiencePreview200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudience200Response read(JsonReader in) throws IOException { + public GetAudiencePreview200Response read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -173,18 +177,19 @@ public PreviewAudience200Response read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudience200Response given an JSON string + * Create an instance of GetAudiencePreview200Response given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudience200Response - * @throws IOException if the JSON string is invalid with respect to PreviewAudience200Response + * @return An instance of GetAudiencePreview200Response + * @throws IOException if the JSON string is invalid with respect to + * GetAudiencePreview200Response */ - public static PreviewAudience200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudience200Response.class); + public static GetAudiencePreview200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudiencePreview200Response.class); } /** - * Convert an instance of PreviewAudience200Response to an JSON string + * Convert an instance of GetAudiencePreview200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java new file mode 100644 index 00000000..91363b74 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java @@ -0,0 +1,208 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output when reading an audience preview. */ +public class GetAudiencePreviewAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) + private AudiencePreview audiencePreview; + + public GetAudiencePreviewAlphaOutput() {} + + public GetAudiencePreviewAlphaOutput audiencePreview(AudiencePreview audiencePreview) { + + this.audiencePreview = audiencePreview; + return this; + } + + /** + * Get audiencePreview + * + * @return audiencePreview + */ + @javax.annotation.Nonnull + public AudiencePreview getAudiencePreview() { + return audiencePreview; + } + + public void setAudiencePreview(AudiencePreview audiencePreview) { + this.audiencePreview = audiencePreview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudiencePreviewAlphaOutput getAudiencePreviewAlphaOutput = + (GetAudiencePreviewAlphaOutput) o; + return Objects.equals(this.audiencePreview, getAudiencePreviewAlphaOutput.audiencePreview); + } + + @Override + public int hashCode() { + return Objects.hash(audiencePreview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudiencePreviewAlphaOutput {\n"); + sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiencePreview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiencePreview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudiencePreviewAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudiencePreviewAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudiencePreviewAlphaOutput is not" + + " found in the empty JSON string", + GetAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudiencePreviewAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAudiencePreviewAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audiencePreview` + AudiencePreview.validateJsonElement(jsonObj.get("audiencePreview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudiencePreviewAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAudiencePreviewAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudiencePreviewAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudiencePreviewAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudiencePreviewAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudiencePreviewAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetAudiencePreviewAlphaOutput + */ + public static GetAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudiencePreviewAlphaOutput.class); + } + + /** + * Convert an instance of GetAudiencePreviewAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java b/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java new file mode 100644 index 00000000..5cffb88e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java @@ -0,0 +1,432 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Audience preview that is currently being calculated. */ +public class RunningAudiencePreview { + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + RUNNING("RUNNING"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudienceOptionsWithLookback options; + + public RunningAudiencePreview() {} + + public RunningAudiencePreview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public RunningAudiencePreview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RunningAudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public RunningAudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public RunningAudiencePreview options(AudienceOptionsWithLookback options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudienceOptionsWithLookback getOptions() { + return options; + } + + public void setOptions(AudienceOptionsWithLookback options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunningAudiencePreview runningAudiencePreview = (RunningAudiencePreview) o; + return Objects.equals(this.status, runningAudiencePreview.status) + && Objects.equals(this.id, runningAudiencePreview.id) + && Objects.equals(this.audienceType, runningAudiencePreview.audienceType) + && Objects.equals(this.definition, runningAudiencePreview.definition) + && Objects.equals(this.options, runningAudiencePreview.options); + } + + @Override + public int hashCode() { + return Objects.hash(status, id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunningAudiencePreview {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RunningAudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RunningAudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RunningAudiencePreview is not found in" + + " the empty JSON string", + RunningAudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RunningAudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RunningAudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunningAudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunningAudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunningAudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(RunningAudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RunningAudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunningAudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RunningAudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunningAudiencePreview + * @throws IOException if the JSON string is invalid with respect to RunningAudiencePreview + */ + public static RunningAudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunningAudiencePreview.class); + } + + /** + * Convert an instance of RunningAudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From b757d408372693373e997871990f1e14a4831a2d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 11 Jun 2025 16:43:35 +0000 Subject: [PATCH 434/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@5b7ceb96. From 903aaad06d52ed281abc04f2232ed9ae98620770 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Jun 2025 15:44:26 +0000 Subject: [PATCH 435/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e3604bbd. --- docs/AudiencesApi.md | 2 +- src/main/java/com/segment/publicapi/JSON.java | 2 + .../segment/publicapi/api/AudiencesApi.java | 27 +- .../models/AudiencePreviewOptions.java | 250 ++++++++++++++++++ .../models/CommonAudiencePreview.java | 10 +- .../models/CompletedAudiencePreview.java | 10 +- .../CreateAudiencePreviewAlphaInput.java | 10 +- .../models/FailedAudiencePreview.java | 12 +- .../models/RunningAudiencePreview.java | 10 +- 9 files changed, 303 insertions(+), 30 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 901dfcb3..7eee68c2 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -96,7 +96,7 @@ public class Example { Create Audience Preview -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 8d1092af..a36f1bce 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -180,6 +180,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 64a2d6cc..56b7a765 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -394,7 +394,14 @@ private okhttp3.Call createAudiencePreviewValidateBeforeCall( * call this endpoint, the specified Workspace needs to have the Audience feature enabled. * Please reach out to your customer success manager for more information. • When called, this * endpoint may generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param createAudiencePreviewAlphaInput (required) @@ -424,7 +431,14 @@ public CreateAudiencePreview200Response createAudiencePreview( * call this endpoint, the specified Workspace needs to have the Audience feature enabled. * Please reach out to your customer success manager for more information. • When called, this * endpoint may generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param createAudiencePreviewAlphaInput (required) @@ -456,7 +470,14 @@ public ApiResponse createAudiencePreviewWithHt * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. • When * called, this endpoint may generate the `Audience Preview Created` event in the - * [audit trail](/tag/Audit-Trail). + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for + * this endpoint is 700 requests per month per spaceId, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param createAudiencePreviewAlphaInput (required) diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java new file mode 100644 index 00000000..c697236b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java @@ -0,0 +1,250 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Options which should be applied when segmenting audience previews. */ +public class AudiencePreviewOptions { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds; + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public AudiencePreviewOptions() {} + + public AudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public AudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience preview membership. + * Profiles will only be considered for audience preview membership if the profile has at least + * one external id whose key matches a value in this set. If unspecified, a default set of + * external identifiers will be used: `['user_id', 'email', + * 'android.idfa', 'ios.idfa']`. + * + * @return filterByExternalIds + */ + @javax.annotation.Nullable + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public AudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days (specified from the date + * the audience preview was created) that event data will be included from when determining + * audience preview membership. If unspecified, event data will not be included when determining + * audience preview membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewOptions audiencePreviewOptions = (AudiencePreviewOptions) o; + return Objects.equals(this.filterByExternalIds, audiencePreviewOptions.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, audiencePreviewOptions.backfillEventDataDays); + } + + @Override + public int hashCode() { + return Objects.hash(filterByExternalIds, backfillEventDataDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewOptions {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewOptions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewOptions is not found in" + + " the empty JSON string", + AudiencePreviewOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewOptions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("filterByExternalIds") != null + && !jsonObj.get("filterByExternalIds").isJsonNull() + && !jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewOptions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewOptions value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewOptions + */ + public static AudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewOptions.class); + } + + /** + * Convert an instance of AudiencePreviewOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java b/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java index b88798e5..7d340073 100644 --- a/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java @@ -94,7 +94,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private AudiencePreviewOptions options; public CommonAudiencePreview() {} @@ -158,7 +158,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public CommonAudiencePreview options(AudienceOptionsWithLookback options) { + public CommonAudiencePreview options(AudiencePreviewOptions options) { this.options = options; return this; @@ -170,11 +170,11 @@ public CommonAudiencePreview options(AudienceOptionsWithLookback options) { * @return options */ @javax.annotation.Nonnull - public AudienceOptionsWithLookback getOptions() { + public AudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(AudiencePreviewOptions options) { this.options = options; } @@ -297,7 +297,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the required field `definition` AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); // validate the required field `options` - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java b/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java index b9ca00b8..9149e311 100644 --- a/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java @@ -156,7 +156,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private AudiencePreviewOptions options; public CompletedAudiencePreview() {} @@ -288,7 +288,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public CompletedAudiencePreview options(AudienceOptionsWithLookback options) { + public CompletedAudiencePreview options(AudiencePreviewOptions options) { this.options = options; return this; @@ -300,11 +300,11 @@ public CompletedAudiencePreview options(AudienceOptionsWithLookback options) { * @return options */ @javax.annotation.Nonnull - public AudienceOptionsWithLookback getOptions() { + public AudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(AudiencePreviewOptions options) { this.options = options; } @@ -463,7 +463,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the required field `definition` AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); // validate the required field `options` - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index 54bc5b54..71e4759a 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -89,7 +89,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private AudiencePreviewOptions options; public CreateAudiencePreviewAlphaInput() {} @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public CreateAudiencePreviewAlphaInput options(AudienceOptionsWithLookback options) { + public CreateAudiencePreviewAlphaInput options(AudiencePreviewOptions options) { this.options = options; return this; @@ -145,11 +145,11 @@ public CreateAudiencePreviewAlphaInput options(AudienceOptionsWithLookback optio * @return options */ @javax.annotation.Nullable - public AudienceOptionsWithLookback getOptions() { + public AudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(AudiencePreviewOptions options) { this.options = options; } @@ -263,7 +263,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } } diff --git a/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java b/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java index b179b84a..12b6d355 100644 --- a/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java @@ -28,7 +28,7 @@ import java.util.Objects; import java.util.Set; -/** FailedAudiencePreview */ +/** Audience preview that has failed to calculate. */ public class FailedAudiencePreview { /** Status for the audience preview. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -148,7 +148,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private AudiencePreviewOptions options; public FailedAudiencePreview() {} @@ -252,7 +252,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public FailedAudiencePreview options(AudienceOptionsWithLookback options) { + public FailedAudiencePreview options(AudiencePreviewOptions options) { this.options = options; return this; @@ -264,11 +264,11 @@ public FailedAudiencePreview options(AudienceOptionsWithLookback options) { * @return options */ @javax.annotation.Nonnull - public AudienceOptionsWithLookback getOptions() { + public AudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(AudiencePreviewOptions options) { this.options = options; } @@ -413,7 +413,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the required field `definition` AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); // validate the required field `options` - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java b/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java index 5cffb88e..0514c3eb 100644 --- a/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java @@ -143,7 +143,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private AudiencePreviewOptions options; public RunningAudiencePreview() {} @@ -227,7 +227,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public RunningAudiencePreview options(AudienceOptionsWithLookback options) { + public RunningAudiencePreview options(AudiencePreviewOptions options) { this.options = options; return this; @@ -239,11 +239,11 @@ public RunningAudiencePreview options(AudienceOptionsWithLookback options) { * @return options */ @javax.annotation.Nonnull - public AudienceOptionsWithLookback getOptions() { + public AudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(AudiencePreviewOptions options) { this.options = options; } @@ -377,7 +377,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the required field `definition` AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); // validate the required field `options` - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { From c0b374bf59f7a41a5c3dcaadef037e903a250b3b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Jun 2025 16:03:30 +0000 Subject: [PATCH 436/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@3ec34db8. From 1b91b4bc23a2a6489914f872f1fc6480cb86dfee Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Jun 2025 16:14:52 +0000 Subject: [PATCH 437/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4b4b2a71. From a9ca1fb78e73880463b6e48fae1e2bc0fc958450 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Jun 2025 16:18:32 +0000 Subject: [PATCH 438/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@6c231341. --- src/main/java/com/segment/publicapi/JSON.java | 6 + .../publicapi/models/AudiencePreview.java | 169 +++--- .../models/AudiencePreviewAnyOf.java | 518 ++++++++++++++++++ .../models/AudiencePreviewAnyOf1.java | 432 +++++++++++++++ .../models/AudiencePreviewAnyOf2.java | 468 ++++++++++++++++ 5 files changed, 1507 insertions(+), 86 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index a36f1bce..d9c3ea78 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -177,6 +177,12 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewAnyOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewAnyOf1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewAnyOf2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index d982756c..2405ed0a 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -37,12 +37,12 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'AudiencePreview' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterCompletedAudiencePreview = - gson.getDelegateAdapter(this, TypeToken.get(CompletedAudiencePreview.class)); - final TypeAdapter adapterRunningAudiencePreview = - gson.getDelegateAdapter(this, TypeToken.get(RunningAudiencePreview.class)); - final TypeAdapter adapterFailedAudiencePreview = - gson.getDelegateAdapter(this, TypeToken.get(FailedAudiencePreview.class)); + final TypeAdapter adapterAudiencePreviewAnyOf = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf.class)); + final TypeAdapter adapterAudiencePreviewAnyOf1 = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf1.class)); + final TypeAdapter adapterAudiencePreviewAnyOf2 = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf2.class)); return (TypeAdapter) new TypeAdapter() { @@ -54,36 +54,34 @@ public void write(JsonWriter out, AudiencePreview value) return; } - // check if the actual instance is of the type - // `CompletedAudiencePreview` - if (value.getActualInstance() instanceof CompletedAudiencePreview) { + // check if the actual instance is of the type `AudiencePreviewAnyOf` + if (value.getActualInstance() instanceof AudiencePreviewAnyOf) { JsonElement element = - adapterCompletedAudiencePreview.toJsonTree( - (CompletedAudiencePreview) - value.getActualInstance()); + adapterAudiencePreviewAnyOf.toJsonTree( + (AudiencePreviewAnyOf) value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `RunningAudiencePreview` - if (value.getActualInstance() instanceof RunningAudiencePreview) { + // check if the actual instance is of the type `AudiencePreviewAnyOf1` + if (value.getActualInstance() instanceof AudiencePreviewAnyOf1) { JsonElement element = - adapterRunningAudiencePreview.toJsonTree( - (RunningAudiencePreview) value.getActualInstance()); + adapterAudiencePreviewAnyOf1.toJsonTree( + (AudiencePreviewAnyOf1) value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `FailedAudiencePreview` - if (value.getActualInstance() instanceof FailedAudiencePreview) { + // check if the actual instance is of the type `AudiencePreviewAnyOf2` + if (value.getActualInstance() instanceof AudiencePreviewAnyOf2) { JsonElement element = - adapterFailedAudiencePreview.toJsonTree( - (FailedAudiencePreview) value.getActualInstance()); + adapterAudiencePreviewAnyOf2.toJsonTree( + (AudiencePreviewAnyOf2) value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " CompletedAudiencePreview, FailedAudiencePreview," - + " RunningAudiencePreview"); + + " AudiencePreviewAnyOf, AudiencePreviewAnyOf1," + + " AudiencePreviewAnyOf2"); } @Override @@ -94,11 +92,11 @@ public AudiencePreview read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize CompletedAudiencePreview + // deserialize AudiencePreviewAnyOf try { // validate the JSON object to see if any exception is thrown - CompletedAudiencePreview.validateJsonElement(jsonElement); - actualAdapter = adapterCompletedAudiencePreview; + AudiencePreviewAnyOf.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewAnyOf; AudiencePreview ret = new AudiencePreview(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -106,20 +104,19 @@ public AudiencePreview read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for CompletedAudiencePreview" - + " failed with `%s`.", + "Deserialization for AudiencePreviewAnyOf failed" + + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema" - + " 'CompletedAudiencePreview'", + "Input data does not match schema 'AudiencePreviewAnyOf'", e); } - // deserialize RunningAudiencePreview + // deserialize AudiencePreviewAnyOf1 try { // validate the JSON object to see if any exception is thrown - RunningAudiencePreview.validateJsonElement(jsonElement); - actualAdapter = adapterRunningAudiencePreview; + AudiencePreviewAnyOf1.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewAnyOf1; AudiencePreview ret = new AudiencePreview(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -127,19 +124,19 @@ public AudiencePreview read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for RunningAudiencePreview failed" + "Deserialization for AudiencePreviewAnyOf1 failed" + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'RunningAudiencePreview'", + "Input data does not match schema 'AudiencePreviewAnyOf1'", e); } - // deserialize FailedAudiencePreview + // deserialize AudiencePreviewAnyOf2 try { // validate the JSON object to see if any exception is thrown - FailedAudiencePreview.validateJsonElement(jsonElement); - actualAdapter = adapterFailedAudiencePreview; + AudiencePreviewAnyOf2.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewAnyOf2; AudiencePreview ret = new AudiencePreview(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -147,12 +144,12 @@ public AudiencePreview read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for FailedAudiencePreview failed" + "Deserialization for AudiencePreviewAnyOf2 failed" + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'FailedAudiencePreview'", + "Input data does not match schema 'AudiencePreviewAnyOf2'", e); } @@ -175,25 +172,25 @@ public AudiencePreview() { super("anyOf", Boolean.FALSE); } - public AudiencePreview(CompletedAudiencePreview o) { + public AudiencePreview(AudiencePreviewAnyOf o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public AudiencePreview(FailedAudiencePreview o) { + public AudiencePreview(AudiencePreviewAnyOf1 o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public AudiencePreview(RunningAudiencePreview o) { + public AudiencePreview(AudiencePreviewAnyOf2 o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("CompletedAudiencePreview", CompletedAudiencePreview.class); - schemas.put("RunningAudiencePreview", RunningAudiencePreview.class); - schemas.put("FailedAudiencePreview", FailedAudiencePreview.class); + schemas.put("AudiencePreviewAnyOf", AudiencePreviewAnyOf.class); + schemas.put("AudiencePreviewAnyOf1", AudiencePreviewAnyOf1.class); + schemas.put("AudiencePreviewAnyOf2", AudiencePreviewAnyOf2.class); } @Override @@ -203,39 +200,39 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: CompletedAudiencePreview, FailedAudiencePreview, - * RunningAudiencePreview + * against the anyOf child schemas: AudiencePreviewAnyOf, AudiencePreviewAnyOf1, + * AudiencePreviewAnyOf2 * *

It could be an instance of the 'anyOf' schemas. */ @Override public void setActualInstance(Object instance) { - if (instance instanceof CompletedAudiencePreview) { + if (instance instanceof AudiencePreviewAnyOf) { super.setActualInstance(instance); return; } - if (instance instanceof RunningAudiencePreview) { + if (instance instanceof AudiencePreviewAnyOf1) { super.setActualInstance(instance); return; } - if (instance instanceof FailedAudiencePreview) { + if (instance instanceof AudiencePreviewAnyOf2) { super.setActualInstance(instance); return; } throw new RuntimeException( - "Invalid instance type. Must be CompletedAudiencePreview, FailedAudiencePreview," - + " RunningAudiencePreview"); + "Invalid instance type. Must be AudiencePreviewAnyOf, AudiencePreviewAnyOf1," + + " AudiencePreviewAnyOf2"); } /** - * Get the actual instance, which can be the following: CompletedAudiencePreview, - * FailedAudiencePreview, RunningAudiencePreview + * Get the actual instance, which can be the following: AudiencePreviewAnyOf, + * AudiencePreviewAnyOf1, AudiencePreviewAnyOf2 * - * @return The actual instance (CompletedAudiencePreview, FailedAudiencePreview, - * RunningAudiencePreview) + * @return The actual instance (AudiencePreviewAnyOf, AudiencePreviewAnyOf1, + * AudiencePreviewAnyOf2) */ @Override public Object getActualInstance() { @@ -243,36 +240,36 @@ public Object getActualInstance() { } /** - * Get the actual instance of `CompletedAudiencePreview`. If the actual instance is not - * `CompletedAudiencePreview`, the ClassCastException will be thrown. + * Get the actual instance of `AudiencePreviewAnyOf`. If the actual instance is not + * `AudiencePreviewAnyOf`, the ClassCastException will be thrown. * - * @return The actual instance of `CompletedAudiencePreview` - * @throws ClassCastException if the instance is not `CompletedAudiencePreview` + * @return The actual instance of `AudiencePreviewAnyOf` + * @throws ClassCastException if the instance is not `AudiencePreviewAnyOf` */ - public CompletedAudiencePreview getCompletedAudiencePreview() throws ClassCastException { - return (CompletedAudiencePreview) super.getActualInstance(); + public AudiencePreviewAnyOf getAudiencePreviewAnyOf() throws ClassCastException { + return (AudiencePreviewAnyOf) super.getActualInstance(); } /** - * Get the actual instance of `RunningAudiencePreview`. If the actual instance is not - * `RunningAudiencePreview`, the ClassCastException will be thrown. + * Get the actual instance of `AudiencePreviewAnyOf1`. If the actual instance is not + * `AudiencePreviewAnyOf1`, the ClassCastException will be thrown. * - * @return The actual instance of `RunningAudiencePreview` - * @throws ClassCastException if the instance is not `RunningAudiencePreview` + * @return The actual instance of `AudiencePreviewAnyOf1` + * @throws ClassCastException if the instance is not `AudiencePreviewAnyOf1` */ - public RunningAudiencePreview getRunningAudiencePreview() throws ClassCastException { - return (RunningAudiencePreview) super.getActualInstance(); + public AudiencePreviewAnyOf1 getAudiencePreviewAnyOf1() throws ClassCastException { + return (AudiencePreviewAnyOf1) super.getActualInstance(); } /** - * Get the actual instance of `FailedAudiencePreview`. If the actual instance is not - * `FailedAudiencePreview`, the ClassCastException will be thrown. + * Get the actual instance of `AudiencePreviewAnyOf2`. If the actual instance is not + * `AudiencePreviewAnyOf2`, the ClassCastException will be thrown. * - * @return The actual instance of `FailedAudiencePreview` - * @throws ClassCastException if the instance is not `FailedAudiencePreview` + * @return The actual instance of `AudiencePreviewAnyOf2` + * @throws ClassCastException if the instance is not `AudiencePreviewAnyOf2` */ - public FailedAudiencePreview getFailedAudiencePreview() throws ClassCastException { - return (FailedAudiencePreview) super.getActualInstance(); + public AudiencePreviewAnyOf2 getAudiencePreviewAnyOf2() throws ClassCastException { + return (AudiencePreviewAnyOf2) super.getActualInstance(); } /** @@ -284,45 +281,45 @@ public FailedAudiencePreview getFailedAudiencePreview() throws ClassCastExceptio public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate anyOf schemas one by one ArrayList errorMessages = new ArrayList<>(); - // validate the json string with CompletedAudiencePreview + // validate the json string with AudiencePreviewAnyOf try { - CompletedAudiencePreview.validateJsonElement(jsonElement); + AudiencePreviewAnyOf.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for CompletedAudiencePreview failed with `%s`.", + "Deserialization for AudiencePreviewAnyOf failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with RunningAudiencePreview + // validate the json string with AudiencePreviewAnyOf1 try { - RunningAudiencePreview.validateJsonElement(jsonElement); + AudiencePreviewAnyOf1.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for RunningAudiencePreview failed with `%s`.", + "Deserialization for AudiencePreviewAnyOf1 failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with FailedAudiencePreview + // validate the json string with AudiencePreviewAnyOf2 try { - FailedAudiencePreview.validateJsonElement(jsonElement); + AudiencePreviewAnyOf2.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for FailedAudiencePreview failed with `%s`.", + "Deserialization for AudiencePreviewAnyOf2 failed with `%s`.", e.getMessage())); // continue to the next one } throw new IOException( String.format( "The JSON string is invalid for AudiencePreview with anyOf schemas:" - + " CompletedAudiencePreview, FailedAudiencePreview," - + " RunningAudiencePreview. no class match the result, expected at" - + " least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", + + " AudiencePreviewAnyOf, AudiencePreviewAnyOf1, AudiencePreviewAnyOf2." + + " no class match the result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); } diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java new file mode 100644 index 00000000..ea89bd59 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java @@ -0,0 +1,518 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudiencePreviewAnyOf */ +public class AudiencePreviewAnyOf { + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + COMPLETED("COMPLETED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudiencePreviewOptions options; + + public AudiencePreviewAnyOf() {} + + public AudiencePreviewAnyOf status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public AudiencePreviewAnyOf results(List results) { + + this.results = results; + return this; + } + + public AudiencePreviewAnyOf addResultsItem(AudiencePreviewResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Sampled result membership for the audience preview. + * + * @return results + */ + @javax.annotation.Nonnull + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public AudiencePreviewAnyOf size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nonnull + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + + public AudiencePreviewAnyOf id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreviewAnyOf audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudiencePreviewAnyOf definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public AudiencePreviewAnyOf options(AudiencePreviewOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudiencePreviewOptions getOptions() { + return options; + } + + public void setOptions(AudiencePreviewOptions options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewAnyOf audiencePreviewAnyOf = (AudiencePreviewAnyOf) o; + return Objects.equals(this.status, audiencePreviewAnyOf.status) + && Objects.equals(this.results, audiencePreviewAnyOf.results) + && Objects.equals(this.size, audiencePreviewAnyOf.size) + && Objects.equals(this.id, audiencePreviewAnyOf.id) + && Objects.equals(this.audienceType, audiencePreviewAnyOf.audienceType) + && Objects.equals(this.definition, audiencePreviewAnyOf.definition) + && Objects.equals(this.options, audiencePreviewAnyOf.options); + } + + @Override + public int hashCode() { + return Objects.hash(status, results, size, id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewAnyOf {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("results"); + openapiFields.add("size"); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("results"); + openapiRequiredFields.add("size"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewAnyOf + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewAnyOf.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewAnyOf is not found in" + + " the empty JSON string", + AudiencePreviewAnyOf.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewAnyOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewAnyOf` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewAnyOf.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `results` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("results").toString())); + } + + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + // validate the required field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); + } + ; + // validate the required field `size` + AudienceSize.validateJsonElement(jsonObj.get("size")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewAnyOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewAnyOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewAnyOf value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewAnyOf read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewAnyOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewAnyOf + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewAnyOf + */ + public static AudiencePreviewAnyOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewAnyOf.class); + } + + /** + * Convert an instance of AudiencePreviewAnyOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java new file mode 100644 index 00000000..210fb1ac --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java @@ -0,0 +1,432 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudiencePreviewAnyOf1 */ +public class AudiencePreviewAnyOf1 { + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + RUNNING("RUNNING"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudiencePreviewOptions options; + + public AudiencePreviewAnyOf1() {} + + public AudiencePreviewAnyOf1 status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public AudiencePreviewAnyOf1 id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreviewAnyOf1 audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudiencePreviewAnyOf1 definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public AudiencePreviewAnyOf1 options(AudiencePreviewOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudiencePreviewOptions getOptions() { + return options; + } + + public void setOptions(AudiencePreviewOptions options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewAnyOf1 audiencePreviewAnyOf1 = (AudiencePreviewAnyOf1) o; + return Objects.equals(this.status, audiencePreviewAnyOf1.status) + && Objects.equals(this.id, audiencePreviewAnyOf1.id) + && Objects.equals(this.audienceType, audiencePreviewAnyOf1.audienceType) + && Objects.equals(this.definition, audiencePreviewAnyOf1.definition) + && Objects.equals(this.options, audiencePreviewAnyOf1.options); + } + + @Override + public int hashCode() { + return Objects.hash(status, id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewAnyOf1 {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewAnyOf1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewAnyOf1.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewAnyOf1 is not found in" + + " the empty JSON string", + AudiencePreviewAnyOf1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewAnyOf1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewAnyOf1` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewAnyOf1.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewAnyOf1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewAnyOf1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf1.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewAnyOf1 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewAnyOf1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewAnyOf1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewAnyOf1 + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewAnyOf1 + */ + public static AudiencePreviewAnyOf1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewAnyOf1.class); + } + + /** + * Convert an instance of AudiencePreviewAnyOf1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java new file mode 100644 index 00000000..66650533 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java @@ -0,0 +1,468 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudiencePreviewAnyOf2 */ +public class AudiencePreviewAnyOf2 { + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + FAILED("FAILED"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; + + @SerializedName(SERIALIZED_NAME_FAILURE_REASON) + private String failureReason; + + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudiencePreviewOptions options; + + public AudiencePreviewAnyOf2() {} + + public AudiencePreviewAnyOf2 status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public AudiencePreviewAnyOf2 failureReason(String failureReason) { + + this.failureReason = failureReason; + return this; + } + + /** + * Explanation of why the audience preview failed, if available. + * + * @return failureReason + */ + @javax.annotation.Nullable + public String getFailureReason() { + return failureReason; + } + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + public AudiencePreviewAnyOf2 id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreviewAnyOf2 audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudiencePreviewAnyOf2 definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public AudiencePreviewAnyOf2 options(AudiencePreviewOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public AudiencePreviewOptions getOptions() { + return options; + } + + public void setOptions(AudiencePreviewOptions options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewAnyOf2 audiencePreviewAnyOf2 = (AudiencePreviewAnyOf2) o; + return Objects.equals(this.status, audiencePreviewAnyOf2.status) + && Objects.equals(this.failureReason, audiencePreviewAnyOf2.failureReason) + && Objects.equals(this.id, audiencePreviewAnyOf2.id) + && Objects.equals(this.audienceType, audiencePreviewAnyOf2.audienceType) + && Objects.equals(this.definition, audiencePreviewAnyOf2.definition) + && Objects.equals(this.options, audiencePreviewAnyOf2.options); + } + + @Override + public int hashCode() { + return Objects.hash(status, failureReason, id, audienceType, definition, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewAnyOf2 {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("failureReason"); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewAnyOf2 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewAnyOf2.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewAnyOf2 is not found in" + + " the empty JSON string", + AudiencePreviewAnyOf2.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewAnyOf2.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewAnyOf2` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewAnyOf2.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) + && !jsonObj.get("failureReason").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `failureReason` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("failureReason").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewAnyOf2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewAnyOf2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf2.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewAnyOf2 value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewAnyOf2 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewAnyOf2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewAnyOf2 + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewAnyOf2 + */ + public static AudiencePreviewAnyOf2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewAnyOf2.class); + } + + /** + * Convert an instance of AudiencePreviewAnyOf2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 7023cdd642f2c21bcc29fc7364a05f6eaaffe581 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Jun 2025 16:31:59 +0000 Subject: [PATCH 439/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@b5fc64f4. --- src/main/java/com/segment/publicapi/JSON.java | 6 - .../publicapi/models/AudiencePreview.java | 169 +++--- .../models/AudiencePreviewAnyOf.java | 518 ------------------ .../models/AudiencePreviewAnyOf1.java | 432 --------------- .../models/AudiencePreviewAnyOf2.java | 468 ---------------- 5 files changed, 86 insertions(+), 1507 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index d9c3ea78..a36f1bce 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -177,12 +177,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewAnyOf.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewAnyOf1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewAnyOf2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index 2405ed0a..d982756c 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -37,12 +37,12 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'AudiencePreview' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterAudiencePreviewAnyOf = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf.class)); - final TypeAdapter adapterAudiencePreviewAnyOf1 = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf1.class)); - final TypeAdapter adapterAudiencePreviewAnyOf2 = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf2.class)); + final TypeAdapter adapterCompletedAudiencePreview = + gson.getDelegateAdapter(this, TypeToken.get(CompletedAudiencePreview.class)); + final TypeAdapter adapterRunningAudiencePreview = + gson.getDelegateAdapter(this, TypeToken.get(RunningAudiencePreview.class)); + final TypeAdapter adapterFailedAudiencePreview = + gson.getDelegateAdapter(this, TypeToken.get(FailedAudiencePreview.class)); return (TypeAdapter) new TypeAdapter() { @@ -54,34 +54,36 @@ public void write(JsonWriter out, AudiencePreview value) return; } - // check if the actual instance is of the type `AudiencePreviewAnyOf` - if (value.getActualInstance() instanceof AudiencePreviewAnyOf) { + // check if the actual instance is of the type + // `CompletedAudiencePreview` + if (value.getActualInstance() instanceof CompletedAudiencePreview) { JsonElement element = - adapterAudiencePreviewAnyOf.toJsonTree( - (AudiencePreviewAnyOf) value.getActualInstance()); + adapterCompletedAudiencePreview.toJsonTree( + (CompletedAudiencePreview) + value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `AudiencePreviewAnyOf1` - if (value.getActualInstance() instanceof AudiencePreviewAnyOf1) { + // check if the actual instance is of the type `RunningAudiencePreview` + if (value.getActualInstance() instanceof RunningAudiencePreview) { JsonElement element = - adapterAudiencePreviewAnyOf1.toJsonTree( - (AudiencePreviewAnyOf1) value.getActualInstance()); + adapterRunningAudiencePreview.toJsonTree( + (RunningAudiencePreview) value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `AudiencePreviewAnyOf2` - if (value.getActualInstance() instanceof AudiencePreviewAnyOf2) { + // check if the actual instance is of the type `FailedAudiencePreview` + if (value.getActualInstance() instanceof FailedAudiencePreview) { JsonElement element = - adapterAudiencePreviewAnyOf2.toJsonTree( - (AudiencePreviewAnyOf2) value.getActualInstance()); + adapterFailedAudiencePreview.toJsonTree( + (FailedAudiencePreview) value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " AudiencePreviewAnyOf, AudiencePreviewAnyOf1," - + " AudiencePreviewAnyOf2"); + + " CompletedAudiencePreview, FailedAudiencePreview," + + " RunningAudiencePreview"); } @Override @@ -92,11 +94,11 @@ public AudiencePreview read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize AudiencePreviewAnyOf + // deserialize CompletedAudiencePreview try { // validate the JSON object to see if any exception is thrown - AudiencePreviewAnyOf.validateJsonElement(jsonElement); - actualAdapter = adapterAudiencePreviewAnyOf; + CompletedAudiencePreview.validateJsonElement(jsonElement); + actualAdapter = adapterCompletedAudiencePreview; AudiencePreview ret = new AudiencePreview(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -104,19 +106,20 @@ public AudiencePreview read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for AudiencePreviewAnyOf failed" - + " with `%s`.", + "Deserialization for CompletedAudiencePreview" + + " failed with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'AudiencePreviewAnyOf'", + "Input data does not match schema" + + " 'CompletedAudiencePreview'", e); } - // deserialize AudiencePreviewAnyOf1 + // deserialize RunningAudiencePreview try { // validate the JSON object to see if any exception is thrown - AudiencePreviewAnyOf1.validateJsonElement(jsonElement); - actualAdapter = adapterAudiencePreviewAnyOf1; + RunningAudiencePreview.validateJsonElement(jsonElement); + actualAdapter = adapterRunningAudiencePreview; AudiencePreview ret = new AudiencePreview(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -124,19 +127,19 @@ public AudiencePreview read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for AudiencePreviewAnyOf1 failed" + "Deserialization for RunningAudiencePreview failed" + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'AudiencePreviewAnyOf1'", + "Input data does not match schema 'RunningAudiencePreview'", e); } - // deserialize AudiencePreviewAnyOf2 + // deserialize FailedAudiencePreview try { // validate the JSON object to see if any exception is thrown - AudiencePreviewAnyOf2.validateJsonElement(jsonElement); - actualAdapter = adapterAudiencePreviewAnyOf2; + FailedAudiencePreview.validateJsonElement(jsonElement); + actualAdapter = adapterFailedAudiencePreview; AudiencePreview ret = new AudiencePreview(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -144,12 +147,12 @@ public AudiencePreview read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for AudiencePreviewAnyOf2 failed" + "Deserialization for FailedAudiencePreview failed" + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'AudiencePreviewAnyOf2'", + "Input data does not match schema 'FailedAudiencePreview'", e); } @@ -172,25 +175,25 @@ public AudiencePreview() { super("anyOf", Boolean.FALSE); } - public AudiencePreview(AudiencePreviewAnyOf o) { + public AudiencePreview(CompletedAudiencePreview o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public AudiencePreview(AudiencePreviewAnyOf1 o) { + public AudiencePreview(FailedAudiencePreview o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } - public AudiencePreview(AudiencePreviewAnyOf2 o) { + public AudiencePreview(RunningAudiencePreview o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } static { - schemas.put("AudiencePreviewAnyOf", AudiencePreviewAnyOf.class); - schemas.put("AudiencePreviewAnyOf1", AudiencePreviewAnyOf1.class); - schemas.put("AudiencePreviewAnyOf2", AudiencePreviewAnyOf2.class); + schemas.put("CompletedAudiencePreview", CompletedAudiencePreview.class); + schemas.put("RunningAudiencePreview", RunningAudiencePreview.class); + schemas.put("FailedAudiencePreview", FailedAudiencePreview.class); } @Override @@ -200,39 +203,39 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: AudiencePreviewAnyOf, AudiencePreviewAnyOf1, - * AudiencePreviewAnyOf2 + * against the anyOf child schemas: CompletedAudiencePreview, FailedAudiencePreview, + * RunningAudiencePreview * *

It could be an instance of the 'anyOf' schemas. */ @Override public void setActualInstance(Object instance) { - if (instance instanceof AudiencePreviewAnyOf) { + if (instance instanceof CompletedAudiencePreview) { super.setActualInstance(instance); return; } - if (instance instanceof AudiencePreviewAnyOf1) { + if (instance instanceof RunningAudiencePreview) { super.setActualInstance(instance); return; } - if (instance instanceof AudiencePreviewAnyOf2) { + if (instance instanceof FailedAudiencePreview) { super.setActualInstance(instance); return; } throw new RuntimeException( - "Invalid instance type. Must be AudiencePreviewAnyOf, AudiencePreviewAnyOf1," - + " AudiencePreviewAnyOf2"); + "Invalid instance type. Must be CompletedAudiencePreview, FailedAudiencePreview," + + " RunningAudiencePreview"); } /** - * Get the actual instance, which can be the following: AudiencePreviewAnyOf, - * AudiencePreviewAnyOf1, AudiencePreviewAnyOf2 + * Get the actual instance, which can be the following: CompletedAudiencePreview, + * FailedAudiencePreview, RunningAudiencePreview * - * @return The actual instance (AudiencePreviewAnyOf, AudiencePreviewAnyOf1, - * AudiencePreviewAnyOf2) + * @return The actual instance (CompletedAudiencePreview, FailedAudiencePreview, + * RunningAudiencePreview) */ @Override public Object getActualInstance() { @@ -240,36 +243,36 @@ public Object getActualInstance() { } /** - * Get the actual instance of `AudiencePreviewAnyOf`. If the actual instance is not - * `AudiencePreviewAnyOf`, the ClassCastException will be thrown. + * Get the actual instance of `CompletedAudiencePreview`. If the actual instance is not + * `CompletedAudiencePreview`, the ClassCastException will be thrown. * - * @return The actual instance of `AudiencePreviewAnyOf` - * @throws ClassCastException if the instance is not `AudiencePreviewAnyOf` + * @return The actual instance of `CompletedAudiencePreview` + * @throws ClassCastException if the instance is not `CompletedAudiencePreview` */ - public AudiencePreviewAnyOf getAudiencePreviewAnyOf() throws ClassCastException { - return (AudiencePreviewAnyOf) super.getActualInstance(); + public CompletedAudiencePreview getCompletedAudiencePreview() throws ClassCastException { + return (CompletedAudiencePreview) super.getActualInstance(); } /** - * Get the actual instance of `AudiencePreviewAnyOf1`. If the actual instance is not - * `AudiencePreviewAnyOf1`, the ClassCastException will be thrown. + * Get the actual instance of `RunningAudiencePreview`. If the actual instance is not + * `RunningAudiencePreview`, the ClassCastException will be thrown. * - * @return The actual instance of `AudiencePreviewAnyOf1` - * @throws ClassCastException if the instance is not `AudiencePreviewAnyOf1` + * @return The actual instance of `RunningAudiencePreview` + * @throws ClassCastException if the instance is not `RunningAudiencePreview` */ - public AudiencePreviewAnyOf1 getAudiencePreviewAnyOf1() throws ClassCastException { - return (AudiencePreviewAnyOf1) super.getActualInstance(); + public RunningAudiencePreview getRunningAudiencePreview() throws ClassCastException { + return (RunningAudiencePreview) super.getActualInstance(); } /** - * Get the actual instance of `AudiencePreviewAnyOf2`. If the actual instance is not - * `AudiencePreviewAnyOf2`, the ClassCastException will be thrown. + * Get the actual instance of `FailedAudiencePreview`. If the actual instance is not + * `FailedAudiencePreview`, the ClassCastException will be thrown. * - * @return The actual instance of `AudiencePreviewAnyOf2` - * @throws ClassCastException if the instance is not `AudiencePreviewAnyOf2` + * @return The actual instance of `FailedAudiencePreview` + * @throws ClassCastException if the instance is not `FailedAudiencePreview` */ - public AudiencePreviewAnyOf2 getAudiencePreviewAnyOf2() throws ClassCastException { - return (AudiencePreviewAnyOf2) super.getActualInstance(); + public FailedAudiencePreview getFailedAudiencePreview() throws ClassCastException { + return (FailedAudiencePreview) super.getActualInstance(); } /** @@ -281,45 +284,45 @@ public AudiencePreviewAnyOf2 getAudiencePreviewAnyOf2() throws ClassCastExceptio public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate anyOf schemas one by one ArrayList errorMessages = new ArrayList<>(); - // validate the json string with AudiencePreviewAnyOf + // validate the json string with CompletedAudiencePreview try { - AudiencePreviewAnyOf.validateJsonElement(jsonElement); + CompletedAudiencePreview.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for AudiencePreviewAnyOf failed with `%s`.", + "Deserialization for CompletedAudiencePreview failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with AudiencePreviewAnyOf1 + // validate the json string with RunningAudiencePreview try { - AudiencePreviewAnyOf1.validateJsonElement(jsonElement); + RunningAudiencePreview.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for AudiencePreviewAnyOf1 failed with `%s`.", + "Deserialization for RunningAudiencePreview failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with AudiencePreviewAnyOf2 + // validate the json string with FailedAudiencePreview try { - AudiencePreviewAnyOf2.validateJsonElement(jsonElement); + FailedAudiencePreview.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for AudiencePreviewAnyOf2 failed with `%s`.", + "Deserialization for FailedAudiencePreview failed with `%s`.", e.getMessage())); // continue to the next one } throw new IOException( String.format( "The JSON string is invalid for AudiencePreview with anyOf schemas:" - + " AudiencePreviewAnyOf, AudiencePreviewAnyOf1, AudiencePreviewAnyOf2." - + " no class match the result, expected at least 1. Detailed failure" - + " message for anyOf schemas: %s. JSON: %s", + + " CompletedAudiencePreview, FailedAudiencePreview," + + " RunningAudiencePreview. no class match the result, expected at" + + " least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); } diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java deleted file mode 100644 index ea89bd59..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudiencePreviewAnyOf */ -public class AudiencePreviewAnyOf { - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - COMPLETED("COMPLETED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_RESULTS = "results"; - - @SerializedName(SERIALIZED_NAME_RESULTS) - private List results = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public AudiencePreviewAnyOf() {} - - public AudiencePreviewAnyOf status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public AudiencePreviewAnyOf results(List results) { - - this.results = results; - return this; - } - - public AudiencePreviewAnyOf addResultsItem(AudiencePreviewResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Sampled result membership for the audience preview. - * - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - public AudiencePreviewAnyOf size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nonnull - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - - public AudiencePreviewAnyOf id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudiencePreviewAnyOf audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudiencePreviewAnyOf definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public AudiencePreviewAnyOf options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewAnyOf audiencePreviewAnyOf = (AudiencePreviewAnyOf) o; - return Objects.equals(this.status, audiencePreviewAnyOf.status) - && Objects.equals(this.results, audiencePreviewAnyOf.results) - && Objects.equals(this.size, audiencePreviewAnyOf.size) - && Objects.equals(this.id, audiencePreviewAnyOf.id) - && Objects.equals(this.audienceType, audiencePreviewAnyOf.audienceType) - && Objects.equals(this.definition, audiencePreviewAnyOf.definition) - && Objects.equals(this.options, audiencePreviewAnyOf.options); - } - - @Override - public int hashCode() { - return Objects.hash(status, results, size, id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewAnyOf {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("results"); - openapiFields.add("size"); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("results"); - openapiRequiredFields.add("size"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewAnyOf - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewAnyOf.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewAnyOf is not found in" - + " the empty JSON string", - AudiencePreviewAnyOf.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewAnyOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewAnyOf` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewAnyOf.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `results` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("results").toString())); - } - - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); - } - ; - // validate the required field `size` - AudienceSize.validateJsonElement(jsonObj.get("size")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewAnyOf.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewAnyOf' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewAnyOf value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewAnyOf read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreviewAnyOf given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreviewAnyOf - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewAnyOf - */ - public static AudiencePreviewAnyOf fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewAnyOf.class); - } - - /** - * Convert an instance of AudiencePreviewAnyOf to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java deleted file mode 100644 index 210fb1ac..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf1.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudiencePreviewAnyOf1 */ -public class AudiencePreviewAnyOf1 { - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - RUNNING("RUNNING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public AudiencePreviewAnyOf1() {} - - public AudiencePreviewAnyOf1 status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public AudiencePreviewAnyOf1 id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudiencePreviewAnyOf1 audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudiencePreviewAnyOf1 definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public AudiencePreviewAnyOf1 options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewAnyOf1 audiencePreviewAnyOf1 = (AudiencePreviewAnyOf1) o; - return Objects.equals(this.status, audiencePreviewAnyOf1.status) - && Objects.equals(this.id, audiencePreviewAnyOf1.id) - && Objects.equals(this.audienceType, audiencePreviewAnyOf1.audienceType) - && Objects.equals(this.definition, audiencePreviewAnyOf1.definition) - && Objects.equals(this.options, audiencePreviewAnyOf1.options); - } - - @Override - public int hashCode() { - return Objects.hash(status, id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewAnyOf1 {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewAnyOf1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewAnyOf1.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewAnyOf1 is not found in" - + " the empty JSON string", - AudiencePreviewAnyOf1.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewAnyOf1.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewAnyOf1` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewAnyOf1.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewAnyOf1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewAnyOf1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf1.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewAnyOf1 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewAnyOf1 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreviewAnyOf1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreviewAnyOf1 - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewAnyOf1 - */ - public static AudiencePreviewAnyOf1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewAnyOf1.class); - } - - /** - * Convert an instance of AudiencePreviewAnyOf1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java deleted file mode 100644 index 66650533..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewAnyOf2.java +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudiencePreviewAnyOf2 */ -public class AudiencePreviewAnyOf2 { - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - FAILED("FAILED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; - - @SerializedName(SERIALIZED_NAME_FAILURE_REASON) - private String failureReason; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public AudiencePreviewAnyOf2() {} - - public AudiencePreviewAnyOf2 status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public AudiencePreviewAnyOf2 failureReason(String failureReason) { - - this.failureReason = failureReason; - return this; - } - - /** - * Explanation of why the audience preview failed, if available. - * - * @return failureReason - */ - @javax.annotation.Nullable - public String getFailureReason() { - return failureReason; - } - - public void setFailureReason(String failureReason) { - this.failureReason = failureReason; - } - - public AudiencePreviewAnyOf2 id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudiencePreviewAnyOf2 audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudiencePreviewAnyOf2 definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public AudiencePreviewAnyOf2 options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewAnyOf2 audiencePreviewAnyOf2 = (AudiencePreviewAnyOf2) o; - return Objects.equals(this.status, audiencePreviewAnyOf2.status) - && Objects.equals(this.failureReason, audiencePreviewAnyOf2.failureReason) - && Objects.equals(this.id, audiencePreviewAnyOf2.id) - && Objects.equals(this.audienceType, audiencePreviewAnyOf2.audienceType) - && Objects.equals(this.definition, audiencePreviewAnyOf2.definition) - && Objects.equals(this.options, audiencePreviewAnyOf2.options); - } - - @Override - public int hashCode() { - return Objects.hash(status, failureReason, id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewAnyOf2 {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("failureReason"); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewAnyOf2 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewAnyOf2.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewAnyOf2 is not found in" - + " the empty JSON string", - AudiencePreviewAnyOf2.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewAnyOf2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewAnyOf2` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewAnyOf2.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) - && !jsonObj.get("failureReason").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `failureReason` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("failureReason").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewAnyOf2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewAnyOf2' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewAnyOf2.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewAnyOf2 value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewAnyOf2 read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreviewAnyOf2 given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreviewAnyOf2 - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewAnyOf2 - */ - public static AudiencePreviewAnyOf2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewAnyOf2.class); - } - - /** - * Convert an instance of AudiencePreviewAnyOf2 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 1817dfbb1229764b50ff120f8227b24dbf3c43c6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 13 Jun 2025 17:34:30 +0000 Subject: [PATCH 440/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@7f5bf7fa. --- src/main/java/com/segment/publicapi/JSON.java | 9 - .../publicapi/models/AudiencePreview.java | 693 ++++++++++++------ .../models/CommonAudiencePreview.java | 352 --------- .../models/CompletedAudiencePreview.java | 519 ------------- .../models/FailedAudiencePreview.java | 468 ------------ .../models/RunningAudiencePreview.java | 432 ----------- 6 files changed, 455 insertions(+), 2018 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java delete mode 100644 src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java delete mode 100644 src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java delete mode 100644 src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index a36f1bce..3eb3642d 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -213,13 +213,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CancelReverseETLSyncForModelOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CommonAudiencePreview.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CommonSourceSettingsV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CompletedAudiencePreview - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ComputedTraitSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -651,8 +646,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.FQLDefinedPropertyV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.FailedAudiencePreview.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Filter.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1448,8 +1441,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.RuleInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RuleV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.RunningAudiencePreview.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SourceAPICallSnapshotV1 .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index d982756c..6251d5e8 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -12,267 +12,407 @@ package com.segment.publicapi.models; import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.Objects; +import java.util.Set; -public class AudiencePreview extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(AudiencePreview.class.getName()); +/** An audience preview. */ +public class AudiencePreview { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreview' and its subtypes + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterCompletedAudiencePreview = - gson.getDelegateAdapter(this, TypeToken.get(CompletedAudiencePreview.class)); - final TypeAdapter adapterRunningAudiencePreview = - gson.getDelegateAdapter(this, TypeToken.get(RunningAudiencePreview.class)); - final TypeAdapter adapterFailedAudiencePreview = - gson.getDelegateAdapter(this, TypeToken.get(FailedAudiencePreview.class)); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreview value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `CompletedAudiencePreview` - if (value.getActualInstance() instanceof CompletedAudiencePreview) { - JsonElement element = - adapterCompletedAudiencePreview.toJsonTree( - (CompletedAudiencePreview) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `RunningAudiencePreview` - if (value.getActualInstance() instanceof RunningAudiencePreview) { - JsonElement element = - adapterRunningAudiencePreview.toJsonTree( - (RunningAudiencePreview) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `FailedAudiencePreview` - if (value.getActualInstance() instanceof FailedAudiencePreview) { - JsonElement element = - adapterFailedAudiencePreview.toJsonTree( - (FailedAudiencePreview) value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " CompletedAudiencePreview, FailedAudiencePreview," - + " RunningAudiencePreview"); - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } - @Override - public AudiencePreview read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize CompletedAudiencePreview - try { - // validate the JSON object to see if any exception is thrown - CompletedAudiencePreview.validateJsonElement(jsonElement); - actualAdapter = adapterCompletedAudiencePreview; - AudiencePreview ret = new AudiencePreview(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for CompletedAudiencePreview" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'CompletedAudiencePreview'", - e); - } - // deserialize RunningAudiencePreview - try { - // validate the JSON object to see if any exception is thrown - RunningAudiencePreview.validateJsonElement(jsonElement); - actualAdapter = adapterRunningAudiencePreview; - AudiencePreview ret = new AudiencePreview(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for RunningAudiencePreview failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'RunningAudiencePreview'", - e); - } - // deserialize FailedAudiencePreview - try { - // validate the JSON object to see if any exception is thrown - FailedAudiencePreview.validateJsonElement(jsonElement); - actualAdapter = adapterFailedAudiencePreview; - AudiencePreview ret = new AudiencePreview(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for FailedAudiencePreview failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema 'FailedAudiencePreview'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for AudiencePreview: no class" - + " matches result, expected at least 1. Detailed" - + " failure message for anyOf schemas: %s. JSON:" - + " %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private AudiencePreviewOptions options; + + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + RUNNING("RUNNING"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } } } - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; - public AudiencePreview() { - super("anyOf", Boolean.FALSE); + public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; + + @SerializedName(SERIALIZED_NAME_FAILURE_REASON) + private String failureReason; + + public AudiencePreview() {} + + public AudiencePreview id(String id) { + + this.id = id; + return this; } - public AudiencePreview(CompletedAudiencePreview o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; } - public AudiencePreview(FailedAudiencePreview o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); + public void setId(String id) { + this.id = id; } - public AudiencePreview(RunningAudiencePreview o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); + public AudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; } - static { - schemas.put("CompletedAudiencePreview", CompletedAudiencePreview.class); - schemas.put("RunningAudiencePreview", RunningAudiencePreview.class); - schemas.put("FailedAudiencePreview", FailedAudiencePreview.class); + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; } - @Override - public Map> getSchemas() { - return AudiencePreview.schemas; + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; } /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: CompletedAudiencePreview, FailedAudiencePreview, - * RunningAudiencePreview + * Get definition * - *

It could be an instance of the 'anyOf' schemas. + * @return definition */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof CompletedAudiencePreview) { - super.setActualInstance(instance); - return; - } + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } - if (instance instanceof RunningAudiencePreview) { - super.setActualInstance(instance); - return; - } + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } - if (instance instanceof FailedAudiencePreview) { - super.setActualInstance(instance); - return; - } + public AudiencePreview options(AudiencePreviewOptions options) { - throw new RuntimeException( - "Invalid instance type. Must be CompletedAudiencePreview, FailedAudiencePreview," - + " RunningAudiencePreview"); + this.options = options; + return this; } /** - * Get the actual instance, which can be the following: CompletedAudiencePreview, - * FailedAudiencePreview, RunningAudiencePreview + * Get options * - * @return The actual instance (CompletedAudiencePreview, FailedAudiencePreview, - * RunningAudiencePreview) + * @return options */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); + @javax.annotation.Nonnull + public AudiencePreviewOptions getOptions() { + return options; + } + + public void setOptions(AudiencePreviewOptions options) { + this.options = options; + } + + public AudiencePreview status(StatusEnum status) { + + this.status = status; + return this; } /** - * Get the actual instance of `CompletedAudiencePreview`. If the actual instance is not - * `CompletedAudiencePreview`, the ClassCastException will be thrown. + * Status for the audience preview. * - * @return The actual instance of `CompletedAudiencePreview` - * @throws ClassCastException if the instance is not `CompletedAudiencePreview` + * @return status */ - public CompletedAudiencePreview getCompletedAudiencePreview() throws ClassCastException { - return (CompletedAudiencePreview) super.getActualInstance(); + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public AudiencePreview results(List results) { + + this.results = results; + return this; + } + + public AudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; } /** - * Get the actual instance of `RunningAudiencePreview`. If the actual instance is not - * `RunningAudiencePreview`, the ClassCastException will be thrown. + * Sampled result membership for the audience preview. Only has a value if the status is + * 'COMPLETED'. * - * @return The actual instance of `RunningAudiencePreview` - * @throws ClassCastException if the instance is not `RunningAudiencePreview` + * @return results */ - public RunningAudiencePreview getRunningAudiencePreview() throws ClassCastException { - return (RunningAudiencePreview) super.getActualInstance(); + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public AudiencePreview size(AudienceSize size) { + + this.size = size; + return this; } /** - * Get the actual instance of `FailedAudiencePreview`. If the actual instance is not - * `FailedAudiencePreview`, the ClassCastException will be thrown. + * Get size * - * @return The actual instance of `FailedAudiencePreview` - * @throws ClassCastException if the instance is not `FailedAudiencePreview` + * @return size */ - public FailedAudiencePreview getFailedAudiencePreview() throws ClassCastException { - return (FailedAudiencePreview) super.getActualInstance(); + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + + public AudiencePreview failureReason(String failureReason) { + + this.failureReason = failureReason; + return this; + } + + /** + * Explanation of why the audience preview failed. Only has a value if status is + * 'FAILED'. + * + * @return failureReason + */ + @javax.annotation.Nullable + public String getFailureReason() { + return failureReason; + } + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreview audiencePreview = (AudiencePreview) o; + return Objects.equals(this.id, audiencePreview.id) + && Objects.equals(this.audienceType, audiencePreview.audienceType) + && Objects.equals(this.definition, audiencePreview.definition) + && Objects.equals(this.options, audiencePreview.options) + && Objects.equals(this.status, audiencePreview.status) + && Objects.equals(this.results, audiencePreview.results) + && Objects.equals(this.size, audiencePreview.size) + && Objects.equals(this.failureReason, audiencePreview.failureReason); + } + + @Override + public int hashCode() { + return Objects.hash( + id, audienceType, definition, options, status, results, size, failureReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + openapiFields.add("status"); + openapiFields.add("results"); + openapiFields.add("size"); + openapiFields.add("failureReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + openapiRequiredFields.add("status"); } /** @@ -282,48 +422,125 @@ public FailedAudiencePreview getFailedAudiencePreview() throws ClassCastExceptio * @throws IOException if the JSON Element is invalid with respect to AudiencePreview */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with CompletedAudiencePreview - try { - CompletedAudiencePreview.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( + if (jsonElement == null) { + if (!AudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreview is not found in the" + + " empty JSON string", + AudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( String.format( - "Deserialization for CompletedAudiencePreview failed with `%s`.", - e.getMessage())); - // continue to the next one + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); } - // validate the json string with RunningAudiencePreview - try { - RunningAudiencePreview.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( String.format( - "Deserialization for RunningAudiencePreview failed with `%s`.", - e.getMessage())); - // continue to the next one + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); } - // validate the json string with FailedAudiencePreview - try { - FailedAudiencePreview.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( String.format( - "Deserialization for FailedAudiencePreview failed with `%s`.", - e.getMessage())); - // continue to the next one + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + if (jsonArrayresults != null) { + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `results` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("results").toString())); + } + + // validate the optional field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); + } + ; + } + } + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } + if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) + && !jsonObj.get("failureReason").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `failureReason` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("failureReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); } - throw new IOException( - String.format( - "The JSON string is invalid for AudiencePreview with anyOf schemas:" - + " CompletedAudiencePreview, FailedAudiencePreview," - + " RunningAudiencePreview. no class match the result, expected at" - + " least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", - errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java b/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java deleted file mode 100644 index 7d340073..00000000 --- a/src/main/java/com/segment/publicapi/models/CommonAudiencePreview.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Fields common to an audience preview regardless of the status. */ -public class CommonAudiencePreview { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public CommonAudiencePreview() {} - - public CommonAudiencePreview id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public CommonAudiencePreview audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public CommonAudiencePreview definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public CommonAudiencePreview options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CommonAudiencePreview commonAudiencePreview = (CommonAudiencePreview) o; - return Objects.equals(this.id, commonAudiencePreview.id) - && Objects.equals(this.audienceType, commonAudiencePreview.audienceType) - && Objects.equals(this.definition, commonAudiencePreview.definition) - && Objects.equals(this.options, commonAudiencePreview.options); - } - - @Override - public int hashCode() { - return Objects.hash(id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CommonAudiencePreview {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommonAudiencePreview - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CommonAudiencePreview.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CommonAudiencePreview is not found in" - + " the empty JSON string", - CommonAudiencePreview.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CommonAudiencePreview.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CommonAudiencePreview` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CommonAudiencePreview.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CommonAudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CommonAudiencePreview' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CommonAudiencePreview.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CommonAudiencePreview value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CommonAudiencePreview read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CommonAudiencePreview given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommonAudiencePreview - * @throws IOException if the JSON string is invalid with respect to CommonAudiencePreview - */ - public static CommonAudiencePreview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CommonAudiencePreview.class); - } - - /** - * Convert an instance of CommonAudiencePreview to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java b/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java deleted file mode 100644 index 9149e311..00000000 --- a/src/main/java/com/segment/publicapi/models/CompletedAudiencePreview.java +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Audience preview that has been completed. */ -public class CompletedAudiencePreview { - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - COMPLETED("COMPLETED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_RESULTS = "results"; - - @SerializedName(SERIALIZED_NAME_RESULTS) - private List results = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public CompletedAudiencePreview() {} - - public CompletedAudiencePreview status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public CompletedAudiencePreview results(List results) { - - this.results = results; - return this; - } - - public CompletedAudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Sampled result membership for the audience preview. - * - * @return results - */ - @javax.annotation.Nonnull - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - public CompletedAudiencePreview size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nonnull - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - - public CompletedAudiencePreview id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public CompletedAudiencePreview audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public CompletedAudiencePreview definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public CompletedAudiencePreview options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CompletedAudiencePreview completedAudiencePreview = (CompletedAudiencePreview) o; - return Objects.equals(this.status, completedAudiencePreview.status) - && Objects.equals(this.results, completedAudiencePreview.results) - && Objects.equals(this.size, completedAudiencePreview.size) - && Objects.equals(this.id, completedAudiencePreview.id) - && Objects.equals(this.audienceType, completedAudiencePreview.audienceType) - && Objects.equals(this.definition, completedAudiencePreview.definition) - && Objects.equals(this.options, completedAudiencePreview.options); - } - - @Override - public int hashCode() { - return Objects.hash(status, results, size, id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CompletedAudiencePreview {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("results"); - openapiFields.add("size"); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("results"); - openapiRequiredFields.add("size"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CompletedAudiencePreview - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CompletedAudiencePreview.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CompletedAudiencePreview is not found" - + " in the empty JSON string", - CompletedAudiencePreview.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CompletedAudiencePreview.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CompletedAudiencePreview` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CompletedAudiencePreview.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - // ensure the json data is an array - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `results` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("results").toString())); - } - - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - // validate the required field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); - } - ; - // validate the required field `size` - AudienceSize.validateJsonElement(jsonObj.get("size")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CompletedAudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CompletedAudiencePreview' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(CompletedAudiencePreview.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CompletedAudiencePreview value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CompletedAudiencePreview read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CompletedAudiencePreview given an JSON string - * - * @param jsonString JSON string - * @return An instance of CompletedAudiencePreview - * @throws IOException if the JSON string is invalid with respect to CompletedAudiencePreview - */ - public static CompletedAudiencePreview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CompletedAudiencePreview.class); - } - - /** - * Convert an instance of CompletedAudiencePreview to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java b/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java deleted file mode 100644 index 12b6d355..00000000 --- a/src/main/java/com/segment/publicapi/models/FailedAudiencePreview.java +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Audience preview that has failed to calculate. */ -public class FailedAudiencePreview { - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - FAILED("FAILED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; - - @SerializedName(SERIALIZED_NAME_FAILURE_REASON) - private String failureReason; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public FailedAudiencePreview() {} - - public FailedAudiencePreview status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public FailedAudiencePreview failureReason(String failureReason) { - - this.failureReason = failureReason; - return this; - } - - /** - * Explanation of why the audience preview failed, if available. - * - * @return failureReason - */ - @javax.annotation.Nullable - public String getFailureReason() { - return failureReason; - } - - public void setFailureReason(String failureReason) { - this.failureReason = failureReason; - } - - public FailedAudiencePreview id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public FailedAudiencePreview audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public FailedAudiencePreview definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public FailedAudiencePreview options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FailedAudiencePreview failedAudiencePreview = (FailedAudiencePreview) o; - return Objects.equals(this.status, failedAudiencePreview.status) - && Objects.equals(this.failureReason, failedAudiencePreview.failureReason) - && Objects.equals(this.id, failedAudiencePreview.id) - && Objects.equals(this.audienceType, failedAudiencePreview.audienceType) - && Objects.equals(this.definition, failedAudiencePreview.definition) - && Objects.equals(this.options, failedAudiencePreview.options); - } - - @Override - public int hashCode() { - return Objects.hash(status, failureReason, id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FailedAudiencePreview {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("failureReason"); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FailedAudiencePreview - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FailedAudiencePreview.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in FailedAudiencePreview is not found in" - + " the empty JSON string", - FailedAudiencePreview.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FailedAudiencePreview.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `FailedAudiencePreview` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FailedAudiencePreview.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) - && !jsonObj.get("failureReason").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `failureReason` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("failureReason").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FailedAudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FailedAudiencePreview' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(FailedAudiencePreview.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, FailedAudiencePreview value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FailedAudiencePreview read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of FailedAudiencePreview given an JSON string - * - * @param jsonString JSON string - * @return An instance of FailedAudiencePreview - * @throws IOException if the JSON string is invalid with respect to FailedAudiencePreview - */ - public static FailedAudiencePreview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FailedAudiencePreview.class); - } - - /** - * Convert an instance of FailedAudiencePreview to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java b/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java deleted file mode 100644 index 0514c3eb..00000000 --- a/src/main/java/com/segment/publicapi/models/RunningAudiencePreview.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Audience preview that is currently being calculated. */ -public class RunningAudiencePreview { - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - RUNNING("RUNNING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; - - public RunningAudiencePreview() {} - - public RunningAudiencePreview status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public RunningAudiencePreview id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public RunningAudiencePreview audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public RunningAudiencePreview definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public RunningAudiencePreview options(AudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(AudiencePreviewOptions options) { - this.options = options; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RunningAudiencePreview runningAudiencePreview = (RunningAudiencePreview) o; - return Objects.equals(this.status, runningAudiencePreview.status) - && Objects.equals(this.id, runningAudiencePreview.id) - && Objects.equals(this.audienceType, runningAudiencePreview.audienceType) - && Objects.equals(this.definition, runningAudiencePreview.definition) - && Objects.equals(this.options, runningAudiencePreview.options); - } - - @Override - public int hashCode() { - return Objects.hash(status, id, audienceType, definition, options); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RunningAudiencePreview {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RunningAudiencePreview - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RunningAudiencePreview.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RunningAudiencePreview is not found in" - + " the empty JSON string", - RunningAudiencePreview.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RunningAudiencePreview.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `RunningAudiencePreview` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RunningAudiencePreview.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RunningAudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RunningAudiencePreview' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(RunningAudiencePreview.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, RunningAudiencePreview value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RunningAudiencePreview read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RunningAudiencePreview given an JSON string - * - * @param jsonString JSON string - * @return An instance of RunningAudiencePreview - * @throws IOException if the JSON string is invalid with respect to RunningAudiencePreview - */ - public static RunningAudiencePreview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RunningAudiencePreview.class); - } - - /** - * Convert an instance of RunningAudiencePreview to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 2822b39951f2f5d2413f5838fb327aa72a2e7e16 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jun 2025 21:05:33 +0000 Subject: [PATCH 441/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@19a6cb3c. --- docs/AudiencesApi.md | 6 +-- docs/CustomerInsightsApi.md | 2 +- .../publicapi/api/CustomerInsightsApi.java | 28 +++++++------- ...nceSummaryWithAudienceTypeAndLookback.java | 33 ++++++++++++++++ .../models/CreateDownloadAlphaInput.java | 38 +------------------ 5 files changed, 53 insertions(+), 54 deletions(-) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 7eee68c2..eee7db77 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -194,7 +194,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "id"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { GetAudience200Response result = apiInstance.getAudience(spaceId, id); System.out.println(result); @@ -500,7 +500,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -575,7 +575,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/docs/CustomerInsightsApi.md b/docs/CustomerInsightsApi.md index 27ef841b..cd15128a 100644 --- a/docs/CustomerInsightsApi.md +++ b/docs/CustomerInsightsApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Download -Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java index 2cd26214..bcacff81 100644 --- a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java +++ b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java @@ -151,10 +151,11 @@ private okhttp3.Call createDownloadValidateBeforeCall( } /** - * Create Download Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 + * requests per day per workspaceId, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param createDownloadAlphaInput (required) * @return CreateDownload200Response @@ -177,10 +178,11 @@ public CreateDownload200Response createDownload( } /** - * Create Download Create Customer Insights Presigned URLs The rate limit for this endpoint is 1 - * requests per minute, which is lower than the default due to access pattern restrictions. Once - * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the - * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 + * requests per day per workspaceId, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param createDownloadAlphaInput (required) * @return ApiResponse<CreateDownload200Response> @@ -204,11 +206,11 @@ public ApiResponse createDownloadWithHttpInfo( } /** - * Create Download (asynchronously) Create Customer Insights Presigned URLs The rate limit for - * this endpoint is 1 requests per minute, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * Create Download (asynchronously) Create Customer Insights Presigned URLsThe rate limit for + * this endpoint is 30 requests per day per workspaceId, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param createDownloadAlphaInput (required) * @param _callback The callback to be executed when the API call finishes diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 88b7b297..978075eb 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -88,6 +88,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -196,6 +201,26 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } + public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -472,6 +497,7 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) @@ -498,6 +524,7 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, + size, options, id, spaceId, @@ -519,6 +546,7 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); @@ -555,6 +583,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); + openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("id"); openapiFields.add("spaceId"); @@ -640,6 +669,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); diff --git a/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java index 3ba1b5ad..d63c1a44 100644 --- a/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateDownloadAlphaInput.java @@ -34,11 +34,6 @@ public class CreateDownloadAlphaInput { @SerializedName(SERIALIZED_NAME_COLLECTION_ID) private String collectionId; - public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; - - @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) - private String workspaceId; - public static final String SERIALIZED_NAME_HOUR = "hour"; @SerializedName(SERIALIZED_NAME_HOUR) @@ -66,26 +61,6 @@ public void setCollectionId(String collectionId) { this.collectionId = collectionId; } - public CreateDownloadAlphaInput workspaceId(String workspaceId) { - - this.workspaceId = workspaceId; - return this; - } - - /** - * The Workspace id for the collection. - * - * @return workspaceId - */ - @javax.annotation.Nonnull - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - } - public CreateDownloadAlphaInput hour(String hour) { this.hour = hour; @@ -117,13 +92,12 @@ public boolean equals(Object o) { } CreateDownloadAlphaInput createDownloadAlphaInput = (CreateDownloadAlphaInput) o; return Objects.equals(this.collectionId, createDownloadAlphaInput.collectionId) - && Objects.equals(this.workspaceId, createDownloadAlphaInput.workspaceId) && Objects.equals(this.hour, createDownloadAlphaInput.hour); } @Override public int hashCode() { - return Objects.hash(collectionId, workspaceId, hour); + return Objects.hash(collectionId, hour); } @Override @@ -131,7 +105,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateDownloadAlphaInput {\n"); sb.append(" collectionId: ").append(toIndentedString(collectionId)).append("\n"); - sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); sb.append(" hour: ").append(toIndentedString(hour)).append("\n"); sb.append("}"); return sb.toString(); @@ -155,13 +128,11 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("collectionId"); - openapiFields.add("workspaceId"); openapiFields.add("hour"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("collectionId"); - openapiRequiredFields.add("workspaceId"); openapiRequiredFields.add("hour"); } @@ -212,13 +183,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("collectionId").toString())); } - if (!jsonObj.get("workspaceId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workspaceId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workspaceId").toString())); - } if (!jsonObj.get("hour").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( From 57271b070dfbcec4037c213eb1302a5d62b4291b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 24 Jun 2025 21:08:59 +0000 Subject: [PATCH 442/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f5f6db5f. --- docs/AudiencesApi.md | 2 +- src/main/java/com/segment/publicapi/JSON.java | 8 +- .../segment/publicapi/api/AudiencesApi.java | 20 +- .../publicapi/models/AudiencePreview.java | 10 +- .../CreateAudiencePreviewAlphaInput.java | 10 +- ...java => CreateAudiencePreviewOptions.java} | 71 ++-- .../models/ReadAudiencePreviewOptions.java | 302 ++++++++++++++++++ 7 files changed, 366 insertions(+), 57 deletions(-) rename src/main/java/com/segment/publicapi/models/{AudiencePreviewOptions.java => CreateAudiencePreviewOptions.java} (73%) create mode 100644 src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index eee7db77..6f36c321 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -96,7 +96,7 @@ public class Example { Create Audience Preview -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. ### Example diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 3eb3642d..790f8acb 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -180,8 +180,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -242,6 +240,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateAudiencePreviewAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewOptions + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateCloudSourceRegulation200Response .CustomTypeAdapterFactory()); @@ -1257,6 +1258,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReadAudiencePreviewOptions + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 56b7a765..163904c5 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -397,11 +397,9 @@ private okhttp3.Call createAudiencePreviewValidateBeforeCall( * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * restrictions. * * @param spaceId (required) * @param createAudiencePreviewAlphaInput (required) @@ -434,11 +432,9 @@ public CreateAudiencePreview200Response createAudiencePreview( * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is * lower than the default due to access pattern restrictions. Once reached, this endpoint will * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * restrictions. * * @param spaceId (required) * @param createAudiencePreviewAlphaInput (required) @@ -473,11 +469,9 @@ public ApiResponse createAudiencePreviewWithHt * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, * which is lower than the default due to access pattern restrictions. Once reached, this * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for - * this endpoint is 700 requests per month per spaceId, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also + * has a rate limit of 700 requests per month per spaceId, which is lower than the default due + * to access pattern restrictions. * * @param spaceId (required) * @param createAudiencePreviewAlphaInput (required) diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index 6251d5e8..c6fd3573 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -97,7 +97,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; + private ReadAudiencePreviewOptions options; /** Status for the audience preview. */ @JsonAdapter(StatusEnum.Adapter.class) @@ -229,7 +229,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public AudiencePreview options(AudiencePreviewOptions options) { + public AudiencePreview options(ReadAudiencePreviewOptions options) { this.options = options; return this; @@ -241,11 +241,11 @@ public AudiencePreview options(AudiencePreviewOptions options) { * @return options */ @javax.annotation.Nonnull - public AudiencePreviewOptions getOptions() { + public ReadAudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudiencePreviewOptions options) { + public void setOptions(ReadAudiencePreviewOptions options) { this.options = options; } @@ -472,7 +472,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the required field `definition` AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); // validate the required field `options` - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + ReadAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index 71e4759a..4a1aeaa2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -89,7 +89,7 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudiencePreviewOptions options; + private CreateAudiencePreviewOptions options; public CreateAudiencePreviewAlphaInput() {} @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public CreateAudiencePreviewAlphaInput options(AudiencePreviewOptions options) { + public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions options) { this.options = options; return this; @@ -145,11 +145,11 @@ public CreateAudiencePreviewAlphaInput options(AudiencePreviewOptions options) { * @return options */ @javax.annotation.Nullable - public AudiencePreviewOptions getOptions() { + public CreateAudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudiencePreviewOptions options) { + public void setOptions(CreateAudiencePreviewOptions options) { this.options = options; } @@ -263,7 +263,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + CreateAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } } diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java similarity index 73% rename from src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java rename to src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java index c697236b..fbaee4a4 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewOptions.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java @@ -31,7 +31,7 @@ import java.util.Set; /** Options which should be applied when segmenting audience previews. */ -public class AudiencePreviewOptions { +public class CreateAudiencePreviewOptions { public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) @@ -42,15 +42,15 @@ public class AudiencePreviewOptions { @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) private BigDecimal backfillEventDataDays; - public AudiencePreviewOptions() {} + public CreateAudiencePreviewOptions() {} - public AudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + public CreateAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { this.filterByExternalIds = filterByExternalIds; return this; } - public AudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + public CreateAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { if (this.filterByExternalIds == null) { this.filterByExternalIds = new ArrayList<>(); } @@ -76,7 +76,7 @@ public void setFilterByExternalIds(List filterByExternalIds) { this.filterByExternalIds = filterByExternalIds; } - public AudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + public CreateAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { this.backfillEventDataDays = backfillEventDataDays; return this; @@ -85,8 +85,10 @@ public AudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventData /** * If specified, the value of this field indicates the number of days (specified from the date * the audience preview was created) that event data will be included from when determining - * audience preview membership. If unspecified, event data will not be included when determining - * audience preview membership. + * audience preview membership. If not specified, the default is set to the maximum event window + * size, or 7 days if no window condition is defined. Note that this is applied on a best-effort + * basis and may not always be applicable. In such cases, the response will not return a + * backfillEventDataDays value, and all available data will be taken into account. * * @return backfillEventDataDays */ @@ -107,10 +109,13 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AudiencePreviewOptions audiencePreviewOptions = (AudiencePreviewOptions) o; - return Objects.equals(this.filterByExternalIds, audiencePreviewOptions.filterByExternalIds) + CreateAudiencePreviewOptions createAudiencePreviewOptions = + (CreateAudiencePreviewOptions) o; + return Objects.equals( + this.filterByExternalIds, createAudiencePreviewOptions.filterByExternalIds) && Objects.equals( - this.backfillEventDataDays, audiencePreviewOptions.backfillEventDataDays); + this.backfillEventDataDays, + createAudiencePreviewOptions.backfillEventDataDays); } @Override @@ -121,7 +126,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewOptions {\n"); + sb.append("class CreateAudiencePreviewOptions {\n"); sb.append(" filterByExternalIds: ") .append(toIndentedString(filterByExternalIds)) .append("\n"); @@ -160,28 +165,29 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewOptions + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewOptions */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AudiencePreviewOptions.openapiRequiredFields + if (!CreateAudiencePreviewOptions.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AudiencePreviewOptions is not found in" - + " the empty JSON string", - AudiencePreviewOptions.openapiRequiredFields.toString())); + "The required field(s) %s in CreateAudiencePreviewOptions is not" + + " found in the empty JSON string", + CreateAudiencePreviewOptions.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + if (!CreateAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewOptions` properties. JSON: %s", + + " `CreateAudiencePreviewOptions` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } @@ -202,24 +208,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewOptions' and its subtypes + if (!CreateAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewOptions' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewOptions.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewOptions.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AudiencePreviewOptions value) + public void write(JsonWriter out, CreateAudiencePreviewOptions value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AudiencePreviewOptions read(JsonReader in) throws IOException { + public CreateAudiencePreviewOptions read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -229,18 +237,19 @@ public AudiencePreviewOptions read(JsonReader in) throws IOException { } /** - * Create an instance of AudiencePreviewOptions given an JSON string + * Create an instance of CreateAudiencePreviewOptions given an JSON string * * @param jsonString JSON string - * @return An instance of AudiencePreviewOptions - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewOptions + * @return An instance of CreateAudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewOptions */ - public static AudiencePreviewOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewOptions.class); + public static CreateAudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewOptions.class); } /** - * Convert an instance of AudiencePreviewOptions to an JSON string + * Convert an instance of CreateAudiencePreviewOptions to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java new file mode 100644 index 00000000..3acc03b6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java @@ -0,0 +1,302 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Options which should be applied when segmenting audience previews. */ +public class ReadAudiencePreviewOptions { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public ReadAudiencePreviewOptions() {} + + public ReadAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public ReadAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience preview membership. + * Profiles will only be considered for audience preview membership if the profile has at least + * one external id whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public ReadAudiencePreviewOptions includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience preview being created is included when + * determining audience preview membership. Note that including historical data may be needed in + * order to properly handle the definition specified. In these cases, Segment will automatically + * handle including historical data and the response will return the includeHistoricalData + * parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nonnull + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public ReadAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days (specified from the date + * the audience preview was created) that event data will be included from when determining + * audience preview membership. If unspecified, defer to the value of + * `includeHistoricalData` to determine whether historical data is either entirely + * included or entirely excluded when determining audience preview membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadAudiencePreviewOptions readAudiencePreviewOptions = (ReadAudiencePreviewOptions) o; + return Objects.equals( + this.filterByExternalIds, readAudiencePreviewOptions.filterByExternalIds) + && Objects.equals( + this.includeHistoricalData, + readAudiencePreviewOptions.includeHistoricalData) + && Objects.equals( + this.backfillEventDataDays, + readAudiencePreviewOptions.backfillEventDataDays); + } + + @Override + public int hashCode() { + return Objects.hash(filterByExternalIds, includeHistoricalData, backfillEventDataDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadAudiencePreviewOptions {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("backfillEventDataDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + openapiRequiredFields.add("includeHistoricalData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReadAudiencePreviewOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadAudiencePreviewOptions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReadAudiencePreviewOptions is not" + + " found in the empty JSON string", + ReadAudiencePreviewOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReadAudiencePreviewOptions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadAudiencePreviewOptions.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadAudiencePreviewOptions' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReadAudiencePreviewOptions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadAudiencePreviewOptions value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadAudiencePreviewOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReadAudiencePreviewOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadAudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to ReadAudiencePreviewOptions + */ + public static ReadAudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadAudiencePreviewOptions.class); + } + + /** + * Convert an instance of ReadAudiencePreviewOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 95e30308ca41c0d877b60ec1bcea803891465936 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 25 Jun 2025 13:39:07 +0000 Subject: [PATCH 443/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@768d0539. --- docs/AudiencesApi.md | 6 ++-- ...nceSummaryWithAudienceTypeAndLookback.java | 33 ------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 6f36c321..a92dbbbc 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -194,7 +194,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String id = "id"; // String | try { GetAudience200Response result = apiInstance.getAudience(spaceId, id); System.out.println(result); @@ -500,7 +500,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -575,7 +575,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 978075eb..88b7b297 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -88,11 +88,6 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -201,26 +196,6 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } - public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nullable - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -497,7 +472,6 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) @@ -524,7 +498,6 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, - size, options, id, spaceId, @@ -546,7 +519,6 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); @@ -583,7 +555,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); - openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("id"); openapiFields.add("spaceId"); @@ -669,10 +640,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `size` - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { - AudienceSize.validateJsonElement(jsonObj.get("size")); - } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); From c4fe80d6e33d7b8653940df7b9bad0241c7aec60 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 25 Jun 2025 18:19:47 +0000 Subject: [PATCH 444/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e9968715. --- docs/AudiencesApi.md | 6 ++-- ...nceSummaryWithAudienceTypeAndLookback.java | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index a92dbbbc..6f36c321 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -194,7 +194,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "id"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { GetAudience200Response result = apiInstance.getAudience(spaceId, id); System.out.println(result); @@ -500,7 +500,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -575,7 +575,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 88b7b297..978075eb 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -88,6 +88,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -196,6 +201,26 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } + public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -472,6 +497,7 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) @@ -498,6 +524,7 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, + size, options, id, spaceId, @@ -519,6 +546,7 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); @@ -555,6 +583,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); + openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("id"); openapiFields.add("spaceId"); @@ -640,6 +669,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); From 5f4e6020af6a055d77eebce89067ab42777b7359 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 25 Jun 2025 20:23:18 +0000 Subject: [PATCH 445/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4e330aa8. From e4f2b258f775271008a1c370cf262635ec2755fc Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 27 Jun 2025 05:47:34 +0000 Subject: [PATCH 446/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f389aa89. --- README.md | 8 +- docs/AudiencesApi.md | 154 ++--- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 39 +- .../segment/publicapi/api/AudiencesApi.java | 630 ++++++------------ .../publicapi/models/AudiencePreview.java | 565 ---------------- .../publicapi/models/AudienceSize.java | 284 -------- ...nceSummaryWithAudienceTypeAndLookback.java | 33 - .../CreateAudiencePreview200Response.java | 199 ------ .../CreateAudiencePreviewAlphaOutput.java | 210 ------ .../models/CreateAudiencePreviewOptions.java | 259 ------- .../models/GetAudiencePreviewAlphaOutput.java | 208 ------ ...udiencePreviewResult.java => Preview.java} | 61 +- ...e.java => PreviewAudience200Response.java} | 65 +- ...haInput.java => PreviewAudienceInput.java} | 78 +-- ...tifier.java => PreviewAudienceOutput.java} | 94 ++- .../models/ReadAudiencePreviewOptions.java | 302 --------- 19 files changed, 411 insertions(+), 2784 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreview.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSize.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java rename src/main/java/com/segment/publicapi/models/{AudiencePreviewResult.java => Preview.java} (75%) rename src/main/java/com/segment/publicapi/models/{GetAudiencePreview200Response.java => PreviewAudience200Response.java} (69%) rename src/main/java/com/segment/publicapi/models/{CreateAudiencePreviewAlphaInput.java => PreviewAudienceInput.java} (75%) rename src/main/java/com/segment/publicapi/models/{AudiencePreviewIdentifier.java => PreviewAudienceOutput.java} (64%) delete mode 100644 src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java diff --git a/README.md b/README.md index 87d966f8..9af6d601 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.7.0 +Latest API and SDK version: 58.6.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.7.0 + 58.6.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.7.0" + implementation "com.segment.publicapi:segment-publicapi:58.6.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.7.0.jar` +* `target/segment-publicapi-58.6.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 6f36c321..067854e8 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -5,11 +5,10 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | -| [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | -| [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | +| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -90,81 +89,6 @@ public class Example { | **429** | Too many requests | - | -## Operation: createAudiencePreview - -> CreateAudiencePreview200Response createAudiencePreview(spaceId, createAudiencePreviewAlphaInput) - -Create Audience Preview - -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.AudiencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = new CreateAudiencePreviewAlphaInput(); // CreateAudiencePreviewAlphaInput | - try { - CreateAudiencePreview200Response result = apiInstance.createAudiencePreview(spaceId, createAudiencePreviewAlphaInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#createAudiencePreview"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **createAudiencePreviewAlphaInput** | [**CreateAudiencePreviewAlphaInput**](CreateAudiencePreviewAlphaInput.md)| | | - -### Return type - -[**CreateAudiencePreview200Response**](CreateAudiencePreview200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - ## Operation: getAudience > GetAudience200Response getAudience(spaceId, id) @@ -194,7 +118,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String id = "id"; // String | try { GetAudience200Response result = apiInstance.getAudience(spaceId, id); System.out.println(result); @@ -240,13 +164,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: getAudiencePreview +## Operation: listAudienceConsumersFromSpaceAndAudience -> GetAudiencePreview200Response getAudiencePreview(spaceId, id) +> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) -Get Audience Preview +List Audience Consumers from Space And Audience -Reads the results of an audience preview. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -269,12 +193,15 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "2yKFfGeS62yzGxQSAieVOvsPOha-compute_preview_execution-dws3UdTNsppL5dRGsagFpP-compute_preview_execution"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. + ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. try { - GetAudiencePreview200Response result = apiInstance.getAudiencePreview(spaceId, id); + ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#getAudiencePreview"); + System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -291,10 +218,13 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | +| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type -[**GetAudiencePreview200Response**](GetAudiencePreview200Response.md) +[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) ### Authorization @@ -315,13 +245,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudienceConsumersFromSpaceAndAudience +## Operation: listAudiences -> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) +> ListAudiences200Response listAudiences(spaceId, pagination) -List Audience Consumers from Space And Audience +List Audiences -Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -344,15 +274,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. - ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { - ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#listAudiences"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -368,14 +295,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **id** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | -| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type -[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) +[**ListAudiences200Response**](ListAudiences200Response.md) ### Authorization @@ -384,7 +308,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -396,13 +320,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudiences +## Operation: previewAudience -> ListAudiences200Response listAudiences(spaceId, pagination) +> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput) -List Audiences +Preview Audience -Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -425,12 +349,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); + PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudiences"); + System.err.println("Exception when calling AudiencesApi#previewAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -446,11 +370,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | | ### Return type -[**ListAudiences200Response**](ListAudiences200Response.md) +[**PreviewAudience200Response**](PreviewAudience200Response.md) ### Authorization @@ -458,8 +382,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -500,7 +424,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -575,7 +499,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/pom.xml b/pom.xml index 6a340ede..15cc847b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.7.0 + 58.6.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d731c05a..7737bb6e 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.7.0 (Java)"); + setUserAgent("Public API SDK 58.6.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f95a82b6..799812c9 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.7.0"; + public static final String VERSION = "58.6.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 790f8acb..9a4de509 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -175,15 +175,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptionsWithLookback .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewIdentifier - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSize.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -231,18 +222,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateAudienceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreview200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreviewAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreviewAlphaOutput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreviewOptions - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateCloudSourceRegulation200Response .CustomTypeAdapterFactory()); @@ -676,12 +655,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudiencePreview200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudiencePreviewAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); @@ -1234,6 +1207,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilter200Response .CustomTypeAdapterFactory()); @@ -1258,9 +1240,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReadAudiencePreviewOptions - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 163904c5..567267b3 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -20,16 +20,15 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; -import com.segment.publicapi.models.CreateAudiencePreview200Response; -import com.segment.publicapi.models.CreateAudiencePreviewAlphaInput; import com.segment.publicapi.models.GetAudience200Response; -import com.segment.publicapi.models.GetAudiencePreview200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.PreviewAudience200Response; +import com.segment.publicapi.models.PreviewAudienceInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; @@ -285,223 +284,6 @@ public okhttp3.Call createAudienceAsync( return localVarCall; } - /** - * Build call for createAudiencePreview - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createAudiencePreviewCall( - String spaceId, - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createAudiencePreviewAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createAudiencePreviewValidateBeforeCall( - String spaceId, - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " createAudiencePreview(Async)"); - } - - // verify the required parameter 'createAudiencePreviewAlphaInput' is set - if (createAudiencePreviewAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'createAudiencePreviewAlphaInput' when calling" - + " createAudiencePreview(Async)"); - } - - return createAudiencePreviewCall(spaceId, createAudiencePreviewAlphaInput, _callback); - } - - /** - * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. • When called, this - * endpoint may generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @return CreateAudiencePreview200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CreateAudiencePreview200Response createAudiencePreview( - String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) - throws ApiException { - ApiResponse localVarResp = - createAudiencePreviewWithHttpInfo(spaceId, createAudiencePreviewAlphaInput); - return localVarResp.getData(); - } - - /** - * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. • When called, this - * endpoint may generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @return ApiResponse<CreateAudiencePreview200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse createAudiencePreviewWithHttpInfo( - String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - createAudiencePreviewValidateBeforeCall( - spaceId, createAudiencePreviewAlphaInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Audience Preview (asynchronously) Previews Audience. • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Audience Preview Created` event in the - * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also - * has a rate limit of 700 requests per month per spaceId, which is lower than the default due - * to access pattern restrictions. - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createAudiencePreviewAsync( - String spaceId, - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createAudiencePreviewValidateBeforeCall( - spaceId, createAudiencePreviewAlphaInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for getAudience * @@ -695,200 +477,6 @@ public okhttp3.Call getAudienceAsync( return localVarCall; } - /** - * Build call for getAudiencePreview - * - * @param spaceId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudiencePreviewCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews/{id}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAudiencePreviewValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getAudiencePreview(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling getAudiencePreview(Async)"); - } - - return getAudiencePreviewCall(spaceId, id, _callback); - } - - /** - * Get Audience Preview Reads the results of an audience preview. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return GetAudiencePreview200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetAudiencePreview200Response getAudiencePreview(String spaceId, String id) - throws ApiException { - ApiResponse localVarResp = - getAudiencePreviewWithHttpInfo(spaceId, id); - return localVarResp.getData(); - } - - /** - * Get Audience Preview Reads the results of an audience preview. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return ApiResponse<GetAudiencePreview200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getAudiencePreviewWithHttpInfo( - String spaceId, String id) throws ApiException { - okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Audience Preview (asynchronously) Reads the results of an audience preview. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Audience feature enabled. Please reach out to your customer success manager - * for more information. The rate limit for this endpoint is 100 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudiencePreviewAsync( - String spaceId, String id, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for listAudienceConsumersFromSpaceAndAudience * @@ -1358,6 +946,220 @@ public okhttp3.Call listAudiencesAsync( return localVarCall; } + /** + * Build call for previewAudience + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call previewAudienceCall( + String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = previewAudienceInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call previewAudienceValidateBeforeCall( + String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling previewAudience(Async)"); + } + + // verify the required parameter 'previewAudienceInput' is set + if (previewAudienceInput == null) { + throw new ApiException( + "Missing the required parameter 'previewAudienceInput' when calling" + + " previewAudience(Async)"); + } + + return previewAudienceCall(spaceId, previewAudienceInput, _callback); + } + + /** + * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. • When called, this endpoint may + * generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @return PreviewAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public PreviewAudience200Response previewAudience( + String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { + ApiResponse localVarResp = + previewAudienceWithHttpInfo(spaceId, previewAudienceInput); + return localVarResp.getData(); + } + + /** + * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. • When called, this endpoint may + * generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @return ApiResponse<PreviewAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse previewAudienceWithHttpInfo( + String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { + okhttp3.Call localVarCall = + previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Preview Created` event in the + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for + * this endpoint is 700 requests per month per spaceId, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param previewAudienceInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call previewAudienceAsync( + String spaceId, + PreviewAudienceInput previewAudienceInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for removeAudienceFromSpace * diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java deleted file mode 100644 index c6fd3573..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** An audience preview. */ -public class AudiencePreview { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private ReadAudiencePreviewOptions options; - - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - COMPLETED("COMPLETED"), - - FAILED("FAILED"), - - RUNNING("RUNNING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_RESULTS = "results"; - - @SerializedName(SERIALIZED_NAME_RESULTS) - private List results; - - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - - public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; - - @SerializedName(SERIALIZED_NAME_FAILURE_REASON) - private String failureReason; - - public AudiencePreview() {} - - public AudiencePreview id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudiencePreview audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudiencePreview definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public AudiencePreview options(ReadAudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public ReadAudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(ReadAudiencePreviewOptions options) { - this.options = options; - } - - public AudiencePreview status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public AudiencePreview results(List results) { - - this.results = results; - return this; - } - - public AudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Sampled result membership for the audience preview. Only has a value if the status is - * 'COMPLETED'. - * - * @return results - */ - @javax.annotation.Nullable - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - public AudiencePreview size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nullable - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - - public AudiencePreview failureReason(String failureReason) { - - this.failureReason = failureReason; - return this; - } - - /** - * Explanation of why the audience preview failed. Only has a value if status is - * 'FAILED'. - * - * @return failureReason - */ - @javax.annotation.Nullable - public String getFailureReason() { - return failureReason; - } - - public void setFailureReason(String failureReason) { - this.failureReason = failureReason; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreview audiencePreview = (AudiencePreview) o; - return Objects.equals(this.id, audiencePreview.id) - && Objects.equals(this.audienceType, audiencePreview.audienceType) - && Objects.equals(this.definition, audiencePreview.definition) - && Objects.equals(this.options, audiencePreview.options) - && Objects.equals(this.status, audiencePreview.status) - && Objects.equals(this.results, audiencePreview.results) - && Objects.equals(this.size, audiencePreview.size) - && Objects.equals(this.failureReason, audiencePreview.failureReason); - } - - @Override - public int hashCode() { - return Objects.hash( - id, audienceType, definition, options, status, results, size, failureReason); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreview {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - openapiFields.add("status"); - openapiFields.add("results"); - openapiFields.add("size"); - openapiFields.add("failureReason"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreview - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreview.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreview is not found in the" - + " empty JSON string", - AudiencePreview.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreview.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreview` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreview.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - ReadAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - if (jsonArrayresults != null) { - // ensure the json data is an array - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `results` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("results").toString())); - } - - // validate the optional field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); - } - ; - } - } - // validate the optional field `size` - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { - AudienceSize.validateJsonElement(jsonObj.get("size")); - } - if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) - && !jsonObj.get("failureReason").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `failureReason` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("failureReason").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreview' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreview.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreview value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreview read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreview given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreview - * @throws IOException if the JSON string is invalid with respect to AudiencePreview - */ - public static AudiencePreview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreview.class); - } - - /** - * Convert an instance of AudiencePreview to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSize.java b/src/main/java/com/segment/publicapi/models/AudienceSize.java deleted file mode 100644 index 51d2a3af..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSize.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceSize */ -public class AudienceSize { - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - /** The unit type for the count(s) being returned. */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public AudienceSize() {} - - public AudienceSize count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The total audience membership count. Refer to the type field to determine the unit for this - * field (profiles, accounts, etc). - * - * @return count - */ - @javax.annotation.Nonnull - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - public AudienceSize type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The unit type for the count(s) being returned. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSize audienceSize = (AudienceSize) o; - return Objects.equals(this.count, audienceSize.count) - && Objects.equals(this.type, audienceSize.type); - } - - @Override - public int hashCode() { - return Objects.hash(count, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSize {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("count"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceSize - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSize.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceSize is not found in the empty" - + " JSON string", - AudienceSize.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSize.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSize` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceSize.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSize.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceSize' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceSize.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceSize value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSize read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSize given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSize - * @throws IOException if the JSON string is invalid with respect to AudienceSize - */ - public static AudienceSize fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceSize.class); - } - - /** - * Convert an instance of AudienceSize to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 978075eb..88b7b297 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -88,11 +88,6 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -201,26 +196,6 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } - public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nullable - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -497,7 +472,6 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) @@ -524,7 +498,6 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, - size, options, id, spaceId, @@ -546,7 +519,6 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); @@ -583,7 +555,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); - openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("id"); openapiFields.add("spaceId"); @@ -669,10 +640,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `size` - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { - AudienceSize.validateJsonElement(jsonObj.get("size")); - } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java deleted file mode 100644 index bdbd349b..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** CreateAudiencePreview200Response */ -public class CreateAudiencePreview200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CreateAudiencePreviewAlphaOutput data; - - public CreateAudiencePreview200Response() {} - - public CreateAudiencePreview200Response data(CreateAudiencePreviewAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public CreateAudiencePreviewAlphaOutput getData() { - return data; - } - - public void setData(CreateAudiencePreviewAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAudiencePreview200Response createAudiencePreview200Response = - (CreateAudiencePreview200Response) o; - return Objects.equals(this.data, createAudiencePreview200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreview200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreview200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAudiencePreview200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAudiencePreview200Response is" - + " not found in the empty JSON string", - CreateAudiencePreview200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAudiencePreview200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreview200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CreateAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreview200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreview200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAudiencePreview200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAudiencePreview200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAudiencePreview200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAudiencePreview200Response - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreview200Response - */ - public static CreateAudiencePreview200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreview200Response.class); - } - - /** - * Convert an instance of CreateAudiencePreview200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java deleted file mode 100644 index efae7afe..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output when creating an audience preview. */ -public class CreateAudiencePreviewAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) - private AudiencePreviewIdentifier audiencePreview; - - public CreateAudiencePreviewAlphaOutput() {} - - public CreateAudiencePreviewAlphaOutput audiencePreview( - AudiencePreviewIdentifier audiencePreview) { - - this.audiencePreview = audiencePreview; - return this; - } - - /** - * Get audiencePreview - * - * @return audiencePreview - */ - @javax.annotation.Nonnull - public AudiencePreviewIdentifier getAudiencePreview() { - return audiencePreview; - } - - public void setAudiencePreview(AudiencePreviewIdentifier audiencePreview) { - this.audiencePreview = audiencePreview; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAudiencePreviewAlphaOutput createAudiencePreviewAlphaOutput = - (CreateAudiencePreviewAlphaOutput) o; - return Objects.equals( - this.audiencePreview, createAudiencePreviewAlphaOutput.audiencePreview); - } - - @Override - public int hashCode() { - return Objects.hash(audiencePreview); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreviewAlphaOutput {\n"); - sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audiencePreview"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audiencePreview"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreviewAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAudiencePreviewAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAudiencePreviewAlphaOutput is" - + " not found in the empty JSON string", - CreateAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreviewAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateAudiencePreviewAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `audiencePreview` - AudiencePreviewIdentifier.validateJsonElement(jsonObj.get("audiencePreview")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreviewAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreviewAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAudiencePreviewAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAudiencePreviewAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAudiencePreviewAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAudiencePreviewAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreviewAlphaOutput - */ - public static CreateAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaOutput.class); - } - - /** - * Convert an instance of CreateAudiencePreviewAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java deleted file mode 100644 index fbaee4a4..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Options which should be applied when segmenting audience previews. */ -public class CreateAudiencePreviewOptions { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds; - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public CreateAudiencePreviewOptions() {} - - public CreateAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public CreateAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience preview membership. - * Profiles will only be considered for audience preview membership if the profile has at least - * one external id whose key matches a value in this set. If unspecified, a default set of - * external identifiers will be used: `['user_id', 'email', - * 'android.idfa', 'ios.idfa']`. - * - * @return filterByExternalIds - */ - @javax.annotation.Nullable - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public CreateAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days (specified from the date - * the audience preview was created) that event data will be included from when determining - * audience preview membership. If not specified, the default is set to the maximum event window - * size, or 7 days if no window condition is defined. Note that this is applied on a best-effort - * basis and may not always be applicable. In such cases, the response will not return a - * backfillEventDataDays value, and all available data will be taken into account. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAudiencePreviewOptions createAudiencePreviewOptions = - (CreateAudiencePreviewOptions) o; - return Objects.equals( - this.filterByExternalIds, createAudiencePreviewOptions.filterByExternalIds) - && Objects.equals( - this.backfillEventDataDays, - createAudiencePreviewOptions.backfillEventDataDays); - } - - @Override - public int hashCode() { - return Objects.hash(filterByExternalIds, backfillEventDataDays); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreviewOptions {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("backfillEventDataDays"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreviewOptions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAudiencePreviewOptions.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAudiencePreviewOptions is not" - + " found in the empty JSON string", - CreateAudiencePreviewOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreviewOptions` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("filterByExternalIds") != null - && !jsonObj.get("filterByExternalIds").isJsonNull() - && !jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreviewOptions' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreviewOptions.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAudiencePreviewOptions value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAudiencePreviewOptions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAudiencePreviewOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAudiencePreviewOptions - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreviewOptions - */ - public static CreateAudiencePreviewOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewOptions.class); - } - - /** - * Convert an instance of CreateAudiencePreviewOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java deleted file mode 100644 index 91363b74..00000000 --- a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output when reading an audience preview. */ -public class GetAudiencePreviewAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) - private AudiencePreview audiencePreview; - - public GetAudiencePreviewAlphaOutput() {} - - public GetAudiencePreviewAlphaOutput audiencePreview(AudiencePreview audiencePreview) { - - this.audiencePreview = audiencePreview; - return this; - } - - /** - * Get audiencePreview - * - * @return audiencePreview - */ - @javax.annotation.Nonnull - public AudiencePreview getAudiencePreview() { - return audiencePreview; - } - - public void setAudiencePreview(AudiencePreview audiencePreview) { - this.audiencePreview = audiencePreview; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAudiencePreviewAlphaOutput getAudiencePreviewAlphaOutput = - (GetAudiencePreviewAlphaOutput) o; - return Objects.equals(this.audiencePreview, getAudiencePreviewAlphaOutput.audiencePreview); - } - - @Override - public int hashCode() { - return Objects.hash(audiencePreview); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAudiencePreviewAlphaOutput {\n"); - sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audiencePreview"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audiencePreview"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetAudiencePreviewAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetAudiencePreviewAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetAudiencePreviewAlphaOutput is not" - + " found in the empty JSON string", - GetAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAudiencePreviewAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetAudiencePreviewAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `audiencePreview` - AudiencePreview.validateJsonElement(jsonObj.get("audiencePreview")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAudiencePreviewAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetAudiencePreviewAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAudiencePreviewAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAudiencePreviewAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetAudiencePreviewAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAudiencePreviewAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * GetAudiencePreviewAlphaOutput - */ - public static GetAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAudiencePreviewAlphaOutput.class); - } - - /** - * Convert an instance of GetAudiencePreviewAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java b/src/main/java/com/segment/publicapi/models/Preview.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java rename to src/main/java/com/segment/publicapi/models/Preview.java index ce5cbfb0..a1b63f84 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java +++ b/src/main/java/com/segment/publicapi/models/Preview.java @@ -27,23 +27,23 @@ import java.util.Objects; import java.util.Set; -/** Result membership object for an audience preview. */ -public class AudiencePreviewResult { +/** Preview */ +public class Preview { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; - public AudiencePreviewResult() {} + public Preview() {} - public AudiencePreviewResult id(String id) { + public Preview id(String id) { this.id = id; return this; } /** - * Segment id or account id. + * Unique identifier for tracking and retrieving results of the preview. * * @return id */ @@ -64,8 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; - return Objects.equals(this.id, audiencePreviewResult.id); + Preview preview = (Preview) o; + return Objects.equals(this.id, preview.id); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewResult {\n"); + sb.append("class Preview {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,34 +110,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult + * @throws IOException if the JSON Element is invalid with respect to Preview */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AudiencePreviewResult.openapiRequiredFields + if (!Preview.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AudiencePreviewResult is not found in" - + " the empty JSON string", - AudiencePreviewResult.openapiRequiredFields.toString())); + "The required field(s) %s in Preview is not found in the empty JSON" + + " string", + Preview.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { + if (!Preview.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewResult` properties. JSON: %s", + "The field `%s` in the JSON string is not defined in the `Preview`" + + " properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { + for (String requiredField : Preview.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -159,24 +159,23 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewResult' and its subtypes + if (!Preview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Preview' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Preview.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AudiencePreviewResult value) - throws IOException { + public void write(JsonWriter out, Preview value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AudiencePreviewResult read(JsonReader in) throws IOException { + public Preview read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -186,18 +185,18 @@ public AudiencePreviewResult read(JsonReader in) throws IOException { } /** - * Create an instance of AudiencePreviewResult given an JSON string + * Create an instance of Preview given an JSON string * * @param jsonString JSON string - * @return An instance of AudiencePreviewResult - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewResult + * @return An instance of Preview + * @throws IOException if the JSON string is invalid with respect to Preview */ - public static AudiencePreviewResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewResult.class); + public static Preview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Preview.class); } /** - * Convert an instance of AudiencePreviewResult to an JSON string + * Convert an instance of Preview to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java similarity index 69% rename from src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java rename to src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java index e5b85f5b..da007f6e 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java +++ b/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** GetAudiencePreview200Response */ -public class GetAudiencePreview200Response { +/** PreviewAudience200Response */ +public class PreviewAudience200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetAudiencePreviewAlphaOutput data; + private PreviewAudienceOutput data; - public GetAudiencePreview200Response() {} + public PreviewAudience200Response() {} - public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { + public PreviewAudience200Response data(PreviewAudienceOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { * @return data */ @javax.annotation.Nullable - public GetAudiencePreviewAlphaOutput getData() { + public PreviewAudienceOutput getData() { return data; } - public void setData(GetAudiencePreviewAlphaOutput data) { + public void setData(PreviewAudienceOutput data) { this.data = data; } @@ -64,9 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetAudiencePreview200Response getAudiencePreview200Response = - (GetAudiencePreview200Response) o; - return Objects.equals(this.data, getAudiencePreview200Response.data); + PreviewAudience200Response previewAudience200Response = (PreviewAudience200Response) o; + return Objects.equals(this.data, previewAudience200Response.data); } @Override @@ -77,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetAudiencePreview200Response {\n"); + sb.append("class PreviewAudience200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,36 +109,35 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetAudiencePreview200Response + * @throws IOException if the JSON Element is invalid with respect to PreviewAudience200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetAudiencePreview200Response.openapiRequiredFields + if (!PreviewAudience200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in GetAudiencePreview200Response is not" + "The required field(s) %s in PreviewAudience200Response is not" + " found in the empty JSON string", - GetAudiencePreview200Response.openapiRequiredFields.toString())); + PreviewAudience200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!GetAudiencePreview200Response.openapiFields.contains(entry.getKey())) { + if (!PreviewAudience200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `GetAudiencePreview200Response` properties. JSON: %s", + + " `PreviewAudience200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); + PreviewAudienceOutput.validateJsonElement(jsonObj.get("data")); } } @@ -147,27 +145,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAudiencePreview200Response' and its + if (!PreviewAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudience200Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetAudiencePreview200Response.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudience200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, GetAudiencePreview200Response value) + public void write(JsonWriter out, PreviewAudience200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public GetAudiencePreview200Response read(JsonReader in) - throws IOException { + public PreviewAudience200Response read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -177,19 +173,18 @@ public GetAudiencePreview200Response read(JsonReader in) } /** - * Create an instance of GetAudiencePreview200Response given an JSON string + * Create an instance of PreviewAudience200Response given an JSON string * * @param jsonString JSON string - * @return An instance of GetAudiencePreview200Response - * @throws IOException if the JSON string is invalid with respect to - * GetAudiencePreview200Response + * @return An instance of PreviewAudience200Response + * @throws IOException if the JSON string is invalid with respect to PreviewAudience200Response */ - public static GetAudiencePreview200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAudiencePreview200Response.class); + public static PreviewAudience200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudience200Response.class); } /** - * Convert an instance of GetAudiencePreview200Response to an JSON string + * Convert an instance of PreviewAudience200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java rename to src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java index 4a1aeaa2..b38d1ddf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java @@ -28,8 +28,8 @@ import java.util.Objects; import java.util.Set; -/** Input to create an audience preview. */ -public class CreateAudiencePreviewAlphaInput { +/** Input to preview an audience. */ +public class PreviewAudienceInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) @@ -89,11 +89,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private CreateAudiencePreviewOptions options; + private AudienceOptionsWithLookback options; - public CreateAudiencePreviewAlphaInput() {} + public PreviewAudienceInput() {} - public CreateAudiencePreviewAlphaInput definition(AudienceDefinitionWithoutType definition) { + public PreviewAudienceInput definition(AudienceDefinitionWithoutType definition) { this.definition = definition; return this; @@ -113,7 +113,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceType) { + public PreviewAudienceInput audienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; return this; @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions options) { + public PreviewAudienceInput options(AudienceOptionsWithLookback options) { this.options = options; return this; @@ -145,11 +145,11 @@ public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions opti * @return options */ @javax.annotation.Nullable - public CreateAudiencePreviewOptions getOptions() { + public AudienceOptionsWithLookback getOptions() { return options; } - public void setOptions(CreateAudiencePreviewOptions options) { + public void setOptions(AudienceOptionsWithLookback options) { this.options = options; } @@ -161,11 +161,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = - (CreateAudiencePreviewAlphaInput) o; - return Objects.equals(this.definition, createAudiencePreviewAlphaInput.definition) - && Objects.equals(this.audienceType, createAudiencePreviewAlphaInput.audienceType) - && Objects.equals(this.options, createAudiencePreviewAlphaInput.options); + PreviewAudienceInput previewAudienceInput = (PreviewAudienceInput) o; + return Objects.equals(this.definition, previewAudienceInput.definition) + && Objects.equals(this.audienceType, previewAudienceInput.audienceType) + && Objects.equals(this.options, previewAudienceInput.options); } @Override @@ -176,7 +175,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreviewAlphaInput {\n"); + sb.append("class PreviewAudienceInput {\n"); sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); @@ -215,35 +214,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreviewAlphaInput + * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CreateAudiencePreviewAlphaInput.openapiRequiredFields + if (!PreviewAudienceInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CreateAudiencePreviewAlphaInput is not" - + " found in the empty JSON string", - CreateAudiencePreviewAlphaInput.openapiRequiredFields.toString())); + "The required field(s) %s in PreviewAudienceInput is not found in" + + " the empty JSON string", + PreviewAudienceInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!CreateAudiencePreviewAlphaInput.openapiFields.contains(entry.getKey())) { + if (!PreviewAudienceInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreviewAlphaInput` properties. JSON: %s", + + " `PreviewAudienceInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateAudiencePreviewAlphaInput.openapiRequiredFields) { + for (String requiredField : PreviewAudienceInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -263,7 +261,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - CreateAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); } } @@ -271,27 +269,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreviewAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreviewAlphaInput' and its - // subtypes + if (!PreviewAudienceInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudienceInput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreviewAlphaInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateAudiencePreviewAlphaInput value) + public void write(JsonWriter out, PreviewAudienceInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CreateAudiencePreviewAlphaInput read(JsonReader in) - throws IOException { + public PreviewAudienceInput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -301,19 +296,18 @@ public CreateAudiencePreviewAlphaInput read(JsonReader in) } /** - * Create an instance of CreateAudiencePreviewAlphaInput given an JSON string + * Create an instance of PreviewAudienceInput given an JSON string * * @param jsonString JSON string - * @return An instance of CreateAudiencePreviewAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreviewAlphaInput + * @return An instance of PreviewAudienceInput + * @throws IOException if the JSON string is invalid with respect to PreviewAudienceInput */ - public static CreateAudiencePreviewAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaInput.class); + public static PreviewAudienceInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudienceInput.class); } /** - * Convert an instance of CreateAudiencePreviewAlphaInput to an JSON string + * Convert an instance of PreviewAudienceInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java b/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java similarity index 64% rename from src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java rename to src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java index 5fadb72a..fefc0eb9 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java +++ b/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java @@ -27,33 +27,33 @@ import java.util.Objects; import java.util.Set; -/** Identifier for an audience preview. */ -public class AudiencePreviewIdentifier { - public static final String SERIALIZED_NAME_ID = "id"; +/** PreviewAudienceOutput */ +public class PreviewAudienceOutput { + public static final String SERIALIZED_NAME_PREVIEW = "preview"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + @SerializedName(SERIALIZED_NAME_PREVIEW) + private Preview preview; - public AudiencePreviewIdentifier() {} + public PreviewAudienceOutput() {} - public AudiencePreviewIdentifier id(String id) { + public PreviewAudienceOutput preview(Preview preview) { - this.id = id; + this.preview = preview; return this; } /** - * Unique identifier for tracking and retrieving results of an audience preview. + * Get preview * - * @return id + * @return preview */ @javax.annotation.Nonnull - public String getId() { - return id; + public Preview getPreview() { + return preview; } - public void setId(String id) { - this.id = id; + public void setPreview(Preview preview) { + this.preview = preview; } @Override @@ -64,20 +64,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AudiencePreviewIdentifier audiencePreviewIdentifier = (AudiencePreviewIdentifier) o; - return Objects.equals(this.id, audiencePreviewIdentifier.id); + PreviewAudienceOutput previewAudienceOutput = (PreviewAudienceOutput) o; + return Objects.equals(this.preview, previewAudienceOutput.preview); } @Override public int hashCode() { - return Objects.hash(id); + return Objects.hash(preview); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewIdentifier {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("class PreviewAudienceOutput {\n"); + sb.append(" preview: ").append(toIndentedString(preview)).append("\n"); sb.append("}"); return sb.toString(); } @@ -99,45 +99,45 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); + openapiFields.add("preview"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); + openapiRequiredFields.add("preview"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewIdentifier + * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AudiencePreviewIdentifier.openapiRequiredFields + if (!PreviewAudienceOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AudiencePreviewIdentifier is not found" - + " in the empty JSON string", - AudiencePreviewIdentifier.openapiRequiredFields.toString())); + "The required field(s) %s in PreviewAudienceOutput is not found in" + + " the empty JSON string", + PreviewAudienceOutput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AudiencePreviewIdentifier.openapiFields.contains(entry.getKey())) { + if (!PreviewAudienceOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewIdentifier` properties. JSON: %s", + + " `PreviewAudienceOutput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewIdentifier.openapiRequiredFields) { + for (String requiredField : PreviewAudienceOutput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -146,38 +146,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } + // validate the required field `preview` + Preview.validateJsonElement(jsonObj.get("preview")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewIdentifier.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewIdentifier' and its - // subtypes + if (!PreviewAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudienceOutput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewIdentifier.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AudiencePreviewIdentifier value) + public void write(JsonWriter out, PreviewAudienceOutput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AudiencePreviewIdentifier read(JsonReader in) throws IOException { + public PreviewAudienceOutput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -187,18 +181,18 @@ public AudiencePreviewIdentifier read(JsonReader in) throws IOException { } /** - * Create an instance of AudiencePreviewIdentifier given an JSON string + * Create an instance of PreviewAudienceOutput given an JSON string * * @param jsonString JSON string - * @return An instance of AudiencePreviewIdentifier - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewIdentifier + * @return An instance of PreviewAudienceOutput + * @throws IOException if the JSON string is invalid with respect to PreviewAudienceOutput */ - public static AudiencePreviewIdentifier fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewIdentifier.class); + public static PreviewAudienceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudienceOutput.class); } /** - * Convert an instance of AudiencePreviewIdentifier to an JSON string + * Convert an instance of PreviewAudienceOutput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java deleted file mode 100644 index 3acc03b6..00000000 --- a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Options which should be applied when segmenting audience previews. */ -public class ReadAudiencePreviewOptions { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) - private Boolean includeHistoricalData; - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public ReadAudiencePreviewOptions() {} - - public ReadAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public ReadAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience preview membership. - * Profiles will only be considered for audience preview membership if the profile has at least - * one external id whose key matches a value in this set. - * - * @return filterByExternalIds - */ - @javax.annotation.Nonnull - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public ReadAudiencePreviewOptions includeHistoricalData(Boolean includeHistoricalData) { - - this.includeHistoricalData = includeHistoricalData; - return this; - } - - /** - * Determines whether data prior to the audience preview being created is included when - * determining audience preview membership. Note that including historical data may be needed in - * order to properly handle the definition specified. In these cases, Segment will automatically - * handle including historical data and the response will return the includeHistoricalData - * parameter as true. - * - * @return includeHistoricalData - */ - @javax.annotation.Nonnull - public Boolean getIncludeHistoricalData() { - return includeHistoricalData; - } - - public void setIncludeHistoricalData(Boolean includeHistoricalData) { - this.includeHistoricalData = includeHistoricalData; - } - - public ReadAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days (specified from the date - * the audience preview was created) that event data will be included from when determining - * audience preview membership. If unspecified, defer to the value of - * `includeHistoricalData` to determine whether historical data is either entirely - * included or entirely excluded when determining audience preview membership. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadAudiencePreviewOptions readAudiencePreviewOptions = (ReadAudiencePreviewOptions) o; - return Objects.equals( - this.filterByExternalIds, readAudiencePreviewOptions.filterByExternalIds) - && Objects.equals( - this.includeHistoricalData, - readAudiencePreviewOptions.includeHistoricalData) - && Objects.equals( - this.backfillEventDataDays, - readAudiencePreviewOptions.backfillEventDataDays); - } - - @Override - public int hashCode() { - return Objects.hash(filterByExternalIds, includeHistoricalData, backfillEventDataDays); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadAudiencePreviewOptions {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" includeHistoricalData: ") - .append(toIndentedString(includeHistoricalData)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("includeHistoricalData"); - openapiFields.add("backfillEventDataDays"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filterByExternalIds"); - openapiRequiredFields.add("includeHistoricalData"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReadAudiencePreviewOptions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReadAudiencePreviewOptions.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReadAudiencePreviewOptions is not" - + " found in the empty JSON string", - ReadAudiencePreviewOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReadAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReadAudiencePreviewOptions` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReadAudiencePreviewOptions.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("filterByExternalIds") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReadAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReadAudiencePreviewOptions' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ReadAudiencePreviewOptions.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReadAudiencePreviewOptions value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReadAudiencePreviewOptions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReadAudiencePreviewOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadAudiencePreviewOptions - * @throws IOException if the JSON string is invalid with respect to ReadAudiencePreviewOptions - */ - public static ReadAudiencePreviewOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReadAudiencePreviewOptions.class); - } - - /** - * Convert an instance of ReadAudiencePreviewOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 560ada9c580f71322b40b0928c612132d466156d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 27 Jun 2025 06:00:21 +0000 Subject: [PATCH 447/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@8f104019. --- README.md | 8 +- docs/AudiencesApi.md | 176 +++++- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 22 + .../segment/publicapi/api/AudiencesApi.java | 569 ++++++++++++++++-- .../publicapi/models/AudienceSchedule.java | 407 +++++++++++++ ...nceSummaryWithAudienceTypeAndLookback.java | 61 ++ .../com/segment/publicapi/models/Config.java | 286 ++------- .../com/segment/publicapi/models/Config1.java | 453 ++++++++++++++ ...heduleFromSpaceAndAudience200Response.java | 215 +++++++ ...heduleFromSpaceAndAudienceAlphaOutput.java | 226 +++++++ ...edulesFromSpaceAndAudience200Response.java | 216 +++++++ ...edulesFromSpaceAndAudienceAlphaOutput.java | 254 ++++++++ .../publicapi/models/PeriodicConfig.java | 207 +++++++ .../models/ReverseEtlScheduleDefinition.java | 10 +- .../publicapi/models/SpecificDaysConfig.java | 308 ++++++++++ 18 files changed, 3117 insertions(+), 307 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSchedule.java create mode 100644 src/main/java/com/segment/publicapi/models/Config1.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/PeriodicConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java diff --git a/README.md b/README.md index 9af6d601..87d966f8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.6.0 +Latest API and SDK version: 58.7.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.6.0 + 58.7.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.6.0" + implementation "com.segment.publicapi:segment-publicapi:58.7.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.6.0.jar` +* `target/segment-publicapi-58.7.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 067854e8..e1881a0a 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -6,7 +6,9 @@ All URIs are relative to *https://api.segmentapis.com* |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | +| [**getAudienceScheduleFromSpaceAndAudience**](AudiencesApi.md#getAudienceScheduleFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules/{scheduleId} | Get Audience Schedule from Space And Audience | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | +| [**listAudienceSchedulesFromSpaceAndAudience**](AudiencesApi.md#listAudienceSchedulesFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules | List Audience Schedules from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | | [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | @@ -91,11 +93,11 @@ public class Example { ## Operation: getAudience -> GetAudience200Response getAudience(spaceId, id) +> GetAudience200Response getAudience(spaceId, id, include) Get Audience -Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the Audience by id and spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -118,9 +120,10 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "id"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { - GetAudience200Response result = apiInstance.getAudience(spaceId, id); + GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#getAudience"); @@ -140,6 +143,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type @@ -164,6 +168,83 @@ public class Example { | **429** | Too many requests | - | +## Operation: getAudienceScheduleFromSpaceAndAudience + +> GetAudienceScheduleFromSpaceAndAudience200Response getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId) + +Get Audience Schedule from Space And Audience + +Returns the schedule for the given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + try { + GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#getAudienceScheduleFromSpaceAndAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **id** | **String**| | | +| **scheduleId** | **String**| | | + +### Return type + +[**GetAudienceScheduleFromSpaceAndAudience200Response**](GetAudienceScheduleFromSpaceAndAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: listAudienceConsumersFromSpaceAndAudience > ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) @@ -245,13 +326,88 @@ public class Example { | **429** | Too many requests | - | +## Operation: listAudienceSchedulesFromSpaceAndAudience + +> ListAudienceSchedulesFromSpaceAndAudience200Response listAudienceSchedulesFromSpaceAndAudience(spaceId, id) + +List Audience Schedules from Space And Audience + +Returns the list of schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + try { + ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#listAudienceSchedulesFromSpaceAndAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **id** | **String**| | | + +### Return type + +[**ListAudienceSchedulesFromSpaceAndAudience200Response**](ListAudienceSchedulesFromSpaceAndAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: listAudiences -> ListAudiences200Response listAudiences(spaceId, pagination) +> ListAudiences200Response listAudiences(spaceId, pagination, include) List Audiences -Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns Audiences by spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -275,8 +431,9 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#listAudiences"); @@ -296,6 +453,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type @@ -424,7 +582,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -499,7 +657,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/pom.xml b/pom.xml index 15cc847b..6a340ede 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.6.0 + 58.7.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 7737bb6e..d731c05a 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.6.0 (Java)"); + setUserAgent("Public API SDK 58.7.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 799812c9..f95a82b6 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.6.0"; + public static final String VERSION = "58.7.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 9a4de509..1008ce13 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -175,6 +175,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptionsWithLookback .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSchedule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -211,6 +213,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Config1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -655,6 +659,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); @@ -906,6 +916,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudienceConsumersSortInput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListAudienceSchedulesFromSpaceAndAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response .CustomTypeAdapterFactory()); @@ -1201,6 +1219,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PeriodicConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1448,6 +1468,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SpecificDaysConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 567267b3..3a996cb4 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -21,9 +21,11 @@ import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; +import com.segment.publicapi.models.ListAudienceSchedulesFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; @@ -289,6 +291,8 @@ public okhttp3.Call createAudienceAsync( * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -301,7 +305,8 @@ public okhttp3.Call createAudienceAsync( * 429 Too many requests - * */ - public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback _callback) + public okhttp3.Call getAudienceCall( + String spaceId, String id, String include, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -332,6 +337,10 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + final String[] localVarAccepts = { "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json", @@ -366,7 +375,8 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call getAudienceValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { + String spaceId, String id, String include, final ApiCallback _callback) + throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -379,21 +389,24 @@ private okhttp3.Call getAudienceValidateBeforeCall( "Missing the required parameter 'id' when calling getAudience(Async)"); } - return getAudienceCall(spaceId, id, _callback); + return getAudienceCall(spaceId, id, include, _callback); } /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules + * via `?include=schedules`. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 100 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return GetAudience200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -406,23 +419,28 @@ private okhttp3.Call getAudienceValidateBeforeCall( * 429 Too many requests - * */ - public GetAudience200Response getAudience(String spaceId, String id) throws ApiException { - ApiResponse localVarResp = getAudienceWithHttpInfo(spaceId, id); + public GetAudience200Response getAudience(String spaceId, String id, String include) + throws ApiException { + ApiResponse localVarResp = + getAudienceWithHttpInfo(spaceId, id, include); return localVarResp.getData(); } /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules + * via `?include=schedules`. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 100 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return ApiResponse<GetAudience200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -435,25 +453,28 @@ public GetAudience200Response getAudience(String spaceId, String id) throws ApiE * 429 Too many requests - * */ - public ApiResponse getAudienceWithHttpInfo(String spaceId, String id) - throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, null); + public ApiResponse getAudienceWithHttpInfo( + String spaceId, String id, String include) throws ApiException { + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in - * **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 100 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * Get Audience (asynchronously) Returns the Audience by id and spaceId. Supports including + * audience schedules via `?include=schedules`. • This endpoint is in **Beta** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -468,15 +489,231 @@ public ApiResponse getAudienceWithHttpInfo(String spaceI * */ public okhttp3.Call getAudienceAsync( - String spaceId, String id, final ApiCallback _callback) + String spaceId, + String id, + String include, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, _callback); + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getAudienceScheduleFromSpaceAndAudience + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceCall( + String spaceId, String id, String scheduleId, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}/schedules/{scheduleId}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())) + .replace( + "{" + "scheduleId" + "}", + localVarApiClient.escapeString(scheduleId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( + String spaceId, String id, String scheduleId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getAudienceScheduleFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " getAudienceScheduleFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'scheduleId' is set + if (scheduleId == null) { + throw new ApiException( + "Missing the required parameter 'scheduleId' when calling" + + " getAudienceScheduleFromSpaceAndAudience(Async)"); + } + + return getAudienceScheduleFromSpaceAndAudienceCall(spaceId, id, scheduleId, _callback); + } + + /** + * Get Audience Schedule from Space And Audience Returns the schedule for the given audience and + * scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @return GetAudienceScheduleFromSpaceAndAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudienceScheduleFromSpaceAndAudience200Response + getAudienceScheduleFromSpaceAndAudience(String spaceId, String id, String scheduleId) + throws ApiException { + ApiResponse localVarResp = + getAudienceScheduleFromSpaceAndAudienceWithHttpInfo(spaceId, id, scheduleId); + return localVarResp.getData(); + } + + /** + * Get Audience Schedule from Space And Audience Returns the schedule for the given audience and + * scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @return ApiResponse<GetAudienceScheduleFromSpaceAndAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + getAudienceScheduleFromSpaceAndAudienceWithHttpInfo( + String spaceId, String id, String scheduleId) throws ApiException { + okhttp3.Call localVarCall = + getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( + spaceId, id, scheduleId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience Schedule from Space And Audience (asynchronously) Returns the schedule for the + * given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceAsync( + String spaceId, + String id, + String scheduleId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( + spaceId, id, scheduleId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudienceConsumersFromSpaceAndAudience * @@ -742,6 +979,200 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( return localVarCall; } + /** + * Build call for listAudienceSchedulesFromSpaceAndAudience + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}/schedules" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listAudienceSchedulesFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " listAudienceSchedulesFromSpaceAndAudience(Async)"); + } + + return listAudienceSchedulesFromSpaceAndAudienceCall(spaceId, id, _callback); + } + + /** + * List Audience Schedules from Space And Audience Returns the list of schedules for the given + * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ListAudienceSchedulesFromSpaceAndAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListAudienceSchedulesFromSpaceAndAudience200Response + listAudienceSchedulesFromSpaceAndAudience(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + listAudienceSchedulesFromSpaceAndAudienceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * List Audience Schedules from Space And Audience Returns the list of schedules for the given + * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<ListAudienceSchedulesFromSpaceAndAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listAudienceSchedulesFromSpaceAndAudienceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = + listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audience Schedules from Space And Audience (asynchronously) Returns the list of + * schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceAsync( + String spaceId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudiences * @@ -749,6 +1180,8 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -762,7 +1195,10 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, + ListAudiencesPaginationInput pagination, + String include, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -796,6 +1232,10 @@ public okhttp3.Call listAudiencesCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + final String[] localVarAccepts = { "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json", @@ -830,7 +1270,10 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, + ListAudiencesPaginationInput pagination, + String include, + final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -838,23 +1281,26 @@ private okhttp3.Call listAudiencesValidateBeforeCall( "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); } - return listAudiencesCall(spaceId, pagination, _callback); + return listAudiencesCall(spaceId, pagination, include, _callback); } /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 25 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * List Audiences Returns Audiences by spaceId. Supports including audience schedules via + * `?include=schedules`. • This endpoint is in **Beta** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return ListAudiences200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -868,26 +1314,30 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * */ public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + String spaceId, ListAudiencesPaginationInput pagination, String include) + throws ApiException { ApiResponse localVarResp = - listAudiencesWithHttpInfo(spaceId, pagination); + listAudiencesWithHttpInfo(spaceId, pagination, include); return localVarResp.getData(); } /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 25 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * List Audiences Returns Audiences by spaceId. Supports including audience schedules via + * `?include=schedules`. • This endpoint is in **Beta** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return ApiResponse<ListAudiences200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -901,15 +1351,18 @@ public ListAudiences200Response listAudiences( * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); + String spaceId, ListAudiencesPaginationInput pagination, String include) + throws ApiException { + okhttp3.Call localVarCall = + listAudiencesValidateBeforeCall(spaceId, pagination, include, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Beta** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * List Audiences (asynchronously) Returns Audiences by spaceId. Supports including audience + * schedules via `?include=schedules`. • This endpoint is in **Beta** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate * limit for this endpoint is 25 requests per minute, which is lower than the default due to @@ -921,6 +1374,8 @@ public ApiResponse listAudiencesWithHttpInfo( * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -937,10 +1392,12 @@ public ApiResponse listAudiencesWithHttpInfo( public okhttp3.Call listAudiencesAsync( String spaceId, ListAudiencesPaginationInput pagination, + String include, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, _callback); + okhttp3.Call localVarCall = + listAudiencesValidateBeforeCall(spaceId, pagination, include, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java new file mode 100644 index 00000000..043245e1 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java @@ -0,0 +1,407 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Defines an Audience Schedule. */ +public class AudienceSchedule { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** Strategy of the audience schedule (manual, periodic, or specific days). */ + @JsonAdapter(StrategyEnum.Adapter.class) + public enum StrategyEnum { + MANUAL("MANUAL"), + + PERIODIC("PERIODIC"), + + SPECIFIC_DAYS("SPECIFIC_DAYS"); + + private String value; + + StrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrategyEnum fromValue(String value) { + for (StrategyEnum b : StrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + + @SerializedName(SERIALIZED_NAME_STRATEGY) + private StrategyEnum strategy; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + private Config config; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_NEXT_EXECUTION = "nextExecution"; + + @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION) + private String nextExecution; + + public AudienceSchedule() {} + + public AudienceSchedule id(String id) { + + this.id = id; + return this; + } + + /** + * Distinct identifier for the schedule. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSchedule strategy(StrategyEnum strategy) { + + this.strategy = strategy; + return this; + } + + /** + * Strategy of the audience schedule (manual, periodic, or specific days). + * + * @return strategy + */ + @javax.annotation.Nonnull + public StrategyEnum getStrategy() { + return strategy; + } + + public void setStrategy(StrategyEnum strategy) { + this.strategy = strategy; + } + + public AudienceSchedule config(Config config) { + + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + public AudienceSchedule enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether the schedule is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AudienceSchedule nextExecution(String nextExecution) { + + this.nextExecution = nextExecution; + return this; + } + + /** + * The next scheduled execution time (RFC3339). + * + * @return nextExecution + */ + @javax.annotation.Nonnull + public String getNextExecution() { + return nextExecution; + } + + public void setNextExecution(String nextExecution) { + this.nextExecution = nextExecution; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSchedule audienceSchedule = (AudienceSchedule) o; + return Objects.equals(this.id, audienceSchedule.id) + && Objects.equals(this.strategy, audienceSchedule.strategy) + && Objects.equals(this.config, audienceSchedule.config) + && Objects.equals(this.enabled, audienceSchedule.enabled) + && Objects.equals(this.nextExecution, audienceSchedule.nextExecution); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, strategy, config, enabled, nextExecution); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSchedule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" nextExecution: ").append(toIndentedString(nextExecution)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("strategy"); + openapiFields.add("config"); + openapiFields.add("enabled"); + openapiFields.add("nextExecution"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("strategy"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("nextExecution"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSchedule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSchedule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSchedule is not found in the" + + " empty JSON string", + AudienceSchedule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSchedule.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSchedule` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSchedule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `strategy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("strategy").toString())); + } + // validate the optional field `config` + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + Config.validateJsonElement(jsonObj.get("config")); + } + if (!jsonObj.get("nextExecution").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nextExecution` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("nextExecution").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSchedule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSchedule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSchedule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSchedule value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSchedule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSchedule + * @throws IOException if the JSON string is invalid with respect to AudienceSchedule + */ + public static AudienceSchedule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSchedule.class); + } + + /** + * Convert an instance of AudienceSchedule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 88b7b297..30382a29 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -12,6 +12,7 @@ package com.segment.publicapi.models; import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -23,7 +24,9 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -93,6 +96,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OPTIONS) private AudienceOptionsWithLookback options; + public static final String SERIALIZED_NAME_SCHEDULES = "schedules"; + + @SerializedName(SERIALIZED_NAME_SCHEDULES) + private List schedules; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -216,6 +224,35 @@ public void setOptions(AudienceOptionsWithLookback options) { this.options = options; } + public AudienceSummaryWithAudienceTypeAndLookback schedules(List schedules) { + + this.schedules = schedules; + return this; + } + + public AudienceSummaryWithAudienceTypeAndLookback addSchedulesItem( + AudienceSchedule schedulesItem) { + if (this.schedules == null) { + this.schedules = new ArrayList<>(); + } + this.schedules.add(schedulesItem); + return this; + } + + /** + * List of schedules for the audience. + * + * @return schedules + */ + @javax.annotation.Nullable + public List getSchedules() { + return schedules; + } + + public void setSchedules(List schedules) { + this.schedules = schedules; + } + public AudienceSummaryWithAudienceTypeAndLookback id(String id) { this.id = id; @@ -473,6 +510,8 @@ public boolean equals(Object o) { this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) + && Objects.equals( + this.schedules, audienceSummaryWithAudienceTypeAndLookback.schedules) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) @@ -499,6 +538,7 @@ public int hashCode() { audienceType, computeCadence, options, + schedules, id, spaceId, name, @@ -520,6 +560,7 @@ public String toString() { sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -556,6 +597,7 @@ private String toIndentedString(Object o) { openapiFields.add("audienceType"); openapiFields.add("computeCadence"); openapiFields.add("options"); + openapiFields.add("schedules"); openapiFields.add("id"); openapiFields.add("spaceId"); openapiFields.add("name"); @@ -644,6 +686,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); } + if (jsonObj.get("schedules") != null && !jsonObj.get("schedules").isJsonNull()) { + JsonArray jsonArrayschedules = jsonObj.getAsJsonArray("schedules"); + if (jsonArrayschedules != null) { + // ensure the json data is an array + if (!jsonObj.get("schedules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schedules` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("schedules").toString())); + } + + // validate the optional field `schedules` (array) + for (int i = 0; i < jsonArrayschedules.size(); i++) { + AudienceSchedule.validateJsonElement(jsonArrayschedules.get(i)); + } + ; + } + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index a1455431..8327f000 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -37,22 +37,10 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'Config' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlDbtCloudScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); + final TypeAdapter adapterPeriodicConfig = + gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); + final TypeAdapter adapterSpecificDaysConfig = + gson.getDelegateAdapter(this, TypeToken.get(SpecificDaysConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -63,55 +51,25 @@ public void write(JsonWriter out, Config value) throws IOException { return; } - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { + // check if the actual instance is of the type `PeriodicConfig` + if (value.getActualInstance() instanceof PeriodicConfig) { JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); + adapterPeriodicConfig.toJsonTree( + (PeriodicConfig) value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { + // check if the actual instance is of the type `SpecificDaysConfig` + if (value.getActualInstance() instanceof SpecificDaysConfig) { JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlDbtCloudScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlDbtCloudScheduleConfig) { - JsonElement element = - adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( - (ReverseEtlDbtCloudScheduleConfig) - value.getActualInstance()); + adapterSpecificDaysConfig.toJsonTree( + (SpecificDaysConfig) value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," - + " ReverseEtlDbtCloudScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + + " PeriodicConfig, SpecificDaysConfig"); } @Override @@ -122,11 +80,11 @@ public Config read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize ReverseEtlPeriodicScheduleConfig + // deserialize PeriodicConfig try { // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + PeriodicConfig.validateJsonElement(jsonElement); + actualAdapter = adapterPeriodicConfig; Config ret = new Config(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -134,22 +92,19 @@ public Config read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", + "Deserialization for PeriodicConfig failed with" + + " `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", + "Input data does not match schema 'PeriodicConfig'", e); } - // deserialize ReverseEtlSpecificTimeScheduleConfig + // deserialize SpecificDaysConfig try { // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + SpecificDaysConfig.validateJsonElement(jsonElement); + actualAdapter = adapterSpecificDaysConfig; Config ret = new Config(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -157,57 +112,12 @@ public Config read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", + "Deserialization for SpecificDaysConfig failed with" + + " `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } - // deserialize ReverseEtlDbtCloudScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlDbtCloudScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlDbtCloudScheduleConfig'", + "Input data does not match schema 'SpecificDaysConfig'", e); } @@ -229,32 +139,19 @@ public Config() { super("anyOf", Boolean.TRUE); } - public Config(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config(ReverseEtlDbtCloudScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config(ReverseEtlPeriodicScheduleConfig o) { + public Config(PeriodicConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); } - public Config(ReverseEtlSpecificTimeScheduleConfig o) { + public Config(SpecificDaysConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); } static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); - schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); + schemas.put("PeriodicConfig", PeriodicConfig.class); + schemas.put("SpecificDaysConfig", SpecificDaysConfig.class); } @Override @@ -264,9 +161,7 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: PeriodicConfig, SpecificDaysConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -277,39 +172,24 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlCronScheduleConfig) { + if (instance instanceof PeriodicConfig) { super.setActualInstance(instance); return; } - if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { + if (instance instanceof SpecificDaysConfig) { super.setActualInstance(instance); return; } throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be PeriodicConfig, SpecificDaysConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: PeriodicConfig, SpecificDaysConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) + * @return The actual instance (PeriodicConfig, SpecificDaysConfig) */ @Override public Object getActualInstance() { @@ -317,51 +197,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * Get the actual instance of `PeriodicConfig`. If the actual instance is not `PeriodicConfig`, + * the ClassCastException will be thrown. * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + * @return The actual instance of `PeriodicConfig` + * @throws ClassCastException if the instance is not `PeriodicConfig` */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + public PeriodicConfig getPeriodicConfig() throws ClassCastException { + return (PeriodicConfig) super.getActualInstance(); } /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * Get the actual instance of `SpecificDaysConfig`. If the actual instance is not + * `SpecificDaysConfig`, the ClassCastException will be thrown. * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + * @return The actual instance of `SpecificDaysConfig` + * @throws ClassCastException if the instance is not `SpecificDaysConfig` */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not - * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` - */ - public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() - throws ClassCastException { - return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); + public SpecificDaysConfig getSpecificDaysConfig() throws ClassCastException { + return (SpecificDaysConfig) super.getActualInstance(); } /** @@ -373,61 +227,33 @@ public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate anyOf schemas one by one ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlCronScheduleConfig + // validate the json string with PeriodicConfig try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + PeriodicConfig.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + "Deserialization for PeriodicConfig failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with ReverseEtlDbtCloudScheduleConfig + // validate the json string with SpecificDaysConfig try { - ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + SpecificDaysConfig.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" - + " `%s`.", + "Deserialization for SpecificDaysConfig failed with `%s`.", e.getMessage())); // continue to the next one } throw new IOException( String.format( - "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", + "The JSON string is invalid for Config with anyOf schemas: PeriodicConfig," + + " SpecificDaysConfig. no class match the result, expected at least 1." + + " Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); } diff --git a/src/main/java/com/segment/publicapi/models/Config1.java b/src/main/java/com/segment/publicapi/models/Config1.java new file mode 100644 index 00000000..873f79bd --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Config1.java @@ -0,0 +1,453 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class Config1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Config1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Config1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Config1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlDbtCloudScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Config1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlDbtCloudScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlDbtCloudScheduleConfig) { + JsonElement element = + adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( + (ReverseEtlDbtCloudScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public Config1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } + // deserialize ReverseEtlDbtCloudScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlDbtCloudScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlDbtCloudScheduleConfig'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for Config1: no class matches" + + " result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public Config1() { + super("anyOf", Boolean.TRUE); + } + + public Config1(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config1(ReverseEtlDbtCloudScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config1(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config1(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); + schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); + } + + @Override + public Map> getSchemas() { + return Config1.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + /** + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not + * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` + */ + public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() + throws ClassCastException { + return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Config1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlDbtCloudScheduleConfig + try { + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for Config1 with anyOf schemas:" + + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of Config1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Config1 + * @throws IOException if the JSON string is invalid with respect to Config1 + */ + public static Config1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Config1.class); + } + + /** + * Convert an instance of Config1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java new file mode 100644 index 00000000..22661112 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java @@ -0,0 +1,215 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetAudienceScheduleFromSpaceAndAudience200Response */ +public class GetAudienceScheduleFromSpaceAndAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data; + + public GetAudienceScheduleFromSpaceAndAudience200Response() {} + + public GetAudienceScheduleFromSpaceAndAudience200Response data( + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput getData() { + return data; + } + + public void setData(GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceScheduleFromSpaceAndAudience200Response + getAudienceScheduleFromSpaceAndAudience200Response = + (GetAudienceScheduleFromSpaceAndAudience200Response) o; + return Objects.equals(this.data, getAudienceScheduleFromSpaceAndAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceScheduleFromSpaceAndAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudienceScheduleFromSpaceAndAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAudienceScheduleFromSpaceAndAudience200Response is not" + + " found in the empty JSON string", + GetAudienceScheduleFromSpaceAndAudience200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudienceScheduleFromSpaceAndAudience200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceScheduleFromSpaceAndAudience200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceScheduleFromSpaceAndAudience200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAudienceScheduleFromSpaceAndAudience200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAudienceScheduleFromSpaceAndAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAudienceScheduleFromSpaceAndAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceScheduleFromSpaceAndAudience200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceScheduleFromSpaceAndAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceScheduleFromSpaceAndAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudience200Response + */ + public static GetAudienceScheduleFromSpaceAndAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAudienceScheduleFromSpaceAndAudience200Response.class); + } + + /** + * Convert an instance of GetAudienceScheduleFromSpaceAndAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java new file mode 100644 index 00000000..44f75ed2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java @@ -0,0 +1,226 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for get audience schedule. */ +public class GetAudienceScheduleFromSpaceAndAudienceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_SCHEDULE = "audienceSchedule"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCHEDULE) + private AudienceSchedule audienceSchedule; + + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput() {} + + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput audienceSchedule( + AudienceSchedule audienceSchedule) { + + this.audienceSchedule = audienceSchedule; + return this; + } + + /** + * Get audienceSchedule + * + * @return audienceSchedule + */ + @javax.annotation.Nonnull + public AudienceSchedule getAudienceSchedule() { + return audienceSchedule; + } + + public void setAudienceSchedule(AudienceSchedule audienceSchedule) { + this.audienceSchedule = audienceSchedule; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + getAudienceScheduleFromSpaceAndAudienceAlphaOutput = + (GetAudienceScheduleFromSpaceAndAudienceAlphaOutput) o; + return Objects.equals( + this.audienceSchedule, + getAudienceScheduleFromSpaceAndAudienceAlphaOutput.audienceSchedule); + } + + @Override + public int hashCode() { + return Objects.hash(audienceSchedule); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceScheduleFromSpaceAndAudienceAlphaOutput {\n"); + sb.append(" audienceSchedule: ").append(toIndentedString(audienceSchedule)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceSchedule"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceSchedule"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAudienceScheduleFromSpaceAndAudienceAlphaOutput is not" + + " found in the empty JSON string", + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceScheduleFromSpaceAndAudienceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audienceSchedule` + AudienceSchedule.validateJsonElement(jsonObj.get("audienceSchedule")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAudienceScheduleFromSpaceAndAudienceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + */ + public static GetAudienceScheduleFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class); + } + + /** + * Convert an instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java new file mode 100644 index 00000000..f041ef14 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java @@ -0,0 +1,216 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListAudienceSchedulesFromSpaceAndAudience200Response */ +public class ListAudienceSchedulesFromSpaceAndAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data; + + public ListAudienceSchedulesFromSpaceAndAudience200Response() {} + + public ListAudienceSchedulesFromSpaceAndAudience200Response data( + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput getData() { + return data; + } + + public void setData(ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudienceSchedulesFromSpaceAndAudience200Response + listAudienceSchedulesFromSpaceAndAudience200Response = + (ListAudienceSchedulesFromSpaceAndAudience200Response) o; + return Objects.equals(this.data, listAudienceSchedulesFromSpaceAndAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudienceSchedulesFromSpaceAndAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudienceSchedulesFromSpaceAndAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListAudienceSchedulesFromSpaceAndAudience200Response is not" + + " found in the empty JSON string", + ListAudienceSchedulesFromSpaceAndAudience200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudienceSchedulesFromSpaceAndAudience200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudienceSchedulesFromSpaceAndAudience200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudienceSchedulesFromSpaceAndAudience200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListAudienceSchedulesFromSpaceAndAudience200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListAudienceSchedulesFromSpaceAndAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListAudienceSchedulesFromSpaceAndAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudienceSchedulesFromSpaceAndAudience200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudienceSchedulesFromSpaceAndAudience200Response given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of ListAudienceSchedulesFromSpaceAndAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudience200Response + */ + public static ListAudienceSchedulesFromSpaceAndAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListAudienceSchedulesFromSpaceAndAudience200Response.class); + } + + /** + * Convert an instance of ListAudienceSchedulesFromSpaceAndAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java new file mode 100644 index 00000000..c82c692d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java @@ -0,0 +1,254 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for list audience schedules. */ +public class ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_SCHEDULES = "audienceSchedules"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCHEDULES) + private List audienceSchedules = new ArrayList<>(); + + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput() {} + + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput audienceSchedules( + List audienceSchedules) { + + this.audienceSchedules = audienceSchedules; + return this; + } + + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput addAudienceSchedulesItem( + AudienceSchedule audienceSchedulesItem) { + if (this.audienceSchedules == null) { + this.audienceSchedules = new ArrayList<>(); + } + this.audienceSchedules.add(audienceSchedulesItem); + return this; + } + + /** + * A list of audience schedules. + * + * @return audienceSchedules + */ + @javax.annotation.Nonnull + public List getAudienceSchedules() { + return audienceSchedules; + } + + public void setAudienceSchedules(List audienceSchedules) { + this.audienceSchedules = audienceSchedules; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + listAudienceSchedulesFromSpaceAndAudienceAlphaOutput = + (ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput) o; + return Objects.equals( + this.audienceSchedules, + listAudienceSchedulesFromSpaceAndAudienceAlphaOutput.audienceSchedules); + } + + @Override + public int hashCode() { + return Objects.hash(audienceSchedules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput {\n"); + sb.append(" audienceSchedules: ") + .append(toIndentedString(audienceSchedules)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceSchedules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceSchedules"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput is not" + + " found in the empty JSON string", + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("audienceSchedules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceSchedules` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("audienceSchedules").toString())); + } + + JsonArray jsonArrayaudienceSchedules = jsonObj.getAsJsonArray("audienceSchedules"); + // validate the required field `audienceSchedules` (array) + for (int i = 0; i < jsonArrayaudienceSchedules.size(); i++) { + AudienceSchedule.validateJsonElement(jsonArrayaudienceSchedules.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + */ + public static ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class); + } + + /** + * Convert an instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java new file mode 100644 index 00000000..2e0d2a0e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java @@ -0,0 +1,207 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Configures a periodic schedule interval. */ +public class PeriodicConfig { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public PeriodicConfig() {} + + public PeriodicConfig interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Go duration format string, only supporting units \"h\" (hours) and \"m\" + * (minutes). + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PeriodicConfig periodicConfig = (PeriodicConfig) o; + return Objects.equals(this.interval, periodicConfig.interval); + } + + @Override + public int hashCode() { + return Objects.hash(interval); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PeriodicConfig {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PeriodicConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PeriodicConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PeriodicConfig is not found in the" + + " empty JSON string", + PeriodicConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PeriodicConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PeriodicConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PeriodicConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PeriodicConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PeriodicConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PeriodicConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PeriodicConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PeriodicConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of PeriodicConfig + * @throws IOException if the JSON string is invalid with respect to PeriodicConfig + */ + public static PeriodicConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PeriodicConfig.class); + } + + /** + * Convert an instance of PeriodicConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java index 9b466492..f8705f0e 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -95,7 +95,7 @@ public StrategyEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) - private Config config; + private Config1 config; public ReverseEtlScheduleDefinition() {} @@ -119,7 +119,7 @@ public void setStrategy(StrategyEnum strategy) { this.strategy = strategy; } - public ReverseEtlScheduleDefinition config(Config config) { + public ReverseEtlScheduleDefinition config(Config1 config) { this.config = config; return this; @@ -131,11 +131,11 @@ public ReverseEtlScheduleDefinition config(Config config) { * @return config */ @javax.annotation.Nullable - public Config getConfig() { + public Config1 getConfig() { return config; } - public void setConfig(Config config) { + public void setConfig(Config1 config) { this.config = config; } @@ -259,7 +259,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `config` if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - Config.validateJsonElement(jsonObj.get("config")); + Config1.validateJsonElement(jsonObj.get("config")); } } diff --git a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java new file mode 100644 index 00000000..c7584e91 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java @@ -0,0 +1,308 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Configures a schedule for specific days and times. */ +public class SpecificDaysConfig { + public static final String SERIALIZED_NAME_DAYS = "days"; + + @SerializedName(SERIALIZED_NAME_DAYS) + private List days = new ArrayList<>(); + + public static final String SERIALIZED_NAME_HOURS = "hours"; + + @SerializedName(SERIALIZED_NAME_HOURS) + private List hours = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; + + public SpecificDaysConfig() {} + + public SpecificDaysConfig days(List days) { + + this.days = days; + return this; + } + + public SpecificDaysConfig addDaysItem(BigDecimal daysItem) { + if (this.days == null) { + this.days = new ArrayList<>(); + } + this.days.add(daysItem); + return this; + } + + /** + * Days of week for schedule (0=Saturday, 6=Sunday). + * + * @return days + */ + @javax.annotation.Nonnull + public List getDays() { + return days; + } + + public void setDays(List days) { + this.days = days; + } + + public SpecificDaysConfig hours(List hours) { + + this.hours = hours; + return this; + } + + public SpecificDaysConfig addHoursItem(BigDecimal hoursItem) { + if (this.hours == null) { + this.hours = new ArrayList<>(); + } + this.hours.add(hoursItem); + return this; + } + + /** + * Hours of day for schedule (0-23). + * + * @return hours + */ + @javax.annotation.Nonnull + public List getHours() { + return hours; + } + + public void setHours(List hours) { + this.hours = hours; + } + + public SpecificDaysConfig timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * TZ database time zone identifier; for example, America/New_York. + * + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecificDaysConfig specificDaysConfig = (SpecificDaysConfig) o; + return Objects.equals(this.days, specificDaysConfig.days) + && Objects.equals(this.hours, specificDaysConfig.hours) + && Objects.equals(this.timezone, specificDaysConfig.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(days, hours, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecificDaysConfig {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" hours: ").append(toIndentedString(hours)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("days"); + openapiFields.add("hours"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("days"); + openapiRequiredFields.add("hours"); + openapiRequiredFields.add("timezone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SpecificDaysConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SpecificDaysConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SpecificDaysConfig is not found in the" + + " empty JSON string", + SpecificDaysConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SpecificDaysConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SpecificDaysConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SpecificDaysConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("days") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("days").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `days` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("days").toString())); + } + // ensure the required json array is present + if (jsonObj.get("hours") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("hours").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `hours` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("hours").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpecificDaysConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpecificDaysConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SpecificDaysConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SpecificDaysConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpecificDaysConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SpecificDaysConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecificDaysConfig + * @throws IOException if the JSON string is invalid with respect to SpecificDaysConfig + */ + public static SpecificDaysConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecificDaysConfig.class); + } + + /** + * Convert an instance of SpecificDaysConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 7b574b34f2ebe21a5513284dd555f622af4f02fb Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 27 Jun 2025 06:44:11 +0000 Subject: [PATCH 448/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@100eeef2. --- README.md | 8 +- docs/AudiencesApi.md | 188 +++-- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 39 +- .../segment/publicapi/api/AudiencesApi.java | 752 +++++++++++------- .../publicapi/models/AudiencePreview.java | 565 +++++++++++++ ...ut.java => AudiencePreviewIdentifier.java} | 94 ++- ...review.java => AudiencePreviewResult.java} | 61 +- .../publicapi/models/AudienceSize.java | 284 +++++++ .../CreateAudiencePreview200Response.java | 199 +++++ ...a => CreateAudiencePreviewAlphaInput.java} | 78 +- .../CreateAudiencePreviewAlphaOutput.java | 210 +++++ .../models/CreateAudiencePreviewOptions.java | 259 ++++++ ...ava => GetAudiencePreview200Response.java} | 65 +- .../models/GetAudiencePreviewAlphaOutput.java | 208 +++++ .../models/ReadAudiencePreviewOptions.java | 302 +++++++ 18 files changed, 2829 insertions(+), 489 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreview.java rename src/main/java/com/segment/publicapi/models/{PreviewAudienceOutput.java => AudiencePreviewIdentifier.java} (64%) rename src/main/java/com/segment/publicapi/models/{Preview.java => AudiencePreviewResult.java} (75%) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSize.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java rename src/main/java/com/segment/publicapi/models/{PreviewAudienceInput.java => CreateAudiencePreviewAlphaInput.java} (75%) create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java rename src/main/java/com/segment/publicapi/models/{PreviewAudience200Response.java => GetAudiencePreview200Response.java} (69%) create mode 100644 src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java diff --git a/README.md b/README.md index 87d966f8..89c18748 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.7.0 +Latest API and SDK version: 58.8.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.7.0 + 58.8.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.7.0" + implementation "com.segment.publicapi:segment-publicapi:58.8.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.7.0.jar` +* `target/segment-publicapi-58.8.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index e1881a0a..cfbff41b 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -5,12 +5,13 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | +| [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | +| [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview | | [**getAudienceScheduleFromSpaceAndAudience**](AudiencesApi.md#getAudienceScheduleFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules/{scheduleId} | Get Audience Schedule from Space And Audience | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | | [**listAudienceSchedulesFromSpaceAndAudience**](AudiencesApi.md#listAudienceSchedulesFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules | List Audience Schedules from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | -| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -91,6 +92,81 @@ public class Example { | **429** | Too many requests | - | +## Operation: createAudiencePreview + +> CreateAudiencePreview200Response createAudiencePreview(spaceId, createAudiencePreviewAlphaInput) + +Create Audience Preview + +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = new CreateAudiencePreviewAlphaInput(); // CreateAudiencePreviewAlphaInput | + try { + CreateAudiencePreview200Response result = apiInstance.createAudiencePreview(spaceId, createAudiencePreviewAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#createAudiencePreview"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **createAudiencePreviewAlphaInput** | [**CreateAudiencePreviewAlphaInput**](CreateAudiencePreviewAlphaInput.md)| | | + +### Return type + +[**CreateAudiencePreview200Response**](CreateAudiencePreview200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: getAudience > GetAudience200Response getAudience(spaceId, id, include) @@ -168,13 +244,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: getAudienceScheduleFromSpaceAndAudience +## Operation: getAudiencePreview -> GetAudienceScheduleFromSpaceAndAudience200Response getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId) +> GetAudiencePreview200Response getAudiencePreview(spaceId, id) -Get Audience Schedule from Space And Audience +Get Audience Preview -Returns the schedule for the given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. +Reads the results of an audience preview. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -197,13 +273,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | - String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "2yKFfGeS62yzGxQSAieVOvsPOha-compute_preview_execution-dws3UdTNsppL5dRGsagFpP-compute_preview_execution"; // String | try { - GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); + GetAudiencePreview200Response result = apiInstance.getAudiencePreview(spaceId, id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#getAudienceScheduleFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#getAudiencePreview"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -220,11 +295,10 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **scheduleId** | **String**| | | ### Return type -[**GetAudienceScheduleFromSpaceAndAudience200Response**](GetAudienceScheduleFromSpaceAndAudience200Response.md) +[**GetAudiencePreview200Response**](GetAudiencePreview200Response.md) ### Authorization @@ -245,13 +319,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudienceConsumersFromSpaceAndAudience +## Operation: getAudienceScheduleFromSpaceAndAudience -> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) +> GetAudienceScheduleFromSpaceAndAudience200Response getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId) -List Audience Consumers from Space And Audience +Get Audience Schedule from Space And Audience -Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the schedule for the given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -274,15 +348,13 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. - ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { - ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); + GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#getAudienceScheduleFromSpaceAndAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -299,13 +371,11 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | -| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | +| **scheduleId** | **String**| | | ### Return type -[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) +[**GetAudienceScheduleFromSpaceAndAudience200Response**](GetAudienceScheduleFromSpaceAndAudience200Response.md) ### Authorization @@ -326,13 +396,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudienceSchedulesFromSpaceAndAudience +## Operation: listAudienceConsumersFromSpaceAndAudience -> ListAudienceSchedulesFromSpaceAndAudience200Response listAudienceSchedulesFromSpaceAndAudience(spaceId, id) +> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) -List Audience Schedules from Space And Audience +List Audience Consumers from Space And Audience -Returns the list of schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. +Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -355,12 +425,15 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. + ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. try { - ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); + ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudienceSchedulesFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -377,10 +450,13 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | +| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type -[**ListAudienceSchedulesFromSpaceAndAudience200Response**](ListAudienceSchedulesFromSpaceAndAudience200Response.md) +[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) ### Authorization @@ -401,13 +477,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudiences +## Operation: listAudienceSchedulesFromSpaceAndAudience -> ListAudiences200Response listAudiences(spaceId, pagination, include) +> ListAudienceSchedulesFromSpaceAndAudience200Response listAudienceSchedulesFromSpaceAndAudience(spaceId, id) -List Audiences +List Audience Schedules from Space And Audience -Returns Audiences by spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the list of schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -430,13 +506,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); + ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudiences"); + System.err.println("Exception when calling AudiencesApi#listAudienceSchedulesFromSpaceAndAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -452,12 +527,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | +| **id** | **String**| | | ### Return type -[**ListAudiences200Response**](ListAudiences200Response.md) +[**ListAudienceSchedulesFromSpaceAndAudience200Response**](ListAudienceSchedulesFromSpaceAndAudience200Response.md) ### Authorization @@ -466,7 +540,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -478,13 +552,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: previewAudience +## Operation: listAudiences -> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput) +> ListAudiences200Response listAudiences(spaceId, pagination, include) -Preview Audience +List Audiences -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns Audiences by spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -507,12 +581,13 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { - PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#previewAudience"); + System.err.println("Exception when calling AudiencesApi#listAudiences"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -528,11 +603,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type -[**PreviewAudience200Response**](PreviewAudience200Response.md) +[**ListAudiences200Response**](ListAudiences200Response.md) ### Authorization @@ -540,8 +616,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details diff --git a/pom.xml b/pom.xml index 6a340ede..8e2d30af 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.7.0 + 58.8.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d731c05a..6a028ce8 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.7.0 (Java)"); + setUserAgent("Public API SDK 58.8.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f95a82b6..61029765 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.7.0"; + public static final String VERSION = "58.8.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 1008ce13..247eda5e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -175,8 +175,17 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptionsWithLookback .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewIdentifier + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSize.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -226,6 +235,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateAudienceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreview200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewOptions + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateCloudSourceRegulation200Response .CustomTypeAdapterFactory()); @@ -659,6 +680,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudiencePreview200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudiencePreviewAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response .CustomTypeAdapterFactory()); @@ -1227,15 +1254,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudience200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilter200Response .CustomTypeAdapterFactory()); @@ -1260,6 +1278,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReadAudiencePreviewOptions + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 3a996cb4..e3cb801b 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -20,7 +20,10 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; +import com.segment.publicapi.models.CreateAudiencePreview200Response; +import com.segment.publicapi.models.CreateAudiencePreviewAlphaInput; import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.GetAudiencePreview200Response; import com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; @@ -29,8 +32,6 @@ import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.PreviewAudience200Response; -import com.segment.publicapi.models.PreviewAudienceInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; @@ -286,6 +287,223 @@ public okhttp3.Call createAudienceAsync( return localVarCall; } + /** + * Build call for createAudiencePreview + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createAudiencePreviewCall( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createAudiencePreviewAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAudiencePreviewValidateBeforeCall( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " createAudiencePreview(Async)"); + } + + // verify the required parameter 'createAudiencePreviewAlphaInput' is set + if (createAudiencePreviewAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createAudiencePreviewAlphaInput' when calling" + + " createAudiencePreview(Async)"); + } + + return createAudiencePreviewCall(spaceId, createAudiencePreviewAlphaInput, _callback); + } + + /** + * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @return CreateAudiencePreview200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateAudiencePreview200Response createAudiencePreview( + String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createAudiencePreviewWithHttpInfo(spaceId, createAudiencePreviewAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @return ApiResponse<CreateAudiencePreview200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createAudiencePreviewWithHttpInfo( + String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createAudiencePreviewValidateBeforeCall( + spaceId, createAudiencePreviewAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Audience Preview (asynchronously) Previews Audience. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Preview Created` event in the + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also + * has a rate limit of 700 requests per month per spaceId, which is lower than the default due + * to access pattern restrictions. + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createAudiencePreviewAsync( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createAudiencePreviewValidateBeforeCall( + spaceId, createAudiencePreviewAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for getAudience * @@ -337,14 +555,220 @@ public okhttp3.Call getAudienceCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (include != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); - } - + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudienceValidateBeforeCall( + String spaceId, String id, String include, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling getAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getAudience(Async)"); + } + + return getAudienceCall(spaceId, id, include, _callback); + } + + /** + * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules + * via `?include=schedules`. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 100 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) + * @return GetAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudience200Response getAudience(String spaceId, String id, String include) + throws ApiException { + ApiResponse localVarResp = + getAudienceWithHttpInfo(spaceId, id, include); + return localVarResp.getData(); + } + + /** + * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules + * via `?include=schedules`. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 100 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) + * @return ApiResponse<GetAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getAudienceWithHttpInfo( + String spaceId, String id, String include) throws ApiException { + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience (asynchronously) Returns the Audience by id and spaceId. Supports including + * audience schedules via `?include=schedules`. • This endpoint is in **Beta** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceAsync( + String spaceId, + String id, + String include, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getAudiencePreview + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudiencePreviewCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews/{id}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -374,40 +798,37 @@ public okhttp3.Call getAudienceCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getAudienceValidateBeforeCall( - String spaceId, String id, String include, final ApiCallback _callback) - throws ApiException { + private okhttp3.Call getAudiencePreviewValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( - "Missing the required parameter 'spaceId' when calling getAudience(Async)"); + "Missing the required parameter 'spaceId' when calling" + + " getAudiencePreview(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException( - "Missing the required parameter 'id' when calling getAudience(Async)"); + "Missing the required parameter 'id' when calling getAudiencePreview(Async)"); } - return getAudienceCall(spaceId, id, include, _callback); + return getAudiencePreviewCall(spaceId, id, _callback); } /** - * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules - * via `?include=schedules`. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 100 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * Get Audience Preview Reads the results of an audience preview. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @return GetAudience200Response + * @return GetAudiencePreview200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -419,29 +840,26 @@ private okhttp3.Call getAudienceValidateBeforeCall( * 429 Too many requests - * */ - public GetAudience200Response getAudience(String spaceId, String id, String include) + public GetAudiencePreview200Response getAudiencePreview(String spaceId, String id) throws ApiException { - ApiResponse localVarResp = - getAudienceWithHttpInfo(spaceId, id, include); + ApiResponse localVarResp = + getAudiencePreviewWithHttpInfo(spaceId, id); return localVarResp.getData(); } /** - * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules - * via `?include=schedules`. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 100 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. + * Get Audience Preview Reads the results of an audience preview. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @return ApiResponse<GetAudience200Response> + * @return ApiResponse<GetAudiencePreview200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -453,28 +871,25 @@ public GetAudience200Response getAudience(String spaceId, String id, String incl * 429 Too many requests - * */ - public ApiResponse getAudienceWithHttpInfo( - String spaceId, String id, String include) throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, null); - Type localVarReturnType = new TypeToken() {}.getType(); + public ApiResponse getAudiencePreviewWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Audience (asynchronously) Returns the Audience by id and spaceId. Supports including - * audience schedules via `?include=schedules`. • This endpoint is in **Beta** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate + * Get Audience Preview (asynchronously) Reads the results of an audience preview. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. The rate limit for this endpoint is 100 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -488,15 +903,12 @@ public ApiResponse getAudienceWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call getAudienceAsync( - String spaceId, - String id, - String include, - final ApiCallback _callback) + public okhttp3.Call getAudiencePreviewAsync( + String spaceId, String id, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1403,220 +1815,6 @@ public okhttp3.Call listAudiencesAsync( return localVarCall; } - /** - * Build call for previewAudience - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call previewAudienceCall( - String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = previewAudienceInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call previewAudienceValidateBeforeCall( - String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling previewAudience(Async)"); - } - - // verify the required parameter 'previewAudienceInput' is set - if (previewAudienceInput == null) { - throw new ApiException( - "Missing the required parameter 'previewAudienceInput' when calling" - + " previewAudience(Async)"); - } - - return previewAudienceCall(spaceId, previewAudienceInput, _callback); - } - - /** - * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit - * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. • When called, this endpoint may - * generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @return PreviewAudience200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public PreviewAudience200Response previewAudience( - String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { - ApiResponse localVarResp = - previewAudienceWithHttpInfo(spaceId, previewAudienceInput); - return localVarResp.getData(); - } - - /** - * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit - * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. • When called, this endpoint may - * generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @return ApiResponse<PreviewAudience200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse previewAudienceWithHttpInfo( - String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { - okhttp3.Call localVarCall = - previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Audience Preview Created` event in the - * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for - * this endpoint is 700 requests per month per spaceId, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call previewAudienceAsync( - String spaceId, - PreviewAudienceInput previewAudienceInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for removeAudienceFromSpace * diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java new file mode 100644 index 00000000..c6fd3573 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -0,0 +1,565 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** An audience preview. */ +public class AudiencePreview { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private ReadAudiencePreviewOptions options; + + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + RUNNING("RUNNING"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + + public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; + + @SerializedName(SERIALIZED_NAME_FAILURE_REASON) + private String failureReason; + + public AudiencePreview() {} + + public AudiencePreview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public AudiencePreview options(ReadAudiencePreviewOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public ReadAudiencePreviewOptions getOptions() { + return options; + } + + public void setOptions(ReadAudiencePreviewOptions options) { + this.options = options; + } + + public AudiencePreview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public AudiencePreview results(List results) { + + this.results = results; + return this; + } + + public AudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Sampled result membership for the audience preview. Only has a value if the status is + * 'COMPLETED'. + * + * @return results + */ + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public AudiencePreview size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + + public AudiencePreview failureReason(String failureReason) { + + this.failureReason = failureReason; + return this; + } + + /** + * Explanation of why the audience preview failed. Only has a value if status is + * 'FAILED'. + * + * @return failureReason + */ + @javax.annotation.Nullable + public String getFailureReason() { + return failureReason; + } + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreview audiencePreview = (AudiencePreview) o; + return Objects.equals(this.id, audiencePreview.id) + && Objects.equals(this.audienceType, audiencePreview.audienceType) + && Objects.equals(this.definition, audiencePreview.definition) + && Objects.equals(this.options, audiencePreview.options) + && Objects.equals(this.status, audiencePreview.status) + && Objects.equals(this.results, audiencePreview.results) + && Objects.equals(this.size, audiencePreview.size) + && Objects.equals(this.failureReason, audiencePreview.failureReason); + } + + @Override + public int hashCode() { + return Objects.hash( + id, audienceType, definition, options, status, results, size, failureReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + openapiFields.add("status"); + openapiFields.add("results"); + openapiFields.add("size"); + openapiFields.add("failureReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreview is not found in the" + + " empty JSON string", + AudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + ReadAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + if (jsonArrayresults != null) { + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `results` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("results").toString())); + } + + // validate the optional field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); + } + ; + } + } + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } + if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) + && !jsonObj.get("failureReason").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `failureReason` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("failureReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreview + * @throws IOException if the JSON string is invalid with respect to AudiencePreview + */ + public static AudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreview.class); + } + + /** + * Convert an instance of AudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java similarity index 64% rename from src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java rename to src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java index fefc0eb9..5fadb72a 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java @@ -27,33 +27,33 @@ import java.util.Objects; import java.util.Set; -/** PreviewAudienceOutput */ -public class PreviewAudienceOutput { - public static final String SERIALIZED_NAME_PREVIEW = "preview"; +/** Identifier for an audience preview. */ +public class AudiencePreviewIdentifier { + public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_PREVIEW) - private Preview preview; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public PreviewAudienceOutput() {} + public AudiencePreviewIdentifier() {} - public PreviewAudienceOutput preview(Preview preview) { + public AudiencePreviewIdentifier id(String id) { - this.preview = preview; + this.id = id; return this; } /** - * Get preview + * Unique identifier for tracking and retrieving results of an audience preview. * - * @return preview + * @return id */ @javax.annotation.Nonnull - public Preview getPreview() { - return preview; + public String getId() { + return id; } - public void setPreview(Preview preview) { - this.preview = preview; + public void setId(String id) { + this.id = id; } @Override @@ -64,20 +64,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudienceOutput previewAudienceOutput = (PreviewAudienceOutput) o; - return Objects.equals(this.preview, previewAudienceOutput.preview); + AudiencePreviewIdentifier audiencePreviewIdentifier = (AudiencePreviewIdentifier) o; + return Objects.equals(this.id, audiencePreviewIdentifier.id); } @Override public int hashCode() { - return Objects.hash(preview); + return Objects.hash(id); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudienceOutput {\n"); - sb.append(" preview: ").append(toIndentedString(preview)).append("\n"); + sb.append("class AudiencePreviewIdentifier {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); } @@ -99,45 +99,45 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("preview"); + openapiFields.add("id"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("preview"); + openapiRequiredFields.add("id"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceOutput + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewIdentifier */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudienceOutput.openapiRequiredFields + if (!AudiencePreviewIdentifier.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudienceOutput is not found in" - + " the empty JSON string", - PreviewAudienceOutput.openapiRequiredFields.toString())); + "The required field(s) %s in AudiencePreviewIdentifier is not found" + + " in the empty JSON string", + AudiencePreviewIdentifier.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudienceOutput.openapiFields.contains(entry.getKey())) { + if (!AudiencePreviewIdentifier.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudienceOutput` properties. JSON: %s", + + " `AudiencePreviewIdentifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PreviewAudienceOutput.openapiRequiredFields) { + for (String requiredField : AudiencePreviewIdentifier.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -146,32 +146,38 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `preview` - Preview.validateJsonElement(jsonObj.get("preview")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudienceOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudienceOutput' and its subtypes + if (!AudiencePreviewIdentifier.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewIdentifier' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewIdentifier.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudienceOutput value) + public void write(JsonWriter out, AudiencePreviewIdentifier value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudienceOutput read(JsonReader in) throws IOException { + public AudiencePreviewIdentifier read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -181,18 +187,18 @@ public PreviewAudienceOutput read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudienceOutput given an JSON string + * Create an instance of AudiencePreviewIdentifier given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudienceOutput - * @throws IOException if the JSON string is invalid with respect to PreviewAudienceOutput + * @return An instance of AudiencePreviewIdentifier + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewIdentifier */ - public static PreviewAudienceOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudienceOutput.class); + public static AudiencePreviewIdentifier fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewIdentifier.class); } /** - * Convert an instance of PreviewAudienceOutput to an JSON string + * Convert an instance of AudiencePreviewIdentifier to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/Preview.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/Preview.java rename to src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java index a1b63f84..ce5cbfb0 100644 --- a/src/main/java/com/segment/publicapi/models/Preview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java @@ -27,23 +27,23 @@ import java.util.Objects; import java.util.Set; -/** Preview */ -public class Preview { +/** Result membership object for an audience preview. */ +public class AudiencePreviewResult { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; - public Preview() {} + public AudiencePreviewResult() {} - public Preview id(String id) { + public AudiencePreviewResult id(String id) { this.id = id; return this; } /** - * Unique identifier for tracking and retrieving results of the preview. + * Segment id or account id. * * @return id */ @@ -64,8 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Preview preview = (Preview) o; - return Objects.equals(this.id, preview.id); + AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; + return Objects.equals(this.id, audiencePreviewResult.id); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Preview {\n"); + sb.append("class AudiencePreviewResult {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,34 +110,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Preview + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Preview.openapiRequiredFields + if (!AudiencePreviewResult.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in Preview is not found in the empty JSON" - + " string", - Preview.openapiRequiredFields.toString())); + "The required field(s) %s in AudiencePreviewResult is not found in" + + " the empty JSON string", + AudiencePreviewResult.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!Preview.openapiFields.contains(entry.getKey())) { + if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( - "The field `%s` in the JSON string is not defined in the `Preview`" - + " properties. JSON: %s", + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Preview.openapiRequiredFields) { + for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -159,23 +159,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Preview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Preview' and its subtypes + if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewResult' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Preview.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, Preview value) throws IOException { + public void write(JsonWriter out, AudiencePreviewResult value) + throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public Preview read(JsonReader in) throws IOException { + public AudiencePreviewResult read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -185,18 +186,18 @@ public Preview read(JsonReader in) throws IOException { } /** - * Create an instance of Preview given an JSON string + * Create an instance of AudiencePreviewResult given an JSON string * * @param jsonString JSON string - * @return An instance of Preview - * @throws IOException if the JSON string is invalid with respect to Preview + * @return An instance of AudiencePreviewResult + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewResult */ - public static Preview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Preview.class); + public static AudiencePreviewResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewResult.class); } /** - * Convert an instance of Preview to an JSON string + * Convert an instance of AudiencePreviewResult to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/AudienceSize.java b/src/main/java/com/segment/publicapi/models/AudienceSize.java new file mode 100644 index 00000000..51d2a3af --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSize.java @@ -0,0 +1,284 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSize */ +public class AudienceSize { + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + /** The unit type for the count(s) being returned. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceSize() {} + + public AudienceSize count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The total audience membership count. Refer to the type field to determine the unit for this + * field (profiles, accounts, etc). + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + public AudienceSize type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The unit type for the count(s) being returned. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSize audienceSize = (AudienceSize) o; + return Objects.equals(this.count, audienceSize.count) + && Objects.equals(this.type, audienceSize.type); + } + + @Override + public int hashCode() { + return Objects.hash(count, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSize {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("count"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSize + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSize.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSize is not found in the empty" + + " JSON string", + AudienceSize.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSize.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSize` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSize.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSize.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSize' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSize.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSize value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSize read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSize given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSize + * @throws IOException if the JSON string is invalid with respect to AudienceSize + */ + public static AudienceSize fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSize.class); + } + + /** + * Convert an instance of AudienceSize to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java new file mode 100644 index 00000000..bdbd349b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateAudiencePreview200Response */ +public class CreateAudiencePreview200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateAudiencePreviewAlphaOutput data; + + public CreateAudiencePreview200Response() {} + + public CreateAudiencePreview200Response data(CreateAudiencePreviewAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateAudiencePreviewAlphaOutput getData() { + return data; + } + + public void setData(CreateAudiencePreviewAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreview200Response createAudiencePreview200Response = + (CreateAudiencePreview200Response) o; + return Objects.equals(this.data, createAudiencePreview200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreview200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreview200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreview200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreview200Response is" + + " not found in the empty JSON string", + CreateAudiencePreview200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreview200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreview200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreview200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreview200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreview200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreview200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreview200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreview200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreview200Response + */ + public static CreateAudiencePreview200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreview200Response.class); + } + + /** + * Convert an instance of CreateAudiencePreview200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java rename to src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index b38d1ddf..4a1aeaa2 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -28,8 +28,8 @@ import java.util.Objects; import java.util.Set; -/** Input to preview an audience. */ -public class PreviewAudienceInput { +/** Input to create an audience preview. */ +public class CreateAudiencePreviewAlphaInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) @@ -89,11 +89,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private CreateAudiencePreviewOptions options; - public PreviewAudienceInput() {} + public CreateAudiencePreviewAlphaInput() {} - public PreviewAudienceInput definition(AudienceDefinitionWithoutType definition) { + public CreateAudiencePreviewAlphaInput definition(AudienceDefinitionWithoutType definition) { this.definition = definition; return this; @@ -113,7 +113,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public PreviewAudienceInput audienceType(AudienceTypeEnum audienceType) { + public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; return this; @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public PreviewAudienceInput options(AudienceOptionsWithLookback options) { + public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions options) { this.options = options; return this; @@ -145,11 +145,11 @@ public PreviewAudienceInput options(AudienceOptionsWithLookback options) { * @return options */ @javax.annotation.Nullable - public AudienceOptionsWithLookback getOptions() { + public CreateAudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(CreateAudiencePreviewOptions options) { this.options = options; } @@ -161,10 +161,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudienceInput previewAudienceInput = (PreviewAudienceInput) o; - return Objects.equals(this.definition, previewAudienceInput.definition) - && Objects.equals(this.audienceType, previewAudienceInput.audienceType) - && Objects.equals(this.options, previewAudienceInput.options); + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = + (CreateAudiencePreviewAlphaInput) o; + return Objects.equals(this.definition, createAudiencePreviewAlphaInput.definition) + && Objects.equals(this.audienceType, createAudiencePreviewAlphaInput.audienceType) + && Objects.equals(this.options, createAudiencePreviewAlphaInput.options); } @Override @@ -175,7 +176,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudienceInput {\n"); + sb.append("class CreateAudiencePreviewAlphaInput {\n"); sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); @@ -214,34 +215,35 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceInput + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewAlphaInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudienceInput.openapiRequiredFields + if (!CreateAudiencePreviewAlphaInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudienceInput is not found in" - + " the empty JSON string", - PreviewAudienceInput.openapiRequiredFields.toString())); + "The required field(s) %s in CreateAudiencePreviewAlphaInput is not" + + " found in the empty JSON string", + CreateAudiencePreviewAlphaInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudienceInput.openapiFields.contains(entry.getKey())) { + if (!CreateAudiencePreviewAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudienceInput` properties. JSON: %s", + + " `CreateAudiencePreviewAlphaInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PreviewAudienceInput.openapiRequiredFields) { + for (String requiredField : CreateAudiencePreviewAlphaInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -261,7 +263,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + CreateAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } } @@ -269,24 +271,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudienceInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudienceInput' and its subtypes + if (!CreateAudiencePreviewAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewAlphaInput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewAlphaInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudienceInput value) + public void write(JsonWriter out, CreateAudiencePreviewAlphaInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudienceInput read(JsonReader in) throws IOException { + public CreateAudiencePreviewAlphaInput read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -296,18 +301,19 @@ public PreviewAudienceInput read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudienceInput given an JSON string + * Create an instance of CreateAudiencePreviewAlphaInput given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudienceInput - * @throws IOException if the JSON string is invalid with respect to PreviewAudienceInput + * @return An instance of CreateAudiencePreviewAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewAlphaInput */ - public static PreviewAudienceInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudienceInput.class); + public static CreateAudiencePreviewAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaInput.class); } /** - * Convert an instance of PreviewAudienceInput to an JSON string + * Convert an instance of CreateAudiencePreviewAlphaInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java new file mode 100644 index 00000000..efae7afe --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output when creating an audience preview. */ +public class CreateAudiencePreviewAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) + private AudiencePreviewIdentifier audiencePreview; + + public CreateAudiencePreviewAlphaOutput() {} + + public CreateAudiencePreviewAlphaOutput audiencePreview( + AudiencePreviewIdentifier audiencePreview) { + + this.audiencePreview = audiencePreview; + return this; + } + + /** + * Get audiencePreview + * + * @return audiencePreview + */ + @javax.annotation.Nonnull + public AudiencePreviewIdentifier getAudiencePreview() { + return audiencePreview; + } + + public void setAudiencePreview(AudiencePreviewIdentifier audiencePreview) { + this.audiencePreview = audiencePreview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreviewAlphaOutput createAudiencePreviewAlphaOutput = + (CreateAudiencePreviewAlphaOutput) o; + return Objects.equals( + this.audiencePreview, createAudiencePreviewAlphaOutput.audiencePreview); + } + + @Override + public int hashCode() { + return Objects.hash(audiencePreview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreviewAlphaOutput {\n"); + sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiencePreview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiencePreview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreviewAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreviewAlphaOutput is" + + " not found in the empty JSON string", + CreateAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreviewAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAudiencePreviewAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audiencePreview` + AudiencePreviewIdentifier.validateJsonElement(jsonObj.get("audiencePreview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreviewAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreviewAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreviewAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreviewAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewAlphaOutput + */ + public static CreateAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaOutput.class); + } + + /** + * Convert an instance of CreateAudiencePreviewAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java new file mode 100644 index 00000000..fbaee4a4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java @@ -0,0 +1,259 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Options which should be applied when segmenting audience previews. */ +public class CreateAudiencePreviewOptions { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds; + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public CreateAudiencePreviewOptions() {} + + public CreateAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public CreateAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience preview membership. + * Profiles will only be considered for audience preview membership if the profile has at least + * one external id whose key matches a value in this set. If unspecified, a default set of + * external identifiers will be used: `['user_id', 'email', + * 'android.idfa', 'ios.idfa']`. + * + * @return filterByExternalIds + */ + @javax.annotation.Nullable + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public CreateAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days (specified from the date + * the audience preview was created) that event data will be included from when determining + * audience preview membership. If not specified, the default is set to the maximum event window + * size, or 7 days if no window condition is defined. Note that this is applied on a best-effort + * basis and may not always be applicable. In such cases, the response will not return a + * backfillEventDataDays value, and all available data will be taken into account. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreviewOptions createAudiencePreviewOptions = + (CreateAudiencePreviewOptions) o; + return Objects.equals( + this.filterByExternalIds, createAudiencePreviewOptions.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, + createAudiencePreviewOptions.backfillEventDataDays); + } + + @Override + public int hashCode() { + return Objects.hash(filterByExternalIds, backfillEventDataDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreviewOptions {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreviewOptions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreviewOptions is not" + + " found in the empty JSON string", + CreateAudiencePreviewOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreviewOptions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("filterByExternalIds") != null + && !jsonObj.get("filterByExternalIds").isJsonNull() + && !jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewOptions' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewOptions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreviewOptions value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreviewOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreviewOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewOptions + */ + public static CreateAudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewOptions.class); + } + + /** + * Convert an instance of CreateAudiencePreviewOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java similarity index 69% rename from src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java rename to src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java index da007f6e..e5b85f5b 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** PreviewAudience200Response */ -public class PreviewAudience200Response { +/** GetAudiencePreview200Response */ +public class GetAudiencePreview200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private PreviewAudienceOutput data; + private GetAudiencePreviewAlphaOutput data; - public PreviewAudience200Response() {} + public GetAudiencePreview200Response() {} - public PreviewAudience200Response data(PreviewAudienceOutput data) { + public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public PreviewAudience200Response data(PreviewAudienceOutput data) { * @return data */ @javax.annotation.Nullable - public PreviewAudienceOutput getData() { + public GetAudiencePreviewAlphaOutput getData() { return data; } - public void setData(PreviewAudienceOutput data) { + public void setData(GetAudiencePreviewAlphaOutput data) { this.data = data; } @@ -64,8 +64,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudience200Response previewAudience200Response = (PreviewAudience200Response) o; - return Objects.equals(this.data, previewAudience200Response.data); + GetAudiencePreview200Response getAudiencePreview200Response = + (GetAudiencePreview200Response) o; + return Objects.equals(this.data, getAudiencePreview200Response.data); } @Override @@ -76,7 +77,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudience200Response {\n"); + sb.append("class GetAudiencePreview200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -109,35 +110,36 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudience200Response + * @throws IOException if the JSON Element is invalid with respect to + * GetAudiencePreview200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudience200Response.openapiRequiredFields + if (!GetAudiencePreview200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudience200Response is not" + "The required field(s) %s in GetAudiencePreview200Response is not" + " found in the empty JSON string", - PreviewAudience200Response.openapiRequiredFields.toString())); + GetAudiencePreview200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudience200Response.openapiFields.contains(entry.getKey())) { + if (!GetAudiencePreview200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudience200Response` properties. JSON: %s", + + " `GetAudiencePreview200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - PreviewAudienceOutput.validateJsonElement(jsonObj.get("data")); + GetAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); } } @@ -145,25 +147,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudience200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudience200Response' and its + if (!GetAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudiencePreview200Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudience200Response.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAudiencePreview200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudience200Response value) + public void write(JsonWriter out, GetAudiencePreview200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudience200Response read(JsonReader in) throws IOException { + public GetAudiencePreview200Response read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -173,18 +177,19 @@ public PreviewAudience200Response read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudience200Response given an JSON string + * Create an instance of GetAudiencePreview200Response given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudience200Response - * @throws IOException if the JSON string is invalid with respect to PreviewAudience200Response + * @return An instance of GetAudiencePreview200Response + * @throws IOException if the JSON string is invalid with respect to + * GetAudiencePreview200Response */ - public static PreviewAudience200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudience200Response.class); + public static GetAudiencePreview200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudiencePreview200Response.class); } /** - * Convert an instance of PreviewAudience200Response to an JSON string + * Convert an instance of GetAudiencePreview200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java new file mode 100644 index 00000000..91363b74 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java @@ -0,0 +1,208 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output when reading an audience preview. */ +public class GetAudiencePreviewAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) + private AudiencePreview audiencePreview; + + public GetAudiencePreviewAlphaOutput() {} + + public GetAudiencePreviewAlphaOutput audiencePreview(AudiencePreview audiencePreview) { + + this.audiencePreview = audiencePreview; + return this; + } + + /** + * Get audiencePreview + * + * @return audiencePreview + */ + @javax.annotation.Nonnull + public AudiencePreview getAudiencePreview() { + return audiencePreview; + } + + public void setAudiencePreview(AudiencePreview audiencePreview) { + this.audiencePreview = audiencePreview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudiencePreviewAlphaOutput getAudiencePreviewAlphaOutput = + (GetAudiencePreviewAlphaOutput) o; + return Objects.equals(this.audiencePreview, getAudiencePreviewAlphaOutput.audiencePreview); + } + + @Override + public int hashCode() { + return Objects.hash(audiencePreview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudiencePreviewAlphaOutput {\n"); + sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiencePreview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiencePreview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudiencePreviewAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudiencePreviewAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudiencePreviewAlphaOutput is not" + + " found in the empty JSON string", + GetAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudiencePreviewAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAudiencePreviewAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audiencePreview` + AudiencePreview.validateJsonElement(jsonObj.get("audiencePreview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudiencePreviewAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAudiencePreviewAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudiencePreviewAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudiencePreviewAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudiencePreviewAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudiencePreviewAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetAudiencePreviewAlphaOutput + */ + public static GetAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudiencePreviewAlphaOutput.class); + } + + /** + * Convert an instance of GetAudiencePreviewAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java new file mode 100644 index 00000000..3acc03b6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java @@ -0,0 +1,302 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Options which should be applied when segmenting audience previews. */ +public class ReadAudiencePreviewOptions { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public ReadAudiencePreviewOptions() {} + + public ReadAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public ReadAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience preview membership. + * Profiles will only be considered for audience preview membership if the profile has at least + * one external id whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public ReadAudiencePreviewOptions includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience preview being created is included when + * determining audience preview membership. Note that including historical data may be needed in + * order to properly handle the definition specified. In these cases, Segment will automatically + * handle including historical data and the response will return the includeHistoricalData + * parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nonnull + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public ReadAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days (specified from the date + * the audience preview was created) that event data will be included from when determining + * audience preview membership. If unspecified, defer to the value of + * `includeHistoricalData` to determine whether historical data is either entirely + * included or entirely excluded when determining audience preview membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadAudiencePreviewOptions readAudiencePreviewOptions = (ReadAudiencePreviewOptions) o; + return Objects.equals( + this.filterByExternalIds, readAudiencePreviewOptions.filterByExternalIds) + && Objects.equals( + this.includeHistoricalData, + readAudiencePreviewOptions.includeHistoricalData) + && Objects.equals( + this.backfillEventDataDays, + readAudiencePreviewOptions.backfillEventDataDays); + } + + @Override + public int hashCode() { + return Objects.hash(filterByExternalIds, includeHistoricalData, backfillEventDataDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadAudiencePreviewOptions {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("backfillEventDataDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + openapiRequiredFields.add("includeHistoricalData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReadAudiencePreviewOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadAudiencePreviewOptions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReadAudiencePreviewOptions is not" + + " found in the empty JSON string", + ReadAudiencePreviewOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReadAudiencePreviewOptions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadAudiencePreviewOptions.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadAudiencePreviewOptions' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReadAudiencePreviewOptions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadAudiencePreviewOptions value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadAudiencePreviewOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReadAudiencePreviewOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadAudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to ReadAudiencePreviewOptions + */ + public static ReadAudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadAudiencePreviewOptions.class); + } + + /** + * Convert an instance of ReadAudiencePreviewOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 6a75c4b6fa9082bb91c1d94f75b7931f65e7aba6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 27 Jun 2025 16:55:36 +0000 Subject: [PATCH 449/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e2ed8a0b. --- docs/AudiencesApi.md | 8 ++--- ...nceSummaryWithAudienceTypeAndLookback.java | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index cfbff41b..24b3d4b2 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -196,7 +196,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); @@ -348,8 +348,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | - String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String scheduleId = "sch_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); System.out.println(result); @@ -506,7 +506,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); System.out.println(result); diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 30382a29..c225d085 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -91,6 +91,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -204,6 +209,26 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } + public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -509,6 +534,7 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals( this.schedules, audienceSummaryWithAudienceTypeAndLookback.schedules) @@ -537,6 +563,7 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, + size, options, schedules, id, @@ -559,6 +586,7 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -596,6 +624,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); + openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("schedules"); openapiFields.add("id"); @@ -682,6 +711,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); From 891b4c85763b9b52771b7d6b5f121806c56d4e4e Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 1 Jul 2025 07:58:23 +0000 Subject: [PATCH 450/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@04df7ca9. --- README.md | 8 +- docs/AudiencesApi.md | 290 +---- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 61 +- .../segment/publicapi/api/AudiencesApi.java | 1017 +++-------------- .../publicapi/models/AudiencePreview.java | 565 --------- .../models/AudiencePreviewIdentifier.java | 208 ---- .../publicapi/models/AudienceSchedule.java | 407 ------- .../publicapi/models/AudienceSize.java | 284 ----- ...nceSummaryWithAudienceTypeAndLookback.java | 94 -- .../com/segment/publicapi/models/Config.java | 286 ++++- .../com/segment/publicapi/models/Config1.java | 453 -------- .../CreateAudiencePreview200Response.java | 199 ---- .../CreateAudiencePreviewAlphaOutput.java | 210 ---- .../models/CreateAudiencePreviewOptions.java | 259 ----- .../models/GetAudiencePreviewAlphaOutput.java | 208 ---- ...heduleFromSpaceAndAudience200Response.java | 215 ---- ...heduleFromSpaceAndAudienceAlphaOutput.java | 226 ---- ...edulesFromSpaceAndAudience200Response.java | 216 ---- ...edulesFromSpaceAndAudienceAlphaOutput.java | 254 ---- ...udiencePreviewResult.java => Preview.java} | 61 +- ...e.java => PreviewAudience200Response.java} | 65 +- ...haInput.java => PreviewAudienceInput.java} | 78 +- ...Config.java => PreviewAudienceOutput.java} | 95 +- .../models/ReadAudiencePreviewOptions.java | 302 ----- .../models/ReverseEtlScheduleDefinition.java | 10 +- .../publicapi/models/SpecificDaysConfig.java | 308 ----- 29 files changed, 601 insertions(+), 5784 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreview.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSchedule.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudienceSize.java delete mode 100644 src/main/java/com/segment/publicapi/models/Config1.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java delete mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java rename src/main/java/com/segment/publicapi/models/{AudiencePreviewResult.java => Preview.java} (75%) rename src/main/java/com/segment/publicapi/models/{GetAudiencePreview200Response.java => PreviewAudience200Response.java} (69%) rename src/main/java/com/segment/publicapi/models/{CreateAudiencePreviewAlphaInput.java => PreviewAudienceInput.java} (75%) rename src/main/java/com/segment/publicapi/models/{PeriodicConfig.java => PreviewAudienceOutput.java} (65%) delete mode 100644 src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java delete mode 100644 src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java diff --git a/README.md b/README.md index 89c18748..9af6d601 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.8.0 +Latest API and SDK version: 58.6.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.8.0 + 58.6.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.8.0" + implementation "com.segment.publicapi:segment-publicapi:58.6.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.8.0.jar` +* `target/segment-publicapi-58.6.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 24b3d4b2..067854e8 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -5,13 +5,10 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | -| [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | -| [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview | -| [**getAudienceScheduleFromSpaceAndAudience**](AudiencesApi.md#getAudienceScheduleFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules/{scheduleId} | Get Audience Schedule from Space And Audience | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | -| [**listAudienceSchedulesFromSpaceAndAudience**](AudiencesApi.md#listAudienceSchedulesFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules | List Audience Schedules from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | +| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -92,88 +89,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: createAudiencePreview - -> CreateAudiencePreview200Response createAudiencePreview(spaceId, createAudiencePreviewAlphaInput) - -Create Audience Preview - -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.AudiencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = new CreateAudiencePreviewAlphaInput(); // CreateAudiencePreviewAlphaInput | - try { - CreateAudiencePreview200Response result = apiInstance.createAudiencePreview(spaceId, createAudiencePreviewAlphaInput); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#createAudiencePreview"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **createAudiencePreviewAlphaInput** | [**CreateAudiencePreviewAlphaInput**](CreateAudiencePreviewAlphaInput.md)| | | - -### Return type - -[**CreateAudiencePreview200Response**](CreateAudiencePreview200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - ## Operation: getAudience -> GetAudience200Response getAudience(spaceId, id, include) +> GetAudience200Response getAudience(spaceId, id) Get Audience -Returns the Audience by id and spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -196,10 +118,9 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String id = "id"; // String | try { - GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); + GetAudience200Response result = apiInstance.getAudience(spaceId, id); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#getAudience"); @@ -219,7 +140,6 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type @@ -244,158 +164,6 @@ public class Example { | **429** | Too many requests | - | -## Operation: getAudiencePreview - -> GetAudiencePreview200Response getAudiencePreview(spaceId, id) - -Get Audience Preview - -Reads the results of an audience preview. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.AudiencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "2yKFfGeS62yzGxQSAieVOvsPOha-compute_preview_execution-dws3UdTNsppL5dRGsagFpP-compute_preview_execution"; // String | - try { - GetAudiencePreview200Response result = apiInstance.getAudiencePreview(spaceId, id); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#getAudiencePreview"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **id** | **String**| | | - -### Return type - -[**GetAudiencePreview200Response**](GetAudiencePreview200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - -## Operation: getAudienceScheduleFromSpaceAndAudience - -> GetAudienceScheduleFromSpaceAndAudience200Response getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId) - -Get Audience Schedule from Space And Audience - -Returns the schedule for the given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. - -### Example - -```java -// Import classes: -import com.segment.publicapi.ApiClient; -import com.segment.publicapi.ApiException; -import com.segment.publicapi.Configuration; -import com.segment.publicapi.auth.*; -import com.segment.publicapi.models.*; -import com.segment.publicapi.api.AudiencesApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - - // Configure HTTP bearer authorization: token - HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); - token.setBearerToken("BEARER TOKEN"); - - AudiencesApi apiInstance = new AudiencesApi(defaultClient); - String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - String scheduleId = "sch_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - try { - GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#getAudienceScheduleFromSpaceAndAudience"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **spaceId** | **String**| | | -| **id** | **String**| | | -| **scheduleId** | **String**| | | - -### Return type - -[**GetAudienceScheduleFromSpaceAndAudience200Response**](GetAudienceScheduleFromSpaceAndAudience200Response.md) - -### Authorization - -[token](../README.md#token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | -| **404** | Resource not found | - | -| **422** | Validation failure | - | -| **429** | Too many requests | - | - - ## Operation: listAudienceConsumersFromSpaceAndAudience > ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) @@ -477,13 +245,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudienceSchedulesFromSpaceAndAudience +## Operation: listAudiences -> ListAudienceSchedulesFromSpaceAndAudience200Response listAudienceSchedulesFromSpaceAndAudience(spaceId, id) +> ListAudiences200Response listAudiences(spaceId, pagination) -List Audience Schedules from Space And Audience +List Audiences -Returns the list of schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. +Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -506,12 +274,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { - ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudienceSchedulesFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#listAudiences"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -527,11 +295,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **id** | **String**| | | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type -[**ListAudienceSchedulesFromSpaceAndAudience200Response**](ListAudienceSchedulesFromSpaceAndAudience200Response.md) +[**ListAudiences200Response**](ListAudiences200Response.md) ### Authorization @@ -540,7 +308,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -552,13 +320,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudiences +## Operation: previewAudience -> ListAudiences200Response listAudiences(spaceId, pagination, include) +> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput) -List Audiences +Preview Audience -Returns Audiences by spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -581,13 +349,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); + PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudiences"); + System.err.println("Exception when calling AudiencesApi#previewAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -603,12 +370,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | +| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | | ### Return type -[**ListAudiences200Response**](ListAudiences200Response.md) +[**PreviewAudience200Response**](PreviewAudience200Response.md) ### Authorization @@ -616,8 +382,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -658,7 +424,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -733,7 +499,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/pom.xml b/pom.xml index 8e2d30af..15cc847b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.8.0 + 58.6.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 6a028ce8..7737bb6e 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.8.0 (Java)"); + setUserAgent("Public API SDK 58.6.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 61029765..799812c9 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.8.0"; + public static final String VERSION = "58.6.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 247eda5e..9a4de509 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -175,17 +175,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptionsWithLookback .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewIdentifier - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSchedule.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudienceSize.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -222,8 +211,6 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Config1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -235,18 +222,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateAudienceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreview200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreviewAlphaInput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreviewAlphaOutput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.CreateAudiencePreviewOptions - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateCloudSourceRegulation200Response .CustomTypeAdapterFactory()); @@ -680,18 +655,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudiencePreview200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudiencePreviewAlphaOutput - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudienceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); @@ -943,14 +906,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudienceConsumersSortInput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models - .ListAudienceSchedulesFromSpaceAndAudience200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models - .ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response .CustomTypeAdapterFactory()); @@ -1246,14 +1201,21 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationOutput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PeriodicConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilter200Response .CustomTypeAdapterFactory()); @@ -1278,9 +1240,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ReadAudiencePreviewOptions - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1489,8 +1448,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.SpecificDaysConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index e3cb801b..567267b3 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -20,18 +20,15 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; -import com.segment.publicapi.models.CreateAudiencePreview200Response; -import com.segment.publicapi.models.CreateAudiencePreviewAlphaInput; import com.segment.publicapi.models.GetAudience200Response; -import com.segment.publicapi.models.GetAudiencePreview200Response; -import com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; -import com.segment.publicapi.models.ListAudienceSchedulesFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.PreviewAudience200Response; +import com.segment.publicapi.models.PreviewAudienceInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; @@ -288,637 +285,10 @@ public okhttp3.Call createAudienceAsync( } /** - * Build call for createAudiencePreview - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createAudiencePreviewCall( - String spaceId, - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, - final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = createAudiencePreviewAlphaInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call createAudiencePreviewValidateBeforeCall( - String spaceId, - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, - final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " createAudiencePreview(Async)"); - } - - // verify the required parameter 'createAudiencePreviewAlphaInput' is set - if (createAudiencePreviewAlphaInput == null) { - throw new ApiException( - "Missing the required parameter 'createAudiencePreviewAlphaInput' when calling" - + " createAudiencePreview(Async)"); - } - - return createAudiencePreviewCall(spaceId, createAudiencePreviewAlphaInput, _callback); - } - - /** - * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. • When called, this - * endpoint may generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @return CreateAudiencePreview200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public CreateAudiencePreview200Response createAudiencePreview( - String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) - throws ApiException { - ApiResponse localVarResp = - createAudiencePreviewWithHttpInfo(spaceId, createAudiencePreviewAlphaInput); - return localVarResp.getData(); - } - - /** - * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. • When called, this - * endpoint may generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @return ApiResponse<CreateAudiencePreview200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse createAudiencePreviewWithHttpInfo( - String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) - throws ApiException { - okhttp3.Call localVarCall = - createAudiencePreviewValidateBeforeCall( - spaceId, createAudiencePreviewAlphaInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Create Audience Preview (asynchronously) Previews Audience. • This endpoint is in **Alpha** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Audience Preview Created` event in the - * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also - * has a rate limit of 700 requests per month per spaceId, which is lower than the default due - * to access pattern restrictions. - * - * @param spaceId (required) - * @param createAudiencePreviewAlphaInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call createAudiencePreviewAsync( - String spaceId, - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - createAudiencePreviewValidateBeforeCall( - spaceId, createAudiencePreviewAlphaInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getAudience - * - * @param spaceId (required) - * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudienceCall( - String spaceId, String id, String include, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/{id}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (include != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); - } - - final String[] localVarAccepts = { - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAudienceValidateBeforeCall( - String spaceId, String id, String include, final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling getAudience(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling getAudience(Async)"); - } - - return getAudienceCall(spaceId, id, include, _callback); - } - - /** - * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules - * via `?include=schedules`. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 100 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @return GetAudience200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetAudience200Response getAudience(String spaceId, String id, String include) - throws ApiException { - ApiResponse localVarResp = - getAudienceWithHttpInfo(spaceId, id, include); - return localVarResp.getData(); - } - - /** - * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules - * via `?include=schedules`. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 100 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @return ApiResponse<GetAudience200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getAudienceWithHttpInfo( - String spaceId, String id, String include) throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Audience (asynchronously) Returns the Audience by id and spaceId. Supports including - * audience schedules via `?include=schedules`. • This endpoint is in **Beta** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudienceAsync( - String spaceId, - String id, - String include, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getAudiencePreview - * - * @param spaceId (required) - * @param id (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudiencePreviewCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews/{id}" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAudiencePreviewValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getAudiencePreview(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling getAudiencePreview(Async)"); - } - - return getAudiencePreviewCall(spaceId, id, _callback); - } - - /** - * Get Audience Preview Reads the results of an audience preview. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return GetAudiencePreview200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public GetAudiencePreview200Response getAudiencePreview(String spaceId, String id) - throws ApiException { - ApiResponse localVarResp = - getAudiencePreviewWithHttpInfo(spaceId, id); - return localVarResp.getData(); - } - - /** - * Get Audience Preview Reads the results of an audience preview. • This endpoint is in - * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • - * In order to successfully call this endpoint, the specified Workspace needs to have the - * Audience feature enabled. Please reach out to your customer success manager for more - * information. The rate limit for this endpoint is 100 requests per minute, which is lower than - * the default due to access pattern restrictions. Once reached, this endpoint will respond with - * the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @return ApiResponse<GetAudiencePreview200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse getAudiencePreviewWithHttpInfo( - String spaceId, String id) throws ApiException { - okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get Audience Preview (asynchronously) Reads the results of an audience preview. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Audience feature enabled. Please reach out to your customer success manager - * for more information. The rate limit for this endpoint is 100 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param id (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call getAudiencePreviewAsync( - String spaceId, String id, final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - - /** - * Build call for getAudienceScheduleFromSpaceAndAudience + * Build call for getAudience * * @param spaceId (required) * @param id (required) - * @param scheduleId (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -931,8 +301,7 @@ public okhttp3.Call getAudiencePreviewAsync( * 429 Too many requests - * */ - public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceCall( - String spaceId, String id, String scheduleId, final ApiCallback _callback) + public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -951,14 +320,11 @@ public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceCall( // create path and map variables String localVarPath = - "/spaces/{spaceId}/audiences/{id}/schedules/{scheduleId}" + "/spaces/{spaceId}/audiences/{id}" .replace( "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())) - .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())) - .replace( - "{" + "scheduleId" + "}", - localVarApiClient.escapeString(scheduleId.toString())); + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -967,7 +333,9 @@ public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceCall( Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -997,44 +365,36 @@ public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( - String spaceId, String id, String scheduleId, final ApiCallback _callback) - throws ApiException { + private okhttp3.Call getAudienceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " getAudienceScheduleFromSpaceAndAudience(Async)"); + "Missing the required parameter 'spaceId' when calling getAudience(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException( - "Missing the required parameter 'id' when calling" - + " getAudienceScheduleFromSpaceAndAudience(Async)"); - } - - // verify the required parameter 'scheduleId' is set - if (scheduleId == null) { - throw new ApiException( - "Missing the required parameter 'scheduleId' when calling" - + " getAudienceScheduleFromSpaceAndAudience(Async)"); + "Missing the required parameter 'id' when calling getAudience(Async)"); } - return getAudienceScheduleFromSpaceAndAudienceCall(spaceId, id, scheduleId, _callback); + return getAudienceCall(spaceId, id, _callback); } /** - * Get Audience Schedule from Space And Audience Returns the schedule for the given audience and - * scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Audience feature enabled. Please reach out to your customer - * success manager for more information. + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) - * @param scheduleId (required) - * @return GetAudienceScheduleFromSpaceAndAudience200Response + * @return GetAudience200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1046,25 +406,24 @@ private okhttp3.Call getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( * 429 Too many requests - * */ - public GetAudienceScheduleFromSpaceAndAudience200Response - getAudienceScheduleFromSpaceAndAudience(String spaceId, String id, String scheduleId) - throws ApiException { - ApiResponse localVarResp = - getAudienceScheduleFromSpaceAndAudienceWithHttpInfo(spaceId, id, scheduleId); + public GetAudience200Response getAudience(String spaceId, String id) throws ApiException { + ApiResponse localVarResp = getAudienceWithHttpInfo(spaceId, id); return localVarResp.getData(); } /** - * Get Audience Schedule from Space And Audience Returns the schedule for the given audience and - * scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Audience feature enabled. Please reach out to your customer - * success manager for more information. + * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) - * @param scheduleId (required) - * @return ApiResponse<GetAudienceScheduleFromSpaceAndAudience200Response> + * @return ApiResponse<GetAudience200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1076,27 +435,25 @@ private okhttp3.Call getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( * 429 Too many requests - * */ - public ApiResponse - getAudienceScheduleFromSpaceAndAudienceWithHttpInfo( - String spaceId, String id, String scheduleId) throws ApiException { - okhttp3.Call localVarCall = - getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( - spaceId, id, scheduleId, null); - Type localVarReturnType = - new TypeToken() {}.getType(); + public ApiResponse getAudienceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Audience Schedule from Space And Audience (asynchronously) Returns the schedule for the - * given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any - * feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. + * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in + * **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In + * order to successfully call this endpoint, the specified Workspace needs to have the Audience + * feature enabled. Please reach out to your customer success manager for more information. The + * rate limit for this endpoint is 100 requests per minute, which is lower than the default due + * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) - * @param scheduleId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1110,18 +467,12 @@ private okhttp3.Call getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( * 429 Too many requests - * */ - public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceAsync( - String spaceId, - String id, - String scheduleId, - final ApiCallback _callback) + public okhttp3.Call getAudienceAsync( + String spaceId, String id, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( - spaceId, id, scheduleId, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1392,10 +743,12 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( } /** - * Build call for listAudienceSchedulesFromSpaceAndAudience + * Build call for listAudiences * * @param spaceId (required) - * @param id (required) + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1408,8 +761,9 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * 429 Too many requests - * */ - public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { + public okhttp3.Call listAudiencesCall( + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1427,11 +781,10 @@ public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceCall( // create path and map variables String localVarPath = - "/spaces/{spaceId}/audiences/{id}/schedules" + "/spaces/{spaceId}/audiences" .replace( "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())) - .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + localVarApiClient.escapeString(spaceId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -1439,8 +792,14 @@ public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" + "application/vnd.segment.v1beta+json", + "application/vnd.segment.v1alpha+json", + "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1470,35 +829,33 @@ public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { + private okhttp3.Call listAudiencesValidateBeforeCall( + String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( - "Missing the required parameter 'spaceId' when calling" - + " listAudienceSchedulesFromSpaceAndAudience(Async)"); - } - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - "Missing the required parameter 'id' when calling" - + " listAudienceSchedulesFromSpaceAndAudience(Async)"); + "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); } - return listAudienceSchedulesFromSpaceAndAudienceCall(spaceId, id, _callback); + return listAudiencesCall(spaceId, pagination, _callback); } /** - * List Audience Schedules from Space And Audience Returns the list of schedules for the given - * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Audience feature enabled. Please reach out to your customer - * success manager for more information. + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 25 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) - * @param id (required) - * @return ListAudienceSchedulesFromSpaceAndAudience200Response + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) + * @return ListAudiences200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1510,24 +867,28 @@ private okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall * 429 Too many requests - * */ - public ListAudienceSchedulesFromSpaceAndAudience200Response - listAudienceSchedulesFromSpaceAndAudience(String spaceId, String id) - throws ApiException { - ApiResponse localVarResp = - listAudienceSchedulesFromSpaceAndAudienceWithHttpInfo(spaceId, id); + public ListAudiences200Response listAudiences( + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + ApiResponse localVarResp = + listAudiencesWithHttpInfo(spaceId, pagination); return localVarResp.getData(); } /** - * List Audience Schedules from Space And Audience Returns the list of schedules for the given - * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Audience feature enabled. Please reach out to your customer - * success manager for more information. + * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 25 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) - * @param id (required) - * @return ApiResponse<ListAudienceSchedulesFromSpaceAndAudience200Response> + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) + * @return ApiResponse<ListAudiences200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1539,25 +900,27 @@ private okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall * 429 Too many requests - * */ - public ApiResponse - listAudienceSchedulesFromSpaceAndAudienceWithHttpInfo(String spaceId, String id) - throws ApiException { - okhttp3.Call localVarCall = - listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall(spaceId, id, null); - Type localVarReturnType = - new TypeToken() {}.getType(); + public ApiResponse listAudiencesWithHttpInfo( + String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Audience Schedules from Space And Audience (asynchronously) Returns the list of - * schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any - * feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. + * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Beta** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 25 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) - * @param id (required) + * @param pagination Information about the pagination of this response. [See + * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) + * for more info. This parameter exists in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1571,29 +934,23 @@ private okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall * 429 Too many requests - * */ - public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceAsync( + public okhttp3.Call listAudiencesAsync( String spaceId, - String id, - final ApiCallback _callback) + ListAudiencesPaginationInput pagination, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = - listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall(spaceId, id, _callback); - Type localVarReturnType = - new TypeToken() {}.getType(); + okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for listAudiences + * Build call for previewAudience * * @param spaceId (required) - * @param pagination Information about the pagination of this response. [See - * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) - * for more info. This parameter exists in alpha. (optional) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) + * @param previewAudienceInput (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1606,11 +963,8 @@ public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceAsync( * 429 Too many requests - * */ - public okhttp3.Call listAudiencesCall( - String spaceId, - ListAudiencesPaginationInput pagination, - String include, - final ApiCallback _callback) + public okhttp3.Call previewAudienceCall( + String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1625,11 +979,11 @@ public okhttp3.Call listAudiencesCall( basePath = null; } - Object localVarPostBody = null; + Object localVarPostBody = previewAudienceInput; // create path and map variables String localVarPath = - "/spaces/{spaceId}/audiences" + "/spaces/{spaceId}/audiences/previews" .replace( "{" + "spaceId" + "}", localVarApiClient.escapeString(spaceId.toString())); @@ -1640,25 +994,15 @@ public okhttp3.Call listAudiencesCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (pagination != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); - } - - if (include != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); - } - final String[] localVarAccepts = { - "application/vnd.segment.v1beta+json", - "application/vnd.segment.v1alpha+json", - "application/json" + "application/vnd.segment.v1alpha+json", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } - final String[] localVarContentTypes = {}; + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { @@ -1669,7 +1013,7 @@ public okhttp3.Call listAudiencesCall( return localVarApiClient.buildCall( basePath, localVarPath, - "GET", + "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -1681,39 +1025,43 @@ public okhttp3.Call listAudiencesCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, - ListAudiencesPaginationInput pagination, - String include, - final ApiCallback _callback) + private okhttp3.Call previewAudienceValidateBeforeCall( + String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( - "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); + "Missing the required parameter 'spaceId' when calling previewAudience(Async)"); + } + + // verify the required parameter 'previewAudienceInput' is set + if (previewAudienceInput == null) { + throw new ApiException( + "Missing the required parameter 'previewAudienceInput' when calling" + + " previewAudience(Async)"); } - return listAudiencesCall(spaceId, pagination, include, _callback); + return previewAudienceCall(spaceId, previewAudienceInput, _callback); } /** - * List Audiences Returns Audiences by spaceId. Supports including audience schedules via - * `?include=schedules`. • This endpoint is in **Beta** testing. Please submit + * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit * any feedback by sending an email to friends@segment.com. • In order to successfully call this * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. The rate limit for this endpoint - * is 25 requests per minute, which is lower than the default due to access pattern + * out to your customer success manager for more information. • When called, this endpoint may + * generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * requests per month per spaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param spaceId (required) - * @param pagination Information about the pagination of this response. [See - * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) - * for more info. This parameter exists in alpha. (optional) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @return ListAudiences200Response + * @param previewAudienceInput (required) + * @return PreviewAudience200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1725,32 +1073,31 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * 429 Too many requests - * */ - public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination, String include) - throws ApiException { - ApiResponse localVarResp = - listAudiencesWithHttpInfo(spaceId, pagination, include); + public PreviewAudience200Response previewAudience( + String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { + ApiResponse localVarResp = + previewAudienceWithHttpInfo(spaceId, previewAudienceInput); return localVarResp.getData(); } /** - * List Audiences Returns Audiences by spaceId. Supports including audience schedules via - * `?include=schedules`. • This endpoint is in **Beta** testing. Please submit + * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit * any feedback by sending an email to friends@segment.com. • In order to successfully call this * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. The rate limit for this endpoint - * is 25 requests per minute, which is lower than the default due to access pattern + * out to your customer success manager for more information. • When called, this endpoint may + * generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 + * requests per month per spaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param spaceId (required) - * @param pagination Information about the pagination of this response. [See - * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) - * for more info. This parameter exists in alpha. (optional) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) - * @return ApiResponse<ListAudiences200Response> + * @param previewAudienceInput (required) + * @return ApiResponse<PreviewAudience200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details @@ -1762,32 +1109,31 @@ public ListAudiences200Response listAudiences( * 429 Too many requests - * */ - public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination, String include) - throws ApiException { + public ApiResponse previewAudienceWithHttpInfo( + String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { okhttp3.Call localVarCall = - listAudiencesValidateBeforeCall(spaceId, pagination, include, null); - Type localVarReturnType = new TypeToken() {}.getType(); + previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Audiences (asynchronously) Returns Audiences by spaceId. Supports including audience - * schedules via `?include=schedules`. • This endpoint is in **Beta** testing. + * Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing. * Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 25 requests per minute, which is lower than the default due to + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Preview Created` event in the + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for + * this endpoint is 700 requests per month per spaceId, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) - * @param pagination Information about the pagination of this response. [See - * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) - * for more info. This parameter exists in alpha. (optional) - * @param include Additional resource to include, support schedules only. This parameter exists - * in alpha. (optional) + * @param previewAudienceInput (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1801,16 +1147,15 @@ public ApiResponse listAudiencesWithHttpInfo( * 429 Too many requests - * */ - public okhttp3.Call listAudiencesAsync( + public okhttp3.Call previewAudienceAsync( String spaceId, - ListAudiencesPaginationInput pagination, - String include, - final ApiCallback _callback) + PreviewAudienceInput previewAudienceInput, + final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listAudiencesValidateBeforeCall(spaceId, pagination, include, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); + previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java deleted file mode 100644 index c6fd3573..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** An audience preview. */ -public class AudiencePreview { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** The audience type of the preview. */ - @JsonAdapter(AudienceTypeEnum.Adapter.class) - public enum AudienceTypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - AudienceTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AudienceTypeEnum fromValue(String value) { - for (AudienceTypeEnum b : AudienceTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AudienceTypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) - private AudienceTypeEnum audienceType; - - public static final String SERIALIZED_NAME_DEFINITION = "definition"; - - @SerializedName(SERIALIZED_NAME_DEFINITION) - private AudienceDefinitionWithoutType definition; - - public static final String SERIALIZED_NAME_OPTIONS = "options"; - - @SerializedName(SERIALIZED_NAME_OPTIONS) - private ReadAudiencePreviewOptions options; - - /** Status for the audience preview. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - COMPLETED("COMPLETED"), - - FAILED("FAILED"), - - RUNNING("RUNNING"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_RESULTS = "results"; - - @SerializedName(SERIALIZED_NAME_RESULTS) - private List results; - - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - - public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; - - @SerializedName(SERIALIZED_NAME_FAILURE_REASON) - private String failureReason; - - public AudiencePreview() {} - - public AudiencePreview id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudiencePreview audienceType(AudienceTypeEnum audienceType) { - - this.audienceType = audienceType; - return this; - } - - /** - * The audience type of the preview. - * - * @return audienceType - */ - @javax.annotation.Nonnull - public AudienceTypeEnum getAudienceType() { - return audienceType; - } - - public void setAudienceType(AudienceTypeEnum audienceType) { - this.audienceType = audienceType; - } - - public AudiencePreview definition(AudienceDefinitionWithoutType definition) { - - this.definition = definition; - return this; - } - - /** - * Get definition - * - * @return definition - */ - @javax.annotation.Nonnull - public AudienceDefinitionWithoutType getDefinition() { - return definition; - } - - public void setDefinition(AudienceDefinitionWithoutType definition) { - this.definition = definition; - } - - public AudiencePreview options(ReadAudiencePreviewOptions options) { - - this.options = options; - return this; - } - - /** - * Get options - * - * @return options - */ - @javax.annotation.Nonnull - public ReadAudiencePreviewOptions getOptions() { - return options; - } - - public void setOptions(ReadAudiencePreviewOptions options) { - this.options = options; - } - - public AudiencePreview status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * Status for the audience preview. - * - * @return status - */ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public AudiencePreview results(List results) { - - this.results = results; - return this; - } - - public AudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { - if (this.results == null) { - this.results = new ArrayList<>(); - } - this.results.add(resultsItem); - return this; - } - - /** - * Sampled result membership for the audience preview. Only has a value if the status is - * 'COMPLETED'. - * - * @return results - */ - @javax.annotation.Nullable - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - public AudiencePreview size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nullable - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - - public AudiencePreview failureReason(String failureReason) { - - this.failureReason = failureReason; - return this; - } - - /** - * Explanation of why the audience preview failed. Only has a value if status is - * 'FAILED'. - * - * @return failureReason - */ - @javax.annotation.Nullable - public String getFailureReason() { - return failureReason; - } - - public void setFailureReason(String failureReason) { - this.failureReason = failureReason; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreview audiencePreview = (AudiencePreview) o; - return Objects.equals(this.id, audiencePreview.id) - && Objects.equals(this.audienceType, audiencePreview.audienceType) - && Objects.equals(this.definition, audiencePreview.definition) - && Objects.equals(this.options, audiencePreview.options) - && Objects.equals(this.status, audiencePreview.status) - && Objects.equals(this.results, audiencePreview.results) - && Objects.equals(this.size, audiencePreview.size) - && Objects.equals(this.failureReason, audiencePreview.failureReason); - } - - @Override - public int hashCode() { - return Objects.hash( - id, audienceType, definition, options, status, results, size, failureReason); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreview {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); - sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); - sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("audienceType"); - openapiFields.add("definition"); - openapiFields.add("options"); - openapiFields.add("status"); - openapiFields.add("results"); - openapiFields.add("size"); - openapiFields.add("failureReason"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("audienceType"); - openapiRequiredFields.add("definition"); - openapiRequiredFields.add("options"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreview - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreview.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreview is not found in the" - + " empty JSON string", - AudiencePreview.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreview.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreview` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreview.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("audienceType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("audienceType").toString())); - } - // validate the required field `definition` - AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); - // validate the required field `options` - ReadAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { - JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); - if (jsonArrayresults != null) { - // ensure the json data is an array - if (!jsonObj.get("results").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `results` to be an array in the JSON string" - + " but got `%s`", - jsonObj.get("results").toString())); - } - - // validate the optional field `results` (array) - for (int i = 0; i < jsonArrayresults.size(); i++) { - AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); - } - ; - } - } - // validate the optional field `size` - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { - AudienceSize.validateJsonElement(jsonObj.get("size")); - } - if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) - && !jsonObj.get("failureReason").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `failureReason` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("failureReason").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreview' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreview.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreview value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreview read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreview given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreview - * @throws IOException if the JSON string is invalid with respect to AudiencePreview - */ - public static AudiencePreview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreview.class); - } - - /** - * Convert an instance of AudiencePreview to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java deleted file mode 100644 index 5fadb72a..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Identifier for an audience preview. */ -public class AudiencePreviewIdentifier { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public AudiencePreviewIdentifier() {} - - public AudiencePreviewIdentifier id(String id) { - - this.id = id; - return this; - } - - /** - * Unique identifier for tracking and retrieving results of an audience preview. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewIdentifier audiencePreviewIdentifier = (AudiencePreviewIdentifier) o; - return Objects.equals(this.id, audiencePreviewIdentifier.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewIdentifier {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewIdentifier - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewIdentifier.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewIdentifier is not found" - + " in the empty JSON string", - AudiencePreviewIdentifier.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewIdentifier.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewIdentifier` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewIdentifier.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewIdentifier.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewIdentifier' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewIdentifier.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewIdentifier value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewIdentifier read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreviewIdentifier given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreviewIdentifier - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewIdentifier - */ - public static AudiencePreviewIdentifier fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewIdentifier.class); - } - - /** - * Convert an instance of AudiencePreviewIdentifier to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java deleted file mode 100644 index 043245e1..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.openapitools.jackson.nullable.JsonNullable; - -/** Defines an Audience Schedule. */ -public class AudienceSchedule { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** Strategy of the audience schedule (manual, periodic, or specific days). */ - @JsonAdapter(StrategyEnum.Adapter.class) - public enum StrategyEnum { - MANUAL("MANUAL"), - - PERIODIC("PERIODIC"), - - SPECIFIC_DAYS("SPECIFIC_DAYS"); - - private String value; - - StrategyEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StrategyEnum fromValue(String value) { - for (StrategyEnum b : StrategyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StrategyEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StrategyEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STRATEGY = "strategy"; - - @SerializedName(SERIALIZED_NAME_STRATEGY) - private StrategyEnum strategy; - - public static final String SERIALIZED_NAME_CONFIG = "config"; - - @SerializedName(SERIALIZED_NAME_CONFIG) - private Config config; - - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - - public static final String SERIALIZED_NAME_NEXT_EXECUTION = "nextExecution"; - - @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION) - private String nextExecution; - - public AudienceSchedule() {} - - public AudienceSchedule id(String id) { - - this.id = id; - return this; - } - - /** - * Distinct identifier for the schedule. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudienceSchedule strategy(StrategyEnum strategy) { - - this.strategy = strategy; - return this; - } - - /** - * Strategy of the audience schedule (manual, periodic, or specific days). - * - * @return strategy - */ - @javax.annotation.Nonnull - public StrategyEnum getStrategy() { - return strategy; - } - - public void setStrategy(StrategyEnum strategy) { - this.strategy = strategy; - } - - public AudienceSchedule config(Config config) { - - this.config = config; - return this; - } - - /** - * Get config - * - * @return config - */ - @javax.annotation.Nullable - public Config getConfig() { - return config; - } - - public void setConfig(Config config) { - this.config = config; - } - - public AudienceSchedule enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether the schedule is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public AudienceSchedule nextExecution(String nextExecution) { - - this.nextExecution = nextExecution; - return this; - } - - /** - * The next scheduled execution time (RFC3339). - * - * @return nextExecution - */ - @javax.annotation.Nonnull - public String getNextExecution() { - return nextExecution; - } - - public void setNextExecution(String nextExecution) { - this.nextExecution = nextExecution; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSchedule audienceSchedule = (AudienceSchedule) o; - return Objects.equals(this.id, audienceSchedule.id) - && Objects.equals(this.strategy, audienceSchedule.strategy) - && Objects.equals(this.config, audienceSchedule.config) - && Objects.equals(this.enabled, audienceSchedule.enabled) - && Objects.equals(this.nextExecution, audienceSchedule.nextExecution); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b - || (a != null - && b != null - && a.isPresent() - && b.isPresent() - && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, strategy, config, enabled, nextExecution); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSchedule {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); - sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" nextExecution: ").append(toIndentedString(nextExecution)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("strategy"); - openapiFields.add("config"); - openapiFields.add("enabled"); - openapiFields.add("nextExecution"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("strategy"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("nextExecution"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceSchedule - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSchedule.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceSchedule is not found in the" - + " empty JSON string", - AudienceSchedule.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSchedule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSchedule` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceSchedule.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("strategy").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `strategy` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("strategy").toString())); - } - // validate the optional field `config` - if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - Config.validateJsonElement(jsonObj.get("config")); - } - if (!jsonObj.get("nextExecution").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `nextExecution` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("nextExecution").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSchedule.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceSchedule' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceSchedule.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceSchedule value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSchedule read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSchedule given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSchedule - * @throws IOException if the JSON string is invalid with respect to AudienceSchedule - */ - public static AudienceSchedule fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceSchedule.class); - } - - /** - * Convert an instance of AudienceSchedule to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSize.java b/src/main/java/com/segment/publicapi/models/AudienceSize.java deleted file mode 100644 index 51d2a3af..00000000 --- a/src/main/java/com/segment/publicapi/models/AudienceSize.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** AudienceSize */ -public class AudienceSize { - public static final String SERIALIZED_NAME_COUNT = "count"; - - @SerializedName(SERIALIZED_NAME_COUNT) - private BigDecimal count; - - /** The unit type for the count(s) being returned. */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ACCOUNTS("ACCOUNTS"), - - USERS("USERS"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public AudienceSize() {} - - public AudienceSize count(BigDecimal count) { - - this.count = count; - return this; - } - - /** - * The total audience membership count. Refer to the type field to determine the unit for this - * field (profiles, accounts, etc). - * - * @return count - */ - @javax.annotation.Nonnull - public BigDecimal getCount() { - return count; - } - - public void setCount(BigDecimal count) { - this.count = count; - } - - public AudienceSize type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The unit type for the count(s) being returned. - * - * @return type - */ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudienceSize audienceSize = (AudienceSize) o; - return Objects.equals(this.count, audienceSize.count) - && Objects.equals(this.type, audienceSize.type); - } - - @Override - public int hashCode() { - return Objects.hash(count, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudienceSize {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("count"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("count"); - openapiRequiredFields.add("type"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudienceSize - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudienceSize.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudienceSize is not found in the empty" - + " JSON string", - AudienceSize.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudienceSize.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudienceSize` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudienceSize.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudienceSize.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudienceSize' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudienceSize.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudienceSize value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudienceSize read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudienceSize given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudienceSize - * @throws IOException if the JSON string is invalid with respect to AudienceSize - */ - public static AudienceSize fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudienceSize.class); - } - - /** - * Convert an instance of AudienceSize to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index c225d085..88b7b297 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -12,7 +12,6 @@ package com.segment.publicapi.models; import com.google.gson.Gson; -import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -24,9 +23,7 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -91,21 +88,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) private AudienceOptionsWithLookback options; - public static final String SERIALIZED_NAME_SCHEDULES = "schedules"; - - @SerializedName(SERIALIZED_NAME_SCHEDULES) - private List schedules; - public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -209,26 +196,6 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } - public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nullable - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -249,35 +216,6 @@ public void setOptions(AudienceOptionsWithLookback options) { this.options = options; } - public AudienceSummaryWithAudienceTypeAndLookback schedules(List schedules) { - - this.schedules = schedules; - return this; - } - - public AudienceSummaryWithAudienceTypeAndLookback addSchedulesItem( - AudienceSchedule schedulesItem) { - if (this.schedules == null) { - this.schedules = new ArrayList<>(); - } - this.schedules.add(schedulesItem); - return this; - } - - /** - * List of schedules for the audience. - * - * @return schedules - */ - @javax.annotation.Nullable - public List getSchedules() { - return schedules; - } - - public void setSchedules(List schedules) { - this.schedules = schedules; - } - public AudienceSummaryWithAudienceTypeAndLookback id(String id) { this.id = id; @@ -534,10 +472,7 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) - && Objects.equals( - this.schedules, audienceSummaryWithAudienceTypeAndLookback.schedules) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) @@ -563,9 +498,7 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, - size, options, - schedules, id, spaceId, name, @@ -586,9 +519,7 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -624,9 +555,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); - openapiFields.add("size"); openapiFields.add("options"); - openapiFields.add("schedules"); openapiFields.add("id"); openapiFields.add("spaceId"); openapiFields.add("name"); @@ -711,33 +640,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `size` - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { - AudienceSize.validateJsonElement(jsonObj.get("size")); - } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); } - if (jsonObj.get("schedules") != null && !jsonObj.get("schedules").isJsonNull()) { - JsonArray jsonArrayschedules = jsonObj.getAsJsonArray("schedules"); - if (jsonArrayschedules != null) { - // ensure the json data is an array - if (!jsonObj.get("schedules").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `schedules` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("schedules").toString())); - } - - // validate the optional field `schedules` (array) - for (int i = 0; i < jsonArrayschedules.size(); i++) { - AudienceSchedule.validateJsonElement(jsonArrayschedules.get(i)); - } - ; - } - } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index 8327f000..a1455431 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -37,10 +37,22 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'Config' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterPeriodicConfig = - gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); - final TypeAdapter adapterSpecificDaysConfig = - gson.getDelegateAdapter(this, TypeToken.get(SpecificDaysConfig.class)); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlDbtCloudScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -51,25 +63,55 @@ public void write(JsonWriter out, Config value) throws IOException { return; } - // check if the actual instance is of the type `PeriodicConfig` - if (value.getActualInstance() instanceof PeriodicConfig) { + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { JsonElement element = - adapterPeriodicConfig.toJsonTree( - (PeriodicConfig) value.getActualInstance()); + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `SpecificDaysConfig` - if (value.getActualInstance() instanceof SpecificDaysConfig) { + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { JsonElement element = - adapterSpecificDaysConfig.toJsonTree( - (SpecificDaysConfig) value.getActualInstance()); + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlDbtCloudScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlDbtCloudScheduleConfig) { + JsonElement element = + adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( + (ReverseEtlDbtCloudScheduleConfig) + value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " PeriodicConfig, SpecificDaysConfig"); + + " ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } @Override @@ -80,11 +122,11 @@ public Config read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize PeriodicConfig + // deserialize ReverseEtlPeriodicScheduleConfig try { // validate the JSON object to see if any exception is thrown - PeriodicConfig.validateJsonElement(jsonElement); - actualAdapter = adapterPeriodicConfig; + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; Config ret = new Config(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -92,19 +134,22 @@ public Config read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for PeriodicConfig failed with" - + " `%s`.", + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'PeriodicConfig'", + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", e); } - // deserialize SpecificDaysConfig + // deserialize ReverseEtlSpecificTimeScheduleConfig try { // validate the JSON object to see if any exception is thrown - SpecificDaysConfig.validateJsonElement(jsonElement); - actualAdapter = adapterSpecificDaysConfig; + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; Config ret = new Config(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -112,12 +157,57 @@ public Config read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for SpecificDaysConfig failed with" - + " `%s`.", + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema 'SpecificDaysConfig'", + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } + // deserialize ReverseEtlDbtCloudScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; + Config ret = new Config(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlDbtCloudScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlDbtCloudScheduleConfig'", e); } @@ -139,19 +229,32 @@ public Config() { super("anyOf", Boolean.TRUE); } - public Config(PeriodicConfig o) { + public Config(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config(ReverseEtlDbtCloudScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config(ReverseEtlPeriodicScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); } - public Config(SpecificDaysConfig o) { + public Config(ReverseEtlSpecificTimeScheduleConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); } static { - schemas.put("PeriodicConfig", PeriodicConfig.class); - schemas.put("SpecificDaysConfig", SpecificDaysConfig.class); + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); + schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); } @Override @@ -161,7 +264,9 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: PeriodicConfig, SpecificDaysConfig + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -172,24 +277,39 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof PeriodicConfig) { + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlCronScheduleConfig) { super.setActualInstance(instance); return; } - if (instance instanceof SpecificDaysConfig) { + if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { super.setActualInstance(instance); return; } throw new RuntimeException( - "Invalid instance type. Must be PeriodicConfig, SpecificDaysConfig"); + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); } /** - * Get the actual instance, which can be the following: PeriodicConfig, SpecificDaysConfig + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig * - * @return The actual instance (PeriodicConfig, SpecificDaysConfig) + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) */ @Override public Object getActualInstance() { @@ -197,25 +317,51 @@ public Object getActualInstance() { } /** - * Get the actual instance of `PeriodicConfig`. If the actual instance is not `PeriodicConfig`, - * the ClassCastException will be thrown. + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. * - * @return The actual instance of `PeriodicConfig` - * @throws ClassCastException if the instance is not `PeriodicConfig` + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` */ - public PeriodicConfig getPeriodicConfig() throws ClassCastException { - return (PeriodicConfig) super.getActualInstance(); + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); } /** - * Get the actual instance of `SpecificDaysConfig`. If the actual instance is not - * `SpecificDaysConfig`, the ClassCastException will be thrown. + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. * - * @return The actual instance of `SpecificDaysConfig` - * @throws ClassCastException if the instance is not `SpecificDaysConfig` + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` */ - public SpecificDaysConfig getSpecificDaysConfig() throws ClassCastException { - return (SpecificDaysConfig) super.getActualInstance(); + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not + * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` + */ + public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() + throws ClassCastException { + return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); } /** @@ -227,33 +373,61 @@ public SpecificDaysConfig getSpecificDaysConfig() throws ClassCastException { public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate anyOf schemas one by one ArrayList errorMessages = new ArrayList<>(); - // validate the json string with PeriodicConfig + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlCronScheduleConfig try { - PeriodicConfig.validateJsonElement(jsonElement); + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for PeriodicConfig failed with `%s`.", + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with SpecificDaysConfig + // validate the json string with ReverseEtlDbtCloudScheduleConfig try { - SpecificDaysConfig.validateJsonElement(jsonElement); + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for SpecificDaysConfig failed with `%s`.", + "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" + + " `%s`.", e.getMessage())); // continue to the next one } throw new IOException( String.format( - "The JSON string is invalid for Config with anyOf schemas: PeriodicConfig," - + " SpecificDaysConfig. no class match the result, expected at least 1." - + " Detailed failure message for anyOf schemas: %s. JSON: %s", + "The JSON string is invalid for Config with anyOf schemas:" + + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", errorMessages, jsonElement.toString())); } diff --git a/src/main/java/com/segment/publicapi/models/Config1.java b/src/main/java/com/segment/publicapi/models/Config1.java deleted file mode 100644 index 873f79bd..00000000 --- a/src/main/java/com/segment/publicapi/models/Config1.java +++ /dev/null @@ -1,453 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class Config1 extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(Config1.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Config1.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Config1' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlDbtCloudScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, Config1 value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { - JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { - JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlDbtCloudScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlDbtCloudScheduleConfig) { - JsonElement element = - adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( - (ReverseEtlDbtCloudScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," - + " ReverseEtlDbtCloudScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } - - @Override - public Config1 read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize ReverseEtlPeriodicScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; - Config1 ret = new Config1(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", - e); - } - // deserialize ReverseEtlSpecificTimeScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; - Config1 ret = new Config1(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - Config1 ret = new Config1(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } - // deserialize ReverseEtlDbtCloudScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; - Config1 ret = new Config1(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlDbtCloudScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlDbtCloudScheduleConfig'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for Config1: no class matches" - + " result, expected at least 1. Detailed failure" - + " message for anyOf schemas: %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public Config1() { - super("anyOf", Boolean.TRUE); - } - - public Config1(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config1(ReverseEtlDbtCloudScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config1(ReverseEtlPeriodicScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config1(ReverseEtlSpecificTimeScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); - schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); - } - - @Override - public Map> getSchemas() { - return Config1.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - *

It could be an instance of the 'anyOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance == null) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlCronScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); - } - - /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig - * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` - */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` - */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not - * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` - */ - public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() - throws ClassCastException { - return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Config1 - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlCronScheduleConfig - try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlDbtCloudScheduleConfig - try { - ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - throw new IOException( - String.format( - "The JSON string is invalid for Config1 with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", - errorMessages, jsonElement.toString())); - } - - /** - * Create an instance of Config1 given an JSON string - * - * @param jsonString JSON string - * @return An instance of Config1 - * @throws IOException if the JSON string is invalid with respect to Config1 - */ - public static Config1 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Config1.class); - } - - /** - * Convert an instance of Config1 to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java deleted file mode 100644 index bdbd349b..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** CreateAudiencePreview200Response */ -public class CreateAudiencePreview200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private CreateAudiencePreviewAlphaOutput data; - - public CreateAudiencePreview200Response() {} - - public CreateAudiencePreview200Response data(CreateAudiencePreviewAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public CreateAudiencePreviewAlphaOutput getData() { - return data; - } - - public void setData(CreateAudiencePreviewAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAudiencePreview200Response createAudiencePreview200Response = - (CreateAudiencePreview200Response) o; - return Objects.equals(this.data, createAudiencePreview200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreview200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreview200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAudiencePreview200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAudiencePreview200Response is" - + " not found in the empty JSON string", - CreateAudiencePreview200Response.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAudiencePreview200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreview200Response` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - CreateAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreview200Response' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreview200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAudiencePreview200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAudiencePreview200Response read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAudiencePreview200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAudiencePreview200Response - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreview200Response - */ - public static CreateAudiencePreview200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreview200Response.class); - } - - /** - * Convert an instance of CreateAudiencePreview200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java deleted file mode 100644 index efae7afe..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output when creating an audience preview. */ -public class CreateAudiencePreviewAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) - private AudiencePreviewIdentifier audiencePreview; - - public CreateAudiencePreviewAlphaOutput() {} - - public CreateAudiencePreviewAlphaOutput audiencePreview( - AudiencePreviewIdentifier audiencePreview) { - - this.audiencePreview = audiencePreview; - return this; - } - - /** - * Get audiencePreview - * - * @return audiencePreview - */ - @javax.annotation.Nonnull - public AudiencePreviewIdentifier getAudiencePreview() { - return audiencePreview; - } - - public void setAudiencePreview(AudiencePreviewIdentifier audiencePreview) { - this.audiencePreview = audiencePreview; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAudiencePreviewAlphaOutput createAudiencePreviewAlphaOutput = - (CreateAudiencePreviewAlphaOutput) o; - return Objects.equals( - this.audiencePreview, createAudiencePreviewAlphaOutput.audiencePreview); - } - - @Override - public int hashCode() { - return Objects.hash(audiencePreview); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreviewAlphaOutput {\n"); - sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audiencePreview"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audiencePreview"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreviewAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAudiencePreviewAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAudiencePreviewAlphaOutput is" - + " not found in the empty JSON string", - CreateAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreviewAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateAudiencePreviewAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `audiencePreview` - AudiencePreviewIdentifier.validateJsonElement(jsonObj.get("audiencePreview")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreviewAlphaOutput' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreviewAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAudiencePreviewAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAudiencePreviewAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAudiencePreviewAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAudiencePreviewAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreviewAlphaOutput - */ - public static CreateAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaOutput.class); - } - - /** - * Convert an instance of CreateAudiencePreviewAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java deleted file mode 100644 index fbaee4a4..00000000 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Options which should be applied when segmenting audience previews. */ -public class CreateAudiencePreviewOptions { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds; - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public CreateAudiencePreviewOptions() {} - - public CreateAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public CreateAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience preview membership. - * Profiles will only be considered for audience preview membership if the profile has at least - * one external id whose key matches a value in this set. If unspecified, a default set of - * external identifiers will be used: `['user_id', 'email', - * 'android.idfa', 'ios.idfa']`. - * - * @return filterByExternalIds - */ - @javax.annotation.Nullable - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public CreateAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days (specified from the date - * the audience preview was created) that event data will be included from when determining - * audience preview membership. If not specified, the default is set to the maximum event window - * size, or 7 days if no window condition is defined. Note that this is applied on a best-effort - * basis and may not always be applicable. In such cases, the response will not return a - * backfillEventDataDays value, and all available data will be taken into account. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CreateAudiencePreviewOptions createAudiencePreviewOptions = - (CreateAudiencePreviewOptions) o; - return Objects.equals( - this.filterByExternalIds, createAudiencePreviewOptions.filterByExternalIds) - && Objects.equals( - this.backfillEventDataDays, - createAudiencePreviewOptions.backfillEventDataDays); - } - - @Override - public int hashCode() { - return Objects.hash(filterByExternalIds, backfillEventDataDays); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreviewOptions {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("backfillEventDataDays"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreviewOptions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CreateAudiencePreviewOptions.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in CreateAudiencePreviewOptions is not" - + " found in the empty JSON string", - CreateAudiencePreviewOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CreateAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreviewOptions` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the optional json data is an array if present - if (jsonObj.get("filterByExternalIds") != null - && !jsonObj.get("filterByExternalIds").isJsonNull() - && !jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreviewOptions' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreviewOptions.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, CreateAudiencePreviewOptions value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CreateAudiencePreviewOptions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of CreateAudiencePreviewOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of CreateAudiencePreviewOptions - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreviewOptions - */ - public static CreateAudiencePreviewOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewOptions.class); - } - - /** - * Convert an instance of CreateAudiencePreviewOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java deleted file mode 100644 index 91363b74..00000000 --- a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output when reading an audience preview. */ -public class GetAudiencePreviewAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) - private AudiencePreview audiencePreview; - - public GetAudiencePreviewAlphaOutput() {} - - public GetAudiencePreviewAlphaOutput audiencePreview(AudiencePreview audiencePreview) { - - this.audiencePreview = audiencePreview; - return this; - } - - /** - * Get audiencePreview - * - * @return audiencePreview - */ - @javax.annotation.Nonnull - public AudiencePreview getAudiencePreview() { - return audiencePreview; - } - - public void setAudiencePreview(AudiencePreview audiencePreview) { - this.audiencePreview = audiencePreview; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAudiencePreviewAlphaOutput getAudiencePreviewAlphaOutput = - (GetAudiencePreviewAlphaOutput) o; - return Objects.equals(this.audiencePreview, getAudiencePreviewAlphaOutput.audiencePreview); - } - - @Override - public int hashCode() { - return Objects.hash(audiencePreview); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAudiencePreviewAlphaOutput {\n"); - sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audiencePreview"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audiencePreview"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetAudiencePreviewAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetAudiencePreviewAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in GetAudiencePreviewAlphaOutput is not" - + " found in the empty JSON string", - GetAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAudiencePreviewAlphaOutput` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GetAudiencePreviewAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `audiencePreview` - AudiencePreview.validateJsonElement(jsonObj.get("audiencePreview")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAudiencePreviewAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetAudiencePreviewAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, GetAudiencePreviewAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAudiencePreviewAlphaOutput read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetAudiencePreviewAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAudiencePreviewAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * GetAudiencePreviewAlphaOutput - */ - public static GetAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAudiencePreviewAlphaOutput.class); - } - - /** - * Convert an instance of GetAudiencePreviewAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java deleted file mode 100644 index 22661112..00000000 --- a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** GetAudienceScheduleFromSpaceAndAudience200Response */ -public class GetAudienceScheduleFromSpaceAndAudience200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data; - - public GetAudienceScheduleFromSpaceAndAudience200Response() {} - - public GetAudienceScheduleFromSpaceAndAudience200Response data( - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput getData() { - return data; - } - - public void setData(GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAudienceScheduleFromSpaceAndAudience200Response - getAudienceScheduleFromSpaceAndAudience200Response = - (GetAudienceScheduleFromSpaceAndAudience200Response) o; - return Objects.equals(this.data, getAudienceScheduleFromSpaceAndAudience200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAudienceScheduleFromSpaceAndAudience200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetAudienceScheduleFromSpaceAndAudience200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetAudienceScheduleFromSpaceAndAudience200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " GetAudienceScheduleFromSpaceAndAudience200Response is not" - + " found in the empty JSON string", - GetAudienceScheduleFromSpaceAndAudience200Response - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAudienceScheduleFromSpaceAndAudience200Response.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAudienceScheduleFromSpaceAndAudience200Response`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.validateJsonElement( - jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudienceScheduleFromSpaceAndAudience200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'GetAudienceScheduleFromSpaceAndAudience200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - GetAudienceScheduleFromSpaceAndAudience200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - GetAudienceScheduleFromSpaceAndAudience200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAudienceScheduleFromSpaceAndAudience200Response read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetAudienceScheduleFromSpaceAndAudience200Response given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAudienceScheduleFromSpaceAndAudience200Response - * @throws IOException if the JSON string is invalid with respect to - * GetAudienceScheduleFromSpaceAndAudience200Response - */ - public static GetAudienceScheduleFromSpaceAndAudience200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, GetAudienceScheduleFromSpaceAndAudience200Response.class); - } - - /** - * Convert an instance of GetAudienceScheduleFromSpaceAndAudience200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java deleted file mode 100644 index 44f75ed2..00000000 --- a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output for get audience schedule. */ -public class GetAudienceScheduleFromSpaceAndAudienceAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE_SCHEDULE = "audienceSchedule"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_SCHEDULE) - private AudienceSchedule audienceSchedule; - - public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput() {} - - public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput audienceSchedule( - AudienceSchedule audienceSchedule) { - - this.audienceSchedule = audienceSchedule; - return this; - } - - /** - * Get audienceSchedule - * - * @return audienceSchedule - */ - @javax.annotation.Nonnull - public AudienceSchedule getAudienceSchedule() { - return audienceSchedule; - } - - public void setAudienceSchedule(AudienceSchedule audienceSchedule) { - this.audienceSchedule = audienceSchedule; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput - getAudienceScheduleFromSpaceAndAudienceAlphaOutput = - (GetAudienceScheduleFromSpaceAndAudienceAlphaOutput) o; - return Objects.equals( - this.audienceSchedule, - getAudienceScheduleFromSpaceAndAudienceAlphaOutput.audienceSchedule); - } - - @Override - public int hashCode() { - return Objects.hash(audienceSchedule); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetAudienceScheduleFromSpaceAndAudienceAlphaOutput {\n"); - sb.append(" audienceSchedule: ").append(toIndentedString(audienceSchedule)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audienceSchedule"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audienceSchedule"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetAudienceScheduleFromSpaceAndAudienceAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " GetAudienceScheduleFromSpaceAndAudienceAlphaOutput is not" - + " found in the empty JSON string", - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `GetAudienceScheduleFromSpaceAndAudienceAlphaOutput`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `audienceSchedule` - AudienceSchedule.validateJsonElement(jsonObj.get("audienceSchedule")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'GetAudienceScheduleFromSpaceAndAudienceAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - GetAudienceScheduleFromSpaceAndAudienceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput given an JSON string - * - * @param jsonString JSON string - * @return An instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * GetAudienceScheduleFromSpaceAndAudienceAlphaOutput - */ - public static GetAudienceScheduleFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class); - } - - /** - * Convert an instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java deleted file mode 100644 index f041ef14..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** ListAudienceSchedulesFromSpaceAndAudience200Response */ -public class ListAudienceSchedulesFromSpaceAndAudience200Response { - public static final String SERIALIZED_NAME_DATA = "data"; - - @SerializedName(SERIALIZED_NAME_DATA) - private ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data; - - public ListAudienceSchedulesFromSpaceAndAudience200Response() {} - - public ListAudienceSchedulesFromSpaceAndAudience200Response data( - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data) { - - this.data = data; - return this; - } - - /** - * Get data - * - * @return data - */ - @javax.annotation.Nullable - public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput getData() { - return data; - } - - public void setData(ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data) { - this.data = data; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudienceSchedulesFromSpaceAndAudience200Response - listAudienceSchedulesFromSpaceAndAudience200Response = - (ListAudienceSchedulesFromSpaceAndAudience200Response) o; - return Objects.equals(this.data, listAudienceSchedulesFromSpaceAndAudience200Response.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudienceSchedulesFromSpaceAndAudience200Response {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListAudienceSchedulesFromSpaceAndAudience200Response - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListAudienceSchedulesFromSpaceAndAudience200Response.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " ListAudienceSchedulesFromSpaceAndAudience200Response is not" - + " found in the empty JSON string", - ListAudienceSchedulesFromSpaceAndAudience200Response - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAudienceSchedulesFromSpaceAndAudience200Response.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudienceSchedulesFromSpaceAndAudience200Response`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the optional field `data` - if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.validateJsonElement( - jsonObj.get("data")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudienceSchedulesFromSpaceAndAudience200Response.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'ListAudienceSchedulesFromSpaceAndAudience200Response' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - ListAudienceSchedulesFromSpaceAndAudience200Response.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - ListAudienceSchedulesFromSpaceAndAudience200Response value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudienceSchedulesFromSpaceAndAudience200Response read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudienceSchedulesFromSpaceAndAudience200Response given an JSON - * string - * - * @param jsonString JSON string - * @return An instance of ListAudienceSchedulesFromSpaceAndAudience200Response - * @throws IOException if the JSON string is invalid with respect to - * ListAudienceSchedulesFromSpaceAndAudience200Response - */ - public static ListAudienceSchedulesFromSpaceAndAudience200Response fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, ListAudienceSchedulesFromSpaceAndAudience200Response.class); - } - - /** - * Convert an instance of ListAudienceSchedulesFromSpaceAndAudience200Response to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java deleted file mode 100644 index c82c692d..00000000 --- a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Output for list audience schedules. */ -public class ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput { - public static final String SERIALIZED_NAME_AUDIENCE_SCHEDULES = "audienceSchedules"; - - @SerializedName(SERIALIZED_NAME_AUDIENCE_SCHEDULES) - private List audienceSchedules = new ArrayList<>(); - - public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput() {} - - public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput audienceSchedules( - List audienceSchedules) { - - this.audienceSchedules = audienceSchedules; - return this; - } - - public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput addAudienceSchedulesItem( - AudienceSchedule audienceSchedulesItem) { - if (this.audienceSchedules == null) { - this.audienceSchedules = new ArrayList<>(); - } - this.audienceSchedules.add(audienceSchedulesItem); - return this; - } - - /** - * A list of audience schedules. - * - * @return audienceSchedules - */ - @javax.annotation.Nonnull - public List getAudienceSchedules() { - return audienceSchedules; - } - - public void setAudienceSchedules(List audienceSchedules) { - this.audienceSchedules = audienceSchedules; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput - listAudienceSchedulesFromSpaceAndAudienceAlphaOutput = - (ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput) o; - return Objects.equals( - this.audienceSchedules, - listAudienceSchedulesFromSpaceAndAudienceAlphaOutput.audienceSchedules); - } - - @Override - public int hashCode() { - return Objects.hash(audienceSchedules); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput {\n"); - sb.append(" audienceSchedules: ") - .append(toIndentedString(audienceSchedules)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("audienceSchedules"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("audienceSchedules"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput is not" - + " found in the empty JSON string", - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput - .openapiRequiredFields - .toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiFields.contains( - entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput`" - + " properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("audienceSchedules").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `audienceSchedules` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("audienceSchedules").toString())); - } - - JsonArray jsonArrayaudienceSchedules = jsonObj.getAsJsonArray("audienceSchedules"); - // validate the required field `audienceSchedules` (array) - for (int i = 0; i < jsonArrayaudienceSchedules.size(); i++) { - AudienceSchedule.validateJsonElement(jsonArrayaudienceSchedules.get(i)); - } - ; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, - TypeToken.get( - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, - ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput read( - JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput given an JSON - * string - * - * @param jsonString JSON string - * @return An instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput - * @throws IOException if the JSON string is invalid with respect to - * ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput - */ - public static ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) - throws IOException { - return JSON.getGson() - .fromJson(jsonString, ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class); - } - - /** - * Convert an instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java b/src/main/java/com/segment/publicapi/models/Preview.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java rename to src/main/java/com/segment/publicapi/models/Preview.java index ce5cbfb0..a1b63f84 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java +++ b/src/main/java/com/segment/publicapi/models/Preview.java @@ -27,23 +27,23 @@ import java.util.Objects; import java.util.Set; -/** Result membership object for an audience preview. */ -public class AudiencePreviewResult { +/** Preview */ +public class Preview { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; - public AudiencePreviewResult() {} + public Preview() {} - public AudiencePreviewResult id(String id) { + public Preview id(String id) { this.id = id; return this; } /** - * Segment id or account id. + * Unique identifier for tracking and retrieving results of the preview. * * @return id */ @@ -64,8 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; - return Objects.equals(this.id, audiencePreviewResult.id); + Preview preview = (Preview) o; + return Objects.equals(this.id, preview.id); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewResult {\n"); + sb.append("class Preview {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,34 +110,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult + * @throws IOException if the JSON Element is invalid with respect to Preview */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!AudiencePreviewResult.openapiRequiredFields + if (!Preview.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in AudiencePreviewResult is not found in" - + " the empty JSON string", - AudiencePreviewResult.openapiRequiredFields.toString())); + "The required field(s) %s in Preview is not found in the empty JSON" + + " string", + Preview.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { + if (!Preview.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewResult` properties. JSON: %s", + "The field `%s` in the JSON string is not defined in the `Preview`" + + " properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { + for (String requiredField : Preview.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -159,24 +159,23 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewResult' and its subtypes + if (!Preview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Preview' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Preview.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, AudiencePreviewResult value) - throws IOException { + public void write(JsonWriter out, Preview value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public AudiencePreviewResult read(JsonReader in) throws IOException { + public Preview read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -186,18 +185,18 @@ public AudiencePreviewResult read(JsonReader in) throws IOException { } /** - * Create an instance of AudiencePreviewResult given an JSON string + * Create an instance of Preview given an JSON string * * @param jsonString JSON string - * @return An instance of AudiencePreviewResult - * @throws IOException if the JSON string is invalid with respect to AudiencePreviewResult + * @return An instance of Preview + * @throws IOException if the JSON string is invalid with respect to Preview */ - public static AudiencePreviewResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewResult.class); + public static Preview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Preview.class); } /** - * Convert an instance of AudiencePreviewResult to an JSON string + * Convert an instance of Preview to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java similarity index 69% rename from src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java rename to src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java index e5b85f5b..da007f6e 100644 --- a/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java +++ b/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** GetAudiencePreview200Response */ -public class GetAudiencePreview200Response { +/** PreviewAudience200Response */ +public class PreviewAudience200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private GetAudiencePreviewAlphaOutput data; + private PreviewAudienceOutput data; - public GetAudiencePreview200Response() {} + public PreviewAudience200Response() {} - public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { + public PreviewAudience200Response data(PreviewAudienceOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { * @return data */ @javax.annotation.Nullable - public GetAudiencePreviewAlphaOutput getData() { + public PreviewAudienceOutput getData() { return data; } - public void setData(GetAudiencePreviewAlphaOutput data) { + public void setData(PreviewAudienceOutput data) { this.data = data; } @@ -64,9 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - GetAudiencePreview200Response getAudiencePreview200Response = - (GetAudiencePreview200Response) o; - return Objects.equals(this.data, getAudiencePreview200Response.data); + PreviewAudience200Response previewAudience200Response = (PreviewAudience200Response) o; + return Objects.equals(this.data, previewAudience200Response.data); } @Override @@ -77,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class GetAudiencePreview200Response {\n"); + sb.append("class PreviewAudience200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,36 +109,35 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * GetAudiencePreview200Response + * @throws IOException if the JSON Element is invalid with respect to PreviewAudience200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!GetAudiencePreview200Response.openapiRequiredFields + if (!PreviewAudience200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in GetAudiencePreview200Response is not" + "The required field(s) %s in PreviewAudience200Response is not" + " found in the empty JSON string", - GetAudiencePreview200Response.openapiRequiredFields.toString())); + PreviewAudience200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!GetAudiencePreview200Response.openapiFields.contains(entry.getKey())) { + if (!PreviewAudience200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `GetAudiencePreview200Response` properties. JSON: %s", + + " `PreviewAudience200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - GetAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); + PreviewAudienceOutput.validateJsonElement(jsonObj.get("data")); } } @@ -147,27 +145,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!GetAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GetAudiencePreview200Response' and its + if (!PreviewAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudience200Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(GetAudiencePreview200Response.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudience200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, GetAudiencePreview200Response value) + public void write(JsonWriter out, PreviewAudience200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public GetAudiencePreview200Response read(JsonReader in) - throws IOException { + public PreviewAudience200Response read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -177,19 +173,18 @@ public GetAudiencePreview200Response read(JsonReader in) } /** - * Create an instance of GetAudiencePreview200Response given an JSON string + * Create an instance of PreviewAudience200Response given an JSON string * * @param jsonString JSON string - * @return An instance of GetAudiencePreview200Response - * @throws IOException if the JSON string is invalid with respect to - * GetAudiencePreview200Response + * @return An instance of PreviewAudience200Response + * @throws IOException if the JSON string is invalid with respect to PreviewAudience200Response */ - public static GetAudiencePreview200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, GetAudiencePreview200Response.class); + public static PreviewAudience200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudience200Response.class); } /** - * Convert an instance of GetAudiencePreview200Response to an JSON string + * Convert an instance of PreviewAudience200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java rename to src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java index 4a1aeaa2..b38d1ddf 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java @@ -28,8 +28,8 @@ import java.util.Objects; import java.util.Set; -/** Input to create an audience preview. */ -public class CreateAudiencePreviewAlphaInput { +/** Input to preview an audience. */ +public class PreviewAudienceInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) @@ -89,11 +89,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private CreateAudiencePreviewOptions options; + private AudienceOptionsWithLookback options; - public CreateAudiencePreviewAlphaInput() {} + public PreviewAudienceInput() {} - public CreateAudiencePreviewAlphaInput definition(AudienceDefinitionWithoutType definition) { + public PreviewAudienceInput definition(AudienceDefinitionWithoutType definition) { this.definition = definition; return this; @@ -113,7 +113,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceType) { + public PreviewAudienceInput audienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; return this; @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions options) { + public PreviewAudienceInput options(AudienceOptionsWithLookback options) { this.options = options; return this; @@ -145,11 +145,11 @@ public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions opti * @return options */ @javax.annotation.Nullable - public CreateAudiencePreviewOptions getOptions() { + public AudienceOptionsWithLookback getOptions() { return options; } - public void setOptions(CreateAudiencePreviewOptions options) { + public void setOptions(AudienceOptionsWithLookback options) { this.options = options; } @@ -161,11 +161,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = - (CreateAudiencePreviewAlphaInput) o; - return Objects.equals(this.definition, createAudiencePreviewAlphaInput.definition) - && Objects.equals(this.audienceType, createAudiencePreviewAlphaInput.audienceType) - && Objects.equals(this.options, createAudiencePreviewAlphaInput.options); + PreviewAudienceInput previewAudienceInput = (PreviewAudienceInput) o; + return Objects.equals(this.definition, previewAudienceInput.definition) + && Objects.equals(this.audienceType, previewAudienceInput.audienceType) + && Objects.equals(this.options, previewAudienceInput.options); } @Override @@ -176,7 +175,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateAudiencePreviewAlphaInput {\n"); + sb.append("class PreviewAudienceInput {\n"); sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); @@ -215,35 +214,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * CreateAudiencePreviewAlphaInput + * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CreateAudiencePreviewAlphaInput.openapiRequiredFields + if (!PreviewAudienceInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CreateAudiencePreviewAlphaInput is not" - + " found in the empty JSON string", - CreateAudiencePreviewAlphaInput.openapiRequiredFields.toString())); + "The required field(s) %s in PreviewAudienceInput is not found in" + + " the empty JSON string", + PreviewAudienceInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!CreateAudiencePreviewAlphaInput.openapiFields.contains(entry.getKey())) { + if (!PreviewAudienceInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `CreateAudiencePreviewAlphaInput` properties. JSON: %s", + + " `PreviewAudienceInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CreateAudiencePreviewAlphaInput.openapiRequiredFields) { + for (String requiredField : PreviewAudienceInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -263,7 +261,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - CreateAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); } } @@ -271,27 +269,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CreateAudiencePreviewAlphaInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CreateAudiencePreviewAlphaInput' and its - // subtypes + if (!PreviewAudienceInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudienceInput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(CreateAudiencePreviewAlphaInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CreateAudiencePreviewAlphaInput value) + public void write(JsonWriter out, PreviewAudienceInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CreateAudiencePreviewAlphaInput read(JsonReader in) - throws IOException { + public PreviewAudienceInput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -301,19 +296,18 @@ public CreateAudiencePreviewAlphaInput read(JsonReader in) } /** - * Create an instance of CreateAudiencePreviewAlphaInput given an JSON string + * Create an instance of PreviewAudienceInput given an JSON string * * @param jsonString JSON string - * @return An instance of CreateAudiencePreviewAlphaInput - * @throws IOException if the JSON string is invalid with respect to - * CreateAudiencePreviewAlphaInput + * @return An instance of PreviewAudienceInput + * @throws IOException if the JSON string is invalid with respect to PreviewAudienceInput */ - public static CreateAudiencePreviewAlphaInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaInput.class); + public static PreviewAudienceInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudienceInput.class); } /** - * Convert an instance of CreateAudiencePreviewAlphaInput to an JSON string + * Convert an instance of PreviewAudienceInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java b/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java similarity index 65% rename from src/main/java/com/segment/publicapi/models/PeriodicConfig.java rename to src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java index 2e0d2a0e..fefc0eb9 100644 --- a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java +++ b/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java @@ -27,34 +27,33 @@ import java.util.Objects; import java.util.Set; -/** Configures a periodic schedule interval. */ -public class PeriodicConfig { - public static final String SERIALIZED_NAME_INTERVAL = "interval"; +/** PreviewAudienceOutput */ +public class PreviewAudienceOutput { + public static final String SERIALIZED_NAME_PREVIEW = "preview"; - @SerializedName(SERIALIZED_NAME_INTERVAL) - private String interval; + @SerializedName(SERIALIZED_NAME_PREVIEW) + private Preview preview; - public PeriodicConfig() {} + public PreviewAudienceOutput() {} - public PeriodicConfig interval(String interval) { + public PreviewAudienceOutput preview(Preview preview) { - this.interval = interval; + this.preview = preview; return this; } /** - * Go duration format string, only supporting units \"h\" (hours) and \"m\" - * (minutes). + * Get preview * - * @return interval + * @return preview */ @javax.annotation.Nonnull - public String getInterval() { - return interval; + public Preview getPreview() { + return preview; } - public void setInterval(String interval) { - this.interval = interval; + public void setPreview(Preview preview) { + this.preview = preview; } @Override @@ -65,20 +64,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PeriodicConfig periodicConfig = (PeriodicConfig) o; - return Objects.equals(this.interval, periodicConfig.interval); + PreviewAudienceOutput previewAudienceOutput = (PreviewAudienceOutput) o; + return Objects.equals(this.preview, previewAudienceOutput.preview); } @Override public int hashCode() { - return Objects.hash(interval); + return Objects.hash(preview); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PeriodicConfig {\n"); - sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("class PreviewAudienceOutput {\n"); + sb.append(" preview: ").append(toIndentedString(preview)).append("\n"); sb.append("}"); return sb.toString(); } @@ -100,45 +99,45 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("interval"); + openapiFields.add("preview"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("interval"); + openapiRequiredFields.add("preview"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PeriodicConfig + * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceOutput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PeriodicConfig.openapiRequiredFields + if (!PreviewAudienceOutput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PeriodicConfig is not found in the" - + " empty JSON string", - PeriodicConfig.openapiRequiredFields.toString())); + "The required field(s) %s in PreviewAudienceOutput is not found in" + + " the empty JSON string", + PreviewAudienceOutput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PeriodicConfig.openapiFields.contains(entry.getKey())) { + if (!PreviewAudienceOutput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PeriodicConfig` properties. JSON: %s", + + " `PreviewAudienceOutput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PeriodicConfig.openapiRequiredFields) { + for (String requiredField : PreviewAudienceOutput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -147,36 +146,32 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("interval").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `interval` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("interval").toString())); - } + // validate the required field `preview` + Preview.validateJsonElement(jsonObj.get("preview")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PeriodicConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PeriodicConfig' and its subtypes + if (!PreviewAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PreviewAudienceOutput' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceOutput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PeriodicConfig value) throws IOException { + public void write(JsonWriter out, PreviewAudienceOutput value) + throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PeriodicConfig read(JsonReader in) throws IOException { + public PreviewAudienceOutput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -186,18 +181,18 @@ public PeriodicConfig read(JsonReader in) throws IOException { } /** - * Create an instance of PeriodicConfig given an JSON string + * Create an instance of PreviewAudienceOutput given an JSON string * * @param jsonString JSON string - * @return An instance of PeriodicConfig - * @throws IOException if the JSON string is invalid with respect to PeriodicConfig + * @return An instance of PreviewAudienceOutput + * @throws IOException if the JSON string is invalid with respect to PreviewAudienceOutput */ - public static PeriodicConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PeriodicConfig.class); + public static PreviewAudienceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PreviewAudienceOutput.class); } /** - * Convert an instance of PeriodicConfig to an JSON string + * Convert an instance of PreviewAudienceOutput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java deleted file mode 100644 index 3acc03b6..00000000 --- a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Options which should be applied when segmenting audience previews. */ -public class ReadAudiencePreviewOptions { - public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; - - @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) - private List filterByExternalIds = new ArrayList<>(); - - public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; - - @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) - private Boolean includeHistoricalData; - - public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; - - @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) - private BigDecimal backfillEventDataDays; - - public ReadAudiencePreviewOptions() {} - - public ReadAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { - - this.filterByExternalIds = filterByExternalIds; - return this; - } - - public ReadAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { - if (this.filterByExternalIds == null) { - this.filterByExternalIds = new ArrayList<>(); - } - this.filterByExternalIds.add(filterByExternalIdsItem); - return this; - } - - /** - * The set of profile external identifiers being used to determine audience preview membership. - * Profiles will only be considered for audience preview membership if the profile has at least - * one external id whose key matches a value in this set. - * - * @return filterByExternalIds - */ - @javax.annotation.Nonnull - public List getFilterByExternalIds() { - return filterByExternalIds; - } - - public void setFilterByExternalIds(List filterByExternalIds) { - this.filterByExternalIds = filterByExternalIds; - } - - public ReadAudiencePreviewOptions includeHistoricalData(Boolean includeHistoricalData) { - - this.includeHistoricalData = includeHistoricalData; - return this; - } - - /** - * Determines whether data prior to the audience preview being created is included when - * determining audience preview membership. Note that including historical data may be needed in - * order to properly handle the definition specified. In these cases, Segment will automatically - * handle including historical data and the response will return the includeHistoricalData - * parameter as true. - * - * @return includeHistoricalData - */ - @javax.annotation.Nonnull - public Boolean getIncludeHistoricalData() { - return includeHistoricalData; - } - - public void setIncludeHistoricalData(Boolean includeHistoricalData) { - this.includeHistoricalData = includeHistoricalData; - } - - public ReadAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { - - this.backfillEventDataDays = backfillEventDataDays; - return this; - } - - /** - * If specified, the value of this field indicates the number of days (specified from the date - * the audience preview was created) that event data will be included from when determining - * audience preview membership. If unspecified, defer to the value of - * `includeHistoricalData` to determine whether historical data is either entirely - * included or entirely excluded when determining audience preview membership. - * - * @return backfillEventDataDays - */ - @javax.annotation.Nullable - public BigDecimal getBackfillEventDataDays() { - return backfillEventDataDays; - } - - public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { - this.backfillEventDataDays = backfillEventDataDays; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadAudiencePreviewOptions readAudiencePreviewOptions = (ReadAudiencePreviewOptions) o; - return Objects.equals( - this.filterByExternalIds, readAudiencePreviewOptions.filterByExternalIds) - && Objects.equals( - this.includeHistoricalData, - readAudiencePreviewOptions.includeHistoricalData) - && Objects.equals( - this.backfillEventDataDays, - readAudiencePreviewOptions.backfillEventDataDays); - } - - @Override - public int hashCode() { - return Objects.hash(filterByExternalIds, includeHistoricalData, backfillEventDataDays); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadAudiencePreviewOptions {\n"); - sb.append(" filterByExternalIds: ") - .append(toIndentedString(filterByExternalIds)) - .append("\n"); - sb.append(" includeHistoricalData: ") - .append(toIndentedString(includeHistoricalData)) - .append("\n"); - sb.append(" backfillEventDataDays: ") - .append(toIndentedString(backfillEventDataDays)) - .append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("filterByExternalIds"); - openapiFields.add("includeHistoricalData"); - openapiFields.add("backfillEventDataDays"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("filterByExternalIds"); - openapiRequiredFields.add("includeHistoricalData"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ReadAudiencePreviewOptions - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ReadAudiencePreviewOptions.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in ReadAudiencePreviewOptions is not" - + " found in the empty JSON string", - ReadAudiencePreviewOptions.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ReadAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `ReadAudiencePreviewOptions` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ReadAudiencePreviewOptions.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("filterByExternalIds") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `filterByExternalIds` to be an array in the JSON" - + " string but got `%s`", - jsonObj.get("filterByExternalIds").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ReadAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ReadAudiencePreviewOptions' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(ReadAudiencePreviewOptions.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, ReadAudiencePreviewOptions value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ReadAudiencePreviewOptions read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of ReadAudiencePreviewOptions given an JSON string - * - * @param jsonString JSON string - * @return An instance of ReadAudiencePreviewOptions - * @throws IOException if the JSON string is invalid with respect to ReadAudiencePreviewOptions - */ - public static ReadAudiencePreviewOptions fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ReadAudiencePreviewOptions.class); - } - - /** - * Convert an instance of ReadAudiencePreviewOptions to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java index f8705f0e..9b466492 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -95,7 +95,7 @@ public StrategyEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) - private Config1 config; + private Config config; public ReverseEtlScheduleDefinition() {} @@ -119,7 +119,7 @@ public void setStrategy(StrategyEnum strategy) { this.strategy = strategy; } - public ReverseEtlScheduleDefinition config(Config1 config) { + public ReverseEtlScheduleDefinition config(Config config) { this.config = config; return this; @@ -131,11 +131,11 @@ public ReverseEtlScheduleDefinition config(Config1 config) { * @return config */ @javax.annotation.Nullable - public Config1 getConfig() { + public Config getConfig() { return config; } - public void setConfig(Config1 config) { + public void setConfig(Config config) { this.config = config; } @@ -259,7 +259,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `config` if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - Config1.validateJsonElement(jsonObj.get("config")); + Config.validateJsonElement(jsonObj.get("config")); } } diff --git a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java deleted file mode 100644 index c7584e91..00000000 --- a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Configures a schedule for specific days and times. */ -public class SpecificDaysConfig { - public static final String SERIALIZED_NAME_DAYS = "days"; - - @SerializedName(SERIALIZED_NAME_DAYS) - private List days = new ArrayList<>(); - - public static final String SERIALIZED_NAME_HOURS = "hours"; - - @SerializedName(SERIALIZED_NAME_HOURS) - private List hours = new ArrayList<>(); - - public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; - - @SerializedName(SERIALIZED_NAME_TIMEZONE) - private String timezone; - - public SpecificDaysConfig() {} - - public SpecificDaysConfig days(List days) { - - this.days = days; - return this; - } - - public SpecificDaysConfig addDaysItem(BigDecimal daysItem) { - if (this.days == null) { - this.days = new ArrayList<>(); - } - this.days.add(daysItem); - return this; - } - - /** - * Days of week for schedule (0=Saturday, 6=Sunday). - * - * @return days - */ - @javax.annotation.Nonnull - public List getDays() { - return days; - } - - public void setDays(List days) { - this.days = days; - } - - public SpecificDaysConfig hours(List hours) { - - this.hours = hours; - return this; - } - - public SpecificDaysConfig addHoursItem(BigDecimal hoursItem) { - if (this.hours == null) { - this.hours = new ArrayList<>(); - } - this.hours.add(hoursItem); - return this; - } - - /** - * Hours of day for schedule (0-23). - * - * @return hours - */ - @javax.annotation.Nonnull - public List getHours() { - return hours; - } - - public void setHours(List hours) { - this.hours = hours; - } - - public SpecificDaysConfig timezone(String timezone) { - - this.timezone = timezone; - return this; - } - - /** - * TZ database time zone identifier; for example, America/New_York. - * - * @return timezone - */ - @javax.annotation.Nonnull - public String getTimezone() { - return timezone; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecificDaysConfig specificDaysConfig = (SpecificDaysConfig) o; - return Objects.equals(this.days, specificDaysConfig.days) - && Objects.equals(this.hours, specificDaysConfig.hours) - && Objects.equals(this.timezone, specificDaysConfig.timezone); - } - - @Override - public int hashCode() { - return Objects.hash(days, hours, timezone); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecificDaysConfig {\n"); - sb.append(" days: ").append(toIndentedString(days)).append("\n"); - sb.append(" hours: ").append(toIndentedString(hours)).append("\n"); - sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("days"); - openapiFields.add("hours"); - openapiFields.add("timezone"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("days"); - openapiRequiredFields.add("hours"); - openapiRequiredFields.add("timezone"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SpecificDaysConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SpecificDaysConfig.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in SpecificDaysConfig is not found in the" - + " empty JSON string", - SpecificDaysConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SpecificDaysConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `SpecificDaysConfig` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SpecificDaysConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("days") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("days").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `days` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("days").toString())); - } - // ensure the required json array is present - if (jsonObj.get("hours") == null) { - throw new IllegalArgumentException( - "Expected the field `linkedContent` to be an array in the JSON string but got" - + " `null`"); - } else if (!jsonObj.get("hours").isJsonArray()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `hours` to be an array in the JSON string but got" - + " `%s`", - jsonObj.get("hours").toString())); - } - if (!jsonObj.get("timezone").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `timezone` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("timezone").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SpecificDaysConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SpecificDaysConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(SpecificDaysConfig.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, SpecificDaysConfig value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SpecificDaysConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of SpecificDaysConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of SpecificDaysConfig - * @throws IOException if the JSON string is invalid with respect to SpecificDaysConfig - */ - public static SpecificDaysConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SpecificDaysConfig.class); - } - - /** - * Convert an instance of SpecificDaysConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} From 54732357c350b1bf48f9a5e87e0ccfa1c729bcce Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 1 Jul 2025 08:07:28 +0000 Subject: [PATCH 451/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e38435e4. --- README.md | 8 +- docs/AudiencesApi.md | 148 +++- docs/CustomerInsightsApi.md | 2 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 39 +- .../segment/publicapi/api/AudiencesApi.java | 630 ++++++++++++------ .../publicapi/api/CustomerInsightsApi.java | 10 +- .../publicapi/models/AudiencePreview.java | 565 ++++++++++++++++ ...ut.java => AudiencePreviewIdentifier.java} | 94 +-- ...review.java => AudiencePreviewResult.java} | 61 +- .../publicapi/models/AudienceSize.java | 284 ++++++++ .../CreateAudiencePreview200Response.java | 199 ++++++ ...a => CreateAudiencePreviewAlphaInput.java} | 78 ++- .../CreateAudiencePreviewAlphaOutput.java | 210 ++++++ .../models/CreateAudiencePreviewOptions.java | 259 +++++++ ...ava => GetAudiencePreview200Response.java} | 65 +- .../models/GetAudiencePreviewAlphaOutput.java | 208 ++++++ .../models/ReadAudiencePreviewOptions.java | 302 +++++++++ 20 files changed, 2754 insertions(+), 414 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreview.java rename src/main/java/com/segment/publicapi/models/{PreviewAudienceOutput.java => AudiencePreviewIdentifier.java} (64%) rename src/main/java/com/segment/publicapi/models/{Preview.java => AudiencePreviewResult.java} (75%) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSize.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java rename src/main/java/com/segment/publicapi/models/{PreviewAudienceInput.java => CreateAudiencePreviewAlphaInput.java} (75%) create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java rename src/main/java/com/segment/publicapi/models/{PreviewAudience200Response.java => GetAudiencePreview200Response.java} (69%) create mode 100644 src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java diff --git a/README.md b/README.md index 9af6d601..87d966f8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.6.0 +Latest API and SDK version: 58.7.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.6.0 + 58.7.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.6.0" + implementation "com.segment.publicapi:segment-publicapi:58.7.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.6.0.jar` +* `target/segment-publicapi-58.7.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 067854e8..a92dbbbc 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -5,10 +5,11 @@ All URIs are relative to *https://api.segmentapis.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createAudience**](AudiencesApi.md#createAudience) | **POST** /spaces/{spaceId}/audiences | Create Audience | +| [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | +| [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | -| [**previewAudience**](AudiencesApi.md#previewAudience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -89,6 +90,81 @@ public class Example { | **429** | Too many requests | - | +## Operation: createAudiencePreview + +> CreateAudiencePreview200Response createAudiencePreview(spaceId, createAudiencePreviewAlphaInput) + +Create Audience Preview + +Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = new CreateAudiencePreviewAlphaInput(); // CreateAudiencePreviewAlphaInput | + try { + CreateAudiencePreview200Response result = apiInstance.createAudiencePreview(spaceId, createAudiencePreviewAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#createAudiencePreview"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **createAudiencePreviewAlphaInput** | [**CreateAudiencePreviewAlphaInput**](CreateAudiencePreviewAlphaInput.md)| | | + +### Return type + +[**CreateAudiencePreview200Response**](CreateAudiencePreview200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: getAudience > GetAudience200Response getAudience(spaceId, id) @@ -164,13 +240,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudienceConsumersFromSpaceAndAudience +## Operation: getAudiencePreview -> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) +> GetAudiencePreview200Response getAudiencePreview(spaceId, id) -List Audience Consumers from Space And Audience +Get Audience Preview -Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Reads the results of an audience preview. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -193,15 +269,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | - PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. - ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. + String id = "2yKFfGeS62yzGxQSAieVOvsPOha-compute_preview_execution-dws3UdTNsppL5dRGsagFpP-compute_preview_execution"; // String | try { - ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); + GetAudiencePreview200Response result = apiInstance.getAudiencePreview(spaceId, id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); + System.err.println("Exception when calling AudiencesApi#getAudiencePreview"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -218,13 +291,10 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | -| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type -[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) +[**GetAudiencePreview200Response**](GetAudiencePreview200Response.md) ### Authorization @@ -245,13 +315,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: listAudiences +## Operation: listAudienceConsumersFromSpaceAndAudience -> ListAudiences200Response listAudiences(spaceId, pagination) +> ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) -List Audiences +List Audience Consumers from Space And Audience -Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the list of consumers for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -274,12 +344,15 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. + ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); + ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#listAudiences"); + System.err.println("Exception when calling AudiencesApi#listAudienceConsumersFromSpaceAndAudience"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -295,11 +368,14 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **id** | **String**| | | +| **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | +| **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type -[**ListAudiences200Response**](ListAudiences200Response.md) +[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md) ### Authorization @@ -308,7 +384,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json +- **Accept**: application/vnd.segment.v1alpha+json, application/json ### HTTP response details @@ -320,13 +396,13 @@ public class Example { | **429** | Too many requests | - | -## Operation: previewAudience +## Operation: listAudiences -> PreviewAudience200Response previewAudience(spaceId, previewAudienceInput) +> ListAudiences200Response listAudiences(spaceId, pagination) -Preview Audience +List Audiences -Previews Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 requests per month per spaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -349,12 +425,12 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - PreviewAudienceInput previewAudienceInput = new PreviewAudienceInput(); // PreviewAudienceInput | + ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. try { - PreviewAudience200Response result = apiInstance.previewAudience(spaceId, previewAudienceInput); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AudiencesApi#previewAudience"); + System.err.println("Exception when calling AudiencesApi#listAudiences"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -370,11 +446,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | -| **previewAudienceInput** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| | | +| **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | ### Return type -[**PreviewAudience200Response**](PreviewAudience200Response.md) +[**ListAudiences200Response**](ListAudiences200Response.md) ### Authorization @@ -382,8 +458,8 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/vnd.segment.v1alpha+json -- **Accept**: application/vnd.segment.v1alpha+json, application/json +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json ### HTTP response details diff --git a/docs/CustomerInsightsApi.md b/docs/CustomerInsightsApi.md index cd15128a..891b717e 100644 --- a/docs/CustomerInsightsApi.md +++ b/docs/CustomerInsightsApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Download -Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Create Customer Insights Presigned URLsThe rate limit for this endpoint is 120 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/pom.xml b/pom.xml index 15cc847b..6a340ede 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.6.0 + 58.7.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 7737bb6e..d731c05a 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.6.0 (Java)"); + setUserAgent("Public API SDK 58.7.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 799812c9..f95a82b6 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.6.0"; + public static final String VERSION = "58.7.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 9a4de509..790f8acb 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -175,6 +175,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceOptionsWithLookback .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewIdentifier + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSize.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSummary.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -222,6 +231,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateAudienceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreview200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.CreateAudiencePreviewOptions + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.CreateCloudSourceRegulation200Response .CustomTypeAdapterFactory()); @@ -655,6 +676,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.GetAudienceAlphaOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudienceBetaOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudiencePreview200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudiencePreviewAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); @@ -1207,15 +1234,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PermissionResourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionV1.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.Preview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudience200Response - .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudienceInput.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.PreviewAudienceOutput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PreviewDestinationFilter200Response .CustomTypeAdapterFactory()); @@ -1240,6 +1258,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PropertyValueTransformationV1 .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ReadAudiencePreviewOptions + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 567267b3..163904c5 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -20,15 +20,16 @@ import com.segment.publicapi.Pair; import com.segment.publicapi.models.CreateAudience200Response; import com.segment.publicapi.models.CreateAudienceAlphaInput; +import com.segment.publicapi.models.CreateAudiencePreview200Response; +import com.segment.publicapi.models.CreateAudiencePreviewAlphaInput; import com.segment.publicapi.models.GetAudience200Response; +import com.segment.publicapi.models.GetAudiencePreview200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; -import com.segment.publicapi.models.PreviewAudience200Response; -import com.segment.publicapi.models.PreviewAudienceInput; import com.segment.publicapi.models.RemoveAudienceFromSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpace200Response; import com.segment.publicapi.models.UpdateAudienceForSpaceAlphaInput; @@ -284,6 +285,223 @@ public okhttp3.Call createAudienceAsync( return localVarCall; } + /** + * Build call for createAudiencePreview + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createAudiencePreviewCall( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = createAudiencePreviewAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAudiencePreviewValidateBeforeCall( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " createAudiencePreview(Async)"); + } + + // verify the required parameter 'createAudiencePreviewAlphaInput' is set + if (createAudiencePreviewAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'createAudiencePreviewAlphaInput' when calling" + + " createAudiencePreview(Async)"); + } + + return createAudiencePreviewCall(spaceId, createAudiencePreviewAlphaInput, _callback); + } + + /** + * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @return CreateAudiencePreview200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public CreateAudiencePreview200Response createAudiencePreview( + String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) + throws ApiException { + ApiResponse localVarResp = + createAudiencePreviewWithHttpInfo(spaceId, createAudiencePreviewAlphaInput); + return localVarResp.getData(); + } + + /** + * Create Audience Preview Previews Audience. • This endpoint is in **Alpha** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. • When called, this + * endpoint may generate the `Audience Preview Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. This endpoint also has a rate limit of 700 + * requests per month per spaceId, which is lower than the default due to access pattern + * restrictions. + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @return ApiResponse<CreateAudiencePreview200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse createAudiencePreviewWithHttpInfo( + String spaceId, CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + createAudiencePreviewValidateBeforeCall( + spaceId, createAudiencePreviewAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Audience Preview (asynchronously) Previews Audience. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Audience Preview Created` event in the + * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, + * which is lower than the default due to access pattern restrictions. Once reached, this + * endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. This endpoint also + * has a rate limit of 700 requests per month per spaceId, which is lower than the default due + * to access pattern restrictions. + * + * @param spaceId (required) + * @param createAudiencePreviewAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call createAudiencePreviewAsync( + String spaceId, + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + createAudiencePreviewValidateBeforeCall( + spaceId, createAudiencePreviewAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for getAudience * @@ -477,6 +695,200 @@ public okhttp3.Call getAudienceAsync( return localVarCall; } + /** + * Build call for getAudiencePreview + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudiencePreviewCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/previews/{id}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudiencePreviewValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getAudiencePreview(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling getAudiencePreview(Async)"); + } + + return getAudiencePreviewCall(spaceId, id, _callback); + } + + /** + * Get Audience Preview Reads the results of an audience preview. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return GetAudiencePreview200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudiencePreview200Response getAudiencePreview(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + getAudiencePreviewWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * Get Audience Preview Reads the results of an audience preview. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. The rate limit for this endpoint is 100 requests per minute, which is lower than + * the default due to access pattern restrictions. Once reached, this endpoint will respond with + * the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<GetAudiencePreview200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getAudiencePreviewWithHttpInfo( + String spaceId, String id) throws ApiException { + okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience Preview (asynchronously) Reads the results of an audience preview. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. The rate limit for this endpoint is 100 requests per minute, which is + * lower than the default due to access pattern restrictions. Once reached, this endpoint will + * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudiencePreviewAsync( + String spaceId, String id, final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = getAudiencePreviewValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudienceConsumersFromSpaceAndAudience * @@ -946,220 +1358,6 @@ public okhttp3.Call listAudiencesAsync( return localVarCall; } - /** - * Build call for previewAudience - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call previewAudienceCall( - String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = previewAudienceInput; - - // create path and map variables - String localVarPath = - "/spaces/{spaceId}/audiences/previews" - .replace( - "{" + "spaceId" + "}", - localVarApiClient.escapeString(spaceId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/vnd.segment.v1alpha+json", "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] {"token"}; - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames, - _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call previewAudienceValidateBeforeCall( - String spaceId, PreviewAudienceInput previewAudienceInput, final ApiCallback _callback) - throws ApiException { - // verify the required parameter 'spaceId' is set - if (spaceId == null) { - throw new ApiException( - "Missing the required parameter 'spaceId' when calling previewAudience(Async)"); - } - - // verify the required parameter 'previewAudienceInput' is set - if (previewAudienceInput == null) { - throw new ApiException( - "Missing the required parameter 'previewAudienceInput' when calling" - + " previewAudience(Async)"); - } - - return previewAudienceCall(spaceId, previewAudienceInput, _callback); - } - - /** - * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit - * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. • When called, this endpoint may - * generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @return PreviewAudience200Response - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public PreviewAudience200Response previewAudience( - String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { - ApiResponse localVarResp = - previewAudienceWithHttpInfo(spaceId, previewAudienceInput); - return localVarResp.getData(); - } - - /** - * Preview Audience Previews Audience. • This endpoint is in **Alpha** testing. Please submit - * any feedback by sending an email to friends@segment.com. • In order to successfully call this - * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach - * out to your customer success manager for more information. • When called, this endpoint may - * generate the `Audience Preview Created` event in the [audit - * trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. The rate limit for this endpoint is 700 - * requests per month per spaceId, which is lower than the default due to access pattern - * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with - * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more - * information. - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @return ApiResponse<PreviewAudience200Response> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public ApiResponse previewAudienceWithHttpInfo( - String spaceId, PreviewAudienceInput previewAudienceInput) throws ApiException { - okhttp3.Call localVarCall = - previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, null); - Type localVarReturnType = new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Preview Audience (asynchronously) Previews Audience. • This endpoint is in **Alpha** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. • When - * called, this endpoint may generate the `Audience Preview Created` event in the - * [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 5 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. The rate limit for - * this endpoint is 700 requests per month per spaceId, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. - * - * @param spaceId (required) - * @param previewAudienceInput (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body - * object - * @http.response.details - * - * - * - * - * - * - *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
- */ - public okhttp3.Call previewAudienceAsync( - String spaceId, - PreviewAudienceInput previewAudienceInput, - final ApiCallback _callback) - throws ApiException { - - okhttp3.Call localVarCall = - previewAudienceValidateBeforeCall(spaceId, previewAudienceInput, _callback); - Type localVarReturnType = new TypeToken() {}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** * Build call for removeAudienceFromSpace * diff --git a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java index bcacff81..c1a0a7a5 100644 --- a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java +++ b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java @@ -151,8 +151,8 @@ private okhttp3.Call createDownloadValidateBeforeCall( } /** - * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 - * requests per day per workspaceId, which is lower than the default due to access pattern + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is + * 120 requests per day per workspaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -178,8 +178,8 @@ public CreateDownload200Response createDownload( } /** - * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 - * requests per day per workspaceId, which is lower than the default due to access pattern + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is + * 120 requests per day per workspaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -207,7 +207,7 @@ public ApiResponse createDownloadWithHttpInfo( /** * Create Download (asynchronously) Create Customer Insights Presigned URLsThe rate limit for - * this endpoint is 30 requests per day per workspaceId, which is lower than the default due to + * this endpoint is 120 requests per day per workspaceId, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java new file mode 100644 index 00000000..c6fd3573 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -0,0 +1,565 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** An audience preview. */ +public class AudiencePreview { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** The audience type of the preview. */ + @JsonAdapter(AudienceTypeEnum.Adapter.class) + public enum AudienceTypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + AudienceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AudienceTypeEnum fromValue(String value) { + for (AudienceTypeEnum b : AudienceTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AudienceTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AudienceTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUDIENCE_TYPE = "audienceType"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_TYPE) + private AudienceTypeEnum audienceType; + + public static final String SERIALIZED_NAME_DEFINITION = "definition"; + + @SerializedName(SERIALIZED_NAME_DEFINITION) + private AudienceDefinitionWithoutType definition; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + + @SerializedName(SERIALIZED_NAME_OPTIONS) + private ReadAudiencePreviewOptions options; + + /** Status for the audience preview. */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + COMPLETED("COMPLETED"), + + FAILED("FAILED"), + + RUNNING("RUNNING"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_RESULTS = "results"; + + @SerializedName(SERIALIZED_NAME_RESULTS) + private List results; + + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + + public static final String SERIALIZED_NAME_FAILURE_REASON = "failureReason"; + + @SerializedName(SERIALIZED_NAME_FAILURE_REASON) + private String failureReason; + + public AudiencePreview() {} + + public AudiencePreview id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier for tracking and retrieving results of an audience preview. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreview audienceType(AudienceTypeEnum audienceType) { + + this.audienceType = audienceType; + return this; + } + + /** + * The audience type of the preview. + * + * @return audienceType + */ + @javax.annotation.Nonnull + public AudienceTypeEnum getAudienceType() { + return audienceType; + } + + public void setAudienceType(AudienceTypeEnum audienceType) { + this.audienceType = audienceType; + } + + public AudiencePreview definition(AudienceDefinitionWithoutType definition) { + + this.definition = definition; + return this; + } + + /** + * Get definition + * + * @return definition + */ + @javax.annotation.Nonnull + public AudienceDefinitionWithoutType getDefinition() { + return definition; + } + + public void setDefinition(AudienceDefinitionWithoutType definition) { + this.definition = definition; + } + + public AudiencePreview options(ReadAudiencePreviewOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nonnull + public ReadAudiencePreviewOptions getOptions() { + return options; + } + + public void setOptions(ReadAudiencePreviewOptions options) { + this.options = options; + } + + public AudiencePreview status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status for the audience preview. + * + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public AudiencePreview results(List results) { + + this.results = results; + return this; + } + + public AudiencePreview addResultsItem(AudiencePreviewResult resultsItem) { + if (this.results == null) { + this.results = new ArrayList<>(); + } + this.results.add(resultsItem); + return this; + } + + /** + * Sampled result membership for the audience preview. Only has a value if the status is + * 'COMPLETED'. + * + * @return results + */ + @javax.annotation.Nullable + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public AudiencePreview size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + + public AudiencePreview failureReason(String failureReason) { + + this.failureReason = failureReason; + return this; + } + + /** + * Explanation of why the audience preview failed. Only has a value if status is + * 'FAILED'. + * + * @return failureReason + */ + @javax.annotation.Nullable + public String getFailureReason() { + return failureReason; + } + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreview audiencePreview = (AudiencePreview) o; + return Objects.equals(this.id, audiencePreview.id) + && Objects.equals(this.audienceType, audiencePreview.audienceType) + && Objects.equals(this.definition, audiencePreview.definition) + && Objects.equals(this.options, audiencePreview.options) + && Objects.equals(this.status, audiencePreview.status) + && Objects.equals(this.results, audiencePreview.results) + && Objects.equals(this.size, audiencePreview.size) + && Objects.equals(this.failureReason, audiencePreview.failureReason); + } + + @Override + public int hashCode() { + return Objects.hash( + id, audienceType, definition, options, status, results, size, failureReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreview {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("audienceType"); + openapiFields.add("definition"); + openapiFields.add("options"); + openapiFields.add("status"); + openapiFields.add("results"); + openapiFields.add("size"); + openapiFields.add("failureReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("audienceType"); + openapiRequiredFields.add("definition"); + openapiRequiredFields.add("options"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudiencePreview + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreview.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreview is not found in the" + + " empty JSON string", + AudiencePreview.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreview.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreview` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreview.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("audienceType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("audienceType").toString())); + } + // validate the required field `definition` + AudienceDefinitionWithoutType.validateJsonElement(jsonObj.get("definition")); + // validate the required field `options` + ReadAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + if (jsonObj.get("results") != null && !jsonObj.get("results").isJsonNull()) { + JsonArray jsonArrayresults = jsonObj.getAsJsonArray("results"); + if (jsonArrayresults != null) { + // ensure the json data is an array + if (!jsonObj.get("results").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `results` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("results").toString())); + } + + // validate the optional field `results` (array) + for (int i = 0; i < jsonArrayresults.size(); i++) { + AudiencePreviewResult.validateJsonElement(jsonArrayresults.get(i)); + } + ; + } + } + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } + if ((jsonObj.get("failureReason") != null && !jsonObj.get("failureReason").isJsonNull()) + && !jsonObj.get("failureReason").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `failureReason` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("failureReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreview.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreview' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreview.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreview value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreview read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreview given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreview + * @throws IOException if the JSON string is invalid with respect to AudiencePreview + */ + public static AudiencePreview fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreview.class); + } + + /** + * Convert an instance of AudiencePreview to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java similarity index 64% rename from src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java rename to src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java index fefc0eb9..5fadb72a 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudienceOutput.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewIdentifier.java @@ -27,33 +27,33 @@ import java.util.Objects; import java.util.Set; -/** PreviewAudienceOutput */ -public class PreviewAudienceOutput { - public static final String SERIALIZED_NAME_PREVIEW = "preview"; +/** Identifier for an audience preview. */ +public class AudiencePreviewIdentifier { + public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_PREVIEW) - private Preview preview; + @SerializedName(SERIALIZED_NAME_ID) + private String id; - public PreviewAudienceOutput() {} + public AudiencePreviewIdentifier() {} - public PreviewAudienceOutput preview(Preview preview) { + public AudiencePreviewIdentifier id(String id) { - this.preview = preview; + this.id = id; return this; } /** - * Get preview + * Unique identifier for tracking and retrieving results of an audience preview. * - * @return preview + * @return id */ @javax.annotation.Nonnull - public Preview getPreview() { - return preview; + public String getId() { + return id; } - public void setPreview(Preview preview) { - this.preview = preview; + public void setId(String id) { + this.id = id; } @Override @@ -64,20 +64,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudienceOutput previewAudienceOutput = (PreviewAudienceOutput) o; - return Objects.equals(this.preview, previewAudienceOutput.preview); + AudiencePreviewIdentifier audiencePreviewIdentifier = (AudiencePreviewIdentifier) o; + return Objects.equals(this.id, audiencePreviewIdentifier.id); } @Override public int hashCode() { - return Objects.hash(preview); + return Objects.hash(id); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudienceOutput {\n"); - sb.append(" preview: ").append(toIndentedString(preview)).append("\n"); + sb.append("class AudiencePreviewIdentifier {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); } @@ -99,45 +99,45 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("preview"); + openapiFields.add("id"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("preview"); + openapiRequiredFields.add("id"); } /** * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceOutput + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewIdentifier */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudienceOutput.openapiRequiredFields + if (!AudiencePreviewIdentifier.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudienceOutput is not found in" - + " the empty JSON string", - PreviewAudienceOutput.openapiRequiredFields.toString())); + "The required field(s) %s in AudiencePreviewIdentifier is not found" + + " in the empty JSON string", + AudiencePreviewIdentifier.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudienceOutput.openapiFields.contains(entry.getKey())) { + if (!AudiencePreviewIdentifier.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudienceOutput` properties. JSON: %s", + + " `AudiencePreviewIdentifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PreviewAudienceOutput.openapiRequiredFields) { + for (String requiredField : AudiencePreviewIdentifier.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -146,32 +146,38 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `preview` - Preview.validateJsonElement(jsonObj.get("preview")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudienceOutput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudienceOutput' and its subtypes + if (!AudiencePreviewIdentifier.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewIdentifier' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceOutput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewIdentifier.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudienceOutput value) + public void write(JsonWriter out, AudiencePreviewIdentifier value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudienceOutput read(JsonReader in) throws IOException { + public AudiencePreviewIdentifier read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -181,18 +187,18 @@ public PreviewAudienceOutput read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudienceOutput given an JSON string + * Create an instance of AudiencePreviewIdentifier given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudienceOutput - * @throws IOException if the JSON string is invalid with respect to PreviewAudienceOutput + * @return An instance of AudiencePreviewIdentifier + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewIdentifier */ - public static PreviewAudienceOutput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudienceOutput.class); + public static AudiencePreviewIdentifier fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewIdentifier.class); } /** - * Convert an instance of PreviewAudienceOutput to an JSON string + * Convert an instance of AudiencePreviewIdentifier to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/Preview.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/Preview.java rename to src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java index a1b63f84..ce5cbfb0 100644 --- a/src/main/java/com/segment/publicapi/models/Preview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java @@ -27,23 +27,23 @@ import java.util.Objects; import java.util.Set; -/** Preview */ -public class Preview { +/** Result membership object for an audience preview. */ +public class AudiencePreviewResult { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; - public Preview() {} + public AudiencePreviewResult() {} - public Preview id(String id) { + public AudiencePreviewResult id(String id) { this.id = id; return this; } /** - * Unique identifier for tracking and retrieving results of the preview. + * Segment id or account id. * * @return id */ @@ -64,8 +64,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Preview preview = (Preview) o; - return Objects.equals(this.id, preview.id); + AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; + return Objects.equals(this.id, audiencePreviewResult.id); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Preview {\n"); + sb.append("class AudiencePreviewResult {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append("}"); return sb.toString(); @@ -110,34 +110,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Preview + * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!Preview.openapiRequiredFields + if (!AudiencePreviewResult.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in Preview is not found in the empty JSON" - + " string", - Preview.openapiRequiredFields.toString())); + "The required field(s) %s in AudiencePreviewResult is not found in" + + " the empty JSON string", + AudiencePreviewResult.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!Preview.openapiFields.contains(entry.getKey())) { + if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( - "The field `%s` in the JSON string is not defined in the `Preview`" - + " properties. JSON: %s", + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Preview.openapiRequiredFields) { + for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -159,23 +159,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Preview.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Preview' and its subtypes + if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewResult' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(Preview.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, Preview value) throws IOException { + public void write(JsonWriter out, AudiencePreviewResult value) + throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public Preview read(JsonReader in) throws IOException { + public AudiencePreviewResult read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -185,18 +186,18 @@ public Preview read(JsonReader in) throws IOException { } /** - * Create an instance of Preview given an JSON string + * Create an instance of AudiencePreviewResult given an JSON string * * @param jsonString JSON string - * @return An instance of Preview - * @throws IOException if the JSON string is invalid with respect to Preview + * @return An instance of AudiencePreviewResult + * @throws IOException if the JSON string is invalid with respect to AudiencePreviewResult */ - public static Preview fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Preview.class); + public static AudiencePreviewResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewResult.class); } /** - * Convert an instance of Preview to an JSON string + * Convert an instance of AudiencePreviewResult to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/AudienceSize.java b/src/main/java/com/segment/publicapi/models/AudienceSize.java new file mode 100644 index 00000000..51d2a3af --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSize.java @@ -0,0 +1,284 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AudienceSize */ +public class AudienceSize { + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + private BigDecimal count; + + /** The unit type for the count(s) being returned. */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTS("ACCOUNTS"), + + USERS("USERS"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AudienceSize() {} + + public AudienceSize count(BigDecimal count) { + + this.count = count; + return this; + } + + /** + * The total audience membership count. Refer to the type field to determine the unit for this + * field (profiles, accounts, etc). + * + * @return count + */ + @javax.annotation.Nonnull + public BigDecimal getCount() { + return count; + } + + public void setCount(BigDecimal count) { + this.count = count; + } + + public AudienceSize type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The unit type for the count(s) being returned. + * + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSize audienceSize = (AudienceSize) o; + return Objects.equals(this.count, audienceSize.count) + && Objects.equals(this.type, audienceSize.type); + } + + @Override + public int hashCode() { + return Objects.hash(count, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSize {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("count"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("count"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSize + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSize.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSize is not found in the empty" + + " JSON string", + AudienceSize.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSize.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSize` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSize.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSize.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSize' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSize.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSize value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSize read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSize given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSize + * @throws IOException if the JSON string is invalid with respect to AudienceSize + */ + public static AudienceSize fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSize.class); + } + + /** + * Convert an instance of AudienceSize to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java new file mode 100644 index 00000000..bdbd349b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreview200Response.java @@ -0,0 +1,199 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** CreateAudiencePreview200Response */ +public class CreateAudiencePreview200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private CreateAudiencePreviewAlphaOutput data; + + public CreateAudiencePreview200Response() {} + + public CreateAudiencePreview200Response data(CreateAudiencePreviewAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public CreateAudiencePreviewAlphaOutput getData() { + return data; + } + + public void setData(CreateAudiencePreviewAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreview200Response createAudiencePreview200Response = + (CreateAudiencePreview200Response) o; + return Objects.equals(this.data, createAudiencePreview200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreview200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreview200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreview200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreview200Response is" + + " not found in the empty JSON string", + CreateAudiencePreview200Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreview200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreview200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CreateAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreview200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreview200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreview200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreview200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreview200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreview200Response + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreview200Response + */ + public static CreateAudiencePreview200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreview200Response.class); + } + + /** + * Convert an instance of CreateAudiencePreview200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java similarity index 75% rename from src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java rename to src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index b38d1ddf..4a1aeaa2 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudienceInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -28,8 +28,8 @@ import java.util.Objects; import java.util.Set; -/** Input to preview an audience. */ -public class PreviewAudienceInput { +/** Input to create an audience preview. */ +public class CreateAudiencePreviewAlphaInput { public static final String SERIALIZED_NAME_DEFINITION = "definition"; @SerializedName(SERIALIZED_NAME_DEFINITION) @@ -89,11 +89,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) - private AudienceOptionsWithLookback options; + private CreateAudiencePreviewOptions options; - public PreviewAudienceInput() {} + public CreateAudiencePreviewAlphaInput() {} - public PreviewAudienceInput definition(AudienceDefinitionWithoutType definition) { + public CreateAudiencePreviewAlphaInput definition(AudienceDefinitionWithoutType definition) { this.definition = definition; return this; @@ -113,7 +113,7 @@ public void setDefinition(AudienceDefinitionWithoutType definition) { this.definition = definition; } - public PreviewAudienceInput audienceType(AudienceTypeEnum audienceType) { + public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; return this; @@ -133,7 +133,7 @@ public void setAudienceType(AudienceTypeEnum audienceType) { this.audienceType = audienceType; } - public PreviewAudienceInput options(AudienceOptionsWithLookback options) { + public CreateAudiencePreviewAlphaInput options(CreateAudiencePreviewOptions options) { this.options = options; return this; @@ -145,11 +145,11 @@ public PreviewAudienceInput options(AudienceOptionsWithLookback options) { * @return options */ @javax.annotation.Nullable - public AudienceOptionsWithLookback getOptions() { + public CreateAudiencePreviewOptions getOptions() { return options; } - public void setOptions(AudienceOptionsWithLookback options) { + public void setOptions(CreateAudiencePreviewOptions options) { this.options = options; } @@ -161,10 +161,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudienceInput previewAudienceInput = (PreviewAudienceInput) o; - return Objects.equals(this.definition, previewAudienceInput.definition) - && Objects.equals(this.audienceType, previewAudienceInput.audienceType) - && Objects.equals(this.options, previewAudienceInput.options); + CreateAudiencePreviewAlphaInput createAudiencePreviewAlphaInput = + (CreateAudiencePreviewAlphaInput) o; + return Objects.equals(this.definition, createAudiencePreviewAlphaInput.definition) + && Objects.equals(this.audienceType, createAudiencePreviewAlphaInput.audienceType) + && Objects.equals(this.options, createAudiencePreviewAlphaInput.options); } @Override @@ -175,7 +176,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudienceInput {\n"); + sb.append("class CreateAudiencePreviewAlphaInput {\n"); sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); @@ -214,34 +215,35 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudienceInput + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewAlphaInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudienceInput.openapiRequiredFields + if (!CreateAudiencePreviewAlphaInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudienceInput is not found in" - + " the empty JSON string", - PreviewAudienceInput.openapiRequiredFields.toString())); + "The required field(s) %s in CreateAudiencePreviewAlphaInput is not" + + " found in the empty JSON string", + CreateAudiencePreviewAlphaInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudienceInput.openapiFields.contains(entry.getKey())) { + if (!CreateAudiencePreviewAlphaInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudienceInput` properties. JSON: %s", + + " `CreateAudiencePreviewAlphaInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PreviewAudienceInput.openapiRequiredFields) { + for (String requiredField : CreateAudiencePreviewAlphaInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -261,7 +263,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { - AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); + CreateAudiencePreviewOptions.validateJsonElement(jsonObj.get("options")); } } @@ -269,24 +271,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudienceInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudienceInput' and its subtypes + if (!CreateAudiencePreviewAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewAlphaInput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudienceInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewAlphaInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudienceInput value) + public void write(JsonWriter out, CreateAudiencePreviewAlphaInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudienceInput read(JsonReader in) throws IOException { + public CreateAudiencePreviewAlphaInput read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -296,18 +301,19 @@ public PreviewAudienceInput read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudienceInput given an JSON string + * Create an instance of CreateAudiencePreviewAlphaInput given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudienceInput - * @throws IOException if the JSON string is invalid with respect to PreviewAudienceInput + * @return An instance of CreateAudiencePreviewAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewAlphaInput */ - public static PreviewAudienceInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudienceInput.class); + public static CreateAudiencePreviewAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaInput.class); } /** - * Convert an instance of PreviewAudienceInput to an JSON string + * Convert an instance of CreateAudiencePreviewAlphaInput to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java new file mode 100644 index 00000000..efae7afe --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaOutput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output when creating an audience preview. */ +public class CreateAudiencePreviewAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) + private AudiencePreviewIdentifier audiencePreview; + + public CreateAudiencePreviewAlphaOutput() {} + + public CreateAudiencePreviewAlphaOutput audiencePreview( + AudiencePreviewIdentifier audiencePreview) { + + this.audiencePreview = audiencePreview; + return this; + } + + /** + * Get audiencePreview + * + * @return audiencePreview + */ + @javax.annotation.Nonnull + public AudiencePreviewIdentifier getAudiencePreview() { + return audiencePreview; + } + + public void setAudiencePreview(AudiencePreviewIdentifier audiencePreview) { + this.audiencePreview = audiencePreview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreviewAlphaOutput createAudiencePreviewAlphaOutput = + (CreateAudiencePreviewAlphaOutput) o; + return Objects.equals( + this.audiencePreview, createAudiencePreviewAlphaOutput.audiencePreview); + } + + @Override + public int hashCode() { + return Objects.hash(audiencePreview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreviewAlphaOutput {\n"); + sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiencePreview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiencePreview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreviewAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreviewAlphaOutput is" + + " not found in the empty JSON string", + CreateAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreviewAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAudiencePreviewAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audiencePreview` + AudiencePreviewIdentifier.validateJsonElement(jsonObj.get("audiencePreview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreviewAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreviewAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreviewAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreviewAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewAlphaOutput + */ + public static CreateAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewAlphaOutput.class); + } + + /** + * Convert an instance of CreateAudiencePreviewAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java new file mode 100644 index 00000000..fbaee4a4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewOptions.java @@ -0,0 +1,259 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Options which should be applied when segmenting audience previews. */ +public class CreateAudiencePreviewOptions { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds; + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public CreateAudiencePreviewOptions() {} + + public CreateAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public CreateAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience preview membership. + * Profiles will only be considered for audience preview membership if the profile has at least + * one external id whose key matches a value in this set. If unspecified, a default set of + * external identifiers will be used: `['user_id', 'email', + * 'android.idfa', 'ios.idfa']`. + * + * @return filterByExternalIds + */ + @javax.annotation.Nullable + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public CreateAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days (specified from the date + * the audience preview was created) that event data will be included from when determining + * audience preview membership. If not specified, the default is set to the maximum event window + * size, or 7 days if no window condition is defined. Note that this is applied on a best-effort + * basis and may not always be applicable. In such cases, the response will not return a + * backfillEventDataDays value, and all available data will be taken into account. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAudiencePreviewOptions createAudiencePreviewOptions = + (CreateAudiencePreviewOptions) o; + return Objects.equals( + this.filterByExternalIds, createAudiencePreviewOptions.filterByExternalIds) + && Objects.equals( + this.backfillEventDataDays, + createAudiencePreviewOptions.backfillEventDataDays); + } + + @Override + public int hashCode() { + return Objects.hash(filterByExternalIds, backfillEventDataDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAudiencePreviewOptions {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("backfillEventDataDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CreateAudiencePreviewOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateAudiencePreviewOptions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CreateAudiencePreviewOptions is not" + + " found in the empty JSON string", + CreateAudiencePreviewOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CreateAudiencePreviewOptions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("filterByExternalIds") != null + && !jsonObj.get("filterByExternalIds").isJsonNull() + && !jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAudiencePreviewOptions' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CreateAudiencePreviewOptions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAudiencePreviewOptions value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAudiencePreviewOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAudiencePreviewOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to + * CreateAudiencePreviewOptions + */ + public static CreateAudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAudiencePreviewOptions.class); + } + + /** + * Convert an instance of CreateAudiencePreviewOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java similarity index 69% rename from src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java rename to src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java index da007f6e..e5b85f5b 100644 --- a/src/main/java/com/segment/publicapi/models/PreviewAudience200Response.java +++ b/src/main/java/com/segment/publicapi/models/GetAudiencePreview200Response.java @@ -27,16 +27,16 @@ import java.util.Objects; import java.util.Set; -/** PreviewAudience200Response */ -public class PreviewAudience200Response { +/** GetAudiencePreview200Response */ +public class GetAudiencePreview200Response { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private PreviewAudienceOutput data; + private GetAudiencePreviewAlphaOutput data; - public PreviewAudience200Response() {} + public GetAudiencePreview200Response() {} - public PreviewAudience200Response data(PreviewAudienceOutput data) { + public GetAudiencePreview200Response data(GetAudiencePreviewAlphaOutput data) { this.data = data; return this; @@ -48,11 +48,11 @@ public PreviewAudience200Response data(PreviewAudienceOutput data) { * @return data */ @javax.annotation.Nullable - public PreviewAudienceOutput getData() { + public GetAudiencePreviewAlphaOutput getData() { return data; } - public void setData(PreviewAudienceOutput data) { + public void setData(GetAudiencePreviewAlphaOutput data) { this.data = data; } @@ -64,8 +64,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PreviewAudience200Response previewAudience200Response = (PreviewAudience200Response) o; - return Objects.equals(this.data, previewAudience200Response.data); + GetAudiencePreview200Response getAudiencePreview200Response = + (GetAudiencePreview200Response) o; + return Objects.equals(this.data, getAudiencePreview200Response.data); } @Override @@ -76,7 +77,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PreviewAudience200Response {\n"); + sb.append("class GetAudiencePreview200Response {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append("}"); return sb.toString(); @@ -109,35 +110,36 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PreviewAudience200Response + * @throws IOException if the JSON Element is invalid with respect to + * GetAudiencePreview200Response */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!PreviewAudience200Response.openapiRequiredFields + if (!GetAudiencePreview200Response.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in PreviewAudience200Response is not" + "The required field(s) %s in GetAudiencePreview200Response is not" + " found in the empty JSON string", - PreviewAudience200Response.openapiRequiredFields.toString())); + GetAudiencePreview200Response.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!PreviewAudience200Response.openapiFields.contains(entry.getKey())) { + if (!GetAudiencePreview200Response.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `PreviewAudience200Response` properties. JSON: %s", + + " `GetAudiencePreview200Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the optional field `data` if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { - PreviewAudienceOutput.validateJsonElement(jsonObj.get("data")); + GetAudiencePreviewAlphaOutput.validateJsonElement(jsonObj.get("data")); } } @@ -145,25 +147,27 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PreviewAudience200Response.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PreviewAudience200Response' and its + if (!GetAudiencePreview200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudiencePreview200Response' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(PreviewAudience200Response.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAudiencePreview200Response.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, PreviewAudience200Response value) + public void write(JsonWriter out, GetAudiencePreview200Response value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public PreviewAudience200Response read(JsonReader in) throws IOException { + public GetAudiencePreview200Response read(JsonReader in) + throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -173,18 +177,19 @@ public PreviewAudience200Response read(JsonReader in) throws IOException { } /** - * Create an instance of PreviewAudience200Response given an JSON string + * Create an instance of GetAudiencePreview200Response given an JSON string * * @param jsonString JSON string - * @return An instance of PreviewAudience200Response - * @throws IOException if the JSON string is invalid with respect to PreviewAudience200Response + * @return An instance of GetAudiencePreview200Response + * @throws IOException if the JSON string is invalid with respect to + * GetAudiencePreview200Response */ - public static PreviewAudience200Response fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PreviewAudience200Response.class); + public static GetAudiencePreview200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudiencePreview200Response.class); } /** - * Convert an instance of PreviewAudience200Response to an JSON string + * Convert an instance of GetAudiencePreview200Response to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java new file mode 100644 index 00000000..91363b74 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudiencePreviewAlphaOutput.java @@ -0,0 +1,208 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output when reading an audience preview. */ +public class GetAudiencePreviewAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_PREVIEW = "audiencePreview"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_PREVIEW) + private AudiencePreview audiencePreview; + + public GetAudiencePreviewAlphaOutput() {} + + public GetAudiencePreviewAlphaOutput audiencePreview(AudiencePreview audiencePreview) { + + this.audiencePreview = audiencePreview; + return this; + } + + /** + * Get audiencePreview + * + * @return audiencePreview + */ + @javax.annotation.Nonnull + public AudiencePreview getAudiencePreview() { + return audiencePreview; + } + + public void setAudiencePreview(AudiencePreview audiencePreview) { + this.audiencePreview = audiencePreview; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudiencePreviewAlphaOutput getAudiencePreviewAlphaOutput = + (GetAudiencePreviewAlphaOutput) o; + return Objects.equals(this.audiencePreview, getAudiencePreviewAlphaOutput.audiencePreview); + } + + @Override + public int hashCode() { + return Objects.hash(audiencePreview); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudiencePreviewAlphaOutput {\n"); + sb.append(" audiencePreview: ").append(toIndentedString(audiencePreview)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audiencePreview"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audiencePreview"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudiencePreviewAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudiencePreviewAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetAudiencePreviewAlphaOutput is not" + + " found in the empty JSON string", + GetAudiencePreviewAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudiencePreviewAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudiencePreviewAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAudiencePreviewAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audiencePreview` + AudiencePreview.validateJsonElement(jsonObj.get("audiencePreview")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudiencePreviewAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAudiencePreviewAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetAudiencePreviewAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAudiencePreviewAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudiencePreviewAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudiencePreviewAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudiencePreviewAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetAudiencePreviewAlphaOutput + */ + public static GetAudiencePreviewAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAudiencePreviewAlphaOutput.class); + } + + /** + * Convert an instance of GetAudiencePreviewAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java new file mode 100644 index 00000000..3acc03b6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ReadAudiencePreviewOptions.java @@ -0,0 +1,302 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Options which should be applied when segmenting audience previews. */ +public class ReadAudiencePreviewOptions { + public static final String SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS = "filterByExternalIds"; + + @SerializedName(SERIALIZED_NAME_FILTER_BY_EXTERNAL_IDS) + private List filterByExternalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA = "includeHistoricalData"; + + @SerializedName(SERIALIZED_NAME_INCLUDE_HISTORICAL_DATA) + private Boolean includeHistoricalData; + + public static final String SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS = "backfillEventDataDays"; + + @SerializedName(SERIALIZED_NAME_BACKFILL_EVENT_DATA_DAYS) + private BigDecimal backfillEventDataDays; + + public ReadAudiencePreviewOptions() {} + + public ReadAudiencePreviewOptions filterByExternalIds(List filterByExternalIds) { + + this.filterByExternalIds = filterByExternalIds; + return this; + } + + public ReadAudiencePreviewOptions addFilterByExternalIdsItem(String filterByExternalIdsItem) { + if (this.filterByExternalIds == null) { + this.filterByExternalIds = new ArrayList<>(); + } + this.filterByExternalIds.add(filterByExternalIdsItem); + return this; + } + + /** + * The set of profile external identifiers being used to determine audience preview membership. + * Profiles will only be considered for audience preview membership if the profile has at least + * one external id whose key matches a value in this set. + * + * @return filterByExternalIds + */ + @javax.annotation.Nonnull + public List getFilterByExternalIds() { + return filterByExternalIds; + } + + public void setFilterByExternalIds(List filterByExternalIds) { + this.filterByExternalIds = filterByExternalIds; + } + + public ReadAudiencePreviewOptions includeHistoricalData(Boolean includeHistoricalData) { + + this.includeHistoricalData = includeHistoricalData; + return this; + } + + /** + * Determines whether data prior to the audience preview being created is included when + * determining audience preview membership. Note that including historical data may be needed in + * order to properly handle the definition specified. In these cases, Segment will automatically + * handle including historical data and the response will return the includeHistoricalData + * parameter as true. + * + * @return includeHistoricalData + */ + @javax.annotation.Nonnull + public Boolean getIncludeHistoricalData() { + return includeHistoricalData; + } + + public void setIncludeHistoricalData(Boolean includeHistoricalData) { + this.includeHistoricalData = includeHistoricalData; + } + + public ReadAudiencePreviewOptions backfillEventDataDays(BigDecimal backfillEventDataDays) { + + this.backfillEventDataDays = backfillEventDataDays; + return this; + } + + /** + * If specified, the value of this field indicates the number of days (specified from the date + * the audience preview was created) that event data will be included from when determining + * audience preview membership. If unspecified, defer to the value of + * `includeHistoricalData` to determine whether historical data is either entirely + * included or entirely excluded when determining audience preview membership. + * + * @return backfillEventDataDays + */ + @javax.annotation.Nullable + public BigDecimal getBackfillEventDataDays() { + return backfillEventDataDays; + } + + public void setBackfillEventDataDays(BigDecimal backfillEventDataDays) { + this.backfillEventDataDays = backfillEventDataDays; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadAudiencePreviewOptions readAudiencePreviewOptions = (ReadAudiencePreviewOptions) o; + return Objects.equals( + this.filterByExternalIds, readAudiencePreviewOptions.filterByExternalIds) + && Objects.equals( + this.includeHistoricalData, + readAudiencePreviewOptions.includeHistoricalData) + && Objects.equals( + this.backfillEventDataDays, + readAudiencePreviewOptions.backfillEventDataDays); + } + + @Override + public int hashCode() { + return Objects.hash(filterByExternalIds, includeHistoricalData, backfillEventDataDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadAudiencePreviewOptions {\n"); + sb.append(" filterByExternalIds: ") + .append(toIndentedString(filterByExternalIds)) + .append("\n"); + sb.append(" includeHistoricalData: ") + .append(toIndentedString(includeHistoricalData)) + .append("\n"); + sb.append(" backfillEventDataDays: ") + .append(toIndentedString(backfillEventDataDays)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filterByExternalIds"); + openapiFields.add("includeHistoricalData"); + openapiFields.add("backfillEventDataDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filterByExternalIds"); + openapiRequiredFields.add("includeHistoricalData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ReadAudiencePreviewOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReadAudiencePreviewOptions.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ReadAudiencePreviewOptions is not" + + " found in the empty JSON string", + ReadAudiencePreviewOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ReadAudiencePreviewOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ReadAudiencePreviewOptions` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReadAudiencePreviewOptions.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("filterByExternalIds") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("filterByExternalIds").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `filterByExternalIds` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("filterByExternalIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadAudiencePreviewOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadAudiencePreviewOptions' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ReadAudiencePreviewOptions.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadAudiencePreviewOptions value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadAudiencePreviewOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ReadAudiencePreviewOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadAudiencePreviewOptions + * @throws IOException if the JSON string is invalid with respect to ReadAudiencePreviewOptions + */ + public static ReadAudiencePreviewOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadAudiencePreviewOptions.class); + } + + /** + * Convert an instance of ReadAudiencePreviewOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 8040b3aa20992782ad52ca157b4a7a2363e1996b Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 1 Jul 2025 08:40:20 +0000 Subject: [PATCH 452/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@be211400. --- README.md | 8 ++--- docs/AudiencesApi.md | 6 ++-- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- ...nceSummaryWithAudienceTypeAndLookback.java | 33 +++++++++++++++++++ 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 87d966f8..89c18748 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.7.0 +Latest API and SDK version: 58.8.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.7.0 + 58.8.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.7.0" + implementation "com.segment.publicapi:segment-publicapi:58.8.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.7.0.jar` +* `target/segment-publicapi-58.8.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index a92dbbbc..6f36c321 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -194,7 +194,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "id"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { GetAudience200Response result = apiInstance.getAudience(spaceId, id); System.out.println(result); @@ -500,7 +500,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { RemoveAudienceFromSpace200Response result = apiInstance.removeAudienceFromSpace(spaceId, id); System.out.println(result); @@ -575,7 +575,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | UpdateAudienceForSpaceAlphaInput updateAudienceForSpaceAlphaInput = new UpdateAudienceForSpaceAlphaInput(); // UpdateAudienceForSpaceAlphaInput | try { UpdateAudienceForSpace200Response result = apiInstance.updateAudienceForSpace(spaceId, id, updateAudienceForSpaceAlphaInput); diff --git a/pom.xml b/pom.xml index 6a340ede..8e2d30af 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.7.0 + 58.8.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index d731c05a..6a028ce8 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.7.0 (Java)"); + setUserAgent("Public API SDK 58.8.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index f95a82b6..61029765 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.7.0"; + public static final String VERSION = "58.8.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 88b7b297..978075eb 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -88,6 +88,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -196,6 +201,26 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } + public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -472,6 +497,7 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) @@ -498,6 +524,7 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, + size, options, id, spaceId, @@ -519,6 +546,7 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); @@ -555,6 +583,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); + openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("id"); openapiFields.add("spaceId"); @@ -640,6 +669,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); From d30cbfea610dc773058dd1a36c1cb7e653de5b63 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 1 Jul 2025 09:04:08 +0000 Subject: [PATCH 453/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@c7c94909. --- README.md | 8 +- docs/AudiencesApi.md | 170 +++++- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 22 + .../segment/publicapi/api/AudiencesApi.java | 569 ++++++++++++++++-- .../publicapi/models/AudienceSchedule.java | 378 ++++++++++++ ...nceSummaryWithAudienceTypeAndLookback.java | 61 ++ .../com/segment/publicapi/models/Config.java | 286 ++------- .../com/segment/publicapi/models/Config1.java | 453 ++++++++++++++ ...heduleFromSpaceAndAudience200Response.java | 215 +++++++ ...heduleFromSpaceAndAudienceAlphaOutput.java | 226 +++++++ ...edulesFromSpaceAndAudience200Response.java | 216 +++++++ ...edulesFromSpaceAndAudienceAlphaOutput.java | 254 ++++++++ .../publicapi/models/PeriodicConfig.java | 207 +++++++ .../models/ReverseEtlScheduleDefinition.java | 10 +- .../publicapi/models/SpecificDaysConfig.java | 308 ++++++++++ 18 files changed, 3085 insertions(+), 304 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudienceSchedule.java create mode 100644 src/main/java/com/segment/publicapi/models/Config1.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/PeriodicConfig.java create mode 100644 src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java diff --git a/README.md b/README.md index 89c18748..e188e49b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.8.0 +Latest API and SDK version: 58.9.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.8.0 + 58.9.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.8.0" + implementation "com.segment.publicapi:segment-publicapi:58.9.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.8.0.jar` +* `target/segment-publicapi-58.9.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 6f36c321..24b3d4b2 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -8,7 +8,9 @@ All URIs are relative to *https://api.segmentapis.com* | [**createAudiencePreview**](AudiencesApi.md#createAudiencePreview) | **POST** /spaces/{spaceId}/audiences/previews | Create Audience Preview | | [**getAudience**](AudiencesApi.md#getAudience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience | | [**getAudiencePreview**](AudiencesApi.md#getAudiencePreview) | **GET** /spaces/{spaceId}/audiences/previews/{id} | Get Audience Preview | +| [**getAudienceScheduleFromSpaceAndAudience**](AudiencesApi.md#getAudienceScheduleFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules/{scheduleId} | Get Audience Schedule from Space And Audience | | [**listAudienceConsumersFromSpaceAndAudience**](AudiencesApi.md#listAudienceConsumersFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience | +| [**listAudienceSchedulesFromSpaceAndAudience**](AudiencesApi.md#listAudienceSchedulesFromSpaceAndAudience) | **GET** /spaces/{spaceId}/audiences/{id}/schedules | List Audience Schedules from Space And Audience | | [**listAudiences**](AudiencesApi.md#listAudiences) | **GET** /spaces/{spaceId}/audiences | List Audiences | | [**removeAudienceFromSpace**](AudiencesApi.md#removeAudienceFromSpace) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space | | [**updateAudienceForSpace**](AudiencesApi.md#updateAudienceForSpace) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space | @@ -167,11 +169,11 @@ public class Example { ## Operation: getAudience -> GetAudience200Response getAudience(spaceId, id) +> GetAudience200Response getAudience(spaceId, id, include) Get Audience -Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns the Audience by id and spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 100 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -195,8 +197,9 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { - GetAudience200Response result = apiInstance.getAudience(spaceId, id); + GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#getAudience"); @@ -216,6 +219,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type @@ -315,6 +319,83 @@ public class Example { | **429** | Too many requests | - | +## Operation: getAudienceScheduleFromSpaceAndAudience + +> GetAudienceScheduleFromSpaceAndAudience200Response getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId) + +Get Audience Schedule from Space And Audience + +Returns the schedule for the given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String scheduleId = "sch_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + try { + GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#getAudienceScheduleFromSpaceAndAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **id** | **String**| | | +| **scheduleId** | **String**| | | + +### Return type + +[**GetAudienceScheduleFromSpaceAndAudience200Response**](GetAudienceScheduleFromSpaceAndAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: listAudienceConsumersFromSpaceAndAudience > ListAudienceConsumersFromSpaceAndAudience200Response listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort) @@ -396,13 +477,88 @@ public class Example { | **429** | Too many requests | - | +## Operation: listAudienceSchedulesFromSpaceAndAudience + +> ListAudienceSchedulesFromSpaceAndAudience200Response listAudienceSchedulesFromSpaceAndAudience(spaceId, id) + +List Audience Schedules from Space And Audience + +Returns the list of schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.AudiencesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + AudiencesApi apiInstance = new AudiencesApi(defaultClient); + String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + try { + ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AudiencesApi#listAudienceSchedulesFromSpaceAndAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **id** | **String**| | | + +### Return type + +[**ListAudienceSchedulesFromSpaceAndAudience200Response**](ListAudienceSchedulesFromSpaceAndAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + ## Operation: listAudiences -> ListAudiences200Response listAudiences(spaceId, pagination) +> ListAudiences200Response listAudiences(spaceId, pagination, include) List Audiences -Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Returns Audiences by spaceId. Supports including audience schedules via `?include=schedules`. • This endpoint is in **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 25 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example @@ -426,8 +582,9 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#listAudiences"); @@ -447,6 +604,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type diff --git a/pom.xml b/pom.xml index 8e2d30af..242c5bb7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.8.0 + 58.9.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 6a028ce8..8bb0364c 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.8.0 (Java)"); + setUserAgent("Public API SDK 58.9.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 61029765..ed947a37 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.8.0"; + public static final String VERSION = "58.9.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 790f8acb..247eda5e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -182,6 +182,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudienceSchedule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudienceSize.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -220,6 +222,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Config1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -682,6 +686,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAudiencePreviewAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetComputedTrait200Response .CustomTypeAdapterFactory()); @@ -933,6 +943,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudienceConsumersSortInput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListAudienceSchedulesFromSpaceAndAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models + .ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response .CustomTypeAdapterFactory()); @@ -1228,6 +1246,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.PaginationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PaginationOutput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.PeriodicConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.PermissionInputV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -1469,6 +1489,8 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.SpaceWarehouseSelectiveSyncItemAlpha .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.SpecificDaysConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.StreamStatusV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index 163904c5..e3cb801b 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -24,9 +24,11 @@ import com.segment.publicapi.models.CreateAudiencePreviewAlphaInput; import com.segment.publicapi.models.GetAudience200Response; import com.segment.publicapi.models.GetAudiencePreview200Response; +import com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; +import com.segment.publicapi.models.ListAudienceSchedulesFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; @@ -507,6 +509,8 @@ public okhttp3.Call createAudiencePreviewAsync( * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -519,7 +523,8 @@ public okhttp3.Call createAudiencePreviewAsync( * 429 Too many requests - * */ - public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback _callback) + public okhttp3.Call getAudienceCall( + String spaceId, String id, String include, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -550,6 +555,10 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + final String[] localVarAccepts = { "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json", @@ -584,7 +593,8 @@ public okhttp3.Call getAudienceCall(String spaceId, String id, final ApiCallback @SuppressWarnings("rawtypes") private okhttp3.Call getAudienceValidateBeforeCall( - String spaceId, String id, final ApiCallback _callback) throws ApiException { + String spaceId, String id, String include, final ApiCallback _callback) + throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException( @@ -597,21 +607,24 @@ private okhttp3.Call getAudienceValidateBeforeCall( "Missing the required parameter 'id' when calling getAudience(Async)"); } - return getAudienceCall(spaceId, id, _callback); + return getAudienceCall(spaceId, id, include, _callback); } /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules + * via `?include=schedules`. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 100 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return GetAudience200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -624,23 +637,28 @@ private okhttp3.Call getAudienceValidateBeforeCall( * 429 Too many requests - * */ - public GetAudience200Response getAudience(String spaceId, String id) throws ApiException { - ApiResponse localVarResp = getAudienceWithHttpInfo(spaceId, id); + public GetAudience200Response getAudience(String spaceId, String id, String include) + throws ApiException { + ApiResponse localVarResp = + getAudienceWithHttpInfo(spaceId, id, include); return localVarResp.getData(); } /** - * Get Audience Returns the Audience by id and spaceId. • This endpoint is in **Beta** testing. - * Please submit any feedback by sending an email to friends@segment.com. • In order to - * successfully call this endpoint, the specified Workspace needs to have the Audience feature - * enabled. Please reach out to your customer success manager for more information. The rate - * limit for this endpoint is 100 requests per minute, which is lower than the default due to - * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP - * status code with headers indicating the limit parameters. See [Rate - * Limiting](/#tag/Rate-Limits) for more information. + * Get Audience Returns the Audience by id and spaceId. Supports including audience schedules + * via `?include=schedules`. • This endpoint is in **Beta** testing. Please + * submit any feedback by sending an email to friends@segment.com. • In order to successfully + * call this endpoint, the specified Workspace needs to have the Audience feature enabled. + * Please reach out to your customer success manager for more information. The rate limit for + * this endpoint is 100 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return ApiResponse<GetAudience200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -653,25 +671,28 @@ public GetAudience200Response getAudience(String spaceId, String id) throws ApiE * 429 Too many requests - * */ - public ApiResponse getAudienceWithHttpInfo(String spaceId, String id) - throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, null); + public ApiResponse getAudienceWithHttpInfo( + String spaceId, String id, String include) throws ApiException { + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Get Audience (asynchronously) Returns the Audience by id and spaceId. • This endpoint is in - * **Beta** testing. Please submit any feedback by sending an email to friends@segment.com. • In - * order to successfully call this endpoint, the specified Workspace needs to have the Audience - * feature enabled. Please reach out to your customer success manager for more information. The - * rate limit for this endpoint is 100 requests per minute, which is lower than the default due - * to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * Get Audience (asynchronously) Returns the Audience by id and spaceId. Supports including + * audience schedules via `?include=schedules`. • This endpoint is in **Beta** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 100 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param id (required) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -686,10 +707,13 @@ public ApiResponse getAudienceWithHttpInfo(String spaceI * */ public okhttp3.Call getAudienceAsync( - String spaceId, String id, final ApiCallback _callback) + String spaceId, + String id, + String include, + final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, _callback); + okhttp3.Call localVarCall = getAudienceValidateBeforeCall(spaceId, id, include, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -889,6 +913,219 @@ public okhttp3.Call getAudiencePreviewAsync( return localVarCall; } + /** + * Build call for getAudienceScheduleFromSpaceAndAudience + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceCall( + String spaceId, String id, String scheduleId, final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}/schedules/{scheduleId}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())) + .replace( + "{" + "scheduleId" + "}", + localVarApiClient.escapeString(scheduleId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( + String spaceId, String id, String scheduleId, final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getAudienceScheduleFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " getAudienceScheduleFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'scheduleId' is set + if (scheduleId == null) { + throw new ApiException( + "Missing the required parameter 'scheduleId' when calling" + + " getAudienceScheduleFromSpaceAndAudience(Async)"); + } + + return getAudienceScheduleFromSpaceAndAudienceCall(spaceId, id, scheduleId, _callback); + } + + /** + * Get Audience Schedule from Space And Audience Returns the schedule for the given audience and + * scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @return GetAudienceScheduleFromSpaceAndAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetAudienceScheduleFromSpaceAndAudience200Response + getAudienceScheduleFromSpaceAndAudience(String spaceId, String id, String scheduleId) + throws ApiException { + ApiResponse localVarResp = + getAudienceScheduleFromSpaceAndAudienceWithHttpInfo(spaceId, id, scheduleId); + return localVarResp.getData(); + } + + /** + * Get Audience Schedule from Space And Audience Returns the schedule for the given audience and + * scheduleId. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @return ApiResponse<GetAudienceScheduleFromSpaceAndAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + getAudienceScheduleFromSpaceAndAudienceWithHttpInfo( + String spaceId, String id, String scheduleId) throws ApiException { + okhttp3.Call localVarCall = + getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( + spaceId, id, scheduleId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Audience Schedule from Space And Audience (asynchronously) Returns the schedule for the + * given audience and scheduleId. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param scheduleId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getAudienceScheduleFromSpaceAndAudienceAsync( + String spaceId, + String id, + String scheduleId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getAudienceScheduleFromSpaceAndAudienceValidateBeforeCall( + spaceId, id, scheduleId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudienceConsumersFromSpaceAndAudience * @@ -1154,6 +1391,200 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( return localVarCall; } + /** + * Build call for listAudienceSchedulesFromSpaceAndAudience + * + * @param spaceId (required) + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{id}/schedules" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall( + String spaceId, String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listAudienceSchedulesFromSpaceAndAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " listAudienceSchedulesFromSpaceAndAudience(Async)"); + } + + return listAudienceSchedulesFromSpaceAndAudienceCall(spaceId, id, _callback); + } + + /** + * List Audience Schedules from Space And Audience Returns the list of schedules for the given + * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ListAudienceSchedulesFromSpaceAndAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListAudienceSchedulesFromSpaceAndAudience200Response + listAudienceSchedulesFromSpaceAndAudience(String spaceId, String id) + throws ApiException { + ApiResponse localVarResp = + listAudienceSchedulesFromSpaceAndAudienceWithHttpInfo(spaceId, id); + return localVarResp.getData(); + } + + /** + * List Audience Schedules from Space And Audience Returns the list of schedules for the given + * audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an + * email to friends@segment.com. • In order to successfully call this endpoint, the specified + * Workspace needs to have the Audience feature enabled. Please reach out to your customer + * success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @return ApiResponse<ListAudienceSchedulesFromSpaceAndAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listAudienceSchedulesFromSpaceAndAudienceWithHttpInfo(String spaceId, String id) + throws ApiException { + okhttp3.Call localVarCall = + listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall(spaceId, id, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Audience Schedules from Space And Audience (asynchronously) Returns the list of + * schedules for the given audience. • This endpoint is in **Alpha** testing. Please submit any + * feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. + * + * @param spaceId (required) + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceAsync( + String spaceId, + String id, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listAudienceSchedulesFromSpaceAndAudienceValidateBeforeCall(spaceId, id, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** * Build call for listAudiences * @@ -1161,6 +1592,8 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1174,7 +1607,10 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( * */ public okhttp3.Call listAudiencesCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, + ListAudiencesPaginationInput pagination, + String include, + final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers @@ -1208,6 +1644,10 @@ public okhttp3.Call listAudiencesCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + final String[] localVarAccepts = { "application/vnd.segment.v1beta+json", "application/vnd.segment.v1alpha+json", @@ -1242,7 +1682,10 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( - String spaceId, ListAudiencesPaginationInput pagination, final ApiCallback _callback) + String spaceId, + ListAudiencesPaginationInput pagination, + String include, + final ApiCallback _callback) throws ApiException { // verify the required parameter 'spaceId' is set if (spaceId == null) { @@ -1250,23 +1693,26 @@ private okhttp3.Call listAudiencesValidateBeforeCall( "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); } - return listAudiencesCall(spaceId, pagination, _callback); + return listAudiencesCall(spaceId, pagination, include, _callback); } /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 25 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * List Audiences Returns Audiences by spaceId. Supports including audience schedules via + * `?include=schedules`. • This endpoint is in **Beta** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return ListAudiences200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1280,26 +1726,30 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * */ public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { + String spaceId, ListAudiencesPaginationInput pagination, String include) + throws ApiException { ApiResponse localVarResp = - listAudiencesWithHttpInfo(spaceId, pagination); + listAudiencesWithHttpInfo(spaceId, pagination, include); return localVarResp.getData(); } /** - * List Audiences Returns Audiences by spaceId. • This endpoint is in **Beta** testing. Please - * submit any feedback by sending an email to friends@segment.com. • In order to successfully - * call this endpoint, the specified Workspace needs to have the Audience feature enabled. - * Please reach out to your customer success manager for more information. The rate limit for - * this endpoint is 25 requests per minute, which is lower than the default due to access - * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code - * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * List Audiences Returns Audiences by spaceId. Supports including audience schedules via + * `?include=schedules`. • This endpoint is in **Beta** testing. Please submit + * any feedback by sending an email to friends@segment.com. • In order to successfully call this + * endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach + * out to your customer success manager for more information. The rate limit for this endpoint + * is 25 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. * * @param spaceId (required) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @return ApiResponse<ListAudiences200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -1313,15 +1763,18 @@ public ListAudiences200Response listAudiences( * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination) throws ApiException { - okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, null); + String spaceId, ListAudiencesPaginationInput pagination, String include) + throws ApiException { + okhttp3.Call localVarCall = + listAudiencesValidateBeforeCall(spaceId, pagination, include, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * List Audiences (asynchronously) Returns Audiences by spaceId. • This endpoint is in **Beta** - * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * List Audiences (asynchronously) Returns Audiences by spaceId. Supports including audience + * schedules via `?include=schedules`. • This endpoint is in **Beta** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to * successfully call this endpoint, the specified Workspace needs to have the Audience feature * enabled. Please reach out to your customer success manager for more information. The rate * limit for this endpoint is 25 requests per minute, which is lower than the default due to @@ -1333,6 +1786,8 @@ public ApiResponse listAudiencesWithHttpInfo( * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) + * @param include Additional resource to include, support schedules only. This parameter exists + * in alpha. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body @@ -1349,10 +1804,12 @@ public ApiResponse listAudiencesWithHttpInfo( public okhttp3.Call listAudiencesAsync( String spaceId, ListAudiencesPaginationInput pagination, + String include, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = listAudiencesValidateBeforeCall(spaceId, pagination, _callback); + okhttp3.Call localVarCall = + listAudiencesValidateBeforeCall(spaceId, pagination, include, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java new file mode 100644 index 00000000..e2430a2e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java @@ -0,0 +1,378 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Defines an Audience Schedule. */ +public class AudienceSchedule { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + /** Strategy of the audience schedule (manual, periodic, or specific days). */ + @JsonAdapter(StrategyEnum.Adapter.class) + public enum StrategyEnum { + MANUAL("MANUAL"), + + PERIODIC("PERIODIC"), + + SPECIFIC_DAYS("SPECIFIC_DAYS"); + + private String value; + + StrategyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StrategyEnum fromValue(String value) { + for (StrategyEnum b : StrategyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StrategyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StrategyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + + @SerializedName(SERIALIZED_NAME_STRATEGY) + private StrategyEnum strategy; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + + @SerializedName(SERIALIZED_NAME_CONFIG) + private Config config; + + public static final String SERIALIZED_NAME_NEXT_EXECUTION = "nextExecution"; + + @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION) + private String nextExecution; + + public AudienceSchedule() {} + + public AudienceSchedule id(String id) { + + this.id = id; + return this; + } + + /** + * Distinct identifier for the schedule. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudienceSchedule strategy(StrategyEnum strategy) { + + this.strategy = strategy; + return this; + } + + /** + * Strategy of the audience schedule (manual, periodic, or specific days). + * + * @return strategy + */ + @javax.annotation.Nonnull + public StrategyEnum getStrategy() { + return strategy; + } + + public void setStrategy(StrategyEnum strategy) { + this.strategy = strategy; + } + + public AudienceSchedule config(Config config) { + + this.config = config; + return this; + } + + /** + * Get config + * + * @return config + */ + @javax.annotation.Nullable + public Config getConfig() { + return config; + } + + public void setConfig(Config config) { + this.config = config; + } + + public AudienceSchedule nextExecution(String nextExecution) { + + this.nextExecution = nextExecution; + return this; + } + + /** + * The next scheduled execution time (RFC3339). + * + * @return nextExecution + */ + @javax.annotation.Nullable + public String getNextExecution() { + return nextExecution; + } + + public void setNextExecution(String nextExecution) { + this.nextExecution = nextExecution; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudienceSchedule audienceSchedule = (AudienceSchedule) o; + return Objects.equals(this.id, audienceSchedule.id) + && Objects.equals(this.strategy, audienceSchedule.strategy) + && Objects.equals(this.config, audienceSchedule.config) + && Objects.equals(this.nextExecution, audienceSchedule.nextExecution); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, strategy, config, nextExecution); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudienceSchedule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" nextExecution: ").append(toIndentedString(nextExecution)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("strategy"); + openapiFields.add("config"); + openapiFields.add("nextExecution"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("strategy"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AudienceSchedule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudienceSchedule.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudienceSchedule is not found in the" + + " empty JSON string", + AudienceSchedule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudienceSchedule.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudienceSchedule` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudienceSchedule.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("strategy").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `strategy` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("strategy").toString())); + } + // validate the optional field `config` + if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { + Config.validateJsonElement(jsonObj.get("config")); + } + if ((jsonObj.get("nextExecution") != null && !jsonObj.get("nextExecution").isJsonNull()) + && !jsonObj.get("nextExecution").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nextExecution` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("nextExecution").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudienceSchedule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudienceSchedule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudienceSchedule.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudienceSchedule value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudienceSchedule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudienceSchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudienceSchedule + * @throws IOException if the JSON string is invalid with respect to AudienceSchedule + */ + public static AudienceSchedule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudienceSchedule.class); + } + + /** + * Convert an instance of AudienceSchedule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 978075eb..c225d085 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -12,6 +12,7 @@ package com.segment.publicapi.models; import com.google.gson.Gson; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; @@ -23,7 +24,9 @@ import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -98,6 +101,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_OPTIONS) private AudienceOptionsWithLookback options; + public static final String SERIALIZED_NAME_SCHEDULES = "schedules"; + + @SerializedName(SERIALIZED_NAME_SCHEDULES) + private List schedules; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -241,6 +249,35 @@ public void setOptions(AudienceOptionsWithLookback options) { this.options = options; } + public AudienceSummaryWithAudienceTypeAndLookback schedules(List schedules) { + + this.schedules = schedules; + return this; + } + + public AudienceSummaryWithAudienceTypeAndLookback addSchedulesItem( + AudienceSchedule schedulesItem) { + if (this.schedules == null) { + this.schedules = new ArrayList<>(); + } + this.schedules.add(schedulesItem); + return this; + } + + /** + * List of schedules for the audience. + * + * @return schedules + */ + @javax.annotation.Nullable + public List getSchedules() { + return schedules; + } + + public void setSchedules(List schedules) { + this.schedules = schedules; + } + public AudienceSummaryWithAudienceTypeAndLookback id(String id) { this.id = id; @@ -499,6 +536,8 @@ public boolean equals(Object o) { audienceSummaryWithAudienceTypeAndLookback.computeCadence) && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) + && Objects.equals( + this.schedules, audienceSummaryWithAudienceTypeAndLookback.schedules) && Objects.equals(this.id, audienceSummaryWithAudienceTypeAndLookback.id) && Objects.equals(this.spaceId, audienceSummaryWithAudienceTypeAndLookback.spaceId) && Objects.equals(this.name, audienceSummaryWithAudienceTypeAndLookback.name) @@ -526,6 +565,7 @@ public int hashCode() { computeCadence, size, options, + schedules, id, spaceId, name, @@ -548,6 +588,7 @@ public String toString() { sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" spaceId: ").append(toIndentedString(spaceId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -585,6 +626,7 @@ private String toIndentedString(Object o) { openapiFields.add("computeCadence"); openapiFields.add("size"); openapiFields.add("options"); + openapiFields.add("schedules"); openapiFields.add("id"); openapiFields.add("spaceId"); openapiFields.add("name"); @@ -677,6 +719,25 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); } + if (jsonObj.get("schedules") != null && !jsonObj.get("schedules").isJsonNull()) { + JsonArray jsonArrayschedules = jsonObj.getAsJsonArray("schedules"); + if (jsonArrayschedules != null) { + // ensure the json data is an array + if (!jsonObj.get("schedules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `schedules` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("schedules").toString())); + } + + // validate the optional field `schedules` (array) + for (int i = 0; i < jsonArrayschedules.size(); i++) { + AudienceSchedule.validateJsonElement(jsonArrayschedules.get(i)); + } + ; + } + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/src/main/java/com/segment/publicapi/models/Config.java b/src/main/java/com/segment/publicapi/models/Config.java index a1455431..8327f000 100644 --- a/src/main/java/com/segment/publicapi/models/Config.java +++ b/src/main/java/com/segment/publicapi/models/Config.java @@ -37,22 +37,10 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'Config' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter - adapterReverseEtlPeriodicScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlSpecificTimeScheduleConfig = - gson.getDelegateAdapter( - this, - TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); - final TypeAdapter adapterReverseEtlCronScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); - final TypeAdapter - adapterReverseEtlDbtCloudScheduleConfig = - gson.getDelegateAdapter( - this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); + final TypeAdapter adapterPeriodicConfig = + gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); + final TypeAdapter adapterSpecificDaysConfig = + gson.getDelegateAdapter(this, TypeToken.get(SpecificDaysConfig.class)); return (TypeAdapter) new TypeAdapter() { @@ -63,55 +51,25 @@ public void write(JsonWriter out, Config value) throws IOException { return; } - // check if the actual instance is of the type - // `ReverseEtlPeriodicScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlPeriodicScheduleConfig) { + // check if the actual instance is of the type `PeriodicConfig` + if (value.getActualInstance() instanceof PeriodicConfig) { JsonElement element = - adapterReverseEtlPeriodicScheduleConfig.toJsonTree( - (ReverseEtlPeriodicScheduleConfig) - value.getActualInstance()); + adapterPeriodicConfig.toJsonTree( + (PeriodicConfig) value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type - // `ReverseEtlSpecificTimeScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlSpecificTimeScheduleConfig) { + // check if the actual instance is of the type `SpecificDaysConfig` + if (value.getActualInstance() instanceof SpecificDaysConfig) { JsonElement element = - adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( - (ReverseEtlSpecificTimeScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlCronScheduleConfig` - if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { - JsonElement element = - adapterReverseEtlCronScheduleConfig.toJsonTree( - (ReverseEtlCronScheduleConfig) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `ReverseEtlDbtCloudScheduleConfig` - if (value.getActualInstance() - instanceof ReverseEtlDbtCloudScheduleConfig) { - JsonElement element = - adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( - (ReverseEtlDbtCloudScheduleConfig) - value.getActualInstance()); + adapterSpecificDaysConfig.toJsonTree( + (SpecificDaysConfig) value.getActualInstance()); elementAdapter.write(out, element); return; } throw new IOException( "Failed to serialize as the type doesn't match anyOf schemae:" - + " ReverseEtlCronScheduleConfig," - + " ReverseEtlDbtCloudScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + + " PeriodicConfig, SpecificDaysConfig"); } @Override @@ -122,11 +80,11 @@ public Config read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize ReverseEtlPeriodicScheduleConfig + // deserialize PeriodicConfig try { // validate the JSON object to see if any exception is thrown - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + PeriodicConfig.validateJsonElement(jsonElement); + actualAdapter = adapterPeriodicConfig; Config ret = new Config(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -134,22 +92,19 @@ public Config read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for" - + " ReverseEtlPeriodicScheduleConfig failed" - + " with `%s`.", + "Deserialization for PeriodicConfig failed with" + + " `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlPeriodicScheduleConfig'", + "Input data does not match schema 'PeriodicConfig'", e); } - // deserialize ReverseEtlSpecificTimeScheduleConfig + // deserialize SpecificDaysConfig try { // validate the JSON object to see if any exception is thrown - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( - jsonElement); - actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + SpecificDaysConfig.validateJsonElement(jsonElement); + actualAdapter = adapterSpecificDaysConfig; Config ret = new Config(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); return ret; @@ -157,57 +112,12 @@ public Config read(JsonReader in) throws IOException { // deserialization failed, continue errorMessages.add( String.format( - "Deserialization for" - + " ReverseEtlSpecificTimeScheduleConfig failed" - + " with `%s`.", + "Deserialization for SpecificDaysConfig failed with" + + " `%s`.", e.getMessage())); log.log( Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlSpecificTimeScheduleConfig'", - e); - } - // deserialize ReverseEtlCronScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlCronScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for ReverseEtlCronScheduleConfig" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlCronScheduleConfig'", - e); - } - // deserialize ReverseEtlDbtCloudScheduleConfig - try { - // validate the JSON object to see if any exception is thrown - ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); - actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; - Config ret = new Config(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for" - + " ReverseEtlDbtCloudScheduleConfig failed" - + " with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'ReverseEtlDbtCloudScheduleConfig'", + "Input data does not match schema 'SpecificDaysConfig'", e); } @@ -229,32 +139,19 @@ public Config() { super("anyOf", Boolean.TRUE); } - public Config(ReverseEtlCronScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config(ReverseEtlDbtCloudScheduleConfig o) { - super("anyOf", Boolean.TRUE); - setActualInstance(o); - } - - public Config(ReverseEtlPeriodicScheduleConfig o) { + public Config(PeriodicConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); } - public Config(ReverseEtlSpecificTimeScheduleConfig o) { + public Config(SpecificDaysConfig o) { super("anyOf", Boolean.TRUE); setActualInstance(o); } static { - schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); - schemas.put( - "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); - schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); - schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); + schemas.put("PeriodicConfig", PeriodicConfig.class); + schemas.put("SpecificDaysConfig", SpecificDaysConfig.class); } @Override @@ -264,9 +161,7 @@ public Map> getSchemas() { /** * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: ReverseEtlCronScheduleConfig, - * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * against the anyOf child schemas: PeriodicConfig, SpecificDaysConfig * *

It could be an instance of the 'anyOf' schemas. */ @@ -277,39 +172,24 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof ReverseEtlPeriodicScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof ReverseEtlCronScheduleConfig) { + if (instance instanceof PeriodicConfig) { super.setActualInstance(instance); return; } - if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { + if (instance instanceof SpecificDaysConfig) { super.setActualInstance(instance); return; } throw new RuntimeException( - "Invalid instance type. Must be ReverseEtlCronScheduleConfig," - + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig"); + "Invalid instance type. Must be PeriodicConfig, SpecificDaysConfig"); } /** - * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, - * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, - * ReverseEtlSpecificTimeScheduleConfig + * Get the actual instance, which can be the following: PeriodicConfig, SpecificDaysConfig * - * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, - * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) + * @return The actual instance (PeriodicConfig, SpecificDaysConfig) */ @Override public Object getActualInstance() { @@ -317,51 +197,25 @@ public Object getActualInstance() { } /** - * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not - * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` - */ - public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() - throws ClassCastException { - return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is - * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * Get the actual instance of `PeriodicConfig`. If the actual instance is not `PeriodicConfig`, + * the ClassCastException will be thrown. * - * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + * @return The actual instance of `PeriodicConfig` + * @throws ClassCastException if the instance is not `PeriodicConfig` */ - public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() - throws ClassCastException { - return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + public PeriodicConfig getPeriodicConfig() throws ClassCastException { + return (PeriodicConfig) super.getActualInstance(); } /** - * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not - * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * Get the actual instance of `SpecificDaysConfig`. If the actual instance is not + * `SpecificDaysConfig`, the ClassCastException will be thrown. * - * @return The actual instance of `ReverseEtlCronScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + * @return The actual instance of `SpecificDaysConfig` + * @throws ClassCastException if the instance is not `SpecificDaysConfig` */ - public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() - throws ClassCastException { - return (ReverseEtlCronScheduleConfig) super.getActualInstance(); - } - - /** - * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not - * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. - * - * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` - * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` - */ - public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() - throws ClassCastException { - return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); + public SpecificDaysConfig getSpecificDaysConfig() throws ClassCastException { + return (SpecificDaysConfig) super.getActualInstance(); } /** @@ -373,61 +227,33 @@ public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() public static void validateJsonElement(JsonElement jsonElement) throws IOException { // validate anyOf schemas one by one ArrayList errorMessages = new ArrayList<>(); - // validate the json string with ReverseEtlPeriodicScheduleConfig - try { - ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlSpecificTimeScheduleConfig - try { - ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" - + " `%s`.", - e.getMessage())); - // continue to the next one - } - // validate the json string with ReverseEtlCronScheduleConfig + // validate the json string with PeriodicConfig try { - ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + PeriodicConfig.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + "Deserialization for PeriodicConfig failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with ReverseEtlDbtCloudScheduleConfig + // validate the json string with SpecificDaysConfig try { - ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + SpecificDaysConfig.validateJsonElement(jsonElement); return; } catch (Exception e) { errorMessages.add( String.format( - "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" - + " `%s`.", + "Deserialization for SpecificDaysConfig failed with `%s`.", e.getMessage())); // continue to the next one } throw new IOException( String.format( - "The JSON string is invalid for Config with anyOf schemas:" - + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," - + " ReverseEtlPeriodicScheduleConfig," - + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," - + " expected at least 1. Detailed failure message for anyOf schemas:" - + " %s. JSON: %s", + "The JSON string is invalid for Config with anyOf schemas: PeriodicConfig," + + " SpecificDaysConfig. no class match the result, expected at least 1." + + " Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); } diff --git a/src/main/java/com/segment/publicapi/models/Config1.java b/src/main/java/com/segment/publicapi/models/Config1.java new file mode 100644 index 00000000..873f79bd --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Config1.java @@ -0,0 +1,453 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class Config1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Config1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Config1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Config1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter + adapterReverseEtlPeriodicScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlPeriodicScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlSpecificTimeScheduleConfig = + gson.getDelegateAdapter( + this, + TypeToken.get(ReverseEtlSpecificTimeScheduleConfig.class)); + final TypeAdapter adapterReverseEtlCronScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlCronScheduleConfig.class)); + final TypeAdapter + adapterReverseEtlDbtCloudScheduleConfig = + gson.getDelegateAdapter( + this, TypeToken.get(ReverseEtlDbtCloudScheduleConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Config1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `ReverseEtlPeriodicScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlPeriodicScheduleConfig) { + JsonElement element = + adapterReverseEtlPeriodicScheduleConfig.toJsonTree( + (ReverseEtlPeriodicScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlSpecificTimeScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlSpecificTimeScheduleConfig) { + JsonElement element = + adapterReverseEtlSpecificTimeScheduleConfig.toJsonTree( + (ReverseEtlSpecificTimeScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlCronScheduleConfig` + if (value.getActualInstance() instanceof ReverseEtlCronScheduleConfig) { + JsonElement element = + adapterReverseEtlCronScheduleConfig.toJsonTree( + (ReverseEtlCronScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `ReverseEtlDbtCloudScheduleConfig` + if (value.getActualInstance() + instanceof ReverseEtlDbtCloudScheduleConfig) { + JsonElement element = + adapterReverseEtlDbtCloudScheduleConfig.toJsonTree( + (ReverseEtlDbtCloudScheduleConfig) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + @Override + public Config1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ReverseEtlPeriodicScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlPeriodicScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlPeriodicScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlPeriodicScheduleConfig'", + e); + } + // deserialize ReverseEtlSpecificTimeScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement( + jsonElement); + actualAdapter = adapterReverseEtlSpecificTimeScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlSpecificTimeScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlSpecificTimeScheduleConfig'", + e); + } + // deserialize ReverseEtlCronScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlCronScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlCronScheduleConfig'", + e); + } + // deserialize ReverseEtlDbtCloudScheduleConfig + try { + // validate the JSON object to see if any exception is thrown + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + actualAdapter = adapterReverseEtlDbtCloudScheduleConfig; + Config1 ret = new Config1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for" + + " ReverseEtlDbtCloudScheduleConfig failed" + + " with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ReverseEtlDbtCloudScheduleConfig'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for Config1: no class matches" + + " result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public Config1() { + super("anyOf", Boolean.TRUE); + } + + public Config1(ReverseEtlCronScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config1(ReverseEtlDbtCloudScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config1(ReverseEtlPeriodicScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + public Config1(ReverseEtlSpecificTimeScheduleConfig o) { + super("anyOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("ReverseEtlPeriodicScheduleConfig", ReverseEtlPeriodicScheduleConfig.class); + schemas.put( + "ReverseEtlSpecificTimeScheduleConfig", ReverseEtlSpecificTimeScheduleConfig.class); + schemas.put("ReverseEtlCronScheduleConfig", ReverseEtlCronScheduleConfig.class); + schemas.put("ReverseEtlDbtCloudScheduleConfig", ReverseEtlDbtCloudScheduleConfig.class); + } + + @Override + public Map> getSchemas() { + return Config1.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: ReverseEtlCronScheduleConfig, + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + *

It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlPeriodicScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlSpecificTimeScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlCronScheduleConfig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ReverseEtlDbtCloudScheduleConfig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException( + "Invalid instance type. Must be ReverseEtlCronScheduleConfig," + + " ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig"); + } + + /** + * Get the actual instance, which can be the following: ReverseEtlCronScheduleConfig, + * ReverseEtlDbtCloudScheduleConfig, ReverseEtlPeriodicScheduleConfig, + * ReverseEtlSpecificTimeScheduleConfig + * + * @return The actual instance (ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig, + * ReverseEtlPeriodicScheduleConfig, ReverseEtlSpecificTimeScheduleConfig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlPeriodicScheduleConfig`. If the actual instance is not + * `ReverseEtlPeriodicScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlPeriodicScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlPeriodicScheduleConfig` + */ + public ReverseEtlPeriodicScheduleConfig getReverseEtlPeriodicScheduleConfig() + throws ClassCastException { + return (ReverseEtlPeriodicScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlSpecificTimeScheduleConfig`. If the actual instance is + * not `ReverseEtlSpecificTimeScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlSpecificTimeScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlSpecificTimeScheduleConfig` + */ + public ReverseEtlSpecificTimeScheduleConfig getReverseEtlSpecificTimeScheduleConfig() + throws ClassCastException { + return (ReverseEtlSpecificTimeScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlCronScheduleConfig`. If the actual instance is not + * `ReverseEtlCronScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlCronScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlCronScheduleConfig` + */ + public ReverseEtlCronScheduleConfig getReverseEtlCronScheduleConfig() + throws ClassCastException { + return (ReverseEtlCronScheduleConfig) super.getActualInstance(); + } + + /** + * Get the actual instance of `ReverseEtlDbtCloudScheduleConfig`. If the actual instance is not + * `ReverseEtlDbtCloudScheduleConfig`, the ClassCastException will be thrown. + * + * @return The actual instance of `ReverseEtlDbtCloudScheduleConfig` + * @throws ClassCastException if the instance is not `ReverseEtlDbtCloudScheduleConfig` + */ + public ReverseEtlDbtCloudScheduleConfig getReverseEtlDbtCloudScheduleConfig() + throws ClassCastException { + return (ReverseEtlDbtCloudScheduleConfig) super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Config1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ReverseEtlPeriodicScheduleConfig + try { + ReverseEtlPeriodicScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlPeriodicScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlSpecificTimeScheduleConfig + try { + ReverseEtlSpecificTimeScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlSpecificTimeScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlCronScheduleConfig + try { + ReverseEtlCronScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlCronScheduleConfig failed with `%s`.", + e.getMessage())); + // continue to the next one + } + // validate the json string with ReverseEtlDbtCloudScheduleConfig + try { + ReverseEtlDbtCloudScheduleConfig.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for ReverseEtlDbtCloudScheduleConfig failed with" + + " `%s`.", + e.getMessage())); + // continue to the next one + } + throw new IOException( + String.format( + "The JSON string is invalid for Config1 with anyOf schemas:" + + " ReverseEtlCronScheduleConfig, ReverseEtlDbtCloudScheduleConfig," + + " ReverseEtlPeriodicScheduleConfig," + + " ReverseEtlSpecificTimeScheduleConfig. no class match the result," + + " expected at least 1. Detailed failure message for anyOf schemas:" + + " %s. JSON: %s", + errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of Config1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of Config1 + * @throws IOException if the JSON string is invalid with respect to Config1 + */ + public static Config1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Config1.class); + } + + /** + * Convert an instance of Config1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java new file mode 100644 index 00000000..22661112 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudience200Response.java @@ -0,0 +1,215 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetAudienceScheduleFromSpaceAndAudience200Response */ +public class GetAudienceScheduleFromSpaceAndAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data; + + public GetAudienceScheduleFromSpaceAndAudience200Response() {} + + public GetAudienceScheduleFromSpaceAndAudience200Response data( + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput getData() { + return data; + } + + public void setData(GetAudienceScheduleFromSpaceAndAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceScheduleFromSpaceAndAudience200Response + getAudienceScheduleFromSpaceAndAudience200Response = + (GetAudienceScheduleFromSpaceAndAudience200Response) o; + return Objects.equals(this.data, getAudienceScheduleFromSpaceAndAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceScheduleFromSpaceAndAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudienceScheduleFromSpaceAndAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAudienceScheduleFromSpaceAndAudience200Response is not" + + " found in the empty JSON string", + GetAudienceScheduleFromSpaceAndAudience200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudienceScheduleFromSpaceAndAudience200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceScheduleFromSpaceAndAudience200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceScheduleFromSpaceAndAudience200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAudienceScheduleFromSpaceAndAudience200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAudienceScheduleFromSpaceAndAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAudienceScheduleFromSpaceAndAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceScheduleFromSpaceAndAudience200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceScheduleFromSpaceAndAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceScheduleFromSpaceAndAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudience200Response + */ + public static GetAudienceScheduleFromSpaceAndAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAudienceScheduleFromSpaceAndAudience200Response.class); + } + + /** + * Convert an instance of GetAudienceScheduleFromSpaceAndAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java new file mode 100644 index 00000000..44f75ed2 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.java @@ -0,0 +1,226 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for get audience schedule. */ +public class GetAudienceScheduleFromSpaceAndAudienceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_SCHEDULE = "audienceSchedule"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCHEDULE) + private AudienceSchedule audienceSchedule; + + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput() {} + + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput audienceSchedule( + AudienceSchedule audienceSchedule) { + + this.audienceSchedule = audienceSchedule; + return this; + } + + /** + * Get audienceSchedule + * + * @return audienceSchedule + */ + @javax.annotation.Nonnull + public AudienceSchedule getAudienceSchedule() { + return audienceSchedule; + } + + public void setAudienceSchedule(AudienceSchedule audienceSchedule) { + this.audienceSchedule = audienceSchedule; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + getAudienceScheduleFromSpaceAndAudienceAlphaOutput = + (GetAudienceScheduleFromSpaceAndAudienceAlphaOutput) o; + return Objects.equals( + this.audienceSchedule, + getAudienceScheduleFromSpaceAndAudienceAlphaOutput.audienceSchedule); + } + + @Override + public int hashCode() { + return Objects.hash(audienceSchedule); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAudienceScheduleFromSpaceAndAudienceAlphaOutput {\n"); + sb.append(" audienceSchedule: ").append(toIndentedString(audienceSchedule)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceSchedule"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceSchedule"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetAudienceScheduleFromSpaceAndAudienceAlphaOutput is not" + + " found in the empty JSON string", + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetAudienceScheduleFromSpaceAndAudienceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `audienceSchedule` + AudienceSchedule.validateJsonElement(jsonObj.get("audienceSchedule")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetAudienceScheduleFromSpaceAndAudienceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetAudienceScheduleFromSpaceAndAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAudienceScheduleFromSpaceAndAudienceAlphaOutput read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * GetAudienceScheduleFromSpaceAndAudienceAlphaOutput + */ + public static GetAudienceScheduleFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetAudienceScheduleFromSpaceAndAudienceAlphaOutput.class); + } + + /** + * Convert an instance of GetAudienceScheduleFromSpaceAndAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java new file mode 100644 index 00000000..f041ef14 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudience200Response.java @@ -0,0 +1,216 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListAudienceSchedulesFromSpaceAndAudience200Response */ +public class ListAudienceSchedulesFromSpaceAndAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data; + + public ListAudienceSchedulesFromSpaceAndAudience200Response() {} + + public ListAudienceSchedulesFromSpaceAndAudience200Response data( + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput getData() { + return data; + } + + public void setData(ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudienceSchedulesFromSpaceAndAudience200Response + listAudienceSchedulesFromSpaceAndAudience200Response = + (ListAudienceSchedulesFromSpaceAndAudience200Response) o; + return Objects.equals(this.data, listAudienceSchedulesFromSpaceAndAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudienceSchedulesFromSpaceAndAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudienceSchedulesFromSpaceAndAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListAudienceSchedulesFromSpaceAndAudience200Response is not" + + " found in the empty JSON string", + ListAudienceSchedulesFromSpaceAndAudience200Response + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudienceSchedulesFromSpaceAndAudience200Response.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudienceSchedulesFromSpaceAndAudience200Response`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.validateJsonElement( + jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudienceSchedulesFromSpaceAndAudience200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListAudienceSchedulesFromSpaceAndAudience200Response' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListAudienceSchedulesFromSpaceAndAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListAudienceSchedulesFromSpaceAndAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudienceSchedulesFromSpaceAndAudience200Response read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudienceSchedulesFromSpaceAndAudience200Response given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of ListAudienceSchedulesFromSpaceAndAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudience200Response + */ + public static ListAudienceSchedulesFromSpaceAndAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListAudienceSchedulesFromSpaceAndAudience200Response.class); + } + + /** + * Convert an instance of ListAudienceSchedulesFromSpaceAndAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java new file mode 100644 index 00000000..c82c692d --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.java @@ -0,0 +1,254 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for list audience schedules. */ +public class ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput { + public static final String SERIALIZED_NAME_AUDIENCE_SCHEDULES = "audienceSchedules"; + + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCHEDULES) + private List audienceSchedules = new ArrayList<>(); + + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput() {} + + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput audienceSchedules( + List audienceSchedules) { + + this.audienceSchedules = audienceSchedules; + return this; + } + + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput addAudienceSchedulesItem( + AudienceSchedule audienceSchedulesItem) { + if (this.audienceSchedules == null) { + this.audienceSchedules = new ArrayList<>(); + } + this.audienceSchedules.add(audienceSchedulesItem); + return this; + } + + /** + * A list of audience schedules. + * + * @return audienceSchedules + */ + @javax.annotation.Nonnull + public List getAudienceSchedules() { + return audienceSchedules; + } + + public void setAudienceSchedules(List audienceSchedules) { + this.audienceSchedules = audienceSchedules; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + listAudienceSchedulesFromSpaceAndAudienceAlphaOutput = + (ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput) o; + return Objects.equals( + this.audienceSchedules, + listAudienceSchedulesFromSpaceAndAudienceAlphaOutput.audienceSchedules); + } + + @Override + public int hashCode() { + return Objects.hash(audienceSchedules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput {\n"); + sb.append(" audienceSchedules: ") + .append(toIndentedString(audienceSchedules)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("audienceSchedules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("audienceSchedules"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput is not" + + " found in the empty JSON string", + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + .openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiFields.contains( + entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput`" + + " properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("audienceSchedules").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `audienceSchedules` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("audienceSchedules").toString())); + } + + JsonArray jsonArrayaudienceSchedules = jsonObj.getAsJsonArray("audienceSchedules"); + // validate the required field `audienceSchedules` (array) + for (int i = 0; i < jsonArrayaudienceSchedules.size(); i++) { + AudienceSchedule.validateJsonElement(jsonArrayaudienceSchedules.get(i)); + } + ; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput + */ + public static ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput.class); + } + + /** + * Convert an instance of ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java new file mode 100644 index 00000000..2e0d2a0e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java @@ -0,0 +1,207 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Configures a periodic schedule interval. */ +public class PeriodicConfig { + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + private String interval; + + public PeriodicConfig() {} + + public PeriodicConfig interval(String interval) { + + this.interval = interval; + return this; + } + + /** + * Go duration format string, only supporting units \"h\" (hours) and \"m\" + * (minutes). + * + * @return interval + */ + @javax.annotation.Nonnull + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PeriodicConfig periodicConfig = (PeriodicConfig) o; + return Objects.equals(this.interval, periodicConfig.interval); + } + + @Override + public int hashCode() { + return Objects.hash(interval); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PeriodicConfig {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("interval"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PeriodicConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PeriodicConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PeriodicConfig is not found in the" + + " empty JSON string", + PeriodicConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PeriodicConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `PeriodicConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PeriodicConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PeriodicConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PeriodicConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PeriodicConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PeriodicConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PeriodicConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PeriodicConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of PeriodicConfig + * @throws IOException if the JSON string is invalid with respect to PeriodicConfig + */ + public static PeriodicConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PeriodicConfig.class); + } + + /** + * Convert an instance of PeriodicConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java index 9b466492..f8705f0e 100644 --- a/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java +++ b/src/main/java/com/segment/publicapi/models/ReverseEtlScheduleDefinition.java @@ -95,7 +95,7 @@ public StrategyEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_CONFIG = "config"; @SerializedName(SERIALIZED_NAME_CONFIG) - private Config config; + private Config1 config; public ReverseEtlScheduleDefinition() {} @@ -119,7 +119,7 @@ public void setStrategy(StrategyEnum strategy) { this.strategy = strategy; } - public ReverseEtlScheduleDefinition config(Config config) { + public ReverseEtlScheduleDefinition config(Config1 config) { this.config = config; return this; @@ -131,11 +131,11 @@ public ReverseEtlScheduleDefinition config(Config config) { * @return config */ @javax.annotation.Nullable - public Config getConfig() { + public Config1 getConfig() { return config; } - public void setConfig(Config config) { + public void setConfig(Config1 config) { this.config = config; } @@ -259,7 +259,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `config` if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { - Config.validateJsonElement(jsonObj.get("config")); + Config1.validateJsonElement(jsonObj.get("config")); } } diff --git a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java new file mode 100644 index 00000000..c7584e91 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java @@ -0,0 +1,308 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Configures a schedule for specific days and times. */ +public class SpecificDaysConfig { + public static final String SERIALIZED_NAME_DAYS = "days"; + + @SerializedName(SERIALIZED_NAME_DAYS) + private List days = new ArrayList<>(); + + public static final String SERIALIZED_NAME_HOURS = "hours"; + + @SerializedName(SERIALIZED_NAME_HOURS) + private List hours = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TIMEZONE = "timezone"; + + @SerializedName(SERIALIZED_NAME_TIMEZONE) + private String timezone; + + public SpecificDaysConfig() {} + + public SpecificDaysConfig days(List days) { + + this.days = days; + return this; + } + + public SpecificDaysConfig addDaysItem(BigDecimal daysItem) { + if (this.days == null) { + this.days = new ArrayList<>(); + } + this.days.add(daysItem); + return this; + } + + /** + * Days of week for schedule (0=Saturday, 6=Sunday). + * + * @return days + */ + @javax.annotation.Nonnull + public List getDays() { + return days; + } + + public void setDays(List days) { + this.days = days; + } + + public SpecificDaysConfig hours(List hours) { + + this.hours = hours; + return this; + } + + public SpecificDaysConfig addHoursItem(BigDecimal hoursItem) { + if (this.hours == null) { + this.hours = new ArrayList<>(); + } + this.hours.add(hoursItem); + return this; + } + + /** + * Hours of day for schedule (0-23). + * + * @return hours + */ + @javax.annotation.Nonnull + public List getHours() { + return hours; + } + + public void setHours(List hours) { + this.hours = hours; + } + + public SpecificDaysConfig timezone(String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * TZ database time zone identifier; for example, America/New_York. + * + * @return timezone + */ + @javax.annotation.Nonnull + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecificDaysConfig specificDaysConfig = (SpecificDaysConfig) o; + return Objects.equals(this.days, specificDaysConfig.days) + && Objects.equals(this.hours, specificDaysConfig.hours) + && Objects.equals(this.timezone, specificDaysConfig.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(days, hours, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecificDaysConfig {\n"); + sb.append(" days: ").append(toIndentedString(days)).append("\n"); + sb.append(" hours: ").append(toIndentedString(hours)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("days"); + openapiFields.add("hours"); + openapiFields.add("timezone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("days"); + openapiRequiredFields.add("hours"); + openapiRequiredFields.add("timezone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SpecificDaysConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SpecificDaysConfig.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SpecificDaysConfig is not found in the" + + " empty JSON string", + SpecificDaysConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SpecificDaysConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `SpecificDaysConfig` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SpecificDaysConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("days") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("days").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `days` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("days").toString())); + } + // ensure the required json array is present + if (jsonObj.get("hours") == null) { + throw new IllegalArgumentException( + "Expected the field `linkedContent` to be an array in the JSON string but got" + + " `null`"); + } else if (!jsonObj.get("hours").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `hours` to be an array in the JSON string but got" + + " `%s`", + jsonObj.get("hours").toString())); + } + if (!jsonObj.get("timezone").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `timezone` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("timezone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpecificDaysConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpecificDaysConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SpecificDaysConfig.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, SpecificDaysConfig value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpecificDaysConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SpecificDaysConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecificDaysConfig + * @throws IOException if the JSON string is invalid with respect to SpecificDaysConfig + */ + public static SpecificDaysConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecificDaysConfig.class); + } + + /** + * Convert an instance of SpecificDaysConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 44aa0552a1cb9ff13bff48352cc5a917945ad614 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 3 Jul 2025 18:20:51 +0000 Subject: [PATCH 454/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f4de9912. --- docs/AudiencesApi.md | 16 +- docs/DeletionAndSuppressionApi.md | 2 +- src/main/java/com/segment/publicapi/JSON.java | 8 + .../api/DeletionAndSuppressionApi.java | 25 +- .../publicapi/models/AudiencePreview.java | 2 + .../models/AudiencePreviewAccountResult.java | 212 +++++++++++ .../models/AudiencePreviewProfileResult.java | 254 +++++++++++++ .../models/AudiencePreviewResult.java | 333 ++++++++++------- ...nceSummaryWithAudienceTypeAndLookback.java | 33 -- .../CreateAudiencePreviewAlphaInput.java | 10 +- .../publicapi/models/EntityDetails.java | 351 ++++++++++++++++++ .../publicapi/models/PeriodicConfig.java | 4 +- .../publicapi/models/SpecificDaysConfig.java | 2 +- 13 files changed, 1077 insertions(+), 175 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java create mode 100644 src/main/java/com/segment/publicapi/models/EntityDetails.java diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 24b3d4b2..f083ff64 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -196,8 +196,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); System.out.println(result); @@ -219,7 +219,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | ### Return type @@ -348,8 +348,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - String scheduleId = "sch_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); System.out.println(result); @@ -506,7 +506,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); System.out.println(result); @@ -582,7 +582,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); System.out.println(result); @@ -604,7 +604,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | ### Return type diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 855605d7..0409b8fa 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -244,7 +244,7 @@ public class Example { Delete Regulation -Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). +Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: this endpoint has been deprecated according to the guidelines, and may experience reduced SLA guarantees. ### Example diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 247eda5e..d6fbf7d6 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -177,9 +177,15 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewAccountResult + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewProfileResult + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -647,6 +653,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EntityDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 3070d13b..1d56031c 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -699,7 +699,10 @@ public okhttp3.Call createWorkspaceRegulationAsync( * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -763,6 +766,7 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { @@ -779,7 +783,9 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @return DeleteRegulation200Response @@ -793,7 +799,10 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public DeleteRegulation200Response deleteRegulation(String regulateId) throws ApiException { ApiResponse localVarResp = deleteRegulationWithHttpInfo(regulateId); @@ -803,7 +812,9 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -817,7 +828,10 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public ApiResponse deleteRegulationWithHttpInfo(String regulateId) throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, null); @@ -828,7 +842,9 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation * must be in the initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes @@ -843,7 +859,10 @@ public ApiResponse deleteRegulationWithHttpInfo(Str * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public okhttp3.Call deleteRegulationAsync( String regulateId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index c6fd3573..f6f59e60 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -43,6 +43,8 @@ public class AudiencePreview { public enum AudienceTypeEnum { ACCOUNTS("ACCOUNTS"), + LINKED("LINKED"), + USERS("USERS"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java new file mode 100644 index 00000000..c2657ae4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Result membership object for an audience preview with `audienceType: ACCOUNTS`. */ +public class AudiencePreviewAccountResult { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public AudiencePreviewAccountResult() {} + + public AudiencePreviewAccountResult id(String id) { + + this.id = id; + return this; + } + + /** + * Account id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewAccountResult audiencePreviewAccountResult = + (AudiencePreviewAccountResult) o; + return Objects.equals(this.id, audiencePreviewAccountResult.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewAccountResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudiencePreviewAccountResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewAccountResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewAccountResult is not" + + " found in the empty JSON string", + AudiencePreviewAccountResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewAccountResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewAccountResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewAccountResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewAccountResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewAccountResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewAccountResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewAccountResult value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewAccountResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewAccountResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewAccountResult + * @throws IOException if the JSON string is invalid with respect to + * AudiencePreviewAccountResult + */ + public static AudiencePreviewAccountResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewAccountResult.class); + } + + /** + * Convert an instance of AudiencePreviewAccountResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java new file mode 100644 index 00000000..c8fa29f8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java @@ -0,0 +1,254 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Result membership object for an audience preview with `audienceType: USERS` or + * `audienceType: LINKED`. + */ +public class AudiencePreviewProfileResult { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ENTITIES = "entities"; + + @SerializedName(SERIALIZED_NAME_ENTITIES) + private Map> entities; + + public AudiencePreviewProfileResult() {} + + public AudiencePreviewProfileResult id(String id) { + + this.id = id; + return this; + } + + /** + * Segment id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreviewProfileResult entities(Map> entities) { + + this.entities = entities; + return this; + } + + public AudiencePreviewProfileResult putEntitiesItem( + String key, List entitiesItem) { + if (this.entities == null) { + this.entities = new HashMap<>(); + } + this.entities.put(key, entitiesItem); + return this; + } + + /** + * Associated entities. + * + * @return entities + */ + @javax.annotation.Nullable + public Map> getEntities() { + return entities; + } + + public void setEntities(Map> entities) { + this.entities = entities; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewProfileResult audiencePreviewProfileResult = + (AudiencePreviewProfileResult) o; + return Objects.equals(this.id, audiencePreviewProfileResult.id) + && Objects.equals(this.entities, audiencePreviewProfileResult.entities); + } + + @Override + public int hashCode() { + return Objects.hash(id, entities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewProfileResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("entities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudiencePreviewProfileResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewProfileResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewProfileResult is not" + + " found in the empty JSON string", + AudiencePreviewProfileResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewProfileResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewProfileResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewProfileResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewProfileResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewProfileResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewProfileResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewProfileResult value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewProfileResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewProfileResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewProfileResult + * @throws IOException if the JSON string is invalid with respect to + * AudiencePreviewProfileResult + */ + public static AudiencePreviewProfileResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewProfileResult.class); + } + + /** + * Convert an instance of AudiencePreviewProfileResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java index ce5cbfb0..38c3214b 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java @@ -13,97 +13,219 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; -/** Result membership object for an audience preview. */ -public class AudiencePreviewResult { - public static final String SERIALIZED_NAME_ID = "id"; +public class AudiencePreviewResult extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AudiencePreviewResult.class.getName()); - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAudiencePreviewAccountResult = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewAccountResult.class)); + final TypeAdapter adapterAudiencePreviewProfileResult = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewProfileResult.class)); - public AudiencePreviewResult() {} + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewResult value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `AudiencePreviewAccountResult` + if (value.getActualInstance() instanceof AudiencePreviewAccountResult) { + JsonElement element = + adapterAudiencePreviewAccountResult.toJsonTree( + (AudiencePreviewAccountResult) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `AudiencePreviewProfileResult` + if (value.getActualInstance() instanceof AudiencePreviewProfileResult) { + JsonElement element = + adapterAudiencePreviewProfileResult.toJsonTree( + (AudiencePreviewProfileResult) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " AudiencePreviewAccountResult," + + " AudiencePreviewProfileResult"); + } + + @Override + public AudiencePreviewResult read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); - public AudiencePreviewResult id(String id) { + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; - this.id = id; - return this; + // deserialize AudiencePreviewAccountResult + try { + // validate the JSON object to see if any exception is thrown + AudiencePreviewAccountResult.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewAccountResult; + AudiencePreviewResult ret = new AudiencePreviewResult(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudiencePreviewAccountResult" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'AudiencePreviewAccountResult'", + e); + } + // deserialize AudiencePreviewProfileResult + try { + // validate the JSON object to see if any exception is thrown + AudiencePreviewProfileResult.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewProfileResult; + AudiencePreviewResult ret = new AudiencePreviewResult(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudiencePreviewProfileResult" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'AudiencePreviewProfileResult'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for AudiencePreviewResult: no" + + " class matches result, expected at least 1." + + " Detailed failure message for anyOf schemas: %s." + + " JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } } - /** - * Segment id or account id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public AudiencePreviewResult() { + super("anyOf", Boolean.FALSE); } - public void setId(String id) { - this.id = id; + public AudiencePreviewResult(AudiencePreviewAccountResult o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; - return Objects.equals(this.id, audiencePreviewResult.id); + public AudiencePreviewResult(AudiencePreviewProfileResult o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); } - @Override - public int hashCode() { - return Objects.hash(id); + static { + schemas.put("AudiencePreviewAccountResult", AudiencePreviewAccountResult.class); + schemas.put("AudiencePreviewProfileResult", AudiencePreviewProfileResult.class); } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewResult {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); + public Map> getSchemas() { + return AudiencePreviewResult.schemas; } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: AudiencePreviewAccountResult, AudiencePreviewProfileResult + * + *

It could be an instance of the 'anyOf' schemas. */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AudiencePreviewAccountResult) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AudiencePreviewProfileResult) { + super.setActualInstance(instance); + return; } - return o.toString().replace("\n", "\n "); + + throw new RuntimeException( + "Invalid instance type. Must be AudiencePreviewAccountResult," + + " AudiencePreviewProfileResult"); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance, which can be the following: AudiencePreviewAccountResult, + * AudiencePreviewProfileResult + * + * @return The actual instance (AudiencePreviewAccountResult, AudiencePreviewProfileResult) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); + /** + * Get the actual instance of `AudiencePreviewAccountResult`. If the actual instance is not + * `AudiencePreviewAccountResult`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudiencePreviewAccountResult` + * @throws ClassCastException if the instance is not `AudiencePreviewAccountResult` + */ + public AudiencePreviewAccountResult getAudiencePreviewAccountResult() + throws ClassCastException { + return (AudiencePreviewAccountResult) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); + /** + * Get the actual instance of `AudiencePreviewProfileResult`. If the actual instance is not + * `AudiencePreviewProfileResult`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudiencePreviewProfileResult` + * @throws ClassCastException if the instance is not `AudiencePreviewProfileResult` + */ + public AudiencePreviewProfileResult getAudiencePreviewProfileResult() + throws ClassCastException { + return (AudiencePreviewProfileResult) super.getActualInstance(); } /** @@ -113,76 +235,37 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewResult is not found in" - + " the empty JSON string", - AudiencePreviewResult.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewResult` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AudiencePreviewAccountResult + try { + AudiencePreviewAccountResult.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); + "Deserialization for AudiencePreviewAccountResult failed with `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewResult value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with AudiencePreviewProfileResult + try { + AudiencePreviewProfileResult.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AudiencePreviewProfileResult failed with `%s`.", + e.getMessage())); + // continue to the next one } + throw new IOException( + String.format( + "The JSON string is invalid for AudiencePreviewResult with anyOf schemas:" + + " AudiencePreviewAccountResult, AudiencePreviewProfileResult. no" + + " class match the result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index c225d085..30382a29 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -91,11 +91,6 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; - public static final String SERIALIZED_NAME_SIZE = "size"; - - @SerializedName(SERIALIZED_NAME_SIZE) - private AudienceSize size; - public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -209,26 +204,6 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } - public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { - - this.size = size; - return this; - } - - /** - * Get size - * - * @return size - */ - @javax.annotation.Nullable - public AudienceSize getSize() { - return size; - } - - public void setSize(AudienceSize size) { - this.size = size; - } - public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -534,7 +509,6 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) - && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals( this.schedules, audienceSummaryWithAudienceTypeAndLookback.schedules) @@ -563,7 +537,6 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, - size, options, schedules, id, @@ -586,7 +559,6 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); - sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -624,7 +596,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); - openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("schedules"); openapiFields.add("id"); @@ -711,10 +682,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); - // validate the optional field `size` - if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { - AudienceSize.validateJsonElement(jsonObj.get("size")); - } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index 4a1aeaa2..ea591663 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -35,11 +35,16 @@ public class CreateAudiencePreviewAlphaInput { @SerializedName(SERIALIZED_NAME_DEFINITION) private AudienceDefinitionWithoutType definition; - /** Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. */ + /** + * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS, + * LINKED. + */ @JsonAdapter(AudienceTypeEnum.Adapter.class) public enum AudienceTypeEnum { ACCOUNTS("ACCOUNTS"), + LINKED("LINKED"), + USERS("USERS"); private String value; @@ -120,7 +125,8 @@ public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceTyp } /** - * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. + * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS, + * LINKED. * * @return audienceType */ diff --git a/src/main/java/com/segment/publicapi/models/EntityDetails.java b/src/main/java/com/segment/publicapi/models/EntityDetails.java new file mode 100644 index 00000000..b2af7170 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/EntityDetails.java @@ -0,0 +1,351 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Entity details. */ +public class EntityDetails { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ID_PROPERTY = "idProperty"; + + @SerializedName(SERIALIZED_NAME_ID_PROPERTY) + private String idProperty; + + public static final String SERIALIZED_NAME_RELATIONSHIP_SLUG = "relationshipSlug"; + + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_SLUG) + private String relationshipSlug; + + public static final String SERIALIZED_NAME_PROPERTIES = "properties"; + + @SerializedName(SERIALIZED_NAME_PROPERTIES) + private Map properties; + + public static final String SERIALIZED_NAME_ENTITIES = "entities"; + + @SerializedName(SERIALIZED_NAME_ENTITIES) + private Map entities = new HashMap<>(); + + public EntityDetails() {} + + public EntityDetails id(String id) { + + this.id = id; + return this; + } + + /** + * The entity primary key value. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EntityDetails idProperty(String idProperty) { + + this.idProperty = idProperty; + return this; + } + + /** + * The entity primary key column name. + * + * @return idProperty + */ + @javax.annotation.Nonnull + public String getIdProperty() { + return idProperty; + } + + public void setIdProperty(String idProperty) { + this.idProperty = idProperty; + } + + public EntityDetails relationshipSlug(String relationshipSlug) { + + this.relationshipSlug = relationshipSlug; + return this; + } + + /** + * The entity relationship slug. + * + * @return relationshipSlug + */ + @javax.annotation.Nonnull + public String getRelationshipSlug() { + return relationshipSlug; + } + + public void setRelationshipSlug(String relationshipSlug) { + this.relationshipSlug = relationshipSlug; + } + + public EntityDetails properties(Map properties) { + + this.properties = properties; + return this; + } + + public EntityDetails putPropertiesItem(String key, Object propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Entity properties. + * + * @return properties + */ + @javax.annotation.Nullable + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public EntityDetails entities(Map entities) { + + this.entities = entities; + return this; + } + + public EntityDetails putEntitiesItem(String key, Object entitiesItem) { + if (this.entities == null) { + this.entities = new HashMap<>(); + } + this.entities.put(key, entitiesItem); + return this; + } + + /** + * The related entities one level deeper into an entity branch. + * + * @return entities + */ + @javax.annotation.Nullable + public Map getEntities() { + return entities; + } + + public void setEntities(Map entities) { + this.entities = entities; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityDetails entityDetails = (EntityDetails) o; + return Objects.equals(this.id, entityDetails.id) + && Objects.equals(this.idProperty, entityDetails.idProperty) + && Objects.equals(this.relationshipSlug, entityDetails.relationshipSlug) + && Objects.equals(this.properties, entityDetails.properties) + && Objects.equals(this.entities, entityDetails.entities); + } + + @Override + public int hashCode() { + return Objects.hash(id, idProperty, relationshipSlug, properties, entities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityDetails {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" idProperty: ").append(toIndentedString(idProperty)).append("\n"); + sb.append(" relationshipSlug: ").append(toIndentedString(relationshipSlug)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("idProperty"); + openapiFields.add("relationshipSlug"); + openapiFields.add("properties"); + openapiFields.add("entities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("idProperty"); + openapiRequiredFields.add("relationshipSlug"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntityDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EntityDetails.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EntityDetails is not found in the" + + " empty JSON string", + EntityDetails.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EntityDetails.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EntityDetails` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntityDetails.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("idProperty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `idProperty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("idProperty").toString())); + } + if (!jsonObj.get("relationshipSlug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `relationshipSlug` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("relationshipSlug").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EntityDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntityDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EntityDetails.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EntityDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EntityDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EntityDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntityDetails + * @throws IOException if the JSON string is invalid with respect to EntityDetails + */ + public static EntityDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntityDetails.class); + } + + /** + * Convert an instance of EntityDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java index 2e0d2a0e..e5998722 100644 --- a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java +++ b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java @@ -43,8 +43,8 @@ public PeriodicConfig interval(String interval) { } /** - * Go duration format string, only supporting units \"h\" (hours) and \"m\" - * (minutes). + * Go duration format string, only supporting units \"day\" (days), \"h\" + * (hours) and \"m\" (minutes). * * @return interval */ diff --git a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java index c7584e91..cb518213 100644 --- a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java +++ b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java @@ -64,7 +64,7 @@ public SpecificDaysConfig addDaysItem(BigDecimal daysItem) { } /** - * Days of week for schedule (0=Saturday, 6=Sunday). + * Days of week for schedule (0=Sunday, 6=Saturday). * * @return days */ From 63703fc5a62302dcc428b3372a765e6573f19602 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 3 Jul 2025 21:02:10 +0000 Subject: [PATCH 455/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@096ee70e. --- src/main/java/com/segment/publicapi/models/EntityDetails.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/segment/publicapi/models/EntityDetails.java b/src/main/java/com/segment/publicapi/models/EntityDetails.java index b2af7170..58a8516f 100644 --- a/src/main/java/com/segment/publicapi/models/EntityDetails.java +++ b/src/main/java/com/segment/publicapi/models/EntityDetails.java @@ -160,7 +160,8 @@ public EntityDetails putEntitiesItem(String key, Object entitiesItem) { } /** - * The related entities one level deeper into an entity branch. + * Related entities that are one level deeper will only be returned if those entities are + * referenced in the audience definition. * * @return entities */ From cb604956a026d6bc4a29993fc635598964fbc79a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 7 Jul 2025 18:09:12 +0000 Subject: [PATCH 456/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@17f42909. From 1772411f37999b58821417bf5003ac7876332783 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 7 Jul 2025 23:16:33 +0000 Subject: [PATCH 457/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@363053a7. --- README.md | 8 +- docs/AudiencesApi.md | 16 +- docs/CustomerInsightsApi.md | 2 +- docs/DeletionAndSuppressionApi.md | 2 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 8 - .../publicapi/api/CustomerInsightsApi.java | 10 +- .../api/DeletionAndSuppressionApi.java | 25 +- .../publicapi/models/AudiencePreview.java | 2 - .../models/AudiencePreviewAccountResult.java | 212 ----------- .../models/AudiencePreviewProfileResult.java | 254 ------------- .../models/AudiencePreviewResult.java | 333 +++++++---------- .../publicapi/models/AudienceSchedule.java | 37 +- ...nceSummaryWithAudienceTypeAndLookback.java | 33 ++ .../CreateAudiencePreviewAlphaInput.java | 10 +- .../publicapi/models/EntityDetails.java | 352 ------------------ .../publicapi/models/PeriodicConfig.java | 4 +- .../publicapi/models/SpecificDaysConfig.java | 2 +- 20 files changed, 221 insertions(+), 1095 deletions(-) delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java delete mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java delete mode 100644 src/main/java/com/segment/publicapi/models/EntityDetails.java diff --git a/README.md b/README.md index e188e49b..89c18748 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.9.0 +Latest API and SDK version: 58.8.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.9.0 + 58.8.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.9.0" + implementation "com.segment.publicapi:segment-publicapi:58.8.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.9.0.jar` +* `target/segment-publicapi-58.8.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index f083ff64..24b3d4b2 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -196,8 +196,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | - String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); System.out.println(result); @@ -219,7 +219,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type @@ -348,8 +348,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | - String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String scheduleId = "sch_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); System.out.println(result); @@ -506,7 +506,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | try { ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); System.out.println(result); @@ -582,7 +582,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); System.out.println(result); @@ -604,7 +604,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | ### Return type diff --git a/docs/CustomerInsightsApi.md b/docs/CustomerInsightsApi.md index 891b717e..cd15128a 100644 --- a/docs/CustomerInsightsApi.md +++ b/docs/CustomerInsightsApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Download -Create Customer Insights Presigned URLsThe rate limit for this endpoint is 120 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 0409b8fa..855605d7 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -244,7 +244,7 @@ public class Example { Delete Regulation -Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: this endpoint has been deprecated according to the guidelines, and may experience reduced SLA guarantees. +Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). ### Example diff --git a/pom.xml b/pom.xml index 242c5bb7..8e2d30af 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.9.0 + 58.8.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 8bb0364c..6a028ce8 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.9.0 (Java)"); + setUserAgent("Public API SDK 58.8.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index ed947a37..61029765 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.9.0"; + public static final String VERSION = "58.8.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index d6fbf7d6..247eda5e 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -177,15 +177,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewAccountResult - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.AudiencePreviewProfileResult - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -653,8 +647,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.EntityDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java index c1a0a7a5..bcacff81 100644 --- a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java +++ b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java @@ -151,8 +151,8 @@ private okhttp3.Call createDownloadValidateBeforeCall( } /** - * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is - * 120 requests per day per workspaceId, which is lower than the default due to access pattern + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 + * requests per day per workspaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -178,8 +178,8 @@ public CreateDownload200Response createDownload( } /** - * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is - * 120 requests per day per workspaceId, which is lower than the default due to access pattern + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 + * requests per day per workspaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -207,7 +207,7 @@ public ApiResponse createDownloadWithHttpInfo( /** * Create Download (asynchronously) Create Customer Insights Presigned URLsThe rate limit for - * this endpoint is 120 requests per day per workspaceId, which is lower than the default due to + * this endpoint is 30 requests per day per workspaceId, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 1d56031c..3070d13b 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -699,10 +699,7 @@ public okhttp3.Call createWorkspaceRegulationAsync( * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -766,7 +763,6 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c _callback); } - @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { @@ -783,9 +779,7 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: - * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA - * guarantees. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return DeleteRegulation200Response @@ -799,10 +793,7 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public DeleteRegulation200Response deleteRegulation(String regulateId) throws ApiException { ApiResponse localVarResp = deleteRegulationWithHttpInfo(regulateId); @@ -812,9 +803,7 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: - * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA - * guarantees. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -828,10 +817,7 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public ApiResponse deleteRegulationWithHttpInfo(String regulateId) throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, null); @@ -842,9 +828,7 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation * must be in the initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: - * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA - * guarantees. + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). * * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes @@ -859,10 +843,7 @@ public ApiResponse deleteRegulationWithHttpInfo(Str * 422 Validation failure - * 429 Too many requests - * - * - * @deprecated */ - @Deprecated public okhttp3.Call deleteRegulationAsync( String regulateId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index f6f59e60..c6fd3573 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -43,8 +43,6 @@ public class AudiencePreview { public enum AudienceTypeEnum { ACCOUNTS("ACCOUNTS"), - LINKED("LINKED"), - USERS("USERS"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java deleted file mode 100644 index c2657ae4..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Result membership object for an audience preview with `audienceType: ACCOUNTS`. */ -public class AudiencePreviewAccountResult { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public AudiencePreviewAccountResult() {} - - public AudiencePreviewAccountResult id(String id) { - - this.id = id; - return this; - } - - /** - * Account id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewAccountResult audiencePreviewAccountResult = - (AudiencePreviewAccountResult) o; - return Objects.equals(this.id, audiencePreviewAccountResult.id); - } - - @Override - public int hashCode() { - return Objects.hash(id); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewAccountResult {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudiencePreviewAccountResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewAccountResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewAccountResult is not" - + " found in the empty JSON string", - AudiencePreviewAccountResult.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewAccountResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewAccountResult` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewAccountResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewAccountResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewAccountResult' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AudiencePreviewAccountResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewAccountResult value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewAccountResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreviewAccountResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreviewAccountResult - * @throws IOException if the JSON string is invalid with respect to - * AudiencePreviewAccountResult - */ - public static AudiencePreviewAccountResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewAccountResult.class); - } - - /** - * Convert an instance of AudiencePreviewAccountResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java deleted file mode 100644 index c8fa29f8..00000000 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** - * Result membership object for an audience preview with `audienceType: USERS` or - * `audienceType: LINKED`. - */ -public class AudiencePreviewProfileResult { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_ENTITIES = "entities"; - - @SerializedName(SERIALIZED_NAME_ENTITIES) - private Map> entities; - - public AudiencePreviewProfileResult() {} - - public AudiencePreviewProfileResult id(String id) { - - this.id = id; - return this; - } - - /** - * Segment id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AudiencePreviewProfileResult entities(Map> entities) { - - this.entities = entities; - return this; - } - - public AudiencePreviewProfileResult putEntitiesItem( - String key, List entitiesItem) { - if (this.entities == null) { - this.entities = new HashMap<>(); - } - this.entities.put(key, entitiesItem); - return this; - } - - /** - * Associated entities. - * - * @return entities - */ - @javax.annotation.Nullable - public Map> getEntities() { - return entities; - } - - public void setEntities(Map> entities) { - this.entities = entities; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewProfileResult audiencePreviewProfileResult = - (AudiencePreviewProfileResult) o; - return Objects.equals(this.id, audiencePreviewProfileResult.id) - && Objects.equals(this.entities, audiencePreviewProfileResult.entities); - } - - @Override - public int hashCode() { - return Objects.hash(id, entities); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewProfileResult {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("entities"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * AudiencePreviewProfileResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewProfileResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewProfileResult is not" - + " found in the empty JSON string", - AudiencePreviewProfileResult.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewProfileResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewProfileResult` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewProfileResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewProfileResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewProfileResult' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(AudiencePreviewProfileResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewProfileResult value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewProfileResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of AudiencePreviewProfileResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of AudiencePreviewProfileResult - * @throws IOException if the JSON string is invalid with respect to - * AudiencePreviewProfileResult - */ - public static AudiencePreviewProfileResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AudiencePreviewProfileResult.class); - } - - /** - * Convert an instance of AudiencePreviewProfileResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java index 38c3214b..ce5cbfb0 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java @@ -13,219 +13,97 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.HashSet; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.Objects; +import java.util.Set; -public class AudiencePreviewResult extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(AudiencePreviewResult.class.getName()); +/** Result membership object for an audience preview. */ +public class AudiencePreviewResult { + public static final String SERIALIZED_NAME_ID = "id"; - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterAudiencePreviewAccountResult = - gson.getDelegateAdapter( - this, TypeToken.get(AudiencePreviewAccountResult.class)); - final TypeAdapter adapterAudiencePreviewProfileResult = - gson.getDelegateAdapter( - this, TypeToken.get(AudiencePreviewProfileResult.class)); + @SerializedName(SERIALIZED_NAME_ID) + private String id; - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewResult value) - throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type - // `AudiencePreviewAccountResult` - if (value.getActualInstance() instanceof AudiencePreviewAccountResult) { - JsonElement element = - adapterAudiencePreviewAccountResult.toJsonTree( - (AudiencePreviewAccountResult) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type - // `AudiencePreviewProfileResult` - if (value.getActualInstance() instanceof AudiencePreviewProfileResult) { - JsonElement element = - adapterAudiencePreviewProfileResult.toJsonTree( - (AudiencePreviewProfileResult) - value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException( - "Failed to serialize as the type doesn't match anyOf schemae:" - + " AudiencePreviewAccountResult," - + " AudiencePreviewProfileResult"); - } - - @Override - public AudiencePreviewResult read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); + public AudiencePreviewResult() {} - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; + public AudiencePreviewResult id(String id) { - // deserialize AudiencePreviewAccountResult - try { - // validate the JSON object to see if any exception is thrown - AudiencePreviewAccountResult.validateJsonElement(jsonElement); - actualAdapter = adapterAudiencePreviewAccountResult; - AudiencePreviewResult ret = new AudiencePreviewResult(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for AudiencePreviewAccountResult" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'AudiencePreviewAccountResult'", - e); - } - // deserialize AudiencePreviewProfileResult - try { - // validate the JSON object to see if any exception is thrown - AudiencePreviewProfileResult.validateJsonElement(jsonElement); - actualAdapter = adapterAudiencePreviewProfileResult; - AudiencePreviewResult ret = new AudiencePreviewResult(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add( - String.format( - "Deserialization for AudiencePreviewProfileResult" - + " failed with `%s`.", - e.getMessage())); - log.log( - Level.FINER, - "Input data does not match schema" - + " 'AudiencePreviewProfileResult'", - e); - } - - throw new IOException( - String.format( - "Failed deserialization for AudiencePreviewResult: no" - + " class matches result, expected at least 1." - + " Detailed failure message for anyOf schemas: %s." - + " JSON: %s", - errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } + this.id = id; + return this; } - // store a list of schema names defined in anyOf - public static final Map> schemas = new HashMap>(); - - public AudiencePreviewResult() { - super("anyOf", Boolean.FALSE); + /** + * Segment id or account id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; } - public AudiencePreviewResult(AudiencePreviewAccountResult o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); + public void setId(String id) { + this.id = id; } - public AudiencePreviewResult(AudiencePreviewProfileResult o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; + return Objects.equals(this.id, audiencePreviewResult.id); } - static { - schemas.put("AudiencePreviewAccountResult", AudiencePreviewAccountResult.class); - schemas.put("AudiencePreviewProfileResult", AudiencePreviewProfileResult.class); + @Override + public int hashCode() { + return Objects.hash(id); } @Override - public Map> getSchemas() { - return AudiencePreviewResult.schemas; + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); } /** - * Set the instance that matches the anyOf child schema, check the instance parameter is valid - * against the anyOf child schemas: AudiencePreviewAccountResult, AudiencePreviewProfileResult - * - *

It could be an instance of the 'anyOf' schemas. + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof AudiencePreviewAccountResult) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof AudiencePreviewProfileResult) { - super.setActualInstance(instance); - return; + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - - throw new RuntimeException( - "Invalid instance type. Must be AudiencePreviewAccountResult," - + " AudiencePreviewProfileResult"); + return o.toString().replace("\n", "\n "); } - /** - * Get the actual instance, which can be the following: AudiencePreviewAccountResult, - * AudiencePreviewProfileResult - * - * @return The actual instance (AudiencePreviewAccountResult, AudiencePreviewProfileResult) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; - /** - * Get the actual instance of `AudiencePreviewAccountResult`. If the actual instance is not - * `AudiencePreviewAccountResult`, the ClassCastException will be thrown. - * - * @return The actual instance of `AudiencePreviewAccountResult` - * @throws ClassCastException if the instance is not `AudiencePreviewAccountResult` - */ - public AudiencePreviewAccountResult getAudiencePreviewAccountResult() - throws ClassCastException { - return (AudiencePreviewAccountResult) super.getActualInstance(); - } + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); - /** - * Get the actual instance of `AudiencePreviewProfileResult`. If the actual instance is not - * `AudiencePreviewProfileResult`, the ClassCastException will be thrown. - * - * @return The actual instance of `AudiencePreviewProfileResult` - * @throws ClassCastException if the instance is not `AudiencePreviewProfileResult` - */ - public AudiencePreviewProfileResult getAudiencePreviewProfileResult() - throws ClassCastException { - return (AudiencePreviewProfileResult) super.getActualInstance(); + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); } /** @@ -235,37 +113,76 @@ public AudiencePreviewProfileResult getAudiencePreviewProfileResult() * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate anyOf schemas one by one - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with AudiencePreviewAccountResult - try { - AudiencePreviewAccountResult.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( - String.format( - "Deserialization for AudiencePreviewAccountResult failed with `%s`.", - e.getMessage())); - // continue to the next one + if (jsonElement == null) { + if (!AudiencePreviewResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewResult is not found in" + + " the empty JSON string", + AudiencePreviewResult.openapiRequiredFields.toString())); + } } - // validate the json string with AudiencePreviewProfileResult - try { - AudiencePreviewProfileResult.validateJsonElement(jsonElement); - return; - } catch (Exception e) { - errorMessages.add( + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( String.format( - "Deserialization for AudiencePreviewProfileResult failed with `%s`.", - e.getMessage())); - // continue to the next one + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewResult value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); } - throw new IOException( - String.format( - "The JSON string is invalid for AudiencePreviewResult with anyOf schemas:" - + " AudiencePreviewAccountResult, AudiencePreviewProfileResult. no" - + " class match the result, expected at least 1. Detailed failure" - + " message for anyOf schemas: %s. JSON: %s", - errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java index e2430a2e..043245e1 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java @@ -95,6 +95,11 @@ public StrategyEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CONFIG) private Config config; + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + public static final String SERIALIZED_NAME_NEXT_EXECUTION = "nextExecution"; @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION) @@ -162,6 +167,26 @@ public void setConfig(Config config) { this.config = config; } + public AudienceSchedule enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether the schedule is enabled. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + public AudienceSchedule nextExecution(String nextExecution) { this.nextExecution = nextExecution; @@ -173,7 +198,7 @@ public AudienceSchedule nextExecution(String nextExecution) { * * @return nextExecution */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getNextExecution() { return nextExecution; } @@ -194,6 +219,7 @@ public boolean equals(Object o) { return Objects.equals(this.id, audienceSchedule.id) && Objects.equals(this.strategy, audienceSchedule.strategy) && Objects.equals(this.config, audienceSchedule.config) + && Objects.equals(this.enabled, audienceSchedule.enabled) && Objects.equals(this.nextExecution, audienceSchedule.nextExecution); } @@ -208,7 +234,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, strategy, config, nextExecution); + return Objects.hash(id, strategy, config, enabled, nextExecution); } private static int hashCodeNullable(JsonNullable a) { @@ -225,6 +251,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" nextExecution: ").append(toIndentedString(nextExecution)).append("\n"); sb.append("}"); return sb.toString(); @@ -250,12 +277,15 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("strategy"); openapiFields.add("config"); + openapiFields.add("enabled"); openapiFields.add("nextExecution"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); openapiRequiredFields.add("strategy"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("nextExecution"); } /** @@ -316,8 +346,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { Config.validateJsonElement(jsonObj.get("config")); } - if ((jsonObj.get("nextExecution") != null && !jsonObj.get("nextExecution").isJsonNull()) - && !jsonObj.get("nextExecution").isJsonPrimitive()) { + if (!jsonObj.get("nextExecution").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `nextExecution` to be a primitive type in the JSON" diff --git a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java index 30382a29..c225d085 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSummaryWithAudienceTypeAndLookback.java @@ -91,6 +91,11 @@ public AudienceTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTE_CADENCE) private AudienceComputeCadence computeCadence; + public static final String SERIALIZED_NAME_SIZE = "size"; + + @SerializedName(SERIALIZED_NAME_SIZE) + private AudienceSize size; + public static final String SERIALIZED_NAME_OPTIONS = "options"; @SerializedName(SERIALIZED_NAME_OPTIONS) @@ -204,6 +209,26 @@ public void setComputeCadence(AudienceComputeCadence computeCadence) { this.computeCadence = computeCadence; } + public AudienceSummaryWithAudienceTypeAndLookback size(AudienceSize size) { + + this.size = size; + return this; + } + + /** + * Get size + * + * @return size + */ + @javax.annotation.Nullable + public AudienceSize getSize() { + return size; + } + + public void setSize(AudienceSize size) { + this.size = size; + } + public AudienceSummaryWithAudienceTypeAndLookback options(AudienceOptionsWithLookback options) { this.options = options; @@ -509,6 +534,7 @@ public boolean equals(Object o) { && Objects.equals( this.computeCadence, audienceSummaryWithAudienceTypeAndLookback.computeCadence) + && Objects.equals(this.size, audienceSummaryWithAudienceTypeAndLookback.size) && Objects.equals(this.options, audienceSummaryWithAudienceTypeAndLookback.options) && Objects.equals( this.schedules, audienceSummaryWithAudienceTypeAndLookback.schedules) @@ -537,6 +563,7 @@ public int hashCode() { return Objects.hash( audienceType, computeCadence, + size, options, schedules, id, @@ -559,6 +586,7 @@ public String toString() { sb.append("class AudienceSummaryWithAudienceTypeAndLookback {\n"); sb.append(" audienceType: ").append(toIndentedString(audienceType)).append("\n"); sb.append(" computeCadence: ").append(toIndentedString(computeCadence)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); @@ -596,6 +624,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("audienceType"); openapiFields.add("computeCadence"); + openapiFields.add("size"); openapiFields.add("options"); openapiFields.add("schedules"); openapiFields.add("id"); @@ -682,6 +711,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `computeCadence` AudienceComputeCadence.validateJsonElement(jsonObj.get("computeCadence")); + // validate the optional field `size` + if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonNull()) { + AudienceSize.validateJsonElement(jsonObj.get("size")); + } // validate the optional field `options` if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull()) { AudienceOptionsWithLookback.validateJsonElement(jsonObj.get("options")); diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index ea591663..4a1aeaa2 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -35,16 +35,11 @@ public class CreateAudiencePreviewAlphaInput { @SerializedName(SERIALIZED_NAME_DEFINITION) private AudienceDefinitionWithoutType definition; - /** - * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS, - * LINKED. - */ + /** Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. */ @JsonAdapter(AudienceTypeEnum.Adapter.class) public enum AudienceTypeEnum { ACCOUNTS("ACCOUNTS"), - LINKED("LINKED"), - USERS("USERS"); private String value; @@ -125,8 +120,7 @@ public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceTyp } /** - * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS, - * LINKED. + * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. * * @return audienceType */ diff --git a/src/main/java/com/segment/publicapi/models/EntityDetails.java b/src/main/java/com/segment/publicapi/models/EntityDetails.java deleted file mode 100644 index 58a8516f..00000000 --- a/src/main/java/com/segment/publicapi/models/EntityDetails.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Segment Public API - * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. - * - * Contact: friends@segment.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.segment.publicapi.models; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.segment.publicapi.JSON; -import java.io.IOException; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -/** Entity details. */ -public class EntityDetails { - public static final String SERIALIZED_NAME_ID = "id"; - - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_ID_PROPERTY = "idProperty"; - - @SerializedName(SERIALIZED_NAME_ID_PROPERTY) - private String idProperty; - - public static final String SERIALIZED_NAME_RELATIONSHIP_SLUG = "relationshipSlug"; - - @SerializedName(SERIALIZED_NAME_RELATIONSHIP_SLUG) - private String relationshipSlug; - - public static final String SERIALIZED_NAME_PROPERTIES = "properties"; - - @SerializedName(SERIALIZED_NAME_PROPERTIES) - private Map properties; - - public static final String SERIALIZED_NAME_ENTITIES = "entities"; - - @SerializedName(SERIALIZED_NAME_ENTITIES) - private Map entities = new HashMap<>(); - - public EntityDetails() {} - - public EntityDetails id(String id) { - - this.id = id; - return this; - } - - /** - * The entity primary key value. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public EntityDetails idProperty(String idProperty) { - - this.idProperty = idProperty; - return this; - } - - /** - * The entity primary key column name. - * - * @return idProperty - */ - @javax.annotation.Nonnull - public String getIdProperty() { - return idProperty; - } - - public void setIdProperty(String idProperty) { - this.idProperty = idProperty; - } - - public EntityDetails relationshipSlug(String relationshipSlug) { - - this.relationshipSlug = relationshipSlug; - return this; - } - - /** - * The entity relationship slug. - * - * @return relationshipSlug - */ - @javax.annotation.Nonnull - public String getRelationshipSlug() { - return relationshipSlug; - } - - public void setRelationshipSlug(String relationshipSlug) { - this.relationshipSlug = relationshipSlug; - } - - public EntityDetails properties(Map properties) { - - this.properties = properties; - return this; - } - - public EntityDetails putPropertiesItem(String key, Object propertiesItem) { - if (this.properties == null) { - this.properties = new HashMap<>(); - } - this.properties.put(key, propertiesItem); - return this; - } - - /** - * Entity properties. - * - * @return properties - */ - @javax.annotation.Nullable - public Map getProperties() { - return properties; - } - - public void setProperties(Map properties) { - this.properties = properties; - } - - public EntityDetails entities(Map entities) { - - this.entities = entities; - return this; - } - - public EntityDetails putEntitiesItem(String key, Object entitiesItem) { - if (this.entities == null) { - this.entities = new HashMap<>(); - } - this.entities.put(key, entitiesItem); - return this; - } - - /** - * Related entities that are one level deeper will only be returned if those entities are - * referenced in the audience definition. - * - * @return entities - */ - @javax.annotation.Nullable - public Map getEntities() { - return entities; - } - - public void setEntities(Map entities) { - this.entities = entities; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EntityDetails entityDetails = (EntityDetails) o; - return Objects.equals(this.id, entityDetails.id) - && Objects.equals(this.idProperty, entityDetails.idProperty) - && Objects.equals(this.relationshipSlug, entityDetails.relationshipSlug) - && Objects.equals(this.properties, entityDetails.properties) - && Objects.equals(this.entities, entityDetails.entities); - } - - @Override - public int hashCode() { - return Objects.hash(id, idProperty, relationshipSlug, properties, entities); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EntityDetails {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" idProperty: ").append(toIndentedString(idProperty)).append("\n"); - sb.append(" relationshipSlug: ").append(toIndentedString(relationshipSlug)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("idProperty"); - openapiFields.add("relationshipSlug"); - openapiFields.add("properties"); - openapiFields.add("entities"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("idProperty"); - openapiRequiredFields.add("relationshipSlug"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EntityDetails - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EntityDetails.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in EntityDetails is not found in the" - + " empty JSON string", - EntityDetails.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EntityDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `EntityDetails` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EntityDetails.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); - } - if (!jsonObj.get("idProperty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `idProperty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("idProperty").toString())); - } - if (!jsonObj.get("relationshipSlug").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `relationshipSlug` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("relationshipSlug").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EntityDetails.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EntityDetails' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(EntityDetails.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, EntityDetails value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EntityDetails read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of EntityDetails given an JSON string - * - * @param jsonString JSON string - * @return An instance of EntityDetails - * @throws IOException if the JSON string is invalid with respect to EntityDetails - */ - public static EntityDetails fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EntityDetails.class); - } - - /** - * Convert an instance of EntityDetails to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java index e5998722..2e0d2a0e 100644 --- a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java +++ b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java @@ -43,8 +43,8 @@ public PeriodicConfig interval(String interval) { } /** - * Go duration format string, only supporting units \"day\" (days), \"h\" - * (hours) and \"m\" (minutes). + * Go duration format string, only supporting units \"h\" (hours) and \"m\" + * (minutes). * * @return interval */ diff --git a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java index cb518213..c7584e91 100644 --- a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java +++ b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java @@ -64,7 +64,7 @@ public SpecificDaysConfig addDaysItem(BigDecimal daysItem) { } /** - * Days of week for schedule (0=Sunday, 6=Saturday). + * Days of week for schedule (0=Saturday, 6=Sunday). * * @return days */ From cb75ea37c18de6ff9918f1fb8e055c6e30f2d9c2 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 8 Jul 2025 20:50:19 +0000 Subject: [PATCH 458/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@363053a7. From 1e15dbcf2bcf0a90de8aaf7258880e197b8e07c6 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 8 Jul 2025 20:58:34 +0000 Subject: [PATCH 459/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@e2ed8a0b. From f6e90bdd527df422e0c39674fe3c4ee0aeca0969 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 9 Jul 2025 19:20:59 +0000 Subject: [PATCH 460/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@9a5f1c29. --- README.md | 8 +- docs/AudiencesApi.md | 16 +- docs/CustomerInsightsApi.md | 2 +- docs/DeletionAndSuppressionApi.md | 2 +- pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 8 + .../publicapi/api/CustomerInsightsApi.java | 10 +- .../api/DeletionAndSuppressionApi.java | 25 +- .../publicapi/models/AudiencePreview.java | 2 + .../models/AudiencePreviewAccountResult.java | 212 +++++++++++ .../models/AudiencePreviewProfileResult.java | 254 +++++++++++++ .../models/AudiencePreviewResult.java | 333 ++++++++++------- .../publicapi/models/AudienceSchedule.java | 37 +- .../CreateAudiencePreviewAlphaInput.java | 10 +- .../publicapi/models/EntityDetails.java | 352 ++++++++++++++++++ .../publicapi/models/PeriodicConfig.java | 4 +- .../publicapi/models/SpecificDaysConfig.java | 2 +- 19 files changed, 1095 insertions(+), 188 deletions(-) create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java create mode 100644 src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java create mode 100644 src/main/java/com/segment/publicapi/models/EntityDetails.java diff --git a/README.md b/README.md index 89c18748..9c6c69a0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.8.0 +Latest API and SDK version: 58.11.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.8.0 + 58.11.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.8.0" + implementation "com.segment.publicapi:segment-publicapi:58.11.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.8.0.jar` +* `target/segment-publicapi-58.11.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index 24b3d4b2..f083ff64 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -196,8 +196,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { GetAudience200Response result = apiInstance.getAudience(spaceId, id, include); System.out.println(result); @@ -219,7 +219,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **id** | **String**| | | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | ### Return type @@ -348,8 +348,8 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | - String scheduleId = "sch_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String scheduleId = "sch_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { GetAudienceScheduleFromSpaceAndAudience200Response result = apiInstance.getAudienceScheduleFromSpaceAndAudience(spaceId, id, scheduleId); System.out.println(result); @@ -506,7 +506,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | - String id = "aud_171sV3fzJkiY2PnlbpMZJRbrgSW"; // String | + String id = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | try { ListAudienceSchedulesFromSpaceAndAudience200Response result = apiInstance.listAudienceSchedulesFromSpaceAndAudience(spaceId, id); System.out.println(result); @@ -582,7 +582,7 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - String include = "include_example"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. + String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); System.out.println(result); @@ -604,7 +604,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | | **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] | +| **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | ### Return type diff --git a/docs/CustomerInsightsApi.md b/docs/CustomerInsightsApi.md index cd15128a..891b717e 100644 --- a/docs/CustomerInsightsApi.md +++ b/docs/CustomerInsightsApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.segmentapis.com* Create Download -Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. +Create Customer Insights Presigned URLsThe rate limit for this endpoint is 120 requests per day per workspaceId, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/docs/DeletionAndSuppressionApi.md b/docs/DeletionAndSuppressionApi.md index 855605d7..0409b8fa 100644 --- a/docs/DeletionAndSuppressionApi.md +++ b/docs/DeletionAndSuppressionApi.md @@ -244,7 +244,7 @@ public class Example { Delete Regulation -Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). +Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. • When called, this endpoint may generate the `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: this endpoint has been deprecated according to the guidelines, and may experience reduced SLA guarantees. ### Example diff --git a/pom.xml b/pom.xml index 8e2d30af..15dfaa35 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.8.0 + 58.11.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 6a028ce8..79512d53 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.8.0 (Java)"); + setUserAgent("Public API SDK 58.11.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index 61029765..e7ab1929 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.8.0"; + public static final String VERSION = "58.11.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index 247eda5e..d6fbf7d6 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -177,9 +177,15 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreview.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewAccountResult + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewIdentifier .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AudiencePreviewProfileResult + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AudiencePreviewResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -647,6 +653,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.EchoV1Output.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EdgeFunctionsAlpha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.EntityDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.EventSourceV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( diff --git a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java index bcacff81..c1a0a7a5 100644 --- a/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java +++ b/src/main/java/com/segment/publicapi/api/CustomerInsightsApi.java @@ -151,8 +151,8 @@ private okhttp3.Call createDownloadValidateBeforeCall( } /** - * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 - * requests per day per workspaceId, which is lower than the default due to access pattern + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is + * 120 requests per day per workspaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -178,8 +178,8 @@ public CreateDownload200Response createDownload( } /** - * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is 30 - * requests per day per workspaceId, which is lower than the default due to access pattern + * Create Download Create Customer Insights Presigned URLsThe rate limit for this endpoint is + * 120 requests per day per workspaceId, which is lower than the default due to access pattern * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more * information. @@ -207,7 +207,7 @@ public ApiResponse createDownloadWithHttpInfo( /** * Create Download (asynchronously) Create Customer Insights Presigned URLsThe rate limit for - * this endpoint is 30 requests per day per workspaceId, which is lower than the default due to + * this endpoint is 120 requests per day per workspaceId, which is lower than the default due to * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. diff --git a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java index 3070d13b..1d56031c 100644 --- a/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java +++ b/src/main/java/com/segment/publicapi/api/DeletionAndSuppressionApi.java @@ -699,7 +699,10 @@ public okhttp3.Call createWorkspaceRegulationAsync( * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _callback) throws ApiException { String basePath = null; @@ -763,6 +766,7 @@ public okhttp3.Call deleteRegulationCall(String regulateId, final ApiCallback _c _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call deleteRegulationValidateBeforeCall( String regulateId, final ApiCallback _callback) throws ApiException { @@ -779,7 +783,9 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @return DeleteRegulation200Response @@ -793,7 +799,10 @@ private okhttp3.Call deleteRegulationValidateBeforeCall( * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public DeleteRegulation200Response deleteRegulation(String regulateId) throws ApiException { ApiResponse localVarResp = deleteRegulationWithHttpInfo(regulateId); @@ -803,7 +812,9 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap /** * Delete Regulation Deletes a regulation from the Workspace. The regulation must be in the * initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @return ApiResponse<DeleteRegulation200Response> @@ -817,7 +828,10 @@ public DeleteRegulation200Response deleteRegulation(String regulateId) throws Ap * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public ApiResponse deleteRegulationWithHttpInfo(String regulateId) throws ApiException { okhttp3.Call localVarCall = deleteRegulationValidateBeforeCall(regulateId, null); @@ -828,7 +842,9 @@ public ApiResponse deleteRegulationWithHttpInfo(Str /** * Delete Regulation (asynchronously) Deletes a regulation from the Workspace. The regulation * must be in the initialized state to be deleted. • When called, this endpoint may generate the - * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). + * `Regulation Deleted` event in the [audit trail](/tag/Audit-Trail). **DEPRECATED**: + * this endpoint has been deprecated according to the guidelines, and may experience reduced SLA + * guarantees. * * @param regulateId (required) * @param _callback The callback to be executed when the API call finishes @@ -843,7 +859,10 @@ public ApiResponse deleteRegulationWithHttpInfo(Str * 422 Validation failure - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public okhttp3.Call deleteRegulationAsync( String regulateId, final ApiCallback _callback) throws ApiException { diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreview.java b/src/main/java/com/segment/publicapi/models/AudiencePreview.java index c6fd3573..f6f59e60 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreview.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreview.java @@ -43,6 +43,8 @@ public class AudiencePreview { public enum AudienceTypeEnum { ACCOUNTS("ACCOUNTS"), + LINKED("LINKED"), + USERS("USERS"); private String value; diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java new file mode 100644 index 00000000..c2657ae4 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewAccountResult.java @@ -0,0 +1,212 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Result membership object for an audience preview with `audienceType: ACCOUNTS`. */ +public class AudiencePreviewAccountResult { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public AudiencePreviewAccountResult() {} + + public AudiencePreviewAccountResult id(String id) { + + this.id = id; + return this; + } + + /** + * Account id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewAccountResult audiencePreviewAccountResult = + (AudiencePreviewAccountResult) o; + return Objects.equals(this.id, audiencePreviewAccountResult.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewAccountResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudiencePreviewAccountResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewAccountResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewAccountResult is not" + + " found in the empty JSON string", + AudiencePreviewAccountResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewAccountResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewAccountResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewAccountResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewAccountResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewAccountResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewAccountResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewAccountResult value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewAccountResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewAccountResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewAccountResult + * @throws IOException if the JSON string is invalid with respect to + * AudiencePreviewAccountResult + */ + public static AudiencePreviewAccountResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewAccountResult.class); + } + + /** + * Convert an instance of AudiencePreviewAccountResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java new file mode 100644 index 00000000..c8fa29f8 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewProfileResult.java @@ -0,0 +1,254 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Result membership object for an audience preview with `audienceType: USERS` or + * `audienceType: LINKED`. + */ +public class AudiencePreviewProfileResult { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ENTITIES = "entities"; + + @SerializedName(SERIALIZED_NAME_ENTITIES) + private Map> entities; + + public AudiencePreviewProfileResult() {} + + public AudiencePreviewProfileResult id(String id) { + + this.id = id; + return this; + } + + /** + * Segment id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AudiencePreviewProfileResult entities(Map> entities) { + + this.entities = entities; + return this; + } + + public AudiencePreviewProfileResult putEntitiesItem( + String key, List entitiesItem) { + if (this.entities == null) { + this.entities = new HashMap<>(); + } + this.entities.put(key, entitiesItem); + return this; + } + + /** + * Associated entities. + * + * @return entities + */ + @javax.annotation.Nullable + public Map> getEntities() { + return entities; + } + + public void setEntities(Map> entities) { + this.entities = entities; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudiencePreviewProfileResult audiencePreviewProfileResult = + (AudiencePreviewProfileResult) o; + return Objects.equals(this.id, audiencePreviewProfileResult.id) + && Objects.equals(this.entities, audiencePreviewProfileResult.entities); + } + + @Override + public int hashCode() { + return Objects.hash(id, entities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudiencePreviewProfileResult {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("entities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AudiencePreviewProfileResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AudiencePreviewProfileResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AudiencePreviewProfileResult is not" + + " found in the empty JSON string", + AudiencePreviewProfileResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AudiencePreviewProfileResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AudiencePreviewProfileResult` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AudiencePreviewProfileResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewProfileResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewProfileResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewProfileResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewProfileResult value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AudiencePreviewProfileResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AudiencePreviewProfileResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of AudiencePreviewProfileResult + * @throws IOException if the JSON string is invalid with respect to + * AudiencePreviewProfileResult + */ + public static AudiencePreviewProfileResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AudiencePreviewProfileResult.class); + } + + /** + * Convert an instance of AudiencePreviewProfileResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java index ce5cbfb0..38c3214b 100644 --- a/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java +++ b/src/main/java/com/segment/publicapi/models/AudiencePreviewResult.java @@ -13,97 +13,219 @@ import com.google.gson.Gson; import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.segment.publicapi.JSON; import java.io.IOException; -import java.util.HashSet; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; -/** Result membership object for an audience preview. */ -public class AudiencePreviewResult { - public static final String SERIALIZED_NAME_ID = "id"; +public class AudiencePreviewResult extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AudiencePreviewResult.class.getName()); - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AudiencePreviewResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAudiencePreviewAccountResult = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewAccountResult.class)); + final TypeAdapter adapterAudiencePreviewProfileResult = + gson.getDelegateAdapter( + this, TypeToken.get(AudiencePreviewProfileResult.class)); - public AudiencePreviewResult() {} + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AudiencePreviewResult value) + throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type + // `AudiencePreviewAccountResult` + if (value.getActualInstance() instanceof AudiencePreviewAccountResult) { + JsonElement element = + adapterAudiencePreviewAccountResult.toJsonTree( + (AudiencePreviewAccountResult) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type + // `AudiencePreviewProfileResult` + if (value.getActualInstance() instanceof AudiencePreviewProfileResult) { + JsonElement element = + adapterAudiencePreviewProfileResult.toJsonTree( + (AudiencePreviewProfileResult) + value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException( + "Failed to serialize as the type doesn't match anyOf schemae:" + + " AudiencePreviewAccountResult," + + " AudiencePreviewProfileResult"); + } + + @Override + public AudiencePreviewResult read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); - public AudiencePreviewResult id(String id) { + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; - this.id = id; - return this; + // deserialize AudiencePreviewAccountResult + try { + // validate the JSON object to see if any exception is thrown + AudiencePreviewAccountResult.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewAccountResult; + AudiencePreviewResult ret = new AudiencePreviewResult(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudiencePreviewAccountResult" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'AudiencePreviewAccountResult'", + e); + } + // deserialize AudiencePreviewProfileResult + try { + // validate the JSON object to see if any exception is thrown + AudiencePreviewProfileResult.validateJsonElement(jsonElement); + actualAdapter = adapterAudiencePreviewProfileResult; + AudiencePreviewResult ret = new AudiencePreviewResult(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add( + String.format( + "Deserialization for AudiencePreviewProfileResult" + + " failed with `%s`.", + e.getMessage())); + log.log( + Level.FINER, + "Input data does not match schema" + + " 'AudiencePreviewProfileResult'", + e); + } + + throw new IOException( + String.format( + "Failed deserialization for AudiencePreviewResult: no" + + " class matches result, expected at least 1." + + " Detailed failure message for anyOf schemas: %s." + + " JSON: %s", + errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } } - /** - * Segment id or account id. - * - * @return id - */ - @javax.annotation.Nonnull - public String getId() { - return id; + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public AudiencePreviewResult() { + super("anyOf", Boolean.FALSE); } - public void setId(String id) { - this.id = id; + public AudiencePreviewResult(AudiencePreviewAccountResult o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AudiencePreviewResult audiencePreviewResult = (AudiencePreviewResult) o; - return Objects.equals(this.id, audiencePreviewResult.id); + public AudiencePreviewResult(AudiencePreviewProfileResult o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); } - @Override - public int hashCode() { - return Objects.hash(id); + static { + schemas.put("AudiencePreviewAccountResult", AudiencePreviewAccountResult.class); + schemas.put("AudiencePreviewProfileResult", AudiencePreviewProfileResult.class); } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AudiencePreviewResult {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append("}"); - return sb.toString(); + public Map> getSchemas() { + return AudiencePreviewResult.schemas; } /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: AudiencePreviewAccountResult, AudiencePreviewProfileResult + * + *

It could be an instance of the 'anyOf' schemas. */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AudiencePreviewAccountResult) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AudiencePreviewProfileResult) { + super.setActualInstance(instance); + return; } - return o.toString().replace("\n", "\n "); + + throw new RuntimeException( + "Invalid instance type. Must be AudiencePreviewAccountResult," + + " AudiencePreviewProfileResult"); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; + /** + * Get the actual instance, which can be the following: AudiencePreviewAccountResult, + * AudiencePreviewProfileResult + * + * @return The actual instance (AudiencePreviewAccountResult, AudiencePreviewProfileResult) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); + /** + * Get the actual instance of `AudiencePreviewAccountResult`. If the actual instance is not + * `AudiencePreviewAccountResult`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudiencePreviewAccountResult` + * @throws ClassCastException if the instance is not `AudiencePreviewAccountResult` + */ + public AudiencePreviewAccountResult getAudiencePreviewAccountResult() + throws ClassCastException { + return (AudiencePreviewAccountResult) super.getActualInstance(); + } - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); + /** + * Get the actual instance of `AudiencePreviewProfileResult`. If the actual instance is not + * `AudiencePreviewProfileResult`, the ClassCastException will be thrown. + * + * @return The actual instance of `AudiencePreviewProfileResult` + * @throws ClassCastException if the instance is not `AudiencePreviewProfileResult` + */ + public AudiencePreviewProfileResult getAudiencePreviewProfileResult() + throws ClassCastException { + return (AudiencePreviewProfileResult) super.getActualInstance(); } /** @@ -113,76 +235,37 @@ private String toIndentedString(Object o) { * @throws IOException if the JSON Element is invalid with respect to AudiencePreviewResult */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AudiencePreviewResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in AudiencePreviewResult is not found in" - + " the empty JSON string", - AudiencePreviewResult.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AudiencePreviewResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException( - String.format( - "The field `%s` in the JSON string is not defined in the" - + " `AudiencePreviewResult` properties. JSON: %s", - entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AudiencePreviewResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException( + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AudiencePreviewAccountResult + try { + AudiencePreviewAccountResult.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( String.format( - "Expected the field `id` to be a primitive type in the JSON string but" - + " got `%s`", - jsonObj.get("id").toString())); + "Deserialization for AudiencePreviewAccountResult failed with `%s`.", + e.getMessage())); + // continue to the next one } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AudiencePreviewResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AudiencePreviewResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(AudiencePreviewResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, AudiencePreviewResult value) - throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AudiencePreviewResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); + // validate the json string with AudiencePreviewProfileResult + try { + AudiencePreviewProfileResult.validateJsonElement(jsonElement); + return; + } catch (Exception e) { + errorMessages.add( + String.format( + "Deserialization for AudiencePreviewProfileResult failed with `%s`.", + e.getMessage())); + // continue to the next one } + throw new IOException( + String.format( + "The JSON string is invalid for AudiencePreviewResult with anyOf schemas:" + + " AudiencePreviewAccountResult, AudiencePreviewProfileResult. no" + + " class match the result, expected at least 1. Detailed failure" + + " message for anyOf schemas: %s. JSON: %s", + errorMessages, jsonElement.toString())); } /** diff --git a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java index 043245e1..e2430a2e 100644 --- a/src/main/java/com/segment/publicapi/models/AudienceSchedule.java +++ b/src/main/java/com/segment/publicapi/models/AudienceSchedule.java @@ -95,11 +95,6 @@ public StrategyEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CONFIG) private Config config; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; - - @SerializedName(SERIALIZED_NAME_ENABLED) - private Boolean enabled; - public static final String SERIALIZED_NAME_NEXT_EXECUTION = "nextExecution"; @SerializedName(SERIALIZED_NAME_NEXT_EXECUTION) @@ -167,26 +162,6 @@ public void setConfig(Config config) { this.config = config; } - public AudienceSchedule enabled(Boolean enabled) { - - this.enabled = enabled; - return this; - } - - /** - * Whether the schedule is enabled. - * - * @return enabled - */ - @javax.annotation.Nonnull - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - public AudienceSchedule nextExecution(String nextExecution) { this.nextExecution = nextExecution; @@ -198,7 +173,7 @@ public AudienceSchedule nextExecution(String nextExecution) { * * @return nextExecution */ - @javax.annotation.Nonnull + @javax.annotation.Nullable public String getNextExecution() { return nextExecution; } @@ -219,7 +194,6 @@ public boolean equals(Object o) { return Objects.equals(this.id, audienceSchedule.id) && Objects.equals(this.strategy, audienceSchedule.strategy) && Objects.equals(this.config, audienceSchedule.config) - && Objects.equals(this.enabled, audienceSchedule.enabled) && Objects.equals(this.nextExecution, audienceSchedule.nextExecution); } @@ -234,7 +208,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, strategy, config, enabled, nextExecution); + return Objects.hash(id, strategy, config, nextExecution); } private static int hashCodeNullable(JsonNullable a) { @@ -251,7 +225,6 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); sb.append(" config: ").append(toIndentedString(config)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" nextExecution: ").append(toIndentedString(nextExecution)).append("\n"); sb.append("}"); return sb.toString(); @@ -277,15 +250,12 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("strategy"); openapiFields.add("config"); - openapiFields.add("enabled"); openapiFields.add("nextExecution"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); openapiRequiredFields.add("strategy"); - openapiRequiredFields.add("enabled"); - openapiRequiredFields.add("nextExecution"); } /** @@ -346,7 +316,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonNull()) { Config.validateJsonElement(jsonObj.get("config")); } - if (!jsonObj.get("nextExecution").isJsonPrimitive()) { + if ((jsonObj.get("nextExecution") != null && !jsonObj.get("nextExecution").isJsonNull()) + && !jsonObj.get("nextExecution").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( "Expected the field `nextExecution` to be a primitive type in the JSON" diff --git a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java index 4a1aeaa2..ea591663 100644 --- a/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateAudiencePreviewAlphaInput.java @@ -35,11 +35,16 @@ public class CreateAudiencePreviewAlphaInput { @SerializedName(SERIALIZED_NAME_DEFINITION) private AudienceDefinitionWithoutType definition; - /** Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. */ + /** + * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS, + * LINKED. + */ @JsonAdapter(AudienceTypeEnum.Adapter.class) public enum AudienceTypeEnum { ACCOUNTS("ACCOUNTS"), + LINKED("LINKED"), + USERS("USERS"); private String value; @@ -120,7 +125,8 @@ public CreateAudiencePreviewAlphaInput audienceType(AudienceTypeEnum audienceTyp } /** - * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS. + * Discriminator denoting the audience's product type. Possible values: USERS, ACCOUNTS, + * LINKED. * * @return audienceType */ diff --git a/src/main/java/com/segment/publicapi/models/EntityDetails.java b/src/main/java/com/segment/publicapi/models/EntityDetails.java new file mode 100644 index 00000000..58a8516f --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/EntityDetails.java @@ -0,0 +1,352 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Entity details. */ +public class EntityDetails { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ID_PROPERTY = "idProperty"; + + @SerializedName(SERIALIZED_NAME_ID_PROPERTY) + private String idProperty; + + public static final String SERIALIZED_NAME_RELATIONSHIP_SLUG = "relationshipSlug"; + + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_SLUG) + private String relationshipSlug; + + public static final String SERIALIZED_NAME_PROPERTIES = "properties"; + + @SerializedName(SERIALIZED_NAME_PROPERTIES) + private Map properties; + + public static final String SERIALIZED_NAME_ENTITIES = "entities"; + + @SerializedName(SERIALIZED_NAME_ENTITIES) + private Map entities = new HashMap<>(); + + public EntityDetails() {} + + public EntityDetails id(String id) { + + this.id = id; + return this; + } + + /** + * The entity primary key value. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public EntityDetails idProperty(String idProperty) { + + this.idProperty = idProperty; + return this; + } + + /** + * The entity primary key column name. + * + * @return idProperty + */ + @javax.annotation.Nonnull + public String getIdProperty() { + return idProperty; + } + + public void setIdProperty(String idProperty) { + this.idProperty = idProperty; + } + + public EntityDetails relationshipSlug(String relationshipSlug) { + + this.relationshipSlug = relationshipSlug; + return this; + } + + /** + * The entity relationship slug. + * + * @return relationshipSlug + */ + @javax.annotation.Nonnull + public String getRelationshipSlug() { + return relationshipSlug; + } + + public void setRelationshipSlug(String relationshipSlug) { + this.relationshipSlug = relationshipSlug; + } + + public EntityDetails properties(Map properties) { + + this.properties = properties; + return this; + } + + public EntityDetails putPropertiesItem(String key, Object propertiesItem) { + if (this.properties == null) { + this.properties = new HashMap<>(); + } + this.properties.put(key, propertiesItem); + return this; + } + + /** + * Entity properties. + * + * @return properties + */ + @javax.annotation.Nullable + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public EntityDetails entities(Map entities) { + + this.entities = entities; + return this; + } + + public EntityDetails putEntitiesItem(String key, Object entitiesItem) { + if (this.entities == null) { + this.entities = new HashMap<>(); + } + this.entities.put(key, entitiesItem); + return this; + } + + /** + * Related entities that are one level deeper will only be returned if those entities are + * referenced in the audience definition. + * + * @return entities + */ + @javax.annotation.Nullable + public Map getEntities() { + return entities; + } + + public void setEntities(Map entities) { + this.entities = entities; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntityDetails entityDetails = (EntityDetails) o; + return Objects.equals(this.id, entityDetails.id) + && Objects.equals(this.idProperty, entityDetails.idProperty) + && Objects.equals(this.relationshipSlug, entityDetails.relationshipSlug) + && Objects.equals(this.properties, entityDetails.properties) + && Objects.equals(this.entities, entityDetails.entities); + } + + @Override + public int hashCode() { + return Objects.hash(id, idProperty, relationshipSlug, properties, entities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntityDetails {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" idProperty: ").append(toIndentedString(idProperty)).append("\n"); + sb.append(" relationshipSlug: ").append(toIndentedString(relationshipSlug)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" entities: ").append(toIndentedString(entities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("idProperty"); + openapiFields.add("relationshipSlug"); + openapiFields.add("properties"); + openapiFields.add("entities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("idProperty"); + openapiRequiredFields.add("relationshipSlug"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntityDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EntityDetails.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in EntityDetails is not found in the" + + " empty JSON string", + EntityDetails.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EntityDetails.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `EntityDetails` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntityDetails.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("idProperty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `idProperty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("idProperty").toString())); + } + if (!jsonObj.get("relationshipSlug").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `relationshipSlug` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("relationshipSlug").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EntityDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntityDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(EntityDetails.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, EntityDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EntityDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of EntityDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntityDetails + * @throws IOException if the JSON string is invalid with respect to EntityDetails + */ + public static EntityDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntityDetails.class); + } + + /** + * Convert an instance of EntityDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java index 2e0d2a0e..e5998722 100644 --- a/src/main/java/com/segment/publicapi/models/PeriodicConfig.java +++ b/src/main/java/com/segment/publicapi/models/PeriodicConfig.java @@ -43,8 +43,8 @@ public PeriodicConfig interval(String interval) { } /** - * Go duration format string, only supporting units \"h\" (hours) and \"m\" - * (minutes). + * Go duration format string, only supporting units \"day\" (days), \"h\" + * (hours) and \"m\" (minutes). * * @return interval */ diff --git a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java index c7584e91..cb518213 100644 --- a/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java +++ b/src/main/java/com/segment/publicapi/models/SpecificDaysConfig.java @@ -64,7 +64,7 @@ public SpecificDaysConfig addDaysItem(BigDecimal daysItem) { } /** - * Days of week for schedule (0=Saturday, 6=Sunday). + * Days of week for schedule (0=Sunday, 6=Saturday). * * @return days */ From 4dea73056094dfec3791ceebf3b72b373391872d Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 10 Jul 2025 06:02:27 +0000 Subject: [PATCH 461/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@dbb366f2. --- .../models/CreateInsertFunctionInstanceAlphaInput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java index bb87ee76..e7148225 100644 --- a/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java +++ b/src/main/java/com/segment/publicapi/models/CreateInsertFunctionInstanceAlphaInput.java @@ -64,7 +64,8 @@ public CreateInsertFunctionInstanceAlphaInput functionId(String functionId) { } /** - * Insert Function id to which this instance is associated. + * Insert Function id to which this instance is associated. Note: Remove the ifnd_/ifns_ prefix + * from the id. * * @return functionId */ From e6a5d46f483820f87cb188ac94a22e727aedb0bd Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Thu, 10 Jul 2025 15:08:06 +0000 Subject: [PATCH 462/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@2f86f440. --- docs/AudiencesApi.md | 10 +-- src/main/java/com/segment/publicapi/JSON.java | 6 +- .../segment/publicapi/api/AudiencesApi.java | 41 ++++++++---- ...nput.java => ListAudienceSearchInput.java} | 67 +++++++++---------- 4 files changed, 70 insertions(+), 54 deletions(-) rename src/main/java/com/segment/publicapi/models/{ListAudienceConsumersSearchInput.java => ListAudienceSearchInput.java} (79%) diff --git a/docs/AudiencesApi.md b/docs/AudiencesApi.md index f083ff64..3ba7eb23 100644 --- a/docs/AudiencesApi.md +++ b/docs/AudiencesApi.md @@ -427,7 +427,7 @@ public class Example { String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | String id = "aud_0ujsswThIGTUYm2K8FjOOfXtY1K"; // String | PaginationInput pagination = new PaginationInput(); // PaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. - ListAudienceConsumersSearchInput search = new ListAudienceConsumersSearchInput(); // ListAudienceConsumersSearchInput | Optional search criteria This parameter exists in alpha. + ListAudienceSearchInput search = new ListAudienceSearchInput(); // ListAudienceSearchInput | Optional search criteria This parameter exists in alpha. ListAudienceConsumersSortInput sort = new ListAudienceConsumersSortInput(); // ListAudienceConsumersSortInput | Optional sort criteria This parameter exists in alpha. try { ListAudienceConsumersFromSpaceAndAudience200Response result = apiInstance.listAudienceConsumersFromSpaceAndAudience(spaceId, id, pagination, search, sort); @@ -451,7 +451,7 @@ public class Example { | **spaceId** | **String**| | | | **id** | **String**| | | | **pagination** | [**PaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | -| **search** | [**ListAudienceConsumersSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | +| **search** | [**ListAudienceSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | | **sort** | [**ListAudienceConsumersSortInput**](.md)| Optional sort criteria This parameter exists in alpha. | [optional] | ### Return type @@ -554,7 +554,7 @@ public class Example { ## Operation: listAudiences -> ListAudiences200Response listAudiences(spaceId, pagination, include) +> ListAudiences200Response listAudiences(spaceId, search, pagination, include) List Audiences @@ -581,10 +581,11 @@ public class Example { AudiencesApi apiInstance = new AudiencesApi(defaultClient); String spaceId = "9aQ1Lj62S4bomZKLF4DPqW"; // String | + ListAudienceSearchInput search = new ListAudienceSearchInput(); // ListAudienceSearchInput | Optional search criteria This parameter exists in alpha. ListAudiencesPaginationInput pagination = new ListAudiencesPaginationInput(); // ListAudiencesPaginationInput | Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. String include = "schedules"; // String | Additional resource to include, support schedules only. This parameter exists in alpha. try { - ListAudiences200Response result = apiInstance.listAudiences(spaceId, pagination, include); + ListAudiences200Response result = apiInstance.listAudiences(spaceId, search, pagination, include); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AudiencesApi#listAudiences"); @@ -603,6 +604,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **spaceId** | **String**| | | +| **search** | [**ListAudienceSearchInput**](.md)| Optional search criteria This parameter exists in alpha. | [optional] | | **pagination** | [**ListAudiencesPaginationInput**](.md)| Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. | [optional] | | **include** | **String**| Additional resource to include, support schedules only. This parameter exists in alpha. | [optional] [enum: schedules] | diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index d6fbf7d6..a5af3027 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -945,9 +945,6 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models .ListAudienceConsumersFromSpaceAndAudienceAlphaOutput .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.segment.publicapi.models.ListAudienceConsumersSearchInput - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudienceConsumersSortInput .CustomTypeAdapterFactory()); @@ -959,6 +956,9 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models .ListAudienceSchedulesFromSpaceAndAudienceAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListAudienceSearchInput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.ListAudiences200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/AudiencesApi.java b/src/main/java/com/segment/publicapi/api/AudiencesApi.java index e3cb801b..b7b34f88 100644 --- a/src/main/java/com/segment/publicapi/api/AudiencesApi.java +++ b/src/main/java/com/segment/publicapi/api/AudiencesApi.java @@ -26,9 +26,9 @@ import com.segment.publicapi.models.GetAudiencePreview200Response; import com.segment.publicapi.models.GetAudienceScheduleFromSpaceAndAudience200Response; import com.segment.publicapi.models.ListAudienceConsumersFromSpaceAndAudience200Response; -import com.segment.publicapi.models.ListAudienceConsumersSearchInput; import com.segment.publicapi.models.ListAudienceConsumersSortInput; import com.segment.publicapi.models.ListAudienceSchedulesFromSpaceAndAudience200Response; +import com.segment.publicapi.models.ListAudienceSearchInput; import com.segment.publicapi.models.ListAudiences200Response; import com.segment.publicapi.models.ListAudiencesPaginationInput; import com.segment.publicapi.models.PaginationInput; @@ -1152,7 +1152,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceCall( String spaceId, String id, PaginationInput pagination, - ListAudienceConsumersSearchInput search, + ListAudienceSearchInput search, ListAudienceConsumersSortInput sort, final ApiCallback _callback) throws ApiException { @@ -1232,7 +1232,7 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall String spaceId, String id, PaginationInput pagination, - ListAudienceConsumersSearchInput search, + ListAudienceSearchInput search, ListAudienceConsumersSortInput sort, final ApiCallback _callback) throws ApiException { @@ -1288,7 +1288,7 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall String spaceId, String id, PaginationInput pagination, - ListAudienceConsumersSearchInput search, + ListAudienceSearchInput search, ListAudienceConsumersSortInput sort) throws ApiException { ApiResponse localVarResp = @@ -1331,7 +1331,7 @@ private okhttp3.Call listAudienceConsumersFromSpaceAndAudienceValidateBeforeCall String spaceId, String id, PaginationInput pagination, - ListAudienceConsumersSearchInput search, + ListAudienceSearchInput search, ListAudienceConsumersSortInput sort) throws ApiException { okhttp3.Call localVarCall = @@ -1377,7 +1377,7 @@ public okhttp3.Call listAudienceConsumersFromSpaceAndAudienceAsync( String spaceId, String id, PaginationInput pagination, - ListAudienceConsumersSearchInput search, + ListAudienceSearchInput search, ListAudienceConsumersSortInput sort, final ApiCallback _callback) throws ApiException { @@ -1589,6 +1589,7 @@ public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceAsync( * Build call for listAudiences * * @param spaceId (required) + * @param search Optional search criteria This parameter exists in alpha. (optional) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) @@ -1608,6 +1609,7 @@ public okhttp3.Call listAudienceSchedulesFromSpaceAndAudienceAsync( */ public okhttp3.Call listAudiencesCall( String spaceId, + ListAudienceSearchInput search, ListAudiencesPaginationInput pagination, String include, final ApiCallback _callback) @@ -1640,6 +1642,10 @@ public okhttp3.Call listAudiencesCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (search != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("search", search)); + } + if (pagination != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); } @@ -1683,6 +1689,7 @@ public okhttp3.Call listAudiencesCall( @SuppressWarnings("rawtypes") private okhttp3.Call listAudiencesValidateBeforeCall( String spaceId, + ListAudienceSearchInput search, ListAudiencesPaginationInput pagination, String include, final ApiCallback _callback) @@ -1693,7 +1700,7 @@ private okhttp3.Call listAudiencesValidateBeforeCall( "Missing the required parameter 'spaceId' when calling listAudiences(Async)"); } - return listAudiencesCall(spaceId, pagination, include, _callback); + return listAudiencesCall(spaceId, search, pagination, include, _callback); } /** @@ -1708,6 +1715,7 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * information. * * @param spaceId (required) + * @param search Optional search criteria This parameter exists in alpha. (optional) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) @@ -1726,10 +1734,13 @@ private okhttp3.Call listAudiencesValidateBeforeCall( * */ public ListAudiences200Response listAudiences( - String spaceId, ListAudiencesPaginationInput pagination, String include) + String spaceId, + ListAudienceSearchInput search, + ListAudiencesPaginationInput pagination, + String include) throws ApiException { ApiResponse localVarResp = - listAudiencesWithHttpInfo(spaceId, pagination, include); + listAudiencesWithHttpInfo(spaceId, search, pagination, include); return localVarResp.getData(); } @@ -1745,6 +1756,7 @@ public ListAudiences200Response listAudiences( * information. * * @param spaceId (required) + * @param search Optional search criteria This parameter exists in alpha. (optional) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) @@ -1763,10 +1775,13 @@ public ListAudiences200Response listAudiences( * */ public ApiResponse listAudiencesWithHttpInfo( - String spaceId, ListAudiencesPaginationInput pagination, String include) + String spaceId, + ListAudienceSearchInput search, + ListAudiencesPaginationInput pagination, + String include) throws ApiException { okhttp3.Call localVarCall = - listAudiencesValidateBeforeCall(spaceId, pagination, include, null); + listAudiencesValidateBeforeCall(spaceId, search, pagination, include, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1783,6 +1798,7 @@ public ApiResponse listAudiencesWithHttpInfo( * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) + * @param search Optional search criteria This parameter exists in alpha. (optional) * @param pagination Information about the pagination of this response. [See * pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) * for more info. This parameter exists in alpha. (optional) @@ -1803,13 +1819,14 @@ public ApiResponse listAudiencesWithHttpInfo( */ public okhttp3.Call listAudiencesAsync( String spaceId, + ListAudienceSearchInput search, ListAudiencesPaginationInput pagination, String include, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = - listAudiencesValidateBeforeCall(spaceId, pagination, include, _callback); + listAudiencesValidateBeforeCall(spaceId, search, pagination, include, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersSearchInput.java b/src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java similarity index 79% rename from src/main/java/com/segment/publicapi/models/ListAudienceConsumersSearchInput.java rename to src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java index c230adf7..771faa46 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudienceConsumersSearchInput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java @@ -29,12 +29,14 @@ import java.util.Set; /** Search criteria input for list audience consumers. */ -public class ListAudienceConsumersSearchInput { +public class ListAudienceSearchInput { /** Field to filter by. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { DEFINITION("DEFINITION"), + KEY("KEY"), + NAME("NAME"); private String value; @@ -86,9 +88,9 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_QUERY) private String query; - public ListAudienceConsumersSearchInput() {} + public ListAudienceSearchInput() {} - public ListAudienceConsumersSearchInput type(TypeEnum type) { + public ListAudienceSearchInput type(TypeEnum type) { this.type = type; return this; @@ -108,7 +110,7 @@ public void setType(TypeEnum type) { this.type = type; } - public ListAudienceConsumersSearchInput query(String query) { + public ListAudienceSearchInput query(String query) { this.query = query; return this; @@ -136,10 +138,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ListAudienceConsumersSearchInput listAudienceConsumersSearchInput = - (ListAudienceConsumersSearchInput) o; - return Objects.equals(this.type, listAudienceConsumersSearchInput.type) - && Objects.equals(this.query, listAudienceConsumersSearchInput.query); + ListAudienceSearchInput listAudienceSearchInput = (ListAudienceSearchInput) o; + return Objects.equals(this.type, listAudienceSearchInput.type) + && Objects.equals(this.query, listAudienceSearchInput.query); } @Override @@ -150,7 +151,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ListAudienceConsumersSearchInput {\n"); + sb.append("class ListAudienceSearchInput {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append("}"); @@ -187,35 +188,34 @@ private String toIndentedString(Object o) { * Validates the JSON Element and throws an exception if issues found * * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to - * ListAudienceConsumersSearchInput + * @throws IOException if the JSON Element is invalid with respect to ListAudienceSearchInput */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!ListAudienceConsumersSearchInput.openapiRequiredFields + if (!ListAudienceSearchInput.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in ListAudienceConsumersSearchInput is" - + " not found in the empty JSON string", - ListAudienceConsumersSearchInput.openapiRequiredFields.toString())); + "The required field(s) %s in ListAudienceSearchInput is not found" + + " in the empty JSON string", + ListAudienceSearchInput.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!ListAudienceConsumersSearchInput.openapiFields.contains(entry.getKey())) { + if (!ListAudienceSearchInput.openapiFields.contains(entry.getKey())) { throw new IllegalArgumentException( String.format( "The field `%s` in the JSON string is not defined in the" - + " `ListAudienceConsumersSearchInput` properties. JSON: %s", + + " `ListAudienceSearchInput` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ListAudienceConsumersSearchInput.openapiRequiredFields) { + for (String requiredField : ListAudienceSearchInput.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -244,27 +244,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!ListAudienceConsumersSearchInput.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ListAudienceConsumersSearchInput' and - // its subtypes + if (!ListAudienceSearchInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListAudienceSearchInput' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(ListAudienceConsumersSearchInput.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListAudienceSearchInput.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, ListAudienceConsumersSearchInput value) + public void write(JsonWriter out, ListAudienceSearchInput value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public ListAudienceConsumersSearchInput read(JsonReader in) - throws IOException { + public ListAudienceSearchInput read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -274,19 +272,18 @@ public ListAudienceConsumersSearchInput read(JsonReader in) } /** - * Create an instance of ListAudienceConsumersSearchInput given an JSON string + * Create an instance of ListAudienceSearchInput given an JSON string * * @param jsonString JSON string - * @return An instance of ListAudienceConsumersSearchInput - * @throws IOException if the JSON string is invalid with respect to - * ListAudienceConsumersSearchInput + * @return An instance of ListAudienceSearchInput + * @throws IOException if the JSON string is invalid with respect to ListAudienceSearchInput */ - public static ListAudienceConsumersSearchInput fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ListAudienceConsumersSearchInput.class); + public static ListAudienceSearchInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListAudienceSearchInput.class); } /** - * Convert an instance of ListAudienceConsumersSearchInput to an JSON string + * Convert an instance of ListAudienceSearchInput to an JSON string * * @return JSON string */ From 467935eec05ec0aef0edd7800a18a60668f90692 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 14 Jul 2025 21:30:44 +0000 Subject: [PATCH 463/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@447c7128. --- README.md | 16 +- docs/ActivationsApi.md | 486 ++++++ pom.xml | 2 +- .../java/com/segment/publicapi/ApiClient.java | 2 +- .../com/segment/publicapi/Configuration.java | 2 +- src/main/java/com/segment/publicapi/JSON.java | 58 + .../segment/publicapi/api/ActivationsApi.java | 1505 +++++++++++++++++ .../models/ActivationSummaryOutput.java | 237 +++ .../AddActivationToAudience200Response.java | 201 +++ .../AddActivationToAudienceAlphaInput.java | 452 +++++ .../AddActivationToAudienceAlphaOutput.java | 210 +++ .../AddDestinationToAudience200Response.java | 201 +++ .../AddDestinationToAudienceAlphaInput.java | 282 +++ .../AddDestinationToAudienceAlphaOutput.java | 210 +++ .../segment/publicapi/models/Connection.java | 206 +++ .../models/DeleteActivationAlphaOutput.java | 209 +++ .../publicapi/models/DestinationInput.java | 243 +++ .../GetActivationFromAudience200Response.java | 203 +++ .../GetActivationFromAudienceOutput.java | 208 +++ .../models/ListActivationsAlphaOutput.java | 259 +++ ...istActivationsFromAudience200Response.java | 203 +++ .../ListActivationsFromAudienceOutput.java | 267 +++ ...moveActivationFromAudience200Response.java | 205 +++ .../RemoveActivationFromAudienceOutput.java | 215 +++ ...pdateActivationForAudience200Response.java | 203 +++ ...UpdateActivationForAudienceAlphaInput.java | 305 ++++ .../UpdateActivationForAudienceOutput.java | 209 +++ 27 files changed, 6789 insertions(+), 10 deletions(-) create mode 100644 docs/ActivationsApi.md create mode 100644 src/main/java/com/segment/publicapi/api/ActivationsApi.java create mode 100644 src/main/java/com/segment/publicapi/models/ActivationSummaryOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/AddActivationToAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/AddDestinationToAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/Connection.java create mode 100644 src/main/java/com/segment/publicapi/models/DeleteActivationAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/DestinationInput.java create mode 100644 src/main/java/com/segment/publicapi/models/GetActivationFromAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/GetActivationFromAudienceOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListActivationsAlphaOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/ListActivationsFromAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/ListActivationsFromAudienceOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveActivationFromAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/RemoveActivationFromAudienceOutput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateActivationForAudience200Response.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceAlphaInput.java create mode 100644 src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceOutput.java diff --git a/README.md b/README.md index 9c6c69a0..e6e37b0b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.11.0 +Latest API and SDK version: 58.12.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.11.0 + 58.12.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.11.0" + implementation "com.segment.publicapi:segment-publicapi:58.12.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.11.0.jar` +* `target/segment-publicapi-58.12.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! @@ -85,9 +85,11 @@ public class Example { HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); token.setBearerToken(""); - ApiCallsApi apiInstance = new ApiCallsApi(defaultClient); - String period = "2021-02-01"; // String | The start of the usage month in the ISO-8601 format. This parameter exists in v1. - PaginationInput pagination = new PaginationInput(); // PaginationInput | Pagination input for per Source API calls counts. This parameter exists in v1. + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String connectionId = "ii_123456789"; // String | + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput = new AddActivationToAudienceAlphaInput(); // AddActivationToAudienceAlphaInput | // Make an API call without Pagination try { diff --git a/docs/ActivationsApi.md b/docs/ActivationsApi.md new file mode 100644 index 00000000..59b7aa2c --- /dev/null +++ b/docs/ActivationsApi.md @@ -0,0 +1,486 @@ +# ActivationsApi + +All URIs are relative to *https://api.segmentapis.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addActivationToAudience**](ActivationsApi.md#addActivationToAudience) | **POST** /spaces/{spaceId}/audiences/{audienceId}/{connectionId}/activations | Add Activation to Audience | +| [**addDestinationToAudience**](ActivationsApi.md#addDestinationToAudience) | **POST** /spaces/{spaceId}/audiences/{audienceId}/destinations | Add Destination to Audience | +| [**getActivationFromAudience**](ActivationsApi.md#getActivationFromAudience) | **GET** /spaces/{spaceId}/audiences/{audienceId}/activations/{id} | Get Activation from Audience | +| [**listActivationsFromAudience**](ActivationsApi.md#listActivationsFromAudience) | **GET** /spaces/{spaceId}/audiences/{audienceId}/activations | List Activations from Audience | +| [**removeActivationFromAudience**](ActivationsApi.md#removeActivationFromAudience) | **DELETE** /spaces/{spaceId}/audiences/{audienceId}/activations/{id} | Remove Activation from Audience | +| [**updateActivationForAudience**](ActivationsApi.md#updateActivationForAudience) | **PATCH** /spaces/{spaceId}/audiences/{audienceId}/activations/{id} | Update Activation for Audience | + + + +## Operation: addActivationToAudience + +> AddActivationToAudience200Response addActivationToAudience(spaceId, audienceId, connectionId, addActivationToAudienceAlphaInput) + +Add Activation to Audience + +Creates Activation. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Activation Created` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ActivationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String connectionId = "ii_123456789"; // String | + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput = new AddActivationToAudienceAlphaInput(); // AddActivationToAudienceAlphaInput | + try { + AddActivationToAudience200Response result = apiInstance.addActivationToAudience(spaceId, audienceId, connectionId, addActivationToAudienceAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActivationsApi#addActivationToAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **audienceId** | **String**| | | +| **connectionId** | **String**| | | +| **addActivationToAudienceAlphaInput** | [**AddActivationToAudienceAlphaInput**](AddActivationToAudienceAlphaInput.md)| | | + +### Return type + +[**AddActivationToAudience200Response**](AddActivationToAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: addDestinationToAudience + +> AddDestinationToAudience200Response addDestinationToAudience(spaceId, audienceId, addDestinationToAudienceAlphaInput) + +Add Destination to Audience + +Adds a Destination to an Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Destination Added into Audience` event in the [audit trail](/tag/Audit-Trail). + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ActivationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput = new AddDestinationToAudienceAlphaInput(); // AddDestinationToAudienceAlphaInput | + try { + AddDestinationToAudience200Response result = apiInstance.addDestinationToAudience(spaceId, audienceId, addDestinationToAudienceAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActivationsApi#addDestinationToAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **audienceId** | **String**| | | +| **addDestinationToAudienceAlphaInput** | [**AddDestinationToAudienceAlphaInput**](AddDestinationToAudienceAlphaInput.md)| | | + +### Return type + +[**AddDestinationToAudience200Response**](AddDestinationToAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: getActivationFromAudience + +> GetActivationFromAudience200Response getActivationFromAudience(spaceId, audienceId, id, workspaceId) + +Get Activation from Audience + +Gets a single Activation by id. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ActivationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "act_987654321"; // String | + String workspaceId = "LF4DPqW"; // String | The workspace id This parameter exists in alpha. + try { + GetActivationFromAudience200Response result = apiInstance.getActivationFromAudience(spaceId, audienceId, id, workspaceId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActivationsApi#getActivationFromAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **audienceId** | **String**| | | +| **id** | **String**| | | +| **workspaceId** | **String**| The workspace id This parameter exists in alpha. | | + +### Return type + +[**GetActivationFromAudience200Response**](GetActivationFromAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: listActivationsFromAudience + +> ListActivationsFromAudience200Response listActivationsFromAudience(spaceId, audienceId, workspaceId, pagination) + +List Activations from Audience + +Lists all Activations. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ActivationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String workspaceId = "LF4DPqW"; // String | The workspace id This parameter exists in alpha. + PaginationInput pagination = new PaginationInput(); // PaginationInput | Optional pagination. This parameter exists in alpha. + try { + ListActivationsFromAudience200Response result = apiInstance.listActivationsFromAudience(spaceId, audienceId, workspaceId, pagination); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActivationsApi#listActivationsFromAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **audienceId** | **String**| | | +| **workspaceId** | **String**| The workspace id This parameter exists in alpha. | | +| **pagination** | [**PaginationInput**](.md)| Optional pagination. This parameter exists in alpha. | [optional] | + +### Return type + +[**ListActivationsFromAudience200Response**](ListActivationsFromAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: removeActivationFromAudience + +> RemoveActivationFromAudience200Response removeActivationFromAudience(spaceId, audienceId, id, workspaceId) + +Remove Activation from Audience + +Deletes an Activation. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ActivationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "act_987654321"; // String | + String workspaceId = "LF4DPqW"; // String | The workspace id This parameter exists in alpha. + try { + RemoveActivationFromAudience200Response result = apiInstance.removeActivationFromAudience(spaceId, audienceId, id, workspaceId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActivationsApi#removeActivationFromAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **audienceId** | **String**| | | +| **id** | **String**| | | +| **workspaceId** | **String**| The workspace id This parameter exists in alpha. | | + +### Return type + +[**RemoveActivationFromAudience200Response**](RemoveActivationFromAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + + +## Operation: updateActivationForAudience + +> UpdateActivationForAudience200Response updateActivationForAudience(spaceId, audienceId, id, updateActivationForAudienceAlphaInput) + +Update Activation for Audience + +Updates an Activation. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + +### Example + +```java +// Import classes: +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.auth.*; +import com.segment.publicapi.models.*; +import com.segment.publicapi.api.ActivationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP bearer authorization: token + HttpBearerAuth token = (HttpBearerAuth) defaultClient.getAuthentication("token"); + token.setBearerToken("BEARER TOKEN"); + + ActivationsApi apiInstance = new ActivationsApi(defaultClient); + String spaceId = "spa_9aQ1Lj62S4bomZKLF4DPqW"; // String | + String audienceId = "aud_0ujsszwN8NRY24YaXiTIE2VWDTS"; // String | + String id = "act_987654321"; // String | + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput = new UpdateActivationForAudienceAlphaInput(); // UpdateActivationForAudienceAlphaInput | + try { + UpdateActivationForAudience200Response result = apiInstance.updateActivationForAudience(spaceId, audienceId, id, updateActivationForAudienceAlphaInput); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActivationsApi#updateActivationForAudience"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **spaceId** | **String**| | | +| **audienceId** | **String**| | | +| **id** | **String**| | | +| **updateActivationForAudienceAlphaInput** | [**UpdateActivationForAudienceAlphaInput**](UpdateActivationForAudienceAlphaInput.md)| | | + +### Return type + +[**UpdateActivationForAudience200Response**](UpdateActivationForAudience200Response.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/vnd.segment.v1alpha+json +- **Accept**: application/vnd.segment.v1alpha+json, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **404** | Resource not found | - | +| **422** | Validation failure | - | +| **429** | Too many requests | - | + diff --git a/pom.xml b/pom.xml index 15dfaa35..82faec54 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.11.0 + 58.12.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index 79512d53..c0537f14 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.11.0 (Java)"); + setUserAgent("Public API SDK 58.12.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index e7ab1929..b1003b0c 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.11.0"; + public static final String VERSION = "58.12.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/segment/publicapi/JSON.java b/src/main/java/com/segment/publicapi/JSON.java index a5af3027..4db4fb1c 100644 --- a/src/main/java/com/segment/publicapi/JSON.java +++ b/src/main/java/com/segment/publicapi/JSON.java @@ -95,12 +95,33 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.APICallSnapshotV1.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AccessPermissionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ActivationSummaryOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddActivationToAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddActivationToAudienceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddActivationToAudienceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AddConnectionFromSourceToWarehouse201Response .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AddConnectionFromSourceToWarehouseV1Output .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddDestinationToAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddDestinationToAudienceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.AddDestinationToAudienceAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.AddLabelsToSource200Response .CustomTypeAdapterFactory()); @@ -230,6 +251,8 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Config.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Config1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.Connection.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.Contact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( @@ -486,6 +509,9 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DbtModelSyncTrigger.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DeleteActivationAlphaOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DeleteDestination200Response .CustomTypeAdapterFactory()); @@ -602,6 +628,8 @@ private static Class getClassByDiscriminator( .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationFilterV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.DestinationInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.DestinationMetadataActionFieldV1 .CustomTypeAdapterFactory()); @@ -673,6 +701,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GenerateUploadURLForEdgeFunctionsAlphaOutput .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetActivationFromAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.GetActivationFromAudienceOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.GetAdvancedSyncScheduleFromWarehouse200Response .CustomTypeAdapterFactory()); @@ -937,6 +971,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.LabelAlpha.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.LabelV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListActivationsAlphaOutput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListActivationsFromAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.ListActivationsFromAudienceOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models .ListAudienceConsumersFromSpaceAndAudience200Response @@ -1293,6 +1336,12 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.Regulation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RegulationListEntryV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveActivationFromAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.RemoveActivationFromAudienceOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.RemoveAudienceFromSpace200Response .CustomTypeAdapterFactory()); @@ -1523,6 +1572,15 @@ private static Class getClassByDiscriminator( new com.segment.publicapi.models.TransformationBeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.TransformationV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateActivationForAudience200Response + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateActivationForAudienceAlphaInput + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.segment.publicapi.models.UpdateActivationForAudienceOutput + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.segment.publicapi.models.UpdateAudienceForSpace200Response .CustomTypeAdapterFactory()); diff --git a/src/main/java/com/segment/publicapi/api/ActivationsApi.java b/src/main/java/com/segment/publicapi/api/ActivationsApi.java new file mode 100644 index 00000000..e5290091 --- /dev/null +++ b/src/main/java/com/segment/publicapi/api/ActivationsApi.java @@ -0,0 +1,1505 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.api; + +import com.google.gson.reflect.TypeToken; +import com.segment.publicapi.ApiCallback; +import com.segment.publicapi.ApiClient; +import com.segment.publicapi.ApiException; +import com.segment.publicapi.ApiResponse; +import com.segment.publicapi.Configuration; +import com.segment.publicapi.Pair; +import com.segment.publicapi.models.AddActivationToAudience200Response; +import com.segment.publicapi.models.AddActivationToAudienceAlphaInput; +import com.segment.publicapi.models.AddDestinationToAudience200Response; +import com.segment.publicapi.models.AddDestinationToAudienceAlphaInput; +import com.segment.publicapi.models.GetActivationFromAudience200Response; +import com.segment.publicapi.models.ListActivationsFromAudience200Response; +import com.segment.publicapi.models.PaginationInput; +import com.segment.publicapi.models.RemoveActivationFromAudience200Response; +import com.segment.publicapi.models.UpdateActivationForAudience200Response; +import com.segment.publicapi.models.UpdateActivationForAudienceAlphaInput; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ActivationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ActivationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ActivationsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for addActivationToAudience + * + * @param spaceId (required) + * @param audienceId (required) + * @param connectionId (required) + * @param addActivationToAudienceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call addActivationToAudienceCall( + String spaceId, + String audienceId, + String connectionId, + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = addActivationToAudienceAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{audienceId}/{connectionId}/activations" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "audienceId" + "}", + localVarApiClient.escapeString(audienceId.toString())) + .replace( + "{" + "connectionId" + "}", + localVarApiClient.escapeString(connectionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addActivationToAudienceValidateBeforeCall( + String spaceId, + String audienceId, + String connectionId, + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " addActivationToAudience(Async)"); + } + + // verify the required parameter 'audienceId' is set + if (audienceId == null) { + throw new ApiException( + "Missing the required parameter 'audienceId' when calling" + + " addActivationToAudience(Async)"); + } + + // verify the required parameter 'connectionId' is set + if (connectionId == null) { + throw new ApiException( + "Missing the required parameter 'connectionId' when calling" + + " addActivationToAudience(Async)"); + } + + // verify the required parameter 'addActivationToAudienceAlphaInput' is set + if (addActivationToAudienceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'addActivationToAudienceAlphaInput' when" + + " calling addActivationToAudience(Async)"); + } + + return addActivationToAudienceCall( + spaceId, audienceId, connectionId, addActivationToAudienceAlphaInput, _callback); + } + + /** + * Add Activation to Audience Creates Activation. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Activation Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param connectionId (required) + * @param addActivationToAudienceAlphaInput (required) + * @return AddActivationToAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public AddActivationToAudience200Response addActivationToAudience( + String spaceId, + String audienceId, + String connectionId, + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + addActivationToAudienceWithHttpInfo( + spaceId, audienceId, connectionId, addActivationToAudienceAlphaInput); + return localVarResp.getData(); + } + + /** + * Add Activation to Audience Creates Activation. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Audience feature + * enabled. Please reach out to your customer success manager for more information. • When + * called, this endpoint may generate the `Activation Created` event in the [audit + * trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests per minute, which + * is lower than the default due to access pattern restrictions. Once reached, this endpoint + * will respond with the 429 HTTP status code with headers indicating the limit parameters. See + * [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param connectionId (required) + * @param addActivationToAudienceAlphaInput (required) + * @return ApiResponse<AddActivationToAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse addActivationToAudienceWithHttpInfo( + String spaceId, + String audienceId, + String connectionId, + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + addActivationToAudienceValidateBeforeCall( + spaceId, audienceId, connectionId, addActivationToAudienceAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add Activation to Audience (asynchronously) Creates Activation. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Activation Created` + * event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 10 requests + * per minute, which is lower than the default due to access pattern restrictions. Once reached, + * this endpoint will respond with the 429 HTTP status code with headers indicating the limit + * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param connectionId (required) + * @param addActivationToAudienceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call addActivationToAudienceAsync( + String spaceId, + String audienceId, + String connectionId, + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addActivationToAudienceValidateBeforeCall( + spaceId, + audienceId, + connectionId, + addActivationToAudienceAlphaInput, + _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for addDestinationToAudience + * + * @param spaceId (required) + * @param audienceId (required) + * @param addDestinationToAudienceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call addDestinationToAudienceCall( + String spaceId, + String audienceId, + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = addDestinationToAudienceAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{audienceId}/destinations" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "audienceId" + "}", + localVarApiClient.escapeString(audienceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addDestinationToAudienceValidateBeforeCall( + String spaceId, + String audienceId, + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " addDestinationToAudience(Async)"); + } + + // verify the required parameter 'audienceId' is set + if (audienceId == null) { + throw new ApiException( + "Missing the required parameter 'audienceId' when calling" + + " addDestinationToAudience(Async)"); + } + + // verify the required parameter 'addDestinationToAudienceAlphaInput' is set + if (addDestinationToAudienceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'addDestinationToAudienceAlphaInput' when" + + " calling addDestinationToAudience(Async)"); + } + + return addDestinationToAudienceCall( + spaceId, audienceId, addDestinationToAudienceAlphaInput, _callback); + } + + /** + * Add Destination to Audience Adds a Destination to an Audience. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Destination Added into + * Audience` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param audienceId (required) + * @param addDestinationToAudienceAlphaInput (required) + * @return AddDestinationToAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public AddDestinationToAudience200Response addDestinationToAudience( + String spaceId, + String audienceId, + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + addDestinationToAudienceWithHttpInfo( + spaceId, audienceId, addDestinationToAudienceAlphaInput); + return localVarResp.getData(); + } + + /** + * Add Destination to Audience Adds a Destination to an Audience. • This endpoint is in + * **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • + * In order to successfully call this endpoint, the specified Workspace needs to have the + * Audience feature enabled. Please reach out to your customer success manager for more + * information. • When called, this endpoint may generate the `Destination Added into + * Audience` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param audienceId (required) + * @param addDestinationToAudienceAlphaInput (required) + * @return ApiResponse<AddDestinationToAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse addDestinationToAudienceWithHttpInfo( + String spaceId, + String audienceId, + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + addDestinationToAudienceValidateBeforeCall( + spaceId, audienceId, addDestinationToAudienceAlphaInput, null); + Type localVarReturnType = new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add Destination to Audience (asynchronously) Adds a Destination to an Audience. • This + * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to + * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace + * needs to have the Audience feature enabled. Please reach out to your customer success manager + * for more information. • When called, this endpoint may generate the `Destination Added + * into Audience` event in the [audit trail](/tag/Audit-Trail). + * + * @param spaceId (required) + * @param audienceId (required) + * @param addDestinationToAudienceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call addDestinationToAudienceAsync( + String spaceId, + String audienceId, + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + addDestinationToAudienceValidateBeforeCall( + spaceId, audienceId, addDestinationToAudienceAlphaInput, _callback); + Type localVarReturnType = new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for getActivationFromAudience + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getActivationFromAudienceCall( + String spaceId, + String audienceId, + String id, + String workspaceId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{audienceId}/activations/{id}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "audienceId" + "}", + localVarApiClient.escapeString(audienceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (workspaceId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("workspaceId", workspaceId)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getActivationFromAudienceValidateBeforeCall( + String spaceId, + String audienceId, + String id, + String workspaceId, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " getActivationFromAudience(Async)"); + } + + // verify the required parameter 'audienceId' is set + if (audienceId == null) { + throw new ApiException( + "Missing the required parameter 'audienceId' when calling" + + " getActivationFromAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " getActivationFromAudience(Async)"); + } + + // verify the required parameter 'workspaceId' is set + if (workspaceId == null) { + throw new ApiException( + "Missing the required parameter 'workspaceId' when calling" + + " getActivationFromAudience(Async)"); + } + + return getActivationFromAudienceCall(spaceId, audienceId, id, workspaceId, _callback); + } + + /** + * Get Activation from Audience Gets a single Activation by id. The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @return GetActivationFromAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public GetActivationFromAudience200Response getActivationFromAudience( + String spaceId, String audienceId, String id, String workspaceId) throws ApiException { + ApiResponse localVarResp = + getActivationFromAudienceWithHttpInfo(spaceId, audienceId, id, workspaceId); + return localVarResp.getData(); + } + + /** + * Get Activation from Audience Gets a single Activation by id. The rate limit for this endpoint + * is 60 requests per minute, which is lower than the default due to access pattern + * restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with + * headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @return ApiResponse<GetActivationFromAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse getActivationFromAudienceWithHttpInfo( + String spaceId, String audienceId, String id, String workspaceId) throws ApiException { + okhttp3.Call localVarCall = + getActivationFromAudienceValidateBeforeCall( + spaceId, audienceId, id, workspaceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get Activation from Audience (asynchronously) Gets a single Activation by id. The rate limit + * for this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call getActivationFromAudienceAsync( + String spaceId, + String audienceId, + String id, + String workspaceId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + getActivationFromAudienceValidateBeforeCall( + spaceId, audienceId, id, workspaceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for listActivationsFromAudience + * + * @param spaceId (required) + * @param audienceId (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param pagination Optional pagination. This parameter exists in alpha. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listActivationsFromAudienceCall( + String spaceId, + String audienceId, + String workspaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{audienceId}/activations" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "audienceId" + "}", + localVarApiClient.escapeString(audienceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (workspaceId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("workspaceId", workspaceId)); + } + + if (pagination != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pagination", pagination)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listActivationsFromAudienceValidateBeforeCall( + String spaceId, + String audienceId, + String workspaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " listActivationsFromAudience(Async)"); + } + + // verify the required parameter 'audienceId' is set + if (audienceId == null) { + throw new ApiException( + "Missing the required parameter 'audienceId' when calling" + + " listActivationsFromAudience(Async)"); + } + + // verify the required parameter 'workspaceId' is set + if (workspaceId == null) { + throw new ApiException( + "Missing the required parameter 'workspaceId' when calling" + + " listActivationsFromAudience(Async)"); + } + + return listActivationsFromAudienceCall( + spaceId, audienceId, workspaceId, pagination, _callback); + } + + /** + * List Activations from Audience Lists all Activations. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param pagination Optional pagination. This parameter exists in alpha. (optional) + * @return ListActivationsFromAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ListActivationsFromAudience200Response listActivationsFromAudience( + String spaceId, String audienceId, String workspaceId, PaginationInput pagination) + throws ApiException { + ApiResponse localVarResp = + listActivationsFromAudienceWithHttpInfo( + spaceId, audienceId, workspaceId, pagination); + return localVarResp.getData(); + } + + /** + * List Activations from Audience Lists all Activations. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param pagination Optional pagination. This parameter exists in alpha. (optional) + * @return ApiResponse<ListActivationsFromAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + listActivationsFromAudienceWithHttpInfo( + String spaceId, + String audienceId, + String workspaceId, + PaginationInput pagination) + throws ApiException { + okhttp3.Call localVarCall = + listActivationsFromAudienceValidateBeforeCall( + spaceId, audienceId, workspaceId, pagination, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Activations from Audience (asynchronously) Lists all Activations. The rate limit for + * this endpoint is 60 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param pagination Optional pagination. This parameter exists in alpha. (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call listActivationsFromAudienceAsync( + String spaceId, + String audienceId, + String workspaceId, + PaginationInput pagination, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + listActivationsFromAudienceValidateBeforeCall( + spaceId, audienceId, workspaceId, pagination, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for removeActivationFromAudience + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeActivationFromAudienceCall( + String spaceId, + String audienceId, + String id, + String workspaceId, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{audienceId}/activations/{id}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "audienceId" + "}", + localVarApiClient.escapeString(audienceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (workspaceId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("workspaceId", workspaceId)); + } + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeActivationFromAudienceValidateBeforeCall( + String spaceId, + String audienceId, + String id, + String workspaceId, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " removeActivationFromAudience(Async)"); + } + + // verify the required parameter 'audienceId' is set + if (audienceId == null) { + throw new ApiException( + "Missing the required parameter 'audienceId' when calling" + + " removeActivationFromAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " removeActivationFromAudience(Async)"); + } + + // verify the required parameter 'workspaceId' is set + if (workspaceId == null) { + throw new ApiException( + "Missing the required parameter 'workspaceId' when calling" + + " removeActivationFromAudience(Async)"); + } + + return removeActivationFromAudienceCall(spaceId, audienceId, id, workspaceId, _callback); + } + + /** + * Remove Activation from Audience Deletes an Activation. The rate limit for this endpoint is 10 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @return RemoveActivationFromAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public RemoveActivationFromAudience200Response removeActivationFromAudience( + String spaceId, String audienceId, String id, String workspaceId) throws ApiException { + ApiResponse localVarResp = + removeActivationFromAudienceWithHttpInfo(spaceId, audienceId, id, workspaceId); + return localVarResp.getData(); + } + + /** + * Remove Activation from Audience Deletes an Activation. The rate limit for this endpoint is 10 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @return ApiResponse<RemoveActivationFromAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + removeActivationFromAudienceWithHttpInfo( + String spaceId, String audienceId, String id, String workspaceId) + throws ApiException { + okhttp3.Call localVarCall = + removeActivationFromAudienceValidateBeforeCall( + spaceId, audienceId, id, workspaceId, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Activation from Audience (asynchronously) Deletes an Activation. The rate limit for + * this endpoint is 10 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param workspaceId The workspace id This parameter exists in alpha. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call removeActivationFromAudienceAsync( + String spaceId, + String audienceId, + String id, + String workspaceId, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + removeActivationFromAudienceValidateBeforeCall( + spaceId, audienceId, id, workspaceId, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + + /** + * Build call for updateActivationForAudience + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param updateActivationForAudienceAlphaInput (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateActivationForAudienceCall( + String spaceId, + String audienceId, + String id, + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateActivationForAudienceAlphaInput; + + // create path and map variables + String localVarPath = + "/spaces/{spaceId}/audiences/{audienceId}/activations/{id}" + .replace( + "{" + "spaceId" + "}", + localVarApiClient.escapeString(spaceId.toString())) + .replace( + "{" + "audienceId" + "}", + localVarApiClient.escapeString(audienceId.toString())) + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.segment.v1alpha+json", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/vnd.segment.v1alpha+json"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] {"token"}; + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PATCH", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames, + _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateActivationForAudienceValidateBeforeCall( + String spaceId, + String audienceId, + String id, + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + // verify the required parameter 'spaceId' is set + if (spaceId == null) { + throw new ApiException( + "Missing the required parameter 'spaceId' when calling" + + " updateActivationForAudience(Async)"); + } + + // verify the required parameter 'audienceId' is set + if (audienceId == null) { + throw new ApiException( + "Missing the required parameter 'audienceId' when calling" + + " updateActivationForAudience(Async)"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + "Missing the required parameter 'id' when calling" + + " updateActivationForAudience(Async)"); + } + + // verify the required parameter 'updateActivationForAudienceAlphaInput' is set + if (updateActivationForAudienceAlphaInput == null) { + throw new ApiException( + "Missing the required parameter 'updateActivationForAudienceAlphaInput' when" + + " calling updateActivationForAudience(Async)"); + } + + return updateActivationForAudienceCall( + spaceId, audienceId, id, updateActivationForAudienceAlphaInput, _callback); + } + + /** + * Update Activation for Audience Updates an Activation. The rate limit for this endpoint is 10 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param updateActivationForAudienceAlphaInput (required) + * @return UpdateActivationForAudience200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public UpdateActivationForAudience200Response updateActivationForAudience( + String spaceId, + String audienceId, + String id, + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput) + throws ApiException { + ApiResponse localVarResp = + updateActivationForAudienceWithHttpInfo( + spaceId, audienceId, id, updateActivationForAudienceAlphaInput); + return localVarResp.getData(); + } + + /** + * Update Activation for Audience Updates an Activation. The rate limit for this endpoint is 10 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param updateActivationForAudienceAlphaInput (required) + * @return ApiResponse<UpdateActivationForAudience200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public ApiResponse + updateActivationForAudienceWithHttpInfo( + String spaceId, + String audienceId, + String id, + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput) + throws ApiException { + okhttp3.Call localVarCall = + updateActivationForAudienceValidateBeforeCall( + spaceId, audienceId, id, updateActivationForAudienceAlphaInput, null); + Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Activation for Audience (asynchronously) Updates an Activation. The rate limit for + * this endpoint is 10 requests per minute, which is lower than the default due to access + * pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code + * with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more + * information. + * + * @param spaceId (required) + * @param audienceId (required) + * @param id (required) + * @param updateActivationForAudienceAlphaInput (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body + * object + * @http.response.details + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK -
404 Resource not found -
422 Validation failure -
429 Too many requests -
+ */ + public okhttp3.Call updateActivationForAudienceAsync( + String spaceId, + String audienceId, + String id, + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput, + final ApiCallback _callback) + throws ApiException { + + okhttp3.Call localVarCall = + updateActivationForAudienceValidateBeforeCall( + spaceId, audienceId, id, updateActivationForAudienceAlphaInput, _callback); + Type localVarReturnType = + new TypeToken() {}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/segment/publicapi/models/ActivationSummaryOutput.java b/src/main/java/com/segment/publicapi/models/ActivationSummaryOutput.java new file mode 100644 index 00000000..a9a54016 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ActivationSummaryOutput.java @@ -0,0 +1,237 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** A class that encapsulates the output shared across endpoints for a given activation. */ +public class ActivationSummaryOutput { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public ActivationSummaryOutput() {} + + public ActivationSummaryOutput id(String id) { + + this.id = id; + return this; + } + + /** + * The activation id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ActivationSummaryOutput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Activation Enabled Status. + * + * @return enabled + */ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivationSummaryOutput activationSummaryOutput = (ActivationSummaryOutput) o; + return Objects.equals(this.id, activationSummaryOutput.id) + && Objects.equals(this.enabled, activationSummaryOutput.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(id, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivationSummaryOutput {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("enabled"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ActivationSummaryOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ActivationSummaryOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ActivationSummaryOutput is not found" + + " in the empty JSON string", + ActivationSummaryOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ActivationSummaryOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ActivationSummaryOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ActivationSummaryOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ActivationSummaryOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ActivationSummaryOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ActivationSummaryOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ActivationSummaryOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ActivationSummaryOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ActivationSummaryOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActivationSummaryOutput + * @throws IOException if the JSON string is invalid with respect to ActivationSummaryOutput + */ + public static ActivationSummaryOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ActivationSummaryOutput.class); + } + + /** + * Convert an instance of ActivationSummaryOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddActivationToAudience200Response.java b/src/main/java/com/segment/publicapi/models/AddActivationToAudience200Response.java new file mode 100644 index 00000000..46388317 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AddActivationToAudience200Response.java @@ -0,0 +1,201 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AddActivationToAudience200Response */ +public class AddActivationToAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private AddActivationToAudienceAlphaOutput data; + + public AddActivationToAudience200Response() {} + + public AddActivationToAudience200Response data(AddActivationToAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public AddActivationToAudienceAlphaOutput getData() { + return data; + } + + public void setData(AddActivationToAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddActivationToAudience200Response addActivationToAudience200Response = + (AddActivationToAudience200Response) o; + return Objects.equals(this.data, addActivationToAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddActivationToAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddActivationToAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddActivationToAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddActivationToAudience200Response is" + + " not found in the empty JSON string", + AddActivationToAudience200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddActivationToAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddActivationToAudience200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddActivationToAudienceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddActivationToAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddActivationToAudience200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddActivationToAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddActivationToAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddActivationToAudience200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddActivationToAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddActivationToAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * AddActivationToAudience200Response + */ + public static AddActivationToAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddActivationToAudience200Response.class); + } + + /** + * Convert an instance of AddActivationToAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaInput.java new file mode 100644 index 00000000..2bc63a65 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaInput.java @@ -0,0 +1,452 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input to create an activation. */ +public class AddActivationToAudienceAlphaInput { + public static final String SERIALIZED_NAME_VERSION_SCHEMA = "versionSchema"; + + @SerializedName(SERIALIZED_NAME_VERSION_SCHEMA) + private String versionSchema; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_DESTINATION_ID = "destinationId"; + + @SerializedName(SERIALIZED_NAME_DESTINATION_ID) + private String destinationId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_HAS_ENABLED_RESYNC = "hasEnabledResync"; + + @SerializedName(SERIALIZED_NAME_HAS_ENABLED_RESYNC) + private Boolean hasEnabledResync; + + public static final String SERIALIZED_NAME_EMIT_ENTITY_CONTEXT = "emitEntityContext"; + + @SerializedName(SERIALIZED_NAME_EMIT_ENTITY_CONTEXT) + private String emitEntityContext; + + public static final String SERIALIZED_NAME_EVENT_EMITTER = "eventEmitter"; + + @SerializedName(SERIALIZED_NAME_EVENT_EMITTER) + private Object eventEmitter = null; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + private Object subscription = null; + + public AddActivationToAudienceAlphaInput() {} + + public AddActivationToAudienceAlphaInput versionSchema(String versionSchema) { + + this.versionSchema = versionSchema; + return this; + } + + /** + * Version Schema. + * + * @return versionSchema + */ + @javax.annotation.Nonnull + public String getVersionSchema() { + return versionSchema; + } + + public void setVersionSchema(String versionSchema) { + this.versionSchema = versionSchema; + } + + public AddActivationToAudienceAlphaInput workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The id of the Workspace the audience exists within. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public AddActivationToAudienceAlphaInput destinationId(String destinationId) { + + this.destinationId = destinationId; + return this; + } + + /** + * The Destination id. + * + * @return destinationId + */ + @javax.annotation.Nonnull + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + + public AddActivationToAudienceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Whether the event emitter should be created in an enabled state. + * + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AddActivationToAudienceAlphaInput hasEnabledResync(Boolean hasEnabledResync) { + + this.hasEnabledResync = hasEnabledResync; + return this; + } + + /** + * Whether the event emitter should be created with the resync option. + * + * @return hasEnabledResync + */ + @javax.annotation.Nullable + public Boolean getHasEnabledResync() { + return hasEnabledResync; + } + + public void setHasEnabledResync(Boolean hasEnabledResync) { + this.hasEnabledResync = hasEnabledResync; + } + + public AddActivationToAudienceAlphaInput emitEntityContext(String emitEntityContext) { + + this.emitEntityContext = emitEntityContext; + return this; + } + + /** + * Whether the event emitter should emit events when the profile changes or when any enriched + * entity values changes. Only valid for identify events. + * + * @return emitEntityContext + */ + @javax.annotation.Nullable + public String getEmitEntityContext() { + return emitEntityContext; + } + + public void setEmitEntityContext(String emitEntityContext) { + this.emitEntityContext = emitEntityContext; + } + + public AddActivationToAudienceAlphaInput eventEmitter(Object eventEmitter) { + + this.eventEmitter = eventEmitter; + return this; + } + + /** + * Configuration settings for the event emitter to be created. + * + * @return eventEmitter + */ + @javax.annotation.Nullable + public Object getEventEmitter() { + return eventEmitter; + } + + public void setEventEmitter(Object eventEmitter) { + this.eventEmitter = eventEmitter; + } + + public AddActivationToAudienceAlphaInput subscription(Object subscription) { + + this.subscription = subscription; + return this; + } + + /** + * Subscription info to connect the event emitter to a Destination attached to the audience. + * + * @return subscription + */ + @javax.annotation.Nullable + public Object getSubscription() { + return subscription; + } + + public void setSubscription(Object subscription) { + this.subscription = subscription; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddActivationToAudienceAlphaInput addActivationToAudienceAlphaInput = + (AddActivationToAudienceAlphaInput) o; + return Objects.equals(this.versionSchema, addActivationToAudienceAlphaInput.versionSchema) + && Objects.equals(this.workspaceId, addActivationToAudienceAlphaInput.workspaceId) + && Objects.equals( + this.destinationId, addActivationToAudienceAlphaInput.destinationId) + && Objects.equals(this.enabled, addActivationToAudienceAlphaInput.enabled) + && Objects.equals( + this.hasEnabledResync, addActivationToAudienceAlphaInput.hasEnabledResync) + && Objects.equals( + this.emitEntityContext, addActivationToAudienceAlphaInput.emitEntityContext) + && Objects.equals(this.eventEmitter, addActivationToAudienceAlphaInput.eventEmitter) + && Objects.equals( + this.subscription, addActivationToAudienceAlphaInput.subscription); + } + + @Override + public int hashCode() { + return Objects.hash( + versionSchema, + workspaceId, + destinationId, + enabled, + hasEnabledResync, + emitEntityContext, + eventEmitter, + subscription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddActivationToAudienceAlphaInput {\n"); + sb.append(" versionSchema: ").append(toIndentedString(versionSchema)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" destinationId: ").append(toIndentedString(destinationId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" hasEnabledResync: ").append(toIndentedString(hasEnabledResync)).append("\n"); + sb.append(" emitEntityContext: ") + .append(toIndentedString(emitEntityContext)) + .append("\n"); + sb.append(" eventEmitter: ").append(toIndentedString(eventEmitter)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("versionSchema"); + openapiFields.add("workspaceId"); + openapiFields.add("destinationId"); + openapiFields.add("enabled"); + openapiFields.add("hasEnabledResync"); + openapiFields.add("emitEntityContext"); + openapiFields.add("eventEmitter"); + openapiFields.add("subscription"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("versionSchema"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("destinationId"); + openapiRequiredFields.add("eventEmitter"); + openapiRequiredFields.add("subscription"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddActivationToAudienceAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddActivationToAudienceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddActivationToAudienceAlphaInput is" + + " not found in the empty JSON string", + AddActivationToAudienceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddActivationToAudienceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddActivationToAudienceAlphaInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddActivationToAudienceAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("versionSchema").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `versionSchema` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("versionSchema").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + if (!jsonObj.get("destinationId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `destinationId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("destinationId").toString())); + } + if ((jsonObj.get("emitEntityContext") != null + && !jsonObj.get("emitEntityContext").isJsonNull()) + && !jsonObj.get("emitEntityContext").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `emitEntityContext` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("emitEntityContext").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddActivationToAudienceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddActivationToAudienceAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddActivationToAudienceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddActivationToAudienceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddActivationToAudienceAlphaInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddActivationToAudienceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddActivationToAudienceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * AddActivationToAudienceAlphaInput + */ + public static AddActivationToAudienceAlphaInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddActivationToAudienceAlphaInput.class); + } + + /** + * Convert an instance of AddActivationToAudienceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaOutput.java new file mode 100644 index 00000000..f99dbbca --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AddActivationToAudienceAlphaOutput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Activation output for create. */ +public class AddActivationToAudienceAlphaOutput { + public static final String SERIALIZED_NAME_ACTIVATION = "activation"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION) + private ActivationSummaryOutput activation; + + public AddActivationToAudienceAlphaOutput() {} + + public AddActivationToAudienceAlphaOutput activation(ActivationSummaryOutput activation) { + + this.activation = activation; + return this; + } + + /** + * Get activation + * + * @return activation + */ + @javax.annotation.Nonnull + public ActivationSummaryOutput getActivation() { + return activation; + } + + public void setActivation(ActivationSummaryOutput activation) { + this.activation = activation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddActivationToAudienceAlphaOutput addActivationToAudienceAlphaOutput = + (AddActivationToAudienceAlphaOutput) o; + return Objects.equals(this.activation, addActivationToAudienceAlphaOutput.activation); + } + + @Override + public int hashCode() { + return Objects.hash(activation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddActivationToAudienceAlphaOutput {\n"); + sb.append(" activation: ").append(toIndentedString(activation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("activation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddActivationToAudienceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddActivationToAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddActivationToAudienceAlphaOutput is" + + " not found in the empty JSON string", + AddActivationToAudienceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddActivationToAudienceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddActivationToAudienceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddActivationToAudienceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `activation` + ActivationSummaryOutput.validateJsonElement(jsonObj.get("activation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddActivationToAudienceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddActivationToAudienceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddActivationToAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddActivationToAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddActivationToAudienceAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddActivationToAudienceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddActivationToAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * AddActivationToAudienceAlphaOutput + */ + public static AddActivationToAudienceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddActivationToAudienceAlphaOutput.class); + } + + /** + * Convert an instance of AddActivationToAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddDestinationToAudience200Response.java b/src/main/java/com/segment/publicapi/models/AddDestinationToAudience200Response.java new file mode 100644 index 00000000..c38032f6 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AddDestinationToAudience200Response.java @@ -0,0 +1,201 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AddDestinationToAudience200Response */ +public class AddDestinationToAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private AddDestinationToAudienceAlphaOutput data; + + public AddDestinationToAudience200Response() {} + + public AddDestinationToAudience200Response data(AddDestinationToAudienceAlphaOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public AddDestinationToAudienceAlphaOutput getData() { + return data; + } + + public void setData(AddDestinationToAudienceAlphaOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddDestinationToAudience200Response addDestinationToAudience200Response = + (AddDestinationToAudience200Response) o; + return Objects.equals(this.data, addDestinationToAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddDestinationToAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddDestinationToAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddDestinationToAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddDestinationToAudience200Response is" + + " not found in the empty JSON string", + AddDestinationToAudience200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddDestinationToAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddDestinationToAudience200Response` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + AddDestinationToAudienceAlphaOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddDestinationToAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddDestinationToAudience200Response' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddDestinationToAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddDestinationToAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddDestinationToAudience200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddDestinationToAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddDestinationToAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * AddDestinationToAudience200Response + */ + public static AddDestinationToAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddDestinationToAudience200Response.class); + } + + /** + * Convert an instance of AddDestinationToAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaInput.java b/src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaInput.java new file mode 100644 index 00000000..cb20e3b9 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaInput.java @@ -0,0 +1,282 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input to Add a Destination into an Audience. */ +public class AddDestinationToAudienceAlphaInput { + public static final String SERIALIZED_NAME_VERSION_SCHEMA = "versionSchema"; + + @SerializedName(SERIALIZED_NAME_VERSION_SCHEMA) + private String versionSchema; + + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + + @SerializedName(SERIALIZED_NAME_DESTINATION) + private DestinationInput destination; + + public AddDestinationToAudienceAlphaInput() {} + + public AddDestinationToAudienceAlphaInput versionSchema(String versionSchema) { + + this.versionSchema = versionSchema; + return this; + } + + /** + * Version Schema. + * + * @return versionSchema + */ + @javax.annotation.Nonnull + public String getVersionSchema() { + return versionSchema; + } + + public void setVersionSchema(String versionSchema) { + this.versionSchema = versionSchema; + } + + public AddDestinationToAudienceAlphaInput workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The id of the Workspace the audience exists within. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public AddDestinationToAudienceAlphaInput destination(DestinationInput destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * + * @return destination + */ + @javax.annotation.Nonnull + public DestinationInput getDestination() { + return destination; + } + + public void setDestination(DestinationInput destination) { + this.destination = destination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddDestinationToAudienceAlphaInput addDestinationToAudienceAlphaInput = + (AddDestinationToAudienceAlphaInput) o; + return Objects.equals(this.versionSchema, addDestinationToAudienceAlphaInput.versionSchema) + && Objects.equals(this.workspaceId, addDestinationToAudienceAlphaInput.workspaceId) + && Objects.equals(this.destination, addDestinationToAudienceAlphaInput.destination); + } + + @Override + public int hashCode() { + return Objects.hash(versionSchema, workspaceId, destination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddDestinationToAudienceAlphaInput {\n"); + sb.append(" versionSchema: ").append(toIndentedString(versionSchema)).append("\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("versionSchema"); + openapiFields.add("workspaceId"); + openapiFields.add("destination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("versionSchema"); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("destination"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddDestinationToAudienceAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddDestinationToAudienceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddDestinationToAudienceAlphaInput is" + + " not found in the empty JSON string", + AddDestinationToAudienceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddDestinationToAudienceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddDestinationToAudienceAlphaInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddDestinationToAudienceAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("versionSchema").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `versionSchema` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("versionSchema").toString())); + } + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + // validate the required field `destination` + DestinationInput.validateJsonElement(jsonObj.get("destination")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddDestinationToAudienceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddDestinationToAudienceAlphaInput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddDestinationToAudienceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddDestinationToAudienceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddDestinationToAudienceAlphaInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddDestinationToAudienceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddDestinationToAudienceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * AddDestinationToAudienceAlphaInput + */ + public static AddDestinationToAudienceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddDestinationToAudienceAlphaInput.class); + } + + /** + * Convert an instance of AddDestinationToAudienceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaOutput.java b/src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaOutput.java new file mode 100644 index 00000000..3b002a63 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/AddDestinationToAudienceAlphaOutput.java @@ -0,0 +1,210 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** AddDestinationToAudienceAlphaOutput */ +public class AddDestinationToAudienceAlphaOutput { + public static final String SERIALIZED_NAME_CONNECTION = "connection"; + + @SerializedName(SERIALIZED_NAME_CONNECTION) + private Connection connection; + + public AddDestinationToAudienceAlphaOutput() {} + + public AddDestinationToAudienceAlphaOutput connection(Connection connection) { + + this.connection = connection; + return this; + } + + /** + * Get connection + * + * @return connection + */ + @javax.annotation.Nonnull + public Connection getConnection() { + return connection; + } + + public void setConnection(Connection connection) { + this.connection = connection; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddDestinationToAudienceAlphaOutput addDestinationToAudienceAlphaOutput = + (AddDestinationToAudienceAlphaOutput) o; + return Objects.equals(this.connection, addDestinationToAudienceAlphaOutput.connection); + } + + @Override + public int hashCode() { + return Objects.hash(connection); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddDestinationToAudienceAlphaOutput {\n"); + sb.append(" connection: ").append(toIndentedString(connection)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connection"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connection"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * AddDestinationToAudienceAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddDestinationToAudienceAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in AddDestinationToAudienceAlphaOutput is" + + " not found in the empty JSON string", + AddDestinationToAudienceAlphaOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddDestinationToAudienceAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `AddDestinationToAudienceAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddDestinationToAudienceAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `connection` + Connection.validateJsonElement(jsonObj.get("connection")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddDestinationToAudienceAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddDestinationToAudienceAlphaOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(AddDestinationToAudienceAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, AddDestinationToAudienceAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddDestinationToAudienceAlphaOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of AddDestinationToAudienceAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddDestinationToAudienceAlphaOutput + * @throws IOException if the JSON string is invalid with respect to + * AddDestinationToAudienceAlphaOutput + */ + public static AddDestinationToAudienceAlphaOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, AddDestinationToAudienceAlphaOutput.class); + } + + /** + * Convert an instance of AddDestinationToAudienceAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/Connection.java b/src/main/java/com/segment/publicapi/models/Connection.java new file mode 100644 index 00000000..7837ec7b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/Connection.java @@ -0,0 +1,206 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The connection that was created. */ +public class Connection { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public Connection() {} + + public Connection id(String id) { + + this.id = id; + return this; + } + + /** + * The id of the connection that was created. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Connection connection = (Connection) o; + return Objects.equals(this.id, connection.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Connection {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Connection + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Connection.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in Connection is not found in the empty" + + " JSON string", + Connection.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Connection.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `Connection` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Connection.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Connection.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Connection' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(Connection.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, Connection value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Connection read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of Connection given an JSON string + * + * @param jsonString JSON string + * @return An instance of Connection + * @throws IOException if the JSON string is invalid with respect to Connection + */ + public static Connection fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Connection.class); + } + + /** + * Convert an instance of Connection to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DeleteActivationAlphaOutput.java b/src/main/java/com/segment/publicapi/models/DeleteActivationAlphaOutput.java new file mode 100644 index 00000000..403303bf --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DeleteActivationAlphaOutput.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for deleting an activation. */ +public class DeleteActivationAlphaOutput { + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public DeleteActivationAlphaOutput() {} + + public DeleteActivationAlphaOutput status(String status) { + + this.status = status; + return this; + } + + /** + * Deletion status. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteActivationAlphaOutput deleteActivationAlphaOutput = (DeleteActivationAlphaOutput) o; + return Objects.equals(this.status, deleteActivationAlphaOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteActivationAlphaOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * DeleteActivationAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteActivationAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DeleteActivationAlphaOutput is not" + + " found in the empty JSON string", + DeleteActivationAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DeleteActivationAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DeleteActivationAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteActivationAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteActivationAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteActivationAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DeleteActivationAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteActivationAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteActivationAlphaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteActivationAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteActivationAlphaOutput + * @throws IOException if the JSON string is invalid with respect to DeleteActivationAlphaOutput + */ + public static DeleteActivationAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteActivationAlphaOutput.class); + } + + /** + * Convert an instance of DeleteActivationAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/DestinationInput.java b/src/main/java/com/segment/publicapi/models/DestinationInput.java new file mode 100644 index 00000000..22419f6b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/DestinationInput.java @@ -0,0 +1,243 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** The Destination Input Object. */ +public class DestinationInput { + public static final String SERIALIZED_NAME_ID = "id"; + + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public DestinationInput() {} + + public DestinationInput id(String id) { + + this.id = id; + return this; + } + + /** + * The Destination instance id. + * + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DestinationInput type(String type) { + + this.type = type; + return this; + } + + /** + * Type of Destination to add to the audience. + * + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DestinationInput destinationInput = (DestinationInput) o; + return Objects.equals(this.id, destinationInput.id) + && Objects.equals(this.type, destinationInput.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DestinationInput {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DestinationInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DestinationInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DestinationInput is not found in the" + + " empty JSON string", + DestinationInput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DestinationInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `DestinationInput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DestinationInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DestinationInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DestinationInput' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DestinationInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DestinationInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DestinationInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DestinationInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of DestinationInput + * @throws IOException if the JSON string is invalid with respect to DestinationInput + */ + public static DestinationInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DestinationInput.class); + } + + /** + * Convert an instance of DestinationInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetActivationFromAudience200Response.java b/src/main/java/com/segment/publicapi/models/GetActivationFromAudience200Response.java new file mode 100644 index 00000000..1a3b4340 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetActivationFromAudience200Response.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** GetActivationFromAudience200Response */ +public class GetActivationFromAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private GetActivationFromAudienceOutput data; + + public GetActivationFromAudience200Response() {} + + public GetActivationFromAudience200Response data(GetActivationFromAudienceOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public GetActivationFromAudienceOutput getData() { + return data; + } + + public void setData(GetActivationFromAudienceOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetActivationFromAudience200Response getActivationFromAudience200Response = + (GetActivationFromAudience200Response) o; + return Objects.equals(this.data, getActivationFromAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetActivationFromAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetActivationFromAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetActivationFromAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetActivationFromAudience200Response" + + " is not found in the empty JSON string", + GetActivationFromAudience200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetActivationFromAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetActivationFromAudience200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + GetActivationFromAudienceOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetActivationFromAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetActivationFromAudience200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetActivationFromAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetActivationFromAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetActivationFromAudience200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetActivationFromAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetActivationFromAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * GetActivationFromAudience200Response + */ + public static GetActivationFromAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetActivationFromAudience200Response.class); + } + + /** + * Convert an instance of GetActivationFromAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/GetActivationFromAudienceOutput.java b/src/main/java/com/segment/publicapi/models/GetActivationFromAudienceOutput.java new file mode 100644 index 00000000..acb430b7 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/GetActivationFromAudienceOutput.java @@ -0,0 +1,208 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for getting an activation from space and audience. */ +public class GetActivationFromAudienceOutput { + public static final String SERIALIZED_NAME_ACTIVATION = "activation"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION) + private ActivationSummaryOutput activation; + + public GetActivationFromAudienceOutput() {} + + public GetActivationFromAudienceOutput activation(ActivationSummaryOutput activation) { + + this.activation = activation; + return this; + } + + /** + * Get activation + * + * @return activation + */ + @javax.annotation.Nonnull + public ActivationSummaryOutput getActivation() { + return activation; + } + + public void setActivation(ActivationSummaryOutput activation) { + this.activation = activation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetActivationFromAudienceOutput getActivationFromAudienceOutput = + (GetActivationFromAudienceOutput) o; + return Objects.equals(this.activation, getActivationFromAudienceOutput.activation); + } + + @Override + public int hashCode() { + return Objects.hash(activation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetActivationFromAudienceOutput {\n"); + sb.append(" activation: ").append(toIndentedString(activation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("activation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * GetActivationFromAudienceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetActivationFromAudienceOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetActivationFromAudienceOutput is not" + + " found in the empty JSON string", + GetActivationFromAudienceOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GetActivationFromAudienceOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `GetActivationFromAudienceOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetActivationFromAudienceOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `activation` + ActivationSummaryOutput.validateJsonElement(jsonObj.get("activation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetActivationFromAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetActivationFromAudienceOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetActivationFromAudienceOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetActivationFromAudienceOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetActivationFromAudienceOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetActivationFromAudienceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetActivationFromAudienceOutput + * @throws IOException if the JSON string is invalid with respect to + * GetActivationFromAudienceOutput + */ + public static GetActivationFromAudienceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetActivationFromAudienceOutput.class); + } + + /** + * Convert an instance of GetActivationFromAudienceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListActivationsAlphaOutput.java b/src/main/java/com/segment/publicapi/models/ListActivationsAlphaOutput.java new file mode 100644 index 00000000..8e70a2da --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListActivationsAlphaOutput.java @@ -0,0 +1,259 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for listing all activations. */ +public class ListActivationsAlphaOutput { + public static final String SERIALIZED_NAME_ACTIVATIONS = "activations"; + + @SerializedName(SERIALIZED_NAME_ACTIVATIONS) + private List activations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationOutput pagination; + + public ListActivationsAlphaOutput() {} + + public ListActivationsAlphaOutput activations(List activations) { + + this.activations = activations; + return this; + } + + public ListActivationsAlphaOutput addActivationsItem(ActivationSummaryOutput activationsItem) { + if (this.activations == null) { + this.activations = new ArrayList<>(); + } + this.activations.add(activationsItem); + return this; + } + + /** + * A list of activation results. + * + * @return activations + */ + @javax.annotation.Nonnull + public List getActivations() { + return activations; + } + + public void setActivations(List activations) { + this.activations = activations; + } + + public ListActivationsAlphaOutput pagination(PaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + public PaginationOutput getPagination() { + return pagination; + } + + public void setPagination(PaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListActivationsAlphaOutput listActivationsAlphaOutput = (ListActivationsAlphaOutput) o; + return Objects.equals(this.activations, listActivationsAlphaOutput.activations) + && Objects.equals(this.pagination, listActivationsAlphaOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(activations, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListActivationsAlphaOutput {\n"); + sb.append(" activations: ").append(toIndentedString(activations)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activations"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("activations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ListActivationsAlphaOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListActivationsAlphaOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListActivationsAlphaOutput is not" + + " found in the empty JSON string", + ListActivationsAlphaOutput.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListActivationsAlphaOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListActivationsAlphaOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListActivationsAlphaOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("activations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activations` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("activations").toString())); + } + + JsonArray jsonArrayactivations = jsonObj.getAsJsonArray("activations"); + // validate the required field `activations` (array) + for (int i = 0; i < jsonArrayactivations.size(); i++) { + ActivationSummaryOutput.validateJsonElement(jsonArrayactivations.get(i)); + } + ; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListActivationsAlphaOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListActivationsAlphaOutput' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(ListActivationsAlphaOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListActivationsAlphaOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListActivationsAlphaOutput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListActivationsAlphaOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListActivationsAlphaOutput + * @throws IOException if the JSON string is invalid with respect to ListActivationsAlphaOutput + */ + public static ListActivationsAlphaOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListActivationsAlphaOutput.class); + } + + /** + * Convert an instance of ListActivationsAlphaOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListActivationsFromAudience200Response.java b/src/main/java/com/segment/publicapi/models/ListActivationsFromAudience200Response.java new file mode 100644 index 00000000..eec3e00b --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListActivationsFromAudience200Response.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** ListActivationsFromAudience200Response */ +public class ListActivationsFromAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private ListActivationsFromAudienceOutput data; + + public ListActivationsFromAudience200Response() {} + + public ListActivationsFromAudience200Response data(ListActivationsFromAudienceOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public ListActivationsFromAudienceOutput getData() { + return data; + } + + public void setData(ListActivationsFromAudienceOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListActivationsFromAudience200Response listActivationsFromAudience200Response = + (ListActivationsFromAudience200Response) o; + return Objects.equals(this.data, listActivationsFromAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListActivationsFromAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListActivationsFromAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListActivationsFromAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListActivationsFromAudience200Response" + + " is not found in the empty JSON string", + ListActivationsFromAudience200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListActivationsFromAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListActivationsFromAudience200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + ListActivationsFromAudienceOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListActivationsFromAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListActivationsFromAudience200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListActivationsFromAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, ListActivationsFromAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListActivationsFromAudience200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListActivationsFromAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListActivationsFromAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * ListActivationsFromAudience200Response + */ + public static ListActivationsFromAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, ListActivationsFromAudience200Response.class); + } + + /** + * Convert an instance of ListActivationsFromAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/ListActivationsFromAudienceOutput.java b/src/main/java/com/segment/publicapi/models/ListActivationsFromAudienceOutput.java new file mode 100644 index 00000000..2c79da79 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/ListActivationsFromAudienceOutput.java @@ -0,0 +1,267 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for listing activations from space and audience. */ +public class ListActivationsFromAudienceOutput { + public static final String SERIALIZED_NAME_ACTIVATIONS = "activations"; + + @SerializedName(SERIALIZED_NAME_ACTIVATIONS) + private List activations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGINATION = "pagination"; + + @SerializedName(SERIALIZED_NAME_PAGINATION) + private PaginationOutput pagination; + + public ListActivationsFromAudienceOutput() {} + + public ListActivationsFromAudienceOutput activations( + List activations) { + + this.activations = activations; + return this; + } + + public ListActivationsFromAudienceOutput addActivationsItem( + ActivationSummaryOutput activationsItem) { + if (this.activations == null) { + this.activations = new ArrayList<>(); + } + this.activations.add(activationsItem); + return this; + } + + /** + * A list of activation results. + * + * @return activations + */ + @javax.annotation.Nonnull + public List getActivations() { + return activations; + } + + public void setActivations(List activations) { + this.activations = activations; + } + + public ListActivationsFromAudienceOutput pagination(PaginationOutput pagination) { + + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * + * @return pagination + */ + @javax.annotation.Nullable + public PaginationOutput getPagination() { + return pagination; + } + + public void setPagination(PaginationOutput pagination) { + this.pagination = pagination; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListActivationsFromAudienceOutput listActivationsFromAudienceOutput = + (ListActivationsFromAudienceOutput) o; + return Objects.equals(this.activations, listActivationsFromAudienceOutput.activations) + && Objects.equals(this.pagination, listActivationsFromAudienceOutput.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(activations, pagination); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListActivationsFromAudienceOutput {\n"); + sb.append(" activations: ").append(toIndentedString(activations)).append("\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activations"); + openapiFields.add("pagination"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("activations"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * ListActivationsFromAudienceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ListActivationsFromAudienceOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in ListActivationsFromAudienceOutput is" + + " not found in the empty JSON string", + ListActivationsFromAudienceOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ListActivationsFromAudienceOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `ListActivationsFromAudienceOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListActivationsFromAudienceOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("activations").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `activations` to be an array in the JSON string but" + + " got `%s`", + jsonObj.get("activations").toString())); + } + + JsonArray jsonArrayactivations = jsonObj.getAsJsonArray("activations"); + // validate the required field `activations` (array) + for (int i = 0; i < jsonArrayactivations.size(); i++) { + ActivationSummaryOutput.validateJsonElement(jsonArrayactivations.get(i)); + } + ; + // validate the optional field `pagination` + if (jsonObj.get("pagination") != null && !jsonObj.get("pagination").isJsonNull()) { + PaginationOutput.validateJsonElement(jsonObj.get("pagination")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListActivationsFromAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListActivationsFromAudienceOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(ListActivationsFromAudienceOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, ListActivationsFromAudienceOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListActivationsFromAudienceOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of ListActivationsFromAudienceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListActivationsFromAudienceOutput + * @throws IOException if the JSON string is invalid with respect to + * ListActivationsFromAudienceOutput + */ + public static ListActivationsFromAudienceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListActivationsFromAudienceOutput.class); + } + + /** + * Convert an instance of ListActivationsFromAudienceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveActivationFromAudience200Response.java b/src/main/java/com/segment/publicapi/models/RemoveActivationFromAudience200Response.java new file mode 100644 index 00000000..6f5daabd --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveActivationFromAudience200Response.java @@ -0,0 +1,205 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** RemoveActivationFromAudience200Response */ +public class RemoveActivationFromAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private RemoveActivationFromAudienceOutput data; + + public RemoveActivationFromAudience200Response() {} + + public RemoveActivationFromAudience200Response data(RemoveActivationFromAudienceOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public RemoveActivationFromAudienceOutput getData() { + return data; + } + + public void setData(RemoveActivationFromAudienceOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveActivationFromAudience200Response removeActivationFromAudience200Response = + (RemoveActivationFromAudience200Response) o; + return Objects.equals(this.data, removeActivationFromAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveActivationFromAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RemoveActivationFromAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RemoveActivationFromAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " RemoveActivationFromAudience200Response is not found in the" + + " empty JSON string", + RemoveActivationFromAudience200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RemoveActivationFromAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveActivationFromAudience200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + RemoveActivationFromAudienceOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveActivationFromAudience200Response.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'RemoveActivationFromAudience200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveActivationFromAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, RemoveActivationFromAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveActivationFromAudience200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveActivationFromAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveActivationFromAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * RemoveActivationFromAudience200Response + */ + public static RemoveActivationFromAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveActivationFromAudience200Response.class); + } + + /** + * Convert an instance of RemoveActivationFromAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/RemoveActivationFromAudienceOutput.java b/src/main/java/com/segment/publicapi/models/RemoveActivationFromAudienceOutput.java new file mode 100644 index 00000000..3fa56230 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/RemoveActivationFromAudienceOutput.java @@ -0,0 +1,215 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for removing an activation from audience. */ +public class RemoveActivationFromAudienceOutput { + public static final String SERIALIZED_NAME_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public RemoveActivationFromAudienceOutput() {} + + public RemoveActivationFromAudienceOutput status(String status) { + + this.status = status; + return this; + } + + /** + * Deletion status. + * + * @return status + */ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveActivationFromAudienceOutput removeActivationFromAudienceOutput = + (RemoveActivationFromAudienceOutput) o; + return Objects.equals(this.status, removeActivationFromAudienceOutput.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveActivationFromAudienceOutput {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * RemoveActivationFromAudienceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RemoveActivationFromAudienceOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in RemoveActivationFromAudienceOutput is" + + " not found in the empty JSON string", + RemoveActivationFromAudienceOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RemoveActivationFromAudienceOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `RemoveActivationFromAudienceOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveActivationFromAudienceOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveActivationFromAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveActivationFromAudienceOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(RemoveActivationFromAudienceOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveActivationFromAudienceOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveActivationFromAudienceOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveActivationFromAudienceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveActivationFromAudienceOutput + * @throws IOException if the JSON string is invalid with respect to + * RemoveActivationFromAudienceOutput + */ + public static RemoveActivationFromAudienceOutput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveActivationFromAudienceOutput.class); + } + + /** + * Convert an instance of RemoveActivationFromAudienceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateActivationForAudience200Response.java b/src/main/java/com/segment/publicapi/models/UpdateActivationForAudience200Response.java new file mode 100644 index 00000000..c6946d4e --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateActivationForAudience200Response.java @@ -0,0 +1,203 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** UpdateActivationForAudience200Response */ +public class UpdateActivationForAudience200Response { + public static final String SERIALIZED_NAME_DATA = "data"; + + @SerializedName(SERIALIZED_NAME_DATA) + private UpdateActivationForAudienceOutput data; + + public UpdateActivationForAudience200Response() {} + + public UpdateActivationForAudience200Response data(UpdateActivationForAudienceOutput data) { + + this.data = data; + return this; + } + + /** + * Get data + * + * @return data + */ + @javax.annotation.Nullable + public UpdateActivationForAudienceOutput getData() { + return data; + } + + public void setData(UpdateActivationForAudienceOutput data) { + this.data = data; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateActivationForAudience200Response updateActivationForAudience200Response = + (UpdateActivationForAudience200Response) o; + return Objects.equals(this.data, updateActivationForAudience200Response.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateActivationForAudience200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateActivationForAudience200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateActivationForAudience200Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateActivationForAudience200Response" + + " is not found in the empty JSON string", + UpdateActivationForAudience200Response.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateActivationForAudience200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateActivationForAudience200Response` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + UpdateActivationForAudienceOutput.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateActivationForAudience200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateActivationForAudience200Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateActivationForAudience200Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateActivationForAudience200Response value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateActivationForAudience200Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateActivationForAudience200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateActivationForAudience200Response + * @throws IOException if the JSON string is invalid with respect to + * UpdateActivationForAudience200Response + */ + public static UpdateActivationForAudience200Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateActivationForAudience200Response.class); + } + + /** + * Convert an instance of UpdateActivationForAudience200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceAlphaInput.java b/src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceAlphaInput.java new file mode 100644 index 00000000..5d76d41c --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceAlphaInput.java @@ -0,0 +1,305 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Input to update an activation. */ +public class UpdateActivationForAudienceAlphaInput { + public static final String SERIALIZED_NAME_WORKSPACE_ID = "workspaceId"; + + @SerializedName(SERIALIZED_NAME_WORKSPACE_ID) + private String workspaceId; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_EVENT_EMITTER = "eventEmitter"; + + @SerializedName(SERIALIZED_NAME_EVENT_EMITTER) + private Object eventEmitter = null; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "subscription"; + + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + private Object subscription = null; + + public UpdateActivationForAudienceAlphaInput() {} + + public UpdateActivationForAudienceAlphaInput workspaceId(String workspaceId) { + + this.workspaceId = workspaceId; + return this; + } + + /** + * The Workspace id. + * + * @return workspaceId + */ + @javax.annotation.Nonnull + public String getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + } + + public UpdateActivationForAudienceAlphaInput enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Determines whether an activation is enabled. + * + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UpdateActivationForAudienceAlphaInput eventEmitter(Object eventEmitter) { + + this.eventEmitter = eventEmitter; + return this; + } + + /** + * Configuration settings for the event emitter to be created. + * + * @return eventEmitter + */ + @javax.annotation.Nullable + public Object getEventEmitter() { + return eventEmitter; + } + + public void setEventEmitter(Object eventEmitter) { + this.eventEmitter = eventEmitter; + } + + public UpdateActivationForAudienceAlphaInput subscription(Object subscription) { + + this.subscription = subscription; + return this; + } + + /** + * Subscription info to connect the event emitter to a Destination attached to the audience. + * + * @return subscription + */ + @javax.annotation.Nullable + public Object getSubscription() { + return subscription; + } + + public void setSubscription(Object subscription) { + this.subscription = subscription; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateActivationForAudienceAlphaInput updateActivationForAudienceAlphaInput = + (UpdateActivationForAudienceAlphaInput) o; + return Objects.equals(this.workspaceId, updateActivationForAudienceAlphaInput.workspaceId) + && Objects.equals(this.enabled, updateActivationForAudienceAlphaInput.enabled) + && Objects.equals( + this.eventEmitter, updateActivationForAudienceAlphaInput.eventEmitter) + && Objects.equals( + this.subscription, updateActivationForAudienceAlphaInput.subscription); + } + + @Override + public int hashCode() { + return Objects.hash(workspaceId, enabled, eventEmitter, subscription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateActivationForAudienceAlphaInput {\n"); + sb.append(" workspaceId: ").append(toIndentedString(workspaceId)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" eventEmitter: ").append(toIndentedString(eventEmitter)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workspaceId"); + openapiFields.add("enabled"); + openapiFields.add("eventEmitter"); + openapiFields.add("subscription"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workspaceId"); + openapiRequiredFields.add("eventEmitter"); + openapiRequiredFields.add("subscription"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateActivationForAudienceAlphaInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateActivationForAudienceAlphaInput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateActivationForAudienceAlphaInput" + + " is not found in the empty JSON string", + UpdateActivationForAudienceAlphaInput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateActivationForAudienceAlphaInput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateActivationForAudienceAlphaInput` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateActivationForAudienceAlphaInput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("workspaceId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `workspaceId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workspaceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateActivationForAudienceAlphaInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateActivationForAudienceAlphaInput' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateActivationForAudienceAlphaInput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UpdateActivationForAudienceAlphaInput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateActivationForAudienceAlphaInput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateActivationForAudienceAlphaInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateActivationForAudienceAlphaInput + * @throws IOException if the JSON string is invalid with respect to + * UpdateActivationForAudienceAlphaInput + */ + public static UpdateActivationForAudienceAlphaInput fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateActivationForAudienceAlphaInput.class); + } + + /** + * Convert an instance of UpdateActivationForAudienceAlphaInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceOutput.java b/src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceOutput.java new file mode 100644 index 00000000..e132a392 --- /dev/null +++ b/src/main/java/com/segment/publicapi/models/UpdateActivationForAudienceOutput.java @@ -0,0 +1,209 @@ +/* + * Segment Public API + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. + * + * Contact: friends@segment.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.segment.publicapi.models; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.segment.publicapi.JSON; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** Output for updating an activation for audience. */ +public class UpdateActivationForAudienceOutput { + public static final String SERIALIZED_NAME_ACTIVATION = "activation"; + + @SerializedName(SERIALIZED_NAME_ACTIVATION) + private ActivationSummaryOutput activation; + + public UpdateActivationForAudienceOutput() {} + + public UpdateActivationForAudienceOutput activation(ActivationSummaryOutput activation) { + + this.activation = activation; + return this; + } + + /** + * Get activation + * + * @return activation + */ + @javax.annotation.Nonnull + public ActivationSummaryOutput getActivation() { + return activation; + } + + public void setActivation(ActivationSummaryOutput activation) { + this.activation = activation; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateActivationForAudienceOutput updateActivationForAudienceOutput = + (UpdateActivationForAudienceOutput) o; + return Objects.equals(this.activation, updateActivationForAudienceOutput.activation); + } + + @Override + public int hashCode() { + return Objects.hash(activation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateActivationForAudienceOutput {\n"); + sb.append(" activation: ").append(toIndentedString(activation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("activation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("activation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * UpdateActivationForAudienceOutput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateActivationForAudienceOutput.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in UpdateActivationForAudienceOutput is" + + " not found in the empty JSON string", + UpdateActivationForAudienceOutput.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateActivationForAudienceOutput.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UpdateActivationForAudienceOutput` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateActivationForAudienceOutput.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `activation` + ActivationSummaryOutput.validateJsonElement(jsonObj.get("activation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateActivationForAudienceOutput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateActivationForAudienceOutput' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UpdateActivationForAudienceOutput.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateActivationForAudienceOutput value) + throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateActivationForAudienceOutput read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateActivationForAudienceOutput given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateActivationForAudienceOutput + * @throws IOException if the JSON string is invalid with respect to + * UpdateActivationForAudienceOutput + */ + public static UpdateActivationForAudienceOutput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateActivationForAudienceOutput.class); + } + + /** + * Convert an instance of UpdateActivationForAudienceOutput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} From 22d0a09559c5a38635a8ee62c287beea70409774 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 14 Jul 2025 22:17:12 +0000 Subject: [PATCH 464/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@27cb9476. From 16d97f0bc7d115a37a96524c409d22fc6e62ff4f Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 14 Jul 2025 23:31:13 +0000 Subject: [PATCH 465/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ba81a719. --- README.md | 8 ++++---- pom.xml | 2 +- src/main/java/com/segment/publicapi/ApiClient.java | 2 +- src/main/java/com/segment/publicapi/Configuration.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e6e37b0b..216a1a61 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ All endpoints in the API follow REST conventions and use standard HTTP methods. See the next sections for more information on how to use the Segment Public API Java SDK. -Latest API and SDK version: 58.12.0 +Latest API and SDK version: 58.13.0 ## Requirements @@ -28,7 +28,7 @@ Add this dependency to your project's POM: com.segment.publicapi segment-publicapi - 58.12.0 + 58.13.0 compile ``` @@ -44,7 +44,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.segment.publicapi:segment-publicapi:58.12.0" + implementation "com.segment.publicapi:segment-publicapi:58.13.0" } ``` @@ -58,7 +58,7 @@ mvn clean package Then manually install the following JARs: -* `target/segment-publicapi-58.12.0.jar` +* `target/segment-publicapi-58.13.0.jar` * `target/lib/*.jar` You are now ready to start making calls to Public API! diff --git a/pom.xml b/pom.xml index 82faec54..38d3eff8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ segment-publicapi jar segment-publicapi - 58.12.0 + 58.13.0 https://segment.com/docs/api/public-api/ Segment Public API diff --git a/src/main/java/com/segment/publicapi/ApiClient.java b/src/main/java/com/segment/publicapi/ApiClient.java index c0537f14..f89365d8 100644 --- a/src/main/java/com/segment/publicapi/ApiClient.java +++ b/src/main/java/com/segment/publicapi/ApiClient.java @@ -123,7 +123,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("Public API SDK 58.12.0 (Java)"); + setUserAgent("Public API SDK 58.13.0 (Java)"); authentications = new HashMap(); } diff --git a/src/main/java/com/segment/publicapi/Configuration.java b/src/main/java/com/segment/publicapi/Configuration.java index b1003b0c..1b49b628 100644 --- a/src/main/java/com/segment/publicapi/Configuration.java +++ b/src/main/java/com/segment/publicapi/Configuration.java @@ -12,7 +12,7 @@ package com.segment.publicapi; public class Configuration { - public static final String VERSION = "58.12.0"; + public static final String VERSION = "58.13.0"; private static ApiClient defaultApiClient = new ApiClient(); From 15befe7daccb065ccaaeeda790ef83c6a1115ac8 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Mon, 14 Jul 2025 23:39:44 +0000 Subject: [PATCH 466/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@da76b00b. From 0051ba235dcea2f4a2f0e2a074a584deec277f1a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Jul 2025 04:31:36 +0000 Subject: [PATCH 467/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@da76b00b. From 509c79e538147149e0f66e23604e9f25efdec700 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Jul 2025 04:45:16 +0000 Subject: [PATCH 468/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@a8224757. From ae15cddddbd97f1d68817651ec124c8aff3f1a7a Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Jul 2025 04:55:41 +0000 Subject: [PATCH 469/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@f32af32b. From d5344860b202dfb6a8b3e5e02f2c4d41a3b11b95 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Jul 2025 05:06:22 +0000 Subject: [PATCH 470/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@849fa401. From abd5d0a6269fa7f927a47ae6a641c4fe20830f87 Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Tue, 15 Jul 2025 05:34:54 +0000 Subject: [PATCH 471/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@ba81a719. From c8506e8462cf16ccbcf848fcf889efd1f2f048ea Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Wed, 16 Jul 2025 22:18:33 +0000 Subject: [PATCH 472/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@95454587. --- .../com/segment/publicapi/models/ListAudienceSearchInput.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java b/src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java index 771faa46..b3ac94ee 100644 --- a/src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java +++ b/src/main/java/com/segment/publicapi/models/ListAudienceSearchInput.java @@ -117,7 +117,7 @@ public ListAudienceSearchInput query(String query) { } /** - * Text to match the field value. + * Text to match against the selected field (max 255 characters). * * @return query */ From c30baf9171a9f35947aaf71d65a998f7bcd520ef Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 18 Jul 2025 17:33:44 +0000 Subject: [PATCH 473/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@bb3a755e. --- docs/SpacesApi.md | 4 +- .../com/segment/publicapi/api/SpacesApi.java | 120 ++++++++++++------ 2 files changed, 85 insertions(+), 39 deletions(-) diff --git a/docs/SpacesApi.md b/docs/SpacesApi.md index 16f2528f..dbf4960c 100644 --- a/docs/SpacesApi.md +++ b/docs/SpacesApi.md @@ -17,7 +17,7 @@ All URIs are relative to *https://api.segmentapis.com* Batch Query Messaging Subscriptions for Space -Get Messaging Subscriptions for space. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out to your customer success manager for more information. + <div style=\"background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px; margin: 16px 0; color: #856404; display: flex; align-items: center; gap: 12px; line-height: 1.5;\"> <span style=\"color: #ff9800; font-size: 16px; flex-shrink: 0;\">⚠️</span> <div style=\"line-height: 1.5;\"> <div style=\"font-weight: 600; font-size: 14px; margin-bottom: 6px;\"> Engage Premier features will no longer be available after December 15, 2025. </div> <div style=\"font-size: 13px;\"> This API will be deactivated after this date. </div> </div> </div> Get Messaging Subscriptions for space. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out to your customer success manager for more information. ### Example @@ -238,7 +238,7 @@ public class Example { Replace Messaging Subscriptions in Spaces -Replace Messaging Subscriptions in Spaces. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + <div style=\"background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px; margin: 16px 0; color: #856404; display: flex; align-items: center; gap: 12px; line-height: 1.5;\"> <span style=\"color: #ff9800; font-size: 16px; flex-shrink: 0;\">⚠️</span> <div style=\"line-height: 1.5;\"> <div style=\"font-weight: 600; font-size: 14px; margin-bottom: 6px;\"> Engage Premier features will no longer be available after December 15, 2025. </div> <div style=\"font-size: 13px;\"> This API will be deactivated after this date. </div> </div> </div> Replace Messaging Subscriptions in Spaces. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Spaces feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. ### Example diff --git a/src/main/java/com/segment/publicapi/api/SpacesApi.java b/src/main/java/com/segment/publicapi/api/SpacesApi.java index 32062b17..8e489fb9 100644 --- a/src/main/java/com/segment/publicapi/api/SpacesApi.java +++ b/src/main/java/com/segment/publicapi/api/SpacesApi.java @@ -176,11 +176,18 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( } /** - * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Spaces feature enabled. Please reach out to your customer success manager - * for more information. + * Batch Query Messaging Subscriptions for Space <div style=\"background-color: + * #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px; margin: 16px 0; color: + * #856404; display: flex; align-items: center; gap: 12px; line-height: 1.5;\"> <span + * style=\"color: #ff9800; font-size: 16px; flex-shrink: 0;\">⚠️</span> + * <div style=\"line-height: 1.5;\"> <div style=\"font-weight: + * 600; font-size: 14px; margin-bottom: 6px;\"> Engage Premier features will no longer + * be available after December 15, 2025. </div> <div style=\"font-size: + * 13px;\"> This API will be deactivated after this date. </div> </div> + * </div> Get Messaging Subscriptions for space. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Spaces feature + * enabled. Please reach out to your customer success manager for more information. * * @param spaceId (required) * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) @@ -209,11 +216,18 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( } /** - * Batch Query Messaging Subscriptions for Space Get Messaging Subscriptions for space. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Spaces feature enabled. Please reach out to your customer success manager - * for more information. + * Batch Query Messaging Subscriptions for Space <div style=\"background-color: + * #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px; margin: 16px 0; color: + * #856404; display: flex; align-items: center; gap: 12px; line-height: 1.5;\"> <span + * style=\"color: #ff9800; font-size: 16px; flex-shrink: 0;\">⚠️</span> + * <div style=\"line-height: 1.5;\"> <div style=\"font-weight: + * 600; font-size: 14px; margin-bottom: 6px;\"> Engage Premier features will no longer + * be available after December 15, 2025. </div> <div style=\"font-size: + * 13px;\"> This API will be deactivated after this date. </div> </div> + * </div> Get Messaging Subscriptions for space. • This endpoint is in **Alpha** testing. + * Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Spaces feature + * enabled. Please reach out to your customer success manager for more information. * * @param spaceId (required) * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) @@ -244,11 +258,19 @@ private okhttp3.Call batchQueryMessagingSubscriptionsForSpaceValidateBeforeCall( } /** - * Batch Query Messaging Subscriptions for Space (asynchronously) Get Messaging Subscriptions - * for space. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Spaces feature enabled. Please reach out to your customer success - * manager for more information. + * Batch Query Messaging Subscriptions for Space (asynchronously) <div + * style=\"background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; + * padding: 16px; margin: 16px 0; color: #856404; display: flex; align-items: center; gap: 12px; + * line-height: 1.5;\"> <span style=\"color: #ff9800; font-size: 16px; + * flex-shrink: 0;\">⚠️</span> <div style=\"line-height: + * 1.5;\"> <div style=\"font-weight: 600; font-size: 14px; margin-bottom: + * 6px;\"> Engage Premier features will no longer be available after December 15, 2025. + * </div> <div style=\"font-size: 13px;\"> This API will be + * deactivated after this date. </div> </div> </div> Get Messaging + * Subscriptions for space. • This endpoint is in **Alpha** testing. Please submit any feedback + * by sending an email to friends@segment.com. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Spaces feature enabled. Please reach out to your + * customer success manager for more information. * * @param spaceId (required) * @param batchQueryMessagingSubscriptionsForSpaceAlphaInput (required) @@ -718,13 +740,21 @@ private okhttp3.Call replaceMessagingSubscriptionsInSpacesValidateBeforeCall( } /** - * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Spaces feature enabled. Please reach out to your customer success manager - * for more information. The rate limit for this endpoint is 60 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Replace Messaging Subscriptions in Spaces <div style=\"background-color: + * #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px; margin: 16px 0; color: + * #856404; display: flex; align-items: center; gap: 12px; line-height: 1.5;\"> <span + * style=\"color: #ff9800; font-size: 16px; flex-shrink: 0;\">⚠️</span> + * <div style=\"line-height: 1.5;\"> <div style=\"font-weight: + * 600; font-size: 14px; margin-bottom: 6px;\"> Engage Premier features will no longer + * be available after December 15, 2025. </div> <div style=\"font-size: + * 13px;\"> This API will be deactivated after this date. </div> </div> + * </div> Replace Messaging Subscriptions in Spaces. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Spaces feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -753,13 +783,21 @@ public ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscrip } /** - * Replace Messaging Subscriptions in Spaces Replace Messaging Subscriptions in Spaces. • This - * endpoint is in **Alpha** testing. Please submit any feedback by sending an email to - * friends@segment.com. • In order to successfully call this endpoint, the specified Workspace - * needs to have the Spaces feature enabled. Please reach out to your customer success manager - * for more information. The rate limit for this endpoint is 60 requests per minute, which is - * lower than the default due to access pattern restrictions. Once reached, this endpoint will - * respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate + * Replace Messaging Subscriptions in Spaces <div style=\"background-color: + * #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 16px; margin: 16px 0; color: + * #856404; display: flex; align-items: center; gap: 12px; line-height: 1.5;\"> <span + * style=\"color: #ff9800; font-size: 16px; flex-shrink: 0;\">⚠️</span> + * <div style=\"line-height: 1.5;\"> <div style=\"font-weight: + * 600; font-size: 14px; margin-bottom: 6px;\"> Engage Premier features will no longer + * be available after December 15, 2025. </div> <div style=\"font-size: + * 13px;\"> This API will be deactivated after this date. </div> </div> + * </div> Replace Messaging Subscriptions in Spaces. • This endpoint is in **Alpha** + * testing. Please submit any feedback by sending an email to friends@segment.com. • In order to + * successfully call this endpoint, the specified Workspace needs to have the Spaces feature + * enabled. Please reach out to your customer success manager for more information. The rate + * limit for this endpoint is 60 requests per minute, which is lower than the default due to + * access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP + * status code with headers indicating the limit parameters. See [Rate * Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) @@ -791,14 +829,22 @@ public ReplaceMessagingSubscriptionsInSpaces200Response replaceMessagingSubscrip } /** - * Replace Messaging Subscriptions in Spaces (asynchronously) Replace Messaging Subscriptions in - * Spaces. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an - * email to friends@segment.com. • In order to successfully call this endpoint, the specified - * Workspace needs to have the Spaces feature enabled. Please reach out to your customer success - * manager for more information. The rate limit for this endpoint is 60 requests per minute, - * which is lower than the default due to access pattern restrictions. Once reached, this - * endpoint will respond with the 429 HTTP status code with headers indicating the limit - * parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. + * Replace Messaging Subscriptions in Spaces (asynchronously) <div + * style=\"background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; + * padding: 16px; margin: 16px 0; color: #856404; display: flex; align-items: center; gap: 12px; + * line-height: 1.5;\"> <span style=\"color: #ff9800; font-size: 16px; + * flex-shrink: 0;\">⚠️</span> <div style=\"line-height: + * 1.5;\"> <div style=\"font-weight: 600; font-size: 14px; margin-bottom: + * 6px;\"> Engage Premier features will no longer be available after December 15, 2025. + * </div> <div style=\"font-size: 13px;\"> This API will be + * deactivated after this date. </div> </div> </div> Replace Messaging + * Subscriptions in Spaces. • This endpoint is in **Alpha** testing. Please submit any feedback + * by sending an email to friends@segment.com. • In order to successfully call this endpoint, + * the specified Workspace needs to have the Spaces feature enabled. Please reach out to your + * customer success manager for more information. The rate limit for this endpoint is 60 + * requests per minute, which is lower than the default due to access pattern restrictions. Once + * reached, this endpoint will respond with the 429 HTTP status code with headers indicating the + * limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. * * @param spaceId (required) * @param replaceMessagingSubscriptionsInSpacesAlphaInput (required) From 4d81bc0eefc8b4b04248e0b9ae52c50ab58cc5ee Mon Sep 17 00:00:00 2001 From: APIs and Common Services team Date: Fri, 18 Jul 2025 17:38:10 +0000 Subject: [PATCH 474/474] Automated SDK update This updates the SDK from internal repo commit segmentio/public-api@4647b747.